Task batch execution method and device, electronic equipment and readable storage medium

By determining the optional execution cycle and the number of tasks executed per second based on the binomial theorem, the system resource occupation problem caused by high-frequency task execution is solved, and the effective utilization of system resources and efficient and stable execution of tasks are achieved.

CN119621258APending Publication Date: 2025-03-14BEIYIN FINANCIAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411419393.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-12
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

Under the high-frequency task execution requirements, system resources are severely occupied, resulting in overloading of computing resources and degrading application performance, unable to effectively exert system performance, and wasting a large amount of computing resources.

Method used

By responding to task batch execution instructions, multiple optional execution cycles are determined according to the binomial theorem, the current number of single task processing is queried, the number of tasks executed per second corresponding to each optional execution cycle is calculated, the total number of tasks to be processed, the number of tasks executed per second is determined, and the batch processing operations of tasks executed in reference to the target execution cycle are measured.

Benefits of technology

It realizes the effective utilization of system resources, ensures that the system pressure is within the affordable range, avoids waste of execution resources caused by fixed intervals, and improves the efficient and stable execution of tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119621258A_ABST
    Figure CN119621258A_ABST
Patent Text Reader

Abstract

The invention discloses a task batch execution method and device, electronic equipment and a readable storage medium, and relates to the technical field of the Internet, a binomial theorem and the actual processing capacity of a system are combined to determine an execution strategy, the processing capacity of the system can be comprehensively utilized, the pressure can be ensured to be within a bearable range, and the execution efficiency is improved. And efficient and stable execution of tasks is realized. The method comprises the following steps: in response to a task batch execution instruction, determining a plurality of selectable execution cycles according to a binomial theorem; querying the current single task processing quantity, and calculating the quantity of tasks executed per second corresponding to each selectable execution cycle to obtain a plurality of quantities of tasks executed per second; counting the total quantity of current to-be-processed tasks, and determining a target quantity of tasks executed per second in the plurality of quantities of tasks executed per second based on the total quantity of the to-be-processed tasks; and taking the selectable execution cycle corresponding to the target number of tasks executed per second as a target execution cycle, and executing batch processing operation of the tasks by referring to the target execution cycle.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of Internet technology, and in particular to a method, device, electronic device and readable storage medium for batch execution of tasks. Background Art

[0002] In all walks of life, especially in the banking industry, batch processing is an important business process that involves unified and efficient processing of a large amount of accumulated information. In the banking industry, common application scenarios include sending various notification messages at regular intervals, agency payment and deduction services, etc. With the continuous development of Internet technology, in order to realize this processing process, patrol or guard mode is usually used for startup and management.

[0003] In related technologies, batch processing of tasks is usually started by patrolling or guarding, aiming at batch processing of accumulated information, such as sending SMS messages, social platform information, batch notification messages in applications, batch payment and deduction, etc. Specifically, periodic inspection and execution of tasks are achieved through a mechanism similar to an infinite loop combined with sleep, or time expressions are used for scheduled scheduling, or external scheduling tools are relied upon for management.

[0004] In the process of implementing the related technology, the inventors realized that the related technology has at least the following technical problems:

[0005] Under high-frequency task execution requirements, such as executing once every two seconds, it will lead to serious occupation and consumption of system resources. Long-term high-frequency execution may not only lead to overload of computing resources, but also may cause degradation of application performance due to frequent data processing, and easily cause small batches of data to run idle, which cannot effectively exert the advantages of system performance and wastes a lot of computing resources. Summary of the invention

[0006] In view of this, the present application provides a task batch execution method, device, electronic device and readable storage medium, the main purpose of which is to solve the problem that the advantages of system performance cannot be effectively utilized and a large amount of computing resources are wasted.

[0007] According to the first aspect of the present application, a method for batch execution of tasks is provided, the method comprising:

[0008] In response to the task batch execution instruction, a plurality of optional execution cycles are determined according to the binomial theorem;

[0009] Query the current number of single task processing, and use the number of single task processing to calculate the number of tasks executed per second corresponding to each optional execution cycle to obtain multiple numbers of tasks executed per second;

[0010] Counting the total amount of tasks to be processed currently, and determining a target number of tasks to be executed per second from among the multiple numbers of tasks to be executed per second based on the total amount of tasks to be processed;

[0011] The optional execution period corresponding to the target number of tasks executed per second is used as the target execution period, and the batch processing operation of the tasks is executed with reference to the target execution period.

[0012] Optionally, determining a plurality of optional execution cycles according to the binomial theorem includes:

[0013] The formula of the binomial theorem is transformed to obtain a period calculation formula, which includes n+1 combination numbers Number of combinations The value of r is 0 to n;

[0014] Obtain multiple preset values, and use each of the preset values ​​to assign a value to n in the period calculation formula to obtain an assignment result corresponding to each of the preset values, wherein the assignment result corresponding to each of the preset values ​​includes at least two calculation results;

[0015] For each assignment result corresponding to the preset value, each calculation result included in the assignment result is used as an execution interval to obtain at least two execution intervals corresponding to the assignment result, and a selectable execution cycle is formed using the at least two execution intervals;

[0016] The above process of forming the optional execution cycle is repeated to obtain the multiple optional execution cycles constructed based on the assignment results corresponding to the multiple preset values.

[0017] Optionally, the formula of the binomial theorem is deformed to obtain a period calculation formula, including:

[0018] According to the formula of the binomial theorem, an expansion of the binomial theorem is determined, wherein the expansion includes n+1 general terms, each of which includes a combination number The power of variable a and the power of variable b;

[0019] In the expansion, the values ​​of the variables a and b in each general term are set to 1, and the combination number in each general term is set to 0 to n. Assign r to obtain the following expansion after assignment:

[0020]

[0021] The expanded expression after assignment is used as the period calculation formula.

[0022] Optionally, each of the preset values ​​is used to assign a value to n in the period calculation formula to obtain an assignment result corresponding to each of the preset values, including:

[0023] For each of the plurality of preset values, in the period calculation formula, the preset value pair is used. Assign values ​​and get the values ​​after assignment The calculation results of

