Node graph test method and device, computer equipment and storage medium

By copying and building test graphs of nodes to be tested in the DPDK Node Graph package processing architecture, the problem of poor testing in the existing technology is solved, and accurate testing and fault location of nodes to be tested is realized.

CN119561826AActive Publication Date: 2025-03-04CHINA TELECOM CLOUD TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411759900.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-03
Publication Date
2025-03-04
Estimated Expiration
2044-12-03

AI Technical Summary

Technical Problem

In the prior art, when testing the DPDK Node Graph package processing architecture, integration tests have problems with poor testing and it is difficult to accurately locate nodes.

Method used

By copying the node to be tested, a special test diagram is constructed, and the test data packet is input into the test diagram for testing processing, and the test results of the node to be tested are obtained.

Benefits of technology

Focusing on a single node avoids the problem of high overall architecture coupling, improves the accuracy of problem positioning, and helps quickly troubleshoot and repair faults.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119561826A_ABST
    Figure CN119561826A_ABST
Patent Text Reader

Abstract

The invention relates to a node graph test method and device, computer equipment and a storage medium, and the method comprises the steps: obtaining a test data packet, carrying out the copying of a to-be-tested node in a node graph packet processing architecture, constructing a test graph according to the to-be-tested node, inputting the test data packet into the test graph, and carrying out the test processing. And obtaining a test result of the to-be-tested node. According to the method, the to-be-tested node in the node graph package processing architecture is subjected to independent copying processing, and the special test graph is constructed based on the to-be-tested node to carry out testing, so that the testing can be focused on a single node, and the problem that the testing efficiency is high due to high overall architecture coupling in a traditional testing method is effectively solved. And the problem of one node may be interfered by other nodes and is difficult to accurately position. And when the test result is abnormal, it can be determined that the function, logic or processing flow of the node to be tested has problems, so that the accuracy of problem positioning is greatly improved, and rapid troubleshooting and fault repair are facilitated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a node graph testing method, device, computer equipment and storage medium. Background Art

[0002] In the field of data communication, with the continuous development of network technology, the requirements for the efficiency and flexibility of data packet processing are increasing. DPDK (Data Plane Development Kit) is a collection of function libraries and drivers that can quickly process network data packets. Under this architecture, each node is responsible for processing specific tasks. Nodes can define their own successor nodes, and then use edges to connect multiple nodes into a graph to form a complete processing flow.

[0003] Compared with traditional packet processing, this packet processing architecture can more effectively improve the hit rate of processor instruction and data cache and reduce memory latency; it is also conducive to the use of vectorized instructions to implement performance optimization.

[0004] However, in the prior art, when testing the DPDK Node Graph packet processing architecture, an integration test is usually used to test the entire system, but this integration test has the problem of poor testing. Summary of the invention

[0005] Based on this, it is necessary to provide a node graph testing method, device, computer equipment and storage medium that can solve the above-mentioned technical problems.

[0006] In a first aspect, the present application provides a node graph testing method. The method comprises:

[0007] Get the test data package;

[0008] For the nodes to be tested in the node graph package processing architecture, the nodes to be tested are copied and processed, and a test graph is constructed according to the nodes to be tested;

[0009] Input the test data packet into the test graph for test processing to obtain the test result of the node to be tested.

[0010] In one embodiment, the step of constructing a test graph according to the nodes to be tested includes:

[0011] Create an input node;

[0012] Perform functional replication on the node to be tested to obtain a cloned node, and set the cloned node as the successor node of the input node;

[0013] A plurality of detection nodes are created according to the cloned node, and each detection node is set as a successor node of the cloned node to obtain a test graph.

[0014] In one embodiment, the step of inputting the test data packet into the test graph for test processing to obtain the test result of the node to be tested includes:

[0015] Inputting the test data packet into the input node for preprocessing to obtain a preprocessed test data packet;

[0016] The pre-processed test data packet is input into the clone node for test processing and data update processing to obtain the target test data;

[0017] The target test data is input into each detection node for data content comparison processing to obtain the test result of the node to be tested.

[0018] In one embodiment, the preprocessed test data includes a preprocessed data packet and preprocessed metadata; the target test data includes a target data packet and target metadata; the preprocessed test data packet is input into the clone node for test processing and data update processing to obtain the target test data, including:

[0019] The pre-processed data packet is input into the clone node for test processing to obtain the target data packet; the clone node has different test types and corresponding test processing;

[0020] The preprocessed metadata is subjected to data update processing to obtain target metadata; the data update processing includes processing progress update and status mark update.

[0021] In one embodiment, the test results of the node to be tested include path test results, data packet test results and metadata test results; the target test data is input into each detection node for data content comparison processing to obtain the test results of the node to be tested, including:

[0022] Compare the node identification of the detection node with the node identification of the expected flow node to obtain the path test result;

