Service Mesh Test Flow Generation Method and Device for Large-Scale Data Center Networks
By building an end-to-end service test flow skeleton of the service mesh system, the path explosion problem caused by symbol execution is solved, the testing efficiency and accuracy are improved, and the stability and reliability of the test flow are ensured.
Patent Information
- Application Number
- CN202510238073.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-03
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2045-03-03
AI Technical Summary
In the prior art, the symbol execution method has a path explosion problem in the service mesh system testing, resulting in low testing efficiency and accuracy.
By generating the end-to-end service test flow skeleton of the service mesh system, including the node metadata information and connector fields of the service item node, the test flow is constructed based on the service interaction relationship to avoid path explosion problems.
Improve the efficiency and accuracy of service mesh system testing, ensure that the test flow does not affect each other, and improve the stability and reliability of the test.
Smart Images

Figure CN119766708B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of software testing, and particularly to a service mesh test flow generation method and device for large-scale data center networks. Background Art
[0002] Service mesh is an important representative software for large-scale data center networks. Operations and maintenance personnel only need to provide several lines of configuration files to complete complex and advanced application layer network functions. Since service mesh controls service traffic and affects the accuracy and performance of the entire application, with the rapid development and increasing popularity of service mesh systems, higher requirements are put forward for the reliability of service mesh. Therefore, it is necessary to test the service mesh system to ensure the stability and reliability of service mesh.
[0003] In related technologies, the service mesh system can be tested by symbolic execution. Symbolic execution uses symbolic values as inputs instead of the specific values used when generally executing a program. When reaching the target code to be tested, the analyzer can obtain the corresponding path constraints, and then use a constraint solver to obtain the specific values that can trigger the target code. Finally, the test results are obtained according to the specific values.
[0004] However, using symbolic execution to test the service mesh system will have a path explosion problem because each service item has a large number of detailed rule options, and the combination of these resources will exponentially increase the input space, resulting in low efficiency and accuracy of service mesh testing. Summary of the Invention
[0005] In view of the above problems, embodiments of the present application provide a service mesh test flow generation method, device, electronic device, and readable storage medium for large-scale data center networks to overcome or at least partially solve the above problems.
[0006] In a first aspect, embodiments of the present application provide a service mesh test flow generation method for large-scale data center networks, and the method includes:
[0007] Generating an end-to-end service test flow skeleton for the target service mesh system based on each first service item included in the target service mesh system and the service interaction relationships between the first service items;
[0008] Generating first connector fields corresponding to each connection edge included in the end-to-end service test flow skeleton based on the service interaction relationships;
[0009] Generating node metadata information corresponding to each first service item node included in the end-to-end service test flow skeleton;
[0010] Generate the target end-to-end service test flow of the target service mesh system based on the node metadata information, the first connector field, and the end-to-end service test flow skeleton.
[0011] Optionally, generating the end-to-end service test flow skeleton of the target service mesh system based on each first service item included in the target service mesh system and the service interaction relationships between the first service items includes:
[0012] Create service test directed connections between the first service items based on the service interaction relationships between the first service items included in the target service mesh system;
[0013] Query the first input end and the first output end from the first service items based on the service test directed connections;
[0014] Generate the end-to-end service test flow skeleton of the target service mesh system based on the first input end, the first output end, and the service test directed connections.
[0015] Optionally, querying the first input end and the first output end from the first service items based on the service test directed connections includes:
[0016] Randomly select from the first service items to obtain a second service item;
[0017] Determine the first service item type of the second service item;
[0018] When the first service item type is not the input type or the output type, based on the service test directed connections, determine the third service item pointing to the second service item and the fourth service item pointed to by the second service item from the first service items;
[0019] Determine the second service item type of the third service item and the third service item type of the fourth service item;
[0020] When the second service item type is the input type, determine the third service item as the first input end;
[0021] When the third service item type is the output type, determine the fourth service item as the first output end.
[0022] Optionally, the method further includes:
[0023] When the first service item type is not the input type and there is no fifth service item pointing to the second service item in the first service items, based on the service interaction relationship, determine that the service interaction type is the sixth service item pointing to the second service item;
[0024] When the fourth service item type of the sixth service item is an input type, determine the sixth service item as the first input end.
[0025] Optionally, the method further includes:
[0026] When the first service item type is not an output type and there is no seventh service item pointed to by the second service item in the first service item, determine the service interaction type as the eighth service item pointed to by the second service item based on the service interaction relationship;
[0027] When the fifth service item type of the eighth service item is an output type, determine the eighth service item as the first output end.
[0028] Optionally, generating the first connector field corresponding to each connection edge included in the end-to-end service test flow skeleton based on the service interaction relationship includes:
[0029] Determine the first host name and the first port number of the first input end in the end-to-end service test flow skeleton;
[0030] Based on the service interaction relationship, send the first host name and the first port number to each connection edge included in the end-to-end service test flow skeleton to obtain the first connector field corresponding to each connection edge.
[0031] Optionally, the node metadata information includes service type information and service name information. Generating the node metadata information corresponding to each first service item node included in the end-to-end service test flow skeleton includes:
[0032] Generate the service type information corresponding to each first service item node included in the end-to-end service test flow skeleton based on the first string matching rule, and generate the service name information corresponding to each first service item node included in the end-to-end service test flow skeleton based on the second string matching rule; wherein, both the first string matching rule and the second string matching rule include at least one of exact matching, prefix matching, and regular expression matching.
[0033] Optionally, the first host name includes a wildcard.
[0034] Optionally, there is no field conflict between the node metadata information and the first connector field.
[0035] In a second aspect, an embodiment of the present application provides a service mesh test flow generation device for a large-scale data center network. The device includes:
[0036] A first generation module, configured to generate an end-to-end service test flow skeleton of the target service mesh system based on each first service item included in the target service mesh system and the service interaction relationships between the first service items;
[0037] A second generation module, configured to generate first connector fields respectively corresponding to each connection edge included in the end-to-end service test flow skeleton based on the service interaction relationships;
[0038] A third generation module, configured to generate node metadata information respectively corresponding to each first service item node included in the end-to-end service test flow skeleton;
[0039] A fourth generation module, configured to generate a target end-to-end service test flow of the target service mesh system based on the node metadata information, the first connector fields, and the end-to-end service test flow skeleton.
[0040] Optionally, the first generation module includes:
[0041] A creation sub-module, configured to create a service test directed connection between the first service items based on the service interaction relationships between the first service items included in the target service mesh system;
[0042] A query sub-module, configured to query a first input end and a first output end from the first service items based on the service test directed connection;
[0043] A first generation sub-module, configured to generate an end-to-end service test flow skeleton of the target service mesh system based on the first input end, the first output end, and the service test directed connection.
[0044] Optionally, the query sub-module includes:
[0045] An extraction unit, configured to randomly extract from the first service items to obtain a second service item;
[0046] A first determination unit, configured to determine a first service item type of the second service item;
[0047] A second determination unit, configured to, when the first service item type is not an input type or an output type, determine a third service item pointing to the second service item and a fourth service item pointed to by the second service item from the first service items based on the service test directed connection;
[0048] A third determination unit, configured to determine a second service item type of the third service item and a third service item type of the fourth service item;
[0049] A fourth determination unit, configured to determine the third service item as a first input end when the second service item type is an input type;
[0050] A fifth determination unit, configured to determine the fourth service item as a first output end when the third service item type is an output type.
[0051] Optionally, the apparatus further includes:
[0052] A first determination module, configured to determine, when the first service item type is not an input type and there is no fifth service item pointing to the second service item in the first service item, a service interaction type as a sixth service item pointing to the second service item based on the service interaction relationship;
[0053] A second determination module, configured to determine the sixth service item as the first input end when the fourth service item type of the sixth service item is an input type.
[0054] Optionally, the apparatus further includes:
[0055] A third determination module, configured to determine, when the first service item type is not an output type and there is no seventh service item pointed to by the second service item in the first service item, a service interaction type as an eighth service item pointed to by the second service item based on the service interaction relationship;
[0056] A fourth determination module, configured to determine the eighth service item as the first output end when the fifth service item type of the eighth service item is an output type.
[0057] Optionally, the second generation module includes:
[0058] A first determination sub-module, configured to determine a first host name and a first port number of a first input end in the end-to-end service test flow skeleton;
[0059] A distribution sub-module, configured to distribute the first host name and the first port number to each connection edge included in the end-to-end service test flow skeleton based on the service interaction relationship, to obtain first connector fields respectively corresponding to the connection edges.
[0060] Optionally, the node metadata information includes service type information and service name information, and the third generation module includes:
[0061] A second generation sub-module, configured to generate the service type information corresponding to each first service item node included in the end-to-end service test flow skeleton based on a first string matching rule, and generate the service name information corresponding to each first service item node included in the end-to-end service test flow skeleton based on a second string matching rule; wherein, both the first string matching rule and the second string matching rule include at least one of exact matching, prefix matching, and regular expression matching.
[0062] Optionally, the first host name includes a wildcard character.
[0063] Optionally, there is no field conflict between the node metadata information and the first connector field.
[0064] In a third aspect, an embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored on the memory, where the processor executes the computer program to implement the service mesh test flow generation method for a large-scale data center network as described in any one of the above.
[0065] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the service mesh test flow generation method for a large-scale data center network as described in any one of the above is implemented.
[0066] Specific beneficial effects are as follows:
[0067] In the embodiments of the present application, based on each first service item included in the target service mesh system and the service interaction relationships between each first service item, an end-to-end service test flow skeleton of the target service mesh system is generated. Based on the service interaction relationships, first connector fields corresponding to each connection edge included in the end-to-end service test flow skeleton are generated. Node metadata information corresponding to each first service item node included in the end-to-end service test flow skeleton is generated. Based on the node metadata information, the first connector fields, and the end-to-end service test flow skeleton, a target end-to-end service test flow of the target service mesh system is generated. An end-to-end service test flow skeleton can be generated according to the first service items included in the target service mesh system and the service interaction relationships between each first service item, and first connector fields corresponding to each connection edge in the test flow skeleton can be generated according to the service interaction relationships. Node metadata information corresponding to each first service item node in the test flow skeleton can be generated. Finally, a target end-to-end service test flow of the target service mesh system can be generated according to the node metadata information, the first connector fields, and the end-to-end service test flow skeleton. The directivity between each service item can be accurately obtained, the path explosion problem generated by symbolic execution can be avoided, and test flows without service interaction do not affect each other. Therefore, when the target end-to-end service test flow is used to test the target service mesh system, the efficiency and accuracy of the service mesh system test can be improved. Description of the Drawings
[0068] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0069] Figure 1 is a schematic flowchart of a method for generating a service mesh test flow for a large-scale data center network provided by an embodiment of the present application;
[0070] Figure 2 is a schematic flowchart of another method for generating a service mesh test flow for a large-scale data center network provided by an embodiment of the present application;
[0071] Figure 3 is a logical block diagram of a service mesh test flow generation device for a large-scale data center network provided by an embodiment of the present application;
[0072] Figure 4 is a schematic diagram of an electronic device provided by an embodiment of the present application. Detailed Embodiments
[0073] The exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings in the embodiments of the present application. Although the exemplary embodiments of the present application are shown in the 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 so that the present application can be more thoroughly understood and the scope of the present application can be fully conveyed to those skilled in the art.
[0074] Referring to Figure 1 , Figure 1 FIG. is a schematic flowchart of a service mesh test flow generation method for a large-scale data center network provided by an embodiment of the present application. The method includes:
[0075] Step 101: Generate an end-to-end service test flow skeleton of the target service mesh system based on each first service item included in the target service mesh system and the service interaction relationships between the first service items.
[0076] In an embodiment of the present application, a service mesh is a way to handle service communication in a microservices architecture. It is an infrastructure layer located between services that can provide functions such as service discovery and load balancing, traffic control and timeout handling, security and authentication, monitoring and authentication, etc. The operating environment of the service mesh can be a kubernetes (k8s) cluster in the Kind software. Correspondingly, the execution environment of the service mesh test prediction method of the present application can be the same as the operating environment of the service mesh. The service mesh can include two parts of components, namely the data plane and the control plane. The data plane processes 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 policies of the service mesh and is responsible for service discovery, routing rules, security settings, etc. The target service mesh system can be a service mesh system to be detected. In the target service mesh system, there can be multiple input ports and multiple output ports for performing different types of communication services. In the target service mesh system, there can be multiple first service items, and there are service interaction relationships between the first service items. This service interaction relationship is directed and indicates the data flow direction between the service items. An end-to-end service test flow skeleton of the target service mesh system can be generated based on each first service item included in the target service mesh system and the service interaction relationships between the first service items. Among them, the end-to-end service test flow skeleton can be a framework capable of carrying data flow. Multiple service item nodes and multiple connection edges can be included in the end-to-end service test flow skeleton. Among them, the service item nodes correspond one-to-one with the first service items, and the connection edges can be directed edges and can be used to connect different service item nodes.
[0077] Step 102: Based on the service interaction relationship, generate first connector fields corresponding to each connection edge included in the end-to-end service test flow skeleton.
[0078] In an embodiment of the present application, a connector is a new communication method between the user space and the kernel space, and it is very convenient to use. Essentially, a connector is a netlink, and its netlink protocol number is NETLINK_CONNECTOR. Compared with a general netlink, it provides an easier-to-use interface and is more convenient to use. Connector fields generally refer to a set of relevant information used to define various attributes and behaviors of a connector during its design, configuration, or use. Through connector fields, the functions, performance, and applicable scope of a connector can be defined. The first connector fields corresponding to each connection edge included in the end-to-end service test flow skeleton can be generated according to the service interaction relationship between each first service item. For the same end-to-end service test flow skeleton, the connection edges inside it can correspond to the same connector fields to implement data flow between service item nodes in the skeleton in hardware. In an embodiment of the present application, connector fields may include, but are not limited to, a host name field and a port number field.
[0079] Step 103: Generate node metadata information corresponding to each first service item node included in the end-to-end service test flow skeleton.
[0080] In an embodiment of the present application, the end-to-end service test flow skeleton may include multiple first service item nodes. First, the types of description information required for these first service item nodes can be defined, that is, the metadata information types (such as node types and node names). Then, the node metadata information corresponding to each first service item node can be generated to describe each first service item node.
[0081] Step 104: Based on the node metadata information, the first connector fields, and the end-to-end service test flow skeleton, generate a target end-to-end service test flow for the target service mesh system.
[0082] In an embodiment of the present application, a target end-to-end service test flow for the target service mesh system can be generated according to the node metadata information, the first connector fields, and the end-to-end service test flow skeleton. Among them, the node metadata information and the first connector fields can be directly added to the end-to-end service test flow skeleton. The node metadata information corresponds to the service item nodes, and the first connector fields correspond to the connection edges. The target end-to-end service test flow can be embodied in the form of a functional function in the code. When executing the target end-to-end service test flow, the functional function corresponding to the target end-to-end service test flow can be called and input data information can be given, so that the target service mesh system can be tested.
[0083] In an embodiment of the present application, an end-to-end service test flow skeleton of the target service mesh system is generated based on each first service item included in the target service mesh system and the service interaction relationships between the first service items. Based on the service interaction relationships, first connector fields corresponding to each connection edge included in the end-to-end service test flow skeleton are generated. Node metadata information corresponding to each first service item node included in the end-to-end service test flow skeleton is generated. Based on the node metadata information, the first connector fields, and the end-to-end service test flow skeleton, an end-to-end service test flow of the target service mesh system is generated. An end-to-end service test flow skeleton can be generated according to the first service items included in the target service mesh system and the service interaction relationships between the first service items, and first connector fields corresponding to each connection edge in the test flow skeleton can be generated according to the service interaction relationships. Node metadata information corresponding to each first service item node in the test flow skeleton can be generated. Finally, an end-to-end service test flow of the target service mesh system can be generated according to the node metadata information, the first connector fields, and the end-to-end service test flow skeleton. The directivity between each service item can be accurately obtained, the path explosion problem generated by symbolic execution can be avoided, and test flows without service interaction do not affect each other. Therefore, when using the end-to-end service test flow to test the target service mesh system, the efficiency and accuracy of the service mesh system test can be improved.
[0084] Refer to Figure 2 , Figure 2 FIG. is a schematic flow chart of another service mesh test flow generation method for a large-scale data center network provided by an embodiment of the present application. The method may include:
[0085] Step 201, create a service test directed connection between the first service items based on the service interaction relationships between the first service items included in the target service mesh system.
[0086] In an embodiment of the present application, the service interaction relationships among the first service items can be represented by an adjacency matrix, where the row numbers and column numbers of the adjacency matrix can each correspond to different first service items. If there is a directed service relationship between two first service items, the matrix element corresponding to the two first service items is 1, otherwise it is 0. Since the service interaction relationship is directed, at most only one of the two matrix elements corresponding to the two first service items can have a value of 0. For example, if Aij = 1, it indicates that there is a service interaction relationship from the first service item i to the first service item j. At this time, Aji = 0. In this way, the service interaction relationships among the first service items included in the target service grid system can be obtained through the adjacency matrix, and then service test directed connections among the first service items can be created according to this interaction relationship. Among them, the service format directed connection can be reflected in the code in the form of reference or being referenced. For example, if service item B references service item A, it means that the service test directed connection between A and B is from A to B.
[0087] Step 202, based on the service test directed connection, query for a first input end and a first output end from the first service items.
[0088] In an embodiment of the present application, a first input end and a first output end can be queried from the first service items according to the service test directed connection among the first service items. Among them, the first service item serving as the first input end may not have a preceding item, that is, there is no other first service item pointing to the first input end; the first service item serving as the first output end may not have a succeeding item, that is, there is no other first service item pointed to by the first output end. The first input end and the first output end can also have specific port identifiers. A first service item can be randomly selected from the first service items, and then, according to the service test directed connection, query upward and downward in sequence. When a first service item with the above specific port identifier is found, the first service item with the above specific port identifier can be determined as the first input end or the first output end. The port identifiers respectively possessed by the first input end and the first output end can be different.
[0089] Optionally, step 202 may include the following sub-steps:
[0090] Sub-step 20201, randomly extract from the first service items to obtain a second service item.
[0091] In an embodiment of the present application, random extraction can be performed from the first service items, so that a second service item can be obtained. Among them, the number of second service items can be one or more.
[0092] Sub-step 20202, determine the first service item type of the second service item.
[0093] In an embodiment of the present application, after the second service item is extracted, the first service item type of the second service item can be determined. The first service item type can include an input type, an output type, and other types, which can be determined by whether a specific port identifier is included in the second service item. For example, the port identifier of the input type can be the string "entry", and the port identifier of the output type can be the string "exit".
[0094] Sub-step 20203, in the case where the first service item type is not the input type or the output type, based on the service test directed connection, determine a third service item pointing to the second service item and a fourth service item pointed to by the second service item from the first service items.
[0095] In an embodiment of the present application, if the first service item type is not the input type or the output type, then according to the service test directed connection between the first service items, a third service item pointing to the second service item and a fourth service item pointed to by the second service item can be determined from the first service items.
[0096] Sub-step 20204, determine the second service item type of the third service item and the third service item type of the fourth service item.
[0097] In an embodiment of the present application, after the third service item and the fourth service item are obtained, the second service item type of the third service item and the third service item type of the fourth service item can be determined.
[0098] Sub-step 20205, in the case where the second service item type is the input type, determine the third service item as the first input end.
[0099] In an embodiment of the present application, if the second service item type is the input type, the third service item can be determined as the first input end. At this time, no other first service items pointing to the third service item will be searched further.
[0100] Sub-step 20206, in the case where the third service item type is the output type, determine the fourth service item as the first output end.
[0101] In the ratings of the present application, if the third service item type is the output type, the fourth service item can be determined as the first output end. At this time, no other first service items pointed to by the fourth service item will be searched further.
[0102] In an embodiment of the present application, by randomly selecting from the first service items, a second service item is obtained, and the first service item type of the second service item is determined. When the first service item type is not the input type or the output type, based on the service test directed connection, a third service item pointing to the second service item and a fourth service item pointed to by the second service item are determined from the first service items. The second service item type of the third service item and the third service item type of the fourth service item are determined. When the second service item type is the input type, the third service item is determined as the first input end. When the third service item type is the output type, the fourth service item is determined as the first output end. The first input end and the first output end can be searched and obtained starting from any one of the first service items, which can improve the convenience of querying the first input end and the first output end to a certain extent.
[0103] Sub-step 20207, when the first service item type is not the input type and there is no fifth service item pointing to the second service item in the first service items, based on the service interaction relationship, determine that the service interaction type is a sixth service item pointing to the second service item.
[0104] In an embodiment of the present application, if the first service item type is not the input type and there is no fifth service item pointing to the second service item in the first service items, it can be considered that there is an omission in the construction process of the end-to-end service test flow. In this case, according to the service interaction relationship between each first service item, it is determined that the service interaction type is a sixth service item pointing to the second service item.
[0105] For example, if the service interaction relationship between the sixth service item and the second service item is represented by matrix elements, its representation form can be Amn = 1, where m represents the sixth service item and n represents the second service item.
[0106] Sub-step 20208, when the fourth service item type of the sixth service item is the input type, determine the sixth service item as the first input end.
[0107] In an embodiment of the present application, the fourth service item type of the sixth service item can be determined first. If the fourth service item type of the sixth service item is the input type, the sixth service item can be determined as the first input end. If the fourth service item type is not the input type, other first service items pointing to the sixth service item can be continuously searched until a first service item with the service item type of the input type is found.
[0108] In an embodiment of the present application, when the first service item type is not the input type and there is no fifth service item pointing to the second service item in the first service item, based on the service interaction relationship, it is determined that the service interaction type is the sixth service item pointing to the second service item. When the fourth service item type of the sixth service item is the input type, the sixth service item is determined as the first input end. When searching for the first input end according to the service test directed connection is abnormal, the qualified sixth service item can be queried according to the service interaction relationship as the first input end, which can, to a certain extent, avoid the problem of the failure of creating the end-to-end service test flow skeleton caused by the abnormality of the service test directed connection, and improve the accuracy and reliability of the first input end.
[0109] Sub-step 20209, when the first service item type is not the output type and there is no seventh service item pointed to by the second service item in the first service item, based on the service interaction relationship, it is determined that the service interaction type is the eighth service item pointed to by the second service item.
[0110] In the ratings of the present application, if the first service item type is not the output type and there is no seventh service item pointed to by the second service item in the first service item, it can be considered that there is an omission in the construction process of the end-to-end service test flow. In this case, according to the service interaction relationship between each first service item, it is determined that the service interaction type is the eighth service item pointed to by the second service item.
[0111] For example, if the service interaction relationship between the eighth service item and the second service item is represented by matrix elements, its representation form can be Axy = 1, where x represents the second service item and y represents the eighth service item.
[0112] Sub-step 20210, when the fifth service item type of the eighth service item is the output type, the eighth service item is determined as the first output end.
[0113] In an embodiment of the present application, the fifth service item type of the eighth service item can be determined first. If the fifth service item type is the output type, the eighth service item can be determined as the first output end. If the fifth service item type is not the output type, other first service items pointed to by the eighth service item can be continuously searched until a first service item with the service item type of the output type is found.
[0114] In an embodiment of the present application, when the type of the first service item is not the output type and the seventh service item pointed to by the second service item does not exist in the first service item, based on the service interaction relationship, the service interaction type is determined to be the eighth service item pointed to by the second service item. When the fifth service item type of the eighth service item is the output type, the eighth service item is determined as the first output end. When there is an abnormality in finding the first output end according to the service test directed connection, the qualified eighth service item can be queried according to the service interaction relationship as the first output end, which can, to a certain extent, avoid the problem of the failure of creating the end-to-end service test flow skeleton caused by the abnormality of the service test directed connection, and improve the accuracy and reliability of the first output end.
[0115] Step 203: Generate the end-to-end service test flow skeleton of the target service mesh system based on the first input end, the first output end, and the service test directed connection.
[0116] In an embodiment of the present application, the end-to-end service test flow skeleton of the target service mesh system can be generated according to the first input end, the first output end, and the service test directed connection. The end-to-end service test flow skeleton can include multiple service item nodes and multiple connection edges, where the connection edges are used to connect the service item nodes. The end-to-end service test flow skeleton can start from the first input end and end at the first output end, and other first service items can be distributed between the first input end and the first output end according to the service test directed connection.
[0117] In an embodiment of the present application, by creating the service test directed connection between each first service item based on the service interaction relationship between each first service item included in the target service mesh system, querying the first input end and the first output end from the first service item based on the service test directed connection, and generating the end-to-end service test flow skeleton of the target service mesh system based on the first input end, the first output end, and the service test directed connection, an end-to-end service test flow skeleton with the first input end and the first output end can be obtained, which can, to a certain extent, improve the stability and reliability of the end-to-end service test flow skeleton.
[0118] Step 204: Determine the first host name and the first port number of the first input end in the end-to-end service test flow skeleton.
[0119] In an embodiment of the present application, the first host name and the first port number of the first input end of the end-to-end service test flow skeleton can be determined. The first host name and the first port number can usually be set manually and can be used as the inherent attributes of the first input end.
[0120] Optionally, the first host name contains a wildcard.
[0121] In an embodiment of the present application, it is possible to allow the use of wildcards to replace certain fields in the first host name. If the host name is a server domain name, it is possible to allow the first segment field of the server domain name to be a wildcard. For example, the first host name can be "***.host.com", where the symbol "***" is a wildcard.
[0122] Step 205: Based on the service interaction relationship, send the first host name and the first port number to each connection edge included in the end-to-end service test flow skeleton to obtain the first connector fields respectively corresponding to each connection edge.
[0123] In an embodiment of the present application, according to the service interaction relationship between each first service item, the first host name and the first port number can be sent to each connection edge included in the end-to-end service test flow skeleton, so that the first connector fields respectively corresponding to each connection edge can be obtained. Among them, the first connector field can include the first host name and the first port number. After the end-to-end service test flow skeleton has a unified first connector field, data can flow normally in the hardware corresponding to the end-to-end service test flow skeleton.
[0124] In an embodiment of the present application, by determining the first host name and the first port number of the first input end in the end-to-end service test flow skeleton, and based on the service interaction relationship, sending the first host name and the first port number to each connection edge included in the end-to-end service test flow skeleton to obtain the first connector fields respectively corresponding to each connection edge, the first host name and the first port number can be sent as the first connector fields to each connection edge, which can improve the reliability and stability of the first connector field to a certain extent.
[0125] Step 206: Based on the first string matching rule, generate the service type information respectively corresponding to each first service item node included in the end-to-end service test flow skeleton, and based on the second string matching rule, generate the service name information respectively corresponding to each first service item node included in the end-to-end service test flow skeleton; wherein, both the first string matching rule and the second string matching rule include at least one of exact matching, prefix matching, and regular expression matching.
[0126] In an embodiment of the present application, the string matching problem is to search for all occurrences of a certain string P in a large string T, and the search rule is the string matching rule. In the embodiment of the present application, the node metadata information may include two categories: service type information and service name information. Among them, the service type information may correspond to the first string matching rule, and the service name information may correspond to the second string matching rule. The service type information corresponding to each first service item node included in the end-to-end service test flow skeleton can be generated according to the first string matching rule. These service type information all satisfy the first string matching rule and can be attributed to the same functional service. The service name information corresponding to each first service item node in the end-to-end service test flow skeleton can also be generated according to the second string matching rule. These service name information satisfy the second string matching rule and can be attributed to the same functional service. The first string matching rule and the second string matching rule may include at least one of exact matching, prefix matching, and regular expression matching. The first string matching rule and the second string matching rule may be the same or different.
[0127] In an embodiment of the present application, by generating the service type information corresponding to each first service item node included in the end-to-end service test flow skeleton based on the first string matching rule, and generating the service name information corresponding to each first service item node included in the end-to-end service test flow skeleton based on the second string matching rule; wherein, both the first string matching rule and the second string matching rule include at least one of exact matching, prefix matching, and regular expression matching. The service type information and service name information corresponding to each first service item node included in the end-to-end service test flow skeleton can be generated according to the first string matching rule and the second string matching rule, which can avoid generating messy service type information and service name information, improve the stability of the service type information and service name information to a certain extent, and improve the reliability of the finally obtained target end-to-end service test flow.
[0128] Step 207: Generate the target end-to-end service test flow of the target service mesh system based on the node metadata information, the first connector field, and the end-to-end service test flow skeleton.
[0129] In an embodiment of the present application, the implementation content of this step may refer to the embodiment content of step 104 and will not be elaborated here.
[0130] Optionally, there is no field conflict between the node metadata information and the first connector field.
[0131] In the embodiments of the present application, field conflict detection can be performed on node metadata information and the first connector field. Usually, the first connector field can have a specific format and value range, while the node metadata needs to avoid the above format and value range. At the same time, there are other possible conflicts. For example, when the communication protocol is set to the DNS mode, the first connector field cannot contain wildcards. If the node metadata information and the first connector field meet the above conditions, it can be considered that there is no field conflict between the node metadata xnxi and the first connector field. This can effectively improve the robustness of the target service mesh system.
[0132] Referring to Figure 3 , Figure 3 FIG. is a logical block diagram of a service mesh test flow generation device for a large-scale data center network provided by an embodiment of the present application. The device 300 may include:
[0133] A first generation module 301, configured to generate an end-to-end service test flow skeleton of the target service mesh system based on each first service item included in the target service mesh system and the service interaction relationship between the first service items;
[0134] A second generation module 302, configured to generate a first connector field corresponding to each connection edge included in the end-to-end service test flow skeleton based on the service interaction relationship;
[0135] A third generation module 303, configured to generate node metadata information corresponding to each first service item node included in the end-to-end service test flow skeleton;
[0136] A fourth generation module 304, configured to generate a target end-to-end service test flow of the target service mesh system based on the node metadata information, the first connector field, and the end-to-end service test flow skeleton.
[0137] Optionally, the first generation module 301 includes:
[0138] A creation sub-module, configured to create a service test directed connection between the first service items based on the service interaction relationship between the first service items included in the target service mesh system;
[0139] A query sub-module, configured to query a first input end and a first output end from the first service items based on the service test directed connection;
[0140] A first generation sub-module, configured to generate an end-to-end service test flow skeleton of the target service mesh system based on the first input end, the first output end, and the service test directed connection.
[0141] Optionally, the query sub-module includes:
[0142] An extraction unit for randomly extracting from the first service item to obtain a second service item;
[0143] A first determination unit for determining the first service item type of the second service item;
[0144] A second determination unit for, when the first service item type is not the input type or the output type, determining, based on the service test directed connection, a third service item pointing to the second service item and a fourth service item pointed to by the second service item from the first service item;
[0145] A third determination unit for determining the second service item type of the third service item and the third service item type of the fourth service item;
[0146] A fourth determination unit for, when the second service item type is the input type, determining the third service item as the first input end;
[0147] A fifth determination unit for, when the third service item type is the output type, determining the fourth service item as the first output end.
[0148] Optionally, the apparatus 300 further includes:
[0149] A first determination module for, when the first service item type is not the input type and there is no fifth service item in the first service item pointing to the second service item, determining, based on the service interaction relationship, that the service interaction type is a sixth service item pointing to the second service item;
[0150] A second determination module for, when the fourth service item type of the sixth service item is the input type, determining the sixth service item as the first input end.
[0151] Optionally, the apparatus 300 further includes:
[0152] A third determination module for, when the first service item type is not the output type and there is no seventh service item in the first service item pointed to by the second service item, determining, based on the service interaction relationship, that the service interaction type is an eighth service item pointed to by the second service item;
[0153] A fourth determination module for, when the fifth service item type of the eighth service item is the output type, determining the eighth service item as the first output end.
[0154] Optionally, the second generation module 302 includes:
[0155] A first determination sub-module, configured to determine a first host name and a first port number of a first input end in the end-to-end service test flow skeleton;
[0156] A distribution sub-module, configured to distribute the first host name and the first port number to each connection edge included in the end-to-end service test flow skeleton based on the service interaction relationship, so as to obtain first connector fields respectively corresponding to the connection edges.
[0157] Optionally, the node metadata information includes service type information and service name information, and the third generation module 303 includes:
[0158] A second generation sub-module, configured to generate the service type information respectively corresponding to each first service item node included in the end-to-end service test flow skeleton based on a first string matching rule, and generate the service name information respectively corresponding to each first service item node included in the end-to-end service test flow skeleton based on a second string matching rule; wherein, both the first string matching rule and the second string matching rule include at least one of exact matching, prefix matching, and regular expression matching.
[0159] Optionally, the first host name includes a wildcard.
[0160] Optionally, there is no field conflict between the node metadata information and the first connector field.
[0161] The service mesh test flow generation device for a large-scale data center network in the embodiments of the present application may be an electronic device or a component in an electronic device, such as an integrated circuit or a chip. The electronic device may be a terminal or other devices other than a terminal. Exemplarily, the electronic device may be a GPU BOX, a mobile phone, a tablet computer, a laptop computer, a handheld computer, a vehicle-mounted electronic device, a Mobile Internet Device (MID), an augmented reality (AR) / virtual reality (VR) device, a robot, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc., and may also be a server, a Network Attached Storage (NAS), a personal computer (PC), a television (TV), a teller machine, or a self-service machine, etc., which is not specifically limited in the embodiments of the present application.
[0162] The service mesh test flow generation device for large-scale data center networks in the embodiments of the present application can be a device with an operating system. The operating system can be the Android operating system, can be the Linux or Windows operating system, etc., and can also be other possible operating systems, which are not specifically limited in the embodiments of the present application.
[0163] The service mesh test flow generation device for large-scale data center networks provided by the embodiments of the present application can implement Figures 1 to 2 each process implemented by the method embodiments. To avoid repetition, details are not described herein again.
[0164] The embodiments of the present application provide an electronic device. Referring to Figure 4 , the electronic device 40 includes: a processor 401, a memory 402, and a computer program 4021 stored on the memory 402 and executable on the processor 401. When the processor 401 executes the program, it implements the service mesh test flow generation method for large-scale data center networks in the foregoing embodiments.
[0165] The embodiments of the present application also provide a computer-readable storage medium, on which computer programs / instructions are stored. When the computer programs / instructions are executed by a processor, the steps in the service mesh test flow generation method disclosed in the embodiments of the present application are implemented.
[0166] The embodiments of the present application also provide a computer program product. When the computer program product runs on an electronic device, it causes the processor to implement the steps in the service mesh test flow generation method disclosed in the embodiments of the present application when executed.
[0167] Each embodiment in this specification is described in a progressive manner. The key point of each embodiment is to illustrate the differences from other embodiments. The same or similar parts among the embodiments can be referred to each other.
[0168] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of 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 block in the flowcharts and / or block diagrams, and the combination of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal devices generate for implementing in the process Figure 1 one process or multiple processes and / or blocks Figure 1a device for the functions specified in one or more boxes.
[0169] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal device to work in a specific manner, such that the instructions stored in the computer-readable memory produce a manufactured article including an instruction device that implements the functions specified in one Figure 1 process or more processes and / or boxes Figure 1 a box or more boxes.
[0170] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device, such that a series of operation steps are executed on the computer or other programmable terminal device to produce a computer-implemented process. Thus, the instructions executed on the computer or other programmable terminal device provide steps for implementing the functions specified in one Figure 1 process or more processes and / or boxes Figure 1 a box or more boxes.
[0171] Although the preferred embodiments of the embodiments of the present application have been described, those skilled in the art can make additional changes and modifications once they learn the basic creative concepts. Therefore, the appended claims are intended to be construed to include the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present application.
[0172] Finally, it should also be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article or terminal device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or terminal device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article or terminal device including the said element.
[0173] The above has introduced in detail a service mesh test flow generation method for large-scale data center networks provided by this application. Specific examples are used in this article to elaborate on the principle and implementation manner of this application. The description of the above embodiments is only used to help understand the method and its core idea of this application; at the same time, for those of ordinary skill in the art, according to the idea of this application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to this application.
Claims
1. A service mesh test flow generation method for large-scale data center networks, characterized in that The method includes: Generating an end-to-end service test flow skeleton for the target service mesh system based on each first service item included in the target service mesh system and the service interaction relationships between the first service items; Generating first connector fields corresponding to each connection edge included in the end-to-end service test flow skeleton based on the service interaction relationships; Generating node metadata information corresponding to each first service item node included in the end-to-end service test flow skeleton; Generating a target end-to-end service test flow for the target service mesh system based on the node metadata information, the first connector fields, and the end-to-end service test flow skeleton; The generating an end-to-end service test flow skeleton for the target service mesh system based on each first service item included in the target service mesh system and the service interaction relationships between the first service items includes: Creating service test directed connections between the first service items based on the service interaction relationships between the first service items included in the target service mesh system; Querying a first input end and a first output end from the first service items based on the service test directed connections; Generating an end-to-end service test flow skeleton for the target service mesh system based on the first input end, the first output end, and the service test directed connections; The querying a first input end and a first output end from the first service items based on the service test directed connections includes: Randomly extracting from the first service items to obtain a second service item; Determining the first service item type of the second service item; When the first service item type is not the input type or the output type, determining a third service item pointing to the second service item and a fourth service item pointed to by the second service item from the first service items based on the service test directed connections; Determining the second service item type of the third service item and the third service item type of the fourth service item; When the second service item type is the input type, determining the third service item as the first input end; When the third service item type is the output type, determining the fourth service item as the first output end.
2. The method according to claim 1, characterized in that, The method further includes: When the first service item type is not the input type and there is no fifth service item pointing to the second service item in the first service items, determining a sixth service item pointing to the second service item as the service interaction type based on the service interaction relationships; When the fourth service item type of the sixth service item is the input type, determining the sixth service item as the first input end.
3. The method according to claim 2, characterized in that, The method further includes: When the first service item type is not the output type and there is no seventh service item pointed to by the second service item in the first service items, determining an eighth service item pointed to by the second service item as the service interaction type based on the service interaction relationships; When the fifth service item type of the eighth service item is the output type, determining the eighth service item as the first output end.
4. The method according to claim 1, characterized in that, Generating the first connector fields corresponding to the respective connection edges included in the end-to-end service test flow skeleton based on the service interaction relationship includes: Determining the first host name and the first port number of the first input end in the end-to-end service test flow skeleton; Based on the service interaction relationship, sending the first host name and the first port number to each connection edge included in the end-to-end service test flow skeleton to obtain the first connector fields corresponding to the respective connection edges.
5. The method according to claim 1 or 4, characterized in that The node metadata information includes service type information and service name information. Generating the node metadata information corresponding to the respective first service item nodes included in the end-to-end service test flow skeleton includes: Generating the service type information corresponding to the respective first service item nodes included in the end-to-end service test flow skeleton based on a first string matching rule, and generating the service name information corresponding to the respective first service item nodes included in the end-to-end service test flow skeleton based on a second string matching rule; wherein, both the first string matching rule and the second string matching rule include at least one of exact matching, prefix matching, and regular expression matching.
6. The method according to claim 4, wherein The first host name contains a wildcard.
7. The method according to claim 1, wherein There is no field conflict between the node metadata information and the first connector fields.
8. A service mesh test flow generation device for a large-scale data center network, characterized in that The apparatus includes: A first generation module, configured to generate an end-to-end service test flow skeleton of the target service mesh system based on each first service item included in the target service mesh system and the service interaction relationship between the respective first service items; A second generation module, configured to generate the first connector fields corresponding to the respective connection edges included in the end-to-end service test flow skeleton based on the service interaction relationship; A third generation module, configured to generate the node metadata information corresponding to the respective first service item nodes included in the end-to-end service test flow skeleton; A fourth generation module, configured to generate a target end-to-end service test flow of the target service mesh system based on the node metadata information, the first connector fields, and the end-to-end service test flow skeleton; The first generation module is specifically configured to create a service test directed connection between the respective first service items based on the service interaction relationship between the respective first service items included in the target service mesh system; querying a first input end and a first output end from the first service items based on the service test directed connection; and generating an end-to-end service test flow skeleton of the target service mesh system based on the first input end, the first output end, and the service test directed connection; Based on the service test for the directed connection, querying the first input end and the first output end from the first service item includes: randomly extracting from the first service item to obtain a second service item; determining the first service item type of the second service item; in the case where the first service item type is not the input type or the output type, based on the service test for the directed connection, determining from the first service item a third service item pointing to the second service item and a fourth service item pointed to by the second service item; determining the second service item type of the third service item and the third service item type of the fourth service item; in the case where the second service item type is the input type, determining the third service item as the first input end; in the case where the third service item type is the output type, determining the fourth service item as the first output end.
Citation Information
Patent Citations
Resource decoupling-oriented service grid test oracle method and device
CN119377084A