Batch step execution adjustment method, computer readable medium and electronic equipment

By adjusting the task parallelism and instruction allocation number, the problem that traditional batch data processing technology cannot ensure that key steps are correctly executed and data is not lost when resources are insufficient, and the execution speed is adaptively adjusted when resources are sufficient to avoid resource waste.

CN119862034APending Publication Date: 2025-04-22WEBANK (CHINA)
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411939813.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-26
Publication Date
2025-04-22

AI Technical Summary

Technical Problem

Traditional batch data processing technology cannot ensure the correct execution of key steps and the data is not lost when the system resources are extremely insufficient. At the same time, the execution speed cannot be adaptively adjusted when the resources are sufficient, resulting in waste of resources.

Method used

By obtaining the system's current resource indicators and indicator weights, as well as the priority and historical instruction allocation number of each step, determine whether to adjust the task parallelism, and determine the instruction allocation number of each step based on the current resource indicators, indicator weights, priority and historical instruction allocation number to adjust the execution speed of the step.

Benefits of technology

It realizes that when the system resources are insufficient, ensures the correct execution of key steps and data is not lost, and adaptively adjusts the execution speed when the system resources are sufficient to avoid resource waste.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119862034A_ABST
    Figure CN119862034A_ABST
Patent Text Reader

Abstract

The invention discloses a batch step execution adjustment method, a computer readable medium and electronic equipment. The method comprises the following steps: acquiring a current resource index and a current index weight of a system, and a priority and a historical instruction distribution number of each step; according to the current resource index and the current index weight, whether the task parallelism degree is adjusted or not is determined; if the task parallelism degree is determined to be adjusted, determining the instruction distribution number of each step according to the current resource index, the current index weight, the priority of each step, the historical instruction distribution number and an instruction distribution algorithm; and finally, according to the instruction allocation number, allocating a corresponding number of instructions to each step so as to adjust the execution speed of each step, and pausing execution of some steps which are not allocated with instructions, or newly allocating instructions to some to-be-executed steps, that is, the number of the steps which are executed in parallel by the system is changed, so that the task parallelism degree is adjusted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of parallel step adjustment, and in particular, relates to a batch step execution adjustment method, a computer-readable medium and an electronic device. Background Art

[0002] Batch processing is commonly used in the financial field. The industry uses readers, processors, and writers to read, process, and write batch data to the database. Usually, in the configuration file of the batch system, all steps of the current batch will be uniformly orchestrated, and each step will be fairly allocated resources and processed according to the orchestration rules during the execution of the entire batch.

[0003] In traditional batch data processing technology, there are multiple tasks, each of which may include multiple steps. The number of tasks that can be executed at the same time is fixed, but some key steps will cause serious problems after data loss, and the fair scheduling algorithm cannot cope with the problem of correct execution of key steps and data loss when system resources are extremely insufficient. In addition, when the system is in a state of sufficient resources, the execution speed of traditional batch data processing technology cannot be adjusted adaptively, which easily leads to overall resource waste in the system.

