Code delivery processing method and device, computer equipment and storage medium

By responding to exception events during the code delivery process, determining the exception code and processing it, the problem of low code delivery processing efficiency in the existing technology is solved, and a more efficient code delivery processing process is achieved.

CN119415122APending Publication Date: 2025-02-11CHINA LIFE INSURANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411719218.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-28
Publication Date
2025-02-11

AI Technical Summary

Technical Problem

When an exception occurs in each delivery processing step, the existing code delivery processing process needs to be executed from scratch, resulting in low efficiency.

Method used

By responding to the exception event triggered during the code delivery process, determine the target delivery link and its input and output information when the exception event is triggered, determine the exception code based on the exception parameters, and process the target code according to the code processing method of the target delivery process, obtain Code output information is used to update the output information of the link and reduce duplicate processing.

Benefits of technology

In the target delivery process, there is no need to update the input information of the entire link, which reduces the update time and improves the efficiency of code delivery. By reducing the processing time of the target interaction process, the efficiency is further improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119415122A_ABST
    Figure CN119415122A_ABST
Patent Text Reader

Abstract

The invention relates to a code delivery processing method and device, computer equipment, a storage medium and a computer program product. The method comprises the steps that in response to an abnormal event triggered in the code delivery processing process, a target delivery link where the abnormal event is triggered and link output information and link input information of the target delivery link are determined, and according to abnormal parameters carried in the link output information, the target delivery link is determined; and determining an abnormal code corresponding to the abnormal parameter from the link input information, processing a target code matched with the abnormal code according to a code processing mode of the target delivery link to obtain code output information of the target code, and performing information replacement on the link output information by using the code output information by adopting the method. And the link output update information is obtained, and the link output update information is used as the link input information of the next link of the target delivery link, so that the total processing time of the processing process is reduced, and the code delivery processing efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of software engineering technology, and in particular to a code delivery processing method, apparatus, computer equipment, storage medium and computer program product. Background Art

[0002] In order to improve the availability and security of the code, the code needs to be delivered, such as compilation, building, and deployment. The processing time and accuracy of each delivery process are important factors in measuring the quality of the delivery process.

[0003] In the existing method, when an exception occurs in each delivery process, the entire delivery process needs to be executed from the beginning, and the code delivery process efficiency is low. Summary of the invention

[0004] Based on this, it is necessary to provide a code delivery processing method, device, computer equipment, computer-readable storage medium and computer program product that can improve code delivery processing efficiency in response to the above technical problems.

[0005] In a first aspect, the present application provides a code delivery processing method. The method comprises:

[0006] In response to an abnormal event triggered during the code delivery processing, determine the target delivery link where the abnormal event is triggered, as well as the link output information and link input information of the target delivery link; determine the abnormal code corresponding to the abnormal parameter from the link input information according to the abnormal parameter carried in the link output information; process the target code matching the abnormal code according to the code processing method of the target delivery link to obtain the code output information of the target code in the target delivery link; use the code output information to replace the code output part in the link output information to obtain link output update information; use the link output update information as the link input information of the next link of the target delivery link.

[0007] In one of the embodiments, the method also includes: determining a target code that matches the abnormal code; obtaining a check weight for the target code match and a weight threshold configured for the check weight; when the check weight is greater than or equal to the weight threshold, determining the code processing method of the target delivery link as a static scanning method and a code testing method; when the check weight is less than the weight threshold, determining the code processing method of the target delivery link as a code testing method.

[0008] In one embodiment, determining the target code that matches the abnormal code includes: querying multiple candidate codes that are associated with the abnormal parameters from the link input information; determining the code similarity between the abnormal code and each of the candidate codes; and screening the target code whose code similarity is greater than a similarity threshold among each of the candidate codes.

[0009] In one of the embodiments, the method further includes: determining the number of link repetitions of the target delivery link; when the number of link repetitions is greater than a preset value, obtaining historical input information of the previous link of the target delivery link; determining, in the historical input information, a historical exception code corresponding to the exception parameter based on the exception parameter carried in the link output information; processing an alternative code matching the historical exception code according to a code processing method of the target delivery link and a code processing method of the previous link to obtain code output information of the alternative code in the target delivery link.

[0010] In one of the embodiments, the method further includes: determining multiple delivery links included in the code delivery processing process; obtaining delivery record information of each of the delivery links; for each of the delivery links, when the delivery record information indicates that the code processing performance of the delivery link does not meet the performance conditions, updating the code processing method of the delivery link.

[0011] In one of the embodiments, the method further includes: for each of the delivery links, extracting the error rate and the consumed time from the delivery record information of the delivery link; based on the error rate and the consumed time, determining the code processing performance of the delivery link; the code processing performance is inversely correlated with the error rate, and the code processing performance is inversely correlated with the consumed time.

[0012] In a second aspect, the present application also provides a code delivery processing device. The device includes:

