Node graph testing method and apparatus, computer device, and storage medium

By copying the nodes under test in the DPDK Node Graph package and constructing the test graph, the shortcomings of existing testing methods in accurately locating nodes are solved, achieving highly accurate test results and rapid fault diagnosis.

CN119561826BActive Publication Date: 2026-01-20CHINA TELECOM CLOUD TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing technologies have shortcomings in testing the DPDK Node Graph package processing architecture. Integration testing is prone to problems due to the high coupling of the overall architecture, making it difficult to accurately locate individual nodes.

Method used

By replicating the nodes under test, a dedicated test graph is constructed. Individual tests are then performed on the nodes under test within the node graph packet processing architecture. This includes creating input nodes, cloned nodes, and detection nodes, performing packet preprocessing, test processing, and data content comparison to ensure the accuracy and independence of the test results.

Benefits of technology

It improves the accuracy of problem localization, enables rapid troubleshooting and repair of faults, avoids interference from the overall architecture coupling on test results, and ensures the accuracy and comprehensiveness of test results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119561826B_ABST
    Figure CN119561826B_ABST
Patent Text Reader

Abstract

The application relates to a node graph testing method and device, computer equipment and a storage medium. Test data packets are acquired, a to-be-tested node in a node graph packet processing architecture is subjected to a copy processing, a test graph is constructed according to the to-be-tested node, the test data packets are input into the test graph for test processing, and a test result of the to-be-tested node is obtained. The application can focus on a single node by separately copying the to-be-tested node in the node graph packet processing architecture and constructing a special test graph based on the to-be-tested node to carry out the test, effectively avoiding the situation that in a traditional test method, due to high overall architecture coupling, a problem of one node may be disturbed by other nodes and is difficult to accurately locate. When the test result is abnormal, it can be determined that there is a problem in the function, logic or processing flow of the to-be-tested node, the accuracy of problem positioning is greatly improved, and the application is helpful for quickly troubleshooting and repairing faults.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

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

[0002] In the field of data communication, with the continuous development of network technology, the efficiency and flexibility of data packet processing are increasingly required. DPDK (Data Plane Development Kit) is a collection of function libraries and drivers for fast processing of network data packets. Under this architecture, each node is responsible for processing a specific task, and the node can define its own successor node. Then, multiple nodes are connected into a graph using edges to form a complete processing flow.

[0003] Compared with traditional packet processing, this packet processing architecture can effectively improve the hit rate of processor instructions and data cache and reduce memory delay. It is also conducive to performance optimization using vector instructions.

[0004] However, when testing the DPDK Node Graph packet processing architecture, the prior art usually uses integrated testing to test the entire system. However, this integrated testing has the problem of poor testing. SUMMARY

[0005] Therefore, it is necessary to provide a node graph testing method, device, computer equipment and storage medium to solve the above problems.

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

[0007] obtaining a test data packet;

[0008] copying the to-be-tested node in the node graph packet processing architecture, and constructing a test graph according to the to-be-tested node;

[0009] inputting the test data packet into the test graph for testing processing to obtain a test result of the to-be-tested node.

[0010] In one embodiment, the test graph is constructed according to the to-be-tested node, comprising:

[0011] creating an input node;

[0012] copying the to-be-tested node to obtain a cloned node, and setting the cloned node as a successor node of the input node;

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

[0014] In one of the embodiments, the method of inputting the test data packet into the test graph for test processing to obtain the test result of the node under test comprises:

[0015] The test data packet is input into the input node for pre-processing to obtain the pre-processed test data packet;

[0016] The pre-processed test data packet is input into the clone node for test processing and data updating 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 under test.

[0018] In one of the embodiments, the pre-processed test data comprises the pre-processed data packet and the pre-processed metadata; the target test data comprises the target data packet and the target metadata; the pre-processed test data packet is input into the clone node for test processing and data updating processing to obtain the target test data, which comprises:

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

[0020] The pre-processed metadata is subjected to data updating processing to obtain the target metadata; the data updating processing comprises processing progress updating and state marker updating.

[0021] In one of the embodiments, the test result of the node under test comprises the path test result, the data packet test result and the metadata test result; the target test data is input into each detection node for data content comparison processing to obtain the test result of the node under test, which comprises:

[0022] The node identifier of the detection node is compared with the node identifier of the expected flow node to obtain the path test result;

[0023] The target data packet is input into the detection node, and the detection node compares the target data packet with the expected data packet obtained in advance 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 obtained in advance to obtain the metadata test result.