[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present application, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention

[0005] The object of the present invention is to provide a method for adjusting the execution of batch steps, a computer-readable medium and an electronic device, so as to solve the problem that the execution speed during batch step processing cannot be adaptively adjusted.

[0006] According to one aspect of the present application, a method for adjusting execution of a batch step is provided, the method comprising:

[0007] Get the current resource index and current index weight of the system, as well as the priority of each step and the number of historical instruction allocations; the current resource index includes task parallelism, which is used to reflect the number of steps executed in parallel by the system in the first time period; the current index weight is the current weight corresponding to the current resource index;

[0008] Determine whether to adjust task parallelism based on current resource indicators and current indicator weights;

[0009] If it is determined to adjust the task parallelism, the number of instructions allocated to each step is determined based on the current resource index, the current index weight, the priority of each step, the number of historical instruction allocations and the instruction allocation algorithm; the execution speed of the step is related to the number of instructions allocated;

[0010] According to the instruction allocation quantity, a corresponding number of instructions are allocated to each step.

[0011] In some embodiments, whether to adjust the task parallelism is determined based on the current resource index and the current index weight, including: calculating the system's parallelism judgment parameter based on the current resource index and the current index weight; the parallelism judgment parameter is used to reflect the sufficiency of system resources; and determining whether to adjust the task parallelism based on the parallelism judgment parameter.

[0012] In some embodiments, when the size of the parallelism judgment parameter and the sufficiency of system resources are positively correlated, it is determined whether to adjust the task parallelism based on the parallelism judgment parameter, including: when the task parallelism is within a first threshold range, a target termination step is selected based on the priority of the step being executed, and the execution of the target termination step is suspended to reduce the task parallelism; when the task parallelism is within a second threshold range, the task parallelism is not adjusted; when the task parallelism is within a third threshold range, a target start step is selected based on the priority of the step to be executed, and the execution of the target start step is started to improve the task parallelism.

[0013] In some embodiments, after calculating the system's parallelism judgment parameter based on resource indicators and indicator weights, the method also includes: when the parallelism judgment parameter is greater than or equal to a recycling threshold, performing instruction recycling according to the priority of each step, and instruction recycling refers to recycling the instructions allocated to the step.

[0014] In some embodiments, the number of instructions allocated to each step is determined based on the current resource index, the current index weight, the priority of each step, the historical instruction allocation number and the instruction allocation algorithm, including: substituting the current resource index and the current index weight into the first instruction algorithm to obtain the first number of instructions allocated to the instruction bucket by the system in the first time period; substituting the first number of instructions, the priority of each step, and the historical instruction allocation number into the instruction allocation algorithm to obtain the instruction allocation number of each step.

[0015] In some embodiments, the method also includes: obtaining the historical resource indicators of the system at the first moment; the first moment is the starting moment of the first time period, and the end moment of the first time period is the moment when the current resource indicators and the current indicator weights are detected; based on the historical resource indicators, the current resource indicators and the current indicator weights, determining the weighted change ratio of the resource indicators corresponding to the first time period; based on the numerical relationship of the weighted change ratio, determining the indicator weight at the next moment.

[0016] In some embodiments, the weighted change ratio of the resource indicator corresponding to the first time period is determined based on historical resource indicators, current resource indicators and current indicator weights, including: dividing the difference between the current resource indicator and the historical resource indicator by the historical resource indicator to obtain the change ratio of the resource indicator; multiplying the change ratio and the weight ratio corresponding to the current indicator weight to obtain the weighted change ratio of the resource indicator.

[0017] In some embodiments, the weighted change ratio includes a first resource weighted change ratio and a second resource weighted change ratio, and the indicator weight includes a first indicator weight and a second indicator weight. According to the numerical relationship of the weighted change ratio, the indicator weight at the next moment is determined, including: if the first resource weighted change ratio is greater than the second resource weighted change ratio, the first indicator weight increases by a first value and the second indicator weight decreases by a second value; if the first resource weighted change ratio is equal to the second resource weighted change ratio, the first indicator weight and the second indicator weight remain unchanged.

[0018] According to one aspect of an embodiment of the present application, a computer-readable medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the execution adjustment method of the batch steps provided in any embodiment of the present application is implemented.

[0019] According to one aspect of an embodiment of the present application, an electronic device is provided, comprising: a processor; a memory for storing executable instructions of the processor; the processor executes the executable instructions to enable the electronic device to implement the execution adjustment method of batch steps provided in any embodiment of the present application.

[0020] In the technical solution of the present application, the current resource indicators and current indicator weights of the system, as well as the priority of each step and the number of historical instruction allocations are obtained; the current resource indicators include task parallelism, and the task parallelism is used to reflect the number of steps executed in parallel by the system in the first time period; the current indicator weight is the current weight corresponding to the current resource indicator; according to the current resource indicators and the current indicator weights, it is determined whether to adjust the task parallelism; if it is determined to adjust the task parallelism, the number of instruction allocations for each step is determined according to the current resource indicators, the current indicator weights, the priority of each step, the number of historical instruction allocations and the instruction allocation algorithm; wherein the execution speed of the step is related to the number of instruction allocations, and the priority of each step is also related to the number of instruction allocations, which can ensure the normal execution of key steps; finally, according to the number of instruction allocations, a corresponding number of instructions are allocated to each step to adjust the execution speed of each step, and some steps to which instructions are not allocated are suspended, or some steps to be executed are newly allocated instructions, that is, the number of steps executed in parallel by the system has changed, thereby realizing the adjustment of task parallelism.

[0021] It should be understood that the above general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0023] Figure 1 The flowchart of the execution adjustment method of batch steps provided in one embodiment of the present application is schematically shown.

[0024] Figure 2 A timing diagram of a batch step execution adjustment method provided in an embodiment of the present application is schematically shown.

[0025] Figure 3 The diagram schematically shows a hierarchy of tasks and steps in a system provided by an embodiment of the present application.