[0013] An acquisition module is used to respond to an abnormal event triggered during the code delivery processing, determine the target delivery link where the abnormal event is triggered, and the link output information and link input information of the target delivery link; an abnormal code determination module is used to determine the abnormal code corresponding to the abnormal parameter from the link input information according to the abnormal parameter carried in the link output information; a code processing module is used to process the target code matching the abnormal code according to the code processing method of the target delivery link, and obtain the code output information of the target code in the target delivery link; an information replacement module is used to use the code output information to replace the code output part in the link output information, and obtain link output update information; an update module is used to use the link output update information as the link input information of the next link of the target delivery link.

[0014] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:

[0015] In response to an abnormal event triggered during the code delivery processing, determine the target delivery link where the abnormal event is triggered, as well as the link output information and link input information of the target delivery link; determine the abnormal code corresponding to the abnormal parameter from the link input information according to the abnormal parameter carried in the link output information; process the target code matching the abnormal code according to the code processing method of the target delivery link to obtain the code output information of the target code in the target delivery link; use the code output information to replace the code output part in the link output information to obtain link output update information; use the link output update information as the link input information of the next link of the target delivery link.

[0016] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0017] In response to an abnormal event triggered during the code delivery processing, determine the target delivery link where the abnormal event is triggered, as well as the link output information and link input information of the target delivery link; determine the abnormal code corresponding to the abnormal parameter from the link input information according to the abnormal parameter carried in the link output information; process the target code matching the abnormal code according to the code processing method of the target delivery link to obtain the code output information of the target code in the target delivery link; use the code output information to replace the code output part in the link output information to obtain link output update information; use the link output update information as the link input information of the next link of the target delivery link.

[0018] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0019] In response to an abnormal event triggered during the code delivery processing, determine the target delivery link where the abnormal event is triggered, as well as the link output information and link input information of the target delivery link; determine the abnormal code corresponding to the abnormal parameter from the link input information according to the abnormal parameter carried in the link output information; process the target code matching the abnormal code according to the code processing method of the target delivery link to obtain the code output information of the target code in the target delivery link; use the code output information to replace the code output part in the link output information to obtain link output update information; use the link output update information as the link input information of the next link of the target delivery link.

[0020] The above-mentioned code delivery processing method, device, computer equipment, storage medium and computer program product, in response to the abnormal event triggered during the code delivery processing, determine the target delivery link where the abnormal event is triggered, as well as the link output information and link input information of the target delivery link, determine the abnormal code corresponding to the abnormal parameter from the link input information according to the abnormal parameter carried in the link output information, accurately locate the abnormal code, and facilitate the subsequent processing of the target code matching the abnormal code. In the target delivery link, there is no need to update the entire link input information, which reduces the update time and improves the code delivery processing efficiency. According to the code processing method of the target delivery link, the target code matching the abnormal code is processed to obtain the code output information of the target code in the target delivery link. With the above-mentioned method, on the one hand, there is no need to update the entire link input information in the target delivery link, which reduces the update time and improves the code delivery processing efficiency. On the other hand, the code output information is used to replace the code output part in the link output information to obtain the link output update information, and the link output update information is used as the link input information of the next link of the target delivery link. There is no need to repeatedly process the link input information, which reduces the processing time of the target interaction link and improves the code delivery processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] FIG1 is an application environment diagram of a code delivery processing method in one embodiment;

[0022] FIG2 is a schematic diagram of a flow chart of a code delivery processing method in one embodiment;

[0023] FIG3 is a flow chart of a method for improving the efficiency of continuous application construction and deployment in one embodiment;

[0024] FIG4 is a structural block diagram of a code delivery processing device in one embodiment;

[0025] FIG. 5 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0026] 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.

[0027] The code delivery processing method provided in the embodiment of the present application can be applied in the application environment shown in FIG1 . In which, the terminal 102 communicates with the server 104 through a network. The data storage system can store data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers.

[0028] The terminal 102 can respond to an abnormal event triggered during the code delivery process to determine the target delivery link where the abnormal event is triggered, as well as the link output information and link input information of the target delivery link. The terminal 102 can determine the abnormal code corresponding to the abnormal parameter from the link input information based on the abnormal parameter carried in the link output information. The terminal 102 can process the target code matching the abnormal code according to the code processing method of the target delivery link to obtain the code output information of the target code in the target delivery link. The terminal 102 can use the code output information to replace the code output part in the link output information to obtain the link output update information. The terminal 102 can use the link output update information as the link input information of the next link of the target delivery link. Among them, the terminal 102 can obtain the target delivery link where the abnormal event is triggered, as well as the link output information and link input information of the target delivery link from the server 104.

[0029] The terminal 102 may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, IoT devices, and portable wearable devices. The IoT devices may be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. The portable wearable devices may be smart watches, smart bracelets, head-mounted devices, etc. The server 104 may be implemented as an independent server or a server cluster consisting of multiple servers.

[0030] In one embodiment, as shown in FIG. 2 , a code delivery processing method is provided, which is described by taking the method applied to the terminal 102 in FIG. 1 as an example, including:

[0031] S202, in response to an abnormal event triggered during the code delivery process, determining the target delivery link at which the abnormal event is triggered, and link output information and link input information of the target delivery link.

