Data testing method, device, electronic device and medium based on relay nodes

By introducing relay nodes into the network, identifying and connecting data sending and receiving devices, and switching IP addresses to enter relay mode, the problem that traditional network packet capture and monitoring software is difficult to maintain the network structure during testing and cannot interfere with data fields in real time, achieving efficient and flexible data testing.

CN119853835BActive Publication Date: 2025-07-01BEIJING REALFLY AVIATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510331899.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-20
Publication Date
2025-07-01
Estimated Expiration
2045-03-20

AI Technical Summary

Technical Problem

Traditional network packet capture and monitoring software is difficult to test while maintaining the existing network structure, and cannot maintain the original data communication status, cannot interfere with the data field values ​​in real time, and cannot flexibly modify the data field types, which limits development and testing efficiency and may affect the stability of critical business systems.

Method used

The relay node identifies the data sending device and the data receiving device, establishes a communication connection, and switches the IP address to enter the relay mode without interfering with the original network, so as to realize data transmission, monitoring and testing.

Benefits of technology

This method can automatically access and intervene the network without affecting the original network, improve the stability and flexibility of data testing, and reduce the impact on the original network.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119853835B_ABST
    Figure CN119853835B_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure provide a data testing method, apparatus, electronic device, and medium based on a relay node, which relate to the fields of data monitoring, data testing, etc. The method is executed by the relay node and includes: identifying a data sending device and a data receiving device; respectively receiving handshake data of the data sending device and the data receiving device based on the heartbeat monitoring port of the relay node, and establishing a communication connection between the relay node and the data sending device and the data receiving device; when the data receiving device switches the original IP address to a test IP address, switching the IP address of the relay node to the original IP address of the data receiving device to enter the relay mode; in the relay mode, performing data transmission, data monitoring, and data testing. In the embodiments of the present disclosure, the relay node can seamlessly intervene in the network without interfering with the original network, perform data transmission, data monitoring, and data testing, and improve the stability and flexibility of data testing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical fields of data monitoring, data testing, etc. Specifically, the present disclosure relates to a data testing method, apparatus, electronic device, and medium based on a relay node. Background Art

[0002] In a modern network environment, it is crucial to test and monitor the accuracy and performance of data transmission, especially without interfering with normal business operations. Ensuring the stability and real-time nature of data communication is key during the software development and testing phases. Regardless of the network data communication protocol used, the reliability of network communication is the basis for the normal operation of functions and the accurate transmission of data.

[0003] However, although traditional network packet capture and monitoring software can provide data monitoring functions, on the one hand, traditional network packet capture mainly realizes direct communication between device A and device B or between device B and device A. This mode is difficult to test while maintaining the existing network structure, which not only limits the development and testing efficiency but may also affect the stability of critical business systems. On the other hand, traditional network packet capture generally has the deficiencies of being unable to maintain the original data communication state, unable to perform real-time intervention on data field values, and unable to flexibly modify data field types.

[0004] In view of the above problems, there is an urgent need for a flexible and accurate data testing solution. Summary of the Invention

[0005] Embodiments of the present disclosure provide a data testing method, apparatus, electronic device, and medium based on a relay node. Through the relay node, it is possible to automatically access the network and seamlessly intervene in the network without interfering with the original network to perform data transmission, data monitoring, and data testing, which not only reduces the impact on the original network but also improves the stability and flexibility of data testing. The technical solutions provided by the present disclosure are as follows:

[0006] In a first aspect, embodiments of the present disclosure provide a data testing method based on a relay node. This method is executed by the relay node and includes:

[0007] Identifying a data sending device and a data receiving device based on the above relay node;

[0008] Receiving handshake data sent by the data sending device and the data receiving device respectively based on the heartbeat monitoring port of the above relay node, and establishing communication connections between the relay node and the data sending device, and between the relay node and the data receiving device based on the handshake data;

[0009] When the above data receiving device switches the original IP address to a test IP address, the IP address of the above relay node is switched to the original IP address of the above data receiving device to enter the relay mode. The test IP address is a pre-defined IP address for data testing. In the above relay mode, the relay node forwards the data sent by the data sending device to the data receiving device, and the relay node also forwards the data sent by the data receiving device to the data sending device. The relay node is also used to regularly send a first heartbeat packet to the data sending device and the data receiving device through the above heartbeat monitoring port to ensure the connection status between the relay node and the data sending device, and between the relay node and the data receiving device;

[0010] In the above relay mode, data transmission, data monitoring, and data testing are performed.

[0011] In a second aspect, an embodiment of the present disclosure provides a data testing device based on a relay node. The device includes a relay node, and the device includes:

[0012] An identification module for identifying a data sending device and a data receiving device based on the above relay node;

[0013] A first processing module for respectively receiving the handshake data sent by the data sending device and the data receiving device based on the heartbeat monitoring port of the above relay node, and establishing a communication connection between the relay node and the data sending device, and between the relay node and the data receiving device based on the above handshake data;

[0014] A second processing module for, when the above data receiving device switches the original IP address to a test IP address, switching the IP address of the above relay node to the original IP address of the above data receiving device to enter the relay mode. The test IP address is a pre-defined IP address for data testing. In the above relay mode, the relay node forwards the data sent by the data sending device to the data receiving device, and the relay node also forwards the data sent by the data receiving device to the data sending device. The relay node is also used to regularly send a first heartbeat packet to the data sending device and the data receiving device through the above heartbeat monitoring port to ensure the connection status between the relay node and the data sending device, and between the relay node and the data receiving device;

[0015] A third processing module for performing data transmission, data monitoring, and data testing in the above relay mode.

[0016] In a third aspect, an embodiment of the present disclosure provides an electronic device, including a processor and a memory, which are interconnected;

[0017] The above-mentioned memory is used to store a computer program;

[0018] The above-mentioned processor is configured to execute the method provided in the first aspect when calling the above-mentioned computer program.

[0019] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium storing a computer program, and the computer program is executed by a processor to implement the method provided in the first aspect.

[0020] In a fifth aspect, an embodiment of the present disclosure provides a computer program product or a computer program. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method provided in the first aspect.

