A risk assessment method, device, electronic device and storage medium
By obtaining the application orchestration diagram of the intelligent application and using the pre-constructed knowledge graph for risk assessment, the risk problems caused by device resource limitations during the operation of intelligent application are solved, and the accurate prediction and effective processing of risks are achieved.
Patent Information
- Application Number
- CN202411975379.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2044-12-30
AI Technical Summary
During the process of running smart applications, due to the limitations of the software and hardware resources of the device's processing unit, risk events may occur, threatening the stability and feasibility of the deployed smart applications in the device's operation.
A risk assessment method is provided, by obtaining the application orchestration diagram to be evaluated and determining matching nodes from the pre-constructed knowledge graph, and generating the first predicted risk assessment result based on the node attributes and connection relationships. The method also includes using a trained risk assessment model and a risk solution plan generation model to further adjust the risk assessment results and generate the risk solution plan.
Accurate prediction of possible risks is achieved, the stability and feasibility of application operation are improved, and the risk can be effectively handled and resolved when risks occur.
Smart Images

Figure CN119378674B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer software technology, and in particular to a risk assessment method, device, electronic device and storage medium. Background Art
[0002] In the field of computer software technology, application developers can develop intelligent applications through intelligent application development tools. Current intelligent application development tools support building application orchestration diagrams of intelligent applications in the form of graphical plug-ins.
[0003] However, due to the hardware and software resource limitations of the processing unit of the device on which the smart application is to be deployed, risk events may occur during the operation of the smart application corresponding to the application orchestration diagram, threatening the stability and feasibility of the device running the deployed smart application. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a risk assessment method, device, electronic device and storage medium to accurately predict possible risks and improve the stability and feasibility of application operation. The specific technical solution is as follows:
[0005] In a first aspect of an embodiment of the present application, a risk assessment method is first provided, the method comprising:
[0006] Obtaining an application orchestration graph to be evaluated; wherein an application orchestration graph of an application includes multiple entities and entity connection relationships between the multiple entities, an entity represents an operation step required to be performed during the running of the application, and the operation steps represented by two entities having an entity connection relationship during the running of the application are executed sequentially;
[0007] Determine, from a pre-built knowledge graph, a node that matches the entity connection relationship between each two entities in the application orchestration graph to be evaluated; wherein the knowledge graph includes multiple nodes and node connection relationships between nodes; each node represents an entity connection relationship between two entities in the application orchestration graph; the node attributes of each node include: the risk type of the risk existing in the entity connection relationship represented by the node; the node connection relationship between two nodes represents the relationship between the risks represented by the two nodes;
[0008] Based on the node attributes of the matched nodes and the node connection relationships between the matched nodes, a first predicted risk assessment result representing the overall risk of the application orchestration graph to be assessed is obtained.
[0009] In some embodiments, obtaining a first predicted risk assessment result representing the overall risk of the application orchestration graph to be assessed based on the node attributes of the matched nodes and the node connection relationship between the matched nodes includes:
[0010] Inputting node attributes of the matched nodes and node connection relationships between the matched nodes into the trained risk assessment model to obtain a first predicted risk assessment result representing the overall risk of the application orchestration graph to be assessed;
[0011] Among them, the risk assessment model is: trained based on the first sample data and the label corresponding to the first sample data; the first sample data includes: the node attributes of the nodes that match the entity connection relationship contained in the first sample application orchestration diagram, and the node connection relationship between the matching nodes; the label corresponding to the first sample data includes: the first sample risk assessment result representing the overall risk of the first sample application orchestration diagram.
[0012] In some embodiments, the risk assessment model training process includes:
[0013] Acquire the first sample data and a label corresponding to the first sample data;
[0014] Inputting the first sample data into the risk assessment model of the initial structure to obtain a second predicted risk assessment result output by the risk assessment model of the initial structure, which indicates the overall risk of the first sample application arrangement diagram;
[0015] Calculate the loss value according to the difference between the obtained second prediction risk assessment result and the first sample risk assessment result included in the label corresponding to the first sample data;
[0016] Based on the obtained loss value, the model parameters of the risk assessment model of the initial structure are adjusted until convergence is reached to obtain a trained risk assessment model.
[0017] In some embodiments, after obtaining a first predicted risk assessment result representing an overall risk of the application orchestration graph to be assessed based on the node attributes of the matched nodes and the node connection relationship between the matched nodes, the method further includes:
[0018] Inputting the first predicted risk assessment result into a trained risk resolution plan generation model to obtain a first predicted risk resolution plan for the application orchestration graph to be assessed;
[0019] Among them, the risk resolution plan generation model is trained based on the second sample data and the label corresponding to the second sample data; the second sample data includes a second sample risk assessment result representing the overall risk of the second sample application orchestration diagram; the label corresponding to the second sample data includes: a first sample risk resolution plan for the second sample application orchestration diagram.
[0020] In some embodiments, the training process of the risk solution generation model includes:
[0021] Acquire the second sample data and a label corresponding to the second sample data;
[0022] Inputting the second sample data into the risk solution plan generation model of the initial structure to obtain a second predicted risk solution plan for the second sample application arrangement diagram output by the risk solution plan generation model of the initial structure;
[0023] Calculate the loss value according to the difference between the obtained second predicted risk solution plan and the first sample risk solution plan included in the label corresponding to the second sample data;
[0024] Based on the obtained loss value, the model parameters of the risk assessment model of the initial structure are adjusted until convergence is reached, thereby obtaining a trained risk resolution plan generation model.
[0025] In some embodiments, after inputting the first predicted risk assessment result into a trained risk resolution plan generation model to obtain a first predicted risk resolution plan for the application orchestration graph to be assessed, the method further includes:
[0026] During the process of running the application generated based on the application orchestration graph to be evaluated, if the risk represented by the first predicted risk evaluation result occurs, it is processed according to the first predicted risk resolution plan.
[0027] In some embodiments, the risk type includes at least one of: model inference risk, resource risk, frame rate risk, and processing unit risk;
[0028] The risk resolution plan corresponding to the model reasoning risk is used to indicate: pruning or replacing the used model during the running of the application generated based on the application orchestration graph to be evaluated;
[0029] The risk resolution plan corresponding to the resource risk is used to indicate: in the process of running the application generated based on the application orchestration graph to be evaluated, to reserve designated spare computing resources, so as to complete the running of the application through the spare computing resources when the risk occurs;
[0030] The risk resolution plan corresponding to the frame rate risk is used to indicate: in the process of running the application generated based on the application orchestration graph to be evaluated, reducing the frame rate of data required to be processed by the application;
[0031] The risk resolution plan corresponding to the processing unit risk is used to indicate: in the process of running the application generated based on the application orchestration graph to be evaluated, a designated spare processing unit is reserved to complete the running of the application through the spare processing unit when the risk occurs.
[0032] In some embodiments, the node connection relationship includes at least one of the following: dependent on, causing enhancement, causing weakening, enhancing, and weakening;
[0033] The node attributes of each node also include: the probability of occurrence of the risk existing in the entity connection relationship represented by the node;
[0034] The obtaining, based on the node attributes of the matched nodes and the node connection relationship between the matched nodes, a first predicted risk assessment result representing the overall risk of the application orchestration graph to be assessed includes:
[0035] For each entity connection relationship in the application orchestration graph to be evaluated, determining the node attribute of the node in the knowledge graph that matches the entity connection relationship as the local risk assessment result represented by the entity connection relationship;
[0036] For any two entity connection relationships in the application orchestration graph to be evaluated, if the risk types of the risks represented by the nodes matched by the two entity connection relationships in the knowledge graph are inconsistent, and the node connection relationship between the two nodes is dependent on, then the occurrence probabilities recorded in the local risk assessment results represented by the two entity connection relationships are respectively increased;
[0037] If the risk types of the risks represented by the nodes that match the two entity connection relationships in the knowledge graph are inconsistent, and the node connection relationship between the two nodes is to cause enhancement, then determine the entity connection relationship represented by the node that causes enhancement in the two entity connection relationships, and increase the occurrence probability recorded in the local risk assessment result of the determined entity connection relationship;
[0038] If the risk types of the risks represented by the nodes that match the two entity connection relationships in the knowledge graph are inconsistent, and the node connection relationship between the two nodes is to cause a weakening, then determine the entity connection relationship represented by the node that causes a weakening in the two entity connection relationships, and reduce the occurrence probability recorded in the local risk assessment result of the determined entity connection relationship;
[0039] If the risk types of the risks represented by the nodes matched by the two entity connection relationships in the knowledge graph are consistent, and the node connection relationship between the two nodes is enhanced, then the occurrence probabilities recorded in the local risk assessment results represented by the two entity connection relationships are respectively increased;
[0040] If the risk types of the risks represented by the nodes matched by the two entity connection relationships in the knowledge graph are consistent, and the node connection relationship between the two nodes is weakened, then the occurrence probabilities recorded in the local risk assessment results represented by the two entity connection relationships are respectively reduced;
[0041] The local risk assessment results represented by the connection relationships of each entity are combined to obtain a first predicted risk assessment result representing the overall risk of the application orchestration graph to be assessed.
[0042] According to a second aspect of an embodiment of the present application, a risk assessment device is provided, the device comprising:
[0043] An application orchestration graph acquisition module is used to acquire an application orchestration graph to be evaluated; wherein an application orchestration graph of an application includes multiple entities and entity connection relationships between the multiple entities, an entity represents an operation step required to be performed during the operation of the application, and the operation steps represented by two entities having an entity connection relationship during the operation of the application are executed sequentially;
[0044] A matching module is used to determine, from a pre-built knowledge graph, a node that matches the entity connection relationship between each two entities in the application orchestration graph to be evaluated; wherein the knowledge graph includes multiple nodes and node connection relationships between nodes; each node represents an entity connection relationship between two entities in the application orchestration graph; the node attributes of each node include: the risk type of the risk existing in the entity connection relationship represented by the node; the node connection relationship between two nodes represents the relationship between the risks represented by the two nodes;
[0045] The first assessment module is used to obtain a first predicted risk assessment result representing the overall risk of the application orchestration graph to be assessed based on node attributes of the matched nodes and node connection relationships between the matched nodes.
[0046] In some embodiments, the first evaluation module is specifically used to:
[0047] Inputting node attributes of the matched nodes and node connection relationships between the matched nodes into the trained risk assessment model to obtain a first predicted risk assessment result representing the overall risk of the application orchestration graph to be assessed;
[0048] Among them, the risk assessment model is: trained based on the first sample data and the label corresponding to the first sample data; the first sample data includes: the node attributes of the nodes that match the entity connection relationship contained in the first sample application orchestration diagram, and the node connection relationship between the matching nodes; the label corresponding to the first sample data includes: the first sample risk assessment result representing the overall risk of the first sample application orchestration diagram.
[0049] In some embodiments, the risk assessment model training process includes:
[0050] Acquire the first sample data and a label corresponding to the first sample data;
[0051] Inputting the first sample data into the risk assessment model of the initial structure to obtain a second predicted risk assessment result output by the risk assessment model of the initial structure, which indicates the overall risk of the first sample application arrangement diagram;
[0052] Calculate the loss value according to the difference between the obtained second prediction risk assessment result and the first sample risk assessment result included in the label corresponding to the first sample data;
[0053] Based on the obtained loss value, the model parameters of the risk assessment model of the initial structure are adjusted until convergence is reached to obtain a trained risk assessment model.
[0054] In some embodiments, the apparatus further comprises:
[0055] A plan generation module is used for obtaining a first predicted risk assessment result representing the overall risk of the application orchestration graph to be evaluated based on the node attributes of the matched nodes and the node connection relationship between the matched nodes, and then inputting the first predicted risk assessment result into the trained risk solution plan generation model to obtain a first predicted risk solution plan for the application orchestration graph to be evaluated;
[0056] Among them, the risk resolution plan generation model is trained based on the second sample data and the label corresponding to the second sample data; the second sample data includes a second sample risk assessment result representing the overall risk of the second sample application orchestration diagram; the label corresponding to the second sample data includes: a first sample risk resolution plan for the second sample application orchestration diagram.
[0057] In some embodiments, the training process of the risk solution generation model includes:
[0058] Acquire the second sample data and a label corresponding to the second sample data;
[0059] Inputting the second sample data into the risk solution plan generation model of the initial structure to obtain a second predicted risk solution plan for the second sample application arrangement diagram output by the risk solution plan generation model of the initial structure;
[0060] Calculate the loss value according to the difference between the obtained second predicted risk solution plan and the first sample risk solution plan included in the label corresponding to the second sample data;
[0061] Based on the obtained loss value, the model parameters of the risk assessment model of the initial structure are adjusted until convergence is reached, thereby obtaining a trained risk resolution plan generation model.
[0062] In some embodiments, the apparatus further comprises:
[0063] A risk processing module is used to input the first predicted risk assessment result into a trained risk resolution plan generation model to obtain a first predicted risk resolution plan for the application orchestration diagram to be evaluated. If the risk represented by the first predicted risk assessment result occurs during the operation of the application generated based on the application orchestration diagram to be evaluated, the risk processing module is used to process the risk according to the first predicted risk resolution plan.
[0064] In some embodiments, the risk type includes at least one of: model inference risk, resource risk, frame rate risk, and processing unit risk;
[0065] The risk resolution plan corresponding to the model reasoning risk is used to indicate: pruning or replacing the used model during the running of the application generated based on the application orchestration graph to be evaluated;
[0066] The risk resolution plan corresponding to the resource risk is used to indicate: in the process of running the application generated based on the application orchestration graph to be evaluated, to reserve designated spare computing resources, so as to complete the running of the application through the spare computing resources when the risk occurs;
[0067] The risk resolution plan corresponding to the frame rate risk is used to indicate: in the process of running the application generated based on the application orchestration graph to be evaluated, reducing the frame rate of data required to be processed by the application;
[0068] The risk resolution plan corresponding to the processing unit risk is used to indicate: in the process of running the application generated based on the application orchestration graph to be evaluated, a designated spare processing unit is reserved to complete the running of the application through the spare processing unit when the risk occurs.
[0069] In some embodiments, the node connection relationship includes at least one of the following: dependent on, causing enhancement, causing weakening, enhancing, and weakening;
[0070] The node attributes of each node also include: the probability of occurrence of the risk existing in the entity connection relationship represented by the node;
[0071] The first evaluation module is specifically used for:
[0072] For each entity connection relationship in the application orchestration graph to be evaluated, determining the node attribute of the node in the knowledge graph that matches the entity connection relationship as the local risk assessment result represented by the entity connection relationship;
[0073] For any two entity connection relationships in the application orchestration graph to be evaluated, if the risk types of the risks represented by the nodes matched by the two entity connection relationships in the knowledge graph are inconsistent, and the node connection relationship between the two nodes is dependent on, then the occurrence probabilities recorded in the local risk assessment results represented by the two entity connection relationships are respectively increased;
[0074] If the risk types of the risks represented by the nodes that match the two entity connection relationships in the knowledge graph are inconsistent, and the node connection relationship between the two nodes is to cause enhancement, then determine the entity connection relationship represented by the node that causes enhancement in the two entity connection relationships, and increase the occurrence probability recorded in the local risk assessment result of the determined entity connection relationship;
[0075] If the risk types of the risks represented by the nodes that match the two entity connection relationships in the knowledge graph are inconsistent, and the node connection relationship between the two nodes is to cause a weakening, then determine the entity connection relationship represented by the node that causes a weakening in the two entity connection relationships, and reduce the occurrence probability recorded in the local risk assessment result of the determined entity connection relationship;
[0076] If the risk types of the risks represented by the nodes matched by the two entity connection relationships in the knowledge graph are consistent, and the node connection relationship between the two nodes is enhanced, then the occurrence probabilities recorded in the local risk assessment results represented by the two entity connection relationships are respectively increased;
[0077] If the risk types of the risks represented by the nodes matched by the two entity connection relationships in the knowledge graph are consistent, and the node connection relationship between the two nodes is weakened, then the occurrence probabilities recorded in the local risk assessment results represented by the two entity connection relationships are respectively reduced;
[0078] The local risk assessment results represented by the connection relationships of each entity are combined to obtain a first predicted risk assessment result representing the overall risk of the application orchestration graph to be assessed.
[0079] According to a third aspect of the embodiments of the present application, an electronic device is provided, including:
[0080] Memory, used to store computer programs;
[0081] The processor is used to implement any of the risk assessment methods described above when executing the program stored in the memory.
[0082] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, any of the risk assessment methods described above is implemented.
[0083] According to another aspect of the embodiments of the present application, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute any of the risk assessment methods described above.
[0084] Beneficial effects of the embodiments of the present application:
[0085] The embodiment of the present application provides a risk assessment method, in which the entities contained in the application orchestration graph of an application (i.e., an intelligent application) can represent the operation steps required to be performed during the operation of the application, and the entity connection relationship between each two entities can represent the execution order between the operation steps represented by the two entities during the operation of the application. Accordingly, after obtaining the application orchestration graph of the application (i.e., the application orchestration graph to be evaluated), the entity connection relationship between each two entities in the application orchestration graph to be evaluated can be determined. Since the pre-constructed knowledge graph records multiple nodes, the node attributes of each node, and the node connection relationship between the nodes, a node represents the entity connection relationship between two entities in the application orchestration graph, and the node attributes of each node include the risk type of the risk of the entity connection relationship represented by the node. Therefore, when performing risk assessment, it is possible to determine the nodes that match the entity connection relationship between each two entities in the application orchestration graph to be evaluated from the pre-constructed knowledge graph, that is, it is possible to determine the entity connection relationship with risks in the application orchestration graph to be evaluated. Furthermore, based on the node connection relationship between nodes recorded in the pre-constructed knowledge graph, it is also possible to combine the entity connection relationship of each risky entity to obtain a first predicted risk assessment result representing the overall risk of the application orchestration graph to be evaluated. That is, by constructing a pre-constructed knowledge graph based on actual risk experience, it is possible to accurately query the risks of each entity connection relationship in the application orchestration graph to be evaluated, and combine the node connection relationship analysis to obtain the first predicted risk assessment result representing the overall risk of the application orchestration graph to be evaluated. In this way, by matching the application orchestration graph to be evaluated with the knowledge graph, accurate risk prediction can be achieved to improve the stability and feasibility of application operation.
[0086] Of course, implementing any product or method of the present application does not necessarily require achieving all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0087] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other embodiments can also be obtained based on these drawings.
[0088] Figure 1 A first flow chart of the risk assessment method provided in the embodiment of the present application;
[0089] Figure 2 An example diagram of an application arrangement diagram provided in an embodiment of the present application;
[0090] Figure 3 A simplified schematic diagram of an application arrangement diagram provided in an embodiment of the present application;
[0091] Figure 4 A second flow chart of the risk assessment method provided in the embodiment of the present application;
[0092] Figure 5 A flow chart of a training risk assessment model provided in an embodiment of the present application;
[0093] Figure 6 A third flow chart of the risk assessment method provided in the embodiment of the present application;
[0094] Figure 7 A flowchart of a training risk solution plan generation model provided in an embodiment of the present application;
[0095] Figure 8 A structural diagram of a risk assessment device provided in an embodiment of the present application;
[0096] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0097] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field based on the present application belong to the scope of protection of the present application.
[0098] In the field of computer software technology, application developers can develop intelligent applications (i.e., applications) through intelligent application development tools. Current intelligent application development tools support building application orchestration diagrams of intelligent applications in the form of graphical plug-ins.
[0099] For example, intelligent application development tools can display plug-ins representing different entities on the interface. Accordingly, application developers can draw an application orchestration diagram consisting of multiple entities and representing the data processing flow (also called pipeline) of the application to be built by dragging or clicking the required plug-ins.
[0100] However, due to the hardware and software resource limitations of the processing unit of the device where the smart application is to be deployed, risk events may occur during the operation of the smart application corresponding to the application orchestration diagram, threatening the stability and feasibility of the smart application deployed by the device. Therefore, how to accurately predict possible risks has become an urgent problem to be solved.
[0101] The application in this application can process the specified type of data according to the actual needs of the application developer to achieve the corresponding function. For example, the application can be used to obtain multiple video streams to detect whether there is a specified target in each video frame (for example, the specified target can be a human body, a vehicle, or a specified animal, etc.), and then the obtained detection results can be analyzed, stored, and forwarded.
[0102] For another example, the application can also be used to obtain an audio segment collected by an audio collection device, and perform semantic recognition on the collected audio segment to convert the voice information in the audio segment into corresponding text information.
[0103] The present application embodiment provides a risk assessment method, which can be applied to electronic devices installed with intelligent application development tools. Figure 1 , Figure 1 The first flow chart of the risk assessment method provided in the embodiment of the present application comprises the following steps:
[0104] S101: Obtain an application orchestration diagram to be evaluated.
[0105] Among them, an application orchestration graph of an application includes multiple entities and entity connection relationships between the multiple entities. An entity represents an operation step that needs to be executed during the operation of the application. During the operation of the application, the operation steps represented by two entities that have an entity connection relationship are executed in sequence.
[0106] S102: Determine, from a pre-built knowledge graph, a node that matches the entity connection relationship between every two entities in the application orchestration graph to be evaluated.
[0107] Among them, the knowledge graph includes multiple nodes and node connection relationships between nodes; each node represents the entity connection relationship between two entities in the application orchestration graph; the node attributes of each node include: the risk type of the risk existing in the entity connection relationship represented by the node; the node connection relationship between two nodes represents the relationship between the risks represented by the two nodes.
[0108] S103: Based on the node attributes of the matched nodes and the node connection relationships between the matched nodes, a first predicted risk assessment result representing the overall risk of the application orchestration graph to be assessed is obtained.
[0109] Based on the above processing, the entities contained in the application orchestration graph of an application (i.e., smart application) can represent the operation steps required to be performed during the operation of the application, and the entity connection relationship between each two entities can represent the execution order between the operation steps represented by the two entities during the operation of the application. Accordingly, after obtaining the application orchestration graph of the application (i.e., the application orchestration graph to be evaluated), the entity connection relationship between each two entities in the application orchestration graph to be evaluated can be determined. Since the pre-constructed knowledge graph records multiple nodes, the node attributes of each node, and the node connection relationship between nodes, a node represents the entity connection relationship between two entities in the application orchestration graph, and the node attributes of each node include the risk type of the risk existing in the entity connection relationship represented by the node. Therefore, when performing risk assessment, the node that matches the entity connection relationship between each two entities in the application orchestration graph to be evaluated can be determined from the pre-constructed knowledge graph, that is, the entity connection relationship with risks in the application orchestration graph to be evaluated can be determined. Furthermore, based on the node connection relationship between nodes recorded in the pre-constructed knowledge graph, it is also possible to combine the entity connection relationship of each risky entity to obtain a first predicted risk assessment result representing the overall risk of the application orchestration graph to be evaluated. That is, by constructing a pre-constructed knowledge graph based on actual risk experience, it is possible to accurately query the risks of each entity connection relationship in the application orchestration graph to be evaluated, and combine the node connection relationship analysis to obtain the first predicted risk assessment result representing the overall risk of the application orchestration graph to be evaluated. In this way, by matching the application orchestration graph to be evaluated with the knowledge graph, accurate risk prediction can be achieved to improve the stability and feasibility of application operation.
[0110] With respect to step S101 , the application orchestration diagram to be evaluated may be an application orchestration diagram pre-drawn by an application developer and for which a corresponding application is to be generated.
[0111] That is to say, before an application is deployed to the application deployment platform, the electronic device can perform a risk assessment on the application orchestration diagram according to the risk assessment method provided in this application. Among them, the application deployment platform can be the device specified by the user on which the application needs to be deployed. Subsequently, the application developer can adjust the application orchestration diagram according to the risk assessment results to avoid the risks existing in the application orchestration diagram. Alternatively, a risk resolution plan for the risk assessment results can be generated to handle the risk according to the determined risk resolution plan when the risk occurs, so as to ensure the stability and feasibility of the application operation.
[0112] Alternatively, the application orchestration diagram to be evaluated may also be an application orchestration diagram of an application that has been generated and deployed on an application deployment platform for use by users. That is to say, for an application that has been launched, the electronic device may perform a risk assessment on the application orchestration diagram of the application according to the risk assessment method provided in this application, and subsequently, a risk resolution plan for the application may be determined based on the results of the risk assessment, so that when a risk occurs, the risk resolution plan may be used to handle the risk, thereby ensuring the stability and feasibility of the application operation.
[0113] An application orchestration graph of an application includes multiple entities and entity connection relationships between the multiple entities. The connection relationship between any two entities can be called an entity connection relationship.
[0114] An entity represents an operation step that needs to be performed during the operation of the application. Accordingly, the entities contained in the application orchestration diagram can be divided into at least the following four categories: logic processing class, model reasoning class, business processing class, and image processing class. For example, the entities of the logic processing class include: judgment logic, merging logic, and splitting logic, etc.; the entities of the model reasoning class include: detection, classification, and gesture recognition, etc.; the entities of the business processing class include: encoding and decoding, event linkage, and rule processing, etc.; the entities of the image processing class include: scaling, cutting out, and cropping, etc.
[0115] For an application, during the running of the application, operation steps represented by two entities having an entity connection relationship in the application orchestration graph of the application are executed in sequence.
[0116] See also Figure 2 , Figure 2 This is an example diagram of an application arrangement diagram provided in an embodiment of the present application. Figure 2As shown in the application arrangement diagram, during the operation of the application corresponding to the application arrangement diagram, the process of the operation steps executed is: stream acquisition → scene classification; wherein, stream acquisition means that the application obtains the data stream to be processed (such as video); scene classification means classifying the data according to the scene, and accordingly, the data can be divided into data corresponding to scene 1 and data corresponding to scene 2. "→" indicates the order in which the operation steps corresponding to the entities are executed. Entity a → entity b means: the operation steps corresponding to entity a are executed first, and then the operation steps corresponding to entity b are executed.
[0117] Furthermore, the classified data should be processed through branch 1 and branch 2 respectively. The data corresponding to scene 1 can be processed through branch 1. The process of the operation steps included in branch 1 is: preprocessing a→scene 1 detection model a→post-processing a→preprocessing b→scene 1 classification model b→post-processing b. Among them, preprocessing a, preprocessing b, post-processing a and post-processing b represent an entity respectively. For example, preprocessing a and preprocessing b can be image processing entities (such as scaling entities, cutout entities, etc.); post-processing a and post-processing b can be business processing entities or logic processing entities, and the types of entities are not specifically limited here.
[0118] The data corresponding to scene 2 can be processed through branch 2. The process of the operation steps included in branch 2 is: Branch 2 includes: preprocessing c→scene 2 detection model c→post-processing c→preprocessing d→scene 2 classification model d→post-processing d. Among them, preprocessing c, preprocessing d, post-processing c and post-processing d each represent an entity. For example, preprocessing c and preprocessing d can be entities of the image processing class (such as scaling entity, cutout entity, etc.); post-processing c and post-processing d can be entities of the business processing class or logic processing class, and the type of entity is not specifically limited here.
[0119] Furthermore, the application can continue to perform subsequent processing on the data processing results output by branch 1 and the data processing results output by branch 2, and the process of the operation steps included is: post-processing e→event linkage. Furthermore, the obtained results can be stored, forwarded, and alarmed respectively.
[0120] See also Figure 3 , Figure 3 A simplified schematic diagram of an application arrangement diagram provided in an embodiment of the present application Figure 3In the figure, N0, N1, N2, N3, N4, N5, N6, N7, N8, N9, N10, N11, and N12 correspond to 13 entities respectively. N0 represents entity 0, N1 represents entity 1, and so on. N12 represents entity 12. E0, E1, E2, E3, E4, E5, E6, E7, E8, E9, E10, E11, E12, and E13 correspond to the entity connection relationships included in the application orchestration graph respectively. E0 represents the entity connection relationship between N0 and N1, E1 represents the entity connection relationship between N0 and N3, and so on. E13 represents the entity connection relationship between N9 and N12. Among them, the entity connection relationship E0 can be expressed as [N0→N1], and the entity connection relationship E1 can be expressed as [N0→N3]. The representation method of other entity connection relationships in the application arrangement diagram is consistent with the representation method of the entity connection relationship E0 and the entity connection relationship E1, and will not be repeated here.
[0121] For step S102, the knowledge graph may be constructed based on previously collected historical experience information, wherein the historical experience information may include documents, reports, literature, historical records, expert knowledge and other empirical information related to the risks of the application orchestration graph.
[0122] In one implementation, a large language model can be used to perform semantic analysis on pre-collected historical experience information to extract structured information for different types of risks to complete the construction of a knowledge graph.
[0123] For example, historical experience information can be: a log generated by the application deployment platform of the deployed application in the process of running the application. Accordingly, the electronic device can use a large language model to perform semantic analysis on the historical experience information collected in advance, and extract the risk types of risks that occur during the operation of the application, the number of times each type of risk occurs, the entity connection relationship corresponding to each type of risk, the risk resolution measures and success cases corresponding to each type of risk, etc. Furthermore, the risks existing in different entity connection relationships and the probability of risk occurrence can be determined based on the above information extracted, and recorded in the knowledge graph. In addition, the knowledge graph can also record information such as the cause of the risk and the scope of impact. For example, the scope of impact includes the duration of the risk, the number of entities affected, etc.
[0124] The pre-built knowledge graph contains multiple nodes, each of which represents the entity connection relationship between two entities in the application orchestration graph. For example, the knowledge graph records multiple nodes, including node 1, node 2, node 3, and node 4. The entity connection relationship represented by node 1 is: scaling entity → detection entity, the entity connection relationship represented by node 2 is: classification entity → rule processing entity, the entity connection relationship represented by node 3 is: detection entity → merge logical entity, and the entity connection relationship represented by node 4 is: classification entity → split logical entity.
[0125] Accordingly, for each entity connection relationship included in the application orchestration graph to be evaluated, it can be determined in the knowledge graph whether there is a node matching the entity connection relationship.
[0126] For example, for the above Figure 3 , if in the entity connection relationship E3[N1→N2], N1 is a scaling entity and N2 is a detection entity, then it can be determined that the entity connection relationship E3 matches node 1 in the knowledge graph. If in the entity connection relationship E4[N2→N5], N2 is a detection entity and N5 is a merged logical entity, then it can be determined that the entity connection relationship E4 matches node 3 in the above knowledge graph. If in the entity connection relationship E7[N5→N8], N5 is a classification entity and N8 is a rule processing entity, then it can be determined that the entity connection relationship E7 matches node 2 in the above knowledge graph. If in the entity connection relationship E8[N6→N9], N6 is a classification entity and N9 is a split logical entity, then it can be determined that the entity connection relationship E8 matches node 4 in the above knowledge graph.
[0127] For each node, the knowledge graph also records the node attributes of the node. The node attributes of each node include: the risk type of the risk of the entity connection relationship represented by the node. Among them, the risk type of risk includes at least one of the following: model reasoning risk, resource risk, frame rate risk, and processing unit risk.
[0128] If the entity connection relationship represented by a node has a model reasoning risk, it means that the operation steps corresponding to the entity connection relationship need to use a model (such as a deep learning model) to process the data. The efficiency of the model reasoning cannot meet the frame rate requirements of the data processing, and multiple NPUs are required to perform model reasoning at the same time. Or, when multiple models are reasoning at the same time, it is impossible to obtain the corresponding computing resources as required to complete the reasoning, resulting in the inability to execute the data processing process normally, and then, the application cannot run normally. For example, both Model 1 and Model 2 need to run on NPU1, and it is pre-specified that: Model 2 runs at the 10th millisecond after Model 1 starts running, and the specified time for Model 1 to run on NPU1 is 10 milliseconds. If the actual running time of Model 1 (such as 15 milliseconds) exceeds the specified time during the actual operation, NPU1 will be occupied at the 10th millisecond after Model 1 starts running. Accordingly, Model 2 cannot be run within the specified time, which in turn causes the data processing process to fail to execute normally.
[0129] If the entity connection relationship represented by a node has resource risks, it means that when executing the operation steps corresponding to the entity connection relationship, the application deployment platform may not be able to provide sufficient computing resources, thereby causing the application to fail to run normally. For example, computing resources can be memory resources, thread resources, etc.
[0130] If the entity connection relationship represented by a node has a frame rate risk, it means that when executing the operation steps corresponding to the entity connection relationship, the frame rate of the data to be processed is high. Due to the resource limitations of the application deployment platform, the application deployment platform may not be able to process the data at this frame rate, which may cause the application to fail to run normally.
[0131] If the entity connection relationship represented by a node has a processing unit risk, it means that when executing the operation steps corresponding to the entity connection relationship, due to the limitation of the data processing capability of the processing unit used to execute the operation steps corresponding to the entity connection relationship, the processing unit may not be able to execute the operation steps corresponding to the entity connection relationship, thereby causing the application to fail to operate normally.
[0132] In one implementation, the node attribute of each node further includes: the probability of occurrence of the risk existing in the entity connection relationship represented by the node.
[0133] For example, the node attribute of node 1 recorded in the knowledge graph may be: the probability of occurrence of frame rate risk is 20%, and the node attribute of node 2 may be: the probability of occurrence of processing unit risk is 30%.
[0134] In one implementation, the node attribute of each node further includes: the risk level of the risk existing in the entity connection relationship represented by the node, wherein the risk levels of the same type of risks are the same.
[0135] For each type of risk, the risk level of each type of risk can be determined according to the impact scope of the risk, which includes the duration of the risk, the number of entities affected, etc.
[0136] For example, for a type of risk, if the risk lasts for a long time and a large number of entities are affected when the risk occurs, it indicates that the risk is more harmful, and accordingly, the risk level of the risk can be set to high; if the risk lasts for a short time and a small number of entities are affected when the risk occurs, it indicates that the risk is less harmful, and accordingly, the risk level of the risk can be set to low.
[0137] For each type of risk, the risk level of each type of risk can also be set by the technician according to actual needs.
[0138] For example, during the operation of the model, technicians need to focus on the execution of the operation steps related to the model. Accordingly, the risk level of the model reasoning risk can be set to high, and the risk level of other types of risks (such as the risk level of frame rate risk) can be set to low.
[0139] The pre-built knowledge graph also records: node connection relationships between nodes. The connection relationship between any two nodes can be called a node connection relationship.
[0140] The node connection relationship between two nodes represents the relationship between the risks represented by the two nodes. Accordingly, the risks existing in the entity connection relationship represented by the two nodes having a node connection relationship can interact with each other. The process of obtaining the first predicted risk assessment result representing the overall risk existing in the application orchestration graph to be assessed through the node connection relationship will be described in the subsequent embodiments.
[0141] Regarding step S103, it can be understood that an application orchestration graph may contain multiple entity connection relationships with matching nodes, and the risks existing in each entity connection relationship may interact with each other to affect the overall risk existing in the application orchestration graph to be evaluated.
[0142] Accordingly, in the present application, the electronic device may determine a first predicted risk assessment result representing the overall risk of the application orchestration diagram to be assessed by at least one of the following two methods.
[0143] The first method of determining the first prediction risk assessment result can be called a logical analysis method:
[0144] In some embodiments, the node connection relationship includes at least one of the following: depends on, causes enhancement, causes weakening, strengthens, and weakens. Accordingly, step S103 includes:
[0145] Step 1: For each entity connection relationship in the application orchestration graph to be evaluated, the node attribute of the node in the knowledge graph that matches the entity connection relationship is determined as the local risk assessment result represented by the entity connection relationship.
[0146] Step 2-a: For any two entity connection relationships in the application orchestration graph to be evaluated, if the risk types of the risks represented by the nodes matching the two entity connection relationships in the knowledge graph are inconsistent, and the node connection relationship between the two nodes is dependent, then the occurrence probabilities recorded in the local risk assessment results represented by the two entity connection relationships are increased respectively.
[0147] Step 2-b: If the risk types of the risks represented by the nodes that match the two entity connection relationships in the knowledge graph are inconsistent, and the node connection relationship between the two nodes leads to enhancement, then determine the entity connection relationship represented by the node that leads to enhancement in the two entity connection relationships, and increase the occurrence probability recorded in the local risk assessment result of the determined entity connection relationship.
[0148] Step 2-c: If the risk types of the risks represented by the nodes that match the two entity connection relationships in the knowledge graph are inconsistent, and the node connection relationship between the two nodes leads to attenuation, then determine the entity connection relationship represented by the node that leads to attenuation in the two entity connection relationships, and reduce the occurrence probability recorded in the local risk assessment result of the determined entity connection relationship.
[0149] Step 2-d: If the risk types of the risks represented by the nodes matching the two entity connection relationships in the knowledge graph are consistent, and the node connection relationship between the two nodes is enhanced, then the occurrence probabilities recorded in the local risk assessment results represented by the two entity connection relationships are increased respectively.
[0150] Step 2-e: If the risk types of the risks represented by the nodes matching the two entity connection relationships in the knowledge graph are consistent, and the node connection relationship between the two nodes is weakened, then the occurrence probabilities recorded in the local risk assessment results represented by the two entity connection relationships are reduced respectively.
[0151] Step 3: Combine the local risk assessment results represented by the connection relationships of each entity to obtain a first predicted risk assessment result representing the overall risk of the application orchestration graph to be assessed.
[0152] In an embodiment of the present application, for each entity connection relationship in the application orchestration graph to be evaluated, if there is a node in the knowledge graph that matches the entity connection relationship, the node attribute of the node in the knowledge graph that matches the entity connection relationship can be determined as the local risk assessment result represented by the entity connection relationship.
[0153] For example, for the above Figure 3 In the example shown, the entity connection relationship E3[N1→N2] matches node 1 in the knowledge graph, and the node attribute of node 1 is that the probability of frame rate risk is 20%. It can be determined that the local risk assessment result represented by the entity connection relationship E3 is: the probability of frame rate risk is 20%. The entity connection relationship E7[N5→N8] matches node 2 in the knowledge graph, and the node attribute of node 2 is that the probability of processing unit risk is 30%. It can be determined that the local risk assessment result represented by the entity connection relationship E7 is: the probability of processing unit risk is 30%.
[0154] Furthermore, after determining the local risk assessment results represented by each entity connection relationship in the application orchestration graph to be evaluated, for any two entity connection relationships, if the knowledge graph records the node connection relationship between the nodes that match the two entity connection relationships, the electronic device can adjust the local risk assessment results represented by the two entity connection relationships based on the node connection relationship between the two nodes.
[0155] Accordingly, the following adjustments can be made according to the type of node connection relationship:
[0156] Type a. The node connection relationship is dependent on:
[0157] In an embodiment of the present application, for any two entity connection relationships in the application orchestration graph to be evaluated, the risk types represented by the nodes (which may be referred to as the first node and the second node) that match the two entity connection relationships in the knowledge graph are inconsistent, and the node connection relationship between the two nodes is dependent, indicating that when there is an entity connection relationship (which may be referred to as the first entity connection relationship) that matches the first node and an entity connection relationship (which may be referred to as the second entity connection relationship) that matches the second node in an application orchestration graph, the probability of occurrence of the risk of the first entity connection relationship and the probability of occurrence of the risk of the second entity connection relationship will both increase. Accordingly, the electronic device can increase the probability of occurrence recorded in the local risk assessment results represented by the two entity connection relationships, respectively.
[0158] For example, the occurrence of resource risk may cause the application deployment platform to have a reduced ability to process data, affecting the occurrence of frame rate risk, and the occurrence of frame rate risk may also cause the application deployment platform to need to allocate more resources for processing data, causing resource risk. Therefore, when the risk types of risks included in the node attributes of two nodes are resource risk and frame rate risk respectively, the node connection relationship between the two nodes can be dependent on.
[0159] Above Figure 3 In the example shown, if in the application orchestration diagram to be evaluated, the node that matches the entity connection relationship E3 is node 1, the node that matches the entity connection relationship E4 is node 3, the node attribute of node 1 is that the probability of occurrence of frame rate risk is 20%, the node attribute of node 3 is that the probability of occurrence of resource risk is 30%, and the node connection relationship between node 1 and node 3 is dependent on. At this time, after determining that the probability of occurrence of frame rate risk in the local risk assessment result represented by the entity connection relationship E3 is 20%, and the probability of occurrence of resource risk in the local risk assessment result represented by the entity connection relationship E4 is 30%, the probability of occurrence of frame rate risk in the local risk assessment result represented by the entity connection relationship E3 can be increased (such as increased to 40%), and the probability of occurrence of resource risk in the local risk assessment result represented by the entity connection relationship E4 can be increased (such as increased to 50%). Among them, the adjustment value of the probability of occurrence of risk can be determined by the technician based on actual experience, and is not limited here.
[0160] Type b. Node connection relationship leads to enhancement:
[0161] In an embodiment of the present application, for any two entity connection relationships in the application orchestration graph to be evaluated, the risk types of the risks represented by the nodes (which may be referred to as the first node and the second node) that match the two entity connection relationships in the knowledge graph are inconsistent, and the node connection relationship between the two nodes leads to enhancement (the second node is the node that is enhanced), indicating that when there are both an entity connection relationship (which may be referred to as the first entity connection relationship) that matches the first node and an entity connection relationship (which may be referred to as the second entity connection relationship) that matches the second node in an application orchestration graph, the probability of occurrence of the risk existing in the second entity connection relationship will increase, and the probability of occurrence of the risk existing in the first entity connection relationship remains unchanged.
[0162] When there is a second entity connection relationship in an application orchestration graph and there is no first entity connection relationship, the probability of occurrence of the risk of the second entity connection relationship will not increase. That is, the probability of occurrence of the risk in the local risk assessment result represented by the entity connection relationship represented by the second node is the probability of occurrence recorded in the node attribute of the second node.
[0163] For example, the occurrence of processing unit risk may cause a change in the way the application deployment platform allocates processing units, resulting in a reduction in the amount of data that can be processed, which in turn leads to an increase in frame rate risk. Therefore, when the risk types of risks included in the node attributes of two nodes are processing unit risk and frame rate risk respectively, the node connection relationship between the two nodes may lead to an increase.
[0164] Above Figure 3 In the example shown, if in the application arrangement diagram to be evaluated, the node that matches the entity connection relationship E3 is node 1, the node that matches the entity connection relationship E4 is node 3, the node attribute of node 1 is that the probability of occurrence of frame rate risk is 20%, the node attribute of node 3 is that the probability of occurrence of processing unit risk is 30%, the node connection relationship between node 1 and node 3 is to cause enhancement, and node 1 is the node that is caused to be enhanced. At this time, after determining that the probability of occurrence of frame rate risk in the local risk assessment result represented by the entity connection relationship E3 is 20%, and the probability of occurrence of processing unit risk in the local risk assessment result represented by the entity connection relationship E4 is 30%, the probability of occurrence of frame rate risk in the local risk assessment result represented by the entity connection relationship E3 can be increased (such as increased to 40%), and the probability of occurrence of processing unit risk in the local risk assessment result represented by the entity connection relationship E4 remains unchanged. Among them, the adjustment value of the probability of occurrence of risk can be determined by the technician based on actual experience, and is not limited here.
[0165] Type c. Node connection relationship leads to weakening:
[0166] In an embodiment of the present application, for any two entity connection relationships in the application orchestration graph to be evaluated, the risk types of risks represented by the nodes (which may be referred to as the first node and the second node) that match the two entity connection relationships in the knowledge graph are inconsistent, and the node connection relationship between the two nodes is to cause weakening (the second node is the node that is caused to be weakened), indicating that when there are both an entity connection relationship (which may be referred to as the first entity connection relationship) that matches the first node and an entity connection relationship (which may be referred to as the second entity connection relationship) that matches the second node in an application orchestration graph, the probability of occurrence of the risk existing in the second entity connection relationship will be reduced, and the probability of occurrence of the risk existing in the first entity connection relationship will remain unchanged.
[0167] When there is a second entity connection relationship in an application orchestration graph and there is no first entity connection relationship, the probability of occurrence of the risk of the second entity connection relationship will not decrease. That is, the probability of occurrence of the risk in the local risk assessment result represented by the entity connection relationship represented by the second node is the probability of occurrence recorded in the node attribute of the second node.
[0168] For example, since the occurrence of model reasoning risk may lead to model replacement during the running of the application, the computing resources required for model reasoning are reduced, thereby reducing the probability of resource risk. Therefore, when the risk types of risks included in the node attributes of two nodes are model reasoning risk and resource risk respectively, the node connection relationship between the two nodes can be weakened.
[0169] Above Figure 3 In the example shown, if in the application arrangement diagram to be evaluated, the node matched by the entity connection relationship E7 is node 2, the node matched by the entity connection relationship E8 is node 4, the node attribute of node 2 is that the probability of occurrence of model reasoning risk is 40%, the node attribute of node 4 is that the probability of occurrence of resource risk is 50%, the node connection relationship between node 2 and node 4 is that it causes weakening, and node 4 is the node that is caused to weaken. At this time, after determining that the probability of occurrence of model reasoning risk in the local risk assessment result represented by the entity connection relationship E7 is 40%, and the probability of occurrence of resource risk in the local risk assessment result represented by the entity connection relationship E8 is 50%, the probability of occurrence of resource risk in the local risk assessment result represented by the entity connection relationship E8 can be reduced (such as reduced to 30%), and the probability of occurrence of resource risk in the local risk assessment result represented by the entity connection relationship E7 remains unchanged. Among them, the adjustment value of the probability of occurrence of risk can be determined by the technician based on actual experience, and is not limited here.
[0170] Type d. Node connection relationship is enhanced:
[0171] In an embodiment of the present application, for any two entity connection relationships in the application orchestration graph to be evaluated, the risk types of the risks represented by the nodes (which can be called the first node and the second node) that match the two entity connection relationships in the knowledge graph are consistent, and the node connection relationship between the two nodes is enhanced. If there is an entity connection relationship (which can be called the first entity connection relationship) that matches the first node in an application orchestration graph, and there is no entity connection relationship (which can be called the second entity connection relationship) that matches the second node, the probability of occurrence of the risk in the local risk assessment result represented by the first entity connection relationship is the probability of occurrence in the node attribute of the first node.
[0172] If there is a second entity connection relationship in an application arrangement graph and there is no first entity connection relationship, the occurrence probability of the risk in the local risk assessment result represented by the second entity connection relationship is the occurrence probability in the node attribute of the second node.
[0173] If a first entity connection relationship and a second entity connection relationship exist at the same time, the probability of occurrence of the risk existing in the local risk assessment result represented by the first entity connection relationship and the probability of occurrence of the risk existing in the local risk assessment result represented by the second entity connection relationship both increase, that is, the electronic device increases the probability of occurrence of the risk existing in the local risk assessment result represented by the first entity connection relationship, and increases the probability of occurrence of the risk existing in the local risk assessment result represented by the second entity connection relationship.
[0174] For example, the occurrence of processing unit risk may cause a change in the way the application deployment platform allocates processing units, resulting in the preemption of multiple processing units, further exacerbating the occurrence of processing unit risk. Therefore, when the risk types of the risks included in the node attributes of two nodes are both processing unit risks, the node connection relationship between the two nodes can be enhanced.
[0175] Above Figure 3 In the example shown, if in the application arrangement diagram to be evaluated, the node matched by the entity connection relationship E7 is node 2, the node matched by the entity connection relationship E8 is node 4, the node attribute of node 2 is that the probability of occurrence of the processing unit risk is 40%, the node attribute of node 4 is that the probability of occurrence of the processing unit risk is 50%, and the node connection relationship between node 2 and node 4 is enhanced. At this time, after determining that the probability of occurrence of the processing unit risk in the local risk assessment result represented by the entity connection relationship E7 is 40%, and the probability of occurrence of the processing unit risk in the local risk assessment result represented by the entity connection relationship E8 is 50%, the probability of occurrence of the resource risk in the local risk assessment result represented by the entity connection relationship E8 can be increased (such as increased to 50%), and the probability of occurrence of the processing unit risk in the local risk assessment result represented by the entity connection relationship E7 can be increased (such as increased to 60%). Among them, the adjustment value of the probability of occurrence of the risk can be determined by the technician based on actual experience, and is not limited here.
[0176] Type e. Node connection relationship is weakened:
[0177] In an embodiment of the present application, for any two entity connection relationships in the application orchestration graph to be evaluated, the risk types of the risks represented by the nodes (which can be called the first node and the second node) that match the two entity connection relationships in the knowledge graph are consistent, and the node connection relationship between the two nodes is weakened. If there is an entity connection relationship (which can be called the first entity connection relationship) that matches the first node in an application orchestration graph, and there is no entity connection relationship (which can be called the second entity connection relationship) that matches the second node, the probability of occurrence of the risk in the local risk assessment result represented by the first entity connection relationship is the probability of occurrence in the node attribute of the first node.
[0178] If there is a second entity connection relationship in an application arrangement graph and there is no first entity connection relationship, the occurrence probability of the risk in the local risk assessment result represented by the second entity connection relationship is the occurrence probability in the node attribute of the second node.
[0179] If a first entity connection relationship and a second entity connection relationship exist at the same time, the probability of occurrence of the risk existing in the local risk assessment result represented by the first entity connection relationship and the probability of occurrence of the risk existing in the local risk assessment result represented by the second entity connection relationship are both reduced, that is, the electronic device reduces the probability of occurrence of the risk existing in the local risk assessment result represented by the first entity connection relationship, and reduces the probability of occurrence of the risk existing in the local risk assessment result represented by the second entity connection relationship.
[0180] For example, the occurrence of frame rate risk may also cause the application to reduce the frame rate of the data to be processed during operation, and thus, the probability of frame rate risk occurring in subsequent operation steps will also be reduced. Therefore, when the risk type of the risk included in the node attributes of two nodes is both frame rate risk, the node connection relationship between the two nodes can be reduced.
[0181] Above Figure 3 In the example shown, if in the application arrangement diagram to be evaluated, the node matched by the entity connection relationship E7 is node 2, the node matched by the entity connection relationship E8 is node 4, the node attribute of node 2 is that the probability of occurrence of frame rate risk is 40%, the node attribute of node 4 is that the probability of occurrence of frame rate risk is 50%, and the node connection relationship between node 2 and node 4 is weakened. At this time, after determining that the probability of occurrence of frame rate risk in the local risk assessment result represented by the entity connection relationship E7 is 40%, and the probability of occurrence of frame rate risk in the local risk assessment result represented by the entity connection relationship E8 is 50%, the probability of occurrence of frame rate risk in the local risk assessment result represented by the entity connection relationship E8 can be reduced (such as reduced to 20%), and the probability of occurrence of frame rate risk in the local risk assessment result represented by the entity connection relationship E7 can be reduced (such as increased to 30%). Among them, the adjustment value of the probability of occurrence of risk can be determined by the technician based on actual experience, and is not limited here.
[0182] It is understandable that for each entity connection relationship in the application orchestration graph to be evaluated, the node that matches the entity connection relationship may have node connection relationships with multiple other nodes. Accordingly, the electronic device can adjust the local risk assessment result represented by the entity connection relationship in combination with the node connection relationships corresponding to the node. Furthermore, in combination with the local risk assessment results represented by the entity connection relationships, a first predicted risk assessment result representing the overall risk of the application orchestration graph to be evaluated is obtained.
[0183] For example, the first predicted risk assessment result representing the overall risk of the application orchestration diagram to be assessed may include: the risk type of the risk existing in each operation step during the execution of the application generated according to the application orchestration diagram, and the probability of occurrence of each risk type, etc.
[0184] Based on the above processing, since an application orchestration graph may contain multiple entity connection relationships with matching nodes, and the risks existing in each entity connection relationship can interact with each other, affecting the overall risk of the application orchestration graph to be evaluated. Therefore, the local risk assessment result represented by the entity connection relationship can be adjusted in combination with the node connection relationship between a node that matches an entity connection relationship and other nodes. Furthermore, in combination with the local risk assessment results represented by each entity connection relationship, a first predicted risk assessment result representing the overall risk of the application orchestration graph to be evaluated is obtained. In this way, the overall risk of the application orchestration graph to be evaluated can be determined from the dimension of the entire graph, thereby improving the accuracy of risk assessment.
[0185] The second method of determining the first prediction risk assessment result can be called the model prediction method:
[0186] In some embodiments, see Figure 4 , Figure 4 The second flow chart of the risk assessment method provided in the embodiment of the present application, step S103, includes:
[0187] S1031: Input the node attributes of the matched nodes and the node connection relationship between the matched nodes into the trained risk assessment model to obtain a first predicted risk assessment result representing the overall risk of the application orchestration graph to be assessed.
[0188] Among them, the risk assessment model is: trained based on the first sample data and the label corresponding to the first sample data; the first sample data includes: the node attributes of the nodes that match the entity connection relationship included in the first sample application orchestration diagram, and the node connection relationship between the matching nodes; the label corresponding to the first sample data includes: the first sample risk assessment result representing the overall risk of the first sample application orchestration diagram.
[0189] In an embodiment of the present application, after determining the nodes that match the entity connection relationship between each two entities in the application orchestration diagram to be evaluated according to the above step S102, the electronic device can input the node attributes of the matching nodes and the node connection relationship between the matching nodes into the trained risk assessment model, and accordingly, the risk assessment model can output a risk assessment result (i.e., a first predicted risk assessment result) representing the overall risk of the application orchestration diagram to be evaluated. For example, the first predicted risk assessment result representing the overall risk of the application orchestration diagram to be evaluated can include: the risk type of the risk existing in each operation step during the execution of the application generated according to the application orchestration diagram, and the probability of occurrence of the risk of each risk type, etc.
[0190] Among them, the risk assessment model can be: Language Model (LM), or Natural Language Processing (NLP) models such as Recurrent Neural Networks (RNN).
[0191] In one implementation, see Figure 5 , Figure 5 A flow chart of a training risk assessment model provided in an embodiment of the present application. Accordingly, the training process of the risk assessment model includes:
[0192] S501: Obtain first sample data and a label corresponding to the first sample data.
[0193] S502: Input the first sample data into the risk assessment model of the initial structure to obtain a second predicted risk assessment result output by the risk assessment model of the initial structure, which represents the overall risk of the first sample application orchestration diagram.
[0194] S503: Calculate a loss value according to the difference between the obtained second prediction risk assessment result and the first sample risk assessment result included in the label corresponding to the first sample data.
[0195] S504: Adjust the model parameters of the risk assessment model of the initial structure based on the obtained loss value until convergence is achieved to obtain a trained risk assessment model.
[0196] In the embodiment of the present application, the first sample data includes: node attributes of nodes that match the entity connection relationship included in the first sample application orchestration graph, and the node connection relationship between the matched nodes. Among them, for a first sample application orchestration graph, the first sample data can be determined according to the above-mentioned method of determining the nodes that match the entity connection relationship included in the application orchestration graph to be evaluated, the node attributes of the matched nodes, and the node connection relationship between the matched nodes, which will not be described in detail here.
[0197] After the first sample data is input into the risk assessment model of the initial structure, the risk assessment model of the initial structure can output a second predicted risk assessment result representing the overall risk of the first sample application arrangement diagram. Furthermore, the loss value can be calculated based on the difference between the obtained second predicted risk assessment result and the first sample risk assessment result contained in the label corresponding to the first sample data. For example, the distance between the text feature of the second predicted risk assessment result and the text feature of the first sample risk assessment result can be calculated as the loss value. Accordingly, the model parameters of the risk assessment model of the initial structure can be adjusted based on the obtained loss value until convergence is reached to obtain a trained risk assessment model.
[0198] Based on the above processing, the risk assessment model can accurately learn: the node attributes of the nodes that match the entity connection relationship contained in the first sample application orchestration graph and the node connection relationship between the matching nodes, and the relationship between the first sample risk assessment result representing the overall risk of the first sample application orchestration graph. Accordingly, when performing risk assessment through the trained risk assessment model, the first predicted risk assessment result output by the model can accurately represent the overall risk of the application orchestration graph to be evaluated. In this way, the risk of the entire graph can be analyzed through the model to improve the efficiency of risk assessment.
[0199] In some embodiments, see Figure 6 , Figure 6 The third flow chart of the risk assessment method provided in the embodiment of the present application is as follows: Figure 1 On the basis of, after step S103, the method further includes:
[0200] S104: Inputting the first predicted risk assessment result into the trained risk resolution plan generation model to obtain a first predicted risk resolution plan for the application orchestration graph to be assessed.
[0201] Among them, the risk resolution plan generation model is trained based on the second sample data and the label corresponding to the second sample data; the second sample data includes the second sample risk assessment result representing the overall risk of the second sample application orchestration diagram; the label corresponding to the second sample data includes: the first sample risk resolution plan for the second sample application orchestration diagram.
[0202] In an embodiment of the present application, after obtaining a first predicted risk assessment result representing the overall risk of the application orchestration graph to be evaluated, the electronic device can generate a first predicted risk solution plan for the application orchestration graph to be evaluated, so that when running the application generated based on the application orchestration graph to be evaluated and the risk represented by the first predicted risk assessment result occurs, processing is performed according to the first predicted risk solution plan to ensure the normal operation of the application.
[0203] In one implementation, the risk resolution plan corresponding to the model reasoning risk is used to indicate: in the process of running the application generated based on the application orchestration graph to be evaluated, prune or replace the used model.
[0204] In an embodiment of the present application, if there is a model reasoning risk in the first predicted risk assessment result representing the overall risk of the application orchestration graph to be assessed, it indicates that a model (such as a deep learning model) is needed to process data during the application operation, and due to the limitations of the software and hardware resources of the application deployment platform, the computing resources or storage resources required for the model reasoning may not be provided, thereby causing the application to fail to operate normally. Therefore, the model that needs to be used during the application operation can be pruned or replaced so that the replaced or pruned model can realize the corresponding reasoning function and ensure the normal operation of the application.
[0205] In one implementation, the risk resolution plan corresponding to the resource risk is used to indicate: during the operation of the application generated based on the application orchestration graph to be evaluated, the specified backup computing resources are reserved to complete the operation of the application through the backup computing resources when the risk occurs.
[0206] In the embodiment of the present application, if there is a resource risk in the first predicted risk assessment result representing the overall risk of the application orchestration graph to be assessed, it indicates that during the application operation, there are operation steps corresponding to entities that are prone to crash. Accordingly, when executing the operation steps corresponding to the entity, designated backup computing resources can be reserved. When the risk occurs, the operation steps corresponding to the entity are executed through the backup computing resources to ensure the normal operation of the application.
[0207] In one implementation, the risk resolution plan corresponding to the frame rate risk is used to indicate: during the running of the application generated based on the application orchestration graph to be evaluated, the frame rate of the data to be processed by the application is reduced.
[0208] In the embodiment of the present application, if there is a frame rate risk in the first predicted risk assessment result representing the overall risk of the application orchestration graph to be assessed, it indicates that during the application operation, the frame rate of the data to be processed is high, and the application deployment platform may not be able to provide the required computing resources or storage resources. Accordingly, the frame rate of the data to be processed by the application can be reduced to ensure the normal operation of the application.
[0209] In one implementation, the risk resolution plan corresponding to the processing unit risk is used to indicate: during the operation of the application generated based on the application orchestration graph to be evaluated, a designated spare processing unit is reserved to complete the operation of the application through the spare processing unit when the risk occurs.
[0210] In an embodiment of the present application, if there is a processing unit risk in the first predicted risk assessment result representing the overall risk of the application orchestration diagram to be assessed, it indicates that during the operation of the application, the data processing capacity of the processing unit that currently executes the operation steps corresponding to the entity is limited, and the operation steps may not be executed. Accordingly, a designated spare processing unit can be reserved when executing the operation steps corresponding to the entity. When a risk occurs, the operation steps corresponding to the entity are executed by the spare processing unit to ensure the normal operation of the application. For example, when there are multiple NPUs (Neural Processing Units), if the model 1 used in the application operation is inferred, the processing efficiency of NPU0 is insufficient or will be preempted. When preparing resources, NPU1 can be used as a spare processing unit. When a risk occurs, the processing unit is switched to NPU1 until NPU0 is alleviated.
[0211] In this way, for different types of risks, electronic devices can generate risk resolution plans to solve the risks and ensure the normal operation of applications. Risk prediction of the actual deployment environment is achieved, and prerequisite resources are prepared during the application operation process, so that when the application is deployed in the hardware device, better and smoother dynamic scheduling can be achieved to ensure the risk response and processing capabilities of the application.
[0212] Accordingly, after obtaining the first predicted risk assessment result, the electronic device can input the first predicted risk assessment result into a trained risk resolution plan generation model to obtain a first predicted risk resolution plan for the application orchestration diagram to be evaluated.
[0213] Among them, the risk solution plan generation model can be: Language Model (LM), or Natural Language Processing (NLP) models such as Recurrent Neural Networks (RNN).
[0214] It can be understood that the second sample data used to train the risk solution plan generation model, and the first sample risk solution plan for the second sample application orchestration diagram contained in the label corresponding to the second sample data, conform to the above-mentioned risk types and the risk solution plans corresponding to each risk.
[0215] In one implementation, see Figure 7 , Figure 7 A flowchart of a training risk solution plan generation model provided in an embodiment of the present application. Accordingly, the training process of the risk solution plan generation model includes:
[0216] S701: Obtain second sample data and a label corresponding to the second sample data.
[0217] S702: Input the second sample data into the risk solution plan generation model of the initial structure to obtain a second predicted risk solution plan for the second sample application arrangement diagram output by the risk solution plan generation model of the initial structure.
[0218] S703: Calculate the loss value according to the difference between the obtained second predicted risk solution plan and the first sample risk solution plan included in the label corresponding to the second sample data.
[0219] S704: Adjust the model parameters of the risk assessment model of the initial structure based on the obtained loss value until convergence is achieved to obtain a trained risk resolution plan generation model.
[0220] In an embodiment of the present application, the second sample data includes a second sample risk assessment result representing the overall risk of the second sample application orchestration diagram; the label corresponding to the second sample data includes: a first sample risk resolution plan for the second sample application orchestration diagram.
[0221] Among them, for a second sample application orchestration diagram, the second sample risk assessment result representing the overall risk of the second sample application orchestration diagram can be determined in accordance with the above-mentioned method of obtaining the first predicted risk assessment result representing the overall risk of the application orchestration diagram to be evaluated, which will not be elaborated here.
[0222] Based on the above processing, the risk solution plan generation model can accurately learn the relationship between the second sample risk assessment result representing the overall risk of the second sample application orchestration graph and the first sample risk solution plan for the second sample application orchestration graph. Accordingly, when the risk solution plan is generated by the trained risk solution plan generation model, the first predicted risk solution plan for the application orchestration graph to be evaluated output by the model can ensure the normal operation of the application.
[0223] In some embodiments, after step S104, the method further includes:
[0224] During the operation of the application generated based on the application orchestration graph to be evaluated, if a risk represented by the first predicted risk evaluation result occurs, it is processed according to the first predicted risk resolution plan.
[0225] In an embodiment of the present application, during the process of running an application generated based on the application orchestration graph to be evaluated, when a risk represented by a first predicted risk assessment result occurs, processing is performed according to the first predicted risk resolution plan to ensure the normal operation of the application.
[0226] Based on the above processing, during the operation of the application, if the risk represented by the first predicted risk assessment result occurs, it can be processed according to the first predicted risk resolution plan. In this way, the risk handling capability during the operation of the application can be improved, and the stability and feasibility of the application operation can be ensured.
[0227] In the technical solution of this application, the operations involved in acquiring, storing, using, processing, transmitting, providing and disclosing historical experience information are all carried out with the user's authorization.
[0228] Based on the same inventive concept, the present application embodiment provides a risk assessment device, see Figure 8 , Figure 8 This is a structural diagram of a risk assessment device provided in an embodiment of the present application. The device includes:
[0229] The application orchestration graph acquisition module 801 is used to acquire the application orchestration graph to be evaluated; wherein, an application orchestration graph of an application includes multiple entities and entity connection relationships between the multiple entities, an entity represents an operation step required to be executed during the operation of the application, and the operation steps represented by two entities having an entity connection relationship during the operation of the application are executed sequentially;
[0230] A matching module 802 is used to determine, from a pre-built knowledge graph, a node that matches the entity connection relationship between each two entities in the application orchestration graph to be evaluated; wherein the knowledge graph includes multiple nodes and node connection relationships between nodes; each node represents an entity connection relationship between two entities in the application orchestration graph; the node attributes of each node include: the risk type of the risk existing in the entity connection relationship represented by the node; the node connection relationship between two nodes represents the relationship between the risks represented by the two nodes;
[0231] The first assessment module 803 is used to obtain a first predicted risk assessment result representing the overall risk of the application orchestration graph to be assessed based on the node attributes of the matched nodes and the node connection relationship between the matched nodes.
[0232] In some embodiments, the first evaluation module 803 is specifically used to:
[0233] Inputting node attributes of the matched nodes and node connection relationships between the matched nodes into the trained risk assessment model to obtain a first predicted risk assessment result representing the overall risk of the application orchestration graph to be assessed;
[0234] Among them, the risk assessment model is: trained based on the first sample data and the label corresponding to the first sample data; the first sample data includes: the node attributes of the nodes that match the entity connection relationship contained in the first sample application orchestration diagram, and the node connection relationship between the matching nodes; the label corresponding to the first sample data includes: the first sample risk assessment result representing the overall risk of the first sample application orchestration diagram.
[0235] In some embodiments, the risk assessment model training process includes:
[0236] Acquire the first sample data and a label corresponding to the first sample data;
[0237] Inputting the first sample data into the risk assessment model of the initial structure to obtain a second predicted risk assessment result output by the risk assessment model of the initial structure, which indicates the overall risk of the first sample application arrangement diagram;
[0238] Calculate the loss value according to the difference between the obtained second prediction risk assessment result and the first sample risk assessment result included in the label corresponding to the first sample data;
[0239] Based on the obtained loss value, the model parameters of the risk assessment model of the initial structure are adjusted until convergence is reached to obtain a trained risk assessment model.
[0240] In some embodiments, the apparatus further comprises:
[0241] A plan generation module is used for obtaining a first predicted risk assessment result representing the overall risk of the application orchestration graph to be evaluated based on the node attributes of the matched nodes and the node connection relationship between the matched nodes, and then inputting the first predicted risk assessment result into the trained risk solution plan generation model to obtain a first predicted risk solution plan for the application orchestration graph to be evaluated;
[0242] Among them, the risk resolution plan generation model is trained based on the second sample data and the label corresponding to the second sample data; the second sample data includes a second sample risk assessment result representing the overall risk of the second sample application orchestration diagram; the label corresponding to the second sample data includes: a first sample risk resolution plan for the second sample application orchestration diagram.
[0243] In some embodiments, the training process of the risk solution generation model includes:
[0244] Acquire the second sample data and a label corresponding to the second sample data;
[0245] Inputting the second sample data into the risk solution plan generation model of the initial structure to obtain a second predicted risk solution plan for the second sample application arrangement diagram output by the risk solution plan generation model of the initial structure;
[0246] Calculate the loss value according to the difference between the obtained second predicted risk solution plan and the first sample risk solution plan included in the label corresponding to the second sample data;
[0247] Based on the obtained loss value, the model parameters of the risk assessment model of the initial structure are adjusted until convergence is reached, thereby obtaining a trained risk resolution plan generation model.
[0248] In some embodiments, the apparatus further comprises:
[0249] A risk processing module is used to input the first predicted risk assessment result into a trained risk resolution plan generation model to obtain a first predicted risk resolution plan for the application orchestration diagram to be evaluated. If the risk represented by the first predicted risk assessment result occurs during the operation of the application generated based on the application orchestration diagram to be evaluated, the risk processing module is used to process the risk according to the first predicted risk resolution plan.
[0250] In some embodiments, the risk type includes at least one of: model inference risk, resource risk, frame rate risk, and processing unit risk;
[0251] The risk resolution plan corresponding to the model reasoning risk is used to indicate: pruning or replacing the used model during the running of the application generated based on the application orchestration graph to be evaluated;
[0252] The risk resolution plan corresponding to the resource risk is used to indicate: in the process of running the application generated based on the application orchestration graph to be evaluated, to reserve designated spare computing resources, so as to complete the running of the application through the spare computing resources when the risk occurs;
[0253] The risk resolution plan corresponding to the frame rate risk is used to indicate: in the process of running the application generated based on the application orchestration graph to be evaluated, reducing the frame rate of data required to be processed by the application;
[0254] The risk resolution plan corresponding to the processing unit risk is used to indicate: in the process of running the application generated based on the application orchestration graph to be evaluated, a designated spare processing unit is reserved to complete the running of the application through the spare processing unit when the risk occurs.
[0255] In some embodiments, the node connection relationship includes at least one of the following: dependent on, causing enhancement, causing weakening, enhancing, and weakening;
[0256] The node attributes of each node also include: the probability of occurrence of the risk existing in the entity connection relationship represented by the node;
[0257] The first evaluation module 803 is specifically used for:
[0258] For each entity connection relationship in the application orchestration graph to be evaluated, determining the node attribute of the node in the knowledge graph that matches the entity connection relationship as the local risk assessment result represented by the entity connection relationship;
[0259] For any two entity connection relationships in the application orchestration graph to be evaluated, if the risk types of the risks represented by the nodes matched by the two entity connection relationships in the knowledge graph are inconsistent, and the node connection relationship between the two nodes is dependent on, then the occurrence probabilities recorded in the local risk assessment results represented by the two entity connection relationships are respectively increased;
[0260] If the risk types of the risks represented by the nodes that match the two entity connection relationships in the knowledge graph are inconsistent, and the node connection relationship between the two nodes is to cause enhancement, then determine the entity connection relationship represented by the node that causes enhancement in the two entity connection relationships, and increase the occurrence probability recorded in the local risk assessment result of the determined entity connection relationship;
[0261] If the risk types of the risks represented by the nodes that match the two entity connection relationships in the knowledge graph are inconsistent, and the node connection relationship between the two nodes is to cause a weakening, then determine the entity connection relationship represented by the node that causes a weakening in the two entity connection relationships, and reduce the occurrence probability recorded in the local risk assessment result of the determined entity connection relationship;
[0262] If the risk types of the risks represented by the nodes matched by the two entity connection relationships in the knowledge graph are consistent, and the node connection relationship between the two nodes is enhanced, then the occurrence probabilities recorded in the local risk assessment results represented by the two entity connection relationships are respectively increased;
[0263] If the risk types of the risks represented by the nodes matched by the two entity connection relationships in the knowledge graph are consistent, and the node connection relationship between the two nodes is weakened, then the occurrence probabilities recorded in the local risk assessment results represented by the two entity connection relationships are respectively reduced;
[0264] The local risk assessment results represented by the connection relationships of each entity are combined to obtain a first predicted risk assessment result representing the overall risk of the application orchestration graph to be assessed.
[0265] The present application also provides an electronic device, such as Fig. 9 As shown, including:
[0266] Memory 901, used for storing computer programs;
[0267] The processor 902 is used to implement the steps of any of the above risk assessment methods when executing the program stored in the memory 901.
[0268] Furthermore, the electronic device may further include a communication bus and / or a communication interface, and the processor 902, the communication interface, and the memory 901 communicate with each other via the communication bus.
[0269] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0270] The communication interface is used for communication between the above electronic device and other devices.
[0271] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0272] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0273] In another embodiment provided in the present application, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above risk assessment methods are implemented.
[0274] In another embodiment provided in the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute any risk assessment method in the above embodiments.
[0275] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a solid-state hard disk (SSD), etc.
[0276] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0277] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, electronic device, and computer-readable storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0278] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.
Claims
1. A risk assessment method, characterized in that: The method comprises: Obtaining an application orchestration graph to be evaluated; wherein an application orchestration graph of an application includes multiple entities and entity connection relationships between the multiple entities, an entity represents an operation step required to be performed during the running of the application, and the operation steps represented by two entities having an entity connection relationship during the running of the application are executed sequentially; Determine, from a pre-built knowledge graph, a node that matches the entity connection relationship between each two entities in the application orchestration graph to be evaluated; wherein the knowledge graph includes multiple nodes and node connection relationships between nodes; each node represents an entity connection relationship between two entities in the application orchestration graph; the node attributes of each node include: the risk type of the risk existing in the entity connection relationship represented by the node; the node connection relationship between two nodes represents the relationship between the risks represented by the two nodes; Based on the node attributes of the matched nodes and the node connection relationships between the matched nodes, a first predicted risk assessment result representing the overall risk of the application orchestration graph to be assessed is obtained.
2. The method according to claim 1, characterized in that The obtaining, based on the node attributes of the matched nodes and the node connection relationship between the matched nodes, a first predicted risk assessment result representing the overall risk of the application orchestration graph to be assessed includes: Inputting node attributes of the matched nodes and node connection relationships between the matched nodes into the trained risk assessment model to obtain a first predicted risk assessment result representing the overall risk of the application orchestration graph to be assessed; Among them, the risk assessment model is: trained based on the first sample data and the label corresponding to the first sample data; the first sample data includes: the node attributes of the nodes that match the entity connection relationship contained in the first sample application orchestration diagram, and the node connection relationship between the matching nodes; the label corresponding to the first sample data includes: the first sample risk assessment result representing the overall risk of the first sample application orchestration diagram.
3. The method according to claim 2, characterized in that The training process of the risk assessment model includes: Acquire the first sample data and a label corresponding to the first sample data; Inputting the first sample data into the risk assessment model of the initial structure to obtain a second predicted risk assessment result output by the risk assessment model of the initial structure, which indicates the overall risk of the first sample application arrangement diagram; Calculate the loss value according to the difference between the obtained second prediction risk assessment result and the first sample risk assessment result included in the label corresponding to the first sample data; Based on the obtained loss value, the model parameters of the risk assessment model of the initial structure are adjusted until convergence is reached to obtain a trained risk assessment model.
4. The method according to claim 1, characterized in that: After obtaining a first predicted risk assessment result representing the overall risk of the application orchestration graph to be assessed based on the node attributes of the matched nodes and the node connection relationship between the matched nodes, the method further includes: Inputting the first predicted risk assessment result into a trained risk resolution plan generation model to obtain a first predicted risk resolution plan for the application orchestration graph to be assessed; Among them, the risk resolution plan generation model is trained based on the second sample data and the label corresponding to the second sample data; the second sample data includes a second sample risk assessment result representing the overall risk of the second sample application orchestration diagram; the label corresponding to the second sample data includes: a first sample risk resolution plan for the second sample application orchestration diagram.
5. The method according to claim 4, characterized in that The training process of the risk solution plan generation model includes: Acquire the second sample data and a label corresponding to the second sample data; Inputting the second sample data into the risk solution plan generation model of the initial structure to obtain a second predicted risk solution plan for the second sample application arrangement diagram output by the risk solution plan generation model of the initial structure; Calculate the loss value according to the difference between the obtained second predicted risk solution plan and the first sample risk solution plan included in the label corresponding to the second sample data; Based on the obtained loss value, the model parameters of the risk assessment model of the initial structure are adjusted until convergence is reached, thereby obtaining a trained risk resolution plan generation model.
6. The method according to claim 4, characterized in that After inputting the first predicted risk assessment result into the trained risk solution plan generation model to obtain the first predicted risk solution plan for the application orchestration graph to be assessed, the method further includes: During the process of running the application generated based on the application orchestration graph to be evaluated, if the risk represented by the first predicted risk evaluation result occurs, it is processed according to the first predicted risk resolution plan.
7. The method according to claim 4, characterized in that The risk type includes at least one of the following: model reasoning risk, resource risk, frame rate risk, and processing unit risk; The risk resolution plan corresponding to the model reasoning risk is used to indicate: pruning or replacing the used model during the running of the application generated based on the application orchestration graph to be evaluated; The risk resolution plan corresponding to the resource risk is used to indicate: in the process of running the application generated based on the application orchestration graph to be evaluated, to reserve designated spare computing resources, so as to complete the running of the application through the spare computing resources when the risk occurs; The risk resolution plan corresponding to the frame rate risk is used to indicate: in the process of running the application generated based on the application orchestration graph to be evaluated, reducing the frame rate of data required to be processed by the application; The risk resolution plan corresponding to the processing unit risk is used to indicate: in the process of running the application generated based on the application orchestration graph to be evaluated, a designated spare processing unit is reserved to complete the running of the application through the spare processing unit when the risk occurs.
8. The method according to claim 1, characterized in that: The node connection relationship includes at least one of the following: dependent on, causing enhancement, causing weakening, enhancing, and weakening; The node attributes of each node also include: the probability of occurrence of the risk existing in the entity connection relationship represented by the node; The obtaining, based on the node attributes of the matched nodes and the node connection relationship between the matched nodes, a first predicted risk assessment result representing the overall risk of the application orchestration graph to be assessed includes: For each entity connection relationship in the application orchestration graph to be evaluated, determining the node attribute of the node in the knowledge graph that matches the entity connection relationship as the local risk assessment result represented by the entity connection relationship; For any two entity connection relationships in the application orchestration graph to be evaluated, if the risk types of the risks represented by the nodes matched by the two entity connection relationships in the knowledge graph are inconsistent, and the node connection relationship between the two nodes is dependent on, then the occurrence probabilities recorded in the local risk assessment results represented by the two entity connection relationships are respectively increased; If the risk types of the risks represented by the nodes that match the two entity connection relationships in the knowledge graph are inconsistent, and the node connection relationship between the two nodes is to cause enhancement, then determine the entity connection relationship represented by the node that causes enhancement in the two entity connection relationships, and increase the occurrence probability recorded in the local risk assessment result of the determined entity connection relationship; If the risk types of the risks represented by the nodes that match the two entity connection relationships in the knowledge graph are inconsistent, and the node connection relationship between the two nodes is to cause a weakening, then determine the entity connection relationship represented by the node that causes a weakening in the two entity connection relationships, and reduce the occurrence probability recorded in the local risk assessment result of the determined entity connection relationship; If the risk types of the risks represented by the nodes matched by the two entity connection relationships in the knowledge graph are consistent, and the node connection relationship between the two nodes is enhanced, then the occurrence probabilities recorded in the local risk assessment results represented by the two entity connection relationships are respectively increased; If the risk types of the risks represented by the nodes matched by the two entity connection relationships in the knowledge graph are consistent, and the node connection relationship between the two nodes is weakened, then the occurrence probabilities recorded in the local risk assessment results represented by the two entity connection relationships are respectively reduced; The local risk assessment results represented by the connection relationships of each entity are combined to obtain a first predicted risk assessment result representing the overall risk of the application orchestration graph to be assessed.
9. A risk assessment device, characterized in that: The device comprises: An application orchestration graph acquisition module is used to acquire an application orchestration graph to be evaluated; wherein an application orchestration graph of an application includes multiple entities and entity connection relationships between the multiple entities, an entity represents an operation step required to be performed during the operation of the application, and the operation steps represented by two entities having an entity connection relationship during the operation of the application are executed sequentially; A matching module is used to determine, from a pre-built knowledge graph, a node that matches the entity connection relationship between each two entities in the application orchestration graph to be evaluated; wherein the knowledge graph includes multiple nodes and node connection relationships between nodes; each node represents an entity connection relationship between two entities in the application orchestration graph; the node attributes of each node include: the risk type of the risk existing in the entity connection relationship represented by the node; the node connection relationship between two nodes represents the relationship between the risks represented by the two nodes; The first assessment module is used to obtain a first predicted risk assessment result representing the overall risk of the application orchestration graph to be assessed based on node attributes of the matched nodes and node connection relationships between the matched nodes.
10. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, for implementing any of the methods described in claims 1-8 when executing a program stored in a memory.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.