[0032] The code delivery process refers to the entire process of code processing. Specifically, the code delivery process includes code pulling, code checking, code compilation, image building, application deployment, and automated testing.

[0033] An abnormal event indicates an operational abnormality during the code delivery process. For example, an operational abnormality occurs during code inspection during the code delivery process. Another example is an operational abnormality occurs during application deployment during the code delivery process.

[0034] The target delivery link can be the link in the code delivery process when an abnormal event is triggered. The target delivery link can be any link in the code pulling link, code checking link, code compiling link, image building link, application deployment link, and automated testing link.

[0035] The link output information may indicate the output information of the link under the target delivery link. Specifically, the link output information may include the output result of the code in the target delivery link. For example, the target delivery link is code compilation, and the link output information may be a war package or executable package obtained by compiling the code, the time consumed by the link, the number of errors reported in the link, the error type of the link, etc. Among them, the War package (Web Application Archive) is a standard format for packaging and publishing Java Web applications. It usually contains the code, configuration files, static resources, and Web resources of the Web application. The executable package may be a jar package, and the Jar package (Java Archive) is a packaging format for Java applications, which may contain Java class files, application resources, related metadata, and libraries.

[0036] The link input information may represent the input information of the link under the target delivery link. Specifically, the link input information may include the input result of the code in the target delivery link. For example, if the target delivery link is the image building link, the link input information may be the information to be processed before the image building of the code, such as a war package or a jar package. The information to be processed may be the entire war package or a part of the war package.

[0037] Specifically, the terminal may respond to an abnormal event triggered during the code delivery process to determine the target delivery link at which the abnormal event is triggered, as well as link output information and link input information of the target delivery link.

[0038] In one embodiment, the terminal may respond to an abnormal event triggered during the code delivery process, and determine the target delivery link at which the abnormal event is triggered, as well as link output information and link input information of the target delivery link during the code delivery process.

[0039] In one embodiment, the terminal may determine multiple preset links in the code delivery process. The terminal may select a target delivery link that matches the abnormal event from the multiple preset links. The multiple preset links include a code pull link, a code check link, a code compilation link, an image build link, an application deployment link, and an automated testing link.

[0040] S204, according to the abnormal parameters carried in the link output information, determine the abnormal code corresponding to the abnormal parameters from the link input information.

[0041] The abnormal parameters may be the abnormal statement, abnormal reason, and abnormal file name carried in the link output information. Taking the target delivery link as the compilation link as an example, the abnormal parameters may be the abnormal statement, abnormal reason, and abnormal file name carried in the war package.

[0042] The exception code can be the specific code that causes the exception parameter. For example, the name of a certain code segment is not compliant, resulting in an exception file name being carried in the environment output information. The code segment, i.e., the exception code, can be located based on the exception file name.

[0043] There are many ways to determine abnormal parameters. Specifically, the terminal can directly extract the abnormal parameters in the compiler output window. The terminal can also extract parameters from the link output information to obtain the parameters marked as abnormal and obtain the abnormal parameters.

[0044] There are many ways to determine the abnormal code. Specifically, the terminal can directly locate the abnormal code line corresponding to the abnormal parameter in the link input information. The terminal can determine the code of the abnormal code line as the abnormal code.

[0045] Before determining the abnormal parameters, the number of link repetitions of the target delivery link may be determined first. Specifically, the terminal may obtain the number of link repetitions of the target delivery link and a preset value configured for the number of link repetitions. When the number of link repetitions is less than or equal to the preset value, the terminal may determine the abnormal code corresponding to the abnormal parameter from the link input information according to the abnormal parameters carried in the link output information.

[0046] S206, processing the target code matching the abnormal code according to the code processing method of the target delivery link, and obtaining the code output information of the target code in the target delivery link.

[0047] Among them, the code processing method can be a specific method for processing the code. Different target delivery links correspond to different code processing methods. A target delivery link can correspond to multiple code processing methods. For example, when the target delivery link is a code inspection link, the code processing method can be at least one of a static scanning method and a code testing method. For another example, when the target delivery link is a code compilation link, the code processing method can be based on an image building method.

[0048] The target code represents the standard code that can achieve the same or similar functions as the abnormal code.

[0049] The code output information may represent the output information of the target code in the target delivery link.

[0050] There are many ways to determine the target code. Specifically, the terminal can receive a correction message for the abnormal code. The terminal can parse the correction message to obtain the target code that matches the abnormal code.

[0051] The terminal can also query multiple candidate codes associated with the abnormal parameters from the link input information. The terminal can determine the code similarity between the abnormal code and each candidate code. The terminal can select the target code whose code similarity is greater than the similarity threshold from each candidate code.

[0052] S208, using the code output information, replacing the code output part in the link output information to obtain link output update information.

[0053] The code output part may represent the part of the link output information that matches the code output information.

[0054] For example, the link output information may indicate the compilation result for 100 lines of code. The code output information may indicate the compilation result of the standard code corresponding to the first 10 lines of code. The code output part may indicate the compilation result of the first 10 lines of code of the compilation result for 100 lines of code.