[0021] In the embodiment of the present disclosure, a relay node identifies a data sending device and a data receiving device, and based on the heartbeat monitoring port of the relay node, a communication connection between the relay node and the data sending device is established through the handshake data sent by the received data sending device, and a communication connection between the relay node and the data receiving device is established through the handshake data sent by the received data receiving device; when the data receiving device and the relay node establish a communication connection, the data receiving device switches its own original IP address to a test IP address, and switches the IP address of the relay node to the original IP address of the data receiving device, and then enters the relay mode; in the relay mode, the data sending device sends data to the relay node, the relay node forwards the data sent by the data sending device to the data receiving device, the data receiving device sends data to the relay node, and the relay node forwards the data sent by the data receiving device to the data sending device. The relay node is further configured to regularly send a first heartbeat packet to the data sending device and the data receiving device through the heartbeat monitoring port to ensure the connection status between the relay node and the data sending device and between the relay node and the data receiving device; in the relay mode, data transmission, data monitoring and data testing are performed. Through the embodiment of the present disclosure, the relay node can automatically access the original network without interfering with the original network and seamlessly intervene in the network. In the relay mode, data transmission, data monitoring and data testing are performed, which can maintain the consistency of data sending and receiving rates and transmission methods, avoid introducing additional network traffic and processing delays due to packet mirroring or interception methods, ensure that the network communication performance and reliability are not affected, and improve the stability, flexibility and reliability of data testing. Description of the Drawings

[0022] To more clearly illustrate the technical solutions in the embodiments of the present disclosure, the following briefly introduces the drawings required for the description in the embodiments of the present disclosure.

[0023] Figure 1 It is a schematic flowchart of a data testing method based on a relay node provided by an embodiment of the present disclosure;

[0024] Figure 2 It is a schematic diagram of a communication structure based on a relay node provided by an embodiment of the present disclosure;

[0025] Figure 3 It is a schematic flowchart of another data testing method based on a relay node provided by an embodiment of the present disclosure;

[0026] Figure 4 It is a schematic diagram of a data packet parsing code provided by an embodiment of the present disclosure;

[0027] Figure 5 It is a schematic flowchart of a process for exiting the relay mode provided by an embodiment of the present disclosure;

[0028] Figure 6 It is a schematic diagram of the structure of a data testing device based on a relay node provided by an embodiment of the present disclosure;

[0029] Figure 7 It is a schematic diagram of the structure of an electronic device for a data testing method of a relay node provided by an embodiment of the present disclosure. Detailed Embodiments

[0030] The following describes the embodiments of the present disclosure in conjunction with the drawings in the present disclosure. It should be understood that the embodiments described below in conjunction with the drawings are exemplary descriptions for explaining the technical solutions of the embodiments of the present disclosure, and do not constitute limitations on the technical solutions of the embodiments of the present disclosure.

[0031] To make the purpose, technical solutions and advantages of the present disclosure clearer, the following will further describe the embodiments of the present disclosure in detail in conjunction with the drawings.

[0032] Currently, traditional solutions generally use general packet capture software for data testing. Although these technical solutions can meet the requirements of network data monitoring to a certain extent, they generally have the deficiencies of being unable to maintain the original data communication state, unable to perform real-time intervention on the data field values, and unable to flexibly modify the data field types.

[0033] Among them, the traditional general packet capture solutions mainly have the following disadvantages:

[0034] 1. Unable to maintain the original data communication state: When traditional packet capture tools monitor data, they cannot completely avoid interfering with the original network structure and the normal flow of data. These tools usually capture data by mirroring ports or intercepting packets, which may introduce additional network traffic and processing delays, thus affecting the performance and reliability of normal network communication.

[0035] 2. Unable to manually intervene in the test field values: Most traditional tools can only perform passive monitoring and lack the ability to perform real-time intervention and replacement on data. This limitation makes it impossible to actively adjust the field values in the data stream during the test, making it difficult to simulate various complex network conditions and abnormal situations, and affecting the flexibility and effectiveness of the test.

[0036] 3. Unable to modify the data field types: Traditional packet capture tools have limitations in the monitoring and analysis functions of packets and cannot flexibly modify the field types in the packets. This restricts the testers' setting and control of the data at specific interesting bits and makes it difficult to meet the needs of precise testing.

[0037] To solve the above problems, it is necessary to further improve and innovate technical methods. Through the data testing method based on relay nodes in the embodiments of the present disclosure, the requirements for higher testing flexibility and accuracy can be met. Refer to Figure 1 , Figure 1 which is a schematic flowchart of a data testing method based on relay nodes provided by the embodiments of the present disclosure. As shown in Figure 1 the method includes:

[0038] Step S101, identifying a data sending device and a data receiving device based on the above-mentioned relay node;

[0039] Step S102, respectively receiving the handshake data sent by the data sending device and the data receiving device based on the heartbeat monitoring port of the above-mentioned relay node, and establishing communication connections between the relay node and the data sending device, and between the relay node and the data receiving device based on the handshake data;

[0040] Step S103, when the above data receiving device switches the original IP address to a test IP address, switch the IP address of the above relay node to the original IP address of the above data receiving device to enter the relay mode. The test IP address is a pre-defined IP address for data testing. In the relay mode, the relay node forwards the data sent by the data sending device to the data receiving device, and the relay node also forwards the data sent by the data receiving device to the data sending device. The relay node is further configured to regularly send a first heartbeat packet to the data sending device and the data receiving device through the heartbeat monitoring port to ensure the connection status between the relay node and the data sending device, and between the relay node and the data receiving device;

[0041] Step S104, in the above relay mode, perform data transmission, data monitoring, and data testing.

[0042] Optionally, for ease of description, the data sending device may be denoted as device A, and the data receiving device may be denoted as device B. By inserting a relay node between device A and device B, or inserting a relay node between device B and device A, a communication architecture of "device A - relay node - device B" or "device B - relay node - device A" is formed. Refer to Figure 2 , Figure 2 which is a schematic diagram of a communication structure based on a relay node provided by an embodiment of the present disclosure. The relay node is responsible for bridging and monitoring communication data streams, and at the same time supports dynamic data packet intervention.

[0043] The embodiment of the present disclosure provides an online test data communication replacement protocol based on a relay node. When applying this protocol, in addition to creating normal data sending and receiving ports during programming, a heartbeat monitoring port also needs to be created. It is necessary to ensure that the relay node, device A, and device B are in the same test network. After the relay node accesses the network, it will automatically detect and identify the target devices in the network, that is, device A and device B. In other words, the data sending device and the data receiving device can be automatically identified based on the relay node.

[0044] In an optional embodiment, the identifying the data sending device and the data receiving device based on the relay node includes:

[0045] Listening to the heartbeat monitoring port through the User Datagram Protocol (UDP) and regularly sending a third heartbeat signal;

