Task processing method and device, electronic equipment and storage medium
By determining the return path of the pending subtask in the task processing message and allocating it to multiple service libraries, the hot issues of the business library caused by frequent return requests by users are solved, and the task processing efficiency is improved.
Patent Information
- Application Number
- CN202411215285.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2024-12-27
AI Technical Summary
In the prior art, when a user frequently sends a return request, the return path of the same user is stored in the same service library, resulting in excessive pressure on the service library, hot issues arise, and impacting the return processing efficiency.
When a task processing message is detected, the task value attribute value is returned to the target processing account by determining the first task association information of the pending sub-task, and determining the task return path based on the information and at least two pre-generated business libraries, and returning the task value attribute value to the target processing account , avoid the return paths of all pending subtasks being stored in the same business library.
It reduces the pressure to access the business database, avoids hot issues in the business database, and improves task processing efficiency.
Smart Images

Figure CN119205253A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of computer technology, and in particular to a task processing method, device, electronic device and storage medium. Background Art
[0002] With the rapid development of Internet technology, Internet consumption platforms have been widely used in various industries, and applying for returns for generated consumption orders has also become a routine operation on Internet consumption platforms.
[0003] In the prior art, for the rollback task corresponding to the rollback request sent by each user, the rollback path of the rollback task is determined from the business library by accessing the business library corresponding to the user, so as to complete the rollback operation of the rollback task based on the rollback path.
[0004] However, in the process of implementing the present invention, it was found that the prior art has at least the following technical problems: a rollback task may include at least one rollback subtask, and since the rollback path of each subtask of the same user is stored in the same business library; therefore, when the same user frequently sends rollback requests multiple times, it causes pressure on the business library storing the rollback path corresponding to the user, resulting in a business library hotspot problem, affecting the efficiency of the rollback processing. Summary of the invention
[0005] The embodiments of the present invention provide a task processing method, device, electronic device and storage medium to achieve the purpose of reducing the access pressure on the business library, avoiding the business library hot spot problem, and facilitating improving the task processing efficiency.
[0006] According to one aspect of the present invention, there is provided a task processing method, comprising:
[0007] In the case of detecting a task processing message, determining first task association information of at least one to-be-processed subtask associated with the task processing message; wherein the attribution users corresponding to the at least one to-be-processed subtask are different;
[0008] For the at least one to-be-processed subtask, determining a task return path for the to-be-processed subtask according to the first task association information of the to-be-processed subtask and at least two pre-generated business libraries, so as to return the task value attribute value corresponding to the to-be-processed subtask to the target processing account based on the task return path;
[0009] The business library is used to store the return paths of all tasks associated with the user.
[0010] According to another aspect of the present invention, there is provided a task processing device, the device comprising:
[0011] A first task association information determination module is used to determine, when a task processing message is detected, first task association information of at least one to-be-processed subtask associated with the task processing message; wherein the attribution users corresponding to the at least one to-be-processed subtask are different;
[0012] A task return path determination module is used to determine, for the at least one to-be-processed subtask, the task return path of the to-be-processed subtask according to the first task association information of the to-be-processed subtask and at least two pre-generated business libraries, so as to return the task value attribute value corresponding to the to-be-processed subtask to the target processing account based on the task return path;
[0013] The business library is used to store the task return paths of all tasks associated with the user.
[0014] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0015] at least one processor; and
[0016] a memory communicatively connected to the at least one processor; wherein,
[0017] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the task processing method described in any embodiment of the present invention.
[0018] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the task processing method described in any embodiment of the present invention when executed.
[0019] The technical solution of the embodiment of the present invention, when a task processing message is detected, determines the first task association information of at least one pending subtask associated with the task processing message; wherein, there are differences in the attribution users corresponding to at least one pending subtask; for at least one pending subtask, the task return path of the pending subtask is determined based on the first task association information of the pending subtask and at least two pre-generated business libraries, so as to return the task value attribute value corresponding to the pending subtask to the target processing account based on the task return path; wherein, the business library is used to store the return paths of all tasks associated with the user. Since there are differences in the attribution users of at least one pending subtask corresponding to the task processing message, when the number of pending subtasks is multiple, the possibility of storing the task return paths of all pending subtasks in the same business library is small; therefore, when determining each task return path, the possibility of accessing the same business library is small, which is conducive to reducing the access pressure on the business library, avoiding the occurrence of business library hot spots, and improving the task processing efficiency.
[0020] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0022] Figure 1 is a flowchart of a task processing method provided according to an embodiment of the present invention;
[0023] Figure 2 is a flowchart of another task processing method provided according to an embodiment of the present invention;
[0024] Figure 3 is a schematic diagram of a task processing system provided according to an embodiment of the present invention;
[0025] Figure 4 is a schematic diagram of the state machine operation according to an embodiment of the present invention;
[0026] Figure 5 is a structural schematic diagram of a task processing device provided according to an embodiment of the present invention;
[0027] Figure 6It is a structural schematic diagram of an electronic device for implementing the task processing method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0028] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "etc." and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0030] It should be noted that the collection, collection, updating, analysis, processing, use, transmission, storage and other aspects of user personal information involved in the technical solution of this disclosure are in compliance with the provisions of relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. Necessary measures are taken for user personal information to prevent illegal access to user personal information data and maintain the security of user personal information and network security.
[0031] Figure 1 This is a flowchart of a task processing method provided according to an embodiment of the present invention. This embodiment is applicable to the case where a task value attribute value corresponding to a pending subtask is returned through a business library. The method can be executed by a task processing device, which can be implemented in the form of hardware and / or software.
[0032] like Figure 1 As shown, the method of this embodiment may specifically include:
[0033] S110. When a task processing message is detected, determine first task association information of at least one to-be-processed subtask associated with the task processing message.
[0034] There is a difference in the users corresponding to at least one of the to-be-processed subtasks. The task processing message corresponds to at least one of the to-be-processed subtasks and is used to indicate that the at least one to-be-processed subtask is to be returned.
[0035] In a specific implementation, it is possible to periodically detect whether there is a task processing message. In the case where the existence of a task processing message is detected, the first task association information of at least one pending subtask that needs to be returned as indicated by the task processing message can be determined by parsing the task processing message, indicating that the pending subtask that needs to be returned is the pending subtask associated with the task processing message. Determine the first task association information of each pending subtask. Among them, the first task association information may be at least one of the task identifier, task name and target user identifier of the pending subtask corresponding to the pending subtask. Exemplarily, in the field of e-commerce, each pending subtask may be a return task for an order. The first task association information may be at least one of the order number, order name and ordering user of the order to be returned. In the field of logistics, the first task association information of each pending subtask may be the transport cargo number.
[0036] S120. For at least one subtask to be processed, determine the task return path of the subtask to be processed according to the first task association information of the subtask to be processed and at least two pre-generated business libraries, so as to return the task value attribute value corresponding to the subtask to be processed to the target processing account based on the task return path.
[0037] The business library is used to store the return path of all tasks associated with the user. The task return path is the path for providing the task value attribute value corresponding to the subtask to be processed. The target processing account is the account for providing the task value attribute value corresponding to the task return path.
[0038] In this embodiment, the first task association information includes the target user identifier and the task identifier corresponding to the subtask to be processed. Exemplarily, the target user identifier includes the target user number, and the task identifier includes the task number. The method of determining the task return path may include: determining the total number of business libraries in the business library, performing an integer operation or a modulo operation on the total number of business libraries by the target user number, using the integer operation result or the modulo operation result as the target business library identifier, and determining the return path corresponding to the task identifier in the target business library corresponding to the target business library identifier as the task return path.
[0039] In a specific implementation, based on the first task association information of the subtask to be processed and at least two pre-generated business libraries, the method for determining the task return path of the subtask to be processed can also be: based on the correspondence between the pre-stored business library and the user, determine the target business library corresponding to the target user identifier; based on the task identifier, determine the task return path in the target business library.
[0040] It should be noted that the corresponding relationship between the business library and the user can be pre-built, that is, the business library that provides business services to the user can be designated. Each business library is used to store the return path of all tasks associated with the user having the corresponding relationship.
[0041] In a specific implementation, for each subtask to be processed, based on the pre-stored correspondence between the business library and the user, the business library corresponding to the target user identifier is determined as the target business library for storing the task return path of the subtask to be processed. Since the target business library may store return paths for multiple tasks, in order to accurately determine the task return path corresponding to the subtask to be processed, the return path corresponding to the task identifier of the subtask to be processed can be determined in the target business library as the task return path.
[0042] For example, in the e-commerce field, the task identifier may be the order number of the order to be returned, and the target user identifier may be the ordering user identifier of the order to be returned. When determining the task return path, first determine the business library for storing the business data of the ordering user as the target business library, and then determine the return path corresponding to the order number in the target business library as the task return path.
[0043] In this embodiment, the target business library is quickly determined from multiple task libraries through the target user identifier, and the task return path is quickly determined based on the task identifier from multiple return paths stored in the target business library, which is beneficial to improving the accuracy and efficiency of determining the task return path.
[0044] Furthermore, each business library contains at least one business table, and each business table is used to store the return path of the task. In a specific implementation, the target business table for storing the task return path of the subtask to be processed can be determined in the target business library through the task identifier. Specifically, the task identifier can be a number; the method for determining the target business table can be: based on the total number of business tables included in the target business library and the task identifier, the target business table is determined. Exemplarily, the task number corresponding to the subtask to be processed is modulo or rounded to the total number of tables, and the business table whose table number is consistent with the numerical value corresponding to the modulo result or the rounding result is determined as the target business table.
[0045] In this embodiment, after the task return path is determined, the task value attribute value corresponding to the subtask to be processed can be returned according to the task return path, so that the task value attribute value is returned to the target processing account corresponding to the task return path.
[0046] It should be noted that each pending subtask may correspond to multiple task return paths. In the case where a pending subtask corresponds to multiple task return paths, the sub-attribute value corresponding to each task return path may be determined in the target business library; and the task value attribute value corresponding to the pending subtask may be formed through each sub-attribute value. When performing a return operation on the task value attribute value, the corresponding sub-attribute value may be returned to the corresponding target processing account according to each task return path; after all sub-attribute values have completed the return operation, the return operation on the task value attribute value of the pending subtask is completed. Exemplarily, the pending subtask may be an order to be returned. When the value attribute value of the order to be returned is provided by multiple target processing accounts, it is necessary to determine the provided path corresponding to each target processing account as the task return path, and return the sub-attribute value to the corresponding target processing account according to each task return path, thereby completing the return operation of the order to be returned.
[0047] In this embodiment, after returning the task value attribute value corresponding to the subtask to be processed to the target processing account, it also includes: generating task completion information, and storing the task completion information in the cache database, so that when a repeated subtask corresponding to the subtask to be processed is received, the processing status of the repeated subtask is determined by accessing the cache database.
[0048] The task completion information is used to indicate that the task value attribute value corresponding to the pending subtask has been returned. The cache database may be a Redis (Remote Dictionary Server) database. A Redis cluster may be provided in advance to store the task completion information of each pending subtask.
[0049] In a specific implementation, for the pending subtasks that have returned the task value attribute value to the target processing account, task completion information corresponding to the pending subtask is generated and stored in the cache database. When a new task processing message is subsequently received, the task associated with the new task processing message is determined. If the associated task contains a repeated subtask that is repeated with the pending subtask, in order to avoid repeated returns, the cache database can be accessed through the repeated task association information of the repeated subtask to determine whether the task completion information corresponding to the repeated task association information exists in the cache database. If so, it means that the processing status of the repeated subtask is completed, and the task completion information is fed back to the user end to which the repeated subtask belongs. If not, it means that the processing status of the repeated subtask is not completed, and a return operation can be performed on the repeated subtask.
[0050] Specifically, the task completion information can be stored in a key-value pair. When the task completion information is fed back to the user end, the value in the key-value pair corresponding to the task completion information can be deserialized, so that the result obtained after deserialization is fed back to the user end. It should be noted that the repeated task association information is consistent with the first task association information of the to-be-processed subtask corresponding to the repeated subtask.
[0051] Furthermore, after the task completion information is stored in the cache database, if a processing status request for obtaining the processing status of the task is received, it is determined whether there is task completion information corresponding to the processing status request in the cache database. If there is, the task completion information can be fed back to the user end that sent the processing status request; if not, task incomplete information is generated and fed back to the user end that sent the processing status request.
[0052] This embodiment stores task completion information in a cache database, so that when a repeated subtask is received, it can determine whether the repeated subtask needs to be processed, thereby avoiding the problem of repeated return operations on the same task, which is beneficial to improving the correctness of the return operation and avoiding resource loss.
[0053] The technical solution of the embodiment of the present invention, when a task processing message is detected, determines the first task association information of at least one pending subtask associated with the task processing message; wherein, there are differences in the attribution users corresponding to at least one pending subtask; for at least one pending subtask, the task return path of the pending subtask is determined based on the first task association information of the pending subtask and at least two pre-generated business libraries, so as to return the task value attribute value corresponding to the pending subtask to the target processing account based on the task return path; wherein, the business library is used to store the return paths of all tasks associated with the user. Since there are differences in the attribution users of at least one pending subtask corresponding to the task processing message, when the number of pending subtasks is multiple, the possibility of storing the task return paths of all pending subtasks in the same business library is small; therefore, when determining each task return path, the possibility of accessing the same business library is small, which is conducive to reducing the access pressure on the business library, avoiding the occurrence of business library hot spots, and improving the task processing efficiency.
[0054] Figure 2 It is a flowchart of another task processing method provided according to an embodiment of the present invention. Based on the above embodiment, this embodiment also includes: receiving a return request sent by the user end, determining the second task association information of the return task corresponding to the return request; based on the second task association information, splitting the return task to obtain at least one return subtask; and generating a task processing message based on the return subtask. Among them, the explanation of the terms that are the same or corresponding to the above embodiments will not be repeated here. Figure 2 As shown, the method includes:
[0055] S210, receiving a return request sent by the user terminal, determining second task association information of the return task corresponding to the return request; based on the second task association information, splitting the return task into at least one return subtask.
[0056] The return request is a request to return a task.
[0057] It should be noted that each return request corresponds to a return task, and each return task may contain at least one return subtask. For example, in the field of e-commerce, a return task may be a task for returning completed orders in a historical time period. Each return subtask may correspond to a completed order, and through a return request, a return operation may be requested for at least one completed order.
[0058] In this embodiment, the return request may include the second task association information of the return task that needs to be returned; after receiving the return request sent by the user end, the return request may be parsed to determine the second task association information of the return task. The second task association information includes at least one of the task identifier of the corresponding return task in the return task, the request value attribute value, the corresponding order information, and the belonging user.
[0059] Optionally, determining the second task association information of the return task corresponding to the return request includes: determining the second task association information of the return task corresponding to the return request when there is a token in a pre-created token bucket.
[0060] The token is stored in the token bucket at a preset frequency, and a token is taken out from the token bucket each time the second task association information is determined.
[0061] It should be noted that before receiving the return request, in order to intercept risky operations such as malicious bursts, the burst traffic requests can be shaped to average the rate of processing requests. Specifically, a token bucket can be created in advance, and the frequency of depositing tokens into the token bucket can be set. By controlling the tokens to be deposited into the token bucket at a preset frequency, the rate of processing requests can be averaged. For example, a token bucket with a capacity of 400 is created in advance, and the preset frequency of depositing tokens into the token bucket is set to 5 milliseconds.
[0062] When a return request is received, it can be determined whether there is a token in the pre-created token bucket. If there is a token, it means that the current processing request rate has not reached the allowed processing upper limit, then the received return request can be processed to determine the second task association information corresponding to the return task. And, after determining the second association information, a stored token is taken out of the token bucket, so that the number of tokens stored in the token bucket is reduced by one. If there is no token, it means that the current processing request rate has reached the allowed processing upper limit, then the processing of the return request is stopped, and a flow limiting and downgrade prompt is performed; if a busy prompt information can be generated, the busy prompt information is fed back to the user end that sent the return request.
[0063] It should be noted that the capacity of each token bucket can be determined according to the actual demand for the rate of processing requests in the application scenario. For example, if the actual demand rate is 2.5 milliseconds to process one request, the number of requests that can be processed by a server per second is 1000 / 2.5=400, and a token bucket with a bucket capacity of 400 can be created.
[0064] In this embodiment, a token bucket is created in advance, and when there are tokens in the token bucket, the return request is further processed, which helps to control the request processing rate to not exceed the processing upper limit of the allowed rate, intercept risky operations such as malicious bursts, and improve the security of the request processing process.
[0065] In this embodiment, the second task association information includes at least one of a task identifier, a requested value attribute value, and a belonging user; the returned task is split to obtain at least one returned sub-task, including: when the second task association information satisfies a preset return condition, the returned task is split to obtain at least one returned sub-task; wherein the preset return condition includes at least one of the following conditions: the task identifier is not empty; the format of the requested value attribute value meets the preset format requirements; the requested value attribute value is less than or equal to the actual value attribute value corresponding to the returned task; the user status of the belonging user is a valid status.
[0066] The request value attribute value is the value attribute value of the return task application associated with the return request.
[0067] In order to avoid the situation of mistaken return, each returned task can be verified to ensure that the returned tasks are normal tasks that meet the preset return conditions.
[0068] It should be noted that the task identifier is not empty, indicating that the returned task is an actual existing task. The value attribute value is usually set according to the preset format requirements. When the format of the request value attribute value meets the preset format requirements, it means that the request value attribute value is a real value attribute value. Exemplarily, the preset format requirement may be in accordance with the regular expression format. In order to prevent malicious return requests from causing resource losses, the actual value attribute value of the completed task corresponding to the return task can be determined by accessing the business library as the actual value attribute value of the return task. Exemplarily, in the field of e-commerce, the value attribute value provided by each completed order associated with the return task when placing an order can be determined, and the sum of each value attribute value is determined as the actual value attribute value of the return task. In order to prevent the occurrence of multiple returns, it can be determined whether the request value attribute value is less than or equal to the actual value attribute value corresponding to the return task; if it is less than or equal to the actual value attribute value, the return task can continue to be processed; if it is greater than the actual value attribute value, it means that an error has occurred in the request value attribute value, and the return task is stopped from continuing to operate. In addition, when determining whether the user status of the attribution task is valid, the business library can be accessed to determine whether the attribution user is a deregistered user. If not, the user status is valid; if not, the user status is invalid.
[0069] Furthermore, by accessing the cache database, it is possible to determine whether there is a subtask in the rollback task that has completed the rollback operation. If so, the task completion information of the subtask that has completed the rollback operation can be fed back to instruct the user end to adjust the rollback request based on the task completion information to avoid repeated rollback operations.
[0070] In actual applications, if the second task-related information meets the preset return conditions, the return task is split into at least one return subtask; if the second task-related information does not meet the preset return conditions, exception information can be generated and sent to the user end that sends the return request, so that the user end can adjust the return request based on the exception information and complete the return operation normally.
[0071] This embodiment selects the return tasks that meet the preset return conditions for return operations, thereby avoiding the occurrence of erroneous returns, which is beneficial to improving the safety and effectiveness of the return operation.
[0072] Optionally, when the return task is a task for returning a completed order, the method for splitting the return task based on the second task association information to obtain at least one return sub-task may be: based on the second task association information, determining the total order quantity of completed orders included in the return task; and splitting the return task into a target number of return sub-tasks.
[0073] If the target quantity is less than or equal to the total order quantity, each completed order corresponding to a return task can be split into an independent return subtask; or multiple completed orders can be split into one return subtask. Each return subtask can correspond to at least one completed order, so that by performing a return operation on the return subtask, the return operation of at least one completed order corresponding to the return subtask is completed.
[0074] S220. For each rolled-back subtask, determine the target subtask library and target subtask table corresponding to the rolled-back subtask, and store the rolled-back subtask in the target subtask table in the target subtask library, so that when the task reading operation is triggered, a task processing message is generated by reading the rolled-back subtask in the subtask table.
[0075] There are multiple subtask libraries, and each task library includes at least one subtask table.
[0076] In this embodiment, the method for determining the target subtask library and target subtask table corresponding to the rolled-back subtask can be: randomly determine a subtask library as the target subtask library for each rolled-back subtask, and use any subtask table in the target subtask library as the target subtask table; after the target subtask tables are determined for all rolled-back subtasks, the number of target subtask tables is greater than 1.
[0077] Optionally, the method for determining the target subtask library and target subtask table corresponding to the returned subtask may also include: determining the third task association information of the returned subtask; and determining the target subtask library and target subtask table corresponding to the returned subtask based on the third task association information, the first total number of the subtask library, and the second total number of subtask tables in each subtask library.
[0078] Specifically, the third task association information may be the subtask number of the returned subtask. The subtask number is encoded in Base64 binary format, and the absolute value of the obtained binary encoding value is determined. The absolute value is divided by the first total number, and a rounding operation is performed to determine the library number of the corresponding target subtask library. The second total number is modulo operation is performed through the absolute value to determine the table number of the target subtask table in the target subtask library, and then the target subtask library and target subtask table corresponding to the returned subtask are determined.
[0079] Exemplarily, the subtask number of the returned subtask is order_0001Base64, the absolute value of the binary code is 15, the first total quantity is 4, the second total quantity is 32, and the library corresponding to the order number order_0001 is 15 / 4=3 libraries, and the corresponding table is 15%32=32 tables.
[0080] In this embodiment, the target subtask library and target subtask table corresponding to the returned subtask can be quickly and effectively determined through the subtask number, the first total number and the second total number, which is conducive to improving the efficiency of determining the target subtask library and the target subtask table.
[0081] In a specific implementation, the rolled-back subtask may be stored in a target subtask table in a target subtask library, so that when it is detected that a task reading operation is triggered, the rolled-back subtask in the subtask table is read to generate a task processing message.
[0082] Specifically, a reading cycle can be set to periodically read the return subtasks in the subtask table. Exemplarily, the reading cycle can be 5 seconds. When the set cycle time is reached, the task reading operation is triggered. Each time the subtask table is read, a preset number of return subtasks in each subtask table can be read, and the return subtasks read out are used as pending subtasks, and each pending subtask generates a corresponding task processing message. Among them, the preset number is greater than or equal to 1.
[0083] In this embodiment, the rollback task is split into at least one rollback subtask, a subtask table corresponding to each rollback subtask is determined in multiple subtask tables for storage, and when the task reading operation is triggered, multiple rollback subtasks are read from the subtask table, thereby greatly reducing the possibility that the users to which the read rollback subtasks belong are the same user. Since each read rollback subtask is treated as a subtask to be processed, it is beneficial to make the users corresponding to the subtasks to be processed different.
[0084] S230: When a task processing message is detected, determine first task association information of at least one to-be-processed subtask associated with the task processing message.
[0085] S240. For at least one subtask to be processed, determine the task return path of the subtask to be processed according to the first task association information of the subtask to be processed and at least two pre-generated business libraries, so as to return the task value attribute value corresponding to the subtask to be processed to the target processing account based on the task return path.
[0086] The business library is used to store the return paths of all tasks associated with the user.
[0087] In order to avoid a backlog of tasks caused by an excessive number of unprocessed returned subtasks stored in the subtask table, the method provided in this embodiment also includes: querying the task status of the returned subtasks stored in each subtask table according to a preset period; wherein the task status includes at least one of an idle state, a locked state and a completed state; based on the task status, determining the third total number of unfinished subtasks in the locked state and the idle state, and when the third total number is greater than a preset number threshold, generating an alarm message for indicating the risk of task backlog, and sending the alarm message to the operation end.
[0088] It should be noted that corresponding task states can be set for the returned subtasks at different stages. After the returned subtask is stored in the target subtask table, the task state of the returned subtask can be set to an idle state; after the returned subtask is read, the task state of the returned subtask can be set to a locked state; after the task processing message corresponding to the returned subtask is generated, the task state corresponding to the returned subtask can be adjusted to a completed state.
[0089] In this embodiment, the task status of the returned subtasks stored in each subtask table can be queried according to a preset period, and the returned subtasks in the locked state and the idle state are determined as unfinished subtasks. Determine the third total number of unfinished subtasks. When the third total number is greater than the preset number threshold, it means that the third total number of unfinished subtasks is too large, resulting in a backlog of tasks. In order to improve the speed and efficiency of task processing, an alarm message for prompting the risk of task backlog can be generated, and the alarm message can be sent to the operation end so that the operation end can participate in the task processing operation. When the third total number is less than or equal to the preset number threshold, it means that the third total number of unfinished subtasks has not reached the backlog condition, and the returned subtasks in the subtask table can continue to be processed according to the current processing method. Exemplarily, the preset number threshold may be 100.
[0090] This embodiment is conducive to timely discovering the backlog of tasks and processing the backlog of returned subtasks in a timely manner, thereby improving the efficiency and speed of task processing and enhancing the user experience.
[0091] Optionally, the method also includes: determining a locked subtask in a locked state in each subtask table, and determining the time difference between the locking start time of the locked subtask and the current time; when the time difference is greater than a preset time difference, adjusting the task state of the locked subtask to an idle state, so that the idle subtask in the idle state can be read when the subtask table is accessed; wherein, the rollback subtask in the locked state does not support being read, and the rollback subtask in the idle state supports being read.
[0092] In this embodiment, the return subtask in the locked state can be determined as a locked subtask. In order to avoid the locked subtask being locked for too long, resulting in untimely task processing, the time difference between the lock start time of the locked subtask and the current time can be determined. Among them, the lock start time is the time when the task state is adjusted to the locked state. When the time difference is greater than the preset time difference, the task state of the locked subtask can be adjusted to the idle state, that is, the locked subtask is released and read again as an idle subtask. Exemplary, the time difference can be 10 seconds.
[0093] Optionally, the time difference of the locked subtask may be periodically determined to adjust the task state of the locked subtask based on the time difference. For example, the time difference may be determined every 5 minutes. In addition, a threshold of the number of times the task state can be adjusted for each locked subtask may be set. Before adjusting the task state of the locked subtask to the idle state, it is also necessary to determine whether the current number of adjustments of the locked subtask reaches the adjustment number threshold. If so, the task state of the locked subtask is not adjusted; if not, the task state of the locked subtask is adjusted to the idle state. Exemplarily, the adjustment number threshold may be 6 times.
[0094] This embodiment avoids the situation where the locked subtask is locked for a long time, which is beneficial to improving the efficiency of processing the subtasks in the subtask table.
[0095] The above describes in detail the embodiments corresponding to the task processing method. In order to make the technical scheme of the present method further clear to those skilled in the art, the following describes in detail the application scenario in which the subtask to be processed is an order to be processed as an example.
[0096] Figure 3 is a schematic diagram of a task processing system provided according to an embodiment of the present invention; Figure 3 The task processing system includes a business front-end, a state machine, a return business end and an operation end.
[0097] For the business front-end, a token bucket is created before receiving the return request. After receiving the return request, a hotspot peak shaving check can be performed, that is, to verify whether there is a token in the token bucket at the current moment. If there is a token in the token bucket, the received return request is processed. Further, a Redis cluster can be pre-built, and a distributed lock can be implemented through the Redis cluster, and the return request can be processed by preempting the distributed lock. Specifically, the setNx(key, value, seconds, TimeUnit.SECONDS) command of Redis can be used to obtain a distributed lock, and the lock expiration time can be set at the same time. After obtaining the lock, it is necessary to verify whether the return task is a task that has been successfully returned. Specifically, based on the user ID of the user who sent the return request, the return request number and the task ID of the corresponding return task, it is determined whether the task completion information of the order corresponding to the return request has been stored in the Redis cluster. If it exists, the return result is obtained by deserializing the task completion information, and the return result is returned to the user end that sent the return request. Among them, the task completion information can be embodied in a string. If it does not exist, the subsequent processing of the return request continues. The task association information of the return task corresponding to the return request and the service information of the distributed lock obtained can be written to the Redis cluster through the business front-end.
[0098] Further, it is determined whether the return task corresponding to the return request meets the preset return condition, that is, each return task is verified. If the verification is passed, the return task is written to the main task library, and the write state of the return task in the main task library is set to the locked state.
[0099] After completing the above return request operation, set the return request processing result and return anti-duplicate code through the Redis cluster pipeline command. The processing result can be a string of task processing information serialized by GsonUtils. The user ID, return request number, processing result, and return anti-duplicate code can all be written to the Redis cluster.
[0100] After receiving the return query request, the return result corresponding to the return query request can be provided. When verifying whether the return task is a task that has been successfully returned, if the task completion information is not found, it can be determined whether there is a corresponding return anti-duplicate code for the return request. If so, the return request task can be regarded as a processed task to avoid repeated returns; if not, the return operation is performed on the return task corresponding to the return request.
[0101] For the working process of the state machine, see Figure 4 . The state machine schedules the main task regularly, and scans and checks the main task table corresponding to the return request in the main task library in batches every 2 seconds, and scans and writes the return task corresponding to the return request in the locked state. Put the scanned return task into the thread pool, and split the return task into at least one return subtask through the split service and store it in the thread pool. For example, the return task contains the following information: return request number, user ID, return request time, task value attribute value, order information corresponding to the return subtask, creation time and update time. Among them, n is a positive integer. The order information includes the order number and order value attribute value.
[0102] The split return subtasks are divided into separate tables according to the order number. When storing the return subtask in the corresponding subtask table, the write status of the return task in the main task library can be updated to the completed status, and the task status of the return subtask stored in the subtask table can be adjusted to the idle status, so that the return subtask and the return task record update are processed in one transaction, effectively ensuring the consistency of the transaction. Through the subtask splitting operation, frequent returns by hot users and the pressure on the return offset of the business library are avoided. It should be noted that the write status refers to the status of the return task in the main task table of the main task library; the task status refers to the status of the return subtask in the subtask table of the subtask library.
[0103] The state machine schedules subtasks regularly, and scans the subtask table in batches every 5 seconds to read the idle return subtasks, and puts the scanned return subtasks into the thread pool. In order to prevent concurrent repeated processing, the task state is adjusted to the locked state for each scanned return subtask, and then the task processing message is sent in the form of a message body through the middleware.
[0104] In order to prevent the thread pool from being full, causing the return subtask to be locked for a long time but not processed, the timed unlocking scheduling task determines the return subtask whose time difference between the lock start time and the current time is greater than the preset time difference, and adjusts the task state of the determined return subtask to the idle state. The preset time difference can be 10 seconds. And set the adjustment number threshold for adjusting the task state, for example, the adjustment number threshold can be 6 times.
[0105] If a large number of subtasks are backlogged and not processed, the returned subtasks are regularly checked through the scheduled alarm scheduling task. For example, each subtask table is scanned every 10 minutes to query the third total number of returned subtasks in the idle state and the locked state in the corresponding subtask table. If the third total number is greater than the preset number threshold, the telephone alarm function is triggered to warn the backlog of subtasks.
[0106] For the return business end, the task processing message is detected in real time, and the installment order and bill details corresponding to the user are queried from the business library according to the user ID and order information in the task processing message. The user ID is used as the partition key for the sub-library and sub-table. Exemplarily, the target business library and target business table where the installment order and bill details corresponding to the user ID are stored can be determined by performing integer operation or modulo operation on the user ID, and the installment order and bill details can be obtained by accessing the target business table, thereby determining the task return path of the pending subtask associated with the task processing message based on the analysis order and bill details, and returning the task value attribute value corresponding to the pending subtask to the target processing account according to the task return path. And based on the return result, the bill details in the business library are updated. Finally, the task completion information is generated and fed back to the Redis cluster.
[0107] For the operation side, for the abnormal subtask, the operation and maintenance task is notified to perform manual processing operations, and the task value attribute value is promptly returned to the target processing account, thereby improving the user experience. Among them, the abnormal subtask can be the subtask indicated in the abnormal processing request sent by the user side.
[0108] This embodiment uses a millisecond-level time window current limiting mechanism to intercept interface explosions and effectively ensure the robustness and availability of the system. Through Redis caching task completion information, idempotent operations are supported, and repeated refund requests return idempotent results, thereby improving the corresponding efficiency of the system. The return task is split into return subtasks, and the subtasks are scanned through state flow and task processing messages are issued. The return subtask uses the order number to divide the library and table. When a batch return request is made on the user side, it is dispersed by the state machine to eliminate the return hot users, thereby reducing the data processing pressure of the business library and ensuring the stability of the system. For tasks that have not been processed for a long time, the relevant personnel can be reached through the timed alarm task, and timely intervention and processing can be carried out to maintain the stability of the system.
[0109] Figure 5 1 is a schematic diagram of the structure of a task processing device provided according to an embodiment of the present invention, and the device is used to execute the task processing method provided in any of the above embodiments. The device and the task processing method of the above embodiments belong to the same inventive concept, and the details not described in detail in the embodiment of the task processing device can refer to the embodiment of the above task processing method. Figure 5 As shown, the device comprises:
[0110] The first task association information determination module 10 is used to determine the first task association information of at least one to-be-processed subtask associated with the task processing message when a task processing message is detected; wherein the attribution user corresponding to the at least one to-be-processed subtask is different;
[0111] The task return path determination module 11 is used to determine the task return path of the subtask to be processed for at least one subtask to be processed according to the first task association information of the subtask to be processed and at least two pre-generated business libraries, so as to return the task value attribute value corresponding to the subtask to be processed to the target processing account based on the task return path;
[0112] The business library is used to store the task return paths of all tasks associated with the user.
[0113] Based on any optional technical solution in the embodiments of the present invention, optionally, the following further includes:
[0114] A return request receiving module, used for receiving a return request sent by a user terminal before determining the first task association information of at least one to-be-processed subtask associated with the task processing message, and determining the second task association information of the return task corresponding to the return request;
[0115] A task splitting module, used for splitting the return task into at least one return subtask based on the second task association information;
[0116] The task storage module is used to determine the target subtask library and target subtask table corresponding to each returned subtask, and store the returned subtask in the target subtask table of the target subtask library, so that when the task reading operation is triggered, a task processing message is generated by reading the returned subtask in the subtask table;
[0117] There are multiple subtask libraries, and each task library includes at least one subtask table.
[0118] Based on any optional technical solution in the embodiments of the present invention, optionally, the task storage module includes:
[0119] A third task associated information determination submodule, used to determine the third task associated information of the returned subtask;
[0120] The target subtask table determination submodule is used to determine the target subtask library and target subtask table corresponding to the returned subtask based on the third task association information, the first total number of the subtask library and the second total number of subtask tables in each subtask library; wherein the third task association information includes the subtask number of the returned subtask.
[0121] Based on any optional technical solution in the embodiment of the present invention, optionally, the second task association information includes at least one of a task identifier, a request value attribute value, and an attributed user;
[0122] Task splitting module, including:
[0123] The task splitting submodule is used to split the return task into at least one return subtask when the second task association information meets the preset return condition; wherein the preset return condition includes at least one of the following conditions:
[0124] The task ID is not empty;
[0125] The format of the requested value attribute value complies with the preset format requirements;
[0126] The requested value attribute value is less than or equal to the actual value attribute value corresponding to the returned task;
[0127] The user status of the attributed user is a valid status.
[0128] Based on any optional technical solution in the embodiments of the present invention, optionally, the following further includes:
[0129] A status query module, used to query the task status of the returned subtask stored in each subtask table according to a preset period; wherein the task status includes at least one of an idle state, a locked state and a completed state;
[0130] The alarm information generation module is used to determine the third total number of unfinished subtasks in the locked state and the idle state based on the task status. When the third total number is greater than the preset number threshold, an alarm information is generated to indicate the risk of task backlog, and the alarm information is sent to the operation end.
[0131] Based on any optional technical solution in the embodiments of the present invention, optionally, the following further includes:
[0132] A time difference determination module is used to determine the locked subtasks in the locked state in each subtask table, and determine the time difference between the locked start time of the locked subtask and the current time;
[0133] A state adjustment module, used for adjusting the task state of the locked subtask to an idle state when the time difference is greater than a preset time difference, so as to read the idle subtask in the idle state when the subtask table is accessed;
[0134] Among them, the rolled-back subtask in the locked state cannot be read, while the rolled-back subtask in the idle state can be read.
[0135] Based on any optional technical solution in the embodiments of the present invention, optionally, the return request receiving module includes:
[0136] A second task association information determination submodule, configured to determine the second task association information of the return task corresponding to the return request when there are tokens in the pre-created token bucket;
[0137] The token is stored in the token bucket at a preset frequency, and a token is taken out from the token bucket each time the second task association information is determined.
[0138] Based on any optional technical solution in the embodiment of the present invention, optionally, the first task association information includes a target user identifier and a task identifier corresponding to the subtask to be processed;
[0139] The task return path determination module 11 includes:
[0140] A target service library determination submodule, used to determine the target service library corresponding to the target user identifier based on the pre-stored correspondence between the service library and the user;
[0141] The task return path determination submodule is used to determine the task return path in the target business library based on the task identifier.
[0142] Based on any optional technical solution in the embodiments of the present invention, optionally, the following further includes:
[0143] The task completion information generation module is used to generate task completion information after returning the task value attribute value corresponding to the subtask to be processed to the target processing account, and store the task completion information in the cache database, so that when a repeated subtask corresponding to the subtask to be processed is received, the processing status of the repeated subtask can be determined by accessing the cache database.
[0144] The technical solution of the embodiment of the present invention, in the case of detecting a task processing message, determines the first task association information of at least one pending subtask associated with the task processing message; wherein, there are differences in the attribution users corresponding to at least one pending subtask; for at least one pending subtask, the task return path of the pending subtask is determined based on the first task association information of the pending subtask and at least two pre-generated business libraries, so as to return the task value attribute value corresponding to the pending subtask to the target processing account based on the task return path; wherein, the business library is used to store the return paths of all tasks associated with the user. Since there are differences in the attribution users of at least one pending subtask corresponding to the task processing message, when the number of pending subtasks is multiple, the possibility of storing the task return paths of all pending subtasks in the same business library is small; therefore, when determining each task return path, the possibility of accessing the same business library is small, thereby reducing the access pressure on the business library, avoiding the occurrence of business library hot spots, and helping to improve task processing efficiency.
[0145] It is worth noting that in the embodiment of the above-mentioned task processing message device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.
[0146] Figure 6 Schematic diagram of the structure of an electronic device that implements the task processing method of an embodiment of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0147] like Figure 6As shown, the electronic device 20 includes at least one processor 21, and a memory connected to the at least one processor 21, such as a read-only memory (ROM) 22, a random access memory (RAM) 23, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 21 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 22 or the computer program loaded from the storage unit 28 to the random access memory (RAM) 23. In RAM23, various programs and data required for the operation of the electronic device 20 can also be stored. The processor 21, ROM22 and RAM23 are connected to each other through a bus 24. An input / output (I / O) interface 25 is also connected to the bus 24.
[0148] A number of components in the electronic device 20 are connected to the I / O interface 25, including: an input unit 26, such as a keyboard, a mouse, etc.; an output unit 27, such as various types of displays, speakers, etc.; a storage unit 28, such as a disk, an optical disk, etc.; and a communication unit 29, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 29 allows the electronic device 20 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0149] The processor 21 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 21 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 21 performs the various methods and processes described above, such as a task processing method.
[0150] In some embodiments, the task processing method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 28. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 20 via the ROM 22 and / or the communication unit 29. When the computer program is loaded into the RAM 23 and executed by the processor 21, one or more steps of the task processing method described above may be performed. Alternatively, in other embodiments, the processor 21 may be configured to perform the task processing method in any other appropriate manner (e.g., by means of firmware).
[0151] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0152] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0153] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0154] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0155] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0156] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0157] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0158] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A task processing method, characterized in that: include: In the case of detecting a task processing message, determining first task association information of at least one to-be-processed subtask associated with the task processing message; wherein the attribution users corresponding to the at least one to-be-processed subtask are different; For the at least one to-be-processed subtask, determining a task return path for the to-be-processed subtask according to the first task association information of the to-be-processed subtask and at least two pre-generated business libraries, so as to return the task value attribute value corresponding to the to-be-processed subtask to the target processing account based on the task return path; The business library is used to store the return paths of all tasks associated with the user.
2. The method according to claim 1, characterized in that Before determining the first task association information of at least one to-be-processed subtask associated with the task processing message, the method further includes: Receive a return request sent by a user terminal, and determine second task association information of the return task corresponding to the return request; Based on the second task association information, split the return task to obtain at least one return subtask; For each of the rollback subtasks, determine the target subtask library and target subtask table corresponding to the rollback subtask, store the rollback subtask in the target subtask table of the target subtask library, so that when a task reading operation is triggered, the task processing message is generated by reading the rollback subtask in the subtask table; There are multiple subtask libraries, and each of the task libraries includes at least one subtask table.
3. The method according to claim 2, characterized in that The step of determining a target subtask library and a target subtask table corresponding to the return subtask includes: Determine third task association information of the returned subtask; Based on the third task association information, the first total number of the subtask library and the second total number of subtask tables in each of the subtask libraries, determine the target subtask library and target subtask table corresponding to the returned subtask; wherein the third task association information includes the subtask number of the returned subtask.
4. The method according to claim 2, characterized in that: The second task association information includes at least one of a task identifier, a request value attribute value, and an attributed user; The step of splitting the return task to obtain at least one return subtask includes: When the second task association information satisfies a preset return condition, the return task is split into at least one return subtask; wherein the preset return condition includes at least one of the following conditions: The task identifier is not empty; The format of the request value attribute value complies with the preset format requirements; The requested value attribute value is less than or equal to the actual value attribute value corresponding to the returned task; The user status of the attributed user is a valid status.
5. The method according to claim 2, characterized in that: Also includes: Querying the task status of each of the returned subtasks stored in the subtask table according to a preset period; wherein the task status includes at least one of an idle state, a locked state, and a completed state; Based on the task status, the third total number of unfinished subtasks in the locked state and the idle state is determined. When the third total number is greater than a preset number threshold, an alarm message is generated to indicate the risk of task backlog, and the alarm message is sent to the operation end.
6. The method according to claim 5, characterized in that Also includes: Determine the locked subtask in each subtask table and determine the time difference between the locking start time of the locked subtask and the current time; When the time difference is greater than a preset time difference, adjusting the task state of the locked subtask to an idle state, so as to read the idle subtask in the idle state when the subtask table is accessed; The rolled-back subtask in the locked state does not support being read, while the rolled-back subtask in the idle state supports being read.
7. The method according to claim 2, characterized in that: The determining of the second task association information of the return task corresponding to the return request includes: In the case where there is a token in the pre-created token bucket, determining second task association information of the rollback task corresponding to the rollback request; The token is stored in the token bucket at a preset frequency, and a token is taken out from the token bucket each time the second task association information is determined.
8. The method according to claim 1, characterized in that: The first task association information includes a target user identifier and a task identifier corresponding to the subtask to be processed; The determining, based on the first task association information of the to-be-processed subtask and at least two pre-generated service libraries, a task return path of the to-be-processed subtask comprises: Determine the target service library corresponding to the target user identifier based on the pre-stored correspondence between the service library and the user; Based on the task identifier, the task return path is determined in the target service library.
9. The method according to claim 1, characterized in that: After returning the task value attribute value corresponding to the to-be-processed subtask to the target processing account, the method further includes: Task completion information is generated and stored in a cache database, so that when a repeated subtask corresponding to the to-be-processed subtask is received, the processing status of the repeated subtask is determined by accessing the cache database.
10. A task processing device, characterized in that: include: A first task association information determination module is used to determine, when a task processing message is detected, first task association information of at least one to-be-processed subtask associated with the task processing message; wherein the attribution users corresponding to the at least one to-be-processed subtask are different; A task return path determination module is used to determine, for the at least one to-be-processed subtask, the task return path of the to-be-processed subtask according to the first task association information of the to-be-processed subtask and at least two pre-generated business libraries, so as to return the task value attribute value corresponding to the to-be-processed subtask to the target processing account based on the task return path; The business library is used to store the task return paths of all tasks associated with the user.
11. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the task processing method according to any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the task processing method according to any one of claims 1 to 9 when executed.