[0055] The link output update information may indicate the new link output information output by the target delivery link. The link output update information may carry an abnormal parameter or may carry an abnormal parameter.

[0056] Specifically, the terminal may determine whether the link output update information includes an abnormal parameter. In the case where the link output update information includes an abnormal parameter, the terminal may return to the step of locating an abnormal code in the link input information according to the abnormal parameter in the link output information until the link output update information does not include the abnormal parameter. In the case where the link output update information does not include the abnormal parameter, the terminal may execute a subsequent method.

[0057] In one of the embodiments, the terminal can determine the number of link repetitions of the delivery link. The terminal can obtain the historical input information of the previous link of the delivery link when the number of link repetitions is greater than a preset value. The terminal can locate the historical abnormal code in the historical input information based on the abnormal parameters in the link output information. The terminal can process the alternative code matching the historical abnormal code according to the code processing method of the delivery link and the code processing method of the previous link to obtain the target output information of the target code in the delivery link.

[0058] S210, using the link output update information as link input information of the next link of the target delivery link.

[0059] It should be noted that the link input information of the target delivery link may be the output information of the previous link of the target delivery link, and the link output information of the target delivery link may be the input information of the next link of the target delivery link.

[0060] Specifically, the terminal may use the link output update information as the link input information of the next link of the target delivery link until all links are executed, thereby ending the code delivery process.

[0061] In the above code delivery processing method, in response to an abnormal event triggered during the code delivery processing, the target delivery link where the abnormal event is triggered, as well as the link output information and link input information of the target delivery link are determined, and according to the abnormal parameters carried in the link output information, the abnormal code corresponding to the abnormal parameters is determined from the link input information, and the abnormal code is accurately located, so as to facilitate the subsequent processing of the target code matching the abnormal code, and there is no need to update the entire link input information in the target delivery link, which reduces the update time and improves the code delivery processing efficiency. According to the code processing method of the target delivery link, the target code matching the abnormal code is processed to obtain the code output information of the target code in the target delivery link. With the above method, on the one hand, there is no need to update the entire link input information in the target delivery link, which reduces the update time and improves the code delivery processing efficiency. On the other hand, the code output information is used to replace the code output part in the link output information to obtain the link output update information, and the link output update information is used as the link input information of the next link of the target delivery link, so there is no need to repeatedly process the link input information, which reduces the processing time of the target interaction link and improves the code delivery processing efficiency.

[0062] In one embodiment, the code delivery processing method also includes: determining the target code that matches the abnormal code, obtaining the inspection weight of the target code match, and the weight threshold configured for the inspection weight, and when the inspection weight is greater than or equal to the weight threshold, determining the code processing method of the target delivery link as a static scanning method and a code testing method; when the inspection weight is less than the weight threshold, determining the code processing method of the target delivery link as a code testing method.

[0063] Among them, the target delivery link can be a code inspection link.

[0064] The inspection weight can indicate the importance of the target code in the target delivery link. A higher importance can indicate that the target code is more important than other codes.

[0065] The weight threshold may represent a threshold configured for the inspection weight.

[0066] Static scanning methods can include sonar scanning and security scanning. Among them, sonar scanning can be a code quality analysis using the SonarQube platform. Security scanning can be a detection of security vulnerabilities in the code. Sonar scanning is a comprehensive code quality analysis tool, while security scanning is more focused on detecting security vulnerabilities in the code. The combination of the two can more comprehensively ensure the quality and security of the code.

[0067] The specific method of code testing can be unit testing. The purpose of unit testing is to verify whether the smallest testable unit of code works as expected, ensure the functional correctness of each code unit, and discover and fix defects as early as possible.

[0068] Specifically, the terminal may determine a plurality of code units included in the target code, and determine a check weight for matching the target code according to unit weights for matching the plurality of code units.

[0069] In this embodiment, the target code that matches the abnormal code is determined, the inspection weight of the target code match and the weight threshold configured for the inspection weight are obtained, and when the inspection weight is greater than or equal to the weight threshold, the code processing method of the target delivery link is determined as the static scanning method and the code testing method; when the inspection weight is less than the weight threshold, the code processing method of the target delivery link is determined as the code testing method, and an accurate code processing method is determined to improve the accuracy of code delivery processing.

[0070] In one embodiment, determining a target code that matches an abnormal code includes: querying multiple candidate codes that are associated with abnormal parameters from link input information, determining the code similarity between the abnormal code and each candidate code, and screening out target codes whose code similarity is greater than a similarity threshold among each candidate code.

[0071] Among them, the candidate code represents a code that has an association relationship with the abnormal parameter. For example, the candidate code can be a code whose code statement is the same or similar to the abnormal statement of the abnormal parameter. The candidate code can also be a code whose code comment is the same or similar to the abnormal statement of the abnormal parameter. The candidate code can also be a code whose code file name is the same or similar to the abnormal statement of the abnormal parameter.