[0046] If a target heartbeat packet feedback based on the third heartbeat signal is received, parse the target heartbeat packet to obtain the identification information of the target heartbeat packet;

[0047] Determine the sending device corresponding to the above target heartbeat data according to the above identification information;

[0048] If the sending device corresponding to the above identification information is the above data sending device, then determine that the above relay node has recognized the above data sending device;

[0049] Or, if the sending device corresponding to the above identification information is the above data receiving device, then determine that the above relay node has recognized the above data receiving device.

[0050] Optionally, the relay node can continuously monitor the heartbeat monitoring port through the User Datagram Protocol (UDP) communication method, and by periodically sending a heartbeat signal (i.e., the above third heartbeat signal), when receiving the feedback heartbeat packet (i.e., the above target heartbeat data packet), parse the packet_id value (i.e., the above identification information) in the heartbeat packet to confirm which target device the heartbeat packet is feedback from. If the packet_id value belongs to device A, then determine that the relay node has recognized device A; if the packet_id value belongs to device B, then determine that the relay node has recognized device B. Among them, device A and device B are identified by a unique identity document (ID) through packet_id.

[0051] After recognizing device A and device B, it is necessary to confirm the connection status between the relay node and device A and device B. The connection status between the relay node and device A and device B can be confirmed by the following method.

[0052] In an optional embodiment, based on the heartbeat monitoring port of the above relay node, respectively receive the handshake data sent by the above data sending device and the above data receiving device, and based on the above handshake data, establish a communication connection between the above relay node and the above data sending device, and between the above relay node and the above data receiving device, including:

[0053] Perform data monitoring based on the above heartbeat monitoring port. When the above handshake data is monitored, perform data identification on the above handshake data to obtain the data identifier of the above handshake data;

[0054] If the above data identifier belongs to the above data sending device, then confirm whether the first handshake signal and the first heartbeat signal included in the above handshake data are in a confirmed state. If so, send the first confirmation handshake information to the above data sending device, and the above data sending device receives the above first confirmation handshake information to establish a communication connection between the above relay node and the above data sending device;

[0055] If the above data identifier belongs to the above data receiving device, confirm whether the second handshake signal and the second heartbeat signal included in the above handshake data are in a confirmed state. If so, send the second confirmation handshake information to the above data receiving device, and the above data receiving device receives the above second confirmation handshake information to establish a communication connection between the above relay node and the above data receiving device.

[0056] Optionally, Device A and Device B establish a communication connection by sending a handshake signal (i.e., the above handshake data) to the heartbeat monitoring port of the relay node. The relay node is responsible for listening to the heartbeat monitoring port and parsing the received packet (i.e., the handshake data) to obtain the ID (packet_id) of the corresponding device in the packet, that is, to obtain the data identifier of the handshake data. If the ID (packet_id) belongs to Device A, confirm whether both the first handshake signal and the first heartbeat signal included in the handshake data are in a confirmed state, that is, confirm whether the handshake data sent by Device A has a "handshake" field and its state is "True", and confirm whether the handshake data sent by Device A has a "heartbeat" field and its state is "True". If both are in a confirmed state, that is, "True", the relay node will send a heartbeat confirmation packet back to Device A to establish the handshake and connection between the relay node and Device A.

[0057] Similarly, if the ID (packet_id) of the corresponding device in the packet obtained by the relay node belongs to Device B, confirm whether both the second handshake signal and the second heartbeat signal included in the handshake data are in a confirmed state, that is, confirm whether the handshake data sent by Device B has a "handshake" field and its state is "True", and confirm whether the handshake data sent by Device B has a "heartbeat" field and its state is "True". If both are in a confirmed state, that is, "True", the relay node will send a heartbeat confirmation packet back to Device B to establish the handshake and connection between the relay node and Device B.

[0058] After the relay node successfully shakes hands with the data sending device (i.e., Device A) and the data receiving device (i.e., Device B), the relay node will record the detected IP address of Device B. Here, the IP address refers to the Internet Protocol Address (abbreviated as IP). Once Device B establishes a connection with the relay node, Device B will switch the data receiving address (i.e., the above original IP address) to the test mode IP address (i.e., the above test IP address), and the data port remains unchanged. At this time, the relay node creates a new connection and automatically matches. The data receiving address of the relay node (i.e., the IP address of the relay node) will be switched to the original IP address of Device B.

[0059] Through the address change method, the direct communication between the original Device A and Device B is changed to Device A sending data to the relay node, and then the relay node forwarding the data to Device B. Moreover, the direct communication between the original Device B and Device A is changed to Device B sending data to the relay node, and then the relay node forwarding the data to Device A, thus entering the relay mode. The relay node also periodically sends heartbeat packets to Device A and Device B through the heartbeat monitoring port to ensure the connection status between the relay node and Device A, as well as between the relay node and Device B.

[0060] In the relay mode, data transmission, data monitoring, and data testing are carried out. When the data transmission, data monitoring, and data testing are completed, the relay mode is exited, and the data sending device and the data receiving device will resume the original communication mode.

[0061] Through the embodiments of the present disclosure, in the relay mode, by modifying the IP address of the data receiving device, the relay node can seamlessly intervene in the original communication link to implement full - process data packet monitoring and intervention. When the test ends, the system can automatically restore the device to the original state, thereby ensuring that the impact of the test process on the network topology and performance is minimized.

[0062] In an optional embodiment, in the above - mentioned relay mode, the data monitoring includes:

[0063] According to the data packet parsing code, the unparsed data received is parsed to obtain the actual parsed data. Among them, the above - mentioned data packet parsing code is determined according to a pre - defined data packet format specification table, and the above - mentioned data packet format specification table is used to define at least one specific character, the type of each above - mentioned specific character, the meaning of each above - mentioned specific character, and the number of bytes occupied by each above - mentioned specific character. The above - mentioned unparsed data includes the data sent by the above - mentioned data sending device and the data sent by the above - mentioned data receiving device;

[0064] On the data monitoring interface of the above - mentioned relay node, the above - mentioned actual parsed data is displayed so that the target user can perform real - time data monitoring.

[0065] Optionally, the relay node can define the data packet format specification table according to the data packet format, and use characters in a specific format to accurately define the structure of the data packet. Among them, the characters defined by the data packet format specification table include but are not limited to the characters shown in Table 1:

[0066] Among them, each character listed in the "Character" column of Table 1 is the above - mentioned at least one specific character, and Table 1 defines the type, meaning, and number of bytes occupied by the character (i.e., the specific character).

