Program change risk prediction method and apparatus

By generating a directed graph of target program changes and a historical risk structure graph, and using graph neural networks for risk prediction, the problem of incomplete identification of risk points in program code modifications is solved, ensuring stable program operation and reducing risk losses.

CN119883871BActive Publication Date: 2025-10-24INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311311918.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-11
Publication Date
2025-10-24
Estimated Expiration
2043-10-11

AI Technical Summary

Technical Problem

In software testing, the existing technology does not comprehensively analyze the risk points of program code changes, resulting in incomplete coverage of test risk points, affecting the normal implementation of program functions, and affecting customer experience and economic benefits.

Method used

By generating a directed graph of the target program change and a historical risk structure graph, inputting them into the program change risk model, and using a graph neural network for risk prediction, the risk points of program changes can be identified quickly and accurately.

Benefits of technology

It enables rapid and accurate risk prediction of program changes, ensuring stable program operation, reducing risk losses, and avoiding functional abnormalities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119883871B_ABST
    Figure CN119883871B_ABST
Patent Text Reader

Abstract

The application provides a program change risk prediction method and device, relates to the technical field of artificial intelligence, and can be applied to the technical field of finance or other technical fields.The program change risk prediction method comprises the following steps: obtaining a target change program;generating a target program change directed graph according to the target change program;inputting the target program change directed graph and a historical risk structure graph into a program change risk model to obtain program change risk.The application can quickly and accurately predict the program change risk, guarantee the stable operation of the program, and reduce the risk loss.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of artificial intelligence, in particular to a program change risk prediction method and device. BACKGROUND

[0002] In the software testing process, the occurrence of test risk points generally comes from the modification of program code. The modification of program code is often completed by a static analysis method to comb the risk points of the program change, but this method often depends on the professional accomplishment of the analyst, and due to the complex calling relationship between programs, a program is often directly or indirectly called by multiple calling parties, which leads to the fact that the combing of the influence points of the program code modification is often not comprehensive, thereby the test risk points are not fully covered, the function after the program modification cannot be normally implemented, and even the original function is affected, the customer experience and economic benefits are affected. SUMMARY

[0003] The main purpose of the embodiment of the present application is to provide a program change risk prediction method and device to quickly and accurately predict the risk of program change, ensure the stable operation of the program, and reduce the risk loss.

[0004] In order to achieve the above purpose, the embodiment of the present application provides a program change risk prediction method, comprising:

[0005] obtaining a target changed program;

[0006] generating a target program change directed graph according to the target changed program;

[0007] inputting the target program change directed graph and a historical risk structure graph into a program change risk model to obtain a program change risk.

[0008] In one embodiment, the step of creating a program change risk model comprises:

[0009] determining a historical program change directed graph according to a historical changed program;

[0010] determining program risk prediction data according to the historical program change directed graph, program change risk model parameters and the historical risk structure graph;

[0011] iteratively adjusting the program change risk model parameters according to the program risk prediction data and actual risk data corresponding to the historical changed program;

[0012] when the current iteration number is equal to a preset iteration number, creating a program change risk model according to the program change risk model parameters.

[0013] In one embodiment, determining the program risk prediction data according to the historical program change directed graph, the program change risk model parameters and the historical risk structure graphs comprises:

[0014] determining a similarity between the historical program change directed graph and each historical risk structure graph according to the historical program change directed graph, the program change risk model parameters and the historical risk structure graphs;

[0015] determining the program risk prediction data according to the similarity and a preset similarity coefficient.

[0016] In one embodiment, determining the similarity between the historical program change directed graph and each historical risk structure graph according to the historical program change directed graph, the program change risk model parameters and the historical risk structure graphs comprises:

[0017] determining a historical program change vector according to the historical program change directed graph and the first program change risk model parameters, and determining a historical risk vector according to the historical risk structure graph and the first program change risk model parameters;

[0018] determining the similarity between the historical program change directed graph and each historical risk structure graph according to the historical program change vector, the historical risk vector and the second program change risk model parameters.

[0019] In one embodiment, determining the program risk prediction data according to the similarity and a preset similarity coefficient comprises:

[0020] determining comprehensive risk data according to the similarity and the similarity coefficient;

[0021] determining the program risk prediction data according to a comparison result of the comprehensive risk data and a preset risk threshold.

[0022] In one embodiment, the method further comprises:

[0023] determining a risk event label according to the actual risk data;

[0024] determining a change code attribute according to a risk event program corresponding to the risk event label;

[0025] generating the historical risk structure graph according to the risk event label and the change code attribute.

[0026] In one embodiment, the risk event label comprises a risk event name, a risk event keyword and a risk event program.

[0027] determining a risk event label according to the actual risk data comprises:

[0028] determining the risk event name, the risk event cause, the risk event impact, and the risk event procedure according to the actual risk data;

[0029] determining the risk event keyword according to the risk event cause and the risk event impact.

[0030] The embodiment of the present application further provides a program change risk prediction device, comprising:

[0031] an acquisition module, used for acquiring a target change program;

[0032] a target program change directed graph module, used for generating a target program change directed graph according to the target change program;

[0033] a program change risk module, used for inputting the target program change directed graph and a historical risk structure graph into a program change risk model to obtain a program change risk.

[0034] In one embodiment, the device further comprises:

[0035] a historical program change directed graph module, used for determining a historical program change directed graph according to a historical change program;

[0036] a program risk prediction data module, used for determining program risk prediction data according to the historical program change directed graph, program change risk model parameters, and the historical risk structure graph;

[0037] an iteration module, used for iteratively adjusting the program change risk model parameters according to the program risk prediction data and actual risk data corresponding to the historical change program;

[0038] a program change risk model creation module, used for creating a program change risk model according to the program change risk model parameters when a current iteration number is equal to a preset iteration number.

[0039] In one embodiment, the program risk prediction data module comprises:

[0040] a similarity unit, used for determining the similarity between the historical program change directed graph and each historical risk structure graph according to the historical program change directed graph, the program change risk model parameters, and the historical risk structure graph;

[0041] a program risk prediction data unit, used for determining program risk prediction data according to the similarity and a preset similarity coefficient.

[0042] In one embodiment, the similarity unit comprises:

[0043] a history risk vector unit configured to determine a history program change vector according to the history program change directed graph and the first program change risk model parameters, and determine a history risk vector according to the history risk structure graph and the first program change risk model parameters;

[0044] a similarity subunit configured to determine a similarity between the history program change directed graph and each history risk structure graph according to the history program change vector, the history risk vector and the second program change risk model parameters.

[0045] In one embodiment, the program risk prediction data unit comprises:

[0046] a comprehensive risk data subunit configured to determine comprehensive risk data according to the similarity and the similarity coefficient;

[0047] a program risk prediction data subunit configured to determine the program risk prediction data according to a comparison result of the comprehensive risk data and a preset risk threshold.

[0048] In one embodiment, the method further comprises:

[0049] a risk event label module configured to determine a risk event label according to the actual risk data;

[0050] a change code attribute module configured to determine a change code attribute according to a risk event program corresponding to the risk event label;

[0051] a history risk structure graph module configured to generate the history risk structure graph according to the risk event label and the change code attribute.

[0052] In one embodiment, the risk event label comprises a risk event name, a risk event keyword and a risk event program.

[0053] The risk event label module comprises:

[0054] a risk parameter determination unit configured to determine the risk event name, a risk event reason, a risk event impact and the risk event program according to the actual risk data;

[0055] a risk event keyword unit configured to determine the risk event keyword according to the risk event reason and the risk event impact.

[0056] The embodiments of the present application also provide an electronic device, which comprises a memory, a processor and a computer program stored in the memory and running on the processor, and the processor implements the steps of the program change risk prediction method when running the computer program.

[0057] The embodiment of the present application also provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to realize the steps of the program change risk prediction method.

[0058] The embodiment of the present application also provides a computer program product, which comprises computer programs / instructions, and the computer programs / instructions are executed by a processor to realize the steps of the program change risk prediction method.

[0059] The program change risk prediction method and device according to the embodiment of the present application can quickly and accurately predict the program change risk, guarantee the stable program running, and reduce the risk loss. BRIEF DESCRIPTION OF DRAWINGS

[0060] In order to more clearly illustrate the technical solutions of the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed in the embodiment description. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative effort on the basis of these drawings.

[0061] Figure 1 is a flowchart of the program change risk prediction method in the embodiment of the present application;

[0062] Figure 2 is a flowchart of generating the historical risk structure chart in the embodiment of the present application;

[0063] Figure 3 is a flowchart of S201 in the embodiment of the present application;

[0064] Figure 4 is a flowchart of creating the program change risk model in the embodiment of the present application;

[0065] Figure 5 is a flowchart of S402 in the embodiment of the present application;

[0066] Figure 6 is a flowchart of S501 in the embodiment of the present application;

[0067] Figure 7 is a flowchart of S502 in the embodiment of the present application;

[0068] Figure 8 is a structural block diagram of the program change risk prediction device in the embodiment of the present application;

[0069] Figure 9 is a schematic block diagram of the system constitution of the electronic device 9600 of the embodiment of the present application. DETAILED DESCRIPTION

[0070] The technical solutions in the embodiments of the present application will be described clearly and completely below in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work belong to the scope of protection of the present application.

[0071] It is known to those skilled in the art that the embodiments of the present application can be implemented as a system, device, apparatus, method or computer program product. Therefore, the present disclosure can be embodied as a complete hardware, complete software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.

[0072] In the technical solutions of the present application, the acquisition, storage, use, processing, etc. of data comply with the relevant provisions of national laws and regulations. The user information in the embodiments of the present application is obtained through legal and compliant channels, and the acquisition, storage, use, processing, etc. of user information is authorized and agreed by the client.