[0072] The code similarity can indicate the similarity between the candidate code and the abnormal code. The higher the code similarity, the more similar the candidate code and the abnormal code are.

[0073] Similarity Threshold indicates the threshold configured for code similarity.

[0074] Specifically, the terminal queries multiple candidate codes that are associated with the abnormal parameters from the link input information. For each candidate code, the terminal can determine the code statement, code comment and code file name of the candidate code. The terminal can determine the similarity between the code statement and the abnormal statement in the abnormal parameter as the first similarity. The terminal can determine the similarity between the code comment and the abnormal cause in the abnormal parameter as the second similarity. The terminal can determine the similarity between the code file name and the abnormal file name in the abnormal parameter as the third similarity. The terminal combines the first similarity, the second similarity and the third similarity to obtain the code similarity between the abnormal code and the candidate code.

[0075] In one embodiment, the terminal may obtain the similarity weights of each similarity configuration, and obtain the code similarities between the abnormal code and the candidate code according to the first similarity weight, the first similarity, the second similarity weight, the second similarity, the third similarity weight, and the third similarity.

[0076] In this embodiment, multiple candidate codes that are associated with abnormal parameters are queried from the link input information, and the code similarity between the abnormal code and each candidate code is determined. Among each candidate code, the target code whose code similarity is greater than the similarity threshold is screened to obtain an accurate target code, thereby improving the accuracy of code delivery processing.

[0077] In one embodiment, the code delivery processing method also includes: determining the number of link repetitions of the target delivery link, and when the number of link repetitions is greater than a preset value, obtaining the historical input information of the previous link of the target delivery link, and determining the historical exception code corresponding to the exception parameter in the historical input information according to the exception parameters carried in the link output information, and processing the alternative code matching the historical exception code according to the code processing method of the target delivery link and the code processing method of the previous link to obtain the code output information of the alternative code in the target delivery link.

[0078] The number of link repetitions may indicate the number of executions of the target delivery link. For example, the number of link repetitions may indicate the number of times the code compilation link is continuously executed within a period of time.

[0079] The preset value indicates the threshold value configured for the number of link repetitions. The preset value can be set according to the actual situation. In order to avoid excessive link repetitions and thus consume more hardware resources, an appropriate threshold value can be configured for the number of link repetitions.

[0080] The historical input information may represent the input information of the link under the previous link. Specifically, the link input information may include the input result of the code in the previous link. For example, if the previous delivery link is the image building link, the historical input information may be the information to be processed before the image building of the code, such as a war package or a jar package.

[0081] The historical abnormal code may indicate a specific code in the historical input information that caused the abnormal parameter to appear.

[0082] The alternative code may represent a standard code that may perform the same or similar function as the abnormal code.

[0083] Specifically, the terminal can process the candidate code matching the historical abnormal code according to the code processing method of the previous link, and obtain the code output information of the candidate code in the previous delivery link. The terminal can process the code output information of the candidate code in the previous delivery link according to the code processing method of the target delivery link, and obtain the code output information of the candidate code in the target delivery link.

[0084] In this embodiment, the number of link repetitions of the target delivery link is determined. When the number of link repetitions is greater than a preset value, the historical input information of the previous link of the target delivery link is obtained. According to the abnormal parameters carried in the link output information, the historical abnormal code corresponding to the abnormal parameters is determined in the historical input information. According to the code processing method of the target delivery link and the code processing method of the previous link, the alternative code matching the historical abnormal code is processed to obtain the code output information of the alternative code in the target delivery link, and multi-link backtracing is performed. While ensuring processing efficiency, the accuracy of code delivery processing is improved.

[0085] In one embodiment, the code delivery processing method also includes: determining multiple delivery links included in the code delivery processing process, obtaining delivery record information of each delivery link, and for each delivery link, when the delivery record information indicates that the code processing performance of the delivery link does not meet the performance conditions, updating the code processing method of the delivery link.

[0086] Among them, multiple delivery links include code pulling, code checking, code compilation, image building, application deployment, and automated testing.

[0087] The delivery record information may be information that characterizes the code processing performance, such as the time consumed in the delivery process, the error rate in the delivery process, etc.

[0088] The performance condition may represent a condition configured for processing performance, for example, a duration condition configured for the duration of the delivery link, or a probability condition configured for the error rate of the delivery link.

[0089] Specifically, the terminal can obtain the delivery record information of each delivery link after each delivery link is completed.

[0090] Specifically, the terminal can update the code processing method of the delivery link for each delivery link when the delivery record information indicates that the code processing performance of the delivery link does not meet the performance conditions. The terminal can also maintain the original code processing method for each delivery link when the delivery record information indicates that the code processing performance of the delivery link meets the performance conditions.

[0091] In one embodiment, for each delivery link, the terminal can obtain the expected processing performance of each of the multiple default processing methods of the delivery link. When the delivery record information indicates that the code processing performance of the delivery link does not meet the performance conditions, the terminal can select the default processing method with better expected processing performance as the new code processing method.