[0067] According to the data packet format specification table shown in Table 1, testers combine these characters manually to generate a data packet parsing code, so that the structure of the data packet can be flexibly adjusted for different test scenarios, data types, and data lengths, realizing efficient replacement of test data communication.

[0068]

[0069] Table 1

[0070] In practical applications, similar to traditional data communication protocols, the relay node puts the received data packet (i.e., unparsed data) into a buffer, and splits and parses the data in the buffer according to the above data packet parsing code, so as to obtain the actual value of each variable of the data in the buffer (i.e., actual data), which is used for data monitoring (i.e., data supervision). Regarding the relevant content of data supervision, please refer to the following description.

[0071] Then, on the data monitoring interface of the relay node, the parsed actual data is displayed, enabling the target user (i.e., the tester) to monitor the data in real time.

[0072] Through the embodiments of the present disclosure, network data can be monitored efficiently and flexibly in real time, and the impact on network topology and performance is effectively reduced, providing great convenience for network data testing and helping to improve network performance and data transmission accuracy.

[0073] In an optional embodiment, in the above relay mode, data testing includes:

[0074] Receiving test data sent by the target user through the data control interface;

[0075] If the data field of the above data sending device is in the over-control state, the above test data is sent to the above data receiving device through the above relay node to implement testing of the above data sending device;

[0076] If the data field of the above data receiving device is in the over-control state, the above test data is sent to the above data sending device through the above relay node to implement testing of the above data receiving device.

[0077] Optionally, in the relay mode, the tester (i.e., the above target user) can monitor the content of the data packet parsed by the relay node, which is sent by the data sending device and the data receiving device. During the monitoring process, the tester can over-control the bits of interest.

[0078] When performing interest bit override, the tester can input test data through the data control interface of the relay node. If the data field of the data sending device is in the override state, the relay node can send the test data to the data receiving device, enabling the testing of the data sending device; if the data field of the data receiving device is in the override state, the relay node can send the test data to the data sending device, enabling the testing of the data receiving device.

[0079] Through the embodiments of the present disclosure, real-time data intervention and monitoring are achieved. The tester can flexibly set interest bit test data, monitor the data transmission situation in real time, obtain the status and content of data packets, and achieve immediate intervention and adjustment.

[0080] In an alternative embodiment, in the above relay mode, data transmission includes:

[0081] Receive and cache the command data sent by the data sending device, and send the command data to the data receiving device;

[0082] In the case where the data receiving device receives the command data and sends feedback data to the relay node according to the command data, receive and cache the feedback data, and send the feedback data to the data sending device so that the data sending device receives the feedback data.

[0083] Optionally, in the relay mode, the data sending device sends command data to the relay node. After receiving the command data, the relay node caches the command data and sends the command data to the data receiving device. After receiving the command data, the data receiving device obtains feedback data based on the content of the command data and sends the feedback data to the relay node. After receiving the feedback data, the relay node caches the feedback data and sends the feedback data to the data sending device, and the data sending device receives the feedback data.

[0084] Through the embodiments of the present disclosure, when data is transmitted in the relay mode, the interaction data between the data sending device and the data receiving device can be forwarded via the relay node. Through the relay node, the consistency of data reception and transmission rates and transmission methods can be maintained, and additional network traffic and processing delays introduced by data packet mirroring or interception methods can be avoided, ensuring that the network communication performance and reliability are not affected.

[0085] In an alternative embodiment, the above relay mode is exited in the following manner:

[0086] Within a preset time, if the relay node does not receive the second heartbeat packet sent by the data sending device, it is determined that the communication connection between the relay node and the data sending device is not established;

[0087] Within the above preset time, if the above relay node does not receive the third heartbeat data packet sent by the above data receiving device, it is determined that no communication connection is established between the above relay node and the above data receiving device;

[0088] In the case that no communication connection is established between the above relay node and the above data sending device and no communication connection is established between the above relay node and the above data receiving device, exit the above relay mode;

[0089] Alternatively, receive a connection stop command sent by the target user through the data control interface;

[0090] Send the above connection stop command to the above data sending device and the above data receiving device respectively, where the above connection stop command is used to instruct the above data sending device and the above data receiving device to disconnect the communication connection with the above relay node;

[0091] In the case of receiving the confirmation disconnection messages sent by the above data sending device and the above data receiving device respectively based on the above connection stop command, exit the above relay mode.

[0092] Optionally, when the test ends, the relay mode can be exited in the following ways:

[0093] Method 1: The tester sends a connection stop command through the data control interface. The connection stop command can be triggered by clicking the disconnection on the data control interface. At this time, the relay node sends the connection stop command to the data sending device and the data receiving device respectively. The connection stop command contains a heartbeat data packet handshake signal, and the "handshake" field in the signal is "False". After the data sending device and the data receiving device receive the connection stop command, they respectively send a heartbeat confirmation data packet (i.e., the above confirmation disconnection message) back to the relay node. At this time, the system will trigger the relay node to exit the relay mode. After exiting the relay mode, the relay node will stop monitoring and intervening in data packets and restore the original data transmission path.

[0094] Method 2: Within a preset time (such as 30 seconds), if the relay node does not detect the second heartbeat data packet sent by the data sending device, it is confirmed that the data sending device and the relay node are disconnected; within a preset time (such as 30 seconds), if the relay node does not detect the third heartbeat data packet sent by the data receiving device, it is confirmed that the data receiving device and the relay node are disconnected. When it is confirmed that the data sending device and the relay node are disconnected and the data receiving device and the relay node are disconnected, exit the relay mode.

[0095] After exiting the relay mode, the data sending device and the data receiving device will restore the original data transmission path, communicate directly without passing through the relay node, and the system will ensure that the network topology and performance are restored to the state before the test, greatly reducing the impact of the test process on the network. Since the software program of the relay node is simple and efficient, it occupies very low resources and has extremely low latency, and the impact on the original network topology and performance during the whole process can be ignored.

[0096] Through the embodiments of the present disclosure, when exiting the relay mode, the impact of the test process on the network can be greatly reduced, and the impact on the performance of the original network topology is reduced.

[0097] In an optional embodiment, the above method further includes:

[0098] When exiting the above relay mode, the above data receiving device switches the above test IP address of the above data receiving device to the above original IP address according to the preset logic;

[0099] Alternatively, when exiting the above relay mode, the above data receiving device receives a recovery instruction and switches the above test IP address of the above data receiving device to the above original IP address.

[0100] Optionally, the above preset logic is: when the data receiving device establishes a communication connection with the relay node, the data receiving device uses the test IP address for data transmission; when the data receiving device disconnects from the relay node, the data receiving device uses the original IP address for data transmission.

