Service grid test prediction method and device for resource decoupling
By determining the connection path in the service grid system and generating test service requests, the problem of low accuracy of test results in the prior art is solved, and a more comprehensive test process and higher accuracy are achieved.
Patent Information
- Application Number
- CN202411908427.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2044-12-24
AI Technical Summary
The prior art fails to effectively consider the differences between systems when testing new service grid systems, resulting in low accuracy of test results.
By determining the connection path from the input port to the output port in the target service grid system, a corresponding test service request is generated and input it into the system to obtain the test results until the result matches the expected result, it is determined that the system test has passed.
A more comprehensive testing process for the service grid system is realized, avoiding the problem of incomplete testing process caused by system differences, and improving the accuracy of the test results.
Smart Images

Figure CN119377084B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of software testing technology, and in particular to a service grid testing prediction method and device for resource decoupling. Background Art
[0002] The scale of distributed machine learning applications is becoming larger and larger, and their functions are becoming more and more complex. In order to improve development efficiency and reduce maintenance costs, many distributed machine learning applications decouple computing resources from network resources and handle network communications through service mesh software. Widely used open source and commercial service mesh systems, such as Istio, Linkerd, and AWS App Mesh, provide rich traffic management capabilities for distributed machine learning application traffic. Service mesh provides developers with declarative APIs, and software developers can define service routing, load balancing, A / B testing, and access control with just a few lines of configuration. In order to ensure that the service mesh system can have high reliability, the service mesh system needs to be tested.
[0003] In the related art, the configuration parameters of the service grid system can be optimized manually. The configuration parameters of the new service grid system can be configured according to the previous processing of other service grid systems, the service grid rules can be set, and the test cases can be set according to the historical processing of other service grid systems, so that the service grid system can be tested.
[0004] However, a new service grid system often has certain differences from other service grid systems, and the above method does not take such differences into account, which results in low accuracy of the test results of the new service grid system using the above method. Summary of the invention
[0005] In view of the above problems, embodiments of the present application provide a service grid test prediction method, device, electronic device and readable storage medium for resource decoupling, so as to overcome the above problems or at least partially solve the above problems.
[0006] In a first aspect, an embodiment of the present application provides a service grid test prediction method for resource decoupling, the method comprising:
[0007] Determine a first connectivity path from the input port to the output port in the target service grid system;
[0008] generating first test service requests corresponding to each of the first communication paths;
[0009] Inputting each of the first test service requests into the target service grid system from an input port corresponding to each of the first test service requests, to obtain each of the first test service results output by the target service grid system;
[0010] In a case where each of the first test service results matches the service reference results respectively corresponding to each of the first connection paths, it is determined that the target service grid system test has passed.
[0011] Optionally, the method further comprises:
[0012] Determine first input message information corresponding to each of the first connection paths based on first satisfiability modulo theory conditions corresponding to each of the first conditional nodes in each of the first connection paths;
[0013] Determine first modification functions corresponding to each of the first communication paths based on the message modification actions corresponding to each of the action nodes in each of the first communication paths;
[0014] The service reference results corresponding to each of the first connection paths are determined based on the first input message information and the first modification function.
[0015] Optionally, determining a first connectivity path from an input port to an output port in the target service grid system includes:
[0016] Determine a first control flow graph of the target service grid system;
[0017] Determine first service request configuration information of each second action node and second satisfiability modulo theoretical condition of each second condition node included in the first control flow graph;
[0018] Based on the first service request configuration information and the second satisfiability model theoretical condition, a first connectivity path from an input port to an output port in the target service grid system is determined.
[0019] Optionally, determining a first connectivity path from an input port to an output port in the target service grid system based on the first service request configuration information and the second satisfiability model theoretical condition includes:
[0020] Determine, based on the first service request configuration information, each input port of the target service grid system and each output port corresponding to each input port;
[0021] Based on the second satisfiability modulo theory condition, determine a third action node and a third condition node between the input port and the output port corresponding to the input port, and upstream and downstream relationships corresponding to the third action node and the third condition node respectively;
[0022] Based on the upstream and downstream relationship, the input port, the output port corresponding to the input port, the third action node and the third condition node are connected to obtain a first connection path.
[0023] Optionally, determining a first connectivity path from an input port to an output port in the target service grid system based on the first service request configuration information and the second satisfiability model theoretical condition includes:
[0024] Determine, based on the first service request configuration information, each input port of the target service grid system and each output port corresponding to each input port;
[0025] Based on the symbolic execution method, determining the fourth action node and the fourth condition node corresponding to each of the input ports from the second action node and the second condition node respectively;
[0026] Based on the symbolic execution method, the input port, the output port corresponding to the input port, the fourth action node and the fourth condition node are connected in sequence to obtain a first connected path.
[0027] Optionally, the generating first test service requests respectively corresponding to each of the first communication paths includes:
[0028] Determining second service request configuration information corresponding to each of the first communication paths from action nodes respectively included in each of the first communication paths;
[0029] Based on each of the second service request configuration information, a first test service request corresponding to each of the first communication paths is generated.
[0030] Optionally, the step of inputting each of the first test service requests into the target service grid system from an input port corresponding to each of the first test service requests to obtain each of the first test service results output by the target service grid system includes:
[0031] Determine a first service grid resource name corresponding to each of the first connectivity paths;
[0032] Matching the first service grid resource name with the standard resource name to obtain a first matching result;
[0033] Determining a test priority of each of the first connectivity paths based on the first matching result;
[0034] In the order of the test priority from high to low, each of the first test service requests is input into the target service grid system from the input port corresponding to each of the first test service requests, so as to obtain each of the first test service results output by the target service grid system.
[0035] Optionally, determining the test priority of each of the first connectivity paths based on the first matching result includes:
[0036] When the first matching result is an exact match, determining the test priority of the first connection path to be a first priority;
[0037] When the first matching result is a regular match, the test priority of the first connection path is determined to be a second priority; wherein the second priority is lower than the first priority.
[0038] Optionally, the method further comprises:
[0039] In the first communication path, if there are at least two second communication paths whose first matching results are both exact matches or both regular matches, and the standard resource names corresponding to the second communication paths are the same, determining the creation time of the second communication paths;
[0040] The test priority of the second communication path created earlier is determined to be the third priority, and the test priority of the second communication path created later is determined to be the fourth priority; wherein the third priority is higher than the fourth priority.
[0041] In a second aspect, an embodiment of the present application provides a service grid test prediction device for resource decoupling, the device comprising:
[0042] A first determination module, configured to determine a first connectivity path from an input port to an output port in a target service grid system;
[0043] A generating module, configured to generate first test service requests corresponding to each of the first connecting paths;
[0044] An input module, used to input each of the first test service requests into the target service grid system from an input port corresponding to each of the first test service requests, to obtain each of the first test service results output by the target service grid system;
[0045] The second determination module is used to determine that the target service grid system test has passed when each of the first test service results matches the service reference results respectively corresponding to each of the first connection paths.
[0046] Optionally, the device further comprises:
[0047] A third determining module, configured to determine first input message information corresponding to each of the first connecting paths based on first satisfiability modulus theoretical conditions corresponding to each of the first conditional nodes in each of the first connecting paths;
[0048] A fourth determining module, configured to determine first modification functions respectively corresponding to each of the first communication paths based on the message modification actions respectively corresponding to each of the action nodes in each of the first communication paths;
[0049] A fifth determining module is configured to determine the service reference results corresponding to the first connection paths based on the first input message information and the first modification function.
[0050] Optionally, the first determining module includes:
[0051] A first determination submodule, used to determine a first control flow graph of a target service grid system;
[0052] A second determination submodule, used to determine the first service request configuration information of each second action node and the second satisfiability modulus theoretical condition of each second condition node included in the first control flow graph;
[0053] The third determination submodule is used to determine a first connectivity path from the input port to the output port in the target service grid system based on the first service request configuration information and the second satisfiability model theoretical condition.
[0054] Optionally, the third determining submodule includes:
[0055] A first determining unit, configured to determine, based on the first service request configuration information, each input port of the target service grid system and each output port corresponding to each input port;
[0056] A second determining unit is used to determine, based on the second satisfiability modulo theory condition, a third action node and a third condition node between the input port and the output port corresponding to the input port, and an upstream and downstream relationship corresponding to the third action node and the third condition node respectively;
[0057] The first connecting unit is used to connect the input port, the output port corresponding to the input port, the third action node and the third condition node based on the upstream and downstream relationship to obtain a first connecting path.
[0058] Optionally, the third determining submodule includes:
[0059] A fourth determining unit, configured to determine, based on the first service request configuration information, each input port of the target service grid system and each output port corresponding to each input port;
[0060] a fifth determining unit, configured to determine, based on a symbolic execution method, from the second action nodes and the second condition nodes, respectively, fourth action nodes and fourth condition nodes corresponding to the respective input ports;
[0061] The second connection unit is used to connect the input port, the output port corresponding to the input port, the fourth action node and the fourth condition node in the order of the fourth action node and the fourth condition node based on the symbolic execution method to obtain a first connection path.
[0062] Optionally, the generating module includes:
[0063] a fourth determining submodule, configured to determine, from the action nodes respectively included in the first communication paths, the second service request configuration information respectively corresponding to the first communication paths;
[0064] The generating submodule is used to generate first test service requests corresponding to each of the first communication paths based on each of the second service request configuration information.
[0065] Optionally, the input module includes:
[0066] A fifth determining submodule, configured to determine a first service grid resource name corresponding to each of the first connectivity paths;
[0067] A matching submodule, used to match the first service grid resource name with the standard resource name to obtain a first matching result;
[0068] a sixth determining submodule, configured to determine a test priority of each of the first connecting paths based on the first matching result;
[0069] The input submodule is used to input each of the first test service requests into the target service grid system from the input ports corresponding to each of the first test service requests in the order of the test priority from high to low, so as to obtain each of the first test service results output by the target service grid system.
[0070] Optionally, the sixth determining submodule includes:
[0071] a sixth determining unit, configured to determine, when the first matching result is an exact match, that the test priority of the first connectivity path is a first priority;
[0072] A seventh determining unit is configured to determine, when the first matching result is a regular match, that the test priority of the first connection path is a second priority; wherein the second priority is lower than the first priority.
[0073] Optionally, the device further comprises:
[0074] a sixth determining module, configured to determine the creation time of the second communication path when, in the first communication path, there are at least two second communication paths whose first matching results are both exact matches or both regular matches, and the standard resource names corresponding to the second communication paths are the same;
[0075] The seventh determination module is used to determine that the test priority of the second communication path with an earlier creation time is the third priority, and determine that the test priority of the second communication path with a later creation time is the fourth priority; wherein the third priority is higher than the fourth priority.
[0076] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored on the memory, wherein the processor executes the computer program to implement a service grid test prediction method for resource decoupling as described in any one of the above items.
[0077] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, a service grid test prediction method for resource decoupling as described in any one of the above items is implemented.
[0078] The specific beneficial effects are:
[0079] The embodiment of the present application determines a first connectivity path from an input port to an output port in a target service grid system, generates first test service requests corresponding to each first connectivity path, inputs each first test service request into the target service grid system from an input port corresponding to each first test service request, obtains each first test service result output by the target service grid system, and determines that the target service grid system test has passed when each first test service result matches a service reference result corresponding to each first connectivity path. The first connectivity paths existing in the target service grid system can be input tested using first test service requests corresponding to each first connectivity path, and when the test results of each first connectivity path match the service reference results corresponding to each first connectivity path, the target service grid system test can be determined to have passed. A more comprehensive test process can be performed on the target service grid system, avoiding the problem of incomplete test process due to differences in service grid systems, and improving the accuracy of the test results of the service grid system to a certain extent. BRIEF DESCRIPTION OF THE DRAWINGS
[0080] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0081] Figure 1 It is a flow chart of a service grid test prediction method for resource decoupling provided in an embodiment of the present application;
[0082] Figure 2 It is a flow chart of another service grid test prediction method for resource decoupling provided in an embodiment of the present application;
[0083] Figure 3 It is a logical block diagram of a service grid test prediction device for resource decoupling provided in an embodiment of the present application;
[0084] Figure 4 It is a schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0085] The exemplary embodiments of the present application will be described in more detail below in conjunction with the accompanying drawings in the embodiments of the present application. Although the exemplary embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present application and to enable the scope of the present application to be fully communicated to those skilled in the art.
[0086] Reference Figure 1 , Figure 1 A flow chart of a service grid test prediction method for resource decoupling provided in an embodiment of the present application, the method comprising:
[0087] Step 101: determine a first connectivity path from an input port to an output port in a target service grid system.
[0088] In an embodiment of the present application, a service grid is a way to handle service communication in a microservice architecture. It is a layer of infrastructure located between services, which can provide functions such as service discovery and load balancing, traffic control and timeout processing, security and authentication, monitoring and authentication. The operating environment of the service grid can be a kubernetes (k8s) cluster in the Kind software. Accordingly, the execution environment of the service grid test prediction method of the present application can be the same as the operating environment of the service grid. The service grid can include two components, namely the data plane and the control plane. The data plane handles actual request and response traffic. It is located between services and is responsible for request routing, load balancing, traffic control, etc.; the control plane manages the configuration and policy of the service grid and is responsible for service discovery, routing rules, security settings, etc. The target service grid system can be a service grid system to be tested. In the target service grid system, there can be multiple input ports and multiple output ports for performing different types of communication services. In the target service grid system, an input port can form a connection path with at least one output port. The connection path is directed, and its direction is from the input port to the output port, and each node on the connection path is a directed node, which is used to indicate the signal flow direction. On this basis, after obtaining the target service grid system, the target service grid system can be analyzed, so as to determine the first connection path from the input port to the output port in the target service grid system. The first connection path can include all possible connection paths in the target service grid system.
[0089] Step 102: Generate first test service requests corresponding to each of the first communication paths.
[0090] In an embodiment of the present application, after obtaining the first connectivity path of the target service grid system, the first test service request corresponding to each first connectivity path can be generated according to the service type corresponding to each first connectivity path. The first test service request can correspond to configuration information such as the service host, service request header, service security settings, and input port and output port of the service. Among them, the service host, service request header and service security settings are request fields, and the input port and output port of the service are metadata of the service request. Since the first connectivity path covers all possible connectivity paths of the target service grid system, the first test service request can cover all possible service types of the target service grid system. In addition, the format of the first test service request can be set independently, and it is only necessary to make the first test service request correspond to the service type, without including all the above configuration information in the request command.
[0091] In a possible embodiment, the first test service request may be further encoded by using a global string table to map the string of the first test service request to an integer, thereby converting the first test service request into an integer list. This can reduce the complexity of the test service request, and the integer list may further include magic numbers to distinguish between test requests and real requests.
[0092] Step 103: Input each of the first test service requests into the target service grid system from an input port corresponding to each of the first test service requests, to obtain each of the first test service results output by the target service grid system.
[0093] In an embodiment of the present application, each first test service request can be input into the target service grid system from their respective corresponding input ports, so that after entering the target service grid system, the first test service request can be processed by the target service grid system accordingly, so that the first test service result can be output at their respective corresponding output ports. After entering the target service grid system, the data flow path of the first test service request can be the first connection path corresponding to the first test service request.
[0094] Step 104: When each of the first test service results matches the service reference results corresponding to each of the first connection paths, it is determined that the target service grid system test has passed.
[0095] In an embodiment of the present application, the service reference results corresponding to each first connection path can be pre-set according to the service type corresponding to the first connection path. If each first test service result matches the service reference result corresponding to each first connection path, it can be determined that the test of the target service grid system has passed. Correspondingly, if there is a mismatch with the service reference result in the first test service result, it can be determined that the test of the target service grid system has failed. In this way, the test prediction of the target service grid system is completed.
[0096] In an embodiment of the present application, by determining a first connectivity path from an input port to an output port in a target service grid system, generating first test service requests corresponding to each first connectivity path, inputting each first test service request into the target service grid system from an input port corresponding to each first test service request, obtaining each first test service result output by the target service grid system, and determining that the target service grid system test has passed when each first test service result matches a service reference result corresponding to each first connectivity path. The first connectivity paths existing in the target service grid system can be input tested using first test service requests corresponding to each first connectivity path, and when the test results of each first connectivity path match the corresponding service reference results, determining that the target service grid system test has passed. A more comprehensive test process can be performed on the target service grid system, avoiding the problem of incomplete test process due to differences in service grid systems, and improving the accuracy of the test results of the service grid system to a certain extent.
[0097] Reference Figure 2 , Figure 2 A flow chart of another service grid test prediction method for resource decoupling provided in an embodiment of the present application, the method may include:
[0098] Step 201: determine a first connectivity path from an input port to an output port in a target service grid system.
[0099] In the embodiments of the present application, the implementation content of this step can refer to the embodiment content of step 101, which will not be repeated here.
[0100] Optionally, step 201 may include the following sub-steps:
[0101] Sub-step 2011, determining a first control flow graph of the target service grid system.
[0102] In an embodiment of the present application, when an application is decomposed into a service grid system, each connection path in the service grid system corresponds to a service function of the application. Therefore, the data flow in the service grid system can form a control flow graph, and the flow path of the data flow in the control flow graph is the connection path of the service grid system. On this basis, the first control flow graph of the target service grid system can be determined according to the structure of the target service grid system.
[0103] Sub-step 2012: determining the first service request configuration information of each second action node and the second satisfiability modulo theoretical condition of each second condition node included in the first control flow graph.
[0104] In an embodiment of the present application, two types of nodes may be included in the first control flow graph, namely, a second action node and a second condition node. Among them, the action node may include one or more first service request configuration information, and in the first service request configuration information, relevant information of the service function corresponding to all the connected paths flowing through the action node may be included, such as the service host, the service request header, the service security setting, and the input port and output port of the service, etc., for receiving and processing the service request related to the above information. In each adjacent action node, the output of the upstream action node is the input of the adjacent downstream action node. This corresponds to the continuous processing process of the input signal in the source application, and each function function may correspond to an action node. The condition node may include a satisfiability modulo theory (SMT) condition, which is used to determine whether the subsequent node is adapted to the request flowing through the condition node. On this basis, in the first control flow graph, the first control flow graph may be parsed, so that the first service request configuration information of each second action node and the second satisfiability modulo theory condition of each second condition node contained in the first control flow graph may be determined.
[0105] Sub-step 2013: determining a first connectivity path from an input port to an output port in the target service grid system based on the first service request configuration information and the second satisfiability model theoretical condition.
[0106] In an embodiment of the present application, the first connection path from the input port to the output port in the target service grid system can be determined according to the first service request configuration information and the second satisfiability modulo theoretical condition. In the target service grid system, the second action node and the second condition node can be spaced apart from each other, so that the second action node downstream and the second action node upstream can be judged by the second satisfiability modulo theoretical condition in the second condition node downstream of the second action node whether they can be in the same connection path. When judging, the first service request configuration information can be combined. If the first service request configuration information of the second action node downstream is the same as the first service request configuration information of the second action node upstream, and the second satisfiability modulo theoretical condition of the second condition node is satisfied, then the above two second action nodes and the second condition node can be in the same connection path. By traversing all the second action nodes and the second condition nodes according to the above method, the first connection path from the input port to the output port in the target service grid system can be obtained.
[0107] Optionally, sub-step 2013 may include the following sub-steps:
[0108] Sub-step A1: determining, based on the first service request configuration information, each input port of the target service grid system and the output ports corresponding to each input port.
[0109] In an embodiment of the present application, each input port of the target service grid system and each output port corresponding to each input port may be determined in the first service request configuration information.
[0110] Sub-step A2, based on the second satisfiability modulus theory condition, determine the third action node and the third condition node between the input port and the output port corresponding to the input port, as well as the upstream and downstream relationships corresponding to the third action node and the third condition node respectively.
[0111] In the embodiment of the present application, according to the second satisfiability modulo theoretical condition, a third action node between an input port and an output port corresponding to the input port can be obtained by screening from the second action node, and a third condition node between an input port and an output port corresponding to the input port can be obtained by screening from the second condition node. At the same time, since the second satisfiability modulo theoretical condition can be used to determine whether a subsequent node is adapted to a request flowing through the condition node, the upstream and downstream relationships corresponding to the third action node and the third condition node can also be obtained.
[0112] Sub-step A3: based on the upstream and downstream relationship, connect the input port, the output port corresponding to the input port, the third action node and the third condition node to obtain a first connection path.
[0113] In an embodiment of the present application, the input port, the output port corresponding to the input port, the third action node and the third condition node can be connected according to the upstream and downstream relationship, so as to obtain a first connection path, wherein the flow direction of the first connection path is consistent with the upstream and downstream relationship, from upstream to downstream, and from the input port to the output port.
[0114] In an embodiment of the present application, by determining the input ports of the target service grid system and the output ports corresponding to the input ports based on the first service request configuration information, determining the third action node and the third condition node between the input port and the output port corresponding to the input port based on the second satisfiability modulo theoretical condition, and the upstream and downstream relationships corresponding to the third action node and the third condition node based on the upstream and downstream relationship, the input port, the output port corresponding to the input port, the third action node and the third condition node are connected to obtain a first connectivity path, and the upstream and downstream relationships between the third action nodes and the third condition nodes can be determined according to the second satisfiability modulo theoretical condition, and the input port and the corresponding output port determined according to the first service request configuration information can be connected according to the upstream and downstream relationship, thereby obtaining the first connectivity path, and the target grid system can be comprehensively analyzed according to the first control flow graph corresponding to the target service grid system, further improving the accuracy and reliability of the first connectivity path.
[0115] Sub-step A4: determining, based on the first service request configuration information, each input port of the target service grid system and the output ports corresponding to each input port.
[0116] In the embodiments of the present application, the implementation content of this step can refer to the embodiment content of step A1, which will not be repeated here.
[0117] Sub-step A5: Based on the symbolic execution method, determine the fourth action node and the fourth condition node corresponding to each of the input ports from the second action node and the second condition node respectively.
[0118] In an embodiment of the present application, symbolic execution is a program analysis technique that can obtain input requests for execution of a specific code area by analyzing the program. The main goal of symbolic execution is to generate a set of inputs within a given time and explore as many different execution paths of the program as possible through these inputs. Symbolic execution uses symbolic values (rather than specific values) as the input of the program and represents program variables as symbolic expressions. When encountering a branch statement, symbolic execution explores each branch and adds the branch condition to the corresponding path constraint. Finally, the solvability of the path constraint is verified by a constraint solver (such as an SMT solver) to determine whether the path is reachable. The symbolic execution method can be used to perform symbolic execution starting from each input port. After the symbolic execution is completed, the fourth action node corresponding to each input port can be obtained from the second action node, and the fourth condition node corresponding to each input port can be obtained from the second condition node.
[0119] Sub-step A6, based on the symbolic execution method, the input port, the output port corresponding to the input port, the fourth action node and the fourth condition node are connected in sequence to obtain a first connected path.
[0120] In an embodiment of the present application, for each input port, the symbolic execution method has a sequence of passing through the fourth action node and the fourth condition node corresponding to the input port. According to this sequence, the input port, the output port corresponding to the input port, the fourth action node and the fourth condition node can be connected to obtain a first connected path. Among them, the direction of the input port, the output port corresponding to the input port, the fourth action node and the fourth condition node in the first connected path is consistent with the sequence of the symbolic execution method passing through the input port, the output port corresponding to the input port, the fourth action node and the fourth condition node.
[0121] In an embodiment of the present application, by determining the input ports of the target service grid system and the output ports corresponding to the input ports based on the first service request configuration information, determining the fourth action node and the fourth condition node corresponding to the input ports from the second action node and the second condition node based on the symbolic execution method, and connecting the input port, the output port corresponding to the input port, the fourth action node and the fourth condition node in sequence through the fourth action node and the fourth condition node based on the symbolic execution method to obtain a first connectivity path. All first connectivity paths contained in the target service grid system can be obtained through the symbolic execution method, thereby further improving the accuracy and reliability of the first connectivity paths.
[0122] In an embodiment of the present application, by determining a first control flow graph of a target service grid system, determining first service request configuration information of each second action node and second satisfiability modulo theoretical condition of each second condition node contained in the first control flow graph, and based on the first service request configuration information and the second satisfiability modulo theoretical condition, determining a first connectivity path from an input port to an output port in the target service grid system, multiple first connectivity paths contained in the target service grid system can be obtained by analyzing the control flow graph corresponding to the target service grid system, thereby improving the matching degree of the first connectivity path with the target service grid system and improving the accuracy of the first connectivity path.
[0123] Step 202: Generate first test service requests corresponding to each of the first communication paths.
[0124] In the embodiments of the present application, the implementation content of this step can refer to the implementation content of step 102, which will not be repeated here.
[0125] Optionally, step 202 may include the following sub-steps:
[0126] Sub-step 2021: determining second service request configuration information corresponding to each of the first communication paths from the action nodes respectively included in each of the first communication paths.
[0127] In the embodiment of the present application, the first communication path may include multiple action nodes, and each action node may include second service request configuration information such as service host, service request header, service security setting, and input port and output port of the service. Therefore, the second service request configuration information corresponding to each first communication path can be determined from the action nodes respectively included in each first communication path.
[0128] Sub-step 2022: generating first test service requests corresponding to each of the first connection paths based on each of the second service request configuration information.
[0129] In an embodiment of the present application, first test service requests corresponding to each first connectivity path can be generated according to the second service request configuration information. The information contained in the first test service request is consistent with the second service request configuration information, but the data type is different. The first test service request can be a string command that can be recognized by the target service grid system, and then the service flow corresponding to the first test service request can be started.
[0130] In an embodiment of the present application, by determining the second service request configuration information corresponding to each first connectivity path from the action nodes respectively included in each first connectivity path, and generating the first test service requests corresponding to each first connectivity path based on the second service request configuration information, the first test service requests corresponding to each first connectivity path can be generated according to the second service request configuration information included in the action nodes in each first connectivity path. Since the information included in the first test service request is more specific, the corresponding request format also has a higher granularity, which can improve the reliability and executability of the first test service request to a certain extent.
[0131] Step 203: Input each of the first test service requests into the target service grid system from an input port corresponding to each of the first test service requests, to obtain each of the first test service results output by the target service grid system.
[0132] In the embodiments of the present application, the implementation content of this step can refer to the implementation content of step 103, which will not be repeated here.
[0133] Optionally, step 203 may include the following sub-steps:
[0134] Sub-step 2031: determining the first service grid resource name corresponding to each of the first connectivity paths.
[0135] In an embodiment of the present application, the service grid resource name may be a service function name of a target service grid system, and the service grid resource name may correspond to a functional service in the target service grid system. Since each first connectivity path corresponds to a functional service, each first connectivity path may correspond to a first service grid resource name. The first service grid resource name may be included in the service request header of the action node in the first connectivity path. In the code, it may be embodied in the form of a function name.
[0136] Sub-step 2032: Match the first service grid resource name with the standard resource name to obtain a first matching result.
[0137] In an embodiment of the present application, the first service grid resource name can be matched with the standard resource name, so that a first matching result can be obtained. The standard resource name can be preset manually. The first matching result can include an exact match and a regular match. The exact match can mean that the first service grid name is the same as the standard resource name, and the regular match can mean that the first service grid name is different from the standard resource name and satisfies the regular expression corresponding to the standard resource name. The regular expression corresponding to the standard resource name can be preset manually.
[0138] Sub-step 2033: determining a test priority of each of the first connection paths based on the first matching result.
[0139] In an embodiment of the present application, the test priority of each first communication path may be determined according to the first matching result, wherein the test priority may correspond to the order in which the first communication paths are tested, and the ones with higher priority may be tested first.
[0140] Optionally, sub-step 2033 may include the following sub-steps:
[0141] Sub-step B1: when the first matching result is an exact match, determining the test priority of the first communication path to be a first priority.
[0142] In an embodiment of the present application, if the first matching result is an exact match, it can be determined that the test priority of the first connectivity path corresponding to the first matching result is the first priority.
[0143] Sub-step B2: when the first matching result is a regular match, determining the test priority of the first connection path to be a second priority; wherein the second priority is lower than the first priority.
[0144] In an embodiment of the present application, if the first matching result is a regular match, it can be determined that the test priority of the first connection path corresponding to the first matching result is the second priority, wherein the second priority may be lower than the first priority.
[0145] Sub-step B3: if there are at least two second communication paths in the first communication path whose first matching results are both exact matches or both regular matches, and the standard resource names corresponding to the second communication paths are the same, determine the creation time of the second communication paths.
[0146] In an embodiment of the present application, if in the first connection path, there are at least two second connection paths whose first matching results with the standard resource name are both exact matches or both regular matches, and the standard resource names corresponding to the second connection paths are the same, the creation time of each second connection path can be further determined.
[0147] Sub-step B4, determining the test priority of the second communication path with an earlier creation time as the third priority, and determining the test priority of the second communication path with a later creation time as the fourth priority; wherein the third priority is higher than the fourth priority.
[0148] In the embodiment of the present application, the test priority of the second connectivity path with an earlier creation time can be determined as the third priority, and the priority with a later creation time can also be determined as the fourth priority, wherein the third priority can be higher than the fourth priority. The third priority and the fourth priority are the next level priorities of the first priority or the second priority.
[0149] For example, if there is a third communication path with a first priority and a fourth priority, and a fourth communication path with a second priority and a third priority, when testing, the third communication path is tested first, and then the fourth communication path is tested.
[0150] In an embodiment of the present application, when the first matching result is an exact match, the test priority of the first connectivity path is determined to be the first priority, and when the first matching result is a regular match, the test priority of the first connectivity path is determined to be the second priority; wherein the second priority is lower than the first priority, in the first connectivity path, there are at least two second connectivity paths whose first matching results are both exact matches or both regular matches, and the standard resource names corresponding to the second connectivity paths are the same, the creation time of the second connectivity path is determined, and the test priority of the second connectivity path with an earlier creation time is determined to be the third priority, and the test priority of the second connectivity path with a later creation time is determined to be the fourth priority; wherein the third priority is higher than the fourth priority, and the test priorities of each first connectivity path can be divided according to the first matching result and the order of the creation time, so that the test result can be more organized and logical, which is easy for testers to debug according to the test results, and can further improve the convenience and operability of the target service grid system.
[0151] Sub-step 2034: input each of the first test service requests into the target service grid system from the input ports corresponding to each of the first test service requests in descending order of the test priority, to obtain each of the first test service results output by the target service grid system.
[0152] In an embodiment of the present application, each first test service request can be input into the target service grid system from the input port corresponding to each first test service request in order of test priority from high to low, so that each first test service result output by the target service grid system can be obtained.
[0153] In an embodiment of the present application, by determining the first service grid resource name corresponding to each first connectivity path, the first service grid resource name is matched with the standard resource name to obtain a first matching result, and based on the first matching result, the test priority of each first connectivity path is determined, and in descending order of test priority, each first test service request is input into the target service grid system from the input port corresponding to each first test service request to obtain each first test service result output by the target service grid system. The first connectivity path can be tested according to the test priority of the first connectivity path, so that the first test service result has a high degree of organization and logic, which is convenient for testers to debug the target service grid system according to the test results, and can improve the convenience and operability of the target service grid system to a certain extent.
[0154] Step 204: determining first input message information corresponding to each of the first connection paths based on first satisfiability modulo theoretical conditions corresponding to each of the first conditional nodes in each of the first connection paths.
[0155] In an embodiment of the present application, a symbolic execution method may be used to generate first input message information corresponding to each first connectivity path through first satisfiability modulo theoretical conditions corresponding to each first conditional node in the first connectivity path. The content contained in the first input message information is the same as the first service request configuration information, but the data format is different. The input message may be in text format. The first service request configuration information may be in the form of a registration table.
[0156] Step 205: determining first modification functions corresponding to each of the first communication paths based on the message modification actions corresponding to each of the action nodes in each of the first communication paths.
[0157] In an embodiment of the present application, a message modification action may refer to an action node processing action on data, that is, a process of converting an input signal into an output signal. The modification function may be obtained based on the association between the input signal and the output signal. For example, if the input signal is a character and the output signal is a number, the modification function may be an encoding function. On this basis, a symbolic execution method may be used to determine the first modification functions corresponding to each first connectivity path, based on the message modification actions corresponding to each action node in the first connectivity path. In the first connectivity path, multiple modification functions may be included, and these modification functions may be combined and connected in sequence to realize the service of the first connectivity path.
[0158] Step 206: Determine the service reference results corresponding to each of the first connection paths based on the first input message information and the first modification function.
[0159] In an embodiment of the present application, the symbolic execution method can derive service reference results corresponding to each first connectivity path according to the first input message information and the first modification function.
[0160] In an embodiment of the present application, by determining the first input message information corresponding to each first connectivity path based on the first satisfiability modulo theoretical conditions corresponding to each first conditional node in each first connectivity path, determining the first modification function corresponding to each first connectivity path based on the message modification action corresponding to each action node in each first connectivity path, and determining the service reference result corresponding to each first connectivity path based on the first input message information and the first modification function, the service reference result corresponding to each first connectivity path can be obtained according to the first input message information and the first modification function through a symbolic execution method, thereby improving the accuracy and reliability of the service reference result to a certain extent.
[0161] Step 207: When each of the first test service results matches the service reference results corresponding to each of the first connection paths, it is determined that the target service grid system test has passed.
[0162] In an embodiment of the present application, if each first test service result matches the service reference result corresponding to each first connectivity path, it can be determined that the target service grid system test has passed.
[0163] Reference Figure 3 , Figure 3 A logical block diagram of a service grid test prediction device for resource decoupling provided in an embodiment of the present application, the device 300 may include:
[0164] A first determining module 301 is used to determine a first connected path from an input port to an output port in a target service grid system;
[0165] A generating module 302, configured to generate first test service requests corresponding to each of the first communication paths;
[0166] An input module 303, configured to input each of the first test service requests into the target service grid system from an input port corresponding to each of the first test service requests, to obtain each of the first test service results output by the target service grid system;
[0167] The second determination module 304 is configured to determine that the target service grid system test has passed if each of the first test service results matches the service reference results respectively corresponding to each of the first connection paths.
[0168] Optionally, the device 300 further includes:
[0169] A third determining module, configured to determine first input message information corresponding to each of the first connecting paths based on first satisfiability modulus theoretical conditions corresponding to each of the first conditional nodes in each of the first connecting paths;
[0170] A fourth determining module, configured to determine first modification functions respectively corresponding to each of the first communication paths based on the message modification actions respectively corresponding to each of the action nodes in each of the first communication paths;
[0171] A fifth determining module is configured to determine the service reference results corresponding to the first connection paths based on the first input message information and the first modification function.
[0172] Optionally, the first determining module 301 includes:
[0173] A first determination submodule, used to determine a first control flow graph of a target service grid system;
[0174] A second determination submodule, used to determine the first service request configuration information of each second action node and the second satisfiability modulus theoretical condition of each second condition node included in the first control flow graph;
[0175] The third determination submodule is used to determine a first connectivity path from the input port to the output port in the target service grid system based on the first service request configuration information and the second satisfiability model theoretical condition.
[0176] Optionally, the third determining submodule includes:
[0177] A first determining unit, configured to determine, based on the first service request configuration information, each input port of the target service grid system and each output port corresponding to each input port;
[0178] A second determining unit is used to determine, based on the second satisfiability modulo theory condition, a third action node and a third condition node between the input port and the output port corresponding to the input port, and an upstream and downstream relationship corresponding to the third action node and the third condition node respectively;
[0179] The first connecting unit is used to connect the input port, the output port corresponding to the input port, the third action node and the third condition node based on the upstream and downstream relationship to obtain a first connecting path.
[0180] Optionally, the third determining submodule includes:
[0181] A fourth determining unit, configured to determine, based on the first service request configuration information, each input port of the target service grid system and each output port corresponding to each input port;
[0182] a fifth determining unit, configured to determine, based on a symbolic execution method, from the second action nodes and the second condition nodes, respectively, fourth action nodes and fourth condition nodes corresponding to the respective input ports;
[0183] The second connection unit is used to connect the input port, the output port corresponding to the input port, the fourth action node and the fourth condition node in the order of the fourth action node and the fourth condition node based on the symbolic execution method to obtain a first connection path.
[0184] Optionally, the generating module 302 includes:
[0185] a fourth determining submodule, configured to determine, from the action nodes respectively included in the first communication paths, the second service request configuration information respectively corresponding to the first communication paths;
[0186] The generating submodule is used to generate first test service requests corresponding to each of the first communication paths based on each of the second service request configuration information.
[0187] Optionally, the input module 303 includes:
[0188] A fifth determining submodule, configured to determine a first service grid resource name corresponding to each of the first connectivity paths;
[0189] A matching submodule, used to match the first service grid resource name with the standard resource name to obtain a first matching result;
[0190] a sixth determining submodule, configured to determine a test priority of each of the first connecting paths based on the first matching result;
[0191] The input submodule is used to input each of the first test service requests into the target service grid system from the input ports corresponding to each of the first test service requests in the order of the test priority from high to low, so as to obtain each of the first test service results output by the target service grid system.
[0192] Optionally, the sixth determining submodule includes:
[0193] a sixth determining unit, configured to determine, when the first matching result is an exact match, that the test priority of the first connectivity path is a first priority;
[0194] A seventh determining unit is configured to determine, when the first matching result is a regular match, that the test priority of the first connection path is a second priority; wherein the second priority is lower than the first priority.
[0195] Optionally, the device 300 further includes:
[0196] a sixth determination module, configured to determine the creation time of the second communication path when, in the first communication path, there are at least two second communication paths whose first matching results are both exact matches or both regular matches, and the standard resource names corresponding to the second communication paths are the same;
[0197] The seventh determination module is used to determine that the test priority of the second communication path with an earlier creation time is the third priority, and determine that the test priority of the second communication path with a later creation time is the fourth priority; wherein the third priority is higher than the fourth priority.
[0198] The resource-decoupled service grid test prediction device in the embodiment of the present application can be an electronic device or a component in an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices other than a terminal. Exemplarily, the electronic device can be a GPUBOX, a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc. It can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.
[0199] The resource decoupling-oriented service grid test prediction device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, a Linux operating system, a Windows operating system, etc., or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0200] The service grid test prediction device for resource decoupling provided in the embodiment of the present application can achieve Figure 1 to Figure 2 To avoid repetition, the various processes implemented by the method embodiment are not described here.
[0201] The present application embodiment provides an electronic device, see Figure 4 The electronic device 40 includes: a processor 401, a memory 402, and a computer program 4021 stored in the memory 402 and executable on the processor 401. When the processor 401 executes the program, the service grid test prediction method for resource decoupling of the aforementioned embodiment is implemented.
[0202] An embodiment of the present application also provides a computer-readable storage medium on which a computer program / instruction is stored. When the computer program / instruction is executed by a processor, the steps in the service grid test prediction method for resource decoupling disclosed in the embodiment of the present application are implemented.
[0203] The embodiment of the present application also provides a computer program product, which, when running on an electronic device, enables a processor to implement the steps in the service grid test prediction method for resource decoupling disclosed in the embodiment of the present application.
[0204] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0205] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, devices, electronic devices, and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0206] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0207] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0208] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.
[0209] Finally, 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 terminal 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 terminal device. In the absence of further restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0210] The above is a detailed introduction to a service grid test prediction method for resource decoupling provided by the present application. This article uses specific examples to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A service grid test prediction method for resource decoupling, characterized in that: The method comprises: Determine a first connectivity path from the input port to the output port in the target service grid system; generating first test service requests corresponding to each of the first communication paths; Inputting each of the first test service requests into the target service grid system from an input port corresponding to each of the first test service requests, to obtain each of the first test service results output by the target service grid system; In a case where each of the first test service results matches a service reference result respectively corresponding to each of the first connection paths, determining that the target service grid system test passes; The step of inputting each of the first test service requests into the target service grid system from an input port corresponding to each of the first test service requests to obtain each of the first test service results output by the target service grid system includes: Determine a first service grid resource name corresponding to each of the first connectivity paths; Matching the first service grid resource name with the standard resource name to obtain a first matching result; Determining a test priority of each of the first connectivity paths based on the first matching result; In the order of the test priority from high to low, each of the first test service requests is input into the target service grid system from the input port corresponding to each of the first test service requests, so as to obtain each of the first test service results output by the target service grid system.
2. The method according to claim 1, characterized in that The method further comprises: Determine first input message information corresponding to each of the first connection paths based on first satisfiability modulo theory conditions corresponding to each of the first conditional nodes in each of the first connection paths; Determine first modification functions corresponding to each of the first communication paths based on the message modification actions corresponding to each of the action nodes in each of the first communication paths; The service reference results corresponding to each of the first connection paths are determined based on the first input message information and the first modification function.
3. The method according to claim 1, characterized in that The determining a first connectivity path from an input port to an output port in the target service grid system includes: Determine a first control flow graph of the target service grid system; Determine first service request configuration information of each second action node and second satisfiability modulo theoretical condition of each second condition node included in the first control flow graph; Based on the first service request configuration information and the second satisfiability model theoretical condition, a first connectivity path from an input port to an output port in the target service grid system is determined.
4. The method according to claim 3, characterized in that The determining, based on the first service request configuration information and the second satisfiability model theoretical condition, a first connectivity path from an input port to an output port in the target service grid system includes: Determine, based on the first service request configuration information, each input port of the target service grid system and each output port corresponding to each input port; Based on the second satisfiability modulo theory condition, determine a third action node and a third condition node between the input port and the output port corresponding to the input port, and upstream and downstream relationships corresponding to the third action node and the third condition node respectively; Based on the upstream and downstream relationship, the input port, the output port corresponding to the input port, the third action node and the third condition node are connected to obtain a first connection path.
5. The method according to claim 3, characterized in that: The determining, based on the first service request configuration information and the second satisfiability model theoretical condition, a first connectivity path from an input port to an output port in the target service grid system includes: Determine, based on the first service request configuration information, each input port of the target service grid system and each output port corresponding to each input port; Based on the symbolic execution method, determining the fourth action node and the fourth condition node corresponding to each of the input ports from the second action node and the second condition node respectively; Based on the symbolic execution method, the input port, the output port corresponding to the input port, the fourth action node and the fourth condition node are connected in sequence to obtain a first connected path.
6. The method according to claim 1, characterized in that The generating of first test service requests corresponding to the first communication paths respectively includes: Determining second service request configuration information corresponding to each of the first communication paths from action nodes respectively included in each of the first communication paths; Based on each of the second service request configuration information, a first test service request corresponding to each of the first communication paths is generated.
7. The method according to claim 1, characterized in that The determining, based on the first matching result, a test priority of each of the first connectivity paths includes: When the first matching result is an exact match, determining the test priority of the first connection path to be a first priority; When the first matching result is a regular match, the test priority of the first connection path is determined to be a second priority; wherein the second priority is lower than the first priority.
8. The method according to claim 7, characterized in that The method further comprises: In the first communication path, if there are at least two second communication paths whose first matching results are both exact matches or both regular matches, and the standard resource names corresponding to the second communication paths are the same, determining the creation time of the second communication paths; The test priority of the second communication path created earlier is determined to be the third priority, and the test priority of the second communication path created later is determined to be the fourth priority; wherein the third priority is higher than the fourth priority.
9. A service grid test prediction device for resource decoupling, characterized in that: The device comprises: A first determination module, configured to determine a first connectivity path from an input port to an output port in a target service grid system; A generating module, configured to generate first test service requests corresponding to each of the first connecting paths; An input module, used to input each of the first test service requests into the target service grid system from an input port corresponding to each of the first test service requests, to obtain each of the first test service results output by the target service grid system; A second determination module, configured to determine that the target service grid system test has passed if each of the first test service results matches a service reference result corresponding to each of the first connection paths; Wherein, the input module is specifically used for: Determine a first service grid resource name corresponding to each of the first connectivity paths; Matching the first service grid resource name with the standard resource name to obtain a first matching result; Determining a test priority of each of the first connectivity paths based on the first matching result; In the order of the test priority from high to low, each of the first test service requests is input into the target service grid system from the input port corresponding to each of the first test service requests, so as to obtain each of the first test service results output by the target service grid system.
Citation Information
Patent Citations
Micro-service application oriented failure test tool and method
CN110262972A
Service path performance test method and device
CN111884872A