A task processing method, system and program product
By dynamically adjusting the task processing order in the trading system, and based on a multi-factor fusion scheduling model, the resource consumption problem caused by static rules is solved, and self-correction and real-time task response are improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HUNDSUN TECH
- Filing Date
- 2025-12-15
- Publication Date
- 2026-05-29
AI Technical Summary
When faced with abnormal tasks, the existing trading system's static task processing rules lead to a large consumption of system resources, affecting the efficiency of normal task processing and increasing security risks, and it lacks self-correction capabilities.
By dynamically adjusting the processing order of task data based on the importance, delay, and anomalies of the task data, a multi-factor fusion scheduling model is adopted to dynamically adjust the processing order of task data and build self-correction capabilities.
It improves the system's fault tolerance and throughput, enhances the immediacy of task response and system stability, and avoids the phenomenon of tasks being blocked by invalid tasks.
Smart Images

Figure CN121326534B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of business data processing, and more specifically, to a task processing method, system, and program product. Background Technology
[0002] In existing trading systems, the transaction task processing process is a core functional module, and its stability directly determines the normal operation of trading tasks. Therefore, improving the fault tolerance and error correction capabilities of task processing is particularly important.
[0003] In existing technologies, tasks are typically processed in a first-in, first-out (FIFO) order, which is simple and stable. However, with increasingly complex business scenarios and task processing requirements, this static processing rule can lead to excessive consumption of system resources in the event of an abnormal task, affecting the processing of other normal tasks, reducing the overall system efficiency, and even increasing system security risks. Summary of the Invention
[0004] The purpose of this application is to provide a task processing method, system, and program product that dynamically and flexibly adjusts the processing order of task data by obtaining task data, thereby building a self-correcting capability.
[0005] To achieve the above objectives, the technical solutions adopted in the embodiments of this application are as follows:
[0006] In a first aspect, embodiments of this application provide a task processing method, including:
[0007] The data processing module obtains task data; the task data includes a fund number and a task function number; wherein, the fund number has a mapping relationship with at least one task function; the task function number represents the corresponding task function;
[0008] The data processing module confirms the functional status of the task data; the functional status is used to indicate whether the task data is an abnormal task.
[0009] The data processing module obtains a task element table of the task data; the task element table includes the priority, frequency evaluation factor, latest execution time, and function status corresponding to the task function number; the priority represents the importance of processing the task corresponding to the task function number; the frequency evaluation factor is used to represent the request frequency of the corresponding task function number; the latest execution time represents the acceptable latest execution time of the corresponding task function number.
[0010] The task sorting module calculates the processing sorting value corresponding to the task function number based on the task element table;
[0011] The task processing module processes the corresponding task data in sequence based on the processing sort value corresponding to each task function number.
[0012] Optionally, it also includes:
[0013] The task time statistics module calculates the execution time experience value of the task function number by smoothing the current time data and the historical time data of the task function number.
[0014] The steps for the data processing module to confirm the functional status of the task data include:
[0015] The data processing module compares the execution time experience value with the fault threshold; if the execution time experience value is greater than the fault threshold, the functional status of the task data is confirmed to be abnormal; if the execution time experience value is less than or equal to the fault threshold, the functional status of the task data is confirmed to be normal.
[0016] Optionally, the step of the task time statistics module obtaining the empirical value of the execution time of the task function number by smoothing the calculation based on the current time data and the historical time data of the task function number includes:
[0017] The task time statistics module calculates the execution time experience value of the task function number through smoothing processing based on the initial experience value of the task function number, the smoothing factor, the current time data of the task function number, and the previous time data of the task function number.
[0018] Optionally, it also includes:
[0019] The data processing module compares the number of requests per unit time for the task function number with a request threshold per unit time; if the number of requests per unit time is greater than the request threshold per unit time, the task data is confirmed to be in an overloaded state; if the number of requests per unit time is less than or equal to the request threshold per unit time, the task data is confirmed to be in an unoverloaded state.
[0020] The data processing module determines the frequency evaluation factor of the task function number based on the overload state or the non-overload state.
[0021] Optionally, the step of the task sorting module calculating the processing sorting value corresponding to the task data based on the task element table includes:
[0022] The task sorting module determines the delay factor of the task function number based on the task arrival time and the latest execution time.
[0023] The task sorting module determines the corresponding delay coefficient based on the delay factor of the task function number;
[0024] The task sorting module takes the priority, the frequency evaluation factor, the delay coefficient, and the functional status as input parameters to the multi-factor fusion scheduling model, and calculates the corresponding processing sorting value of the task data.
[0025] Optionally, after the step of the task processing module processing the corresponding task data sequentially based on the processing sort value corresponding to each task function number, the method further includes:
[0026] After the task processing module completes the processing of the corresponding task data, it synchronizes the completion time of the corresponding task function number to the task time statistics module.
[0027] The task time consumption statistics module determines the current time consumption data of the corresponding task function number based on the start time and completion time of the task function number.
[0028] Secondly, embodiments of this application provide a task processing system, including:
[0029] A data processing module is used to obtain task data; the task data includes a fund number and a task function number; wherein the fund number has a mapping relationship with at least one task function; the task function number represents the corresponding task function; confirm the functional status of the task data; the functional status is used to indicate whether the task data is an abnormal task; obtain a task element table of the task data; the task element table includes the priority, frequency evaluation factor, latest execution time, and functional status corresponding to the task function number; the priority represents the processing importance of the task corresponding to the task function number; the frequency evaluation factor is used to represent the request frequency of the corresponding task function number; the latest execution time represents the acceptable latest execution time of the corresponding task function number;
[0030] The task sorting module is used to calculate the processing sorting value corresponding to the task function number based on the task element table.
[0031] The task processing module is used to process the corresponding task data in sequence based on the processing sorting value corresponding to each task function number.
[0032] Optionally, it also includes: a task time statistics module;
[0033] The task time consumption statistics module is used to calculate the execution time experience value of the task function number by smoothing the current time consumption data and the historical time consumption data of the task function number.
[0034] The data processing module is specifically used to compare the execution time experience value with the fault threshold; if the execution time experience value is greater than the fault threshold, the functional status of the task data is confirmed to be abnormal; if the execution time experience value is less than or equal to the fault threshold, the functional status of the task data is confirmed to be normal.
[0035] Optionally, the task sorting module is specifically used to determine the delay factor of the task function number based on the task arrival time and the latest execution time; determine the corresponding delay coefficient based on the delay factor of the task function number; and input the priority, the frequency evaluation factor, the delay coefficient, and the function status as input parameters into a multi-factor fusion scheduling model to calculate the corresponding processing sorting value of the task data.
[0036] Thirdly, embodiments of this application provide a program product that, when executed by a processor, implements the method as described in any one of the first aspects above.
[0037] Compared to existing technologies, the task processing method, system, and program product provided in this application obtain task data, then identify the importance, latency, and abnormal conditions of the task data, and dynamically adjust the processing order of the task data, thereby achieving dynamic processing of task data. Furthermore, due to the dynamic changes in latency and abnormal conditions, the processing order of task data is dynamically and flexibly adjusted, thus building a self-correcting capability.
[0038] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0039] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0040] Figure 1 This is a diagram illustrating a typical task execution strategy.
[0041] Figure 2 This is a schematic diagram of the architecture of a task processing system provided in an embodiment of the present invention;
[0042] Figure 3 A flowchart illustrating a task processing method provided in an embodiment of the present invention;
[0043] Figure 4This is a schematic diagram of the architecture of another task processing system provided in an embodiment of the present invention;
[0044] Figure 5 A flowchart illustrating another task processing method provided in an embodiment of the present invention;
[0045] Figure 6 A flowchart illustrating another task processing method provided in an embodiment of the present invention;
[0046] Figure 7 A flowchart illustrating another task processing method provided in an embodiment of the present invention;
[0047] Figure 8 A flowchart illustrating another task processing method provided in an embodiment of the present invention;
[0048] Figure 9 This invention provides a schematic diagram of another task processing system architecture.
[0049] Figure 10 This invention provides a schematic diagram of another task processing system architecture.
[0050] Figure 11 This is a schematic diagram of an architecture for business balancing in task processing, provided as an embodiment of the present invention. Detailed Implementation
[0051] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0052] Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0053] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this application, terms such as "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0054] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0055] In existing technologies, one common failure in practical application systems is that some clients, due to program malfunctions, initiate a large number of requests. These requests consume excessive system resources, ultimately affecting the normal operation of core business processes.
[0056] In addition, if the trading platform system experiences issues due to various reasons, affecting a particular account or type of business, causing some accounts or business interfaces to time out, the lack of error correction capabilities in the trading system will impact user experience and overall customer engagement.
[0057] For example, the trading client malfunctioned due to incorrect calls from some users. This caused the client to initiate query requests at a rate of 70 requests per second (tps). Since the amount of data involved in this account was large, the query processing consumed significant resources, leading to the backend server's CPU and memory being fully utilized, impacting normal business operations. This type of failure scenario necessitates that the trading system possess self-correcting capabilities. In addition, some account function requests are consistently in a timeout or abnormal state. In a healthy system, the execution urgency of these account function requests needs to be reduced.
[0058] Specifically, Figure 1 See the diagram for a typical task execution strategy. Figure 1 When task data arrives at the transaction scheduling system, the system distinguishes each piece of task data according to static priority, such as... Figure 1 As shown, high-priority, medium-priority, and low-priority tasks are assigned to their respective task queues. Each task queue executes tasks based on a first-in, first-out (FIFO) principle.
[0059] These traditional methods are simple and stable in implementation, but they expose many problems in actual operation. If a certain type of request or a certain fund account malfunctions, the request will consume a large amount of system resources, affecting the normal operation of some core businesses and inevitably causing widespread failures. Static priority strategies, because priorities are fixed in the system design, lack dynamic adaptability, often resulting in low-priority tasks being delayed for a long time or even unable to be executed. When high-priority trading tasks malfunction, such as... Figure 1 If a black task in the high-priority task queue malfunctions, low-priority tasks are often ignored, indicating that conventional task execution architectures lack self-correction capabilities.
[0060] To address the aforementioned technical problems in existing technologies, this paper proposes a task processing mechanism for transactions. Its core logic lies in dynamically adjusting the processing order of task data by identifying its importance, latency, and anomalies, thereby achieving dynamic processing of task data. Furthermore, due to the dynamic changes in latency and anomalies, the processing order of similar task data is dynamically adjusted, thus building a self-correcting capability.
[0061] Optionally, to achieve the above functions, this application provides an implementation method for a task processing system, specifically... Figure 2 This is a schematic diagram of the architecture of a task processing system provided in an embodiment of the present invention. See also: Figure 2 The system 10 includes: a data processing module 100, a task sorting module 101, and a task processing module 102.
[0062] The data processing module 100 is used to extract the fund number and task function number from the task data, and then use the fund number and task function number to extract the elements that affect the sorting order of the task data processing, such as priority, frequency evaluation factor, latest execution time and function status.
[0063] The function status is used to indicate whether the task data is an abnormal task, that is, the data processing module 100 can identify the abnormal task.
[0064] The fund number corresponds to a fund account in the business system, thus enabling this application to pinpoint anomalies down to the specific fund account. The same fund number can be mapped to one or more task functions. Each task function has a unique task function number. See Table 1 below for the relationship between fund numbers, task functions, and task function numbers:
[0065]
[0066] Table 1
[0067] Different tasks have varying degrees of importance. For example, in a transaction system, the timeliness of "auction trading" is far greater than that of date queries. When both "auction trading" and "date query" task data exist simultaneously, theoretically, the auction trading task data should be processed first. Therefore, this application introduces a priority system to characterize the processing importance of the task corresponding to the task function number. However, this priority is not the sole factor influencing the order of task data processing, but rather serves as a valid reference for the architecture of this application to understand the importance of the corresponding task data.
[0068] For a fund account, the number of requests made by each task function number within a unit of time reflects the resource consumption of the business system for the corresponding task data. Therefore, by setting a frequency evaluation factor, the impact of the corresponding task data on the resource consumption can be confirmed, thereby identifying abnormal tasks.
[0069] The acceptable latency varies for each task. As in the previous example, "auction trading" requires stronger timeliness, so its allowed latency should be as short as possible; while "date query" can tolerate a relatively longer latency. Therefore, the latest allowed execution time for each task is determined by adding a maximum execution time corresponding to each task function number.
[0070] See also Figure 2 The task sorting module 101 is used to combine the relevant elements obtained by the data processing module 100 to determine the processing sorting value for the corresponding task function number.
[0071] Because the above factors consider the task execution order from multiple dimensions, such as timeliness, execution cost, task importance, and abnormal situations, the task sorting module 101 can improve the reliability, accuracy, and flexibility of task data execution order scheduling.
[0072] The task processing module 102 processes the task data based on the order of the sorted values.
[0073] The task processing system described in this application first extracts the elements that affect the sorting order of task data processing when the task data enters the system. Compared with static priority rules, it can better perceive the timeliness and resource consumption of each task data, thereby constructing a scheduling element system that is more in line with the transaction business scenario.
[0074] Furthermore, the task sorting module integrates the above factors to determine the processing priority value for the corresponding task function number. This not only prioritizes tasks with higher business priority or those about to time out, but also promptly avoids errors and excludes invalid task data. This mechanism effectively prevents tasks from being blocked by invalid tasks, improving overall system stability and error correction capabilities, and increasing throughput and the immediacy of task response.
[0075] In summary, this application achieves a shift in scheduling concept from static rule-driven to dynamic multi-factor fusion perception. The core objective is to improve fault tolerance.
[0076] Below, based on the aforementioned task processing system, this application provides a possible implementation of a task processing method. Specifically, Figure 3 This is a flowchart illustrating a task processing method provided in an embodiment of the present invention. See also... Figure 3 The method includes:
[0077] Step 200: The data processing module obtains the task data.
[0078] The task data includes the fund number and the task function number.
[0079] Step 202: The data processing module confirms the functional status of the task data.
[0080] This function status is used to indicate whether the task data is an abnormal task.
[0081] Step 203: The data processing module obtains the task element table of the task data.
[0082] The task element table includes the priority, frequency evaluation factor, latest execution time, and functional status corresponding to the task function number; the frequency evaluation factor is used to characterize the request frequency of the corresponding task function number; and the latest execution time characterizes the acceptable latest execution time of the corresponding task function number.
[0083] Optionally, an example of a task element table is provided below, as shown in Example Table 2:
[0084]
[0085] Table 2
[0086] In one possible implementation, the frequency evaluation factor can be correlated with the number of requests for the corresponding task function number per unit time. For example, if the number of requests for "auction trading" within 10 seconds is 0, the corresponding frequency evaluation factor... Set to 0; if the number of requests within 10 seconds is 1~3, the corresponding frequency evaluation factor is... Set to 1; if the number of requests within 10 seconds is 4~6, the corresponding frequency evaluation factor is... Take 2; up to the frequency evaluation factor Take 10.
[0087] It should be noted that for the same task function corresponding to different fund numbers, the task function number can be the same, and there is no restriction here.
[0088] Step 204: The task sorting module calculates the processing sorting value corresponding to the task function number based on the task element table.
[0089] Step 205: The task processing module processes the corresponding task data in sequence based on the processing sort value corresponding to each task function number.
[0090] The task processing method provided in this invention obtains task data, then identifies the importance, delay, and anomalies of the task data, and dynamically adjusts the processing order of the task data, thereby achieving dynamic processing of task data. Furthermore, due to the dynamic changes in delay and anomalies, the processing order of task data is dynamically and flexibly adjusted, thus building a self-correcting capability.
[0091] In a real-world operating environment, the execution time of the task processing module in the above example is affected by various system factors, including but not limited to CPU utilization, memory usage, and data access paths (such as cache hits or disk reads). Even for the same type of task, the execution time can fluctuate due to changes in system state. Therefore, if the execution time of task data is to be considered as a factor influencing the processing ranking value, using only the static average value as the empirical task execution time will lead to a deviation between the scheduling decision and the actual system performance.
[0092] On the other hand, real-time data on the execution time of a single task is not stable. For example, when a task involves loading cold data (the first read from the hard drive), it may cause a sudden spike in execution time, and such transient anomalies do not represent the normal state of the system. To achieve an effective balance between historical statistics and the current state, a dynamically updated empirical estimation mechanism needs to be introduced. Optionally, in Figure 2 On this basis, Figure 4 This is a schematic diagram of the architecture of another task processing system provided in an embodiment of the present invention. See also: Figure 4 The system 10 also includes: a task time statistics module 103.
[0093] The task time statistics module 103 is used to calculate the empirical value of the execution time of the task function number by smoothing the current time data and the historical time data of the task function number.
[0094] Because the task time statistics module dynamically balances historical and current time data, it constructs a task time experience model with real-time awareness capabilities, providing a more accurate performance reference for task data execution scheduling. This solution features high availability, low computational cost, and good system adaptability, making it suitable for high-concurrency business scenarios such as transactions, scheduling, and monitoring.
[0095] Correspondingly, this application provides a possible implementation of a task processing method, specifically, in Figure 3 On this basis, Figure 5 A flowchart illustrating another task processing method provided in an embodiment of the present invention is shown below. Figure 5 The method also includes:
[0096] Step 201: The task time statistics module calculates the empirical value of the execution time of the task function number by smoothing the current time data and the historical time data of the task function number.
[0097] The corresponding step 202 includes:
[0098] Step 202-1: The data processing module compares the empirical value of the execution time with the fault threshold.
[0099] If the execution time experience value is greater than the fault threshold, the functional status of the task data is confirmed to be abnormal; if the execution time experience value is less than or equal to the fault threshold, the functional status of the task data is confirmed to be normal.
[0100] In one possible implementation, step 202-1 could be implemented as follows:
[0101] The task time statistics module calculates the execution time experience value of the task function number through smoothing processing based on the initial experience value of the task function number, the smoothing factor, the current time data of the task function number, and the previous time data of the task function number.
[0102] The initial experience value of the task function number is the execution time of the corresponding business system when it first obtains the task data corresponding to the task function number, which is used as the initial experience value.
[0103] The smoothing factor α is defined as a smoothing factor in the interval (0, 1) to control the degree to which the current time-consuming data influences the empirical value. The larger α is, the more sensitive the system is to changes in the current time consumption; the smaller α is, the more dependent it is on historical trends.
[0104] Optionally, the following provides a possible expression for an empirical value of execution time:
[0105]
[0106] in, This is the empirical value of the execution time at the current time t. This represents the current time elapsed at the current time t. This is the time taken in the previous session. Smoothing coefficient (0 < <1).
[0107] The algorithm described above for calculating the empirical value of execution time can effectively filter out deviations caused by occasional fluctuations, ensuring a dynamic balance between the stability and timeliness of the empirical value of execution time. Furthermore, unlike traditional static average values, this scheme can adapt to changes in system state, making it more responsive and accurate in scheduling strategies.
[0108] Furthermore, after the execution time of a certain task data of the fund number is smoothed by the above step 201, the judgment is made based on step 202-1. If it is greater than the fault threshold, the solution of this application confirms that the task function number is abnormal and marks the function status as abnormal.
[0109] Below is a statistical example for each task under a fund account, as shown in Statistical Example Table 3.
[0110]
[0111] Table 3
[0112] Among them, the smoothed execution time experience value of task data "daily query" =30*1000ms, which is greater than the corresponding fault threshold "1000". Therefore, the function status of "Daily Query" for this task data is "abnormal".
[0113] Optionally, the fault thresholds corresponding to different tasks can be determined based on different counters, network environments, and scenario requirements, and this application does not limit this. Furthermore, based on the above example, the task element table described above can also be used to maintain empirical values for execution time, as shown in Example Table 4 of the task element table below:
[0114]
[0115] Table 4
[0116] In other scenarios, an excessive number of requests for specific task data can unnecessarily consume system resources, thus affecting the normal processing of data from other tasks. Therefore, to identify task data with abnormally high request volumes, this application also provides the following possible implementation method, specifically... Figure 3 On this basis, Figure 6 A flowchart illustrating another task processing method provided in an embodiment of the present invention is shown below. Figure 6 The method also includes:
[0117] Step 206: The data processing module compares the number of requests per unit time for the task function number with the request threshold per unit time.
[0118] Specifically, if the number of requests per unit time exceeds the request threshold per unit time, the task data is confirmed to be in an overloaded state; if the number of requests per unit time is less than or equal to the request threshold per unit time, the task data is confirmed to be in an unoverloaded state.
[0119] Step 207: The data processing module determines the frequency evaluation factor of the task function number based on the overload or non-overload state.
[0120] Optionally, this data processing module can be used to maintain information related to the delay of task data, specifically a transaction delay table, as shown in Table 5 below:
[0121]
[0122] Table 5
[0123] Different types of tasks can have different request thresholds set per unit time. For example, for "auction trading," since the business system needs to execute requests for "auction trading" task data as soon as they arise, its request threshold per unit time can be set to "unlimited," meaning there is no restriction on the number of requests per unit time. For lower-priority tasks, such as "delegated queries," a corresponding request threshold per unit time can be set based on the actual needs of the scenario, such as 10 / tps (10 requests per second).
[0124] Optionally, for the value of the frequency evaluation factor, if the abnormal judgment based on the number of requests per unit time indicates that the state is not overloaded, then the value of the frequency evaluation factor is 0; if the state is overloaded, then the value of the frequency evaluation factor is selected from 1 to 10 based on the degree of overload.
[0125] Optionally, there are several possible ways to determine the value of this frequency evaluation factor, such as: 1- using the range of request thresholds per unit time to determine the value of the frequency evaluation factor within each range; 2- using the designed formula for calculating the value of the frequency evaluation factor to directly determine the value of the frequency evaluation factor for the corresponding task based on the number of requests per unit time.
[0126] For Example 1, referring to Table 5 above, for task types with a priority less than or equal to 2, due to their higher priority, they have higher requirements for latency and processing efficiency, thus requiring preferential allocation of system resources. Therefore, their corresponding unit-time request threshold can be set to "unrestricted," and the corresponding frequency evaluation factor... The value is 0. For task types with a priority greater than 2, the relationship between the request threshold per unit time and the frequency evaluation factor needs to be designed according to the specific circumstances.
[0127] For example, multiple request thresholds per unit time can be set to form a value range. For instance, when the number of requests per unit time for "delegated queries" is less than 10 / tps, its frequency evaluation factor... The value is 0; when the number of requests per unit time is equal to 10 / tps, its frequency evaluation factor is... The value is 1; when the number of requests per unit time is greater than 10 / tps and less than or equal to 15 / tps, its frequency evaluation factor is... The value is 2, and so on. Therefore, in this implementation, for task types with a priority greater than 2 in Table 5, a set of request thresholds per unit time can be maintained to form a frequency evaluation factor. The range of values for .
[0128] For Example 2, the value of this frequency evaluation factor is... The following expression can be satisfied:
[0129]
[0130] in, The number of requests per unit of time.
[0131] In one possible implementation of this transaction delay table, to enhance flexibility and business adaptability, the table can be refreshed periodically or adjusted in real-time via a management interface. During system operation, the priority of certain tasks can be dynamically increased or their maximum allowed waiting time modified based on market fluctuations, system load, or strategy adjustments. For example, during peak trading periods, the maximum waiting time for "order queries" can be appropriately extended to ensure that core transaction tasks are processed with priority.
[0132] Based on the example of the task element table above, it can be seen that the same fund number can correspond to multiple types of tasks. Therefore, this application provides a possible implementation method for a multi-factor fusion sorting mechanism for the task sorting module. This enables a flexible task data execution mechanism based on this dynamic sorting mechanism, thereby adapting to task execution functions in high-concurrency scenarios. Specifically, in Figure 3 On this basis, Figure 7 A flowchart illustrating another task processing method provided in an embodiment of the present invention is shown below. Figure 7 The method, step 204 includes:
[0133] Step 204-1: The task sorting module determines the delay factor of the task function number based on the task arrival time and the latest execution time.
[0134] Specifically, when task data arrives at the business system, the current time of the business system is obtained. Then, referring to the previous section on maintaining the maximum waiting time for various tasks, the latest execution time = current time + maximum waiting time.
[0135] Therefore, the delay factor This is the difference between the task arrival time and the latest execution time. The task arrival time is the moment corresponding to the execution of step 204-1 for a specific task function number. This delay factor... If task data is not executed before the latest execution time, the value will be negative. Furthermore, the longer the execution is delayed, the greater the influence of this variable.
[0136] Step 204-2: The task sorting module determines the corresponding delay coefficient based on the delay factor of the task function number.
[0137] Optionally, the delay coefficient is determined by a time factor function, the expression of which is as follows:
[0138]
[0139] in, This represents the latency factor; Round-Trip Time (RTT) is the time it takes for a single network request to travel back and forth. It's used to standardize the measurement; the later the execution, the larger this value. If the task data hasn't expired, it's 0, having no impact on the result. Optionally, this RTT refers to the latency between the counter and the task processing system executing the various examples of this solution for request and response.
[0140] Step 204-3: The task sorting module inputs priority, frequency evaluation factor, delay coefficient and functional status as input parameters into the multi-factor fusion scheduling model to calculate the corresponding processing sorting value of the task data.
[0141] Optionally, the expression for this multi-factor fusion scheduling model is as follows:
[0142]
[0143] Optionally, the table below shows the "auction trading" task under normal circumstances. Corresponding calculation method, with For example, Table 6 shows the corresponding calculation example table:
[0144]
[0145] Table 6
[0146] Optionally, the table below shows the "Delegated Inquiry" task under normal circumstances. Corresponding calculation method, with For example, Table 7 shows the corresponding calculation example table:
[0147]
[0148] Table 7
[0149] Optionally, the table below shows the "Delegated Query" task under abnormal conditions (500 delegated queries initiated per second). Calculation method, based on For example, Table 8 shows the corresponding calculation example table:
[0150]
[0151] Table 8
[0152] As can be seen, for tasks of different priorities (Tables 6 and 7), the processing order values determined by the calculation mechanism based on the above multi-factor fusion scheduling model are different, thus affecting the processing order of the tasks. For example, when the tasks shown in Tables 6 and 7 are in the same task processing queue, the task data in Table 6 will be processed first.
[0153] For the same type of task (Tables 7 and 8), based on the calculation mechanism of the multi-factor fusion scheduling model mentioned above, if the tasks shown in Tables 7 and 8 are in the same task processing queue, then normal tasks will be processed first, i.e., the task data in Table 7.
[0154] in, The sorting value for processing task data i. The priority of task data i. Let be the delay coefficient for task data i. The value corresponding to the functional state of task data i. is the frequency evaluation factor for task data i.
[0155] Among them, the possible implementation of the value corresponding to the function status is: if it is normal, the value is 0, and if it is abnormal, the value is 2.
[0156] For the value of the frequency evaluation factor, if the abnormal number of requests per unit time is judged to be in a non-overloaded state, then the value of the frequency evaluation factor is 0; if it is in an overloaded state, then the value of the frequency evaluation factor is selected from 1 to 10 based on the degree of overload.
[0157] Optional, The four parameters are the sorting weight parameters ( Initial value suggestions In practice, adjustments will be made based on the specific circumstances, and the changes can be dynamically implemented or adjusted.
[0158] Optionally, based on this multi-factor fusion scheduling model, some configurable strategies and optimization mechanisms tailored to specific business scenarios can be further implemented. Some possible implementation methods are provided below:
[0159] Method 1: Sorting weight parameters Supports dynamic configuration of strategies based on scenarios.
[0160] Method 2: Increase β during peak periods to prioritize responses to tasks that are about to expire.
[0161] Method 3: Increase γ when the system is idle to improve processing efficiency and reduce average response time.
[0162] Method 4: Increase Weighting can prevent a particular account's continuous malfunctions from impacting other business operations as a whole.
[0163] Method 5: Increase Weighting can prevent certain fund accounts from acting abnormally, causing excessive and frequent calls to certain task function accounts, thus affecting normal business operations.
[0164] Method 6: Support external interface access to the policy engine to achieve automated adjustment of scheduling policies.
[0165] In the above Figure 7 In the example shown, by using a multi-factor fusion scheduling model, when a task under a certain funding account experiences an anomaly, its scheduling score is automatically lowered, and its ranking position is improved, thereby eliminating the anomaly and reducing risk. For Figure 7 The example shown demonstrates a mechanism for determining the processing ranking value of task data based on dimensions such as priority, frequency evaluation factor, latency coefficient, and functional status. By introducing a multi-factor fusion scheduling model, tabular management of task-related elements, and an adjustable parameter mechanism, it achieves the following: 1. High real-time scheduling decision-making (identifying and prioritizing the scheduling of tasks that are about to expire); 2. Anomaly detection and avoidance (ensuring high availability of the system); 3. System processing efficiency optimization (prioritizing the scheduling of low-time-consuming tasks to improve throughput); 4. Flexible control of scheduling strategies (parameter configuration-driven, meeting various business scenarios); 5. Enhanced system stability and fairness (avoiding long-term task blocking and tasks not being executed).
[0166] The rationality and universality of this module model were verified through a sorting case of the actual task element table. It has clear engineering feasibility and broad commercial application value, and is suitable for fields with extremely high requirements for task scheduling accuracy and system timeliness, such as transaction matching, financial risk control, and real-time instruction distribution.
[0167] Optionally, after the task processing module completes the processing of task data, it can synchronize the completion time corresponding to that task data to the task time statistics module, so that the task time statistics module can calculate the current time consumption data of that task function number in real time. Specifically, in Figure 5 On this basis, Figure 8 A flowchart illustrating another task processing method provided in an embodiment of the present invention is shown below. Figure 8 The method also includes:
[0168] Step 208: After the task processing module completes the processing of the corresponding task data, it synchronizes the completion time of the corresponding task function number to the task time statistics module.
[0169] Step 209: The task time statistics module determines the current time data of the corresponding task function number based on the start time and completion time of the task function number.
[0170] It can be seen that in the above Figure 8 As can be seen from the examples, the task processing system provided in this application, including its data processing module, task sorting module, task processing module, and task time statistics module, can form a closed loop for task data processing. Specifically, in Figure 4 On this basis, Figure 9 To illustrate another task processing system architecture in this invention, see [link to relevant documentation]. Figure 9 The system 10 includes a task processing module 102 that is communicatively connected to a task time statistics module 103. This allows for real-time synchronization of the completion time of each task, which is then used by the task time statistics module 103 for statistical purposes.
[0171] Optionally, the following provides a possible implementation of a task processing system, giving an overall explanation of the relationship between the above steps. Specifically, in Figure 9 On this basis, Figure 10 To illustrate another task processing system architecture in this invention, see [link to relevant documentation]. Figure 10 :
[0172] When a request for task data i is received, the data processing module 100 extracts its corresponding fund number and task function number. It then obtains the task arrival time and the number of requests per unit time for the task function number, for example, 14 / tps. Next, using the task delay table, the maintained fault threshold, and feedback from the task time experience value statistics module 103, it performs the two judgments mentioned above: Anomaly judgment 1: step 206 above, i.e., confirming whether the corresponding task is overloaded. Anomaly judgment 2: step 202-1 above, i.e., confirming whether a delay fault anomaly has occurred. Thus, the frequency evaluation factor and functional status are determined respectively.
[0173] Furthermore, based on the task's priority, latest execution time, evaluation factor, functional status, and the task's execution time experience value fed back by the task time experience value statistics module 103, the above elements of the task are maintained in the task element table.
[0174] Correspondingly, the task sorting module 101 determines a delay factor based on the task arrival time and the latest execution time, and determines a delay coefficient based on this delay factor in the example above. The task sorting module 101 inputs priority, frequency evaluation factor, functional status and delay coefficient into a multi-factor fusion scheduling model to determine the processing sorting value of task data i.
[0175] Optionally, the task processing module 102 sorts the task processing queue based on the processing sort value of each task data, for example, in... Figure 10 In the example, the processing sort value of task data i is the second position in the task processing queue.
[0176] In one possible implementation, the task processing system can also interact with the counter 11. For example, after the task processing module 102 determines the task processing queue, it feeds back the queue elements of the task processing queue to the counter 11, so as to wait for the counter 11 to process and then feed back.
[0177] After the counter 11 reports the processing result, the task processing module 102 confirms the completion time of each task. Then, the task processing module 102 reports the completion time of the task to the task time experience value statistics module 103.
[0178] The task time experience value statistics module 103 determines the current time of each task based on its start and finish times. It then performs smoothing processing on this current time data to obtain an experience value for the execution time.
[0179] Optionally, for the above examples of this solution, when facing more complex business scenarios, such as high-concurrency business scenarios, load balancing needs to be considered. Therefore, this application provides a possible implementation method for load balancing of task processing. Specifically, Figure 11 This is a schematic diagram of an architecture for business balancing in task processing provided by an embodiment of the present invention. See also... Figure 11 When a request for a task function is received, it triggers a task scheduling process as an API request. This task scheduling process matches the API request to the appropriate task processing process based on a business load balancing strategy, such as... Figure 11 (a) Task processing process 4.
[0180] See also Figure 11(b) For this API request, the task processing system 10 provided in the example above is used for implementation. Specifically, upon receiving the API request, the data processing module extracts key elements, namely, the fund number, task function number, task arrival time, number of requests per unit time, priority, latest execution time, frequency evaluation factor, and functional status, as described in the example above. The task time experience value statistics module calculates the initial value, and then implements the above-mentioned execution time experience value acquisition scheme through task time statistics.
[0181] The task sorting module calculates the processing sorting value based on the above-mentioned element information and the empirical value of execution time.
[0182] The task processing module sorts tasks based on their processing priority values to obtain a task processing queue. It then asynchronously calls an interface to send the queue information back to the counter, awaiting the processing results.
[0183] This application also provides a task processing system that can employ the above-described... Figure 2 , Figure 4 , Figure 9 and Figure 10 The architecture shown is used to achieve the corresponding steps and technical effects.
[0184] The task processing system can be deployed on one or more electronic devices, which may include: memory, processor.
[0185] Memory is used to store one or more programs.
[0186] processor.
[0187] When one or more programs are executed by a processor, the electronic device can achieve the steps and corresponding technical effects when it performs the steps shown in the above method examples.
[0188] In the embodiments provided in this application, it should be understood that the disclosed systems and methods can also be implemented in other ways. The system embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0189] In addition, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0190] If a function is implemented as a software module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a program product. This program product is stored in a computer-readable storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0191] The above are merely preferred embodiments of this application and are not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
[0192] It will be apparent to those skilled in the art that this application is not limited to the details of the exemplary embodiments described above, and that this application can be implemented in other specific forms without departing from the spirit or essential characteristics of this application. Therefore, the embodiments should be considered illustrative and non-limiting in all respects, and the scope of this application is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within this application. No reference numerals in the claims should be construed as limiting the scope of the claims.
Claims
1. A task processing method, characterized in that, include: The data processing module obtains task data; the task data includes a fund number and a task function number; wherein, the fund number has a mapping relationship with at least one task function; the task function number represents the corresponding task function; The data processing module confirms the functional status of the task data; the functional status is used to indicate whether the task data is an abnormal task. The data processing module compares the number of requests per unit time for the task function number with a request threshold per unit time; if the number of requests per unit time is greater than the request threshold per unit time, the task data is confirmed to be in an overloaded state; if the number of requests per unit time is less than or equal to the request threshold per unit time, the task data is confirmed to be in an unoverloaded state. The data processing module determines the frequency evaluation factor of the task function number based on the overload state or the non-overload state. The data processing module obtains a task element table of the task data; the task element table includes the priority, frequency evaluation factor, latest execution time, and function status corresponding to the task function number; the priority represents the importance of processing the task corresponding to the task function number; the frequency evaluation factor is used to represent the request frequency of the corresponding task function number; the latest execution time represents the acceptable latest execution time of the corresponding task function number. The task sorting module calculates the processing sorting value corresponding to the task function number based on the task element table; The task processing module processes the corresponding task data in sequence based on the processing sort value corresponding to each task function number.
2. The method according to claim 1, characterized in that, Also includes: The task time statistics module calculates the execution time experience value of the task function number by smoothing the current time data and the historical time data of the task function number. The steps for the data processing module to confirm the functional status of the task data include: The data processing module compares the execution time experience value with the fault threshold; if the execution time experience value is greater than the fault threshold, the functional status of the task data is confirmed to be abnormal; if the execution time experience value is less than or equal to the fault threshold, the functional status of the task data is confirmed to be normal.
3. The method according to claim 2, characterized in that, The step of the task time statistics module obtaining the empirical value of the execution time of the task function number through smoothing processing based on the current time data and the historical time data of the task function number includes: The task time statistics module calculates the execution time experience value of the task function number through smoothing processing based on the initial experience value of the task function number, the smoothing factor, the current time data of the task function number, and the previous time data of the task function number.
4. The method according to claim 1, characterized in that, The step of the task sorting module calculating the processing sorting value corresponding to the task data based on the task element table includes: The task sorting module determines the delay factor of the task function number based on the task arrival time and the latest execution time. The task sorting module determines the corresponding delay coefficient based on the delay factor of the task function number; The task sorting module takes the priority, the frequency evaluation factor, the delay coefficient, and the functional status as input parameters to the multi-factor fusion scheduling model, and calculates the corresponding processing sorting value of the task data.
5. The method according to claim 2, characterized in that, After the step of the task processing module processing the corresponding task data in sequence based on the processing sort value corresponding to each task function number, the method further includes: After the task processing module completes the processing of the corresponding task data, it synchronizes the completion time of the corresponding task function number to the task time statistics module. The task time consumption statistics module determines the current time consumption data of the corresponding task function number based on the start time and completion time of the task function number.
6. A task processing system, characterized in that, include: The data processing module is used to obtain task data; The task data includes a fund number and a task function number; wherein, the fund number has a mapping relationship with at least one task function; the task function number represents the corresponding task function; the functional status of the task data is confirmed; the functional status is used to indicate whether the task data is an abnormal task; the number of requests per unit time for the task function number is compared with a request threshold per unit time; if the number of requests per unit time is greater than the request threshold per unit time, the task data is confirmed to be in an overloaded state; if the number of requests per unit time is less than or equal to the request threshold per unit time, the task data is confirmed to be in a non-overloaded state; based on the overloaded state or the non-overloaded state, the frequency evaluation factor of the task function number is determined; a task element table of the task data is obtained; the task element table includes the priority, frequency evaluation factor, latest execution time, and functional status corresponding to the task function number; the priority represents the processing importance of the task corresponding to the task function number; the frequency evaluation factor is used to represent the request frequency of the corresponding task function number; the latest execution time represents the acceptable latest execution time of the corresponding task function number. The task sorting module is used to calculate the processing sorting value corresponding to the task function number based on the task element table. The task processing module is used to process the corresponding task data in sequence based on the processing sorting value corresponding to each task function number.
7. The task processing system according to claim 6, characterized in that, Also includes: Task time statistics module; The task time consumption statistics module is used to calculate the execution time experience value of the task function number by smoothing the current time consumption data and the historical time consumption data of the task function number. The data processing module is specifically used to compare the execution time experience value with the fault threshold; if the execution time experience value is greater than the fault threshold, then the functional status of the task data is confirmed to be abnormal. If the empirical value of the execution time is less than or equal to the fault threshold, then the functional status of the task data is confirmed to be normal.
8. The task processing system according to claim 6, characterized in that, The task sorting module is specifically used to determine the delay factor of the task function number based on the task arrival time and the latest execution time; determine the corresponding delay coefficient based on the delay factor of the task function number; and input the priority, the frequency evaluation factor, the delay coefficient, and the function status as input parameters into a multi-factor fusion scheduling model to calculate the corresponding processing sorting value of the task data.
9. A program product, characterized in that, When the program product is executed by the processor, it implements the method as described in any one of claims 1-5.