Data analysis method and device and computer storage medium
By determining whether the modification of the microservice code is a high-risk interface-related code, an alarm signal is generated, which solves the problem of low efficiency of microservice code modification and online launch, and improves research and development efficiency and code repair efficiency.
Patent Information
- Application Number
- CN202310340319.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-31
- Publication Date
- 2024-10-15
AI Technical Summary
In the field of cloud computing, modification of microservice code requires a complete risk assessment, resulting in low development efficiency. R&D engineers need to sort out and analyze massive amounts of data, resulting in low efficiency in the modification and launch of microservice code.
By obtaining the business risk list and code change requests, it can determine whether the code area is associated with high-risk interfaces and generate alarm signals to help R&D engineers check and repair high-risk codes in a timely manner and reduce unnecessary risk assessments.
It greatly reduces the workload of R&D engineers, improves the efficiency of microservice code modification and online, and ensures the reliability and efficiency of analysis.
Smart Images

Figure CN118779201A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of cloud computing, and in particular to a data analysis method, device, and computer storage medium. Background Art
[0002] As the number of services and functions provided by applications to users continues to soar, the efficiency of application delivery is required to be higher. In order to improve the development efficiency of applications, multiple services and functions of a project are usually distributed to different developers for development. Since the development tasks assigned to developers may be fragmented codes, merging multiple services and functions at runtime may cause multiple conflicts. In order to further optimize the development process, a complete project is simply split into multiple small projects with independent services and functions, and then developed and debugged separately, and then combined together according to needs to form a complete project. Each small project with independent functions can be called a microservice.
[0003] Each modification of the microservice code by the cloud vendor needs to be fully assessed before it can be put into use. For example, once a microservice code is modified, after confirming that the modified microservice code has no compliance issues and will not cause redundant actions, the R&D engineer needs to judge the possible risks of the modification of the microservice code. If the R&D engineer believes that the risk brought by the modification of the microservice code is within an acceptable range, the modification of the microservice code can be put into use. If the R&D engineer believes that the risk brought by the modification of the microservice code exceeds the acceptable range, the risk brought by the modification of the service code needs to be verified and repaired before the modification of the microservice code can be put into use. Since each modification of a microservice will have an unknown impact on the application of the user who calls the microservice, the R&D engineer needs to analyze and judge whether the modified code of the microservice has an impact on the upstream and downstream services of the microservice. The R&D engineer sorts and analyzes the massive data, which brings inevitable efficiency problems. How to improve the efficiency of the modification and launch of the microservice code while maintaining the reliability of the analysis has become an urgent problem to be solved. Summary of the invention
[0004] The embodiments of the present application provide a data analysis method, apparatus, and computer storage device for improving the efficiency of modifying and launching microservice codes.
[0005] A first aspect of an embodiment of the present application provides a method for data analysis, including: obtaining a business risk list, the business risk list indicating that a first business interface is a high-risk interface; obtaining a first code change request, the first code change request indicating that a first code area is modified; determining whether the first code area is an associated code area of the first business interface; if so, generating a first alarm signal, the first alarm signal indicating that the first code change request is a high-risk change.
[0006] In the embodiment of the present application, after obtaining the business risk list and the first code change request, it is determined whether the first code area is the associated code area of the first business interface, wherein the business list indicates that the first business interface is a high-risk interface, and the first code change request indicates to modify the first code area. If so, a first alarm signal is generated, so that the R&D engineer can check the content in the first code change request in time after receiving the first alarm signal, and troubleshoot the fault in time. The workload of R&D engineers is greatly reduced, and the efficiency of modifying and launching microservice codes is improved.
[0007] In a possible implementation of the first aspect, the business risk list includes a first identity identification ID, where the first ID is the ID of the first business interface; determining whether the first code area is an associated code area of the first business interface includes: obtaining a second ID, where the second ID is the business interface ID generated when the first code area is running; and determining whether the first ID is the same as the second ID.
[0008] In the embodiment of the present application, the business risk list includes a first identification document (ID), the first ID is the ID of the first business interface, and whether the first code area is the associated code area of the first business interface can be determined by obtaining the second ID generated when the first code area is running, determining whether the first ID and the second ID are the same, and knowing whether the first code area is included in the code of the first business interface. That is, by determining whether the first code area is included in the code of the first business interface, it is determined whether the first code area is the associated code area of the first business interface, which efficiently realizes the determination of the association relationship between the first code area and the first business interface, and improves the implementation efficiency of the solution.
[0009] In a possible implementation of the first aspect, the business risk list also includes a calling relationship between the first business interface and the second business interface, and the ID of the second business interface is a third ID; if the first ID is different from the second ID, the method also includes: determining whether the second ID is the same as the third ID.
[0010] In the embodiment of the present application, the business risk list also includes a call relationship between the first business interface and the second business interface, and the ID of the second business interface is the third ID. If the first ID is different from the second ID, it can be further determined whether the second ID is the same as the third ID. By further checking whether the first code area is a relative code area of the first business interface, if so, it is considered that there is an association relationship between the first code area and the first business interface. Determining whether there is an association relationship between the first code area and the first business interface enables the scheme to make a comprehensive judgment on the association relationship, thereby improving the accuracy of the scheme.
[0011] In a possible implementation of the first aspect, determining whether the first code area is an associated code area of the first business interface includes: obtaining a first interface code, the first interface code being an interface code of the first business interface; determining whether the first code line is included in the first interface code and the second code line is not included in the first interface code, the first code line being a code line of the first code area, and the second code line being a code line of the first code area.
[0012] In the embodiment of the present application, it is possible to determine whether the first code area is the associated code area of the first business interface after obtaining the first interface code, and to determine whether the first code line is included in the first interface code and the second code line does not contain the first interface code, wherein the first interface code is the interface code of the first business interface, the first code line is the code line of the first code area, and the second code line is the code line of the first code area, that is, to determine whether there is a brother relationship between the first code area and the first business interface, and if so, it is considered that there is an associated relationship between the first code area and the first business interface. The scheme improves the possible association relationship judgment between the first code area and the first business interface, and improves the reliability of the scheme.
[0013] In a possible implementation of the first aspect, if the first code area is an associated code area of the first service interface, the first alarm signal also includes the first code area. In the embodiment of the present application, the first alarm information may also carry the first code area, and assist the R&D engineer in understanding the situation of the first code area by accurately prompting the high-risk code area or prompting the code changes that have occurred on the first service interface, thereby improving the efficiency of the R&D engineer in repairing and troubleshooting the first code change request.
[0014] In a possible implementation of the first aspect, the method also includes: obtaining an execution trace of the third business interface according to a first code change request, the first code area is included in the code area of the third business interface; obtaining a first interface code, the first interface code is an interface code of the third business interface; determining whether the overlap between the execution trace of the third business interface and the first interface code is less than a first threshold; if so, generating a second alarm signal, the second alarm signal indicating that the first code area is a change area with a test risk.
[0015] In the embodiment of the present application, the execution trace of the third business interface and the first interface code are obtained according to the first code change request, the first interface code is the interface code of the third business interface, and the first code area is included in the code area of the third business interface. It is determined whether the overlap between the execution trace of the third business interface and the first interface code is less than the first threshold value. If it is less than, a second alarm signal is generated to indicate that the first code area is a change area with a test risk. The execution trace of the third business interface is compared with the overlap between the first interface code to determine whether there is a test risk in the first code area. If there is a test risk, a second alarm signal is generated to alert the R&D engineer to improve the execution efficiency of the solution and provide a more comprehensive test result report to the R&D engineer.
[0016] In a possible implementation of the first aspect, if the first code area is not an associated code area of the first business interface, the method further includes: modifying the first code area according to the first code change request. In an embodiment of the present application, when the first code area does not hit a high-risk interface, the first code area can be modified according to the first code change request to obtain a modified microservice code, thereby improving the integrity of the solution.
[0017] In a possible implementation of the first aspect, the first alarm signal also carries risk status information, and the risk status information indicates whether the first code change request has completed risk correction, or whether the risk correction has not been completed. In an embodiment of the present application, the first alarm signal may also carry risk status information to inform the R&D engineer whether the first code change request has completed risk correction, thereby avoiding repeated processing of risky code change requests and improving the execution efficiency of the solution.
[0018] A second aspect of an embodiment of the present application provides a data analysis device, including:
[0019] An acquisition unit, configured to acquire a business risk list, wherein the business risk list indicates that the first business interface is a high-risk interface;
[0020] The acquiring unit is further used to acquire a first code change request, where the first code change request indicates to modify the first code area;
[0021] A judging unit, used to judge whether the first code region is an associated code region of the first service interface;
[0022] If yes, the generating unit is configured to generate a first warning signal, where the first warning signal indicates that the first code change request is a high-risk change.
[0023] In a possible implementation of the second aspect, the business risk list includes a first identity ID, where the first ID is an ID of a first business interface;
[0024] The judgment unit is specifically used for:
[0025] Obtain a second ID, where the second ID is a service interface ID generated when the first code area is running;
[0026] Determine whether the first ID is the same as the second ID.
[0027] In a possible implementation of the second aspect, the business risk list further includes a calling relationship between the first business interface and the second business interface, and the ID of the second business interface is the third ID;
[0028] If the first ID is different from the second ID, the judging unit is further configured to judge whether the second ID is the same as the third ID.
[0029] In a possible implementation manner of the second aspect, the judging unit is specifically configured to:
[0030] Obtain a first interface code, where the first interface code is an interface code of a first service interface;
[0031] It is determined whether the first code line is included in the first interface code and the second code line is not included in the first interface code, the first code line is a code line in the first code area, and the second code line is a code line in the first code area.
[0032] In a possible implementation of the second aspect, if the first code area is an associated code area of the first service interface, the first alarm signal also includes the first code area.
[0033] In a possible implementation of the second aspect, the acquisition unit is further configured to acquire an execution trace of the third service interface according to the first code change request, and the first code region is included in a code region of the third service interface;
[0034] The acquiring unit is further used to acquire a first interface code, where the first interface code is an interface code of a third service interface;
[0035] The judging unit is further used to judge whether the overlap between the execution trace of the third service interface and the first interface code is less than a first threshold;
[0036] If so, the generating unit is further configured to generate a second warning signal, wherein the second warning signal indicates that the first code region is a modified region with a test risk.
[0037] In a possible implementation of the second aspect, if the first code region is not an associated code region of the first service interface, the apparatus further includes a modification unit configured to modify the first code region according to the first code change request.
[0038] In a possible implementation manner of the second aspect, the first warning signal further carries risk status information, where the risk status information indicates whether the first code change request has completed risk correction or has not completed risk correction.
[0039] A third aspect of an embodiment of the present application provides a data analysis device, including a processor and a memory, the memory is used to store instructions, and the processor is used to execute instructions. When the processor executes the instructions, it executes the method in the first aspect or any possible implementation of the first aspect.
[0040] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium, characterized in that it includes a program, which, when executed on a computer, enables the computer to execute a method as described in the first aspect or any possible implementation of the first aspect.
[0041] A fifth aspect of an embodiment of the present application provides a computing device cluster, characterized in that it includes at least one computing device, each computing device includes a processor and a memory;
[0042] The processor of at least one computing device is used to execute instructions stored in the memory of at least one computing device, so that the computing device cluster executes the method as described in the aforementioned first aspect or any possible implementation of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 A schematic diagram of an application scenario of the data analysis method of an embodiment of the present application;
[0044] Figure 2 A flow chart of a data analysis method provided in an embodiment of the present application;
[0045] Figure 3 A schematic diagram of an association method between a first code area and a first service interface provided in an embodiment of the present application;
[0046] Figure 4 A schematic diagram of a method for obtaining an execution trace of a first code region provided in an embodiment of the present application;
[0047] Figure 5 A schematic diagram of a structure of a data analysis device provided in an embodiment of the present application;
[0048] Figure 6 Another structural schematic diagram of the data analysis device provided in the embodiment of the present application;
[0049] Figure 7 A schematic diagram of a structure of a computing device cluster provided in an embodiment of the present application;
[0050] Figure 8 Another structural diagram of a computing device cluster provided in an embodiment of the present application. DETAILED DESCRIPTION
[0051] The embodiments of the present application are described below in conjunction with the drawings in the embodiments of the present application. The terms used in the implementation mode of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application. It is known to those of ordinary skill in the art that with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0052] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, which is only to describe the distinction mode adopted by the objects of the same attributes when describing in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0053] As the number of services and functions provided by applications to users continues to soar, the efficiency of application delivery is required to be higher. In order to improve the development efficiency of applications, multiple services and functions of a project are usually distributed to different developers for development. Since the development tasks assigned to developers may be fragmented codes, merging multiple services and functions at runtime may cause multiple conflicts. In order to further optimize the development process, a complete project is simply split into multiple small projects with independent services and functions, and then developed and debugged separately, and then combined together according to needs to form a complete project. Each small project with independent functions can be called a microservice.
[0054] Each modification of the microservice code by the cloud vendor needs to be fully assessed before it can be put into use. For example, once a microservice code is modified, after confirming that the modified microservice code has no compliance issues and will not cause redundant actions, the R&D engineer needs to judge the possible risks of the modification of the microservice code. If the R&D engineer believes that the risk brought by the modification of the microservice code is within an acceptable range, the modification of the microservice code can be put into use. If the R&D engineer believes that the risk brought by the modification of the microservice code exceeds the acceptable range, the risk brought by the modification of the service code needs to be verified and repaired before the modification of the microservice code can be put into use. Since each modification of a microservice will have an unknown impact on the application of the user who calls the microservice, the R&D engineer needs to analyze and judge whether the modified code of the microservice has an impact on the upstream and downstream services of the microservice. The R&D engineer sorts and analyzes the massive data, which brings inevitable efficiency problems. How to improve the efficiency of the modification and launch of the microservice code while maintaining the reliability of the analysis has become an urgent problem to be solved.
[0055] Based on the above problems, this application proposes that a business risk list can be pre-set in the code change risk identification system. After receiving the code modification entered by the R&D engineer, it is determined whether the code modification entered by the R&D engineer is a modification of the code area related to the high-risk business interface. If so, an alarm signal is generated, and the code modification is fed back to the R&D engineer and other technical personnel through the visualization platform as a high-risk change, so that the R&D engineer can verify the code modification in a timely manner. At the same time, there is no need for R&D engineers to determine whether each code modification is a high-risk modification one by one, which improves the efficiency of microservice code modification and online release.
[0056] For ease of understanding, the specific application scenarios and processes of this application are first introduced. Figure 1 , Figure 1 A schematic diagram of an application scenario of the data analysis method of an embodiment of the present application.
[0057] R&D engineers can enter the code change content for a certain code area through the data visualization interface provided by the cloud service provider, and can also obtain whether the code change content is a high-risk code change after the code change risk identification system analyzes and processes the code change content. For example, the R&D engineer enters the first code change request for modifying the first code area through the data visualization interface, and the first code change request triggers a series of code testing activities such as UT testing, interface testing, and E2E testing. After completing the code testing activities, the code change content is input into the modification risk identification module to determine whether the first code area is related to the high-risk business interface, and / or, the input test risk identification module determines whether the motion trajectory executed by the first code area and the business code overlap of the business interface related to it is lower than the threshold. The identification result of the risk identification module is stored in the risk management module, and when at least one of the above two judgments is established, an alarm signal is generated, and the alarm signal shows the R&D engineer that the first code change request is a high-risk code change through the data visualization interface. So that the R&D engineer can check and repair the first code change request according to the alarm signal.
[0058] The above scheme is introduced below with reference to the accompanying drawings. Figure 2 , Figure 2 A flow chart of a data analysis method provided in an embodiment of the present application.
[0059] 201. Obtain a list of business risks;
[0060] A business risk list is obtained, where the business risk list indicates that the first business interface is a high-risk interface.
[0061] Exemplarily, a business risk list entered by a R&D engineer through a data visualization interface can be obtained, or at least one risk information can be obtained, the risk information including an identifier (identify document, ID) of a business interface of a function where a major accident occurred, the ID of the business interface of the function where the accident occurred, and the ID of at least one business interface among the IDs of business interfaces that cover a high proportion of call volumes or are identified as important in the business code.
[0062] Optionally, you can also collect code change records of microservices in the cloud service, combine the code change records of the microservices and the risk judgment results made by R&D engineers on the code change records of the microservices, analyze and obtain the IDs of the business interfaces of the functions where major accidents have occurred, the IDs of the business interfaces of the functions where accidents have occurred, and the IDs of the business interfaces that cover a high proportion of call volumes in the business code or are marked as important in terms of importance, and generate a business risk list, which indicates that the first business interface is a high-risk interface, wherein the first business interface is at least one of the IDs of the business interfaces of the functions where major accidents have occurred, the IDs of the business interfaces of the functions where accidents have occurred, and the IDs of the business interfaces that cover a high proportion of call volumes in the business code or are marked as important in terms of importance.
[0063] It is understandable that the description of how to obtain the business risk list here is for illustration only. In actual application, it should be set in combination with specific application scenarios and is not limited here.
[0064] Optionally, the business risk list may further include a first ID, where the first ID is an ID of a first business interface.
[0065] Optionally, the business risk list may further indicate that there is a calling relationship between the first business interface and the second business interface, and the ID of the second business interface is the third ID.
[0066] It is understandable that the description of the specific contents of the business risk list here is only an example. In actual applications, the business risk list may also include the correspondence between the business interface ID and the traceID, etc., which is not limited here.
[0067] 202. Obtain a first code change request;
[0068] After the business risk list is obtained, a first code change request is obtained, where the first code change request indicates modification of the first code area.
[0069] Exemplarily, after obtaining the business risk list, the first code change request typed by the R&D engineer is obtained through the data visualization interface, or the first code change request pre-written by the R&D engineer is obtained through the hardware interface.
[0070] It is understandable that the description of the method for obtaining the first code change request here is only an example. In actual applications, the method for obtaining the first code change request should be set in combination with specific application scenarios and is not limited here.
[0071] 203. Determine whether the first code region is an associated code region of the first service interface;
[0072] After obtaining the business risk list and the first code change request, it is determined whether the first code area is an associated code area of the first business interface, wherein the association between the first code area and the first business interface includes a direct relationship, a sibling relationship, and a kinship relationship.
[0073] Combine the following Figure 3 The above three situations are explained respectively. Figure 3 A schematic diagram of an association method between a first code area and a first service interface provided in an embodiment of the present application.
[0074] 1. The association relationship between the first code area and the first service interface is a direct relationship;
[0075] When the first code region is included in the code of the first service interface, the association relationship between the first code region and the first service interface is a direct relationship, that is, there is an association relationship between the first code region and the first service interface.
[0076] Exemplarily, the business risk list includes a first ID, which is an ID of a first business interface. After obtaining the business risk list and the first code change request, before executing the change of the first code area, the aspect-oriented programming (AOP) technology is used to implant hooks at the entrance and exit of the first business interface, so that during the execution of the change of the first code area, a second ID can be obtained, and the second ID is the interface ID corresponding to the first code area.
[0077] By determining whether the first ID is the same as the second ID, it is determined whether there is a direct relationship between the first code area and the first service interface.
[0078] If the first ID is the same as the second ID, there is a direct relationship between the first code region and the first service interface, that is, there is an association relationship between the first code region and the first service interface.
[0079] If the first ID is different from the second ID, there is no direct relationship between the first code region and the first service interface.
[0080] In the embodiment of the present application, the business risk list includes a first identification document (ID), the first ID is the ID of the first business interface, and whether the first code area is the associated code area of the first business interface can be determined by obtaining the second ID generated when the first code area is running, determining whether the first ID and the second ID are the same, and knowing whether the first code area is included in the code of the first business interface. That is, by determining whether the first code area is included in the code of the first business interface, it is determined whether the first code area is the associated code area of the first business interface, which efficiently realizes the determination of the association relationship between the first code area and the first business interface, and improves the implementation efficiency of the solution.
[0081] 2. The association relationship between the first code area and the first service interface is a brother relationship;
[0082] When some code lines in the first code area are included in the code of the first business interface, and there is also some code in the first code area that is not included in the code of the first business interface, the association relationship between the first code area and the first business interface is a brother relationship, that is, there is an association relationship between the first code area and the first business interface.
[0083] Exemplarily, after obtaining the business risk list and the first code change request, the first interface code can also be obtained, where the first interface code is the interface code of the first business interface, and it is determined whether the first code line is included in the first interface code and the second code line is not included in the first interface code, wherein the first code line and the second code line are both code lines within the first code area.
[0084] If the conditions are met, there is a sibling relationship between the first code region and the first service interface, that is, there is an association relationship between the first code region and the first service interface.
[0085] If not, there is no sibling relationship between the first code region and the first service interface.
[0086] In the embodiment of the present application, it is possible to determine whether the first code area is the associated code area of the first business interface after obtaining the first interface code, and to determine whether the first code line is included in the first interface code and the second code line does not contain the first interface code, wherein the first interface code is the interface code of the first business interface, the first code line is the code line of the first code area, and the second code line is the code line of the first code area, that is, to determine whether there is a brother relationship between the first code area and the first business interface, and if so, it is considered that there is an associated relationship between the first code area and the first business interface. The scheme improves the possible association relationship judgment between the first code area and the first business interface, and improves the reliability of the scheme.
[0087] 3. The association relationship between the first code area and the first service interface is a kinship relationship.
[0088] When the first code region is included in the code of the second business interface, and there is a calling relationship between the first business interface and the second business interface, the association relationship between the first code region and the first business interface is a kinship relationship, that is, there is an association relationship between the first code region and the first business interface.
[0089] Exemplarily, after the business risk list and the first code change request are obtained, the business risk list also includes a calling relationship between the first business interface and the second business interface, and the ID of the second business interface is the third ID.
[0090] It is determined whether the second ID is the same as the third ID, and whether there is a direct relationship between the first code area and the first service interface.
[0091] If the second ID is the same as the third ID, there is a kinship relationship between the first code region and the first service interface, that is, there is an association relationship between the first code region and the first service interface.
[0092] If the second ID is different from the third ID, there is no kinship relationship between the first code region and the first service interface.
[0093] In the embodiment of the present application, the business risk list also includes a call relationship between the first business interface and the second business interface, and the ID of the second business interface is the third ID. If the first ID is different from the second ID, it can be further determined whether the second ID is the same as the third ID. By further checking whether the first code area is a relative code area of the first business interface, if so, it is considered that there is an association relationship between the first code area and the first business interface. Determining whether there is an association relationship between the first code area and the first business interface enables the scheme to make a comprehensive judgment on the association relationship, thereby improving the accuracy of the scheme.
[0094] It should be noted that the description of the determination of the association relationship between the first code area and the first business interface here is only an example, and there is no restriction on the order of determination of the multiple association relationships. When any one of the association relationships is established, the determination can be stopped, and it is determined that there is an association relationship between the first code area and the first business interface, and step 204 is executed; when three of the association relationships are not established at the same time, it is determined that there is no association relationship between the first code area and the first business interface, and step 205 is executed.
[0095] It is understandable that the description of the sequence of step 203, step 205 and step 206 here is only an example. In actual applications, the sequence of execution of step 203, step 205 and step 206 should be set according to the specific application scenario and is not limited here.
[0096] 204. Generate a first alarm signal;
[0097] When an association relationship exists between the first code area and the first service interface, a first warning signal is generated, and the first warning signal indicates that the first code change request is a high-risk change.
[0098] Optionally, the first warning signal may also carry risk status information, where the risk status information indicates that the first code change request has completed risk correction, or has not completed risk correction.
[0099] In an embodiment of the present application, the first alarm signal may also carry risk status information to inform the R&D engineer whether the first code change request has completed risk correction, thereby avoiding repeated processing of risky code change requests and improving the execution efficiency of the solution.
[0100] Optionally, the first alarm signal may also carry a first code area.
[0101] In an embodiment of the present application, the first alarm information may also carry the first code area, and assist R&D engineers in understanding the situation of the first code area by accurately prompting high-risk code areas or prompting code changes that have occurred on the first business interface, thereby improving the efficiency of R&D engineers in repairing and troubleshooting the first code change requests.
[0102] It is understandable that the description of the content carried by the first alarm signal here is only an example. In actual applications, the association relationship between the first code area and the first business interface can be increased to a direct relationship, a brother relationship or a relative relationship according to the specific application scenario. There is no limitation here.
[0103] Optionally, the first alarm signal may also be notified to the R&D engineer through the data visualization interface, so that the R&D engineer can promptly learn that the first code change request is a high-risk change, and perform risk investigation on the first code change request.
[0104] It is understandable that the method of informing the R&D engineer of the first alarm signal here is only an example. In actual application, it can also be achieved through other methods and means, which are not limited here.
[0105] 205. Acquire the execution trace of the third service interface and the first interface code according to the first code change request;
[0106] After obtaining the business risk list and the first code change request, the execution track of the third business interface and the first interface code are obtained according to the first code change request, wherein the first interface code is the code of the third business interface, and the first interface code includes classes, methods and code lines of all codes related to the third business interface. The execution track of the third business interface is the code area obtained by running the updated code of the third business interface after the code of the third business interface is updated according to the first code change request, and the first code area is included in the code area of the third business interface.
[0107] Exemplarily, after updating the code in the first code area under the third business interface according to the first code change request using code coverage probe technology, code testing is performed to obtain the execution trajectory of the third business interface after the code change, including the classes, methods and code lines of the code involved in multiple calls to the third business interface.
[0108] Optionally, you can also execute the automatic deployment of the instrumentation script to obtain the interface ID and trace information corresponding to the first code area during the execution of the code coverage probe technology. And associate the interface ID, traceID and thread-level probe execution data corresponding to the first code area to generate the code execution trace data under the call interface related to the first code area. For details, please refer to Figure 4 , Figure 4 A schematic diagram of a method for obtaining an execution trace of a first code area provided in an embodiment of the present application.
[0109] Depend on Figure 4 It can be seen that after obtaining the first code change request, the automatic deployment plug-in script is run to insert the code coverage agent and the application performance management (APM) agent into the microservice corresponding to the first business interface, so as to realize that during the execution of the code coverage agent, the interface ID and trace information corresponding to the code are obtained by the hook function and the corresponding relationship between the two is generated. And the interface ID and trace ID obtained by APMagent are mapped to the code coverage probe queue to realize the association between the first code change request and the code execution trace data. After completing the association between the first code change request and the code execution trace data, the association relationship between the first code change request and the code execution trace data can be stored through the network communication layer for subsequent use.
[0110] It is understandable that the description of obtaining the execution trace of the third business interface here is only an example. In actual applications, the execution trace of the third business interface can also be obtained by other methods, which are not limited here.
[0111] 206. Determine whether the overlap between the execution trace of the third service interface and the first interface code is less than a first threshold;
[0112] After acquiring the execution trace of the third service interface and the first interface code, it is determined whether the overlap between the execution trace of the third service interface and the first interface code is less than a first threshold.
[0113] Exemplarily, the overlap between the classes of the execution trace of the third business interface and the classes of the first interface code is less than 70%, the overlap between the methods of the execution trace of the third business interface and the methods of the first interface code is less than 70%, and the overlap between the code lines of the execution trace of the third business interface and the code lines of the first interface code is less than 70%. When at least one of the above three situations is true, it is determined that the overlap between the execution trace of the third business interface and the first interface code is less than the first threshold.
[0114] If yes, execute step 207;
[0115] If not, execute step 208.
[0116] It should be noted that the description here of whether the overlap between the execution trajectory of the third business interface and the first interface code is less than the first threshold is only an example. In actual applications, it can also be set that when all the above three situations are met, it is determined that the overlap between the execution trajectory of the third business interface and the first interface code is less than the first threshold, or when one of the above three situations is met, it is determined that the overlap between the execution trajectory of the first code area and the first interface code is less than the first threshold. There is no restriction here.
[0117] In the embodiment of the present application, the execution trace of the third business interface and the first interface code are obtained according to the first code change request, the first interface code is the interface code of the third business interface, and the first code area is included in the code area of the third business interface. It is determined whether the overlap between the execution trace of the third business interface and the first interface code is less than the first threshold value. If it is less than, a second alarm signal is generated to indicate that the first code area is a change area with a test risk. The execution trace of the third business interface is compared with the overlap between the first interface code to determine whether there is a test risk in the first code area. If there is a test risk, a second alarm signal is generated to alert the R&D engineer to improve the execution efficiency of the solution and provide a more comprehensive test result report to the R&D engineer.
[0118] Optionally, to determine whether the overlap between the execution trajectory of the third business interface and the first interface code is less than a first threshold, after obtaining the execution trajectory of the third business interface and the first interface code, the difference code area between the execution trajectory of the third business interface and the first interface code is calculated according to the execution trajectory of the third business interface and the first interface code, and it is determined whether the first code area is included in the difference code area.
[0119] If not, it is considered that there is a test risk in the first code area, and step 207 is executed;
[0120] If so, execute step 208.
[0121] It is understandable that the description of the sequence of step 203, step 205 and step 206 here is only an example. In actual applications, the sequence of execution of step 203, step 205 and step 206 should be set according to the specific application scenario and is not limited here.
[0122] 207. Generate a second alarm signal;
[0123] When the overlap between the execution trace of the first code area and the first interface code is less than a first threshold, a second warning signal is generated, and the second warning signal indicates that there is a test risk in the first code change request.
[0124] Optionally, the second warning signal may also carry risk status information, where the risk status information indicates whether the second code change request has completed risk correction, or whether risk correction has not been completed.
[0125] Optionally, the second alarm signal may also be notified to the R&D engineer through the data visualization interface, so that the R&D engineer can promptly learn that the first code change request has a test risk, and conduct a risk investigation on the first code change request.
[0126] It is understandable that the description of the content carried by the first alarm signal here is only an example. In actual applications, the association relationship between the first code area and the first business interface can be increased to a direct relationship, a brother relationship or a relative relationship according to the specific application scenario. There is no limitation here.
[0127] 208. Modify the first code area according to the first code change request.
[0128] When the first code region is not an associated code region of the first service interface and the overlap between the execution trace of the first code region and the first interface code is greater than or equal to a first threshold, the first code region is modified according to the first code modification request.
[0129] It can be understood that the description here of modifying the first code area according to the first code change request is only an example. In actual applications, the first code area can also be modified according to the first code change request when the first code area is not an associated code area of the first business interface, or when the overlap between the execution trajectory of the first code area and the first interface code is greater than or equal to the first threshold. There is no limitation here.
[0130] In the embodiment of the present application, when the first code area does not hit the high-risk interface, the first code area can be modified according to the first code change request to obtain the modified microservice code, thereby improving the integrity of the solution.
[0131] In the embodiment of the present application, after obtaining the business risk list and the first code change request, it is determined whether the first code area is the associated code area of the first business interface, wherein the business list indicates that the first business interface is a high-risk interface, and the first code change request indicates to modify the first code area. If so, a first alarm signal is generated, so that the R&D engineer can check the content in the first code change request in time after receiving the first alarm signal, and troubleshoot the fault in time. The workload of R&D engineers is greatly reduced, and the efficiency of modifying and launching microservice codes is improved.
[0132] The above is an introduction to the data analysis method provided by the present application. The following is an introduction to the data analysis device provided by the embodiment of the present application in conjunction with the accompanying drawings. Figure 5 , Figure 5 A schematic diagram of the structure of a data analysis device provided in an embodiment of the present application.
[0133] The data analysis device 500 comprises:
[0134] An acquisition unit 501 is used to acquire a business risk list, where the business risk list indicates that the first business interface is a high-risk interface;
[0135] The acquiring unit 501 is further configured to acquire a first code change request, where the first code change request indicates modifying a first code region;
[0136] A judging unit 502 is used to judge whether the first code region is an associated code region of the first service interface;
[0137] If yes, the generating unit 503 is configured to generate a first warning signal, where the first warning signal indicates that the first code change request is a high-risk change.
[0138] Optionally, the business risk list includes a first identity ID, where the first ID is an ID of a first business interface;
[0139] The judging unit 502 is specifically configured to:
[0140] Obtain a second ID, where the second ID is a service interface ID generated when the first code area is running;
[0141] Determine whether the first ID is the same as the second ID.
[0142] Optionally, the business risk list further includes that there is a calling relationship between the first business interface and the second business interface, and the ID of the second business interface is the third ID;
[0143] If the first ID is different from the second ID, the determination unit 502 is further configured to determine whether the second ID is the same as the third ID.
[0144] Optionally, the judging unit 502 is specifically configured to:
[0145] Obtain a first interface code, where the first interface code is an interface code of a first service interface;
[0146] It is determined whether the first code line is included in the first interface code and the second code line is not included in the first interface code, the first code line is a code line in the first code area, and the second code line is a code line in the first code area.
[0147] Optionally, if the first code area is an associated code area of the first service interface, the first alarm signal also includes the first code area.
[0148] Optionally, the acquisition unit 501 is further configured to acquire an execution trace of a third business interface according to the first code change request, wherein the first code region is included in a code region of the third business interface;
[0149] The acquisition unit 501 is further used to acquire a first interface code, where the first interface code is an interface code of the third service interface;
[0150] The judging unit 502 is further configured to judge whether the overlap between the execution trace of the third service interface and the first interface code is less than a first threshold;
[0151] If yes, the generating unit 503 is further configured to generate a second warning signal, where the second warning signal indicates that the first code region is a modified region with a test risk.
[0152] Optionally, if the first code region is not an associated code region of the first service interface, the apparatus further includes a modifying unit 504, configured to modify the first code region according to the first code change request.
[0153] Optionally, the first warning signal further carries risk status information, where the risk status information indicates that the first code change request has completed risk correction, or has not completed risk correction.
[0154] In addition, the present application also provides a data analysis device, see Figure 6 , Figure 6 Another structural schematic diagram of the data analysis device provided in an embodiment of the present application.
[0155] The data analysis device 600 includes: a bus 602, a processor 604, a memory 606, and a communication interface 608. The processor 604, the memory 606, and the communication interface 608 communicate through the bus 602. The data analysis device 600 can be a server or a terminal device. It should be understood that the present application does not limit the number of processors and memories in the data analysis device 600.
[0156] The bus 602 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 The bus 602 may include a path for transmitting information between various components of the data storage device 600 (eg, memory 606, processor 604, communication interface 608).
[0157] The processor 604 may include any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0158] The memory 606 may include a volatile memory, such as a random access memory (RAM). The processor 604 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).
[0159] The memory 606 stores executable program codes, and the processor 604 executes the executable program codes to respectively implement the functions of the aforementioned acquisition unit 501, the judgment unit 502, the generation unit 503, and the modification unit 504, thereby implementing any one of the data storage methods. That is, the memory 606 stores instructions for executing any one of the data analysis methods.
[0160] Alternatively, the memory 606 stores executable codes, and the processor 604 executes the executable codes to respectively implement the functions of the aforementioned access points, thereby implementing any of the data storage methods. That is, the memory 606 stores instructions for executing any of the data analysis methods.
[0161] The communication interface 608 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 600 and other devices or communication networks.
[0162] See also Figure 7 , Figure 7 A schematic diagram of the structure of a computing device cluster provided in an embodiment of the present application.
[0163] The computing device cluster includes at least one computing device. The computing device may be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device may also be a terminal device such as a desktop computer, a laptop computer, or a smart phone.
[0164] like Figure 7 As shown, the computing device cluster includes at least one data analysis apparatus 600. The memory 606 in one or more data analysis apparatuses 600 in the computing device cluster may store the same instructions for executing any one of the data storage methods.
[0165] In some possible implementations, the memory 606 of one or more data analysis devices 600 in the computing device cluster may also store partial instructions for executing any of the data storage methods. In other words, the combination of one or more data analysis devices 600 may jointly execute instructions for executing any of the data storage methods.
[0166] It should be noted that the memory 606 in different data analysis devices 600 in the computing device cluster can store different instructions, which are respectively used to execute part of the functions of the cloud management platform. That is, the instructions stored in the memory 606 in different data analysis devices 600 can implement the functions of one or more units of the acquisition unit 501, the judgment unit 502, the generation unit 503 and the modification unit 504.
[0167] In some possible implementations, one or more data storage devices in the computing device cluster may be connected via a network, which may be a wide area network or a local area network.
[0168] See also Figure 8 , Figure 8Another structural diagram of a computing device cluster provided in an embodiment of the present application.
[0169] like Figure 8 As shown, two data analysis devices 600A and 600B are connected via a network. Specifically, they are connected to the network via communication interfaces in various computing devices. In this type of possible implementation, the memory 606 in the data analysis device 600A stores instructions for executing the functions of the acquisition unit 501 and the judgment unit 502. At the same time, the memory 606 in the data analysis device 600B stores instructions for executing the functions of the generation unit 503 and the modification unit 504.
[0170] It should be understood that Figure 8 The function of the data analysis device 600A shown in FIG. 6 may also be completed by multiple data analysis devices 600. Similarly, the function of the data analysis device 600B may also be completed by multiple data analysis devices 600.
[0171] The present application embodiment also provides another computing device cluster. The connection relationship between the computing devices in the computing device cluster can be similar to that of Figure 7 and Figure 8 The connection mode of the computing device cluster is different in that the memory 606 in one or more data analysis devices 600 in the computing device cluster may store the same instructions for executing any one of the methods for data storage.
[0172] In some possible implementations, the memory 606 of one or more data analysis devices 600 in the computing device cluster may also store partial instructions for executing any of the data storage methods. In other words, the combination of one or more data analysis devices 600 may jointly execute instructions for executing any of the data storage methods.
[0173] It should be noted that the memory 606 in different data analysis apparatuses 600 in the computing device cluster may store different instructions for executing partial functions of the data storage method.
[0174] An embodiment of the present application also provides a computer-readable storage medium, including computer-readable instructions. When the computer-readable instructions are executed on a computer, the computer executes any one of the implementation methods shown in the aforementioned method embodiments.
[0175] The embodiments of the present application also provide a computer program product, which includes a computer program or instructions. When the computer program or instructions are executed on a computer, the computer executes any one of the implementation methods shown in the aforementioned method embodiments.
[0176] The present application also provides a chip or chip system, which may include a processor. The chip may also include a memory (or storage module) and / or a transceiver (or communication module), or the chip is coupled to a memory (or storage module) and / or a transceiver (or communication module), wherein the transceiver (or communication module) can be used to support the chip for wired and / or wireless communication, and the memory (or storage module) can be used to store a program or a set of instructions, and the processor calls the program or the set of instructions to implement the above method embodiment, and the operation performed by the terminal or network device in any possible implementation of the method embodiment. The chip system may include the above chip, and may also include the above chip and other discrete devices, such as a memory (or storage module) and / or a transceiver (or communication module).
[0177] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0178] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0179] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0180] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0181] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, read-only memory), random access memory (RAM, random access memory), disk or optical disk and other media that can store program code.
Claims
1. A method for data analysis, characterized in that: include: Obtaining a business risk list, wherein the business risk list indicates that the first business interface is a high-risk interface; Obtaining a first code change request, where the first code change request indicates modifying the first code area; Determining whether the first code region is an associated code region of the first service interface; If yes, a first warning signal is generated, wherein the first warning signal indicates that the first code change request is a high-risk change.
2. The method according to claim 1, characterized in that The business risk list includes the first identity ID, where the first ID is the ID of the first business interface; The determining whether the first code region is an associated code region of the first service interface includes: Obtain a second ID, where the second ID is a service interface ID generated when the first code area is running; Determine whether the first ID is the same as the second ID.
3. The method according to claim 2, characterized in that The business risk list also includes that there is a calling relationship between the first business interface and the second business interface, and the ID of the second business interface is the third ID; If the first ID is different from the second ID, the method further includes: Determine whether the second ID is the same as the third ID.
4. The method according to claim 1, characterized in that: The determining whether the first code region is an associated code region of the first service interface includes: Obtaining a first interface code, where the first interface code is an interface code of the first service interface; Determine whether the first code line is included in the first interface code and the second code line is not included in the first interface code, the first code line is the code line of the first code area, and the second code line is the code line of the first code area.
5. The method according to any one of claims 1 to 4, characterized in that: If the first code area is an associated code area of the first service interface, the first alarm signal also includes the first code area.
6. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: Acquire an execution trace of a third service interface according to the first code change request, wherein the first code region is included in a code region of the third service interface; Obtaining a first interface code, where the first interface code is an interface code of a third service interface; Determine whether the overlap between the execution trace of the third service interface and the first interface code is less than a first threshold; If so, a second warning signal is generated, wherein the second warning signal indicates that the first code area is a modified area with a test risk.
7. The method according to any one of claims 1 to 5, characterized in that: If the first code region is not an associated code region of the first service interface, the method further includes: The first code region is modified according to the first code change request.
8. The method according to any one of claims 1 to 5, characterized in that: The first warning signal also carries risk status information, where the risk status information indicates whether the first code change request has completed risk correction or has not completed risk correction.
9. A data analysis device, characterized in that: include: An acquiring unit, configured to acquire a business risk list, wherein the business risk list indicates that the first business interface is a high-risk interface; The acquiring unit is further configured to acquire a first code change request, where the first code change request indicates to modify the first code area; A judging unit, configured to judge whether the first code region is an associated code region of the first service interface; If yes, the generating unit is configured to generate a first warning signal, wherein the first warning signal indicates that the first code change request is a high-risk change.
10. The device according to claim 9, characterized in that The business risk list includes the first identity ID, where the first ID is the ID of the first business interface; The judging unit is specifically used for: Obtain a second ID, where the second ID is a service interface ID generated when the first code area is running; Determine whether the first ID is the same as the second ID.
11. The device according to claim 10, characterized in that The business risk list also includes that there is a calling relationship between the first business interface and the second business interface, and the ID of the second business interface is the third ID; If the first ID is different from the second ID, the judgment unit is further configured to judge whether the second ID is the same as the third ID.
12. The device according to claim 9, characterized in that The judging unit is specifically used for: Obtaining a first interface code, where the first interface code is an interface code of the first service interface; Determine whether the first code line is included in the first interface code and the second code line is not included in the first interface code, the first code line is the code line of the first code area, and the second code line is the code line of the first code area.
13. The device according to any one of claims 9 to 12, characterized in that: If the first code area is an associated code area of the first service interface, the first alarm signal also includes the first code area.
14. The device according to any one of claims 9 to 12, characterized in that: The acquisition unit is further configured to acquire an execution trace of a third service interface according to the first code change request, wherein the first code region is included in a code region of the third service interface; The acquisition unit is further used to acquire a first interface code, where the first interface code is an interface code of the third service interface; The judging unit is further configured to judge whether the overlap between the execution trace of the third service interface and the first interface code is less than a first threshold; If yes, the generating unit is further configured to generate a second warning signal, wherein the second warning signal indicates that the first code region is a modified region with a test risk.
15. The device according to any one of claims 9 to 13, characterized in that: If the first code region is not an associated code region of the first service interface, the device further includes a modifying unit configured to modify the first code region according to the first code change request.
16. The device according to any one of claims 9 to 13, characterized in that The first warning signal also carries risk status information, where the risk status information indicates whether the first code change request has completed risk correction or has not completed risk correction.
17. A data analysis device, characterized in that: The method comprises a processor and a memory, wherein the memory is used to store instructions, and the processor is used to execute the instructions. When the processor executes the instructions, the method according to any one of claims 1 to 8 is executed.
18. A computer-readable storage medium, characterized in that: The invention comprises a program which, when being run on a computer, causes the computer to execute the method according to any one of claims 1 to 8.
19. A computing device cluster, characterized in that: comprising at least one computing device, each computing device comprising a processor and a memory; The processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the method according to any one of claims 1 to 8.