[0026] Figure 4 The module relationship diagram provided in an embodiment of the present application is schematically shown.

[0027] Figure 5 The structural block diagram of an electronic device provided by an embodiment of the present application is schematically shown.

[0028] Figure 6 The structure block diagram of a computer system for implementing an electronic device according to an embodiment of the present application is schematically shown. DETAILED DESCRIPTION

[0029] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more comprehensive and complete and fully convey the concept of the example embodiments to those skilled in the art.

[0030] In addition, the features, structures or characteristics described in the present application may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known methods, devices, realizations or operations are not shown or described in detail to avoid blurring the various aspects of the present application.

[0031] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0032] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.

[0033] When processing data in a financial system, there are some key steps, such as those involving fund transfers in or out. If data is lost in these key steps, it can easily cause business problems and even lead to economic losses for users. At the same time, financial transactions are random, so it is impossible to know exactly how many users a batch system is processing at a certain moment. When a large number of users are operating at the same time, traditional batch frameworks cannot meet the requirements of ensuring that data in key steps is not erroneous or lost. Secondly, traditional batch frameworks usually execute multiple tasks and multiple steps at a fixed speed, and do not fully utilize system resources, which increases the overall execution time of the system, fails to meet the timeliness requirements of key steps, and may also lead to economic losses for users. Therefore, if Figure 1 As shown, the present application provides a method for adjusting the execution of batch steps, the method includes S110 to S140, and the specific process is as follows.

[0034] S110, obtaining the current resource index and current index weight of the system, as well as the priority of each step and the number of historical instruction allocations.

[0035] Specifically, resource indicators are indicators that reflect the status, quantity, or stability of system resources. Current resource indicators refer to system resource indicators at the current moment. Figure 2As shown, assuming that the current moment is the first moment t1, then the current resource indicator and the current indicator weight refer to the information collected at the first moment t1; after the first time period T1 reaches the second moment t2, the current resource indicator and the current indicator weight are collected again, that is, the current resource indicator and the current indicator weight may change over time. In order to distinguish the collection time of the current resource indicator and the current indicator weight, the second moment t2 is used as the current moment in the following process, that is, the current resource indicator and the current indicator weight refer to the resource indicator and the indicator weight collected at the second moment t2. The current resource indicator includes task parallelism, which is used to reflect the number of steps executed in parallel by the system in the first time period; the higher the task parallelism, the more batch steps the system processes simultaneously, and vice versa. Figure 3 As shown, the system may include at least one task, each task may include at least one step, and it should be understood that Figure 3 Step 1 in each task shown is only the step name for the task, and it does not mean that both Task 1 and Task 2 execute the same Step 1. The system executes batch steps, which means that the system executes multiple steps at the same time, such as executing Step 1 and Step 2 of Task 1, and Step 1 of Task 2 at the same time. The current indicator weight is the current weight corresponding to the current resource indicator. The current indicator weight can adjust the influence of the current resource indicator on the task parallelism. As mentioned earlier, there are some key steps in the data processing task, and these key steps have a higher priority than ordinary steps. The number of historical instruction allocations refers to the number of instructions allocated at the previous time of the current moment, expressed in Figure 2 Taking the timing diagram shown as an example, the current moment is the second moment t2, and the historical moment is the first moment t1. The historical instruction allocation number refers to the instruction allocation number determined at the first moment t1, which is the instruction allocation number of each step in the first time period T1.

[0036] S120: Determine whether to adjust the task parallelism according to the current resource indicator and the current indicator weight.

[0037] Specifically, as mentioned above, the current resource indicators are indicators that reflect the current state, quantity or stability of system resources, and usually these resource indicators are specific numerical values. For example, resource indicators may include task parallelism, and task parallelism is used to reflect the number of steps executed in parallel by the system in the first time period. For example, in some scenarios, the higher the task parallelism, the more batch steps the system processes simultaneously, and the lower the stability of the system in processing data, that is, the task parallelism is related to the stability of the system. Therefore, it is possible to statistically analyze the data based on experience and set an adjustment threshold for task parallelism. If the task parallelism is greater than or equal to the adjustment threshold, the task parallelism is adjusted. Alternatively, resource indicators may also include other parameters to achieve a comprehensive evaluation of system resources from multiple angles. In addition, the current indicator weight can adjust the influence of the current resource indicator on the task parallelism. Then, by weighting the current resource indicator through the current indicator weight, the influence of different current resource indicators on the task parallelism can be adjusted. For example, if a certain resource indicator has a greater impact on the stability of the batch system executing key steps, the indicator weight can be used to increase the proportion of the resource indicator in the process of judging whether the task parallelism has been adjusted; or if a certain resource indicator has a smaller impact on the stability of the batch system executing key steps, the indicator weight can be used to reduce the proportion of the resource indicator in the process of judging whether the task parallelism has been adjusted.