[0024] Continue to use the preset value pair in the cycle calculation formula Assign values ​​and get the values ​​after assignment until the calculation results are completed. Assign and obtain The calculation results of

[0025] The at least two currently obtained calculation results are used as the assignment results obtained by assigning the period calculation formula with the preset value.

[0026] Optionally, the calculating the number of tasks executed per second corresponding to each optional execution cycle by using the number of tasks processed at a single time includes:

[0027] For each of the optional execution cycles, counting the number of execution intervals included in the optional execution cycle;

[0028] Reading the interval duration of each execution interval included in the optional execution cycle respectively, and calculating the total interval duration of the execution intervals included in the optional execution cycle;

[0029] A first product of the single task processing quantity and the interval quantity is calculated, and a first ratio of the first product to the total interval duration is calculated, and the first ratio is used as the number of tasks executed per second corresponding to the optional execution cycle.

[0030] Optionally, the determining a target number of tasks executed per second from among the multiple numbers of tasks executed per second based on the total number of tasks to be processed includes:

[0031] Querying the preset processing time associated with the total amount of tasks to be processed, and calculating a second ratio between the total amount of tasks to be processed and the preset processing time;

[0032] The absolute values ​​of the differences between the second ratio and each of the numbers of tasks executed per second are calculated respectively, and the number of tasks executed per second with the smallest absolute value of the difference among the multiple numbers of tasks executed per second is determined as the target number of tasks executed per second.

[0033] Optionally, the batch processing operation of executing tasks with reference to the target execution period includes:

[0034] Query and read the preset execution standard associated with the total amount of tasks to be processed;

[0035] When it is determined by reading that the preset execution standard includes a preset execution number, taking the preset execution number as the designated number, reading at least two target execution intervals included in the target execution cycle, extracting the designated number of designated execution intervals from the at least two target execution intervals, and performing a batch processing operation of the task according to the designated number of designated execution intervals, wherein the duration of the designated execution interval is less than the duration of other execution intervals in the target execution cycle except the designated number of designated execution intervals;

[0036] When it is determined by reading that the preset execution standard includes a preset interval duration, at least two target execution intervals included in the target execution cycle are read, and the second product of each target execution interval and the second ratio is calculated respectively to obtain at least two second products, and the first second product among the at least two second products is determined, and the number of tasks of the first second product is executed, and after the preset interval duration is separated, the next second product of the first second product is determined among the at least two second products, and the number of tasks of the next second product is continued to be executed until each second product is traversed, thereby realizing batch processing operation of tasks;

[0037] When it is determined through reading that the preset execution standard is empty, at least two target execution intervals included in the target execution cycle are read, and batch processing operations of tasks are executed according to the at least two target execution intervals.

[0038] According to a second aspect of the present application, a task batch execution device is provided, the device comprising:

[0039] A determination module, configured to determine a plurality of optional execution cycles according to the binomial theorem in response to a task batch execution instruction;

[0040] A calculation module, used to query the current number of single task processing, and use the single task processing number to calculate the number of tasks executed per second corresponding to each optional execution cycle to obtain multiple numbers of tasks executed per second;

[0041] A statistics module, used for counting the total amount of tasks to be processed currently, and determining a target number of tasks to be executed per second from among the multiple numbers of tasks to be executed per second based on the total amount of tasks to be processed;

[0042] The execution module is used to take the optional execution period corresponding to the target number of tasks executed per second as the target execution period, and perform batch processing operations of the tasks with reference to the target execution period.

[0043] Optionally, the determining module is used to transform the formula of the binomial theorem to obtain a period calculation formula, and the period calculation formula includes n+1 combination numbers Number of combinations The value of r is 0 to n; obtaining multiple preset values, using each of the preset values ​​to assign n in the cycle calculation formula, and obtaining the assignment result corresponding to each of the preset values, wherein each of the assignment results corresponding to the preset values ​​includes at least two calculation results; for each of the assignment results corresponding to the preset values, taking each of the calculation results included in the assignment result as an execution interval, obtaining at least two execution intervals corresponding to the assignment result, and forming an optional execution cycle using the at least two execution intervals; repeating the above process of forming optional execution cycles, obtaining the multiple optional execution cycles constructed based on the assignment results corresponding to the multiple preset values.

[0044] Optionally, the determining module is used to determine an expansion of the binomial theorem according to the formula of the binomial theorem, wherein the expansion includes n+1 general terms, each of which includes a combination number C r n , the power of variable a and the power of variable b; in the expansion, the value of variable a and variable b in each of the general terms is set to 1, and the combination number in each of the general terms is set to 0 to n. Assign r to obtain the following expansion after assignment:

[0045]

[0046] The expanded expression after assignment is used as the period calculation formula.

[0047] Optionally, the determining module is used to, for each preset value among the multiple preset values, use the preset value pair in the period calculation formula Assign values ​​and get the values ​​after assignment The calculation result of the cycle calculation formula continues to use the preset value pair Assign values ​​and get the values ​​after assignment until the calculation results are completed. Assign and obtain The calculation result; using the at least two calculation results currently obtained as the assignment result obtained after assigning the period calculation formula using the preset value.

[0048] Optionally, the calculation module is used to count the number of execution intervals included in each optional execution cycle; read the interval duration of each execution interval included in the optional execution cycle respectively, and calculate the total interval duration of the execution intervals included in the optional execution cycle; calculate the first product of the single task processing number and the interval number, and calculate the first ratio of the first product to the total interval duration, and use the first ratio as the number of tasks executed per second corresponding to the optional execution cycle.

[0049] Optionally, the statistical module is used to query the preset processing time associated with the total amount of tasks to be processed, calculate a second ratio between the total amount of tasks to be processed and the preset processing time; calculate the absolute value of the difference between the second ratio and each of the numbers of tasks executed per second, and determine the number of tasks executed per second with the smallest absolute value of the difference among the multiple numbers of tasks executed per second as the target number of tasks executed per second.