[0023] Input the target data packet into the detection node, and compare the target data packet with the expected data packet obtained in advance through the detection node to obtain the data packet test result;

[0024] The target metadata is input into the detection node, and the detection node compares the target metadata with the expected metadata acquired in advance to obtain the metadata test result.

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

[0026] Create a discard node;

[0027] The discarded node is determined as a successor node of the plurality of detected nodes.

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

[0029] Transmitting data packets from each detection node to a discarding node;

[0030] The memory release processing is performed on the data packets of each detection node through the detection node discarding node to obtain the memory release result.

[0031] In a second aspect, the present application also provides a node graph testing device. The device comprises:

[0032] A data packet acquisition module, used to acquire a test data packet;

[0033] A test graph construction module is used to copy the nodes to be tested in the node graph package processing architecture and construct a test graph based on the nodes to be tested;

[0034] The test module is used to input the test data packet into the test graph for test processing to obtain the test result of the node to be tested.

[0035] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:

[0036] Get the test data package;

[0037] For the nodes to be tested in the node graph package processing architecture, the nodes to be tested are copied and processed, and a test graph is constructed according to the nodes to be tested;

[0038] Input the test data packet into the test graph for test processing to obtain the test result of the node to be tested.

[0039] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0040] Get the test data package;

[0041] For the nodes to be tested in the node graph package processing architecture, the nodes to be tested are copied and processed, and a test graph is constructed according to the nodes to be tested;

[0042] Input the test data packet into the test graph for test processing to obtain the test result of the node to be tested.

[0043] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0044] Get the test data package;

[0045] For the nodes to be tested in the node graph package processing architecture, the nodes to be tested are copied and processed, and a test graph is constructed according to the nodes to be tested;

[0046] Input the test data packet into the test graph for test processing to obtain the test result of the node to be tested.

[0047] The above-mentioned node graph test method, device, computer equipment and storage medium obtain a test data packet, copy and process the node to be tested in the node graph packet processing architecture, and build a test graph based on the node to be tested, input the test data packet into the test graph for test processing, and obtain the test result of the node to be tested. The present application can focus the test on a single node by separately copying and processing the node to be tested in the node graph packet processing architecture, and building a special test graph based on the node to be tested to carry out testing, effectively avoiding the situation in traditional testing methods where the problem of one node may be interfered with by other nodes and difficult to accurately locate due to the high coupling of the overall architecture. When an abnormal test result occurs, it can be clearly stated that there is a problem with the function, logic or processing flow of the node to be tested itself, which greatly improves the accuracy of problem location and helps to quickly troubleshoot and repair faults. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 An application environment diagram of a node graph testing method in an embodiment;

[0049] Figure 2 A schematic diagram of a process flow of a node graph testing method in one embodiment;

[0050] Figure 3 A schematic diagram of a process of constructing a test graph according to nodes to be tested in one embodiment;

[0051] Figure 4 A schematic diagram of the structure of a test diagram in an embodiment;

[0052] Figure 5 A schematic diagram of a test process in one embodiment;

[0053] Figure 6 A schematic diagram of a flow chart of testing and data updating in one embodiment;

[0054] Figure 7 A schematic diagram of a flow chart of data content comparison processing in one embodiment;

[0055] Figure 8 A schematic diagram of a process of creating a discarded node in one embodiment;

[0056] Fig. 9It is a structural schematic diagram of a test chart in another embodiment;

[0057] Fig.10 A schematic diagram of a process of releasing memory in one embodiment;

[0058] Fig.11 is a structural block diagram of a node graph testing device in one embodiment;

[0059] Fig.12 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0060] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0061] First of all, before specifically introducing the technical solution of the embodiments of the present application, the technical background based on the embodiments of the present application is introduced.

[0062] Based on this, the present application provides a node graph testing method, apparatus, computer device and storage medium, aiming to solve the above technical problems.

[0063] The node graph testing method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the cloud computing data center network 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. The server 104 is usually equipped with a high-performance Ethernet card. The cloud computing data center network 102 obtains a test data packet, copies the node to be tested in the node graph packet processing architecture, and constructs a test graph according to the node to be tested, inputs the test data packet into the test graph for test processing, and obtains the test result of the node to be tested. Among them, the cloud computing data center network 102 can be but is not limited to virtual switches, gateways, firewalls and other products, and the server 104 can be implemented with an independent server or a server cluster consisting of multiple servers.

[0064] In an exemplary embodiment, Figure 2 As shown, a node graph testing method is provided, which is applied to Figure 1 The cloud computing data center network in the example is used to illustrate the process, which includes the following steps:

[0065] S201, obtaining a test data packet.

[0066] Among them, the test data packet is a set of data packets specially prepared for testing the node under test in the node graph packet processing architecture. The format, content and related attributes of these data packets are constructed or selected according to the expected processing scenarios and functional requirements of the node under test, and are used to simulate the real data packet situation that may be input to the node under test in actual operation.