[0073] The present application can automatically extract specific entities and relationships according to historical risks, and construct a historical risk directed graph based on this, to describe the historical risk points and their corresponding program changes; at the same time, when the current program changes, the directed graph of the current program change can also be automatically extracted. Based on the constructed directed graph, when the program code changes, the trained graph neural network model is used to automatically evaluate the code changes, and the impact caused by the code changes is sorted out, so as to give the nodes that need to be focused on, which can quickly and accurately predict the program changes. The present application will be described in detail below in combination with the drawings.

[0074] Figure 1 is a flowchart of the program change risk prediction method in the embodiments of the present application. As shown in Figure 1 , the program change risk prediction method comprises:

[0075] S101: Obtain a target changed program.

[0076] S102: Generate a target program change directed graph according to the target changed program.

[0077] For example, when the code segment K changes, a target program change directed graph associated with the K code segment can be generated.

[0078] S103: Input the target program change directed graph and the historical risk structure graph into a program change risk model to obtain a program change risk.

[0079] The program change risk includes a risk type, and the risk can be focused on for testing.

[0080] Figure 1 The execution subject of the program change risk prediction method is a computer. Figure 1 As shown in the flow, the program change risk prediction method and device can quickly and accurately predict the program change risk according to the target program change directed graph, guarantee the stable program running, and reduce the risk loss.

[0081] Figure 2 The flowchart shown in the embodiment of the present application is a flowchart for generating a historical risk structure graph. Figure 2 The program change risk prediction method further includes:

[0082] S201: determining a risk event label according to the actual risk data.

[0083] The risk event label includes a risk event name, a risk event keyword, and a risk event program.

[0084] In the specific implementation, the risk event label can be determined by various ways such as risk report text analysis, program error log analysis, and program error code analysis. For example, when a program has a risk event, the risk report should include the risk event number, the risk event cause, the risk event attribution program, and the risk event impact. The risk event label is formed by the text analysis.

[0085] Figure 3 The flowchart shown in the embodiment of the present application is a flowchart for S201. Figure 3 As shown in the flowchart, S201 includes:

[0086] S301: determining the risk event name, the risk event cause, the risk event impact, and the risk event program according to the actual risk data.

[0087] The risk event label name is the risk event number. According to the risk event attribution program, the corresponding program of the risk event can be further located, and the program change situation can be sorted out.

[0088] S302: determining the risk event keyword according to the risk event cause and the risk event impact.

[0089] In specific implementation, the risk event keywords can be determined by the method of word frequency analysis. For example, when three words in the risk event cause and the risk event impact are the top three words with practical significance in terms of frequency of occurrence, the three words can be used as the risk event keywords of the historical risk event.

[0090] S202: Determine the change code attribute according to the risk event program corresponding to the risk event label.

[0091] In specific implementation, it is assumed that there is a risk event A at present, and the risk event corresponding program in the risk report shows that the program causing the risk event at present is program B. Therefore, the changes of program B occurring in the current period are further sorted out. By comparing the code texts of the previous and subsequent versions, it can be sorted out that there are three changes X, Y and Z of program B occurring in the current period. By evaluating the three changes, it is found that the breakpoint occurs at X, and the breakpoint can be found by analyzing the production log or code segment execution. For example, there is information of ERROR level in the production log.

[0092] In addition, there can be a case where no program change occurs in the current period, but the error breakpoint is still in the program. This situation occurs because the upstream and downstream programs have changed and are incompatible. It is assumed that only program B has changed in the current period, but the program causing the risk event at present is program D. Although change X can run correctly in program B, when it is transmitted to program D, it can not be processed because program D in the current period is not compatible with the change of program B, thereby causing a production event. Therefore, the corresponding code segment in program D should also be extracted. In addition, the extracted code segment should also be marked with related attributes, such as the change type of the current period (adding a field, deleting a field, dictionary value change, etc.), the program function type (online transaction, batch processing, data synchronization, etc.), the code change degree (which can be divided into large, medium and small according to the code change amount), and other attributes.

[0093] Among them, the change code attribute is mainly obtained by the code change amount, and the code change amount mainly refers to the code modification amount of each change in the program change in the current period. For example, there are three changes X, Y and Z in program B, among which the code modification amount of X is 1000 lines, the code change amount of Y is 500 lines, and the code change amount of Z is 100 lines. According to the threshold set in advance, such as more than 600 lines is considered as code change degree-large, less than 300 lines is considered as code change degree-small, and the rest is code change degree-medium.

[0094] S203: Generate the historical risk structure diagram according to the risk event label and the change code attribute.

[0095] For example, there are three program code changes under the label of historical risk event A, namely B, C and D, wherein B is the program code fragment triggering the risk event, and D is the direct program where the error of the risk event occurs, thereby obtaining a directed graph (historical risk structure graph) of B-C-D, and the risk point in the directed graph is labeled at B, that is, the attribute of the risk point is added to the node attribute of B.

[0096] Figure 4 is a flowchart of creating a program change risk model in an embodiment of the present application. As shown in Figure 4 , the steps of creating a program change risk model include:

[0097] S401: determining a historical program change directed graph according to historical changed programs.

[0098] S402: determining program risk prediction data according to the historical program change directed graph, program change risk model parameters and the historical risk structure graph.

[0099] Figure 5 is a flowchart of S402 in an embodiment of the present application. As shown in Figure 5 , S402 includes:

[0100] S501: determining the similarity of the historical program change directed graph and each historical risk structure graph according to the historical program change directed graph, program change risk model parameters and the historical risk structure graph.

[0101] Figure 6 is a flowchart of S501 in an embodiment of the present application. As shown in Figure 6 , S501 includes:

[0102] S601: determining a historical program change vector according to the historical program change directed graph and the first program change risk model parameters, and determining a historical risk vector according to the historical risk structure graph and the first program change risk model parameters.

[0103] In specific implementation, first, the historical program change directed graph and the historical risk structure graph need to be processed by vectorization. The historical program change directed graph is extracted from the code fragment where the program change occurs and extended to the final node, thereby forming a directed graph of program change. The historical program change directed graph and the historical risk structure graph are both graph structure data, which cannot be directly used as input variables in the model training process, so the graph structure data needs to be processed by vectorization first.

[0104] The application can be processed using convolution extraction, but is not limited to this way. The convolution extraction first onehot encodes the graph structure, that is, encodes each node and edge in the graph structure, and converts it into a data matrix; then the data matrix is convoluted and compressed, and the features of each neighbor node are weighted and processed, and the specific processing function is:

[0105]

[0106] where y (u n ) is the historical program change vector or the historical risk vector of the nth directed graph node; f1 is an activation function, which can use functions such as relu and sigmoid; d n is the frequency of the nth directed graph node, d m is the frequency of the mth directed graph node, u m is the data matrix of the mth directed graph node, and the first program change risk model parameters include the first program change risk model weight W1 and the first program change risk model bias b1.

[0107] S602: Determine the similarity of the historical program change directed graph and each historical risk structure graph according to the historical program change vector, the historical risk vector and the second program change risk model parameters.

[0108] where the inner product between two vectors can be used to determine the similarity between the two vectors, and the similarity calculation function used is the formula for calculating the inner product using neural tensor networks.

[0109] S502: Determine program risk prediction data according to the similarity and a preset similarity coefficient.

[0110] Figure 7 is the flowchart of S502 in the embodiment of the application. As shown in Figure 7 S502 includes:

[0111] S701: Determine comprehensive risk data according to the similarity and the similarity coefficient.

[0112] In specific implementation, the historical risk value can be calculated by weighted average, using historical risk occurrence frequency, risk impact level and other historical risk label attributes as the similarity coefficient. Taking the historical risk occurrence frequency as an example, there are currently two types of risk events F and G, of which the historical occurrence frequency of risk event F accounts for 0.8, and the historical occurrence frequency of risk event G accounts for 0.2. The risk event H occurs now, and the similarity calculated with the historical risk structure graph of the risk event F and G is f and g respectively, so the comprehensive risk data of the risk event H can be calculated as 0.8f+0.2g.

[0113] S702: determining the program risk prediction data according to a comparison result of the comprehensive risk data and a preset risk threshold.

[0114] For example, when the comprehensive risk data is greater than the risk threshold, it is considered that there is a risk, and the model output is 1; otherwise, it is considered that there is no risk, and the model output is 0.

[0115] S403: iteratively adjusting the program change risk model parameters according to the program risk prediction data and the actual risk data corresponding to the historical change program.

[0116] S404: when the current iteration number is equal to the preset iteration number, creating a program change risk model according to the program change risk model parameters.

[0117] The specific process of the embodiment of the application is as follows:

[0118] 1. determining the risk event name, risk event cause, risk event impact and risk event program according to the actual risk data.

[0119] 2. determining the risk event keyword according to the risk event cause and the risk event impact.

[0120] 3. determining the change code attribute according to the risk event program corresponding to the risk event label, and generating the historical risk structure diagram according to the risk event label and the change code attribute.

[0121] 4. determining the historical program change vector according to the historical program change directed graph and the first program change risk model parameters, and determining the historical risk vector according to the historical risk structure diagram and the first program change risk model parameters.

[0122] 5. determining the similarity of the historical program change directed graph and each historical risk structure diagram according to the historical program change vector, the historical risk vector and the second program change risk model parameters.

[0123] 6. determining the comprehensive risk data according to the similarity and the similarity coefficient.

[0124] 7. determining the program risk prediction data according to a comparison result of the comprehensive risk data and a preset risk threshold.

[0125] 8. iteratively adjusting the program change risk model parameters according to the program risk prediction data and the actual risk data corresponding to the historical change program.

[0126] 9. when the current iteration number is equal to the preset iteration number, creating a program change risk model according to the program change risk model parameters.

[0127] 10. obtaining a target change program, and generating a target program change directed graph according to the target change program.

[0128] 11. inputting the target program change directed graph and a historical risk structure graph into a program change risk model to obtain a program change risk.