[0092] In this embodiment, multiple delivery links included in the code delivery processing process are determined, and the delivery record information of each delivery link is obtained. For each delivery link, when the delivery record information indicates that the code processing performance of the delivery link does not meet the performance conditions, the code processing method of the delivery link is updated, thereby improving the processing performance of the code processing method of the delivery link, thereby improving the code delivery processing efficiency.

[0093] In one embodiment, the code delivery processing method also includes: for each delivery link, extracting the error rate and consumed time from the delivery record information of the delivery link, and determining the code processing performance of the delivery link based on the error rate and consumed time, the code processing performance is inversely correlated with the error rate, and the code processing performance is inversely correlated with the consumed time.

[0094] The error rate can be expressed as the ratio of the number of system errors to the total number of requests within a certain period of time, reflecting the stability and robustness of the system. A lower error rate means that the system is more reliable and has fewer errors, so it can be considered that the code processing performance is higher. Specifically, the error rate represents the ratio of the number of abnormalities in the delivery link to the total number of delivery links executed within a period of time.

[0095] The consumption time can indicate the time required to complete a business logic or a set of operations. A shorter consumption time means that the system responds faster and is more efficient, so it can be considered that the code processing performance is higher. Specifically, it is the average time from the start to the end of the delivery phase.

[0096] Code processing performance refers to the ability of the delivery stage to process code or data. The higher the code processing performance, the lower the error rate and the shorter the time consumption.

[0097] Specifically, the terminal can be a performance monitoring tool (such as New Relic, AppDynamics, etc.) that can collect system error rate data in real time. The performance monitoring tool can record the response time of the request corresponding to each delivery link, and calculate the average response time or a specific percentile response time (such as the 90% response time).

[0098] In this embodiment, for each delivery link, the error rate and consumed time are extracted from the delivery record information of the delivery link. Based on the error rate and consumed time, the code processing performance of the delivery link is determined. The code processing performance is inversely correlated with the error rate, and the code processing performance is inversely correlated with the consumed time. The accurate code processing performance is determined to improve the accuracy of code delivery processing.

[0099] In one embodiment, as shown in FIG3 , a method for improving the efficiency of continuous application construction and deployment is provided, including:

[0100] S301, in response to an abnormal event triggered during the code delivery process, determining the target delivery link at which the abnormal event is triggered, as well as link output information and link input information of the target delivery link.

[0101] Among them, the target delivery link can be any link in the code pulling link, code checking link, code compilation link, image building link, application deployment link, and automated testing link.

[0102] For example, in the code pulling stage, the terminal can detect whether the current branch code commitID is consistent with the last build commitID. If not, the diff command is used to find the difference file and replace the difference file with the code obtained by the last build. Each branch maintains a record table to record the difference between this and last code.

[0103] In the code inspection phase, the terminal can run code sonar scanning, security scanning, unit testing and other functions. For sonar scanning and security scanning, it is a static scan, recording each scanned file (file name and hashID) and the number of vulnerabilities involved in each file. When the sonar scan or security scan fails, the names and vulnerabilities of the scanned files are saved. The next scan is performed by comparing the file name and the hashID of each file to collect the files that have not been scanned and the files with code changes, and only scan these files. Finally, when generating the scan results, the scan results of each file are counted for display.

[0104] In the code compilation phase, image building phase, and application deployment phase, code compilation generates artifacts under normal circumstances. For example, Java will generate a war package, and then the war will be made into a container image for subsequent deployment and startup. The main problems at this stage are that the code or compilation environment problems lead to compilation failures, and the production of container images involves image pulling and uploading, which takes a long time. For code or compilation environment problems, users can submit the code after troubleshooting and find code problems. By replacing the code with incremental updates, the code in the build process is incrementally updated. For versions of the Java language JDK9 and above, incremental compilation is supported by default, and other high-level programming languages ​​have similar functions to increase the compilation speed. After the artifacts are generated, a container image needs to be made. We provide a large and comprehensive base image, which contains all the compilation environments required by the team, and the application artifacts are mounted into the container. At this time, when the service is started for the first time, taking the Java service as an example, it is necessary to start the container, start Tomcat, and start the Java process, which takes a lot of time. When the service is built, the newly compiled class file is compared with the class inside the container, and the differences are covered and replaced. Then the process is reloaded. There is no need to start the container, start Tomcat, and start the Java process, which takes less time. When the program is verified to be correct and the product needs to be upgraded (the image is passed to the tester or deployer), the image packaging instruction is sent to replace the configuration file (the configuration file is maintained in advance, and different environments have different configuration files. The test environment uses the test configuration file, and the production uses the production configuration file.) The specified image is generated through docker commit and pushed to the remote image repository. This method skips the step of actively integrating the war into the image for packaging, which improves the efficiency of image making.

[0105] In the automated testing phase, the terminal can choose incremental execution or full execution.

[0106] S302, determining the number of repetitions of the target delivery link.

[0107] S303, when the number of link repetitions is less than or equal to a preset value, determine the abnormal code corresponding to the abnormal parameter from the link input information according to the abnormal parameter carried in the link output information.

[0108] S304, querying multiple candidate codes that are associated with abnormal parameters from the link input information.