[0050] Optionally, the execution module is used to query and read the preset execution standard associated with the total amount of tasks to be processed; when it is determined by reading that the preset execution standard includes a preset number of executions, the preset number of executions is used as the specified number, at least two target execution intervals included in the target execution cycle are read, the specified number of specified execution intervals are extracted from the at least two target execution intervals, and batch processing operations of tasks are performed according to the specified number of specified execution intervals, the duration of the specified execution interval is less than the duration of other execution intervals in the target execution cycle except the specified number of specified execution intervals; when it is determined by reading that the preset execution standard includes a preset interval duration, the target execution cycle is read. At least two target execution intervals, respectively calculating the second product of each target execution interval and the second ratio to obtain at least two second products, and determining the first second product among the at least two second products, executing the first second product-numbered tasks, and after the preset interval length, determining the next second product of the first second product among the at least two second products, and continuing to execute the next second product-numbered tasks until each second product is traversed to realize batch processing operations of tasks; when it is determined by reading that the preset execution standard is empty, reading at least two target execution intervals included in the target execution cycle, and executing batch processing operations of tasks according to the at least two target execution intervals.

[0051] According to a third aspect of the present application, an electronic device is provided, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any one of the methods described in the first aspect when executing the computer program.

[0052] According to a fourth aspect of the present application, a readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of any one of the methods described in the first aspect are implemented.

[0053] By means of the above technical scheme, the present application provides a method, device, electronic device and readable storage medium for batch execution of tasks. The present application responds to a task batch execution instruction, determines multiple optional execution cycles according to the binomial theorem, queries the current number of single task processing, uses the number of single task processing to calculate the number of tasks executed per second corresponding to each optional execution cycle, obtains multiple numbers of tasks executed per second, counts the current total number of tasks to be processed, and based on the total number of tasks to be processed, determines a target number of tasks executed per second from the multiple numbers of tasks executed per second, takes the optional execution cycle corresponding to the target number of tasks executed per second as the target execution cycle, and executes batch processing operations of tasks with reference to the target execution cycle. The binomial theorem and the actual processing capacity of the system are combined to determine the strategy for batch execution of tasks, which can not only make full use of the processing capacity of the system, but also ensure that the pressure of the system is within an acceptable range, and at the same time avoid the waste of execution resources caused by the use of fixed intervals, thereby achieving efficient and stable execution of tasks.

[0054] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present application. Also, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0056] Figure 1 A schematic diagram of a task batch execution method provided in an embodiment of the present application is shown;

[0057] Figure 2A A schematic diagram of another method for executing tasks in batches provided in an embodiment of the present application is shown;

[0058] Figure 2B A schematic diagram of a process flow of another method for batch execution of tasks provided in an embodiment of the present application is shown;

[0059] Figure 3 A schematic diagram of the structure of a task batch execution device provided in an embodiment of the present application is shown;

[0060] Figure 4 A schematic diagram of the device structure of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0061] The exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present application and to fully convey the scope of the present application to those skilled in the art.

[0062] The present application embodiment provides a method for batch execution of tasks, such as Figure 1 As shown, the method includes:

[0063] 101. In response to a task batch execution instruction, determine a plurality of optional execution cycles according to the binomial theorem.

[0064] The embodiments of the present application can be applied to a system, which can be a system that provides users with financial, shopping, local life and other services. The system is equipped with a server, which can be an independent server or a server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms, etc., so that the system has the ability to execute tasks in batches.

[0065] In the embodiment of the present application, the system can be an online service system provided by the relevant organization for the convenience of users. The system can provide users with corresponding services, such as order payment services, transfer services, etc. for users to use, and the system will also provide users with proactive services such as message push, so that users can be informed of the latest news of the service in a timely manner. Among them, the system usually executes tasks in a batch processing manner to realize centralized processing of tasks and avoid wasting system resources. For example, in the banking industry, the banking system will batch process the accumulated information, such as sending SMS messages, in-application notification messages, etc. at regular intervals, or batch money payment, deduction, etc. The batch execution of tasks usually sets an execution time, such as starting to execute tasks in batches when a certain number of tasks are accumulated, or when a certain period of time has passed since the last batch execution of tasks, or users and staff request to perform batch operations on the currently accumulated tasks, etc. Therefore, in the embodiment of the present application, a task batch execution condition is set. When it is detected that the current event meets the batch execution condition, the system will determine that a task batch execution instruction has been received. In response to the task batch execution instruction, the system will determine multiple optional execution cycles according to the binomial theorem to determine which method to use for batch execution of tasks in the future. Among them, the task batch execution condition can be a task volume threshold, so that when the currently accumulated task volume reaches the task volume threshold, it can be determined that the task batch execution instruction has been received; or it can also be a duration threshold, so that when the time from the last batch execution of tasks reaches the duration threshold, it can be determined that the task batch execution instruction has been received; or it can also be receiving a manual command, etc. This application does not limit the specific content of the task batch execution condition.

[0066] Furthermore, when executing tasks in batches, how to determine the execution cycle of these batch tasks has always been a key issue in system design and optimization. The applicant recognizes that although the traditional fixed-interval execution method is simple and easy to implement, it often ignores the changes in the actual system load and task characteristics, resulting in low resource utilization and low execution efficiency. Therefore, in an embodiment of the present application, multiple optional execution cycles are determined according to the binomial theorem. The binomial theorem is a mathematical theorem that describes the relationship between the coefficients of each term after a binomial expansion. In an embodiment of the present application, the characteristics and calculation method of the binomial theorem are used to determine the cycle of batch execution of tasks, that is, the execution interval of the task is regarded as a term in a binomial expansion, and the optimal execution interval sequence is determined by calculating the coefficients and combinations of each term, which not only avoids the waste of extensive, fixed-interval execution resources determined by brainstorming, but also improves the efficiency of single execution.

[0067] Among them, the optional execution cycle includes at least two execution intervals, which are used to indicate the method of batch executing tasks. For example, assuming that the optional execution cycle includes 1 and 6, if it is necessary to execute tasks in batches according to the optional execution cycle in the future, a certain amount of tasks can be executed every 1 second, and then a certain amount of tasks can be executed every 6 seconds; or, assuming that the system can execute 20 tasks in 1 second, it can also execute 1×20=20 tasks for the first time, and then after a certain interval, execute 6×20=120 tasks next time, and so on. The present application does not specifically limit the content included in each optional execution cycle, and further, does not specifically limit how to use the optional execution cycle to perform batch processing of tasks in the future.