[0129] In summary, the program change risk prediction method provided by the embodiment of the present application can quickly and accurately predict the risk of program change, avoid the risk situation that has occurred in history, ensure the stable operation of the program, and reduce the risk loss caused by program change.

[0130] Based on the same inventive concept, the embodiment of the present application also provides a program change risk prediction device. Since the principle of solving the problem of the device is similar to that of the program change risk prediction method, the implementation of the device can be referred to the implementation of the method, and the repeated parts will not be described again.

[0131] Figure 8 is a structural block diagram of the program change risk prediction device in the embodiment of the present application. As shown in Figure 8 the program change risk prediction device comprises:

[0132] an obtaining module, configured to obtain a target change program;

[0133] a target program change directed graph module, configured to generate a target program change directed graph according to the target change program;

[0134] a program change risk module, configured to input the target program change directed graph and a historical risk structure graph into a program change risk model to obtain a program change risk.

[0135] In one embodiment, the program change risk prediction device further comprises:

[0136] a historical program change directed graph module, configured to determine a historical program change directed graph according to a historical change program;

[0137] a program risk prediction data module, configured to determine program risk prediction data according to the historical program change directed graph, a program change risk model parameter, and the historical risk structure graph;

[0138] an iteration module, configured to iteratively adjust the program change risk model parameter according to the program risk prediction data and actual risk data corresponding to the historical change program;

[0139] a program change risk model creation module, configured to create a program change risk model according to the program change risk model parameter when a current iteration number is equal to a preset iteration number.

[0140] In one embodiment, the program risk prediction data module comprises:

[0141] a similarity unit, configured to determine the similarity between the historical program change directed graph and each historical risk structure graph based on the historical program change directed graph, program change risk model parameters, and the historical risk structure graph;

[0142] The program risk prediction data unit is used to determine program risk prediction data according to the similarity and a preset similarity coefficient.

[0143] In one embodiment, the similarity unit includes:

[0144] a historical risk vector subunit, configured to determine a historical program change vector based on the historical program change directed graph and the first program change risk model parameters, and to determine a historical risk vector based on the historical risk structure graph and the first program change risk model parameters;

[0145] The similarity subunit is used to determine the similarity between the historical program change directed graph and each historical risk structure graph according to the historical program change vector, the historical risk vector and the second program change risk model parameter.

[0146] In one embodiment, the program risk prediction data unit includes:

[0147] a comprehensive risk data subunit, configured to determine comprehensive risk data based on the similarity and the similarity coefficient;

[0148] The program risk prediction data subunit is used to determine the program risk prediction data based on the comparison result of the comprehensive risk data and the preset risk threshold.

[0149] In one embodiment, it further includes:

[0150] A risk event label module, configured to determine a risk event label based on the actual risk data;

[0151] A change code attribute module is used to determine the change code attribute according to the risk event program corresponding to the risk event label;

[0152] The historical risk structure diagram module is used to generate the historical risk structure diagram according to the risk event label and the change code attribute.

[0153] In one embodiment, the risk event label includes a risk event name, a risk event keyword, and a risk event procedure;

[0154] The risk event label module includes:

[0155] A risk parameter determination unit is configured to determine the risk event name, risk event cause, risk event impact, and the risk event procedure according to the actual risk data.

[0156] A risk event keyword unit is configured to determine the risk event keyword according to the risk event cause and the risk event impact.

[0157] In actual application, the program change risk prediction device comprises a historical risk label acquisition module, a program change acquisition module, a historical risk directed graph generation module, a graph neural network training module, and a risk point prediction module.

[0158] The historical risk label acquisition module comprises a risk event label module, which is configured to extract and summarize historical production operation problems, collate corresponding code changes, and finally form a program change relationship of annotated historical risk points for subsequent directed graph generation.

[0159] The program change acquisition module comprises a change code attribute module, which is configured to acquire the program to which the risk event belongs based on the risk event in the historical risk label, comb the modification occurring in the program, and finally obtain the program change code segment that triggers the risk event.

[0160] The historical risk directed graph generation module comprises a historical risk structure diagram module, which is configured to combine the historical risk label acquisition and the program change acquisition to form the final directed graph. According to the extraction of the above two modules, the historical risk label and the corresponding program change code segment are obtained. By extracting and combining the program change code segment under the historical risk label, the risk directed graph corresponding to the risk label can be obtained.

[0161] The graph neural network training module comprises a historical program change directed graph module, a program risk prediction data module, an iteration module, and a program change risk model creation module, which are configured to, after obtaining the historical risk directed graph, judge the graph similarity between the program directed graph with changes and the historical risk directed graph through the graph neural network, and thus obtain the training process of whether the program change will exist risk.

[0162] The test range and strategy prediction module comprises an acquisition module, a target program change directed graph module, and a program change risk module, which are configured to, after the graph neural network model training is completed, dynamically analyze the program change according to each program change, and judge whether the program change exists risk.