[0038] In some embodiments, S120 may specifically include: calculating a system parallelism judgment parameter according to a current resource indicator and a current indicator weight; and determining whether to adjust the task parallelism according to the parallelism judgment parameter.

[0039] Specifically, the parallelism judgment parameter is used to reflect the adequacy of system resources. Assuming that the parallelism judgment parameter and the adequacy of system resources are inversely correlated, the larger the parallelism judgment parameter is, the lower the adequacy of system resources is, indicating that system resources are in short supply and the system's task parallelism needs to be reduced to improve the system's data processing stability. On the contrary, the smaller the parallelism judgment parameter is, the higher the adequacy of system resources is, indicating that system resources are sufficient and the system's task parallelism needs to be increased to improve the system's resource utilization. In this embodiment, the multiplication result of the current resource index and the corresponding current index weight can be used as the parallelism judgment parameter. If the current resource index has multiple items, the product of each resource index and the corresponding index weight is finally added to obtain the weighted parallelism judgment parameter, thereby realizing a comprehensive evaluation of system resources from multiple angles and improving the accuracy of the parallelism judgment parameter. For example, the current resource indicators include: the frequency of redundant collection (Garbage Collection, GC) per second of the current system Gct, the current processor (CPU) occupancy ratio Cor and the current memory occupancy ratio Mec, the current indicator weights include the first indicator weight k1, the second indicator weight k2 and the third indicator weight k3, and the calculation formula of the parallelism judgment parameter Rs is as follows:

[0040] Formula 1.

[0041]

[0042] Among them, the initial value of the first indicator weight k1 is 50, the initial value of the second indicator weight k2 is 25, and the initial value of the third indicator weight k3 is 25, and it is assumed that the values ​​of the above indicator weights remain unchanged; and the frequency of redundant recovery per second of the current system Gct is 10, the current processor occupancy ratio Cor is 2 / 5, and the current memory occupancy ratio Mec is 1 / 3, then the parallelism judgment parameter Rs at the current moment is Rs = (50 × 10 / 10) + (25 × (2 / 5)) + (25 × (1 / 3)) = 68.33. It should be understood that the values ​​of the above current resource indicators and current indicator weights are only for illustrating the calculation process of the parallelism judgment parameters, and do not limit or represent the specific values ​​of the current resource indicators and current indicator weights. The current resource indicators and current indicator weights should be determined according to the actual application scenario.

[0043] In some embodiments, when the size of the parallelism judgment parameter and the degree to which the task parallelism needs to be adjusted are positively correlated, whether to adjust the task parallelism is determined based on the parallelism judgment parameter, including: when the task parallelism is within a first threshold range, selecting a target termination step based on the priority of the step being executed, and pausing the execution of the target termination step to reduce the task parallelism; when the task parallelism is within a second threshold range, not adjusting the task parallelism; when the task parallelism is within a third threshold range, selecting a target start step based on the priority of the step to be executed, and starting to execute the target start step to improve the task parallelism.

[0044] Specifically, assume that the first threshold range is (80, 100], the second threshold range is (60, 80], and the third threshold range is [0, 60]. If the task parallelism Rs1 is 85, the target abort step is selected according to the priority of the step being executed, and the execution of the target abort step is suspended. Specifically, because the task parallelism Rs1 is in the first threshold range, it means that the system currently has too many task steps in batch processing. Therefore, from the steps being executed, a step with a lower priority is selected as the target abort step, and the execution of the target abort step is suspended to reduce the task parallelism. If the task parallelism Rs2 is 68.33, the task parallelism is not adjusted. Specifically, the task parallelism Rs2 is in the second threshold range, which means that the parallelism of the task steps currently being batch processed by the system is moderate, the system resources are not in short supply, and the resource utilization rate is not too low, so the task parallelism can be maintained. If the task parallelism Rs3 is 45, the target start step is selected according to the priority of the step to be executed, and execution begins. The target start step is executed to improve the task parallelism. Specifically, the task parallelism Rs3 is in the third threshold range, which means that the system currently processes fewer batch tasks in parallel and the utilization rate of system resources is low. Therefore, a step with a higher priority is selected from the steps to be executed as the target start step, and the target start step is executed in parallel to improve the task parallelism of the system and improve the problem of waste of system resources. In another embodiment, if there are multiple steps with the lowest priority in the executing steps, a step is randomly selected, or a target termination step is selected according to the business attributes of the candidate executing steps. For example, if the business attributes of a candidate executing step are more minor, the candidate executing step is used as the target termination step. Similarly, if there are multiple steps with the highest priority in the steps to be executed, a step can be randomly selected, or a target start step can be selected according to the business attributes of the candidate to be executed steps. For example, if the business attributes of a candidate to be executed step are more important, the candidate to be executed step is used as the target start step.