[0101] If exiting the relay mode through the above method 2, the data receiving device and the relay node are in a disconnected state. At this time, the data receiving device will switch the test IP address to the original IP address for communication according to the preset logic.

[0102] If exiting the relay mode through the above method 1, the data receiving device can receive a recovery instruction and switch the test IP address to the original IP address for data transmission.

[0103] Through the embodiments of the present disclosure, after exiting the relay mode, the data sending device will switch to the original IP address for data transmission, ensuring that it can restore to the original data transmission path and reducing the impact of data testing on the original data transmission.

[0104] The data testing method based on the relay node in the embodiments of the present disclosure is described in detail below in combination with an embodiment. For the convenience of description, the data sending device is denoted as device A, and the data receiving device is denoted as device B.

[0105] 1. The communication link is as follows:

[0106] In this embodiment, Device A sends a command data packet to Device B every second (this command data packet corresponds to the command data sent by the above data sending device), which is defined as follows. After receiving this data packet, Device B returns an identical feedback data packet to A (this feedback data packet corresponds to the feedback data sent by the above data receiving device):

[0107] Struct dataPackage

[0108] {

[0109] Float dataTest1;

[0110] Int dataTest2;

[0111] Char dataTest3;

[0112] Bool dataTest4;

[0113] }

[0114] This data packet contains four types of data, namely floating-point type, integer type, character type, and boolean type. The length of each data packet is 10 bytes (byte).

[0115] II. Explanation of Communication Ports and Addresses:

[0116] (1) Device A:

[0117] Data receiving port: 5000;

[0118] Data sending port: 5001;

[0119] Heartbeat monitoring port: 6000

[0120] IP address: 192.168.1.10;

[0121] (2) Relay node:

[0122] Heartbeat monitoring port: 6000;

[0123] Data receiving / sending port: Automatically set according to the data ports of Device A and Device B when establishing a handshake (in this embodiment, the receiving / sending port will be automatically set to: 5001 / 5000 when establishing a connection)

[0124] IP address: 192.168.1.20;

[0125] (3) Device B:

[0126] Heartbeat monitoring port: 6000;

[0127] Data receiving port: 5001;

[0128] Data sending port: 5000;

[0129] IP address 192.168.1.11 (corresponding to the above original IP address);

[0130] Test IP address: 192.168.1.1.

[0131] III. Figure 3 It is a schematic flowchart of another method for testing relay node data provided by an embodiment of the present disclosure. As Figure 3 shown, the steps for device A and device B to establish communication connections with the relay node respectively are:

[0132] Among them, device A and device B establish communication connections by respectively sending handshake data to the relay node. The handshake data is a heartbeat data packet, and the definition of the heartbeat data packet is shown in Table 2 below:

[0133] Table 2

[0134] The embodiment of the present disclosure does not make any limitations on the fields included in the heartbeat data packet. In practical applications, fields can be added according to test requirements.