[0109] S305, determining the code similarity between the abnormal code and each candidate code.

[0110] S306: Filter target codes whose code similarity is greater than a similarity threshold among the candidate codes.

[0111] S307, obtaining the inspection weight of the target code match and the weight threshold configured for the inspection weight.

[0112] S308: When the inspection weight is greater than or equal to the weight threshold, the code processing method of the target delivery link is determined as a static scanning method and a code testing method.

[0113] S309: When the inspection weight is less than the weight threshold, the code processing method of the target delivery link is determined as the code testing method.

[0114] S310, processing the target code matching the abnormal code according to the code processing method of the target delivery link, and obtaining the code output information of the target code in the target delivery link.

[0115] The code processing method includes at least one of a static scanning method and a code testing method.

[0116] Among them, multiple delivery links included in the code delivery process are determined. Delivery record information of each delivery link is obtained. For each delivery link, if the delivery record information indicates that the code processing performance of the delivery link does not meet the performance condition, the code processing method of the delivery link is updated.

[0117] For each delivery link, the error rate and the time consumed are extracted from the delivery record information of the delivery link. Based on the error rate and the time consumed, the code processing performance of the delivery link is determined. The code processing performance is inversely correlated with the error rate, and the code processing performance is inversely correlated with the time consumed.

[0118] S311, when the number of link repetitions is greater than a preset value, obtain the historical input information of the previous link of the target delivery link.

[0119] S312, according to the abnormal parameters carried in the link output information, determine the historical abnormality code corresponding to the abnormal parameters in the historical input information.

[0120] S313, according to the code processing method of the target delivery link and the code processing method of the previous link, the alternative code matching the historical abnormal code is processed to obtain the code output information of the alternative code in the target delivery link.

[0121] S314, using the code output information, replace the code output part in the link output information to obtain link output update information.

[0122] S315, using the link output update information as link input information of the next link of the target delivery link.

[0123] In this embodiment, in response to an abnormal event triggered during the code delivery process, the target delivery link where the abnormal event is triggered, as well as the link output information and link input information of the target delivery link are determined, and according to the abnormal parameters carried in the link output information, the abnormal code corresponding to the abnormal parameters is determined from the link input information, and the abnormal code is accurately located, so as to facilitate the subsequent processing of the target code matching the abnormal code, and there is no need to update the entire link input information in the target delivery link, which reduces the update time and improves the code delivery processing efficiency. According to the code processing method of the target delivery link, the target code matching the abnormal code is processed to obtain the code output information of the target code in the target delivery link. By adopting the above method, on the one hand, there is no need to update the entire link input information in the target delivery link, which reduces the update time and improves the code delivery processing efficiency. On the other hand, the code output information is used to replace the code output part in the link output information to obtain the link output update information, and the link output update information is used as the link input information of the next link of the target delivery link, so there is no need to repeatedly process the link input information, which reduces the processing time of the target interaction link and improves the code delivery processing efficiency.

[0124] The above method can also bring the following beneficial effects: when an error occurs in continuous delivery and the process is interrupted, a quick retry can be performed based on the last build status, which speeds up the build and improves efficiency. In addition, the information of each failure is recorded, and retries can be performed automatically to reduce repeated operations.

[0125] 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.

[0126] Based on the same inventive concept, the embodiment of the present application also provides a code delivery processing device for implementing the code delivery processing 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 code delivery processing device embodiments provided below can refer to the limitations of the code delivery processing method above, and will not be repeated here.

[0127] In one embodiment, as shown in FIG. 4 , a code delivery processing device is provided, including: an acquisition module 402, an abnormal code determination module 404, a code processing module 406, an information replacement module 408, and an update module 410, wherein:

[0128] The acquisition module 402 is used to respond to an abnormal event triggered during the code delivery process, determine the target delivery link at which the abnormal event is triggered, and link output information and link input information of the target delivery link;

[0129] The abnormal code determination module 404 is used to determine the abnormal code corresponding to the abnormal parameter from the link input information according to the abnormal parameter carried in the link output information;

[0130] The code processing module 406 is used to process the target code matching the abnormal code according to the code processing method of the target delivery link to obtain the code output information of the target code in the target delivery link;

[0131] The information replacement module 408 is used to use the code output information to replace the code output part in the link output information to obtain link output update information;

[0132] The updating module 410 is used to use the link output update information as the link input information of the next link of the target delivery link.

[0133] In one of the embodiments, the code delivery processing device also includes: a code processing method determination module, which is used to determine the target code that matches the abnormal code; obtain the inspection weight of the target code match, and the weight threshold configured for the inspection weight; when the inspection weight is greater than or equal to the weight threshold, the code processing method of the target delivery link is determined as a static scanning method and a code testing method; when the inspection weight is less than the weight threshold, the code processing method of the target delivery link is determined as a code testing method.

[0134] In one of the embodiments, the code processing method determination module is also used to query multiple candidate codes that are associated with abnormal parameters from the link input information; determine the code similarity between the abnormal code and each candidate code; and among each candidate code, screen the target code whose code similarity is greater than the similarity threshold.