[0067] In an embodiment of the present application, first, the various types of information that the test data packet needs to cover are determined based on the functional positioning of the node to be tested in the node graph packet processing architecture and the actual application scenario. For example, if the node to be tested is responsible for the forwarding function of the network data packet, then the test data packet should contain common network data packet information such as source address, destination address, protocol type, etc. Then, a data packet that meets the above requirements is selected as a test data packet through a data generation tool or from an existing data packet sample library. During the selection process, different parameter value combinations can be set as needed to cover a variety of input situations that the node to be tested may encounter, such as different source address ranges, multiple protocol types, etc.

[0068] S202, for the nodes to be tested in the node graph package processing architecture, copy the nodes to be tested, and build a test graph according to the nodes to be tested.

[0069] The node to be tested is a specific node in the node graph package processing architecture that needs to be tested to verify whether its function is normal and whether it meets the expected processing requirements.

[0070] The DPDK Node Graph packet processing architecture is a graphical data processing architecture based on nodes and edges, which is used to process data packets. In this architecture, each node undertakes different specific tasks, such as data packet classification, forwarding, filtering, etc. Nodes are connected by edges to determine the flow path of data packets between nodes, thereby realizing a complete data packet processing process.

[0071] In an embodiment of the present application, the cloud computing data center network utilizes the node replication function provided by the node graph package processing architecture or adopts related programming technical means to completely replicate the selected node to be tested, thereby obtaining a replicated node that is completely identical to the original node to be tested in terms of functional characteristics, processing logic, etc.

[0072] In addition to the conventional copying methods mentioned above, deep cloning technology can also be used to copy the nodes to be tested. Deep cloning not only copies the surface attributes and functional logic of the node, but also recursively copies all substructures, objects and their associations involved in the node. The resulting copied nodes can more accurately simulate the behavior of the original nodes to be tested in more complex node graph architectures, especially when the nodes to be tested contain multi-layer nested structures or complex object relationships. Deep cloning can ensure the integrity and accuracy of the copy.

[0073] Instead of creating a separate input node, you can use an existing node in the node graph packet processing architecture as an input node and modify its input configuration to enable it to receive and pass the test data packet and its related metadata. This method can make full use of existing architecture resources and reduce the work of creating additional nodes.

[0074] When determining the connection relationship between the copy node and the check node, a dynamic connection method is used according to the actual processing flow of the node to be tested and the different output branch situations that may occur. That is, instead of simply setting all the successor nodes of the copy node as check nodes, some successor nodes of the copy node are dynamically selected to be connected to the corresponding check nodes according to the specific needs and expected results of each test, and these connection relationships can be adjusted at any time. This can more flexibly adapt to different test scenarios and verification requirements for different output situations.

[0075] S203, input the test data packet into the test graph for test processing to obtain the test result of the node to be tested.

[0076] In an embodiment of the present application, the acquired test data packet is input into the constructed test graph through the input node according to the set format and relevant metadata requirements. The test data packet flows from the input node to the copy node, and the copy node processes the test data packet according to its functional characteristics that are the same as those of the original node to be tested, such as format conversion, data extraction, forwarding operations, etc., and the relevant metadata of the data packet may also be modified during the processing. The processed test data packet flows from the copy node to each inspection node, and key inspections are performed at each inspection node. Finally, the test status of the node to be tested is comprehensively judged based on the inspection results of each inspection node, and the corresponding test results are output.

[0077] Another implementation method: before inputting the test data packet into the test graph, the test data packet can be grouped and processed into several data packet groups with different characteristics or attributes. For example, the data packets are grouped according to the source address range, protocol type, etc. Then, the different data packet groups are input into the test graph in a certain order for test processing. During the circulation of each data packet group, the two key inspections of the inspection node mentioned above are also performed. However, when comprehensively judging the test status of the node to be tested, in addition to considering the individual inspection results of each data packet group, the differences in test results between different data packet groups can also be analyzed, so as to more comprehensively understand the performance and stability of the node to be tested when processing different types of data packets. In this way, possible problems of the node to be tested can be explored more deeply, and the accuracy and comprehensiveness of the test results can be improved.

[0078] The above-mentioned node graph testing method, for the node to be tested in the node graph package processing architecture, copies the node to be tested, builds a test graph based on the node to be tested, inputs the test data packet into the test graph for test processing, and obtains the test result of the node to be tested. The present application can focus the test on a single node by separately copying the node to be tested in the node graph package processing architecture, and building a special test graph based on the node to be tested to carry out testing, effectively avoiding the situation in traditional testing methods where the problem of one node may be interfered with by other nodes and difficult to accurately locate due to the high coupling of the overall architecture. When an abnormal test result occurs, it can be clearly stated that there is a problem with the function, logic or processing flow of the node to be tested itself, which greatly improves the accuracy of problem location and helps to quickly troubleshoot and repair faults.