[0163] In summary, the program change risk prediction device of the embodiment of the present invention generates a target program change directed graph based on the target change program, inputs the target program change directed graph and the historical risk structure graph into the program change risk model, and obtains the program change risk. It can quickly and accurately predict the risk of program changes, ensure stable program operation, and reduce risk losses.

[0164] Figure 9 Schematic block diagram of the system structure of the electronic device 9600 according to an embodiment of the present application. Figure 9 As shown, the electronic device 9600 may include a central processing unit 9100 and a memory 9140; the memory 9140 is coupled to the central processing unit 9100. It is worth noting that the Figure 9 is exemplary; other types of structures may also be used to supplement or replace this structure to implement telecommunication functions or other functions.

[0165] In one embodiment, the program change risk prediction method function may be integrated into the central processing unit 9100. The central processing unit 9100 may be configured to perform the following control:

[0166] Obtain target change procedures;

[0167] generating a target program change directed graph according to the target change program;

[0168] The target program change directed graph and the historical risk structure graph are input into a program change risk model to obtain the program change risk.

[0169] From the above description, it can be seen that the program change risk prediction method provided by this application generates a target program change directed graph based on the target change program, inputs the target program change directed graph and the historical risk structure graph into the program change risk model, and obtains the program change risk. It can quickly and accurately predict the risk of program changes, ensure stable program operation, and reduce risk losses.

[0170] In another embodiment, the program change risk prediction device can be configured separately from the central processing unit 9100. For example, the program change risk prediction device can be configured as a chip connected to the central processing unit 9100, and the function of the program change risk prediction method can be realized through the control of the central processing unit.

[0171] like Figure 9 As shown, the electronic device 9600 may further include: a communication module 9110, an input unit 9120, an audio processor 9130, a display 9160, and a power supply 9170. It is worth noting that the electronic device 9600 does not necessarily have to include Figure 9 In addition, the electronic device 9600 may also include all components shown in Figure 9Components not shown in the figure can be referred to the prior art.

[0172] As shown in FIG. 9, the central processing unit 9100, which is also sometimes referred to as a controller or operation control, can include a microprocessor or other processor device and / or logic device, which receives input and controls the operation of the various components of the electronic device 9600. Figure 9

[0173] The memory 9140, for example, can be one or more of a buffer, a flash memory, a hard drive, a removable media, a volatile memory, a non-volatile memory, or other suitable device. Information related to failures described above can be stored, in addition to programs for executing the information. The central processing unit 9100 can execute the programs stored in the memory 9140 to perform information storage or processing, etc.

[0174] The input unit 9120 provides input to the central processing unit 9100. The input unit 9120 is, for example, a key or a touch input device. The power supply 9170 is used to provide power to the electronic device 9600. The display 9160 is used to display display objects such as images and text. The display can be, for example, an LCD display, but is not limited thereto.

[0175] The memory 9140 can be a solid state memory such as a read only memory (ROM), a random access memory (RAM), a SIM card, etc. It can also be a memory that retains information even when power is off, can be selectively erased, and is provided with more data, examples of which are sometimes referred to as EPROM, etc. The memory 9140 can also be some other type of device. The memory 9140 includes a buffer 9141 (sometimes referred to as a buffer memory). The memory 9140 can include an application / function storage section 9142 for storing application programs and function programs or for storing a flow for performing the operation of the electronic device 9600 by the central processing unit 9100.

[0176] The memory 9140 can also include a data storage section 9143 for storing data such as contacts, digital data, pictures, sounds, and / or any other data used by the electronic device. A driver storage section 9144 of the memory 9140 can include various drivers of the electronic device for communication functions and / or for performing other functions of the electronic device such as a messaging application, a contact application, etc.

[0177] ​The communication module 9110 is a transmitter / receiver 9110 that transmits and receives signals via an antenna 9111. The communication module (transmitter / receiver) 9110 is coupled to the central processor 9100 to provide input signals and receive output signals, as in the case of a conventional mobile communication terminal.

[0178] Based on different communication technologies, a plurality of communication modules 9110, such as a cellular network module, a Bluetooth module, and / or a wireless local area network module, can be provided in the same electronic device. The communication module (transmitter / receiver) 9110 is also coupled to a speaker 9131 and a microphone 9132 via an audio processor 9130 to provide audio output via the speaker 9131 and receive audio input from the microphone 9132, thereby enabling conventional telecommunication functions. The audio processor 9130 can include any suitable buffers, decoders, amplifiers, etc. In addition, the audio processor 9130 is coupled to the central processor 9100, thereby enabling recording on the local device via the microphone 9132 and playing stored sounds on the local device via the speaker 9131.

[0179] The embodiment of the present application further provides a computer readable storage medium capable of implementing all steps of the program change risk prediction method in which the execution subject in the above-mentioned embodiment is a server or a client, wherein the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement all steps of the program change risk prediction method in the above-mentioned embodiment, for example, the steps of:

[0180] obtaining a target changed program;

[0181] generating a target program change directed graph according to the target changed program;