[0045] In some embodiments, after calculating the parallelism judgment parameter of the system based on resource indicators and indicator weights, the method provided in the present application also includes: when the parallelism judgment parameter is greater than or equal to the recycling threshold, instruction recycling is performed according to the priority of each step, and instruction recycling refers to recycling the instructions allocated to the step.

[0046] Specifically, the recycling threshold is the critical value for judging that system resources are in short supply. When the parallelism judgment parameter Rs is greater than the recycling threshold, it indicates that system resources are in short supply. When the parallelism judgment parameter Rs is less than or equal to the recycling threshold, it indicates that system resources are still sufficient to support the normal execution of the currently executed steps. Since the execution of each step is triggered according to instructions, the instructions corresponding to the steps with lower priority are recycled, while the instructions corresponding to the steps with higher priority are retained. In the case of system resource shortage, the normal execution of key steps is prioritized to ensure the data accuracy of the system and improve the problem of easy data loss in resource shortage.

[0047] S130. If it is determined to adjust the task parallelism, the number of instructions allocated for each step is determined according to the current resource index, the current index weight, the priority of each step, the historical number of instructions allocated and the instruction allocation algorithm; the execution speed of the step is related to the number of instructions allocated.

[0048] Specifically, the current resource index is related to the resource status of the system, and the current index weight reflects the degree of influence of the resource index on the task parallelism. The total number of instructions that can be allocated by the system in the next time period can be determined by using the current resource index and the current index weight. Then the total number of instructions, the priority of each step, and the number of historical instruction allocations of each step are input into the instruction allocation algorithm to determine the number of instruction allocations for each step. It should be understood that the more instructions are allocated to each step, the earlier the step can be executed, that is, the more instructions are allocated to the step, the faster its execution speed is, and vice versa; therefore, the execution speed of each step is related to the number of instruction allocations. For example, there are steps A, B and C, where the step priority is step B> step A> step C. Assuming that within 1 second, the number of instructions allocated corresponding to step A is 10, the number of instructions allocated corresponding to step B is 20, and the number of instructions allocated corresponding to step C is 0, then the execution speed of the above steps is ranked as: step B> step A> step C.

[0049] In some embodiments, the number of instructions allocated to each step is determined based on the current resource index, the current index weight, the priority of each step, the historical instruction allocation number and the instruction allocation algorithm, including: substituting the current resource index and the current index weight into the first instruction algorithm to obtain the first number of instructions allocated to the instruction bucket by the system in the first time period; substituting the first number of instructions, the priority of each step, and the historical instruction allocation number into the instruction allocation algorithm to obtain the instruction allocation number of each step.

[0050] Specifically, the first instruction algorithm is used to calculate the total number of instructions that can be allocated by the system in the next time period. The instruction bucket can be understood as the storage location or transfer place of instructions. The instructions to be allocated are allocated to the instruction bucket, and then the corresponding number of instructions are allocated from the instruction bucket to each step. Figure 4 As shown, the system may include a resource acquisition module, a calculation module and a scheduling module. The resource acquisition module is used to collect system operation information to determine resource indicators, etc. The calculation module is used to calculate task parallelism, parallelism judgment parameters and the first instruction number, etc. The scheduling module is used to transfer instructions, such as allocating instructions from the instruction bucket to each step, or recycling instructions from each step to the instruction bucket. In a certain system, the first instruction number Where Rs is the parallelism judgment parameter, which can be calculated based on the current resource index and the current index weight. Moreover, according to the calculation formula of the first instruction number in the above example, when the parallelism judgment parameter Rs is larger, the first instruction number Lsat is smaller, and vice versa, the first instruction number Lsat is larger, which shows that in this case, the size of the parallelism judgment parameter Rs is inversely correlated with the adequacy of system resources. If the size of the parallelism judgment parameter Rs is positively correlated with the adequacy of system resources, then the calculation formula of the first instruction number Lsat can be Thus, when the parallelism judgment parameter Rs is smaller, the first instruction number Lsat is also smaller, and the system resource sufficiency is also smaller. The system resource sufficiency is positively correlated with the size of the first instruction number. And the number of instructions allocated to each step Where Pi represents the priority of the current step to be assigned; It represents the result of summing up the priorities of all the steps to be assigned; Nt represents the number of instructions assigned in the previous time period of the current step, that is, the number of historical instructions assigned.