[0079] In an exemplary embodiment, based on the above embodiment, see Figure 3 The embodiment of the present application relates to a process of constructing a test graph according to a node to be tested, comprising the following steps:

[0080] S301, creating an input node.

[0081] In the embodiment of the present application, an input node can be created through the node creation function provided by the relevant programming framework or library. For example, in some graphical programming-based environments, you can select the "Create Input Node" button or operation option on the operation interface, and then set some basic properties of the input node according to the prompts, such as the node name, the receivable data type, etc. When implemented at the code level, you can instantiate a node class specifically for input, and set the corresponding properties during the initialization process of the class, such as specifying that the data format it receives should match the prepared test data packet format so that the data packet can be received accurately.

[0082] S302 , performing function duplication processing on the node to be tested to obtain a cloned node, and setting the cloned node as a successor node of the input node.

[0083] In an embodiment of the present application, in some graphical node graph architecture platforms with a node copy function, the copy tool provided by the platform can be used directly to copy the selected node to be tested to obtain a cloned node. When implemented at the code level, for systems based on object-oriented programming, functional replication can be achieved through deep copy technology. For example, for a node class written in C++, if you want to copy the node to be tested, you can implement a custom deep copy method that recursively copies all properties, methods, and internal objects of the node object to ensure that the cloned node is fully consistent with the original node to be tested in function.

[0084] When setting the successor node, you can directly drag the output connection point of the input node to the input connection point of the clone node on the operation interface to complete the setting of the successor node relationship. When implementing at the code level, after creating the input node and the clone node, you can modify the successor node pointer (or similar attributes that represent the connection relationship) of the input node to point to the clone node, thereby establishing the correct connection relationship.

[0085] S303, creating multiple detection nodes according to the cloned node, and setting each detection node as a successor node of the cloned node to obtain a test graph.

[0086] In the embodiment of the present application, multiple detection nodes can be created by repeating the "create node" operation multiple times and setting the newly created node as the attribute of the detection node (such as by checking the "detect node" option in the node attribute setting interface). When implemented at the code level, multiple node classes specifically used for detection can also be instantiated, and the corresponding detection functions and attributes can be set during the class initialization process. For example, if a detection node is set to check the flow path of the data packet, a method can be defined in the class to compare whether the current node is the expected next flow node.

[0087] In the embodiment of the present application, by duplicating the functions of the node to be tested to obtain a cloned node and constructing a test graph with the cloned node as the core, the node to be tested can be isolated from the original node graph architecture for separate testing. This effectively avoids the interference of other nodes in the original architecture on the test, so that the functional characteristics of the node to be tested can be more accurately observed and evaluated during the test process. Once an abnormal test result occurs, it can be quickly determined that the problem is with the node to be tested itself, greatly improving the accuracy of problem location.

[0088] In an exemplary embodiment, based on the above embodiment, see Figure 5The embodiment of the present application relates to a process of inputting a test data packet into a test graph for test processing to obtain a test result of a node to be tested, including the following steps:

[0089] S401, input a test data packet into an input node for preprocessing to obtain a preprocessed test data packet.

[0090] In the embodiment of the present application, the prepared test data packet is first transmitted to the input node according to the input format and protocol requirements specified by the input node. After receiving the test data packet, the input node will start the preprocessing process. For example, the format integrity of the data packet is checked, the integrity and accuracy of the metadata is confirmed, and the sorting or conversion operation is performed.

[0091] S402, inputting the pre-processed test data packet into the clone node for test processing and data update processing to obtain target test data.

[0092] The embodiment of the present application transmits the pre-processed test data packet to the clone node according to the connection relationship set in the test diagram. After receiving the data packet, the clone node will perform test processing and test processing according to the same functional characteristics as the original node to be tested. For example, if the original node to be tested is a node responsible for the Layer 2 forwarding (L2Fwd) function, the clone node will also process the data packet according to the rules and logic of Layer 2 forwarding.

[0093] S403, input the target test data into each detection node for data content comparison processing to obtain the test result of the node to be tested.

[0094] In the embodiment of the present application, the target test data is sequentially transmitted to each detection node according to the connection relationship set in the test diagram. After receiving the target test data, each detection node will perform data content comparison processing.

[0095] The embodiment of the present application can ensure that the test data packet enters the subsequent test processing link in a suitable state through the preprocessing operation of the input node, avoiding test errors caused by problems such as incomplete data packet format or inaccurate metadata, thereby improving the initial accuracy of the test. The cloned node accurately replicates the functional characteristics of the node to be tested, and performs accurate test processing and data update processing on the preprocessed test data packet, so that the test can truly reflect the actual processing capacity of the node to be tested, further improving the accuracy of the test. The detection node conducts a comprehensive inspection of the output of the cloned node from multiple angles through strict data content comparison processing, and can accurately determine whether the processing of the node to be tested meets expectations, ensuring the accuracy of the test results.