[0068] 102. Query the current number of single task processing, and use the number of single task processing to calculate the number of tasks executed per second corresponding to each optional execution cycle to obtain multiple numbers of tasks executed per second.

[0069] In an embodiment of the present application, in order to more accurately determine the execution cycle, the system needs to query the current number of single task processing. The number of single task processing reflects the actual processing capacity of the system in the current state and is an important basis for determining the number of tasks executed per second.

[0070] Furthermore, after determining the current number of single task processing, based on the current number of single task processing, the system will calculate the number of tasks executed per second corresponding to each optional execution cycle, and understand how many tasks the system needs to process per second in each optional execution cycle, so as to subsequently select the optional execution cycle that is closest to the system capacity. This can not only make full use of the system's processing capacity, but also ensure that the system pressure is within an acceptable range.

[0071] 103. Count the total number of tasks currently to be processed, and determine a target number of tasks to be executed per second from among multiple numbers of tasks to be executed per second based on the total number of tasks to be processed.

[0072] In the embodiment of the present application, on the basis of determining the number of tasks executed per second corresponding to each optional execution cycle, the system also needs to count the total number of tasks to be processed. The total number of tasks to be processed reflects the task load of the system. Combining the total number of tasks to be processed and the number of tasks executed per second, the system will select an optimal number of tasks executed per second as the target number of tasks executed per second to ensure that the system's processing capacity, task priority and dependency are comprehensively considered to ensure efficient execution of tasks.

[0073] 104. The optional execution period corresponding to the target number of tasks executed per second is used as the target execution period, and batch processing operations of the execution tasks are performed with reference to the target execution period.

[0074] In the embodiment of the present application, the system uses the optional execution cycle corresponding to the target number of tasks executed per second as the target execution cycle, which not only ensures the effective use of system resources, but also ensures the efficient execution of tasks.

[0075] Furthermore, after determining the target execution cycle, the system will refer to the batch processing operation of the cycle execution task, so that the tasks in the task queue are executed in batches according to the execution strategy indicated by the target execution cycle, thereby achieving efficient and stable execution of the tasks.

[0076] The method provided in the embodiment of the present application responds to a task batch execution instruction, determines multiple optional execution cycles according to the binomial theorem, queries the current single task processing number, uses the single task processing number to calculate the number of tasks executed per second corresponding to each optional execution cycle, obtains multiple numbers of tasks executed per second, counts the current total number of tasks to be processed, and based on the total number of tasks to be processed, determines a target number of tasks executed per second from the multiple numbers of tasks executed per second, uses the optional execution cycle corresponding to the target number of tasks executed per second as the target execution cycle, executes batch processing operations of tasks with reference to the target execution cycle, combines the binomial theorem with the actual processing capacity of the system to determine a strategy for task batch execution, which can not only make full use of the processing capacity of the system, but also ensure that the pressure of the system is within an acceptable range, and at the same time avoid the waste of execution resources caused by the use of fixed intervals, thereby achieving efficient and stable execution of tasks.

[0077] Further, as a refinement and extension of the specific implementation of the above embodiment, in order to fully illustrate the specific implementation process of this embodiment, the embodiment of the present application provides another task batch execution method, such as Figure 2A As shown, the method includes:

[0078] 201. In response to a task batch execution instruction, a formula of the binomial theorem is transformed to obtain a period calculation formula.

[0079] The embodiment of the present application can be applied to the system. The relevant content of the system can be found in the content of the above step 101, which will not be repeated here.

[0080] In the system, determining the appropriate execution cycle is crucial to ensure efficient and orderly batch execution of tasks. Traditional execution cycle determination methods are often based on experience or fixed patterns, lacking flexibility and accuracy. Assuming that the system data volume is an average of 5,000 records per minute, and the maximum single batch execution is 1,000 records, then the time interval should be set to 5s, 1,000 records each time, 12 times per minute, the maximum throughput is 12,000 records, and 7,000 redundancies are generated. In actual business scenarios, data is also non-uniform and non-linear. It often requires a business peak in a certain morning time period and a trough in the evening time period, resulting in insufficient peak batches, delayed business processing, and idling of trough threads. Therefore, the present application proposes a method for determining the batch execution cycle of tasks based on the binomial theorem, which can dynamically generate multiple optional execution cycles according to the system status and task characteristics, and determine the optimal execution cycle from them.

[0081] In the embodiment of the present application, the formula of the binomial theorem needs to be transformed to obtain a cycle calculation formula suitable for the task batch execution cycle. Specifically, it is necessary to determine the expansion of the binomial theorem based on the formula of the binomial theorem, where the expansion includes n+1 general terms, each of which includes the combination number The power of variable a and the power of variable b. Next, we need to further set the values ​​of variable a and variable b in each general term to 1 in the expansion, and use 0 to n to set the number of combinations in each general term. Assign a value to r to obtain the expanded form after assignment as shown in the following formula 1, and use the expanded form after assignment as the period calculation formula:

[0082] Formula 1:

[0083] Among them, the cycle calculation formula includes n+1 combination numbers Number of combinations The value of r ranges from 0 to n, and the number of combinations is It represents the total number of combinations of randomly selecting r elements from n different elements and forming a group.

[0084] 202. According to the cycle calculation formula, multiple optional execution cycles are formed.

[0085] In the embodiment of the present application, after obtaining the cycle calculation formula, it is necessary to further generate multiple optional execution cycles according to the cycle calculation formula. First, obtain multiple preset values, and use each preset value to assign n in the cycle calculation formula to obtain the assignment result corresponding to each preset value. Specifically, for each preset value in the multiple preset values, when performing the assignment operation, refer to the above formula 1, and use the preset value pair n in the cycle calculation formula. Assign values ​​and get the values ​​after assignment The calculation result of the cycle calculation formula continues to use the preset value pair Assign values ​​and get the values ​​after assignment until the calculation results are completed. Assign and obtain The calculation result of the period calculation formula is obtained by using the at least two calculation results currently obtained as the assignment result obtained by assigning the period calculation formula with the preset values. Specifically, taking multiple preset values ​​1-7 as an example, it is necessary to use 1-7 to assign values ​​to Formula 1 respectively, where:

[0086] When n is assigned a value of 1, the cycle calculation formula after the assignment is: The calculation results are 2, 1 and 1 respectively;

[0087] When n is assigned a value of 2, the cycle calculation formula after the assignment is: The calculation results are 3, namely 1, 2 and 1;

[0088] When n is assigned a value of 3, the cycle calculation formula after the assignment is: The calculation results are 4, namely 1, 3, 3 and 1;

[0089] When n is assigned a value of 4, the cycle calculation formula after the assignment is: The calculation results are 5, namely 1, 4, 6, 4 and 1;

[0090] When n is assigned a value of 5, the cycle calculation formula after the assignment is: The calculation results are 6, namely 1, 5, 10, 10, 5 and 1;

[0091] When n is assigned a value of 6, the cycle calculation formula after the assignment is: The calculated results are 7, namely 1, 6, 15, 20, 15, 6 and 1;

[0092] When n is assigned a value of 6, the cycle calculation formula after the assignment is: The calculation results obtained are 8, namely 1, 7, 21, 35, 35, 21, 7 and 1.

[0093] In this way, by obtaining multiple preset values ​​and substituting these values ​​into n in the formula in turn, different assignment results can be obtained. Each assignment result includes at least two calculation results. For each assignment result corresponding to the preset value, each calculation result included in the assignment result is used as an execution interval to obtain at least two execution intervals corresponding to the assignment result, and an optional execution cycle is formed using at least two execution intervals. By repeating this process, multiple optional execution cycles based on multiple preset values ​​are obtained, and these cycles cover different task execution requirements and system processing capabilities.

[0094] 203. Query the current number of single task processing, and use the number of single task processing to calculate the number of tasks executed per second corresponding to each optional execution cycle to obtain multiple numbers of tasks executed per second.

[0095] In an embodiment of the present application, in order to determine the task execution efficiency under each optional execution cycle, the embodiment of the present application calculates the number of tasks executed per second corresponding to each optional execution cycle. Specifically, for each optional execution cycle, it is necessary to count the number of intervals of the execution intervals included in the optional execution cycle, read the interval duration of each execution interval included in the optional execution cycle respectively, calculate the total interval duration of the execution intervals included in the optional execution cycle, calculate the first product of the number of single task processing and the number of intervals, and calculate the first ratio of the first product to the total interval duration, and use the first ratio as the number of tasks executed per second corresponding to the optional execution cycle. Continuing with the example of multiple preset values ​​1-7 described in step 202 above, assuming that the current number of single task processing is 1000, the calculated number of tasks executed per second corresponding to each optional execution cycle is as follows:

[0096] When n=1, it is executed twice, taking 1+1=2s, so the number of tasks executed per second is 2×1000 / 2=1000 tasks per second;

[0097] When n=2, it is executed 3 times, taking 1+2+1=4s, so the number of tasks executed per second is 3×1000 / 4=750 tasks / second;

[0098] When n=3, it is executed 4 times, taking 1+3+3+1=8s, so the number of tasks executed per second is 4×1000 / 8=500 tasks per second;

[0099] When n=4, it is executed 5 times, which takes 1+4+6+4+1=16s. Then the number of tasks executed per second is 5×1000 / 16=312.5 tasks per second.

[0100] When n=5, it is executed 6 times, taking 1+5+10+10+5+1=32s, so the number of tasks executed per second is 6×1000 / 32=187.5 tasks per second;

[0101] When n=6, it is executed 7 times, taking 1+6+15+20+15+6+1=64s, so the number of tasks executed per second is 7×1000 / 64=109.375 tasks per second;

[0102] When n=7, it is executed 8 times, taking 1+7+21+35+35+21+7+1=128s, so the number of tasks executed per second is 8×1000 / 128=62.5 tasks per second.

[0103] By calculating the number of tasks executed per second corresponding to each optional execution cycle, we can intuitively understand how many tasks the system needs to process per second under different execution cycles, so as to subsequently select the optional execution cycle that is closest to the system capacity. This can not only make full use of the system's processing capacity, but also ensure that the system pressure is within an acceptable range.

[0104] In addition, it can be known from the above calculation that, because the known number of single task processing is fixed, the number of tasks processed in the cycle can be obtained according to the optional execution cycle, and the interval time is inversely proportional to the processing data, that is, the longer the interval time, the weaker the processing capacity. Therefore, it can be deduced that the general trend is that the larger the amount of data, the smaller the value of n, because the cycle is smooth and symmetrical, it can become a cyclic trend, matching the order of magnitude. Taking n=6 as an example, according to the binomial theorem, the first interval is 1s, the second interval is 6s, the third interval is 15s, the fourth interval is 20s, the fifth interval is 15s, the sixth interval is 6s, and the seventh interval is 1s, and it goes back and forth. In this way, peaks and troughs are artificially formed, that is, there are peaks for processing large amounts of data, and troughs for processing small amounts of data, which greatly improves the efficiency of single execution and reduces the number of executions throughout the day. Therefore, the technical solution of the present application can reduce the number of batch executions of tasks, achieving the effect of saving consultation and shaving peaks and valleys.

[0105] 204. Count the total number of tasks currently to be processed, and determine a target number of tasks to be executed per second from among multiple numbers of tasks to be executed per second based on the total number of tasks to be processed.

[0106] In the embodiment of the present application, on the basis of determining the number of tasks executed per second corresponding to each optional execution cycle, the system also needs to count the total number of tasks to be processed. The total number of tasks to be processed reflects the task load of the system. Combining the total number of tasks to be processed and the number of tasks executed per second, the system will select an optimal number of tasks executed per second as the target number of tasks executed per second to ensure that the system's processing capacity, task priority and dependency are comprehensively considered to ensure efficient execution of tasks.