[0135] In one of the embodiments, the code delivery processing device also includes: a repetition processing module, which is used to determine the number of link repetitions of the target delivery link; when the number of link repetitions is greater than a preset value, obtaining the historical input information of the previous link of the target delivery link; according to the abnormal parameters carried in the link output information, determining the historical abnormal code corresponding to the abnormal parameters in the historical input information; according to the code processing method of the target delivery link and the code processing method of the previous link, processing the alternative code matching the historical abnormal code to obtain the code output information of the alternative code in the target delivery link.

[0136] In one of the embodiments, the code delivery processing device also includes: a processing method update module, which is used to determine multiple delivery links included in the code delivery processing process; obtain the delivery record information of each delivery link; for each delivery link, when the delivery record information indicates that the code processing performance of the delivery link does not meet the performance conditions, update the code processing method of the delivery link.

[0137] In one of the embodiments, the processing method update module is also used to extract the error rate and consumed time from the delivery record information of each delivery link; based on the error rate and consumed time, determine the code processing performance of the delivery link; the code processing performance is inversely correlated with the error rate, and the code processing performance is inversely correlated with the consumed time.

[0138] Each module in the above-mentioned code delivery processing device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.

[0139] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG5. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, 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. Among them, 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 link input and output information 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 code delivery processing method is implemented.

[0140] Those skilled in the art will understand that the structure shown in FIG. 5 is merely a block diagram of a partial 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 shown in the figure, or combine certain components, or have a different arrangement of components.

[0141] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the above method steps are implemented when the processor executes the computer program.

[0142] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the above method steps are implemented.

[0143] In one embodiment, a computer program product is provided, comprising a computer program, which implements the above method steps when executed by a processor.

[0144] 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.

[0145] 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.

[0146] 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 construed as limiting the scope of the present application. It should be noted that, for a person of ordinary skill in the art, several modifications 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 code delivery processing method, characterized in that: The method comprises: In response to an abnormal event triggered during the code delivery process, determine the target delivery link at which the abnormal event is triggered, as well as link output information and link input information of the target delivery link; According to the abnormal parameters carried in the link output information, determining the abnormal code corresponding to the abnormal parameters from the link input information; According to the code processing method of the target delivery link, the target code matching the abnormal code is processed to obtain the code output information of the target code in the target delivery link; Using the code output information, the code output part in the link output information is replaced to obtain link output update information; The link output update information is used as link input information of the next link of the target delivery link.

2. The method according to claim 1, characterized in that The method further comprises: determining a target code matching the abnormal code; Obtaining a check weight for the target code match and a weight threshold configured for the check weight; When the inspection weight is greater than or equal to the weight threshold, the code processing mode of the target delivery link is determined as a static scanning mode and a code testing mode; When the inspection weight is less than the weight threshold, the code processing mode of the target delivery link is determined as the code testing mode.

3. The method according to claim 2, characterized in that The determining of the target code matching the abnormal code comprises: Querying multiple candidate codes associated with the abnormal parameters from the link input information; Determine the code similarity between the abnormal code and each of the candidate codes; Among the candidate codes, target codes whose code similarity is greater than a similarity threshold are selected.

4. The method according to claim 1, characterized in that: The method further comprises: Determining the number of repetitions of the target delivery link; When the number of repetitions of the link is greater than a preset value, obtaining historical input information of the previous link of the target delivery link; According to the abnormal parameters carried in the link output information, determining the historical abnormality code corresponding to the abnormal parameters in the historical input information; According to the code processing method of the target delivery link and the code processing method of the previous link, the alternative code matching the historical exception code is processed to obtain the code output information of the alternative code in the target delivery link.

5. The method according to claim 1, characterized in that The method further comprises: Determining multiple delivery links included in the code delivery process; Obtaining the delivery record information of each of the delivery links; For each of the delivery links, when the delivery record information indicates that the code processing performance of the delivery link does not meet the performance conditions, the code processing method of the delivery link is updated.

6. The method according to claim 5, characterized in that The method further comprises: For each of the delivery links, extract the error rate and the duration of the delivery from the delivery record information of the delivery link; Based on the error rate and the consumed time, the code processing performance of the delivery link is determined; the code processing performance is inversely correlated with the error rate, and the code processing performance is inversely correlated with the consumed time.

7. A code delivery processing device, characterized in that: The device comprises: An acquisition module, configured to respond to an abnormal event triggered during the code delivery process, determine the target delivery link at which the abnormal event is triggered, and link output information and link input information of the target delivery link; An abnormal code determination module, used to determine an abnormal code corresponding to the abnormal parameter from the link input information according to the abnormal parameter carried in the link output information; A code processing module, used for processing the target code matching the abnormal code according to the code processing method of the target delivery link, and obtaining the code output information of the target code in the target delivery link; An information replacement module, used to use the code output information to replace the code output part in the link output information to obtain link output update information; An updating module is used to use the link output update information as link input information of the next link of the target delivery link.

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.