[0051] In some embodiments, the method provided by the present application also includes: obtaining the historical resource indicators of the system at the first moment; the first moment is the starting moment of the first time period, and the end moment of the first time period is the moment when the current resource indicators and the current indicator weights are detected; based on the historical resource indicators, the current resource indicators and the current indicator weights, determining the weighted change ratio of the resource indicators corresponding to the first time period; based on the numerical relationship of the weighted change ratio, determining the indicator weight at the next moment.

[0052] Specifically, during the operation of the system, as the resource index changes, the degree of influence of the resource index on the task parallelism may change, so it is necessary to adjust the index weight corresponding to the resource index. In this embodiment, the change ratio of the resource index in the first time period can be determined in combination with the historical resource index and the current resource index. For example, the historical resource index is X1, and the current resource index is X2. The change ratio can be (|X2-X1| / X1) or (|X1-X2| / X2). When the system has multiple resource indicators, the change ratio can be weighted to obtain a weighted change ratio, wherein the weight can be the ratio of the index weight corresponding to the resource index to the total index weight. The weighted change ratios of the resource index M and the resource index N are compared, and the index weight at the next moment is adjusted according to the comparison result, such as the resource index with a larger weighted change ratio has a larger increase in the index weight, or the resource index with a larger weighted change ratio has a smaller increase in the index weight. The specific change relationship depends on the device configuration, operating parameters and resource indicators of the system.

[0053] In some embodiments, the weighted change ratio of the resource indicator corresponding to the first time period is determined based on historical resource indicators, current resource indicators and current indicator weights, including: dividing the difference between the current resource indicator and the historical resource indicator by the historical resource indicator to obtain the change ratio of the resource indicator; multiplying the change ratio and the weight ratio corresponding to the current indicator weight to obtain the weighted change ratio of the resource indicator.

[0054] Exemplarily, resource indicators include resource indicators M and resource indicators N, indicator weights include indicator weight m and indicator weight n, the historical resource indicator is M1, and the current resource indicator is M2. Then the weighted change of resource indicator M is (|M1-M2| / M1), the weight of resource indicator M is m / (m+n), and the weighted change ratio corresponding to resource indicator M is (|M1-M2| / M1)×(m / (m+n)). Similarly, the weighted change ratio corresponding to resource indicator N is (|N1-N2| / N1)×(n / (m+n)).

[0055] In some embodiments, the resource indicator of the system includes at least one, and when the current resource indicator is in different indicator ranges, its influence on the task parallelism may also be different, so the indicator weight of the next time period can be determined by the indicator range in which the current resource indicator is currently located. For example, the influence of the resource indicator on the task parallelism presents an exponential function relationship, or the influence of the resource indicator on the task parallelism presents a quadratic function relationship, or the influence of the resource indicator on the task parallelism presents a logarithmic function relationship. The above situations are only some examples of the influence of the resource indicator on the task parallelism, and do not limit the relationship between the two.

[0056] In some embodiments, the weighted change ratio includes a first resource weighted change ratio and a second resource weighted change ratio, and the indicator weight includes a first indicator weight and a second indicator weight. According to the numerical relationship of the weighted change ratio, the indicator weight at the next moment is determined, including: if the first resource weighted change ratio is greater than the second resource weighted change ratio, the first indicator weight increases by a first value and the second indicator weight decreases by a second value; if the first resource weighted change ratio is equal to the second resource weighted change ratio, the first indicator weight and the second indicator weight remain unchanged.

[0057] Specifically, the first resource weighted change ratio Ck1 and the second resource weighted change ratio Ck2 are compared. If Ck1>Ck2, the first indicator weight k1 increases by a first value, and the second indicator weight k2 decreases by a second value, wherein the first value and the second value can be any positive integers such as 1, 2, 3 or 4 / 5, and the first value is greater than the second value or the first value is less than the second value. The present application does not specifically limit the specific numerical values ​​of the first value and the second value, and the specific relationship and specific numerical values ​​can be determined according to the specific settings of the system in the actual application. If Ck1<Ck2, the first indicator weight k1 and the second indicator weight k2 remain unchanged. It should be understood that the above-mentioned specific adjustment method of the first indicator weight k1 and the second indicator weight k2 is only one example, and the system can determine the corresponding indicator weight adjustment algorithm according to its own specific configuration.