[0182] inputting the target program change directed graph and a historical risk structure graph into a program change risk model to obtain a program change risk.

[0183] In summary, the computer readable storage medium of the embodiment of the present application generates a target program change directed graph according to a target changed program, inputs the target program change directed graph and a historical risk structure graph into a program change risk model to obtain a program change risk, can quickly and accurately predict the risk of program change, ensures stable program operation, and reduces risk loss.

[0184] The embodiment of the present application also provides a computer program product capable of realizing all steps of the program change risk prediction method in the above-mentioned embodiment in which the execution subject is a server or a client, the computer program product comprising computer programs / instructions which, when executed by a processor, realize all steps of the program change risk prediction method in the above-mentioned embodiment, for example, the steps of:

[0185] obtaining a target changed program;

[0186] generating a target program change directed graph according to the target changed program;

[0187] inputting the target program change directed graph and a historical risk structure graph into a program change risk model to obtain program change risk.

[0188] In summary, the computer program product of the embodiment of the present application generates a target program change directed graph according to a target changed program, inputs the target program change directed graph and a historical risk structure graph into a program change risk model to obtain program change risk, can quickly and accurately predict the program change risk, guarantees stable program running, and reduces risk loss.

[0189] Each embodiment in the specification is described in a progressive manner, and the same or similar parts of each embodiment can be referred to each other. Each embodiment mainly describes the difference from other embodiments. Especially, for the hardware+program type embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the related parts can be referred to the part of the method embodiment.

[0190] The above describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the acts or steps recited in the claims can be performed in a different order than those described in the embodiments and still achieve desirable results. In addition, the processes depicted in the figures do not necessarily require the particular order shown or sequential order in order to achieve the desired results. In some implementations, multitasking and parallel processing can be advantageous.

[0191] Although the present application provides method operation steps as described in the embodiments or flowcharts, more or fewer operation steps can be included based on conventional or non-inventive labor. The order of steps listed in the embodiments is only one of the many execution orders of the steps, and does not represent the only execution order. When the device or client product in practice is executed, the method order shown in the embodiments or the drawings can be executed in sequence or in parallel (for example, in a parallel processor or multi-thread processing environment).

[0192] Although the method operations are described in the present disclosure as a sequence of operations, it is to be understood that the logical flow of the methods can be different than that described, and that the order of execution of the operations can be changed, and that individual operations described as discrete steps can be executed over a different time period, or can be executed in parallel. An implementation of the described methods can be viewed as a state machine where each operation or step in the operational sequence can correspond to a state in a finite state machine, and the various elements of the system can be considered as states, state variables, state transitions and / or transitions variables. Additionally, not all operations can be necessary to implement a method in accordance with the disclosure.

[0193] For ease of description, the above apparatuses are described as various modules to describe the apparatuses separately. Of course, when implementing the embodiments of the present disclosure, the functions of the modules can be implemented in one or more software and / or hardware, or the modules implementing the same function can be implemented by combinations of sub-modules or sub-units. The apparatus embodiments described above are merely illustrative, for example, the division of the units is merely a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed units can be indirect coupling or communication connection through some interfaces, devices or units, and can be electrical, mechanical or other forms.

[0194] Those skilled in the art will also appreciate that, in addition to being implemented in purely computer readable program code means, the controller can be implemented using logic programmed to perform the method steps and realized in logic gates, switches, specialized integrated circuits, programmable logic controllers and embedded microcontrollers, etc. Thus the controller can be considered to be means for implementing various functions in hardware and the means for implementing the various functions can be considered to be structures within the hardware means. Alternatively, the means for implementing the various functions can be considered to be both software modules implementing the method and structures within the hardware means.

[0195] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flow or blocks Figure 1 means for functionally implementing the steps listed in the flowchart block or blocks.

[0196] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart block or blocks. Figure 1 one or more flow or blocks Figure 1 means for functionally implementing the steps listed in the flowchart block or blocks.

[0197] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flow or blocks Figure 1 means for functionally implementing the steps listed in the flowchart block or blocks.

[0198] In one typical configuration, the computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.

[0199] The memory can include non-persistent memory and / or volatile memory, such as random access memory (RAM) and / or cache memory, non-volatile memory, etc. in the form of computer-readable media. The memory is an example of computer-readable media.

[0200] Computer-readable media includes permanent and non-permanent, movable and non-movable media that can be implemented by any method or technology to store information. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic tape disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible to a computing device. According to the definition herein, computer-readable media does not include transitory media such as modulated data signals and carriers.

[0201] Those skilled in the art will appreciate that embodiments of the present specification can be provided as methods, systems or computer program products. Therefore, embodiments of the present specification can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Moreover, embodiments of the present specification can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage etc.) containing computer-usable program code.

[0202] Embodiments of the present specification can be described in the general context of computer-executable instructions being executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. Embodiments of the present specification can also be practiced in distributed computing environments where tasks are performed by remote processing devices that are connected through a communication network. In a distributed computing environment, program modules can be located in both local and remote computer storage media including storage devices.

