Method for constructing user task management system and task management system
By using the client SDK in the user task management system to collect and report user behavior data, and perform multi-level checksum frequency control on the server side, the problems of poor data security and incomplete task verification in the existing system are solved, and higher security, stability and user experience are achieved.
Patent Information
- Application Number
- CN202510464785.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-15
- Publication Date
- 2025-05-13
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing user task management system has problems such as poor data security, imperfect task verification, inaccurate frequency control and delayed integral feedback.
The client SDK collects user behavior data and reports it simultaneously on the interface. The server performs preliminary checksum secondary verification, including multi-dimensional request header verification, frequency control and task rule verification, calculates points and sends task completion information asynchronously through the message queue.
It improves the security and authenticity of data, enhances the security and stability of the task system, improves the user experience, and reduces the server load.
Smart Images

Figure CN119988176A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of Internet applications and services, and in particular to a method for constructing a user task management system and a task management system. Background Art
[0002] With the popularity of Internet applications and the widespread use of mobile devices, user behavior data has become an important basis for optimizing products and improving user experience. Many application systems analyze user habits and evaluate task completion by recording user operation behavior data, and formulate corresponding task rules based on this data. However, most existing user task management systems have the following defects: Poor data security: Currently, many systems fail to effectively protect user privacy and data security when transmitting and storing user task data, and are vulnerable to malicious attacks or data leakage risks; Imperfect task verification: Existing task verification mechanisms usually rely on static rules, which are difficult to cope with dynamic changes in user behavior and real-time adjustments to task rules, resulting in low accuracy in judging task completion; Inaccurate frequency control: Existing technologies have deficiencies in preventing malicious requests and anti-brushing mechanisms, especially in high concurrency situations. There is a lack of effective frequency control measures, which can easily lead to system overload or abuse; Untimely point feedback: Although some systems support point calculation after task completion, since point feedback after task completion often relies on synchronous processing, there is feedback delay and poor user experience.
[0003] Therefore, there is an urgent need for a new user task management system based on behavior tracking that can effectively solve the above problems and improve the security, accuracy and user experience of the task system through real-time recording of user behavior data, encrypted transmission, dynamic task verification, precise frequency control and timely integral feedback. Summary of the invention
[0004] The purpose of the present invention is to provide a method for constructing a user task management system and a task management system to solve the problems of poor data security and imperfect task verification in the prior art.
[0005] To achieve one of the above-mentioned purposes, an embodiment of the present invention provides a method for constructing a user task management system, which is characterized by comprising: Collect user behavior data through the client SDK and report it to the interface at the same time, and send the behavior data and interface report data to the server as client request data; Perform preliminary verification on the client request data through the server, and perform secondary verification on the client request data that passes the preliminary verification, including multi-dimensional request header verification, frequency control, and task rule verification in sequence; When the secondary verification passes, the points are calculated and the task completion information is asynchronously sent to the user client through the message queue.
[0006] As a further improvement of an embodiment of the present invention, the method further includes that the “collecting user behavior data through the client SDK and reporting the interface at the same time, and sending the behavior data and the interface reporting data as client request data to the server” includes, The SDK monitors page access events and button click events of the client application and records the corresponding event type, timestamp, page URL and user ID; Encapsulate the collected behavior data and send it to the server in real time or at a fixed time; When the user completes the preset key task operation, the client calls the predefined API interface to report, and the API interface receives data including user ID, task ID, task type and completion time information; After the server receives the data reported by the interface, it performs a preliminary check on the format and integrity.
[0007] As a further improvement of an embodiment of the present invention, the method further includes: the multi-dimensional request header verification includes: Check whether the source address of the client request data is within the allowed range; check the timestamp of the request to ensure that the request is within a reasonable time range; verify the signature in the request header; and check the user authentication information in the request header.
[0008] As a further improvement of an embodiment of the present invention, the method further includes that the frequency control is a zero-code intrusive frequency control based on Redis, specifically including: Use custom annotations to mark the interfaces that require frequency control; The interceptor intercepts the marked interface request, uses the Redis SETNX command and EX option, uses the combination of user ID and task ID as the key, sets a distributed lock, and limits the number of times each user completes the same task within a unit of time.
[0009] As a further improvement of an embodiment of the present invention, the method further includes: the task rule verification includes: By configuring pluggable task modules, each task module is responsible for specific task logic and functions, so that different task modules can be selected and combined to cope with different task rules.
[0010] As a further improvement of an embodiment of the present invention, the method further includes: the task rule verification further includes: Verify the completion of the user's task based on the behavior data, specifically including: Acquire task rule configuration information corresponding to the task type, wherein the configuration information includes a task ID, a task type, and a completion condition, wherein the completion condition is defined based on user behavior data; According to the completion condition, the operation type, timestamp and page URL in the behavior data are analyzed to determine whether the user has completed the task.
[0011] To achieve one of the above-mentioned purposes of the invention, an embodiment of the present invention further provides a user task management system, the system comprising a data collection module, a data verification module and a task feedback module; The data collection module is used to collect user behavior data through the client SDK and report the interface at the same time, and send the behavior data and interface report data as client request data to the server; The data verification module is used to perform preliminary verification on the client request data through the server, and perform secondary verification on the client request data that passes the preliminary verification, including performing multi-dimensional request header verification, frequency control and task rule verification in sequence; The task feedback module is used to calculate the points and asynchronously send task completion information to the user client through the message queue when the secondary verification is passed.
[0012] As a further improvement of an embodiment of the present invention, the system further includes: the data collection module includes a client SDK and an interface reporting module; the client SDK is used to respond to the user performing a task operation on the client application interface, collect the user's behavior data in real time and send the behavior data to the server; the interface reporting module is used to send the task operation information performed by the user on the client application interface to the server through the interface reporting method to form interface reporting data; The data verification module includes a behavior data storage module, a background service interface module, a task rule configuration module and a task rule verification module; the behavior data storage module is used to store the behavior data sent by the client SDK; the background service interface module is used to receive the interface reporting data and subsequent request parameters, and perform multi-dimensional request header verification and zero-code intrusive frequency control based on Redis, as well as unified interface encryption and decryption of request parameters; the task rule configuration module is used to store task rule configuration information, and the task rules exist in the form of pluggable task modules; the task rule verification module is used to obtain task rules from the task rule configuration module, and verify the completion of user tasks based on the behavior data stored in the behavior data storage module; The task feedback module includes a points rule configuration module, a points calculation module and a message queue module; the points rule configuration module is used to store points rules; the points calculation module is used to calculate points according to the points rules provided by the points rule configuration module; the message queue module is used to asynchronously send task completion information to the user client; The data verification module compares and verifies the received interface reporting data with the behavior data stored in the behavior data storage module. Only when the two are consistent at the key behavior points, the task operation is confirmed to be valid and the subsequent request parameters are processed; the task rule verification module performs task verification based on the behavior data stored in the behavior data storage module; if the task verification passes, the points calculation module calculates the points and sends the task completion information through the message queue module.
[0013] To achieve one of the above-mentioned purposes of the invention, an embodiment of the present invention further provides an electronic device, comprising a memory and a processor, characterized in that the memory stores a computer program that can be run on the processor, and when the program is executed on the processor, the steps in the method of constructing a user task management system as described above are implemented.
[0014] To achieve one of the above-mentioned purposes of the invention, an embodiment of the present invention further provides a storage medium, wherein the storage medium stores a computer program, and wherein when the computer program is executed by a processor, the steps in the method for constructing a user task management system as described above are implemented.
[0015] Compared with the prior art, the present invention provides a method for building a user task management system and a task management system, which collects behavioral data through the client SDK and reports the interface at the same time, forming a dual data source, effectively preventing data tampering and cheating, and improving the authenticity and reliability of the data. The server compares and verifies the two types of data, and performs multi-dimensional verification and frequency control to ensure the security and stability of the system. The pluggable task module and flexible configuration system enhance the scalability and flexibility of the system, can adapt to different business needs, and improve user experience. The use of asynchronous message queues improves task processing efficiency and reduces server load. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 It is an overall flow chart of the method for constructing a user task management system described in the present invention.
[0017] Figure 2 It is a schematic diagram of the architecture of the task management system described in the present invention. DETAILED DESCRIPTION
[0018] The present invention will be described in detail below in conjunction with the specific embodiments shown in the accompanying drawings. However, these embodiments do not limit the present invention, and any structural, methodological, or functional changes made by a person skilled in the art based on these embodiments are all within the scope of protection of the present invention.
[0019] The embodiments of the present invention are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.
[0020] In the first embodiment of the present invention, the present invention provides a method for constructing a user task management system, such as Figure 1 As shown, the method includes, S1: Collect user behavior data through the client SDK and report it to the interface at the same time, and send the behavior data and interface report data to the server as client request data; S2: Perform preliminary verification on the client request data through the server, and perform secondary verification on the client request data that passes the preliminary verification, including multi-dimensional request header verification, frequency control, and task rule verification in sequence; S3: When the secondary verification passes, the points are calculated and the task completion information is asynchronously sent to the user client through the message queue.
[0021] In a specific embodiment of the present invention, the user behavior data is collected through the client SDK and the interface is reported at the same time, and the behavior data and the interface report data are sent to the server as the client request data, specifically, The SDK monitors page access events and button click events of the client application and records the corresponding event type, timestamp, page URL and user ID; Encapsulate the collected behavior data and send it to the server in real time or at a fixed time; When the user completes the preset key task operation, the client calls the predefined API interface to report, and the API interface receives data including user ID, task ID, task type and completion time information; After the server receives the data reported by the interface, it performs a preliminary check on the format and integrity.
[0022] It should be noted that the client SDK is integrated into the application and captures the user's operation behavior in real time by monitoring the event mechanism provided by the operating system or application framework. When a user enters or leaves a page, the SDK will record the corresponding event type (such as page_view, page_exit), as well as the URL address of the page, to analyze the user's access path and dwell time. When a user clicks a button or other interactive element on the interface, the SDK will record the corresponding event type (such as button_click), as well as the button identifier or related information, to analyze the user's operation intentions and behavior preferences. The SDK will record the above event information, as well as the timestamp of the event and the user ID who performed the operation, to form the original behavior data.
[0023] It should be noted that the preset critical task operations refer to operations that are critical to the task system. For these critical task operations, the server will predefine the corresponding API interface to receive the client's reported data. After the user completes the critical task operation, the client will immediately call the corresponding API interface and send the data containing the user ID, task ID, task type and completion time information to the server in a specific format (such as JSON). These data are direct proof that the user has completed the task.
[0024] Furthermore, the present invention collects and records the user's operation behavior in real time by adopting the tracking technology. The tracking technology dynamically tracks the user's behavior path in the application by integrating SDK (Software Development Kit). These operation data include but are not limited to the user's stay time on each page, click behavior, sliding trajectory, input content, etc., as well as the basic information of the device used by the user (such as device model, operating system version, screen resolution, etc.). Through this series of tracking and recording, the system can fully capture the user's usage habits and behavior patterns in the application, providing a basis for subsequent data analysis and decision-making. The uploaded data contains multiple key fields to ensure the accuracy and completeness of task tracking. Specifically, the uploaded data includes user ID, task ID, task type, timestamp, business parameters and tracking information. The user ID is used to uniquely identify the user, the task ID and task type facilitate the identification of the specific task performed by the user, and the timestamp records the time of the user's task operation, which is convenient for subsequent task analysis and timeliness verification. The business parameters include specific information related to the task, and the tracking information further supplements the detailed data of the user's operation, including page clicks, page stay time, interaction mode, etc., providing a full picture of the user's behavior. To ensure data security and privacy, all uploaded data will be encrypted before transmission. The encrypted content mainly includes the operation data performed by the user through the Web or mobile terminal, such as user ID, task ID, operation type, timestamp and other information. Encryption ensures that sensitive information will not be maliciously intercepted or tampered with during data transmission, while ensuring the privacy and security of user data.
[0025] Furthermore, the encryption and decryption algorithm used in the interface request body and response body of the present invention is AES (Advanced Encryption Standard). The AES algorithm has the advantages of high strength, high speed and easy implementation, and has been widely used in various fields. The specific implementation steps of the encryption process include key expansion, initial transformation, encryption cycle, and final transformation, and the decryption process is the inverse operation of the encryption process. It uses the same key and inverse transformation steps to restore the plaintext. In addition, the corresponding AES key management of the present invention mainly includes: 1. The key is a randomly generated 128-bit string; 2. The key is stored in a secure storage device, and the keys for development, testing, and production environments are different.
[0026] In a specific embodiment of the present invention, the multi-dimensional request header verification is specifically, Check whether the source address of the client request data is within the allowed range; check the timestamp of the request to ensure that the request is within a reasonable time range; verify the signature in the request header; and check the user authentication information in the request header.
[0027] It should be noted that by using the request header check, the key parameters of the user device ID, user agent, user browser, and request time in the request are partially verified to ensure the legitimacy and security of the request. This function intercepts all interface requests and verifies the key parameters in the request header by implementing the HandlerInterceptor interface in the Spring framework. Specifically, it checks the user device ID (userDeviceId), user agent (userAgent), user browser (userBrowser), and request time (requestTime). If these parameters are empty or the request time is abnormal, the request will be uniformly intercepted, thereby effectively preventing malicious request attacks.
[0028] In a specific embodiment of the present invention, the frequency control is a zero-code intrusive frequency control based on Redis, specifically, Use custom annotations to mark the interfaces that require frequency control; The interceptor intercepts the marked interface request, uses the Redis SETNX command and EX option, uses the combination of user ID and task ID as the key, sets a distributed lock, and limits the number of times each user completes the same task within a unit of time.
[0029] It should be noted that frequency control is implemented through the Redis lock mechanism, and the number of task completions of each user is recorded through queues and counters to prevent malicious requests and limit the frequency of task access for each user. To this end, the present invention designs an interface frequency controller to prevent the interface from being maliciously visited. The controller is implemented using custom annotations, which contain key and duration parameters. After the interface adds this annotation, the interceptor will identify and attempt to obtain the Redis lock (the lock key is the key parameter in the annotation plus the userId, and the expiration time is set to duration). If the lock is successfully acquired, the request is allowed to pass; otherwise, the request will be intercepted. This controller can be enabled by simply adding an annotation to the interface, achieving zero intrusion into the business.
[0030] Preferably, in the generation of a unique lock key, the key parameter in the annotation plus the userId is used to generate a unique lock key, which ensures that even if multiple users access the key at the same time, the frequency can be controlled independently for each user. At the same time, in order to ensure the consistency and reliability of the lock, use the Redis SETNX command to try to acquire the lock. The SETNX command sets the value of the key only when the key does not exist, so it is thread-safe. Set the lock expiration time (duration) through the EX option of the Redis SET command to ensure that the lock does not exist permanently due to server failures, thereby avoiding deadlocks. The interface uses the annotation @FrequentLimit(lockKey = RedisKeyEnum.ENERGY_TASK_STEPEXCHANGE_LOCK), RedisKey enumeration key and distribution lock validity period Duration, such as ENERGY_TASK_STEPEXCHANGE_LOCK("energy:task:stepexchange:lock", Duration.ofMinutes(1)), which means that the lock key is energy:task:stepexchange:lock+userId in the annotation, and the expiration time is set to 1 minute.
[0031] It should be noted that in order to achieve more flexible and intelligent frequency control, the system load and interface access frequency are monitored in real time, and Redis counters (such as INCR, INCRBY commands) are used to record the number of accesses to each interface within a specified time window. When the system load is low, the frequency limit is appropriately relaxed (that is, the expiration time of the redis lock is shortened); when the system load is high, the frequency limit is tightened (that is, the expiration time of the redis lock is extended) to prevent system overload.
[0032] In a specific embodiment of the present invention, task rule verification is specifically, By configuring pluggable task modules, each task module is responsible for specific task logic and functions, so that different task modules can be selected and combined to cope with different task rules.
[0033] Verify the completion of the user's task based on the behavior data, specifically including: Acquire task rule configuration information corresponding to the task type, wherein the configuration information includes a task ID, a task type, and a completion condition, wherein the completion condition is defined based on user behavior data; According to the completion condition, the operation type, timestamp and page URL in the behavior data are analyzed to determine whether the user has completed the task.
[0034] It should be noted that the task rules obtain configuration from Redis according to the event type, and obtain hash type configuration data in the cache according to the business type. The configuration data is used for business rule judgment. When the task rules are modified in the background, the configuration in Redis is refreshed at the same time; In a specific implementation scenario of the present invention, the task rules include: obtaining parameters of task completion time and operation time from user behavior data, and judging whether the task is completed by comparing the date and time. If the task is completed, further checking whether the user exceeds the maximum number of daily task completions. If so, the task submission is rejected.
[0035] It should be noted that the acquisition of task rules is based on event type and business type. The system will extract the corresponding configuration data from the Redis cache according to the event type (such as user login, user click, task completion, etc.). These configuration data are usually stored in hash type, which is convenient for dynamic acquisition according to different business types. For example, the system can configure different rules for different types of tasks (such as check-in tasks, purchase tasks, comment tasks, etc.) to ensure that users meet the task requirements for different task types. When the backend administrator modifies the task rules, the system will refresh the configuration data in the Redis cache in real time to ensure that the new rules can take effect quickly. This mechanism reduces the dependence on the database and improves the efficiency and flexibility of task rule updates. The updated configuration will directly affect the process of task rule verification, ensuring that the system always determines the user task status based on the latest rules.
[0036] It should be noted that the core content of task rules includes two aspects: Task completion verification: The system obtains key information from user behavior data, such as task completion time, operation time, etc., to determine whether the task has been completed. By comparing these time parameters with the predetermined requirements of the task (such as task start time and end time), the system can accurately determine whether the user has completed the task within the specified time. Task number verification: After the task completion time is confirmed, the system will further check whether the user has exceeded the maximum number of task completions per day. This check is implemented by accessing the Redis cache. The system will determine whether the user has reached the maximum task limit on that day based on the user ID and date. If the user exceeds the number limit, the system will reject the submission of the task and return a corresponding error prompt to prevent users from abusing the task submission interface. The purpose of this verification process is to ensure the fairness of the task and the stability of the system, and to prevent users from frequently submitting tasks or cheating in a short period of time. By combining with the Redis cache, the system can quickly and efficiently verify the task rules and update the status.
[0037] It should be noted that the task rules obtain configuration from Redis according to the event type, and obtain the Hash type configuration data in the cache according to the business type eventType. The configuration data is used for business rule judgment. When the task rules are modified in the background, the configuration in Redis is refreshed at the same time, so that the system can quickly respond to business changes or user needs.
[0038] In a specific implementation scenario of the present invention, after the task is completed, the rule-verified task is asynchronously distributed through RocketMQ and the points are calculated, the points are fed back to the user, and the user's total points are updated according to the set point rules.
[0039] It should be noted that RocketMQ's main function is to achieve asynchronous distribution and processing of task logic, effectively reduce server pressure, and improve the system's concurrent processing capabilities. It only needs to ensure that each message is consumed only once, and there is no specific order of consumption requirements. Therefore, the cluster consumption mode is adopted.
[0040] Furthermore, after receiving the asynchronously distributed information, the user behavior data submitted through the tracking technology is queried according to the user ID, task ID, task type, business ID, and execution time. If the behavior data is complete, it means that the user has completed the task and the user's corresponding energy points are increased. Otherwise, it is regarded as cheating data and discarded.
[0041] It should be noted that the integrity and correctness verification of user behavior data is based on the task rules. For example, a task of reading 5 articles for consultation (each article is no less than 15 seconds) needs to include the click-in and exit data of the 5 articles, and the time difference between the two data needs to be greater than 15 seconds. The entry data of the next article must be before the exit data of the previous article. If the user behavior does not meet the above requirements, the task will be judged as incomplete.
[0042] In the second embodiment of the present invention, the present invention provides a user task management system, such as Figure 2 Said system comprises a data acquisition module 100, a data verification module 200 and a task feedback module 300; The data collection module 100 is used to collect user behavior data through the client SDK and report the interface at the same time, and send the behavior data and interface report data as client request data to the server; The data verification module 200 is used to perform preliminary verification on the client request data through the server, and perform secondary verification on the client request data that passes the preliminary verification, including performing multi-dimensional request header verification, frequency control and task rule verification in sequence; The task feedback module 300 is used to calculate the points and asynchronously send task completion information to the user client through the message queue when the secondary verification is passed.
[0043] In a specific embodiment of the present invention, The data collection module 100 includes a client SDK 101 and an interface reporting module 102; the client SDK 101 is used to respond to the user performing task operations on the client application interface, collect the user's behavior data in real time and send the behavior data to the server; the interface reporting module 102 is used to send the task operation information performed by the user on the client application interface to the server through the interface reporting method to form interface reporting data; The data verification module 200 includes a behavior data storage module 201, a background service interface module 202, a task rule configuration module 203 and a task rule verification module 204; the behavior data storage module 201 is used to store the behavior data sent by the client SDK101; the background service interface module 202 is used to receive the interface reporting data and subsequent request parameters, and perform multi-dimensional request header verification and zero-code intrusive frequency control based on Redis, as well as unified interface encryption and decryption of request parameters; the task rule configuration module 203 is used to store task rule configuration information, and the task rules exist in the form of pluggable task modules; the task rule verification module 204 is used to obtain task rules from the task rule configuration module, and verify the completion of user tasks based on the behavior data stored in the behavior data storage module; The task feedback module 300 includes a points rule configuration module 301, a points calculation module 302 and a message queue module 303; the points rule configuration module 301 is used to store points rules; the points calculation module 302 is used to calculate points according to the points rules provided by the points rule configuration module 301; the message queue module 303 is used to asynchronously send task completion information to the user client; The data verification module 200 compares and verifies the received interface reporting data with the behavior data stored in the behavior data storage module 201. Only when the two are consistent at the key behavior points, the task operation is confirmed to be valid and the subsequent request parameters are processed; the task rule verification module 204 performs task verification based on the behavior data stored in the behavior data storage module 201; if the task verification passes, the points calculation module 302 calculates the points and sends the task completion information through the message queue module 303.
[0044] In embodiment three of the present invention, the present invention provides an electronic device, comprising a memory and a processor, characterized in that the memory stores a computer program that can be run on the processor, and when the program is executed on the processor, the steps in the method of constructing a user task management system as described above are implemented.
[0045] In a fourth embodiment of the present invention, the present invention provides a storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps in the method for constructing a user task management system as described above.
[0046] In summary, the present invention provides a method for building a user task management system and a task management system, which collects behavioral data through the client SDK and reports the interface at the same time, forming a dual data source, effectively preventing data tampering and cheating, and improving the authenticity and reliability of the data. The server compares and verifies the two types of data, and performs multi-dimensional verification and frequency control to ensure the security and stability of the system. The pluggable task module and flexible configuration system enhance the scalability and flexibility of the system, can adapt to different business needs, and improve user experience. The use of asynchronous message queues improves task processing efficiency and reduces server load.
[0047] It should be understood that although this specification is described according to implementation modes, not every implementation mode contains only one independent technical solution. This description of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each implementation mode may also be appropriately combined to form other implementation modes that can be understood by those skilled in the art.
[0048] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the modules described above can refer to the corresponding process in the aforementioned method implementation, and will not be repeated here.
[0049] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present implementation scheme.
[0050] In addition, each functional module in each embodiment of the present application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or in the form of hardware plus software functional modules.
[0051] The above-mentioned integrated module implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, including a number of instructions for a computer system (which can be a personal computer, a server, or a network system, etc.) or a processor to perform some steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program codes.
[0052] Finally, it should be noted that the above implementation modes are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned implementation modes, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned implementation modes, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various implementation modes of the present application.
Claims
1. A method for constructing a user task management system, characterized in that: include, Collect user behavior data through the client SDK and report it to the interface at the same time, and send the behavior data and interface report data to the server as client request data; Perform preliminary verification on the client request data through the server, and perform secondary verification on the client request data that passes the preliminary verification, including multi-dimensional request header verification, frequency control, and task rule verification in sequence; When the secondary verification passes, the points are calculated and the task completion information is asynchronously sent to the user client through the message queue.
2. The method for constructing a user task management system according to claim 1, characterized in that: The "collecting user behavior data through the client SDK and reporting the interface at the same time, and sending the behavior data and interface reporting data as client request data to the server" includes: The SDK monitors page access events and button click events of the client application and records the corresponding event type, timestamp, page URL and user ID; Encapsulate the collected behavior data and send it to the server in real time or at a fixed time; When the user completes the preset key task operation, the client calls the predefined API interface to report, and the API interface receives data including user ID, task ID, task type and completion time information; After the server receives the data reported by the interface, it performs a preliminary check on the format and integrity.
3. The method for constructing a user task management system according to claim 2, characterized in that: The multi-dimensional request header verification includes: Check whether the source address of the client request data is within the permitted range; Check the timestamp of the request to ensure that the request is within a reasonable time frame; Verify the signature in the request header; And check the user authentication information in the request header.
4. The method for constructing a user task management system according to claim 3, characterized in that: The frequency control is a zero-code intrusive frequency control based on Redis, specifically including: Use custom annotations to mark the interfaces that require frequency control; The interceptor intercepts the marked interface request, uses the Redis SETNX command and EX option, uses the combination of user ID and task ID as the key, sets a distributed lock, and limits the number of times each user completes the same task within a unit of time.
5. The method for constructing a user task management system according to claim 4, characterized in that: The task rule verification includes: By configuring pluggable task modules, each task module is responsible for specific task logic and functions, so that different task modules can be selected and combined to cope with different task rules.
6. The method for constructing a user task management system according to claim 5, characterized in that: The task rule verification also includes: Verify the completion of the user's task based on the behavior data, specifically including: Acquire task rule configuration information corresponding to the task type, wherein the configuration information includes a task ID, a task type, and a completion condition, wherein the completion condition is defined based on user behavior data; According to the completion condition, the operation type, timestamp and page URL in the behavior data are analyzed to determine whether the user has completed the task.
7. A user task management system, characterized in that: It includes data collection module, data verification module and task feedback module; The data collection module is used to collect user behavior data through the client SDK and report the interface at the same time, and send the behavior data and interface report data as client request data to the server; The data verification module is used to perform preliminary verification on the client request data through the server, and perform secondary verification on the client request data that passes the preliminary verification, including performing multi-dimensional request header verification, frequency control and task rule verification in sequence; The task feedback module is used to calculate the points and asynchronously send task completion information to the user client through the message queue when the secondary verification is passed.
8. The user task management system according to claim 7, characterized in that: Also includes, The data collection module client includes an SDK and an interface reporting module; the client SDK is used to respond to the user performing task operations on the client application interface, collect the user's behavior data in real time and send the behavior data to the server; The interface reporting module is used to send the task operation information performed by the user in the client application interface to the server through the interface reporting method to form interface reporting data; The data verification module includes a behavior data storage module, a background service interface module, a task rule configuration module and a task rule verification module; the behavior data storage module is used to store the behavior data sent by the client SDK; The background service interface module is used to receive the interface reporting data and subsequent request parameters, perform multi-dimensional request header verification and zero-code intrusive frequency control based on Redis, and perform unified interface encryption and decryption on the request parameters; The task rule configuration module is used to store task rule configuration information, and the task rule exists in the form of a pluggable task module; the task rule verification module is used to obtain the task rule from the task rule configuration module, and verify the completion of the user task based on the behavior data stored in the behavior data storage module; The task feedback module includes a points rule configuration module, a points calculation module and a message queue module; the points rule configuration module is used to store points rules; the points calculation module is used to calculate points according to the points rules provided by the points rule configuration module; the message queue module is used to asynchronously send task completion information to the user client; The data verification module compares and verifies the received interface reporting data with the behavior data stored in the behavior data storage module. Only when the two are consistent at the key behavior points, the task operation is confirmed to be valid and the subsequent request parameters are processed; The task rule verification module performs task verification based on the behavior data stored in the behavior data storage module; If the task verification is passed, the points are calculated by the points calculation module, and task completion information is sent through the message queue module.
9. An electronic device, comprising a memory and a processor, characterized in that: The memory stores a computer program that can be run on the processor, and when the program is executed on the processor, the steps in the method for constructing a user task management system as described in any one of claims 1 to 6 are implemented.
10. A storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps in the method for constructing a user task management system as claimed in any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Verification method and system for identification codes, and shared bicycle
CN107609449A
Method for quickly constructing service calling and middle-platform API gateway
CN112367321A
Monitoring and verification method and system for data security multi-party cooperative computing
CN115065611A
Method for limiting interface access times through custom annotation
CN119089469A
Load balancing agent
US20220303337A1