[0107] Specifically, the preset processing time associated with the total amount of tasks to be processed can be queried, the second ratio between the total amount of tasks to be processed and the preset processing time can be calculated, the absolute value of the difference between the second ratio and each number of tasks executed per second can be calculated respectively, and the number of tasks executed per second with the smallest absolute value of the difference among multiple numbers of tasks executed per second can be determined as the target number of tasks executed per second.

[0108] Continuing with the above example, if the total number of tasks to be processed is 4000 and the preset processing time is 20 seconds, the second ratio calculated is 4000 / 20=200. In this way, it can be known through calculation that the absolute value of the difference between 187.5 and 200 is the smallest. Therefore, 187.5 can be used as the target number of tasks to be executed per second.

[0109] 205. The optional execution period corresponding to the target number of tasks executed per second is used as the target execution period, and the batch processing operation of the execution tasks is performed with reference to the target execution period.

[0110] In an embodiment of the present application, after the target number of tasks executed per second is determined, the optional execution period corresponding to the target number of tasks executed per second can be used as the target execution period, and the batch processing operation of the execution tasks can be performed with reference to the target execution period.

[0111] The system can also be set with preset execution standards, which can be set by the system administrator or user according to actual needs to guide the specific execution method of tasks in the batch processing process. Therefore, in addition to determining the appropriate execution cycle, the system also needs to guide the actual execution process of the task based on the preset execution standards, that is, to adopt different task execution strategies according to the read execution standard content. The specific process is as follows:

[0112] First, the system queries and reads the preset execution standards associated with the total amount of tasks to be processed.

[0113] Subsequently, when it is determined that the preset execution standard includes a preset number of executions, the system will use the preset number of executions as the specified number, read at least two target execution intervals included in the target execution cycle, extract a specified number of specified execution intervals from the at least two target execution intervals, and perform batch processing operations of the tasks according to the specified number of specified execution intervals. Among them, the duration of the specified execution interval is less than the duration of other execution intervals in the target execution cycle except for the specified number of specified execution intervals, that is, the specified execution interval is the smaller target execution interval of at least two target execution intervals, so as to ensure that the task can be executed efficiently and orderly under limited resources. For example, assuming that the preset number of executions indicated by the preset execution standard is 4, if the target execution intervals included in the currently determined target execution cycle are 7, namely 1, 6, 15, 20, 15, 6 and 1, then 1, 6, 6 and 1 are selected as the specified execution intervals. In this way, if the total number of tasks to be processed is 4,000, if it is executed once every 5 seconds according to the traditional fixed interval, 1,000 items each time, it needs to be executed 4 times, which takes 20 seconds. If the technical solution of the present application is adopted to determine 1, 6, 6 and 1 as the specified execution intervals, it is also executed 4 times, and it only takes 1+6+6+1=14 seconds, which saves 6 seconds.

[0114] Accordingly, when the preset execution standard is read and determined to include a preset interval duration, the system will schedule the execution of tasks based on this preset interval duration, and use the target execution cycle to schedule the number of tasks to be executed each time. Specifically, the system needs to read at least two target execution intervals included in the target execution cycle, respectively calculate the second product of each target execution interval and the second ratio, obtain at least two second products, and determine the first second product of the at least two second products, execute the first second product number of tasks, and after the preset interval duration, determine the next second product of the first second product in the at least two second products, and continue to execute the next second product number of tasks until each second product is traversed to achieve batch processing of tasks. For example, assuming that the target execution cycle currently determined includes 7 target execution intervals, namely 1, 6, 15, 20, 15, 6 and 1, and the calculated second ratio is 20, then the first execution is 20, the second execution is 120, the third execution is 300, the fourth execution is 400, the fifth execution is 300, the sixth execution is 120, and the seventh execution is 20. In this cycle, only 7 executions are required, and 1280 tasks can be executed. If the traditional batch execution method with an interval of 5s is adopted, 1200 tasks also need to be executed 12 times, and the technical solution of the present application can reduce 5 times.

[0115] Accordingly, when the preset execution standard is read and determined to be empty, indicating that there is no specific execution standard restriction, the system will read at least two target execution intervals included in the target execution cycle, and execute the batch processing operation of the task according to at least two target execution intervals to ensure that the batch processing of the task can be carried out if system resources permit.

[0116] In summary, the technical solution of this application is summarized as follows:

[0117] See also Figure 2B First, multiple optional execution cycles are calculated according to the binomial theorem. Then, the number of tasks executed per second corresponding to each optional execution cycle is calculated based on the current number of single task processing. Finally, according to the current total number of tasks to be processed, the optional execution cycle is selected as the target execution cycle, and the batch processing operation of the task is performed with reference to the target execution cycle.

[0118] The method provided in the embodiment of the present application responds to a task batch execution instruction, determines multiple optional execution cycles according to the binomial theorem, queries the current single task processing number, uses the single task processing number to calculate the number of tasks executed per second corresponding to each optional execution cycle, obtains multiple numbers of tasks executed per second, counts the current total number of tasks to be processed, and based on the total number of tasks to be processed, determines a target number of tasks executed per second from the multiple numbers of tasks executed per second, uses the optional execution cycle corresponding to the target number of tasks executed per second as the target execution cycle, executes batch processing operations of tasks with reference to the target execution cycle, combines the binomial theorem with the actual processing capacity of the system to determine a strategy for task batch execution, which can not only make full use of the processing capacity of the system, but also ensure that the pressure of the system is within an acceptable range, and at the same time avoid the waste of execution resources caused by the use of fixed intervals, thereby achieving efficient and stable execution of tasks.

[0119] Further, as Figure 1 In a specific implementation of the method, the present application provides a task batch execution device, such as Figure 3 As shown, the device includes: a determination module 301, a calculation module 302, a statistics module 303 and an execution module 304.

[0120] The determination module 301 is used to determine a plurality of optional execution cycles according to the binomial theorem in response to the task batch execution instruction;

[0121] The calculation module 302 is used to query the current single task processing number, and use the single task processing number to calculate the number of tasks executed per second corresponding to each optional execution cycle to obtain multiple numbers of tasks executed per second;