[0135] Step S301: Device A sends data content to device B (that is, Figure 3 the sending command data packet (IP: 192.168.1.11, port: 5001) in

[0136]

[0137] Table 3

[0138] Step S302: Device B sends data content to device A (that is, Figure 3 the return feedback data packet (IP: 192.168.1.10, port: 5000) in

[0139]

[0140] Table 4

[0141] Step S303: The relay node C receives the data packets (i.e., the above handshake data) from device A and device B respectively and processes them:

[0142] 1. The relay node C listens on port 6000 and receives the heartbeat data packets from device A and device B. Here, the data packets sent by which device are distinguished by identifying the packet ID (packet_id).

[0143] 2. The relay node C distinguishes the data packets sent by which device by identifying the packet ID (packet_id), and checks the handshake field and heartbeat field in the data packets. If both the handshake and heartbeat fields are True, it indicates a handshake and heartbeat request.

[0144] 3. When the identified packet ID = 01, indicating a heartbeat data packet sent by device A, when the handshake field (corresponding to the above first handshake signal) and heartbeat field (corresponding to the above first heartbeat signal) in the received data packet are parsed as True (i.e., the confirmation state), the relay node C generates a handshake confirmation packet (corresponding to the above first handshake confirmation information) and sends it to port 5000 of device A to establish a communication connection between the relay node and device A.

[0145] 4. When the identified packet ID = 02, indicating a heartbeat data packet sent by device B, when the handshake field (corresponding to the above second handshake signal) and heartbeat field (corresponding to the above second heartbeat signal) in the received data packet are parsed as True (i.e., the confirmation state), the relay node C generates a handshake confirmation packet (corresponding to the above second handshake confirmation information) and sends it to port 5001 of device B to establish a communication connection between the relay node and device B.

[0146] 5. At this time, the receiving end of device B will use the test IP address (192.168.1.1) to receive data; the relay node C creates a new connection and communicates with the actual IP address (192.168.1.11) (i.e., the original IP address of device B) and port (5001) of device B.

[0147] 6. Once the relay node C has established handshake connections with both device A and device B, the communication mode is switched from "device A - device B, device B - device A" to "device A - relay node - device B, device B - relay node - device A", and at this time, it enters the relay mode.

[0148] Step S304: Data monitoring (i.e., data surveillance) and data testing:

[0149] According to the foregoing data packet format specification table, the tester can set the data packet parsing code as "fic?", where this data packet parsing code can be referred to Figure 4 , Figure 4 is a schematic diagram of a data packet parsing code provided by an embodiment of the present disclosure. After the relay node receives the data packet sent by device A or device B (i.e., the above unparsed data), it caches the received data and parses it according to the definition of "fic?", splitting each data packet with a length of 10 into a floating-point type, an integer type, a character type, and a boolean type, thereby obtaining the actual data values of each variable (i.e., the above actual data), and these values can be used for data monitoring (i.e., data surveillance).

[0150] If the tester hopes to override the value of a certain data variable (for example, hopes to modify the value of dataTest1), then before the data is sent, the value of the "f" field in the "fic?" field can be directly modified and then sent to achieve the override of this bit of data.

[0151] Among them, the process of data monitoring based on the relay node is as follows:

[0152] Step S3041, device A sends a command data packet to the relay node;

[0153] Step S3042, device B sends a feedback data packet to the relay node;

[0154] Step S3043, the tester sets the data packet parsing codes of device A and device B to the relay node through the data control interface;

[0155] Step S3044, the relay node respectively parses and caches the command data packet sent by device A (i.e., the above command data) and the feedback data packet sent by device B (i.e., the above feedback data) according to the data packet parsing code.

[0156] The process of data testing (override) based on the relay node is as follows:

[0157] Step S3045, the tester can perform override on the interesting bits by monitoring the data packet content of device A and device B parsed by the relay node, mainly by sending override command (feedback) data to the relay node;

[0158] Step S3046, after overriding, the command data packet of device A is sent by the relay node to device B;

[0159] Step S3047, after overriding, the feedback data packet of device B is sent by the relay node to device A.

[0160] Through the embodiments of the present disclosure, efficient, flexible, and automated online data testing can be achieved. It not only realizes real-time monitoring and intervention of network data but also effectively reduces the impact on network topology and performance, providing great convenience for network data testing, and contributing to improving network performance and the accuracy of data transmission. It mainly has the following technical effects:

[0161] 1. Do not interfere with the original network structure: The automatic access and exit of relay nodes are realized through the replacement protocol, seamlessly intervening in the network without affecting the original network topology;

[0162] 2. Maintain data communication consistency: In the relay mode, the relay node can maintain the consistency of data reception and transmission rates and transmission methods, avoiding the introduction of additional network traffic and processing delays due to data packet mirroring or interception methods, and ensuring that the network communication performance and reliability are not affected;

[0163] 3. Real-time data intervention and monitoring: Testers can flexibly set the test data of the interest bit, monitor the data transmission situation in real-time, obtain the status and content of data packets, and achieve instant intervention and adjustment;

[0164] 4. Flexibly generate data packet parsing codes: The relay node can define the data packet structure through specific format string characters according to the data packet format specification table. Testers can freely combine these characters as needed to generate data packet parsing codes to adapt to different test requirements and scenarios.

[0165] After completing data monitoring and data testing, the relay mode can be exited, and the original network transmission method can be restored. Refer to Figure 5 , Figure 5 which is a schematic flow diagram of exiting the relay mode provided by the embodiments of the present disclosure. As shown in Figure 5 , the main process is as follows:

[0166] The relay node detects heartbeat data through the heartbeat monitoring port. When no heartbeat packets (heartbeat = True) are received from device A and device B for more than 30 seconds, the relay node automatically disconnects. At this time, device A and device B exit the relay node, and the original IP address (192.168.1.11) of the receiving end of device B is restored, and the transmission method is restored to the direct transmission mode.

[0167] Alternatively, through the data control interface, click the disconnection manually. The relay node sends a disconnection message (handshake = False, heartbeat = False), that is, Figure 5 the disconnection data packet shown in Figure 5Send the disconnected data packet (shown in the figure) to the relay node to confirm the disconnection. Restore the original IP address (192.168.1.11) of the receiving end of Device B, and restore the transmission mode to the direct transmission mode.

[0168] After exiting the relay mode, the system will ensure that the network topology and performance are restored to the state before the test, greatly reducing the impact of the test process on the network. Since the software program of the relay node is simple and efficient, it occupies very low resources and has extremely low latency, and the impact on the original network topology and performance during the whole process can be ignored.

[0169] The embodiment of the present disclosure provides a data testing device based on a relay node. The device includes a relay node, as Figure 6 shown. The device 60 may include: an identification module 601, a first processing module 602, a second processing module 603, and a third processing module 604, where:

[0170] The identification module 601 is used to identify a data sending device and a data receiving device based on the above-mentioned relay node;

[0171] The first processing module 602 is used to respectively receive the handshake data sent by the data sending device and the data receiving device based on the heartbeat monitoring port of the above-mentioned relay node, and establish communication connections between the above-mentioned relay node and the above-mentioned data sending device, and between the above-mentioned relay node and the above-mentioned data receiving device based on the above-mentioned handshake data;

[0172] The second processing module 603 is used to switch the IP address of the above-mentioned relay node to the original IP address of the above-mentioned data receiving device when the above-mentioned data receiving device switches the original IP address to a test IP address, so as to enter the relay mode, where the above-mentioned test IP address is a pre-defined IP address for data testing. In the above-mentioned relay mode, the relay node forwards the data sent by the data sending device to the data receiving device, and the relay node also forwards the data sent by the data receiving device to the data sending device. The above-mentioned relay node is further used to regularly send a first heartbeat data packet to the data sending device and the data receiving device through the above-mentioned heartbeat monitoring port to ensure the connection status between the above-mentioned relay node and the above-mentioned data sending device, and between the above-mentioned relay node and the above-mentioned data receiving device;

[0173] The third processing module 604 is used to perform data transmission, data monitoring, and data testing in the above-mentioned relay mode.

[0174] In an alternative embodiment, the above-mentioned third processing module 604 is specifically used for:

[0175] Parse the received unparsed data according to the data packet parsing code to obtain the actual parsed data. The data packet parsing code is determined according to a predefined data packet format specification table, which is used to define at least one specific character, the type of each specific character, the meaning of each specific character, and the number of bytes occupied by each specific character. The unparsed data includes the data sent by the data sending device and the data sent by the data receiving device;

[0176] On the data monitoring interface of the relay node, display the actual parsed data to enable the target user to perform real-time data monitoring.

[0177] In an optional embodiment, the third processing module 604 is specifically configured to:

[0178] Receive the test data sent by the target user through the data control interface;

[0179] If the data field of the data sending device is in an override state, send the test data to the data receiving device through the relay node to implement the test of the data sending device;

[0180] If the data field of the data receiving device is in an override state, send the test data to the data sending device through the relay node to implement the test of the data receiving device.

[0181] In an optional embodiment, the third processing module 604 is specifically configured to:

[0182] Receive and cache the command data sent by the data sending device, and send the command data to the data receiving device;

[0183] In the case where the data receiving device receives the command data and sends feedback data to the relay node according to the command data, receive and cache the feedback data, and send the feedback data to the data sending device so that the data sending device receives the feedback data.

[0184] In an optional embodiment, the first processing module 602 is specifically configured to:

[0185] Perform data listening based on the heartbeat monitoring port. When the handshake data is monitored, perform data identification on the handshake data to obtain the data identifier of the handshake data;

[0186] If the above data identifier belongs to the above data sending device, confirm whether the first handshake signal and the first heartbeat signal included in the above handshake data are in a confirmed state. If so, send the first confirmation handshake information to the above data sending device, and the above data sending device receives the above first confirmation handshake information to establish a communication connection between the above relay node and the above data sending device;

[0187] If the above data identifier belongs to the above data receiving device, confirm whether the second handshake signal and the second heartbeat signal included in the above handshake data are in a confirmed state. If so, send the second confirmation handshake information to the above data receiving device, and the above data receiving device receives the above second confirmation handshake information to establish a communication connection between the above relay node and the above data receiving device.

[0188] In an alternative embodiment, the above device further includes a fourth processing module for exiting the above relay mode through the following manner by the fourth processing module:

[0189] Within a preset time, if the above relay node does not receive the second heartbeat data packet sent by the above data sending device, it is determined that the communication connection between the above relay node and the above data sending device is not established;

[0190] Within the above preset time, if the above relay node does not receive the third heartbeat data packet sent by the above data receiving device, it is determined that the communication connection between the above relay node and the above data receiving device is not established;

[0191] In the case where the communication connection between the above relay node and the above data sending device is not established and the communication connection between the above relay node and the above data receiving device is not established, exit the above relay mode;

[0192] Alternatively, receive a connection stop command sent by a target user through a data control interface;

[0193] Send the above connection stop command to the above data sending device and the above data receiving device respectively, where the above connection stop command is used to instruct the above data sending device and the above data receiving device to disconnect the communication connection with the above relay node;

[0194] In the case of receiving the confirmation disconnection messages respectively sent by the above data sending device and the above data receiving device based on the above connection stop command, exit the above relay mode.

[0195] In an alternative embodiment, the above device further includes a switching module for:

[0196] In the case of exiting the above relay mode, the above data receiving device switches the above test IP address of the above data receiving device to the above original IP address according to a preset logic;

[0197] Alternatively, in the case of exiting the above relay mode, the above data receiving device receives a recovery instruction and switches the above test IP address of the above data receiving device to the above original IP address.

[0198] In an optional embodiment, the above identification module is specifically configured to:

[0199] Listen to the above heartbeat monitoring port through the User Datagram Protocol (UDP) and periodically send a third heartbeat signal;

[0200] If a target heartbeat data packet is received in response to the above third heartbeat signal, parse the above target heartbeat data packet to obtain the identification information of the above target heartbeat data packet;

[0201] Determine the sending device corresponding to the above target heartbeat data according to the above identification information;

[0202] If the sending device corresponding to the above identification information is the above data sending device, determine that the above relay node has identified the above data sending device;

[0203] Alternatively, if the sending device corresponding to the above identification information is the above data receiving device, determine that the above relay node has identified the above data receiving device.

[0204] The device according to the embodiments of the present disclosure can execute the method provided by the embodiments of the present disclosure, and its implementation principle is similar and has corresponding technical effects. The actions performed by each module in the device according to the embodiments of the present disclosure correspond to the steps in the method according to the embodiments of the present disclosure. For the detailed function descriptions of the modules of the device, reference can be specifically made to the descriptions in the corresponding methods shown above, and details are not described herein again.

[0205] An electronic device (computer device / system) is provided in the embodiments of the present disclosure, including a memory, a processor, and a computer program stored on the memory, and the processor executes the above computer program to implement the steps of the method provided by any optional embodiment of the present disclosure.

[0206] In an optional embodiment, an electronic device is provided, as Figure 7 shown Figure 7The electronic device 4000 shown includes: a processor 4001 and a memory 4003. Among them, the processor 4001 and the memory 4003 are connected, such as being connected through a bus 4002. Optionally, the electronic device 4000 may further include a transceiver 4004, and the transceiver 4004 can be used for data interaction between this electronic device and other electronic devices, such as data sending and / or data receiving, etc. It should be noted that in practical applications, the transceiver 4004 is not limited to one, and the structure of the electronic device 4000 does not constitute a limitation to the embodiments of the present disclosure.

[0207] The processor 4001 may be a CPU (Central Processing Unit, central processor), a general-purpose processor, a DSP (Digital Signal Processor, data signal processor), an ASIC (Application Specific Integrated Circuit, application-specific integrated circuit), an FPGA (Field Programmable Gate Array, field programmable gate array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute various exemplary logic blocks, modules, and circuits described in combination with the content disclosed in the present disclosure. The processor 4001 may also be a combination that realizes computing functions, such as a combination including one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0208] The bus 4002 may include a path for transmitting information between the above components. The bus 4002 may be a PCI (Peripheral Component Interconnect, peripheral component interconnect standard) bus or an EISA (Extended Industry Standard Architecture, extended industry standard structure) bus, etc. The bus 4002 may be divided into an address bus, a data bus, a control bus, etc. For the sake of representation, Figure 7 only a thick line is used to represent it in the figure, but it does not mean that there is only one bus or one type of bus.

[0209] The memory 4003 can be a ROM (Read Only Memory), or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory), or other types of dynamic storage devices that can store information and instructions. It can also be an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory), or other optical disc storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media, other magnetic storage devices, or any other medium that can be used to carry or store computer programs and can be read by a computer, which is not limited herein.