[0096] In an exemplary embodiment, based on the above embodiment, see Figure 6The preprocessed test data of the embodiment of the present application includes a preprocessed data packet and preprocessed metadata; the target test data includes a target data packet and target metadata; the embodiment of the present application involves a process of inputting the preprocessed test data packet into a clone node for test processing and data update processing to obtain target test data, including the following steps:

[0097] S501, input the pre-processed data packet into the clone node for test processing to obtain a target data packet.

[0098] Among them, the test types of cloned nodes are different, and the corresponding test processing is different. The target data packet is the data packet obtained after the cloned node performs the corresponding test processing on the pre-processed data packet according to its test type. Its content may change differently due to different test types of cloned nodes (such as packet classification, forwarding, filtering, etc.). It is an important part of the target test data and is used for subsequent comparison and inspection with the expected data packet.

[0099] The embodiment of the present application transmits the pre-processed data packet to the clone node according to the connection relationship set in the test diagram. After receiving the data packet, the clone node will perform the corresponding test processing operation according to its pre-set test type.

[0100] If the test type of the cloned node is set to packet classification, it will classify the input pre-processed data packets according to the specific characteristics of the data packets (such as protocol type, source address, destination address, etc.). For example, for network data packets, the data packets are divided into different categories according to their protocol types (such as TCP, UDP, etc.) for subsequent targeted processing. During the classification process, some fields of the data packet may be marked or classification-related metadata may be added to clarify its category.

[0101] When the test type of the cloned node is Layer 2 forwarding, it will check the link layer related information of the data packet (such as source MAC address, destination MAC address, etc.) to determine whether forwarding is required and the forwarding target address. If the forwarding conditions are met, the cloned node will modify the link layer related fields of the data packet (such as updating the destination MAC address) so that it can be forwarded along the predetermined path and obtain the target data packet after Layer 2 forwarding processing.

[0102] S502, performing data update processing on the pre-processed metadata to obtain target metadata; the data update processing includes processing progress update and status mark update.

[0103] In the embodiment of the present application, while the clone node performs test processing on the pre-processed data packet, the pre-processed metadata is updated. When the processing progress is updated, the fields related to the processing progress in the metadata are updated according to the processing progress of the data packet in the clone node.

[0104] When the status mark is updated, the mark reflecting the processing status in the metadata is updated according to the processing result of the cloned node on the data packet. Taking Layer 2 forwarding as an example, if the cloned node completes the Layer 2 forwarding operation of the data packet, the "Has it been forwarded" mark in the metadata is changed from "No" to "True"; for packet classification operations, if the data packet has been successfully classified into a certain category, the value of the corresponding classification status mark in the metadata is updated to indicate the current processing status of the data packet.

[0105] The embodiment of the present application can accurately simulate the processing process of the data packet by the node to be tested in the actual operation scenario by performing targeted test processing on the preprocessed data packet according to different test types, ensuring that the obtained target data packet truly reflects the actual processing capability of the node to be tested, thereby improving the accuracy of the data packet processing capability test. The preprocessed metadata is subjected to detailed data update processing, including processing progress update and status mark update, so that the target metadata can accurately reflect the processing progress and status changes of the data packet during the clone node processing process, providing an accurate basis for the subsequent inspection of the detection node, and further improving the accuracy of the test.

[0106] In an exemplary embodiment, based on the above embodiment, see Figure 7 The test results of the node to be tested in the embodiment of the present application include path test results, data packet test results and metadata test results; the embodiment of the present application involves a process of inputting target test data into each detection node for data content comparison processing to obtain the test results of the node to be tested, including the following steps:

[0107] S601, compare the node identifier of the detection node with the node identifier of the expected flow node to obtain the path test result. The path test result reflects the judgment result of whether the data packet reaches each detection node according to the expected flow path after passing through the node to be tested (through clone node simulation processing). By comparing the actual node identifier of the detection node with the node identifier of the expected flow node, it is determined whether the data packet flows correctly between the nodes, so as to evaluate whether the impact of the node to be tested on the data packet flow path meets expectations.

[0108] In the embodiment of the present application, the node identifier of the detection node itself is compared one by one with the node identifier of the expected flow node obtained from the test case configuration. If the node identifier of the detection node completely matches the node identifier of one of the expected flow nodes, and the connection relationship between the detection node and the cloned node also meets the pre-set flow path requirements (for example, it is connected through a specific edge, and the connection order is correct), then it is determined that the data packet meets expectations in terms of the flow path, and the path test result is "passed"; otherwise, the path test result is determined to be "failed", and related error information is recorded, such as the actual node identifier, the expected node identifier, and the connection link that may have problems, etc., for subsequent analysis and troubleshooting.