[0025] In one of the embodiments, the method further comprises:

[0026] A discard node is created;

[0027] The discard node is determined as the successor node of the plurality of detection nodes.

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

[0029] transmitting the data packets of each detection node to the discard node;

[0030] releasing the memory of the data packets of each detection node by the detection node and the discard node, to obtain a memory release result.

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

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

[0033] a test graph construction module, configured to, for a to-be-tested node in a node graph packet processing architecture, perform a copy processing on the to-be-tested node, and construct a test graph according to the to-be-tested node;

[0034] a test module, configured to input the test data packet into the test graph for test processing, to obtain a test result of the to-be-tested node.

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

[0036] acquiring a test data packet;

[0037] for a to-be-tested node in a node graph packet processing architecture, performing a copy processing on the to-be-tested node, and constructing a test graph according to the to-be-tested node;

[0038] inputting the test data packet into the test graph for test processing, to obtain a test result of the to-be-tested node.

[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 the computer program implements the following steps when executed by a processor:

[0040] acquiring a test data packet;

[0041] for a to-be-tested node in a node graph packet processing architecture, performing a copy processing on the to-be-tested node, and constructing a test graph according to the to-be-tested node;

[0042] inputting the test data packet into the test graph for test processing, to obtain a test result of the to-be-tested node.

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

[0044] obtaining a test data packet;

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

[0046] The test data packet is input into the test graph for test processing to obtain a test result of the to-be-tested node.

[0047] The node graph test method, device, computer device and storage medium obtain a test data packet, copy and process a to-be-tested node in a node graph packet processing architecture, construct a test graph according to the to-be-tested node, input the test data packet into the test graph for test processing, and obtain a test result of the to-be-tested node. The present application can focus on a single node by copying and processing the to-be-tested node in the node graph packet processing architecture and constructing a special test graph based on the to-be-tested node to carry out testing, which can effectively avoid the problem that in the traditional test method, due to high coupling of the overall architecture, a problem of a node may be disturbed by other nodes and difficult to accurately locate. When the test result is abnormal, it can be determined that the function, logic or processing flow of the to-be-tested node itself has a problem, which greatly improves the accuracy of problem positioning and helps to quickly troubleshoot and repair faults. BRIEF DESCRIPTION OF DRAWINGS

[0048] Figure 1 An application environment diagram of the node graph test method in one embodiment;

[0049] Figure 2 A flowchart of the node graph test method in one embodiment;

[0050] Figure 3 A flowchart of constructing a test graph according to a to-be-tested node in one embodiment;

[0051] Figure 4 A structure diagram of a test graph in one embodiment;

[0052] Figure 5 A flowchart of test processing in one embodiment;

[0053] Figure 6 A flowchart of test processing and data updating processing in one embodiment;

[0054] Figure 7 A flowchart of data content comparison processing in one embodiment;

[0055] Figure 8 A flowchart of a discarded node creation process in one embodiment;

[0056] Figure 9Fig. 2 is a structural schematic diagram of a test graph in another embodiment;

[0057] Figure 10 Fig. 3 is a flowchart of memory release in an embodiment;

[0058] Figure 11 Fig. 4 is a structural block diagram of a node graph test device in an embodiment;

[0059] Figure 12 Fig. 5 is an internal structural diagram of a computer device in an embodiment. DETAILED DESCRIPTION

[0060] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and should not be used to limit the present application.

[0061] First, before specifically introducing the technical solutions of the embodiments of the present application, the technical background based on which the embodiments of the present application are introduced.

[0062] Based on this, the present application provides a node graph test method, device, computer device and storage medium, aiming at solving the above technical problems.

[0063] The node graph test method provided by the embodiments of the present application can be applied in an application environment as shown in Figure 1 . The cloud computing data center network 102 communicates with the server 104 through a network. The data storage system can store data required to be processed by the server 104. The data storage system can be integrated on the server 104, or 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, performs copy processing on a to-be-tested node in a node graph packet processing architecture, constructs a test graph according to the to-be-tested node, inputs the test data packet into the test graph for test processing, and obtains a test result of the to-be-tested node. The cloud computing data center network 102 can be, but is not limited to, a virtual switch, a gateway, a firewall and the like. The server 104 can be implemented by an independent server or a server cluster composed of multiple servers.

[0064] In an exemplary embodiment, as shown in Figure 2 , a node graph test method is provided, which is taken as an example of the cloud computing data center network in Figure 1 for illustration, and includes the following steps:

[0065] S201, obtaining a test data packet.

[0066] The test data packets are a set of data packets specially prepared for testing the to-be-tested node 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 to-be-tested node, to simulate the actual data packet conditions that may be input to the to-be-tested node in actual operation.

[0067] In the embodiments of the present application, first, various types of information required to be covered by the test data packets are determined according to the functional positioning of the to-be-tested node in the node graph packet processing architecture and the actual application scenarios. For example, if the to-be-tested node is responsible for the forwarding function of network data packets, the test data packets should contain common network data packet information such as source address, destination address, and protocol type. Then, the data generation tool or the existing data packet sample library is used to select data packets that meet the above requirements as test data packets. In the selection process, different parameter value combinations can be set as needed to cover various input conditions that the to-be-tested node may encounter, such as different source address ranges and various protocol types.

[0068] S202, for the to-be-tested node in the node graph packet processing architecture, the to-be-tested node is copied and processed, and a test graph is constructed according to the to-be-tested node.

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

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

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

[0072] In addition to the above-mentioned conventional replication mode, a deep cloning technique can also be used to replicate the to-be-tested node. Deep cloning not only replicates the surface attributes and functional logic of the node, but also recursively replicates all substructures, objects, and their associated relationships involved in the node. The replicated node thus obtained can more accurately simulate the behavior of the original to-be-tested node in a more complex node graph architecture, especially when the to-be-tested node contains multiple nested structures or complex object relationships. Deep cloning can ensure the completeness and accuracy of replication.

[0073] Instead of creating an input node separately, an existing node in the node graph processing architecture can also be used as an input node by modifying its input configuration to enable it to receive and pass on test data packets and their related metadata. This approach can make full use of existing architecture resources and reduce additional node creation work.

[0074] When determining the connection relationship between the replicated node and the check node, a dynamic connection method is used according to the actual processing flow of the to-be-tested node and the different output branch situations that may occur. That is, instead of simply fixing all successor nodes of the replicated node as check nodes, some successor nodes of the replicated node are dynamically selected to be connected to the corresponding check nodes according to the specific requirements 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 a test result of the to-be-tested node.

[0076] In the embodiments 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 related metadata requirements. The test data packet flows from the input node to the replicated node, which will process the test data packet according to the same functional characteristics as the original to-be-tested node, such as format conversion, data extraction, forwarding operation, etc. The related metadata of the data packet may also be modified during processing. The processed test data packet flows from the replicated node to each check node, where key checks are performed. Finally, the test situation of the to-be-tested node is comprehensively judged according to the check results of each check node, and the corresponding test result is output.

[0077] Another implementation: Before inputting the test data packets into the test graph, the test data packets can be grouped into several data packet groups with different characteristics or attributes. For example, grouping according to the source address range of the data packets, the protocol type, etc. Then, different data packet groups are input into the test graph in a certain order for test processing. During the flow of each data packet group, the two key checks of the check node are also performed, but when comprehensively judging the test situation of the to-be-tested node, in addition to considering the individual check results of each data packet group, the differences in test results between different data packet groups can also be analyzed to more comprehensively understand the performance and stability of the to-be-tested node when processing different types of data packets. In this way, the possible problems of the to-be-tested node can be more deeply mined, and the accuracy and comprehensiveness of the test results can be improved.

[0078] The node graph test method described above, for the to-be-tested node in the node graph packet processing architecture, performs copy processing on the to-be-tested node, and constructs a test graph based on the to-be-tested node, inputs test data packets into the test graph for test processing, and obtains test results of the to-be-tested node. The present application can focus on a single node by performing separate copy processing on the to-be-tested node in the node graph packet processing architecture and constructing a special test graph based on the to-be-tested node to carry out testing, which can effectively avoid the situation that in the traditional test method, due to the high coupling of the overall architecture, the problem of one node may be disturbed by other nodes and difficult to accurately locate. When the test result is abnormal, it can be determined that there is a problem with the function, logic or processing flow of the to-be-tested node itself, which greatly improves the accuracy of problem positioning and helps to quickly troubleshoot and repair faults.

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

[0080] S301, creating an input node.

[0081] In the embodiment of the present application, the input node can be created by the node creation function provided by the relevant programming framework or library. For example, in some graphical programming-based environment, the "create input node" button or operation option can be selected on the operation interface, and then some basic attributes of the input node are set according to the prompt, such as node name, data type that can be received, etc. When implemented at the code level, an input node class can be instantiated, and the corresponding attributes are set in the initialization process of the class, such as specifying that the data format it receives should match the format of the prepared test data packets, so as to accurately receive the data packets.

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

[0083] In the embodiments of the present application, in some graphical node diagram architecture platforms with node replication function, the selected to-be-tested node can be directly replicated by using the replication tool provided by the platform to obtain a cloned node. When implemented at the code level, for a system based on object-oriented programming, the function replication can be implemented by deep copy technology. For example, for a node class written in C++, if the to-be-tested node is to be replicated, a custom deep copy method can be implemented, which recursively copies all attributes, methods and internal objects of the node object to ensure that the cloned node is completely consistent with the original to-be-tested node in function.

[0084] When setting the successor node, the output connection point of the input node can be directly dragged to the input connection point of the cloned node on the operation interface to complete the setting of the successor node relationship. When implemented at the code level, after the input node and the cloned node are created, the successor node pointer (or similar attribute representing the connection relationship) of the input node can be modified to point to the cloned 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 diagram.

[0086] In the embodiments of the present application, multiple detection nodes can be created by repeatedly performing the "create node" operation multiple times, and setting the newly created nodes as the properties of the detection nodes (such as by checking the "detection node" option in the node property setting interface). When implemented at the code level, multiple node classes specifically for detection can also be instantiated, and the corresponding detection functions and properties can be set during the initialization process of the class, such as setting a detection node to check the flow path of a data packet, which can define a method in the class to compare whether the current node is the expected next flow node.

[0087] In the embodiments of the present application, the cloned node is obtained by replicating the to-be-tested node, and a test diagram with the cloned node as the core is constructed, which can isolate the to-be-tested node from the original node diagram 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 to-be-tested node itself can be more accurately observed and evaluated during the test, and once the test result is abnormal, it can be quickly determined that the problem is with the to-be-tested node itself, greatly improving the accuracy of problem positioning.

[0088] In an exemplary embodiment, based on the above embodiments, please refer to Figure 5The embodiment of the application relates to a process of inputting test data packets into a test graph for test processing to obtain test results of a node to be tested, comprising the following steps:

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

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

[0091] S402, inputting the preprocessed test data packets into a clone node for test processing and data updating processing to obtain target test data.

[0092] In the embodiment of the application, the preprocessed test data packets are transmitted to the clone node according to the connection relationship set in the test graph. After receiving the data packets, the clone node performs 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 two-layer forwarding (L2Fwd) function, then the clone node also processes the data packets according to the rules and logic of the two-layer forwarding.

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

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

[0095] In the embodiment of the application, the preprocessing operation of the input node can ensure that the test data packets enter the subsequent test processing link in a suitable state, avoid test errors caused by incomplete data packet format or inaccurate metadata, and improve the initial accuracy of the test. The clone node accurately copies the functional characteristics of the node to be tested to accurately process and update the preprocessed test data packets, so that the test can truly reflect the actual processing capability of the node to be tested, and further improve the accuracy of the test. The detection node strictly performs data content comparison processing to comprehensively check the output of the clone node from multiple angles, can accurately judge whether the processing of the node to be tested meets the expectation, and ensures 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 application comprises preprocessed data packets and preprocessed metadata; the target test data comprises target data packets and target metadata; the embodiment of the application relates to a process of inputting the preprocessed test data packets into a cloned node for test processing and data update processing to obtain the target test data, comprising the following steps:

[0097] S501, input the preprocessed data packets into the cloned node for test processing to obtain target data packets.

[0098] The test type of the cloned node is different, and the corresponding test processing is different. The target data packets are obtained by the cloned node performing corresponding test processing on the preprocessed data packets according to the test type. The content may change due to different test types (such as packet classification, forwarding, filtering, etc.) of the cloned node, and is an important part of the target test data, which is used for subsequent comparison and inspection with the expected data packets.

[0099] The embodiment of the application delivers the preprocessed data packets to the cloned node according to the connection relationship set in the test graph. After receiving the data packets, the cloned node will perform corresponding test processing operations according to its pre-set test type.

[0100] If the test type of the cloned node is set to packet classification, it will perform classification operation on the input preprocessed data packets according to specific characteristics (such as protocol type, source address, destination address, etc.) of the data packets. For example, for network data packets, the data packets are divided into different categories according to their protocol type (such as TCP, UDP, etc.) for subsequent targeted processing. In the classification process, some fields of the data packets may be marked or added with classification-related metadata to clearly indicate their belonging category.

[0101] When the test type of the cloned node is two-layer forwarding, it will check the link layer related information (such as source MAC address, destination MAC address, etc.) of the data packets to determine whether the forwarding operation is needed and the target address of the forwarding. If the forwarding condition is met, the cloned node will modify the link layer related fields of the data packets (such as updating the destination MAC address) to make them able to be forwarded according to the predetermined path, and obtain the target data packets after two-layer forwarding processing.

[0102] S502, perform data update processing on the preprocessed metadata to obtain target metadata; the data update processing includes processing progress update and state marker update.

[0103] The embodiment of the present application updates the preprocessed metadata while the cloned node tests and processes the preprocessed data packet. When the processing progress is updated, the field related to the processing progress in the metadata is updated according to the processing progress of the data packet in the cloned node.

[0104] When the state flag is updated, the flag reflecting the processing state in the metadata is updated according to the processing result of the data packet in the cloned node. Taking the two-layer forwarding as an example, if the cloned node completes the two-layer forwarding operation of the data packet, the flag of "whether the data packet has been forwarded" in the metadata is changed from "no" to "yes"; for the packet classification operation, if the data packet has been successfully classified into a certain category, the value of the corresponding classification state flag in the metadata is updated to indicate the current processing state of the data packet.

[0105] The embodiment of the present application can accurately simulate the processing process of the data packet in the actual running scene of the to-be-tested node by performing targeted test processing on the preprocessed data packet according to different test types, ensures that the target data packet truly reflects the actual processing capability of the to-be-tested node, and thus improves the accuracy of the data packet processing capability test. The detailed data update processing of the preprocessed metadata, including the processing progress update and the state flag update, enables the target metadata to accurately reflect the processing progress and state change of the data packet in the processing process of the cloned node, provides an accurate basis for the subsequent inspection of the detection node, and further improves the accuracy of the test.

[0106] In an exemplary embodiment, based on the above embodiment, please refer to Figure 7 The test result of the to-be-tested node of the embodiment of the present application includes the path test result, the data packet test result and the metadata test result; the embodiment of the present application relates to the process of inputting the target test data into each detection node for data content comparison processing to obtain the test result of the to-be-tested node, including the following steps:

[0107] S601, comparing and processing the node identifier of the detection node with the node identifier of the expected flow transfer 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 transfer path after passing through the to-be-tested node (processed by the cloned node). Whether the data packet correctly flows between nodes is determined by comparing the actual node identifier of the detection node with the node identifier of the expected flow transfer node, so as to evaluate whether the influence of the to-be-tested node on the data packet flow transfer path is in line with the expectation.

[0108] The embodiment of the present application compares the node identifier of the detection node with the node identifiers of the expected flow nodes obtained from the test case configuration one by one. 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 requirement (for example, it is connected through a specific edge, and the connection order is correct), it is determined that the data packet meets the expectation in terms of the flow path, and the path test result is "pass"; otherwise, the path test result is "fail", and relevant error information such as the actual node identifier, the expected node identifier, and the connection link that may have a problem is recorded for subsequent analysis and troubleshooting.

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

[0110] The data packet test result is a result obtained by comparing the target data packet (the data packet after the cloned node processing) with the pre-acquired expected data packet. It is used to determine whether the content (such as the source address, the destination address, the protocol type, and other specific data fields) of the data packet is changed as expected or whether the correctness of the data packet content is maintained (in some cases, such as the data packet content should be kept unchanged in the forwarding operation) when the to-be-tested node processes the data packet, so as to measure the accuracy of the to-be-tested node in processing the data packet content.

[0111] The embodiment of the present application compares the parsed target data packet with the expected data packet in detail. The comparison content includes various specific data fields 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, and the like. If all the compared fields are completely consistent with the corresponding fields of the expected data packet, it is determined that the data packet test result is "pass"; otherwise, it is determined that the data packet test result is "fail", and relevant error information such as which fields are inconsistent, the actual value of the target data packet, and the corresponding value of the expected data packet is recorded for subsequent analysis and troubleshooting.

[0112] S603, input the target metadata into the detection node, and compare the target metadata with the pre-acquired expected metadata through the detection node to obtain a metadata test result.

[0113] The metadata test result is a result obtained by comparing the target metadata (the metadata after the cloned node processing and the metadata update processing) with the pre-acquired expected metadata. It is used to evaluate whether the use, modification, or transmission of the metadata (such as the identifier of the data packet, the processing state, the source, and other related auxiliary information) by the to-be-tested node in processing the data packet meets the expectation, so as to determine the accuracy of the to-be-tested node in processing the metadata.

[0114] This application embodiment performs a detailed comparison between the parsed target metadata and the expected metadata. The comparison includes various fields of the metadata, such as whether the packet identifier is the same, whether the processing status is the same, and whether the source is the same. If all compared fields are completely consistent with the corresponding fields of the expected metadata, 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, for subsequent analysis and troubleshooting.

[0115] In one exemplary embodiment, based on the above embodiments, please refer to... Figure 8 The method in this application embodiment further includes the following steps:

[0116] S701, create a discard node.

[0117] In this embodiment of the application, in a test graph environment built based on the node under test, the discard 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, the discarded node is determined as the successor node of multiple detection nodes.

[0119] In this embodiment of the application, after the creation of the discard nodes is completed, it is necessary to establish a correct connection relationship between them and the detection nodes, that is, to determine them as the successor nodes of the detection nodes.

[0120] This application embodiment, by creating a discard node and designating it as the successor node to the detection node, ensures that data packets and metadata release their occupied memory space promptly after completing test-related processing. Whether using a conventional fixed connection configuration or a dynamic connection configuration, it effectively avoids memory leaks, ensuring that the test environment's memory resources are always utilized efficiently, thus improving memory management efficiency throughout the entire testing process.

[0121] In one exemplary embodiment, based on the above embodiments, please refer to... Figure 10 The method in this application embodiment further includes the following steps:

[0122] S801 transmits the data packets from each detection node to the discard node.

[0123] In this embodiment of the application, when constructing the test graph, the successor node of each detection node is explicitly set as the discard node. After a detection node completes its own detection task, it directly transmits the processed data packet to the discard node through the inter-node communication mechanism (such as function calls, 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 by the discard node to obtain a memory release result.

[0125] In the embodiment of the application, when memory release is needed, a master node can send a memory release instruction to the discard node.

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

[0127] Step 1: obtaining a test data packet; copying a to-be-tested node in a node graph packet processing architecture;

[0128] Step 2: creating an input node; copying the to-be-tested node to obtain a cloned node, and setting the cloned node as a successor node of the input node; creating a plurality of detection nodes according to the cloned node, and setting each detection node as a successor node of the cloned node, and creating a discard node; determining the discard node as a successor node of the plurality of detection nodes to obtain a test graph;

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

[0130] Step 4: inputting the preprocessed data packet to the cloned node for test processing to obtain a target data packet; the test type of the cloned node is different, and the corresponding test processing is different; performing data update processing on the preprocessed metadata to obtain target metadata;

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

[0132] Step 6: comparing the node identifier of the detection node with the node identifier of an expected flow node to obtain a path test result; inputting the target data packet to the detection node, and comparing the target data packet with a pre-acquired expected data packet by the detection node to obtain a data packet test result; inputting the target metadata to the detection node, and comparing the target metadata with a pre-acquired expected metadata by the detection node to obtain a metadata test result;

[0133] Step 7: performing memory release processing on the data packet of the detection node by the discard node to obtain a memory release result.

[0134] It should be understood that although the steps in the flowcharts involved in the embodiments described above are shown in sequence according to the arrows, the steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, the execution of the steps is not strictly limited in sequence, and the steps can be executed in other orders. Moreover, at least some of the steps in the flowcharts involved in the embodiments described above can include multiple steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution order of the steps or stages is not necessarily sequential, but can be alternately or alternately executed with at least part of other steps or steps or stages in other steps.

[0135] Based on the same inventive concept, the embodiments of the present application also provide a node graph testing device for implementing the node graph testing method described above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described 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 described above, which will not be repeated here.

[0136] In one embodiment, as shown in Figure 11 a node graph testing device 900 is provided, comprising:

[0137] a data packet acquisition module 901, configured to acquire a test data packet;

[0138] a test graph construction module 902, configured to perform copy processing on a to-be-tested node in a node graph packet processing architecture, and construct a test graph according to the to-be-tested node;

[0139] a test module 903, configured to input the test data packet into the test graph for test processing to obtain a test result of the to-be-tested node.

[0140] In one embodiment, the test graph construction module described above comprises:

[0141] a node creation unit, configured to create an input node;

[0142] a function copy unit, configured to perform function copy processing on the to-be-tested node to obtain a cloned node, and set the cloned node as a successor node of the input node;

[0143] a test graph determination unit, configured to create a plurality of 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 described above comprises:

[0145] A preprocessing unit is configured to input a test data packet into an input node for preprocessing to obtain a preprocessed test data packet.

[0146] A test updating unit is configured to input the preprocessed test data packet into a cloned node for test processing and data updating processing to obtain target test data.

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

[0148] In one of the embodiments, the preprocessed test data includes a preprocessed data packet and a preprocessed metadata; the target test data includes a target data packet and a target metadata; and the test updating unit includes:

[0149] A test subunit is configured to input the preprocessed data packet into the cloned node for test processing to obtain the target data packet; the cloned node has different test types, and the corresponding test processing is different.

[0150] An updating subunit is configured to perform data updating processing on the preprocessed metadata to obtain the target metadata; the data updating processing includes processing progress updating and state marker updating.

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

[0152] An identifier comparison subunit is configured to compare a node identifier of the detection node with a node identifier of an expected flow node to obtain the path test result.

[0153] A data packet comparison subunit is configured to input the target data packet into the detection node, and compare the target data packet with a pre-acquired expected data packet through the detection node to obtain the data packet test result.

[0154] A metadata comparison subunit is configured to input the target metadata into the detection node, and compare the target metadata with a pre-acquired expected metadata through the detection node to obtain the metadata test result.

[0155] In one of the embodiments, the apparatus further includes:

[0156] A discard node construction module is configured to create a discard node.

[0157] A successor node determination module is configured to determine the discard node as a successor node of the plurality of detection nodes.

[0158] In one of the embodiments, the apparatus further includes:

[0159] The data transmission module is configured to transmit the data packets of the detection nodes to the discard node.

[0160] The memory release module is configured to perform memory release processing on the data packets of the detection nodes by the discard node to obtain a memory release result.

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

[0162] In one embodiment, a computer device is provided, which can be a cloud computing data center network, and an internal structure diagram thereof can be as shown in FIG. 1. Figure 12 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 configured 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 running the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is configured to exchange information between the processor and external devices. The communication interface of the computer device is configured to perform wired or wireless communication with an external cloud computing data center network. The wireless communication can be achieved through WIFI, mobile cellular network, NFC (near field communication), or other technologies. The computer program is executed by the processor to implement a node graph testing method. The display unit of the computer device is configured 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. The input device of the computer device can be a touch layer overlaid on the display screen, or a key, trackball, or touchpad arranged on the shell of the computer device, or an external keyboard, touchpad, or mouse, etc.

[0163] Those skilled in the art can understand that Figure 12 The structure shown in FIG. 1 is only a block diagram of part of the structure related to the scheme of the present application, and does not limit the computer device to which the scheme of the present application is applied. Specifically, the computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different component arrangement.

[0164] In one embodiment, a computer device is provided, comprising a memory and a processor, the memory storing a computer program, and the processor implementing the following steps when executing the computer program:

[0165] Obtaining a test data packet;

[0166] For a to-be-tested node in a node graph packet processing architecture, performing a replication process on the to-be-tested node, and constructing a test graph according to the to-be-tested node;

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

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

[0169] Creating an input node;

[0170] Performing a functional replication process on the to-be-tested node to obtain a cloned node, and setting the cloned node as a successor node of the input node;

[0171] Creating a plurality of 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.

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

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

[0174] Inputting the preprocessed test data packet into the cloned node for test processing and data update processing to obtain target test data;

[0175] Inputting the target test data into each detection node for data content comparison processing to obtain a test result of the to-be-tested node.

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

[0177] Inputting the preprocessed data packet into the cloned node for test processing to obtain a target data packet; the cloned node has different test types, and the corresponding test processing is different;

[0178] Performing data update processing on the preprocessed metadata to obtain target metadata; the data update processing includes processing progress update and state marker update.

[0179] In one embodiment, the test result of the to-be-tested node includes a path test result, a data packet test result and a metadata test result; and the processor, when executing the computer program, further implements the following steps:

[0180] comparing the node identifier of the detection node with the node identifier of the expected flow transfer node to obtain a path test result;

[0181] inputting a target data packet into the detection node, and comparing the target data packet with the pre-acquired expected data packet by the detection node to obtain a data packet test result;

[0182] inputting a target metadata into the detection node, and comparing the target metadata with the pre-acquired expected metadata by the detection node to obtain a metadata test result.

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

[0184] creating a discard node;

[0185] determining the discard node as a successor node of the plurality of detection nodes.

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

[0187] transmitting the data packet of each detection node to the discard node;

[0188] releasing the memory of the data packet of each detection node by the discard node to obtain a memory release result.

[0189] According to some embodiments of the present application, a computer program product is also provided, which computer program is executed by a processor to implement the above method. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, some or all of the above method can be implemented according to the processes or functions described in the embodiments of the present application.

[0190] According to some embodiments of the present application, a non-transitory computer readable storage medium including instructions, such as a memory including instructions, is also provided, and the above method 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 and an optical data storage device, etc.

[0191] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of the country and region.

[0192] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing related hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when the computer program is executed, the processes of the above-mentioned embodiments of each method can be included. In the embodiments provided in the present application, any reference to memory, database or other medium 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 storage, high-density embedded non-volatile memory, resistive memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric 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 but not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., without being limited thereto.

[0193] The technical features of the above embodiments can be combined in any way. To make the description concise, not all possible combinations of the technical features in the above embodiments are described, but as long as the combinations of the technical features do not exist contradictions, they should be considered as the scope of the present application.

[0194] The above-described embodiments are merely illustrative of several embodiments of the present application, and the description is relatively specific and detailed, but should not be understood as a limitation on the scope of the patent. It should be noted that for those skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are all within the scope of the present application. Therefore, the scope of protection of the present application should be subject to the appended claims.

Claims

1. A method of testing a node graph, characterized by, The method comprises: acquiring a test data packet; copying a to-be-tested node in a node graph packet processing architecture, and constructing a test graph according to the to-be-tested node; inputting the test data packet into the test graph for test processing to obtain a test result of the to-be-tested node; wherein the step of constructing a test graph according to the to-be-tested node comprises: creating an input node; copying the to-be-tested node to obtain a cloned node, and setting the cloned node as a successor node of the input node; creating a plurality of detection nodes according to the cloned node, and setting each detection node as a successor node of the cloned node to obtain the test graph.

2. The method of claim 1, wherein, The step of inputting the test data packet into the test graph for test processing to obtain a test result of the to-be-tested node comprises: 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 cloned node for test processing and data updating processing to obtain target test data; inputting the target test data into each detection node for data content comparison processing to obtain the test result of the to-be-tested node.

3. The method of claim 2, wherein, The preprocessed test data comprises a preprocessed data packet and preprocessed metadata; and the target test data comprises a target data packet and target metadata. The step of inputting the preprocessed test data packet into the cloned node for test processing and data updating processing to obtain target test data comprises: inputting the preprocessed data packet into the cloned node for test processing to obtain the target data packet; the cloned node has different test types, and the corresponding test processing is different; performing data updating processing on the preprocessed metadata to obtain the target metadata; the data updating processing comprises processing progress updating and state marker updating.

4. The method of claim 3, wherein, The test result of the to-be-tested node comprises a path test result, a data packet test result and metadata test result. The step of inputting the target test data into each detection node for data content comparison processing to obtain the test result of the to-be-tested node comprises: comparing the node identifier of the detection node with the node identifier of an expected flow node to obtain the path test result; inputting the target data packet into the detection node, and comparing the target data packet with a pre-acquired expected data packet through the detection node to obtain the data packet test result; inputting the target metadata into the detection node, and comparing the target metadata with a pre-acquired expected metadata through the detection node to obtain the metadata test result.

5. The method of claim 1, wherein, The method further comprises: creating a discard node; determining the discard node as a successor node of a plurality of detection nodes.

6. The method of claim 5, wherein, The method further comprises: transmitting the data packet of each detection node to the discard node; performing memory release processing on the data packet of each detection node through the discard node to obtain a memory release result.

7. A node graph testing apparatus, characterized by The apparatus comprises: a data packet acquisition module configured to acquire a test data packet; A test graph construction module is configured to replicate a to-be-tested node in a node graph packet processing architecture and construct a test graph according to the to-be-tested node. A test module is configured to input the test data packet into the test graph for test processing to obtain a test result of the to-be-tested node. The test graph construction module comprises: a node creation unit configured to create an input node; a function replication unit configured to replicate a function of the to-be-tested node to obtain a cloned node and set the cloned node as a successor node of the input node; a test graph determination unit configured to create a plurality of detection nodes according to the cloned node and set each detection node as a successor node of the cloned node to obtain the test graph.

8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that, The processor executes the computer program to implement the steps of the method in any one of claims 1 to 6.

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

Citation Information

Patent Citations

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

    CN112306520A