[0203] In the description of the specification, the description using the terms "one embodiment", "some embodiments", "an example", "a specific example", or "some examples" etc. means that the particular feature, structure, material or characteristic following the term is contained in at least one embodiment or example of the specification, and the above-mentioned terms do not necessarily refer to the same embodiment or example. Also, the description using the terms "and / or" between the features, structures, materials or characteristics means that any or all of the features, structures, materials or characteristics are able to be included in a single embodiment or example, and the description using the terms "comprise a" or "comprises" does not exclude the possibility that the other feature, structure, material or characteristic is included.

[0204] The above only describes the embodiments of the specification, and is not intended to limit the specification. The specification can have various changes and modifications for those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the specification should be included in the scope of the claims of the specification.

Claims

1. A program variation risk prediction method characterized by, The method comprises the following steps: obtaining a target change program; generating a target program change directed graph according to the target change program, when a code segment K is changed, a target program change directed graph associated with the K code segment can be generated; inputting the target program change directed graph and a historical risk structure graph into a program change risk model to obtain a program change risk; wherein the step of creating the program change risk model comprises: determining a historical program change directed graph according to a historical change program; determining program risk prediction data according to the historical program change directed graph, program change risk model parameters and the historical risk structure graph, the historical program change directed graph is a directed graph formed by extracting a code segment that has undergone program change and extending to its final node; iteratively adjusting the program change risk model parameters according to the program risk prediction data and actual risk data corresponding to the historical change program; when the current iteration number is equal to the preset iteration number, creating the program change risk model according to the program change risk model parameters; determining a risk event label according to the actual risk data; determining a change code attribute according to a risk event program corresponding to the risk event label; generating the historical risk structure graph according to the risk event label and the change code attribute.

2. The program change risk prediction method according to claim 1, characterized by, determining program risk prediction data according to the historical program change directed graph, program change risk model parameters and the historical risk structure graph comprises: determining the similarity between the historical program change directed graph and each historical risk structure graph according to the historical program change directed graph, program change risk model parameters and the historical risk structure graph; determining program risk prediction data according to the similarity and a preset similarity coefficient.

3. The program change risk prediction method according to claim 2, characterized by, determining the similarity between the historical program change directed graph and each historical risk structure graph according to the historical program change directed graph, program change risk model parameters and the historical risk structure graph comprises: determining a historical program change vector according to the historical program change directed graph and first program change risk model parameters, and determining a historical risk vector according to the historical risk structure graph and first program change risk model parameters; determining the similarity between the historical program change directed graph and each historical risk structure graph according to the historical program change vector, the historical risk vector and second program change risk model parameters.

4. The program change risk prediction method according to claim 2, characterized by, determining program risk prediction data according to the similarity and a preset similarity coefficient comprises: determining comprehensive risk data according to the similarity and the similarity coefficient; determining the program risk prediction data according to the comparison result of the comprehensive risk data and a preset risk threshold.

5. The program change risk prediction method according to claim 1, characterized by, The risk event label comprises a risk event name, a risk event keyword and a risk event program; determining a risk event label according to the actual risk data comprises: determining the risk event name, a risk event reason, a risk event impact and the risk event program according to the actual risk data; determining the risk event keyword according to the risk event reason and the risk event impact.

6. A program change risk prediction device characterized by comprising: The method comprises the following steps: an obtaining module, configured to obtain a target change program; The target program change directed graph module is configured to generate a target program change directed graph according to the target change program, and when a code segment K is changed, a target program change directed graph associated with the K code segment can be generated; The program change risk module is configured to input the target program change directed graph and the historical risk structure graph into a program change risk model to obtain program change risk; The step of creating the program change risk model comprises: determining a historical program change directed graph according to a historical change program; determining program risk prediction data according to the historical program change directed graph, program change risk model parameters and the historical risk structure graph, the historical program change directed graph being a directed graph formed by extracting a code segment that has undergone program change and extending to a final node thereof; iteratively adjusting the program change risk model parameters according to the program risk prediction data and actual risk data corresponding to the historical change program; and creating a program change risk model according to the program change risk model parameters when a current iteration number is equal to a preset iteration number; The risk event label is determined according to the actual risk data; the change code attribute is determined according to a risk event program corresponding to the risk event label; and the historical risk structure graph is generated according to the risk event label and the change code attribute.

7. A computer device comprising a memory, a processor, and a computer program stored on the memory and running on the processor, characterized in that, The processor executes the computer program to implement the steps of the program change risk prediction method of any one of claims 1 to 5.

8. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the program change risk prediction method of any one of claims 1 to 5.

9. A computer program product comprising computer programs / instructions, characterized in that, The computer program or instructions are executed by the processor to implement the steps of the program change risk prediction method of any one of claims 1 to 5.

Citation Information

Patent Citations

  • Model training method and device, test method and device, electronic equipment and storage medium

    CN113296836A

  • Program change influence range identification method and device, equipment and storage medium

    CN114201399A