Author: Xianyu Technology – Qi Wu
Gameplay Platform Background
In Xianyu, we provide users with Xianyu Red envelopes, Alipay red envelopes, postal coupons, bao cards, collectively referred to as user rights and interests. It is an important strategy for the operation of Xianyu users, showing its important value in drawing new, retaining, activating, fission and other aspects. The platform to manage the rights and interests inside Ali is Lafite, which provides both probability lottery and prize claim capabilities externally. Each business user customized their own business side play according to their own demands and combined with lafite’s ability, and based on this, established the idle fish rights play platform — Doraemon.
Pain points analysis
The early marketing activities of Xianyu have two important characteristics: low frequency, artificial, xianyu is a SECOND-HAND trading platform of C2C, the marketing activities themselves are not many, no more than 10 times a year. The gameplay of each marketing activity is a simple lottery, which gives prizes to the winning users. The operation students need to contact one by one and then distribute rights and interests. With business development, the group has equity related platforms, including WLP, MRP, Lafite and finally the unified equity platform Lafite 2. The purpose of equity platform is to converge the rights and interests within the group. It is simply understood that the platform does not produce rights and interests, but is only the porter of rights and interests. With the enrichment of business, the platform also has more abundant rights and interests, including Alipay red envelope, Taobao single product coupons, Taobao store coupons, Taobao Full reduction coupons, Xianyu red envelope, postal coupons, etc. Idle fish also pay more attention to business play has produced a big turntable, turn the brand, nine squares and other play. With the development of idle fish business, there are more demands on the gameplay side, resulting in more complex gameplay such as hundred-coin Raiders, PK matches, leaderboards, check-in and receiving coins. At the same time, more and more problems have been exposed.Problems encountered on the development side: a. The development cycle is long, and the activity business layer is not complicated, but the system security, stability and data consistency should be considered in every activity. B. It is difficult to find and locate problems, and the lack of monitoring and account checking system makes it difficult to find problems in time during activities, which is often realized later. Problems encountered on the operation side: a. The configuration process is complex, and the configuration of the front-end page and activity rules are scattered in multiple systems. B. High communication costs and different concepts on the development side. Each operation needs to accept a set of concepts for different development. C. The effect of activities cannot be paid attention to in real time, and the effect data are usually run after activities. Problems encountered on the test side: a. The cost of testing is high. Multiple accounts of test case conditions need to be constructed during the test to test different situations. B. The feedback link is long, and there is a problem in the black box test, but it is not clear what the specific problem is, and how to maintain the site recurrence. For the development of the most difficult thing to accept is repetition, if I have another chance, I must build a gameplay platform, so idle fish gameplay platform. According to the problems summarized above, three goals were set for the first phase of gameplay platform: 1. To precipitate reusable capabilities, reject repeated development, and precipitate reusable capabilities 2. It is easy to operate, provides a configurable platform for operation, and can complete the activity configuration online by itself. Quickly find, locate, feedback problems, provide testing tools for testing
Gameplay Platform 1.0
A platform how to also want to have A name, everyone began to hope can to solve the problems in the idle fish play, so A black soil flavor name – ollie, wanted to mean to play behind the platform mainly is chasing, doraemon’s pocket inside what all can change, and game platform just fit, so back to, doraemon.
Business architecture
Doraemon’s business goal is to converge all equity related gameplay in Idle Fish, so many of the gameplay is based on existing systems. As shown in the figure below, Doraemon’s entire business architecture is mainly divided into three levels: the bottom layer is external dependence, the middle layer is system core, and the top layer is business.External system dependencies: Doraemon combines business rules with these existing system capabilities to develop A variety of business gameplay. Among them, mission system is an important dependence of gameplay, which provides the ability to arrange tasks such as father-son tasks, combined tasks and ordered tasks. The crowd system is an important dependence of user authentication, which provides the ability of dynamically adding, deleting and authenticating the crowd. User behavior system is a system for collecting and feedback user behavior, which provides the ability of behavior scheduling and real-time feedback. Personalized recommendation system is a personalized rights and interests system for different users. Reconciliation system to ensure the consistency of system data; User notification system provides real-time touch notification capability. System core layer: doraemon lafite with activity, the concept of play, and business rules for encapsulation, operating only need through simple configuration can complete activity configuration, doraemon in activities at the same time provides the log collection, traffic monitoring, data reconciliation, data report of the safe operation of the basic ability to safeguard the stability of the activity. Business layer: The front end provides a variety of gameplay components. Operation students can directly choose the gameplay components that can be used after configuring activities to present different gameplay to users.
The solution
Operation configuration platform
The configuration platform is mainly targeted at business operation students, and the goal is that business operation can be launched without relying on development. In Doraemon, marketing is called an activity at A time, and there are various business rules in an activity, and each business rule corresponds to one Lafite interest. For example: The operation conducts a marketing activity to issue one kind of rights and interests to male users of Idle fish, one kind of rights and interests to female users, and one kind of rights and interests to users of unknown gender. Then, this activity will correspond to three business rules, namely male, female and unknown gender. When a user extracts rights and interests, he first judges his gender and then obtains rights and interests under the corresponding rules. When a user complies with multiple rules, rule decisions are used to determine which rules the user acquires the rights under.There are two kinds of business decision: one is rule decision based on weight, the other is algorithmic decision; The purpose of algorithmic decision is to maximize equity efficiency.
Develop basic links
The basic link of marketing activities is mainly concerned with traffic and security. Traffic is a test of the performance of the whole system, while security is a test of the business rules of the whole activity. Flow contains normal flow and illegal flow, normal flow need to focus on activities began the instantaneous flow rate and peak flow, completes the system capacity and current limiting assurance activities during the server will not be hung, illegal traffic flow need to pay attention to the similar crawler machine, need to intercept before entering the business layer, prevent interfere with the normal users. The security side includes business logic and non-business logic. Business logic includes limiting the number of winning times within a period, business rules and conditions, etc. The non-business logic needs to focus on illegal users of black ash industry, including the same user account, the same device account, the same IP account, etc., to prevent the active rights and interests from being brushed. Solutions are as follows:Bully check is a traffic cleaning tool provided by the group, including DDoS attack defense, CC attack defense, Web attack defense, and batch machine behavior defense. The traffic limiting check access is provided by the group. The single-node traffic and the total traffic can be set. If the traffic exceeds the threshold, the access is denied. Security verification access to the RMB system of the Group, prevention and control of the same user account, the same device, and the same IP account; Single-user concurrent verification uses a global distributed lock to ensure that only one request from an account can enter the service logic layer, preventing concurrent problems with users. Activity code verification, in which the activity code is generated according to the activity, time and user three dimensions, using Base64 simple encryption and decoding verification; Real-time reconciliation mainly focuses on business rules, and verifies rules for every winning user in real time to prevent code loopholes. Hourly offline reconciliation mainly focuses on the order of magnitude to prevent the overdelivery of prizes caused by configuration errors on the operation side.
Testing tools
The testing tool is oriented to test students, and it needs to solve two problems: first, it can quickly construct users who meet the test cases; second, it can quickly find, locate and feedback problems. Which test cases are based on operation set of marketing rules, if the test users to add or flexible to skip validation rules can meet the test students for the invitation, this article adopts the method of the white list to solve structural user test cases, when the user need to add validation rules to check the white list, when the user need to jump over the white list when calibration is submitted, If no whitelist is added, the normal service verification logic is used. Found the problem solution in this paper is through playing abnormal log and log monitoring system in service, positioning problem when log dozen more fine more quickly locate problems, but at the same time log to fine on behalf of the log is playing more and more, the system overhead is very big, so how to choice is a key problem, this article on the solution to this problem, Two sets of log schemes, detailed log and rough log, are produced. First, the whole lottery process is divided into the following steps, as shown in the figure below:For normal online users, only the final success log and exception log are printed. In this case, the rough log is used. For test users, the detailed log is used for each step. The flow chart of the final solution is as follows:First before call draw interface, test users can join white list, by means of sweep code in the call draw interface rules in the process of calibration, the will to white list check of the user, white list whether user is a complex object contains the check each rule, after checking the final call draw interface. At the same time, Spring AOP ability is used to print logs at each stage of calling lottery. When printing, check whether it is a whitelist user first. If it is a whitelist user, print the detailed entry and exit parameters of each step. To improve whitelist performance, whitelisted user information is stored in memory, and whitelist configurations on multiple machines are synchronized using Diamond(external ZooKeeper also has this capability).
Effect of the business
The above briefly introduces the business architecture of the whole system and the solutions to some major problems. The following mainly shows several kinds of gameplay adopted by Doraemon platform:
Task play | PK game | The cumulative play |
---|---|---|
The user can reach the specific task page through the task list page and get the corresponding reward after completing the task. In the scene of idle Fish coin, this gameplay mode is used to obtain idle fish coin by completing the task | Operation to create two teams, so that users support their respective teams, which team wins, which team will get the corresponding reward, in gundam run activities is used in this way | The user accumulates the number of lottery times through the task, and then carries on the lottery, which is used in the quadratic activity |
Gameplay platforms continue to be explored
Through sorting out the problems encountered in daily marketing activities, this paper puts forward corresponding solutions to these problems, and then forms a business-side gameplay platform. Limited by space, this paper mainly introduces the overall architecture of the system and several key problems to be solved, and separately shares the gameplay, implementation details of testing tools and security system precipitated in the system. In the later planning, it is expected to decouple gameplay from gameplay platform and output it as a gameplay ability.