[0122] The statistical module 303 is used to count the total amount of tasks to be processed currently, and determine the target number of tasks to be executed per second from the multiple numbers of tasks to be executed per second based on the total amount of tasks to be processed;

[0123] The execution module 304 is used to use the optional execution period corresponding to the target number of tasks executed per second as the target execution period, and perform batch processing operations on the execution tasks with reference to the target execution period.

[0124] In a specific application scenario, the determination module 301 is used to transform the formula of the binomial theorem to obtain a period calculation formula, which includes n+1 combination numbers Number of combinations The value of r is 0 to n; obtaining multiple preset values, using each of the preset values ​​to assign n in the cycle calculation formula, and obtaining the assignment result corresponding to each of the preset values, wherein each of the assignment results corresponding to the preset values ​​includes at least two calculation results; for each of the assignment results corresponding to the preset values, taking each of the calculation results included in the assignment result as an execution interval, obtaining at least two execution intervals corresponding to the assignment result, and forming an optional execution cycle using the at least two execution intervals; repeating the above process of forming optional execution cycles, obtaining the multiple optional execution cycles constructed based on the assignment results corresponding to the multiple preset values.

[0125] In a specific application scenario, the determination module 301 is used to determine the expansion of the binomial theorem according to the formula of the binomial theorem, wherein the expansion includes n+1 general terms, each of which includes a combination number The power of variable a and the power of variable b; in the expansion, the value of variable a and variable b in each general term is set to 1, and the combination number in each general term is set from 0 to n. Assign r to obtain the following expansion after assignment:

[0126]

[0127] The expanded expression after assignment is used as the period calculation formula.

[0128] In a specific application scenario, the determination module 301 is used to, for each of the multiple preset values, use the preset value in the period calculation formula to calculate the period. Assign values ​​and get the values ​​after assignment The calculation result of the cycle calculation formula continues to use the preset value pair Assign values ​​and get the values ​​after assignment until the calculation results are completed. Assign and obtain The calculation result; using the at least two calculation results currently obtained as the assignment result obtained after assigning the period calculation formula using the preset value.

[0129] In a specific application scenario, the calculation module 302 is used to count the number of execution intervals included in each optional execution cycle; read the interval duration of each execution interval included in the optional execution cycle respectively, and calculate the total interval duration of the execution intervals included in the optional execution cycle; calculate the first product of the number of single task processing and the number of intervals, and calculate the first ratio of the first product to the total interval duration, and use the first ratio as the number of tasks executed per second corresponding to the optional execution cycle.

[0130] In a specific application scenario, the statistical module 303 is used to query the preset processing time associated with the total amount of tasks to be processed, calculate the second ratio between the total amount of tasks to be processed and the preset processing time; calculate the absolute value of the difference between the second ratio and each of the numbers of tasks executed per second, and determine the number of tasks executed per second with the smallest absolute value of the difference among the multiple numbers of tasks executed per second as the target number of tasks executed per second.

[0131] In a specific application scenario, the execution module 304 is used to query and read the preset execution standard associated with the total amount of tasks to be processed; when it is determined by reading that the preset execution standard includes a preset number of executions, the preset number of executions is used as the specified number, and at least two target execution intervals included in the target execution cycle are read, and the specified number of specified execution intervals are extracted from the at least two target execution intervals, and the batch processing operation of the tasks is performed according to the specified number of specified execution intervals, and the duration of the specified execution interval is less than the duration of other execution intervals in the target execution cycle except the specified number of specified execution intervals; when it is determined by reading that the preset execution standard includes a preset interval duration, the target execution cycle is read. The at least two target execution intervals included in the period are calculated, and the second product of each target execution interval and the second ratio is calculated respectively to obtain at least two second products, and the first second product among the at least two second products is determined, and the tasks of the number of the first second product are executed, and after the preset interval length is separated, the next second product of the first second product is determined among the at least two second products, and the tasks of the number of the next second product are continued to be executed until each second product is traversed to realize the batch processing operation of the tasks; when it is determined by reading that the preset execution standard is empty, the at least two target execution intervals included in the target execution cycle are read, and the batch processing operation of the tasks is executed according to the at least two target execution intervals.

[0132] The device provided in the embodiment of the present application responds to a task batch execution instruction, determines multiple optional execution cycles according to the binomial theorem, queries the current single task processing number, uses the single task processing number to calculate the number of tasks executed per second corresponding to each optional execution cycle, obtains multiple numbers of tasks executed per second, counts the current total number of tasks to be processed, and based on the total number of tasks to be processed, determines a target number of tasks executed per second from the multiple numbers of tasks executed per second, takes the optional execution cycle corresponding to the target number of tasks executed per second as the target execution cycle, executes the batch processing operation of the tasks with reference to the target execution cycle, combines the binomial theorem with the actual processing capacity of the system to determine the strategy for task batch execution, which can not only make full use of the processing capacity of the system, but also ensure that the pressure of the system is within an acceptable range, and at the same time avoid the waste of execution resources caused by the use of fixed intervals, thereby achieving efficient and stable execution of tasks.

[0133] It should be noted that for other corresponding descriptions of the functional units involved in the task batch execution device provided in the embodiment of the present application, reference can be made to Figure 1 and FIG. 2A to FIG. 2B The corresponding description in will not be repeated here.

[0134] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0135] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0136] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

[0137] In an exemplary embodiment, see Figure 4 , and also provides an electronic device, which includes a bus, a processor, a memory and a communication interface, and may also include an input and output interface and a display device, wherein each functional unit can communicate with each other through the bus. The memory stores a computer program, and the processor is used to execute the program stored in the memory and execute the task batch execution method in the above embodiment.

[0138] A readable storage medium stores a computer program, which implements the steps of the task batch execution method when executed by a processor.

[0139] Through the description of the above implementation methods, those skilled in the art can clearly understand that the present application can be implemented by hardware, or by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each implementation scenario of the present application.

[0140] Those skilled in the art will appreciate that the accompanying drawings are merely schematic diagrams of a preferred implementation scenario, and the modules or processes in the accompanying drawings are not necessarily required for implementing the present application.