[0109] S602, input the target data packet into the detection node, and compare the target data packet with the expected data packet acquired in advance through the detection node to obtain the data packet test result.

[0110] The packet test result is based on the comparison of the target packet (the packet processed by the cloned node) and the expected packet obtained in advance. It is used to determine whether the content of the packet (such as the source address, destination address, protocol type and other specific data fields) has changed as expected when the node under test processes the packet, or whether the correctness of the packet content is maintained (in some cases, such as the packet content should remain unchanged during forwarding operations), thereby measuring the accuracy of the packet content processing by the node under test.

[0111] The embodiment of the present application compares the parsed target data packet with the expected data packet in detail. The content of the comparison includes each specific data field of the data packet, such as whether the source address is the same, whether the destination address is the same, whether the protocol type is the same, etc. If all the compared fields are completely consistent with the corresponding fields of the expected data packet, then the data packet test result is determined to be "passed"; otherwise, the data packet test result is determined to be "failed", and relevant error information is recorded, such as which fields are inconsistent, the actual value of the target data packet, and the corresponding value of the expected data packet, etc., for subsequent analysis and troubleshooting.

[0112] S603, inputting the target metadata into the detection node, and performing a comparison process on the target metadata and the expected metadata acquired in advance by the detection node to obtain a metadata test result.

[0113] The metadata test result is obtained by comparing the target metadata (metadata after cloning nodes and metadata update) with the expected metadata obtained in advance. It is used to evaluate whether the use, modification or transmission of metadata (such as the identification, processing status, source and other related auxiliary information of the data packet) of the node under test is in line with expectations during the data packet processing, so as to judge the accuracy of metadata processing of the node under test.

[0114] The embodiment of the present application compares the parsed target metadata with the expected metadata in detail. The content of the comparison includes various fields of the metadata, such as whether the identifier of the data packet is the same, whether the processing status is the same, whether the source is the same, etc. If all the compared fields are completely consistent with the corresponding fields of the expected metadata, then the metadata test result is determined to be "passed"; otherwise, the metadata test result is determined to be "failed", and relevant error information is recorded, such as which fields are inconsistent, the actual value of the target metadata, and the corresponding value of the expected metadata, etc., for subsequent analysis and troubleshooting.

[0115] In an exemplary embodiment, based on the above embodiment, see Figure 8 , the method of the embodiment of the present application further includes the following steps:

[0116] S701, creating a discard node.

[0117] In an embodiment of the present application, in a test graph environment constructed based on the node to be tested, the discarded nodes that need to be created are determined according to the overall architecture design of the test graph and the requirements for memory management.

[0118] S702: Determine the discarded node as a successor node of the plurality of detection nodes.

[0119] After the discarded nodes are created, the embodiment of the present application needs to establish a correct connection relationship between them and the detection node, that is, determine them as the successor nodes of the detection node.

[0120] The embodiment of the present application can ensure that the data packet and metadata release the occupied memory space in time after completing the test-related processing by creating a discard node and determining it as the successor node of the detection node. Whether it is in accordance with the conventional fixed connection setting method or the dynamic connection setting method, it can effectively avoid the memory leakage problem, so that the memory resources of the test environment are always kept in a reasonable utilization state, and the memory management efficiency in the entire test process is improved.

[0121] In an exemplary embodiment, based on the above embodiment, see Fig.10 , the method of the embodiment of the present application further includes the following steps:

[0122] S801, transmitting the data packets of each detection node to the discarding node.

[0123] In the embodiment of the present application, when constructing the test graph, the successor node of each detection node has been explicitly set as the discard node created. When the detection node completes its own detection task, it directly passes the processed data packet to the discard node through the communication mechanism between nodes (such as function call, message passing, etc., depending on the implementation technology of the test graph).

[0124] S802, performing memory release processing on the data packet of the detection node through the discarding node to obtain a memory release result.

[0125] In the embodiment of the present application, when memory release is required, a main control node may send a memory release instruction to a discarding node.

[0126] In an exemplary embodiment, based on the above embodiment, the method of the embodiment of the present application includes the following steps:

[0127] Step 1: Obtain a test data packet; for the node to be tested in the node graph packet processing architecture, copy the node to be tested;

[0128] Step 2: Create an input node; perform functional replication on the node to be tested to obtain a clone node, and set the clone node as the successor node of the input node; create multiple detection nodes based on the clone node, and set each detection node as the successor node of the clone node, and create a discard node; determine the discard node as the successor node of multiple detection nodes to obtain a test graph;

[0129] Step 3: Input the test data packet into the input node for preprocessing to obtain the preprocessed data packet and metadata;

[0130] Step 4: Input the preprocessed data packet into the clone node for test processing to obtain the target data packet; the clone node has different test types and corresponding test processing is different; perform data update processing on the preprocessed metadata to obtain the target metadata;

[0131] Step 5: Input the target test data into each detection node for data content comparison processing to obtain the path test results, data packet test results and metadata test results of the node to be tested;