[0210] The memory 4003 is used to store the computer program for implementing the embodiments of the present disclosure and is controlled by the processor 4001 for execution. The processor 4001 is used to execute the computer program stored in the memory 4003 to implement the steps shown in the foregoing method embodiments.

[0211] The embodiments of the present disclosure provide a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps and corresponding contents of the foregoing method embodiments can be implemented.

[0212] The embodiments of the present disclosure further provide a computer program product, including a computer program. When the computer program is executed by a processor, the steps and corresponding contents of the foregoing method embodiments can be implemented.

[0213] It should be understood that although the flowchart of the embodiments of the present disclosure indicates each operation step by an arrow, the execution order of these steps is not limited to the order indicated by the arrow. Unless there is a clear description in this article, in some implementation scenarios of the embodiments of the present disclosure, the implementation steps in each flowchart can be executed in other orders according to requirements. In addition, some or all of the steps in each flowchart may include multiple sub-steps or multiple stages based on the actual implementation scenario. Some or all of these sub-steps or stages can be executed at the same time, and each sub-step or stage among these sub-steps or stages can also be executed at different times respectively. In the scenario where the execution times are different, the execution order of these sub-steps or stages can be flexibly configured according to requirements, and the embodiments of the present disclosure do not limit this.

[0214] The above are only optional implementation manners of some implementation scenarios of the present disclosure. It should be noted that for those of ordinary skill in the art, without departing from the technical concept of the solution of the present disclosure, other similar implementation means based on the technical idea of the present disclosure also fall within the protection scope of the embodiments of the present disclosure.

Claims