[0058] S140. Allocate a corresponding number of instructions to each step according to the instruction allocation quantity.

[0059] Specifically, according to the number of instructions assigned to each step, a corresponding number of instructions are assigned to each step to trigger the execution of each step through the instructions. The system can work at the adjusted execution speed so that the task parallelism can be in a suitable range.

[0060] In the technical solution of the present application, the current resource indicators and current indicator weights of the system, as well as the priority of each step and the number of historical instruction allocations are obtained; the current resource indicators include task parallelism, and the task parallelism is used to reflect the number of steps executed in parallel by the system in the first time period; the current indicator weight is the current weight corresponding to the current resource indicator; according to the current resource indicators and the current indicator weights, it is determined whether to adjust the task parallelism; if it is determined to adjust the task parallelism, the number of instruction allocations for each step is determined according to the current resource indicators, the current indicator weights, the priority of each step, the number of historical instruction allocations and the instruction allocation algorithm; wherein the execution speed of the step is related to the number of instruction allocations, and the priority of each step is also related to the number of instruction allocations, which can ensure the normal execution of key steps; finally, according to the number of instruction allocations, a corresponding number of instructions are allocated to each step to adjust the execution speed of each step, and some steps to which instructions are not allocated are suspended, or some steps to be executed are newly allocated instructions, that is, the number of steps executed in parallel by the system has changed, thereby realizing the adjustment of task parallelism.

[0061] The electronic equipment of this application is introduced below, such as Figure 5 As shown, the present application provides an electronic device, which includes: a processor 510 and a memory 520, the memory 520 is used to store executable instructions of the processor; the processor 510 executes the executable instructions to enable the electronic device to implement the execution adjustment method of the batch steps provided in any embodiment of the present application.

[0062] Specifically, the execution adjustment method of batch steps provided in the present application is stored in the memory 520 of the electronic device, and the execution adjustment method of batch steps is executed by the processor 510 to obtain the current resource indicators and current indicator weights of the system, as well as the priority of each step and the number of historical instruction allocations; determine whether to adjust the task parallelism based on the current resource indicators and the current indicator weights; if it is determined to adjust the task parallelism, determine the number of instruction allocations for each step based on the current resource indicators, the current indicator weights, the priority of each step, the number of historical instruction allocations and the instruction allocation algorithm; finally, based on the number of instruction allocations, allocate a corresponding number of instructions to each step to adjust the execution speed of each step, and some steps that are not allocated instructions are suspended, or some steps to be executed are newly allocated instructions, that is, the number of steps executed in parallel by the system changes, thereby realizing the adjustment of task parallelism.

[0063] It should be known that the specific implementation content of the electronic device in the present application has been explained in detail in the corresponding method embodiment and will not be repeated here.

[0064] Figure 6 The structure block diagram of a computer system for implementing an electronic device according to an embodiment of the present application is schematically shown.

[0065] It should be noted that Figure 6 The computer system 600 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0066] like Figure 6 As shown, the computer system 600 includes a processor 601, which can be a CPU (Central Processing Unit) or an MCU (Microcontroller Unit). The processor 601 can perform various appropriate actions and processes according to the program stored in the read-only memory 602 (Read-Only Memory, ROM) or the program loaded from the storage part 608 to the random access memory 603 (Random Access Memory, RAM). In the random access memory 603, various programs and data required for system operation are also stored. The processor 601, the read-only memory 602 and the random access memory 603 are connected to each other through a bus 604. The input / output interface 605 (Input / Output interface, i.e., I / O interface) is also connected to the bus 604.

[0067] The following components are connected to the input / output interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a local area network card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the input / output interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed so that a computer program read therefrom is installed into the storage section 608 as needed.

[0068] In particular, according to an embodiment of the present application, the process described in each method flow chart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer readable medium, and the computer program contains a program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the processor 601, various functions defined in the system of the present application are executed.

[0069] It should be noted that the computer-readable medium shown in the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by an instruction execution system, device or device or used in combination with it. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than computer readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0070] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the above-mentioned module, program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0071] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.

[0072] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation method 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.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the implementation method according to the present application.

[0073] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary technical means in the art that are not disclosed in the present application.

