Task construction method and device, computer equipment and storage medium
By dynamically adjusting the configuration rate of the token bucket in automated software deployment, the software deployment failure caused by system errors is solved, and the success rate of the construction task and the reliability of the system are improved.
Patent Information
- Application Number
- CN202411774518.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-03-21
AI Technical Summary
During automated software deployment, when a systemic error occurs in a certain step in the pipeline, a large number of software failures may result in a waste of deployment opportunities and human resources.
By getting the pipeline build task, get the token from the token bucket, and perform the pipeline build task. When a pipeline task fails and is a systemic error, reduce the configuration rate of the token bucket for other pipeline building tasks until the systemic error is resolved.
Dynamically adjust the task construction rate, reduce the risk of task failure, improve the overall pass rate of the construction task, ensure the task pass rate, and avoid wasting of construction resources.
Smart Images

Figure CN119668621A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of automation technology, and in particular to a task construction method, apparatus, computer equipment, storage medium and computer program product. Background Art
[0002] With the continuous development of software deployment, automated software deployment technology has emerged. This technology is defined by a series of steps and operations, each step represents a specific operation, such as checking out code, compiling code, running tests, building images, etc. These steps can be organized in a specific order like a pipeline, and conditional judgments and parallel execution can be performed as needed. However, when a systematic error occurs in a step in the pipeline (for example, an error in running the test link), it may cause a large amount of software to always fail during automated deployment, thereby wasting a lot of deployment opportunities and a lot of human resources. Summary of the invention
[0003] Based on this, it is necessary to provide a task construction method, apparatus, computer equipment, computer-readable storage medium and computer program product to address the above technical problems.
[0004] In a first aspect, the present application provides a task construction method. The method comprises:
[0005] Obtain a pipeline construction task, obtain a token from a token bucket, and configure the token for the pipeline construction task;
[0006] According to the token, executing the pipeline construction task;
[0007] In the case where the pipeline construction task fails, analyzing the pipeline construction task to obtain a failure category of the pipeline construction task failure;
[0008] When the failure category is a systematic error, the configuration rate of the token bucket for other pipeline construction tasks is reduced until the systematic error of the pipeline construction task is resolved.
[0009] In one of the embodiments, when the failure category is a systematic error, reducing the configuration rate of the token bucket for other pipeline construction tasks includes:
[0010] When the failure category is a systematic error, reducing the number of configurations of the token bucket for other pipeline construction tasks within the cycle;
[0011] When the number of configurations for other pipeline construction tasks within the token bucket period is reduced and the pipeline construction task still fails, the configuration period of the token bucket for other pipeline construction tasks is increased.
[0012] In one embodiment, obtaining the pipeline construction task includes:
[0013] In response to the pipeline construction task, storing the pipeline construction task in a preset construction queue;
[0014] The pipeline construction tasks are obtained sequentially from the construction queue.
[0015] In one embodiment, the method further comprises:
[0016] In the case where the failure category is a systematic error, repairing the systematic error;
[0017] When the systematic error is resolved, the configuration frequency of the token bucket for other pipeline construction tasks is increased.
[0018] In one embodiment, the construction task includes a deployment program; and executing the pipeline construction task according to the token includes:
[0019] According to the pipeline construction task, determine the program identifier and target address to be deployed;
[0020] According to the program identifier, obtain the code file corresponding to the program to be deployed;
[0021] Compile the code file to obtain a program corresponding to the pipeline construction task;
[0022] A running test is performed on the program, and if the running test passes, the program is deployed to a target address.
[0023] In one embodiment, modifying the configuration rate of the token bucket for other pipeline construction tasks includes:
[0024] Modify the frequency of storing the token in the token bucket; wherein, if there is no token in the token bucket, it is impossible to configure the token for the pipeline construction task.
[0025] In a second aspect, the present application also provides a task construction device. The device comprises:
[0026] A token configuration module, used to obtain a pipeline construction task, obtain a token from a token bucket, and configure the token for the pipeline construction task;
[0027] A task execution module, used for executing the pipeline construction task according to the token;
[0028] A category determination module, used for analyzing the pipeline construction task to obtain a failure category of the pipeline construction task failure when the pipeline construction task fails;
[0029] The rate control module is used to reduce the configuration rate of the token bucket for other pipeline construction tasks when the failure category is a systematic error, until the systematic error of the pipeline construction task is resolved.
[0030] In one embodiment, the rate control includes:
[0031] A quantity control submodule, used for reducing the number of configurations of the token bucket for other pipeline construction tasks within a cycle when the failure category is a systematic error;
[0032] The cycle control submodule is used to increase the configuration cycle of the token bucket for other pipeline construction tasks when the configuration quantity of other pipeline construction tasks within the token bucket cycle is reduced and the pipeline construction task still fails.
[0033] In one embodiment, the token configuration module includes:
[0034] A task storage submodule, for responding to a pipeline construction task and storing the pipeline construction task in a preset construction queue;
[0035] The task acquisition submodule is used to sequentially acquire pipeline construction tasks from the construction queue.
[0036] In one embodiment, the device further includes an error repair module, configured to:
[0037] In the case where the failure category is a systematic error, repairing the systematic error;
[0038] When the systematic error is resolved, the configuration frequency of the token bucket for other pipeline construction tasks is increased.
[0039] In one embodiment, the construction task includes a deployment program; the task execution module includes:
[0040] An identification determination submodule, used to determine the program identification and target address to be deployed according to the pipeline construction task;
[0041] A code determination submodule, used to obtain a code file corresponding to the program to be deployed according to the program identifier;
[0042] A code compiling submodule, used to compile the code file to obtain a program corresponding to the pipeline construction task;
[0043] The program deployment submodule is used to perform a run test on the program and deploy the program to a target address if the run test passes.
[0044] In one embodiment, the device further comprises a rate control module configured to:
[0045] Modify the frequency of storing the token in the token bucket; wherein, if there is no token in the token bucket, it is impossible to configure the token for the pipeline construction task.
[0046] In a third aspect, the present application further provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the task construction method as described in any one of the embodiments of the present disclosure is implemented.
[0047] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the task construction method as described in any one of the embodiments of the present disclosure is implemented.
[0048] In a fifth aspect, the present application further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the task construction method described in any one of the embodiments of the present disclosure is implemented.
[0049] The above-mentioned task construction method, device, computer equipment, storage medium and computer program product obtain a pipeline construction task, obtain a token from a token bucket and execute the pipeline construction task. When the pipeline task fails and it is a systemic error, the configuration rate of the token bucket for other pipeline construction tasks is reduced. In this way, the task construction rate can be dynamically adjusted according to the system error situation of the current pipeline construction task, thereby reducing the risk of task failure and improving the overall pass rate of the construction task. At the same time, adjusting the configuration speed of the token bucket for other tasks can effectively control the time of the construction task, improve the reliability and stability of the task construction, ensure the task pass rate, and avoid the waste of construction resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 A flowchart of a task construction method in one embodiment;
[0051] Figure 2 A schematic diagram of a process for reducing a token bucket configuration rate in one embodiment;
[0052] Figure 3 A schematic diagram of a process for obtaining a pipeline construction task in an embodiment;
[0053] Figure 4 A schematic diagram of a process of repairing a systematic error in one embodiment;
[0054] Figure 5 A schematic diagram of a process for executing a pipeline construction task in an embodiment;
[0055] Figure 6 A schematic diagram of a process flow for implementing a task construction method in an embodiment;
[0056] Figure 7 A bar chart of the implementation of a task construction method in one embodiment;
[0057] Figure 8 A structural block diagram of a task construction device in one embodiment;
[0058] Fig. 9 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0059] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0060] In one embodiment, Figure 1 As shown, a task construction method is provided. This embodiment uses the method applied to a terminal as an example for illustration. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0061] Step S100, obtaining a pipeline construction task, obtaining a token from a token bucket, and configuring the token for the pipeline construction task.
[0062] In an exemplary embodiment, the pipeline construction task may include a construction task that needs to go through preset construction steps in sequence, etc.; for example, the construction task may include program deployment, and the pipeline may include checking out code, compiling code, running tests, building images, etc.
[0063] In an exemplary embodiment, in response to a user sending a pipeline construction task to a server, the server obtains the pipeline construction task, obtains a token from a token bucket, and configures the token for the pipeline construction task.
[0064] In an exemplary embodiment, there are tokens in the token bucket, and the tokens in the token bucket can be filled at a preset speed. Each token can correspond to a build task request. When a build task is generated, the token must be obtained from the token bucket. If the token bucket is empty, it is necessary to wait until the token bucket is available to execute the build task, etc.
[0065] Step S200, executing the pipeline construction task according to the token.
[0066] In an exemplary embodiment, according to the token, executing the pipeline construction task may include providing a token for a task, and one token corresponds to all pipeline steps; in another exemplary embodiment, according to the token, executing the pipeline construction task may also include providing a token for each step of the pipeline construction task, that is, if there is a token, a step of the pipeline construction task is performed; when the rate of the pipeline needs to be adjusted, the token configuration speed of a single step can be slowed down individually, etc.
[0067] Step S300, when the pipeline construction task fails, analyze the pipeline construction task to obtain the failure category of the pipeline construction task failure.
[0068] In an exemplary embodiment, the failure categories of the pipeline build task failure may include systemic errors and build task request errors, etc.; the systemic errors may include server errors, that is, all build tasks corresponding to the task build requests obtained by the server will fail, and the build task request errors may include parameter errors in the build task request, etc., that is, only the error occurs for the build task, and no error occurs for other build tasks, etc.
[0069] Step S400, when the failure category is a systematic error, reducing the configuration rate of the token bucket for other pipeline construction tasks until the systematic error of the pipeline construction task is resolved.
[0070] In an exemplary embodiment, reducing the configuration rate of the token bucket for other pipeline construction tasks may include reducing the number of configurations of the token bucket for other pipeline construction tasks in each cycle, or increasing the weekly cycle time of the token bucket for other pipeline construction tasks (i.e., the time interval between the configuration of one pipeline construction task and the configuration of the next pipeline construction task, etc.); in actual use, the configuration rate of the token bucket for other pipeline construction tasks may also be controlled by modifying the filling rate of tokens in the configuration bucket.
[0071] In an exemplary embodiment, after the systematic error of the pipeline construction task is resolved, the configuration rate of the token bucket for other pipeline construction tasks can be restored; in another exemplary embodiment, after the systematic error of the pipeline construction task is resolved, the configuration rate of the token bucket for other pipeline construction tasks can be increased by multiples to quickly build the restricted construction tasks when the systematic error occurs.
[0072] In the above task construction method, a pipeline construction task is obtained, and a token is obtained from a token bucket and the pipeline construction task is executed. When a pipeline task fails and is a systemic error, the configuration rate of the token bucket for other pipeline construction tasks is reduced. In this way, the task construction rate can be dynamically adjusted according to the system error of the current pipeline construction task, thereby reducing the risk of task failure and improving the overall pass rate of the construction task. At the same time, adjusting the configuration speed of the token bucket for other tasks can effectively control the time of the construction task, improve the reliability and stability of the task construction, ensure the task pass rate, and avoid the waste of construction resources.
[0073] In one embodiment, Figure 2 As shown, when the failure category is a systematic error, reducing the configuration rate of the token bucket for other pipeline construction tasks includes:
[0074] Step S401, when the failure category is a systematic error, reducing the number of configurations of the token bucket for other pipeline construction tasks within the cycle.
[0075] Step S402, when the number of configurations for other pipeline construction tasks within the token bucket period is reduced and the pipeline construction task still fails, the configuration period of the token bucket for other pipeline construction tasks is increased.
[0076] In an exemplary embodiment, reducing the number of configurations of the token bucket for other pipeline construction tasks within a cycle may include reducing the number of configurations of the token bucket in each cycle to 1; that is, only one token is configured in the token bucket in each cycle; when the token bucket is configured with one token and the pipeline construction task still fails, increasing the configuration period of the token bucket configuration token, specifically, the configuration period of the token bucket configuration token may be increased by multiples, etc.
[0077] In this embodiment, by reducing the number of token buckets configured for other pipeline construction tasks in the case of systematic errors, the system load can be effectively reduced, thereby improving the overall stability. If the pipeline construction task still fails after adjusting the configuration number, by increasing the configuration cycle of the token bucket for other tasks, a longer processing time can be provided for the construction task, further relieving the pressure. This flexible adjustment strategy not only optimizes the efficiency of resource use, but also effectively reduces the frequency of task failures and improves the reliability and responsiveness of the construction system.
[0078] In one embodiment, Figure 3 As shown, the task of obtaining pipeline construction includes:
[0079] Step S101, in response to a pipeline construction task, storing the pipeline construction task in a preset construction queue.
[0080] Step S102, sequentially obtaining pipeline construction tasks from the construction queue.
[0081] In an exemplary embodiment, in response to the pipeline construction task of the account, the pipeline construction task of the account can be stored in a preset construction queue. When the token bucket is configured with a token, the pipeline construction task is obtained from the construction queue, and the token is configured to execute the pipeline construction task, etc.
[0082] In this embodiment, the pipeline construction tasks are stored in the preset construction queue, which can effectively manage and schedule tasks. By obtaining the task execution in sequence, the load balancing of the system and the rational use of resources can be ensured. This method makes the task execution more orderly, improves the construction efficiency and success rate. At the same time, the construction queue provides the traceability of the task, facilitates subsequent monitoring and optimization, and helps to improve the overall construction process management.
[0083] In one embodiment, Figure 4 As shown, the method also includes:
[0084] Step S501: when the failure type is a systematic error, repair the systematic error.
[0085] Step S502, when the systematic error is resolved, increase the configuration frequency of the token bucket for other pipeline construction tasks.
[0086] In an exemplary embodiment, after a systematic error occurs, a warning message may be generated, and the administrator may repair the systematic error. After the systematic error is repaired, the configuration frequency of the token bucket for the pipeline construction task may be increased.
[0087] In an exemplary embodiment, the systematic error resolution may include that when a systematic error occurs, there is still a pipeline construction task sending a request token, so when the pipeline construction task is successful, it means that the systematic error is resolved, etc.
[0088] In this embodiment, when a systematic error occurs, repairing the error can effectively restore the normal operation of the pipeline construction task and ensure that the system returns to a stable state as soon as possible. Once the systematic error is resolved, increasing the configuration frequency of the token bucket for other pipeline construction tasks can quickly improve the ability and efficiency of task execution, thereby speeding up the recovery of the overall construction process. This method can not only reduce task delays caused by systematic errors, but also optimize the utilization of resources, ensure that subsequent tasks can be executed smoothly, and ultimately improve the reliability of the overall system and the success rate of construction.
[0089] In one embodiment, Figure 5 As shown, the construction task includes a deployment program; and executing the pipeline construction task according to the token includes:
[0090] Step S201, determining the program identifier and target address to be deployed according to the pipeline construction task.
[0091] Step S202: acquiring the code file corresponding to the program to be deployed according to the program identifier.
[0092] Step S203, compile the code file to obtain a program corresponding to the pipeline construction task.
[0093] Step S204, performing a running test on the program, and deploying the program to a target address if the running test passes.
[0094] In an exemplary embodiment, the pipeline construction task may include program deployment, etc. Specifically, program deployment may include checking out code, compiling code, running tests, and building images, etc. Executing the pipeline construction task may include checking out code, compiling code, running tests, and building images, etc.
[0095] In this embodiment, the program identifier and the target address are determined by the pipeline construction task, the program code is obtained according to the program identifier, and the code is compiled to obtain the program. After the program is run and tested, the program is deployed to the target address. This makes resource allocation more accurate, ensuring that the required code files and operating environment can be obtained in a timely manner, thereby improving construction efficiency. Finally, an effective testing mechanism is established to ensure the quality of the program through compilation and running tests, and deployment is only carried out when the test passes, which greatly improves the reliability and success rate of the system.
[0096] In one embodiment, modifying the configuration rate of the token bucket for other pipeline construction tasks includes:
[0097] Modify the frequency of storing the token in the token bucket; wherein, if there is no token in the token bucket, it is impossible to configure the token for the pipeline construction task.
[0098] In an exemplary embodiment, the modifying frequency of storing tokens in the token bucket may include the frequency of filling the token bucket with tokens, etc.
[0099] In this embodiment, if there is no token in the token bucket, it is impossible to configure a token for the pipeline construction task, and by modifying the frequency of storing tokens in the token bucket, the configuration rate of the token bucket for the pipeline construction task can be effectively controlled, and the rate of executing the pipeline construction task can be further controlled to avoid maintaining the original execution speed of the pipeline construction task when a systemic error occurs, thereby improving the success rate of task construction.
[0100] In an exemplary embodiment, the task construction method can be as follows Figure 6 The flowchart shown is implemented, specifically including:
[0101] Step S901, the user issues a pipeline construction task, the pipeline construction task controller obtains a token from a token bucket, then allocates the pipeline construction task to a certain node, and executes the construction task; wherein, the user may issue the pipeline construction task through the interface or structure of the pipeline construction task; the pipeline construction task interface may include a Jenkins interface, etc.;
[0102] Step S902: When an error occurs during the execution of a pipeline construction task, the error analyzer can determine whether a systematic error has occurred in one of the links of the pipeline construction task by analyzing the error log. Systematic errors usually include failure in the code pulling link, failure in the code building link, failure in the image building link, failure in the deployment link, etc.
[0103] Step S903: After the error analyzer identifies a system error, it will quickly adjust the token bucket strategy; for example, if the code pulling link fails, in order to prevent a large number of other build tasks from failing in the code pulling link, the token bucket is quickly modified to limit the build execution rate;
[0104] Step S904, according to the feedback of the pipeline construction task after speed limit on the system error link, the speed limit strategy is adaptively adjusted. If the construction task that gets this token still fails in the code pulling link, the issuance time is increased by multiple levels; if the construction task that gets this token succeeds in the code pulling link, the token issuance time is restored, and the number of tokens issued in the subsequent multiple levels is increased.
[0105] It is understandable that after adopting this solution, the number of task failures is similar to that without adopting this solution. Figure 7 As shown, the solid line is the number of failed build tasks when the present solution is not adopted, and the dotted line is the number of failed build tasks after the present solution is adopted. It can be understood that, in the background technology, after the build task fails, the number of failures continues to increase because the pipeline is still building tasks, while the present solution can quickly adjust the token issuance rate after a systematic error occurs, so the number of errors is always 1, and after being repaired, it returns to 0, etc.
[0106] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0107] Based on the same inventive concept, the embodiment of the present application also provides a task construction device for implementing the task construction method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more task construction device embodiments provided below can refer to the limitations on the task construction method above, and will not be repeated here.
[0108] In one embodiment, Figure 8 As shown, a task construction device 600 is provided, comprising: a token configuration module 601, a task execution module 602, a category determination module 603 and a rate control module 604, wherein:
[0109] A token configuration module, used to obtain a pipeline construction task, obtain a token from a token bucket, and configure the token for the pipeline construction task;
[0110] A task execution module, used for executing the pipeline construction task according to the token;
[0111] A category determination module, used for analyzing the pipeline construction task to obtain a failure category of the pipeline construction task failure when the pipeline construction task fails;
[0112] The rate control module is used to reduce the configuration rate of the token bucket for other pipeline construction tasks when the failure category is a systematic error, until the systematic error of the pipeline construction task is resolved.
[0113] In one embodiment, the rate control includes:
[0114] A quantity control submodule, used for reducing the number of configurations of the token bucket for other pipeline construction tasks within a cycle when the failure category is a systematic error;
[0115] The cycle control submodule is used to increase the configuration cycle of the token bucket for other pipeline construction tasks when the configuration quantity of other pipeline construction tasks within the token bucket cycle is reduced and the pipeline construction task still fails.
[0116] In one embodiment, the token configuration module includes:
[0117] A task storage submodule, for responding to a pipeline construction task and storing the pipeline construction task in a preset construction queue;
[0118] The task acquisition submodule is used to sequentially acquire pipeline construction tasks from the construction queue.
[0119] In one embodiment, the device further includes an error repair module, configured to:
[0120] In the case where the failure category is a systematic error, repairing the systematic error;
[0121] When the systematic error is resolved, the configuration frequency of the token bucket for other pipeline construction tasks is increased.
[0122] In one embodiment, the construction task includes a deployment program; the task execution module includes:
[0123] An identification determination submodule, used to determine the program identification and target address to be deployed according to the pipeline construction task;
[0124] A code determination submodule, used to obtain a code file corresponding to the program to be deployed according to the program identifier;
[0125] A code compiling submodule, used to compile the code file to obtain a program corresponding to the pipeline construction task;
[0126] The program deployment submodule is used to perform a run test on the program and deploy the program to a target address if the run test passes.
[0127] In one embodiment, the device further comprises a rate control module configured to:
[0128] Modify the frequency of storing the token in the token bucket; wherein, if there is no token in the token bucket, it is impossible to configure the token for the pipeline construction task.
[0129] Each module in the above task construction device can be implemented in whole or in part by software, hardware and a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module above.
[0130] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig. 9 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store token data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a task construction method is implemented.
[0131] Those skilled in the art will understand that Fig. 9 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0132] 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, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0133] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0134] 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.
[0135] 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.
Claims
1. A task construction method, characterized in that: Applied to a server, the method comprises: Obtain a pipeline construction task, obtain a token from a token bucket, and configure the token for the pipeline construction task; According to the token, executing the pipeline construction task; In the case where the pipeline construction task fails, analyzing the pipeline construction task to obtain a failure category of the pipeline construction task failure; When the failure category is a systematic error, the configuration rate of the token bucket for other pipeline construction tasks is reduced until the systematic error of the pipeline construction task is resolved.
2. The method according to claim 1, characterized in that When the failure category is a systematic error, reducing the configuration rate of the token bucket for other pipeline construction tasks includes: When the failure category is a systematic error, reducing the number of configurations of the token bucket for other pipeline construction tasks within the cycle; When the number of configurations for other pipeline construction tasks within the token bucket period is reduced and the pipeline construction task still fails, the configuration period of the token bucket for other pipeline construction tasks is increased.
3. The method according to claim 1, characterized in that The obtaining of pipeline construction tasks includes: In response to the pipeline construction task, storing the pipeline construction task in a preset construction queue; The pipeline construction tasks are obtained sequentially from the construction queue.
4. The method according to claim 1, characterized in that: The method further comprises: In the case where the failure category is a systematic error, repairing the systematic error; When the systematic error is resolved, the configuration frequency of the token bucket for other pipeline construction tasks is increased.
5. The method according to claim 1, characterized in that The construction task includes a deployment program; and executing the pipeline construction task according to the token includes: According to the pipeline construction task, determine the program identifier and target address to be deployed; According to the program identifier, obtain the code file corresponding to the program to be deployed; Compile the code file to obtain a program corresponding to the pipeline construction task; A running test is performed on the program, and if the running test passes, the program is deployed to a target address.
6. The method according to any one of claims 1 to 5, characterized in that: Modify the token bucket's configured rate for other pipeline build tasks, including: Modify the frequency of storing the token in the token bucket; wherein, if there is no token in the token bucket, it is impossible to configure the token for the pipeline construction task.
7. A task construction device, characterized in that: The device comprises: A token configuration module, used to obtain a pipeline construction task, obtain a token from a token bucket, and configure the token for the pipeline construction task; A task execution module, used for executing the pipeline construction task according to the token; A category determination module, used for analyzing the pipeline construction task to obtain a failure category of the pipeline construction task failure when the pipeline construction task fails; The rate control module is used to reduce the configuration rate of the token bucket for other pipeline construction tasks when the failure category is a systematic error, until the systematic error of the pipeline construction task is resolved.
8. A computer 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 6 are implemented.
9. A computer-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 6 are implemented.
10. A computer program product, comprising a computer program, 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 6 are implemented.