1. A data testing method based on relay nodes, characterized in that: The method is performed by a relay node, and the method includes: identifying a data sending device and a data receiving device based on the relay node; Based on the heartbeat monitoring port of the relay node, receiving the handshake data sent by the data sending device and the data receiving device respectively, and establishing a communication connection between the relay node and the data sending device, and between the relay node and the data receiving device based on the handshake data; In the case where the data receiving device switches the original IP address to the test IP address, the IP address of the relay node is switched to the original IP address of the data receiving device to enter the relay mode, wherein the test IP address is a predefined IP address for data testing, and in the relay mode, the relay node forwards the data sent by the data sending device to the data receiving device, and the relay node forwards the data sent by the data receiving device to the data sending device, and the relay node is further used to periodically send a first heartbeat data packet to the data sending device and the data receiving device through the heartbeat monitoring port to ensure the connection status of the relay node and the data sending device, and the connection status of the relay node and the data receiving device; In the relay mode, data transmission, data monitoring, and data testing are performed.

2. The method according to claim 1, characterized in that In the relay mode, data monitoring includes: Parsing the received unparsed data according to the data packet parsing code to obtain the parsed actual data, wherein the data packet parsing code is determined according to a predefined data packet format specification table, the data packet format specification table is used to define at least one specific character, the type of each of the specific characters, the meaning of each of the specific characters and the number of bytes occupied by each of the specific characters, and the unparsed data includes the data sent by the data sending device and the data sent by the data receiving device; The parsed actual data is displayed on the data monitoring interface of the relay node, so that the target user can perform real-time data monitoring.

3. The method according to claim 1, characterized in that In the relay mode, the data test includes: Receive test data sent by the target user through the data control interface; If the data field of the data sending device is in an overriding state, the test data is sent to the data receiving device through the relay node to implement a test on the data sending device, wherein the data field of the data sending device is in an overriding state, which means that the test data set by the target user is sent to the data receiving device through the relay node instead of the data sending device; If the data field of the data receiving device is in an over-control state, the test data is sent to the data sending device through the relay node to implement a test on the data receiving device, wherein the data field of the data receiving device being in an over-control state indicates that the test data set by the target user is sent to the data sending device by replacing the data receiving device through the relay node.

4. The method according to claim 1, characterized in that: In the relay mode, data transmission includes: receiving and buffering command data sent by the data sending device, and sending the command data to the data receiving device; When the data receiving device receives the command data and sends feedback data to the relay node according to the command data, the feedback data is received and buffered, and the feedback data is sent to the data sending device so that the data sending device receives the feedback data.

5. The method according to claim 1, characterized in that: The heartbeat monitoring port based on the relay node receives handshake data sent by the data sending device and the data receiving device respectively, and establishes a communication connection between the relay node and the data sending device, and between the relay node and the data receiving device based on the handshake data, including: Performing data monitoring based on the heartbeat monitoring port, and in the case of monitoring the handshake data, performing data identification on the handshake data to obtain a data identifier of the handshake data; If the data identifier belongs to the data sending device, confirm whether the first handshake signal and the first heartbeat signal contained in the handshake data are in a confirmation state, and if so, send a first confirmation handshake message to the data sending device, and the data sending device receives the first confirmation handshake message to establish a communication connection between the relay node and the data sending device; If the data identifier belongs to the data receiving device, confirm whether the second handshake signal and the second heartbeat signal contained in the handshake data are in a confirmation state. If so, send second confirmation handshake information to the data receiving device, and the data receiving device receives the second confirmation handshake information to establish a communication connection between the relay node and the data receiving device.

6. The method according to claim 1, characterized in that The method further includes exiting the relay mode by: If the relay node does not receive the second heartbeat data packet sent by the data sending device within a preset time, it is determined that the relay node and the data sending device have not established a communication connection; If the relay node does not receive the third heartbeat data packet sent by the data receiving device within the preset time, it is determined that the relay node and the data receiving device have not established a communication connection; When the relay node and the data sending device do not establish a communication connection, and the relay node and the data receiving device do not establish a communication connection, exit the relay mode; Alternatively, receiving a connection stop command sent by the target user through the data control interface; Sending the connection stop command to the data sending device and the data receiving device respectively, wherein the connection stop command is used to instruct the data sending device and the data receiving device to disconnect the communication connection with the relay node; When receiving the disconnection confirmation messages respectively sent by the data sending device and the data receiving device based on the connection stop command, the relay mode is exited.

7. The method according to claim 6, characterized in that The method further comprises: In the case of exiting the relay mode, the data receiving device switches the test IP address of the data receiving device to the original IP address according to a preset logic; Alternatively, in the case of exiting the relay mode, the data receiving device receives a recovery instruction and switches the test IP address of the data receiving device to the original IP address.

8. The method according to claim 1, characterized in that: The identifying of a data sending device and a data receiving device based on the relay node includes: Monitor the heartbeat monitoring port via the User Datagram Protocol UDP and periodically send a third heartbeat signal; If a target heartbeat data packet based on the third heartbeat signal feedback is received, the target heartbeat data packet is parsed to obtain identification information of the target heartbeat data packet; Determine a sending device corresponding to the target heartbeat data according to the identification information; If the sending device corresponding to the identification information is the data sending device, determining that the relay node recognizes the data sending device; Alternatively, if the sending device corresponding to the identification information is the data receiving device, it is determined that the relay node recognizes the data receiving device.

9. A data testing device based on a relay node, characterized in that: The device comprises a relay node, and the device includes: An identification module, used to identify a data sending device and a data receiving device based on the relay node; A first processing module, configured to receive handshake data sent by the data sending device and the data receiving device respectively based on the heartbeat monitoring port of the relay node, and to establish a communication connection between the relay node and the data sending device, and between the relay node and the data receiving device based on the handshake data; a second processing module, configured to switch the IP address of the relay node to the original IP address of the data receiving device to enter a relay mode when the data receiving device switches the original IP address to a test IP address, wherein the test IP address is a predefined IP address for data testing, and in the relay mode, the relay node forwards the data sent by the data sending device to the data receiving device, and the relay node forwards the data sent by the data receiving device to the data sending device, and the relay node is further configured to periodically send a first heartbeat data packet to the data sending device and the data receiving device through the heartbeat monitoring port to ensure the connection status between the relay node and the data sending device, and between the relay node and the data receiving device; The third processing module is used to perform data transmission, data monitoring, and data testing in the relay mode.

10. An electronic device comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Test data communication and test method and device, equipment and a storage medium

    CN110069413A

  • Agent monitoring method of server and related product

    CN110740078A