[0074] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A method for adjusting the execution of a batch step, characterized in that: include: Acquire the current resource index and current index weight of the system, as well as the priority of each step and the number of historical instruction allocations; the current resource index includes task parallelism, which is used to reflect the number of steps executed in parallel by the system in the first time period; the current index weight is the current weight corresponding to the current resource index; Determining whether to adjust the task parallelism according to the current resource indicator and the current indicator weight; If it is determined to adjust the task parallelism, the number of instructions allocated for each step is determined according to the current resource indicator, the current indicator weight, the priority of each step, the historical instruction allocation number and the instruction allocation algorithm; the execution speed of the step is related to the instruction allocation number; According to the instruction allocation quantity, a corresponding number of instructions are allocated to each step.

2. The batch step execution adjustment method according to claim 1, characterized in that: The determining whether to adjust the task parallelism according to the current resource indicator and the current indicator weight includes: According to the current resource index and the current index weight, a system parallelism judgment parameter is calculated; the parallelism judgment parameter is used to reflect the sufficiency of system resources; Determine whether to adjust the task parallelism according to the parallelism judgment parameter.

3. The batch step execution adjustment method according to claim 2, characterized in that: When the magnitude of the parallelism judgment parameter and the sufficiency of system resources are positively correlated, determining whether to adjust the task parallelism according to the parallelism judgment parameter includes: When the task parallelism is within a first threshold range, selecting a target abort step according to the priority of the step being executed, and suspending execution of the target abort step to reduce the task parallelism; When the task parallelism is within a second threshold range, the task parallelism is not adjusted; When the task parallelism is within a third threshold range, a target start step is selected according to the priority of the steps to be executed, and the target start step is started to be executed to improve the task parallelism.

4. The batch step execution adjustment method according to claim 2, characterized in that: After calculating the system parallelism judgment parameter according to the resource indicator and the indicator weight, the method further includes: When the parallelism judgment parameter is greater than or equal to the recycling threshold, instruction recycling is performed according to the priority of each step, and the instruction recycling refers to recycling the instructions allocated to the step.

5. The batch step execution adjustment method according to claim 1, characterized in that: Determining the number of instructions allocated for each step according to the current resource indicator, the current indicator weight, the priority of each step, the historical number of instructions allocated and the instruction allocation algorithm includes: Substituting the current resource indicator and the current indicator weight into a first instruction algorithm to obtain a first number of instructions allocated to the instruction bucket by the system in a first time period; The first number of instructions, the priority of each step, and the number of historical instruction allocations are substituted into the instruction allocation algorithm to obtain the number of instructions allocated for each step.

6. The batch step execution adjustment method according to claim 1, characterized in that: The method further comprises: Acquire the historical resource index of the system at the first moment; the first moment is the starting moment of the first time period, and the ending moment of the first time period is the moment when the current resource index and the current index weight are detected; Determining a weighted change ratio of the resource indicator corresponding to the first time period according to the historical resource indicator, the current resource indicator and the current indicator weight; The indicator weight at the next moment is determined according to the numerical relationship of the weighted change ratio.

7. The batch step execution adjustment method according to claim 6, characterized in that: The determining, according to the historical resource indicator, the current resource indicator and the current indicator weight, a weighted change ratio of the resource indicator corresponding to the first time period includes: Divide the difference between the current resource index and the historical resource index by the historical resource index to obtain a change ratio of the resource index; The change ratio is multiplied by the weight proportion corresponding to the current indicator weight to obtain the weighted change ratio of the resource indicator.

8. The batch step execution adjustment method according to claim 6, characterized in that: The weighted change ratio includes a first resource weighted change ratio and a second resource weighted change ratio, the indicator weight includes a first indicator weight and a second indicator weight, and determining the indicator weight at the next moment according to the numerical relationship of the weighted change ratio includes: If the first resource weighted change ratio is greater than the second resource weighted change ratio, the first indicator weight is increased by a first value, and the second indicator weight is decreased by a second value; If the first resource weighted change ratio is equal to the second resource weighted change ratio, the first indicator weight and the second indicator weight remain unchanged.

9. A computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the execution adjustment method of the batch steps described in any one of claims 1 to 8 is implemented.

10. An electronic device, characterized in that: include: processor; A memory, configured to store executable instructions of the processor; The processor executes the executable instructions to enable the electronic device to implement the batch step execution adjustment method as described in any one of claims 1 to 8.

Citation Information

Cited By

  • Method for running target test cases in batches, electronic equipment and medium

    CN121348052A

  • Method, electronic device, and medium for batch running target test cases

    CN121348052B