[0132] Step 6: Compare the node identifier of the detection node with the node identifier of the expected flow node to obtain a path test result; input the target data packet into the detection node, and compare the target data packet with the expected data packet obtained in advance through the detection node to obtain a data packet test result; input the target metadata into the detection node, and compare the target metadata with the expected metadata obtained in advance through the detection node to obtain a metadata test result;

[0133] Step 7: The memory release process is performed on the data packet of the detection node by discarding the node to obtain the memory release result.

[0134] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0135] Based on the same inventive concept, the embodiment of the present application also provides a node graph testing device for implementing the node graph testing method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more node graph testing device embodiments provided below can refer to the limitations of the node graph testing method above, and will not be repeated here.

[0136] In one embodiment, Fig.11 As shown, a node graph testing device 900 is provided, comprising:

[0137] The data packet acquisition module 901 is used to acquire a test data packet;

[0138] The test graph construction module 902 is used to copy the nodes to be tested in the node graph package processing architecture and construct a test graph according to the nodes to be tested;

[0139] The test module 903 is used to input the test data packet into the test graph for test processing to obtain the test result of the node to be tested.

[0140] In one embodiment, the test pattern construction module includes:

[0141] A node creation unit, used to create an input node;

[0142] A function replication unit, used for performing function replication processing on the node to be tested to obtain a cloned node, and setting the cloned node as a successor node of the input node;

[0143] The test graph determination unit is used to create multiple detection nodes according to the cloned node, and set each detection node as a successor node of the cloned node to obtain a test graph.

[0144] In one embodiment, the test module includes:

[0145] A preprocessing unit, used for inputting a test data packet into an input node for preprocessing to obtain a preprocessed test data packet;

[0146] A test update unit, used for inputting the pre-processed test data packet into the clone node for test processing and data update processing to obtain target test data;

[0147] The content comparison unit is used to input the target test data into each detection node for data content comparison processing to obtain the test result of the node to be tested.

[0148] In one embodiment, the preprocessed test data includes a preprocessed data packet and preprocessed metadata; the target test data includes a target data packet and target metadata; and the test update unit includes:

[0149] The test subunit is used to input the pre-processed data packet into the clone node for test processing to obtain the target data packet; the test type of the clone node is different, and the corresponding test processing is different;

[0150] The updating subunit is used to perform data updating processing on the pre-processed metadata to obtain target metadata; the data updating processing includes processing progress updating and status mark updating.

[0151] In one embodiment, the test result of the node to be tested includes a path test result, a data packet test result and a metadata test result; and the content comparison unit includes:

[0152] The identification comparison subunit is used to compare the node identification of the detection node with the node identification of the expected flow node to obtain the path test result;

[0153] The data packet comparison subunit is used to input the target data packet into the detection node, and compare the target data packet with the expected data packet obtained in advance through the detection node to obtain the data packet test result;

[0154] The metadata comparison subunit is used to input the target metadata into the detection node, and compare the target metadata with the expected metadata obtained in advance through the detection node to obtain the metadata test result.

[0155] In one embodiment, the above device further comprises:

[0156] A discard node building module, used to create a discard node;

[0157] The successor node determination module is used to determine the discarded node as the successor node of the multiple detection nodes.

[0158] In one embodiment, the above device further comprises:

[0159] A data transmission module, used for transmitting data packets from each detection node to a discarding node;

[0160] The memory release module is used to perform memory release processing on the data packets of each detection node through the discarding node to obtain the memory release result.

[0161] Each module in the above-mentioned node graph testing device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each of the above modules.

[0162] In one embodiment, a computer device is provided. The computer device may be a cloud computing data center network, and its internal structure diagram may be as follows: Fig.12 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external cloud computing data center network in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a node graph testing method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.

[0163] Those skilled in the art will understand that Fig.12 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0164] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0165] Get the test data package;

[0166] For the nodes to be tested in the node graph package processing architecture, the nodes to be tested are copied and processed, and a test graph is constructed according to the nodes to be tested;

[0167] Input the test data packet into the test graph for test processing to obtain the test result of the node to be tested.

[0168] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0169] Create an input node;

[0170] Perform functional replication on the node to be tested to obtain a cloned node, and set the cloned node as the successor node of the input node;

[0171] A plurality of detection nodes are created according to the cloned node, and each detection node is set as a successor node of the cloned node to obtain a test graph.

[0172] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0173] Inputting the test data packet into the input node for preprocessing to obtain a preprocessed test data packet;

[0174] Input the pre-processed test data packet into the clone node for test processing and data update processing to obtain target test data;

[0175] The target test data is input into each detection node for data content comparison processing to obtain the test result of the node to be tested.

[0176] In one embodiment, the preprocessed test data includes a preprocessed data packet and preprocessed metadata; the target test data includes a target data packet and target metadata; and the processor further implements the following steps when executing the computer program:

[0177] The pre-processed data packet is input into the clone node for test processing to obtain the target data packet; the clone node has different test types and corresponding test processing;

[0178] The preprocessed metadata is subjected to data update processing to obtain target metadata; the data update processing includes processing progress update and status mark update.

[0179] In one embodiment, the test result of the node to be tested includes a path test result, a data packet test result and a metadata test result; when the processor executes the computer program, the following steps are also implemented:

[0180] Compare the node identification of the detection node with the node identification of the expected flow node to obtain the path test result;

[0181] Input the target data packet into the detection node, and compare the target data packet with the expected data packet obtained in advance through the detection node to obtain the data packet test result;

[0182] The target metadata is input into the detection node, and the detection node compares the target metadata with the expected metadata acquired in advance to obtain the metadata test result.

[0183] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0184] Create a discard node;

[0185] The discarded node is determined as a successor node of the plurality of detected nodes.

[0186] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0187] Transmitting data packets from each detection node to a discarding node;

[0188] The memory release processing is performed on the data packets of each detection node by discarding the node to obtain the memory release result.

[0189] According to some embodiments of the present application, a computer program product is also provided, and when the computer program is executed by a processor, the above method can be implemented. The computer program product includes one or more computer instructions. When these computer instructions are loaded and executed on a computer, part or all of the above method can be implemented in whole or in part according to the process or function described in the embodiment of the present application.

[0190] According to some embodiments of the present application, there is also provided a non-transitory computer-readable storage medium including instructions, such as a memory including instructions, and the above instructions can be executed by a processor of an electronic device to complete the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0191] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

[0192] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0193] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0194] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A node graph testing method, characterized in that: The method comprises: Get the test data package; For the nodes to be tested in the node graph package processing architecture, the nodes to be tested are copied and processed, and a test graph is constructed according to the nodes to be tested; The test data packet is input into the test graph for test processing to obtain the test result of the node to be tested.

2. The method according to claim 1, characterized in that The step of constructing a test graph according to the node to be tested includes: Create an input node; Performing functional replication processing on the node to be tested to obtain a cloned node, and setting the cloned node as a successor node of the input node; A plurality of detection nodes are created according to the cloned node, and each of the detection nodes is set as a successor node of the cloned node to obtain the test graph.

3. The method according to claim 2, characterized in that The step of inputting the test data packet into the test graph for test processing to obtain the test result of the node to be tested includes: Inputting the test data packet into the input node for preprocessing to obtain a preprocessed test data packet; Inputting the preprocessed test data packet into the clone node for test processing and data update processing to obtain target test data; The target test data is input into each of the detection nodes for data content comparison processing to obtain the test result of the node to be tested.

4. The method according to claim 3, characterized in that The preprocessed test data includes a preprocessed data packet and preprocessed metadata; the target test data includes a target data packet and target metadata; The step of inputting the pre-processed test data packet into the clone node for test processing and data update processing to obtain target test data includes: Inputting the preprocessed data packet into the clone node for test processing to obtain the target data packet; the test type of the clone node is different, and the corresponding test processing is different; The preprocessed metadata is subjected to data update processing to obtain the target metadata; the data update processing includes processing progress update and status mark update.

5. The method according to claim 4, characterized in that The test results of the node to be tested include path test results, data packet test results and metadata test results; The step of inputting the target test data into each of the detection nodes for data content comparison processing to obtain the test result of the node to be tested includes: Compare the node identification of the detection node with the node identification of the expected flow node to obtain the path test result; Input the target data packet into the detection node, and compare the target data packet with the expected data packet acquired in advance through the detection node to obtain the data packet test result; The target metadata is input into the detection node, and the detection node compares the target metadata with the expected metadata acquired in advance to obtain the metadata test result.

6. The method according to claim 2, characterized in that The method further comprises: Create a discard node; The discarded node is determined as a successor node of the plurality of detection nodes.

7. The method according to claim 6, characterized in that The method further comprises: Transmitting the data packets of each detection node to the discarding node; The discarding node performs memory release processing on the data packets of each detection node to obtain a memory release result.

8. A node graph testing device, characterized in that: The device comprises: A data packet acquisition module, used to acquire a test data packet; A test graph construction module, used for replicating the nodes to be tested in the node graph package processing architecture, and constructing a test graph according to the nodes to be tested; The test module is used to input the test data packet into the test graph for test processing to obtain the test result of the node to be tested.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Container-based Internet of Vehicles simulation test method and electronic equipment

    CN112306520A

  • Equipment testing method and device, computer equipment and storage medium

    CN115221048A

  • Test method and device, electronic equipment and storage medium

    CN117591412A

  • Mirror image distribution method and device, electronic device and storage medium

    CN118631827A

  • System and method for emulating a multi-stage attack on a node within a target network

    US20220377102A1