[0141] Those skilled in the art will appreciate that the modules in the device in the implementation scenario can be distributed in the device in the implementation scenario according to the implementation scenario description, or can be changed accordingly and located in one or more devices different from the implementation scenario. The modules in the above implementation scenario can be combined into one module, or can be further split into multiple sub-modules.

[0142] The above application serial numbers are for description only and do not represent the advantages or disadvantages of the implementation scenarios.

[0143] The above disclosure only discloses several specific implementation scenarios of the present application. However, the present application is not limited thereto, and any changes that can be conceived by technicians in this field should fall within the scope of protection of the present application.

Claims

1. A method for executing tasks in batches, characterized in that: include: In response to the task batch execution instruction, a plurality of optional execution cycles are determined according to the binomial theorem; Query the current number of single task processing, and use the number of single task processing to calculate the number of tasks executed per second corresponding to each optional execution cycle to obtain multiple numbers of tasks executed per second; Counting the total amount of tasks to be processed currently, and determining a target number of tasks to be executed per second from among the multiple numbers of tasks to be executed per second based on the total amount of tasks to be processed; The optional execution period corresponding to the target number of tasks executed per second is used as the target execution period, and the batch processing operation of the tasks is executed with reference to the target execution period.

2. The method according to claim 1, characterized in that The multiple optional execution cycles are determined according to the binomial theorem, including: The formula of the binomial theorem is transformed to obtain a period calculation formula, which includes n+1 combination numbers Number of combinations The value of r is 0 to n; Obtain multiple preset values, and use each of the preset values ​​to assign a value to n in the period calculation formula to obtain an assignment result corresponding to each of the preset values, wherein the assignment result corresponding to each of the preset values ​​includes at least two calculation results; For each assignment result corresponding to the preset value, each calculation result included in the assignment result is used as an execution interval to obtain at least two execution intervals corresponding to the assignment result, and a selectable execution cycle is formed using the at least two execution intervals; The above process of forming the optional execution cycle is repeated to obtain the multiple optional execution cycles constructed based on the assignment results corresponding to the multiple preset values.

3. The method according to claim 2, characterized in that The formula of the binomial theorem is deformed to obtain a period calculation formula, including: According to the formula of the binomial theorem, an expansion of the binomial theorem is determined, wherein the expansion includes n+1 general terms, each of which includes a combination number The power of variable a and the power of variable b; In the expansion, the values ​​of the variables a and b in each general term are set to 1, and the combination number in each general term is set to 0 to n. Assign r to obtain the following expansion after assignment: The expanded expression after assignment is used as the period calculation formula.

4. The method according to claim 3, characterized in that The step of respectively using each of the preset values ​​to assign a value to n in the period calculation formula to obtain an assignment result corresponding to each of the preset values ​​includes: For each of the plurality of preset values, in the period calculation formula, the preset value pair is used. Assign values ​​and get the values ​​after assignment The calculation results of Continue to use the preset value pair in the cycle calculation formula Assign values ​​and get the values ​​after assignment until the calculation results are completed. Assign and obtain The calculation results of The at least two currently obtained calculation results are used as the assignment results obtained by assigning the period calculation formula with the preset value.

5. The method according to claim 1, characterized in that: The calculating the number of tasks executed per second corresponding to each optional execution cycle by using the number of tasks processed at a single time includes: For each of the optional execution cycles, counting the number of execution intervals included in the optional execution cycle; Reading the interval duration of each execution interval included in the optional execution cycle respectively, and calculating the total interval duration of the execution intervals included in the optional execution cycle; A first product of the single task processing quantity and the interval quantity is calculated, and a first ratio of the first product to the total interval duration is calculated, and the first ratio is used as the number of tasks executed per second corresponding to the optional execution cycle.

6. The method according to claim 1, characterized in that The determining, based on the total amount of tasks to be processed, a target number of tasks executed per second from among the multiple numbers of tasks executed per second, comprises: Querying the preset processing time associated with the total amount of tasks to be processed, and calculating a second ratio between the total amount of tasks to be processed and the preset processing time; The absolute values ​​of the differences between the second ratio and each of the numbers of tasks executed per second are calculated respectively, and the number of tasks executed per second with the smallest absolute value of the difference among the multiple numbers of tasks executed per second is determined as the target number of tasks executed per second.

7. The method according to claim 6, characterized in that The batch processing operation of executing tasks with reference to the target execution period includes: Query and read the preset execution standard associated with the total amount of tasks to be processed; When it is determined by reading that the preset execution standard includes a preset execution number, taking the preset execution number as the designated number, reading at least two target execution intervals included in the target execution cycle, extracting the designated number of designated execution intervals from the at least two target execution intervals, and performing a batch processing operation of the task according to the designated number of designated execution intervals, wherein the duration of the designated execution interval is less than the duration of other execution intervals in the target execution cycle except the designated number of designated execution intervals; When it is determined by reading that the preset execution standard includes a preset interval duration, at least two target execution intervals included in the target execution cycle are read, and the second product of each target execution interval and the second ratio is calculated respectively to obtain at least two second products, and the first second product among the at least two second products is determined, and the number of tasks of the first second product is executed, and after the preset interval duration is separated, the next second product of the first second product is determined among the at least two second products, and the number of tasks of the next second product is continued to be executed until each second product is traversed, thereby realizing batch processing operation of tasks; When it is determined through reading that the preset execution standard is empty, at least two target execution intervals included in the target execution cycle are read, and batch processing operations of tasks are executed according to the at least two target execution intervals.

8. A task batch execution device, characterized in that: include: A determination module, configured to determine a plurality of optional execution cycles according to the binomial theorem in response to a task batch execution instruction; A calculation module, used to query the current number of single task processing, and use the single task processing number to calculate the number of tasks executed per second corresponding to each optional execution cycle to obtain multiple numbers of tasks executed per second; A statistics module, used for counting the total amount of tasks to be processed currently, and determining a target number of tasks to be executed per second from among the multiple numbers of tasks to be executed per second based on the total amount of tasks to be processed; The execution module is used to take the optional execution period corresponding to the target number of tasks executed per second as the target execution period, and perform batch processing operations of the tasks with reference to the target execution period.

9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.