Internode handshake interaction simulation method and device, equipment and storage medium
By building and configuring handshake simulation component nodes in the simulation environment, the problem of difficult interaction between multi-load nodes is solved, and the reliability of functional verification and testing of the drone mission system is realized, improving the user experience.
Patent Information
- Application Number
- CN202411935105.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-03-14
AI Technical Summary
In a simulation environment, it is difficult for the prior art to effectively simulate the interaction between multi-load nodes, resulting in difficulty in verifying the function of the UAV mission system and affecting the reliability of the system simulation.
By determining the data transmission interface and data reception interface based on the simulation RS422 bus in the simulation environment, an initial handshake simulation component node is built, and its working logic is configured according to the handshake packet format and handshake interaction process, the target handshake simulation component node is obtained, and finally connected to the simulation environment to realize the handshake interaction process between nodes.
Successfully simulate the interaction of multi-load nodes in the simulation environment, ensuring the normal operation and testing of the UAV mission system, and improving the user experience.
Smart Images

Figure CN119629070A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of unmanned aerial vehicles (UAVs), and in particular to a method, device, equipment and storage medium for simulating handshake interaction between nodes. Background Art
[0002] As aviation technology evolves, drone mission systems are widely used in fields such as military reconnaissance and environmental monitoring. During the development and testing of drone mission systems, the creation of a simulation environment is crucial, enabling verification of system functionality, performance, and stability without relying on actual hardware.
[0003] However, current simulation environments for drone mission systems face technical bottlenecks in handling payload node communication and interaction. Traditional simulation solutions typically simulate only a single payload node, which also serves as the drone mission system simulation node. Consequently, during the operation of a single payload node, interactions between multiple payload nodes cannot be simulated, making it difficult for developers to verify system functionality and impacting the reliability of the simulation. If a single payload node becomes disconnected, testing cannot be performed.
[0004] Therefore, how to simulate the interaction of multiple payload nodes in a simulation environment to ensure the normal operation and testing of the UAV mission system is a technical problem that needs to be solved urgently. Summary of the Invention
[0005] In view of this, the present invention aims to provide a method, apparatus, device, and storage medium for simulating handshake interactions between nodes, which can simulate the interactions between multiple load nodes in a simulation environment. The specific solution is as follows:
[0006] In a first aspect, the present application provides a method for simulating handshake interactions between nodes, comprising:
[0007] Determine the corresponding data transmission interface and data receiving interface based on the simulated RS422 bus in the simulation environment, and build an initial handshake simulation component node based on the simulated RS422 bus, the data transmission interface and the data receiving interface;
[0008] Determining a handshake data packet format and a handshake interaction process of the initial handshake simulation component node, and configuring a working logic of the initial handshake simulation component node based on the handshake data packet format and the handshake interaction process to obtain a target handshake simulation component node;
[0009] Configuring the simulation environment based on the target handshake simulation component node to connect the target handshake simulation component node to the simulation environment;
[0010] The handshake interaction process between nodes is performed using the target handshake simulation component node that has been connected to the simulation environment and the drone mission system simulation node; the drone mission system simulation node is a node obtained after simulating the drone mission system.
[0011] Optionally, the handshake interaction process includes:
[0012] Sending a handshake request packet to the target handshake simulation component node through the UAV mission system simulation node;
[0013] Identify the handshake request packet by the target handshake simulation component node to obtain an identification result; when the identification result indicates successful identification, respond to the handshake request packet and send a handshake response packet to the UAV mission system simulation node;
[0014] When the UAV mission system simulation node confirms that the handshake is successful, it sends a handshake confirmation packet to the target handshake simulation component node.
[0015] Optionally, determining the handshake data packet format and handshake interaction process of the initial handshake simulation component node includes:
[0016] Using a data monitoring tool and / or a data analysis tool to obtain data packet format information during actual data transmission, and determining a handshake data packet format corresponding to the initial handshake simulation component node based on the data packet format information;
[0017] The handshake steps and handshake timestamps in the actual handshake communication process are obtained, and the handshake interaction process corresponding to the initial handshake simulation component node is determined using the handshake steps and the handshake timestamps.
[0018] Optionally, configuring the working logic of the initial handshake simulation component node based on the handshake data packet format and the handshake interaction process to obtain a target handshake simulation component node includes:
[0019] Logic code information is determined based on the handshake data packet format, the handshake interaction process and the preset statement, and the working logic of the initial handshake simulation component node is configured using the logic code information to obtain a target handshake simulation component node.
[0020] Optionally, configuring the simulation environment based on the target handshake simulation component node includes:
[0021] Initializing the target handshake simulation component node based on a preset component initialization rule to complete a node initialization operation;
[0022] The communication parameters of the simulated RS422 bus in the simulation environment are configured based on simulation requirements, and the target handshake simulation component node is connected to the simulated RS422 bus.
[0023] Optionally, connecting the target handshake simulation component node to the simulation environment includes:
[0024] A dynamic link library file corresponding to the target handshake simulation component node is obtained, and the dynamic link library file is saved in the simulation environment.
[0025] Optionally, determining the corresponding data sending interface and data receiving interface based on the simulated RS422 bus in the simulation environment includes:
[0026] Determine the data transmission interface based on the serial data frame format, protocol requirements and preset data transmission code segment information of the simulated RS422 bus;
[0027] A data receiving interface is determined based on the serial data frame format, the protocol requirements, and preset data receiving code segment information.
[0028] In a second aspect, the present application provides a device for simulating handshake interactions between nodes, comprising:
[0029] A node construction module is used to determine a corresponding data transmission interface and a data receiving interface based on a simulated RS422 bus in a simulation environment, and to construct an initial handshake simulation component node based on the simulated RS422 bus, the data transmission interface, and the data receiving interface;
[0030] a node determination module, configured to determine a handshake data packet format and a handshake interaction process of the initial handshake simulation component node, and configure a working logic of the initial handshake simulation component node based on the handshake data packet format and the handshake interaction process to obtain a target handshake simulation component node;
[0031] A node configuration module, configured to configure the simulation environment based on the target handshake simulation component node to connect the target handshake simulation component node to the simulation environment;
[0032] The handshake interaction module is used to use the target handshake simulation component node that has been connected to the simulation environment and the drone mission system simulation node to execute the handshake interaction process between nodes; the drone mission system simulation node is a node obtained after simulating the drone mission system.
[0033] In a third aspect, the present application provides an electronic device, comprising:
[0034] Memory, used to store computer programs;
[0035] The processor is configured to execute the computer program to implement the aforementioned inter-node handshake interaction simulation method.
[0036] In a fourth aspect, the present application provides a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the aforementioned inter-node handshake interaction simulation method is implemented.
[0037] In the present application, a corresponding data sending interface and a data receiving interface are determined based on a simulated RS422 bus in a simulation environment, and an initial handshake simulation component node is constructed based on the simulated RS422 bus, the data sending interface and the data receiving interface; a handshake data packet format and a handshake interaction process of the initial handshake simulation component node are determined, and the working logic of the initial handshake simulation component node is configured based on the handshake data packet format and the handshake interaction process to obtain a target handshake simulation component node; the simulation environment is configured based on the target handshake simulation component node to connect the target handshake simulation component node to the simulation environment; the target handshake simulation component node that has been connected to the simulation environment is used to execute the handshake interaction process between nodes with the drone mission system simulation node; the drone mission system simulation node is a node obtained after simulating the drone mission system. As can be seen from the above, this application determines the data transceiver interface based on the simulated RS422 bus, and uses the data transceiver interface to construct an initial handshake simulation component node. According to the handshake data packet format and handshake interaction process of the initial handshake simulation component node, the working logic is configured to obtain the target handshake simulation component node. Finally, the target handshake simulation component node is configured and connected to the simulation environment, so that it executes the handshake interaction process with the drone mission system simulation node. In this way, this application can simulate the interaction of multiple payload nodes in the simulation environment, thereby ensuring the normal operation and testing of the drone mission system and improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0039] Figure 1 This is a flow chart of a method for simulating handshake interactions between nodes disclosed in this application;
[0040] Figure 2 This is a schematic diagram of a specific method for simulating handshake interactions between nodes disclosed in this application;
[0041] Figure 3 A flow chart of a handshake interaction process disclosed in this application;
[0042] Figure 4 This is a schematic diagram of a specific handshake interaction process disclosed in this application;
[0043] Figure 5 This is a schematic diagram of the structure of a node handshake interaction simulation device disclosed in this application;
[0044] Figure 6 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION
[0045] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0046] Currently, in the simulation environment, there is a technical bottleneck in the simulation of drone mission systems in terms of handling payload node communication and interaction. Traditional simulation solutions mostly simulate only a single payload node, and the single payload node is the drone mission system simulation node. Then, during the operation of a single payload node, it is impossible to simulate the interaction between multiple payload nodes, making it difficult for developers to verify the functions of the system, affecting the reliability of the system simulation. If a single payload node enters a disconnected state, the testing work cannot be guaranteed. To this end, the present application provides a method, device, equipment, and storage medium for simulating handshake interactions between nodes, which can simulate the interaction of multiple payload nodes in a simulation environment.
[0047] See also Figure 1 and Figure 2 As shown, an embodiment of the present invention discloses a method for simulating handshake interaction between nodes, including:
[0048] Step S11: determining a corresponding data sending interface and a data receiving interface based on a simulated RS422 bus in a simulation environment, and constructing an initial handshake simulation component node based on the simulated RS422 bus, the data sending interface, and the data receiving interface.
[0049] First of all, it should be emphasized that in this embodiment, the simulation environment is provided by the simulation platform. Figure 2As shown in the figure, in the simulation environment, in addition to the host computer test software, components such as the simulated RS422 bus, single payload node (i.e., UAV mission system simulation node), and target handshake simulation component node are all simulated. Through virtual construction, a controllable and efficient testing and verification platform is provided for subsequent handshake simulation and other operations.
[0050] In the present embodiment, the data transmission interface is determined based on the serial data frame format, protocol requirements and preset data transmission code segment information of the simulated RS422 bus, and the data reception interface is determined based on the serial data frame format, the protocol requirements and preset data reception code segment information. It is understandable that the data transmission interface and the data reception interface are designed according to the serial data frame format and protocol requirements of the simulated RS422 bus to ensure that the data transmission interface and the data reception interface support the simulated RS422 bus.
[0051] Furthermore, in RS422 bus communication, the data format primarily refers to the structure and encoding method of data transmission. The data format used in this embodiment is a serial data frame format, which typically consists of a start bit (i.e., a start bit), data bits (i.e., a data bit), a parity bit (i.e., a parity bit), and a stop bit (i.e., a stop bit). Specifically, the start bit is 1 bit, typically 0, indicating the beginning of data; the data bits are typically 8 bits, but can also be 7 bits, indicating the transmitted data; the parity bit can be 1 bit, used for error detection, with common parity options being even, odd, or no parity; and the stop bit is 1 or 2 bits, indicating the end of data transmission.
[0052] Furthermore, in this embodiment, the data receiving interface and data transmitting interface are constructed based on the serial data frame format and protocol requirements of the simulated RS422 bus, as well as the preset data receiving code segment information. Their purpose is to establish channels for receiving and transmitting data in the simulated environment. Therefore, the functions of the data receiving interface and data transmitting interface can be implemented by selecting an appropriate application programming interface (API). In this embodiment, a design example for the data receiving interface can be shown below:
[0053] int rs422_receive(char *buffer, int buffer_size);
[0054] parameter:
[0055] buffer;
[0056] buffer_size;
[0057] Return value:
[0058] Returns the number of bytes of data received on success, or -1 on failure.
[0059] In the above example, buffer is the pointer to the buffer for receiving data, and buffer_size is the buffer size, the maximum number of bytes to receive.
[0060] The design example for the data sending interface can be shown as follows:
[0061] int rs422_send(const char *data, int len);
[0062] parameter:
[0063] data;
[0064] len;
[0065] Return value: Returns the number of bytes sent on success, -1 on failure.
[0066] In the above example, data is the pointer to the data to be sent, and len is the length of the data (that is, the number of bytes).
[0067] Step S12: determining the handshake data packet format and handshake interaction process of the initial handshake simulation component node, and configuring the working logic of the initial handshake simulation component node based on the handshake data packet format and the handshake interaction process to obtain a target handshake simulation component node.
[0068] In this embodiment, a data monitoring tool and / or a data analysis tool are used to obtain data packet format information during actual data transmission, and based on this data packet format information, a handshake packet format corresponding to the initial handshake simulation component node is determined. Specifically, the data monitoring tool can capture data packets flowing through the simulated RS422 bus in real time during actual data transmission, recording their detailed byte structure, field contents, and other information. The data analysis tool then conducts in-depth mining and organization of this collected data, analyzing a large number of data packets to extract representative features and patterns, thereby determining a handshake packet format compatible with the initial handshake simulation component node. The data monitoring tool may include a data packet capture tool, and the data analysis tool may include an oscilloscope. Specifically, the data packet capture tool, oscilloscope, etc. are used to analyze handshake packets during actual data transmission, analyzing and recording information such as the byte structure and field meanings within the handshake data.
[0069] Furthermore, the handshake steps and handshake timestamps of the actual handshake communication process are obtained, and the handshake interaction process corresponding to the initial handshake simulation component node is determined using the handshake steps and the handshake timestamps. It should be noted that the handshake steps cover the process from initiating the handshake request to receiving the response and then to the final confirmation, while the handshake timestamp clarifies the time interval and sequence between each step. Therefore, the handshake interaction process can be constructed using the handshake steps and handshake timestamps.
[0070] After determining the handshake packet format and handshake interaction process, logic code information is determined based on the handshake packet format, the handshake interaction process, and a preset statement, and the logic code information is used to configure the working logic of the initial handshake simulation component node to obtain a target handshake simulation component node. The preset statement can be a statement in the C / C++ language, and the logic code information can include data reception logic, data transmission logic, and handshake logic. The data reception logic can include data reception, data parsing, and data verification.
[0071] Specifically, data reception is to monitor the serial port of the simulation environment, and the data receiving interface receives the data sent from the serial port. Data parsing is to check whether the received data is complete and valid, such as removing the start bit and stop bit and extracting the data part. Data verification can be to ensure whether the data has errors by checking the check bit. The data sending logic can include data preparation, data sending and sending confirmation. Specifically, data preparation is to convert the data that the target handshake simulation component node needs to send into a format that complies with the protocol, for example, start bit, stop bit, check bit, etc. can be added. Data sending is to send the prepared data through the serial port interface of the simulation environment. When the sending confirmation is that the data is sent after completion, the target handshake simulation component node can choose to wait for confirmation, and continue to send the next data after waiting for confirmation that the sending is complete. And after the confirmation of sending is completed, the API return value is the same as the size of the sent data. In addition, it should be noted that the handshake logic contains data sending logic and data receiving logic.
[0072] Furthermore, the operating logic includes logging. Specifically, it records the timestamp of each data packet from the moment it is sent, as well as the order in which they were sent. This detailed time and sequence information is systematically stored as a log. This allows technicians to quickly locate the problem and analyze the potential issues that may have led to the failure based on the time and sequence recorded in the log, allowing for efficient debugging and optimization.
[0073] Step S13: configuring the simulation environment based on the target handshake simulation component node to connect the target handshake simulation component node to the simulation environment.
[0074] In this embodiment, after obtaining the target handshake simulation component node, the target handshake simulation component node is initialized based on the preset component initialization rules to complete the node initialization operation. The initialization operation may include clearing and initializing the data sending area and receiving buffer to ensure the accuracy and stability of data transmission, or resetting the internal status register to put it in the initial ready state, waiting for the handshake simulation process to start.
[0075] Furthermore, in this embodiment, the communication parameters of the simulated RS422 bus in the simulated environment are configured based on the simulation requirements, and the target handshake simulation component node is connected to the simulated RS422 bus. The configuration of the communication parameters of the simulated RS422 bus may include but is not limited to configuring the baud rate, data bits, etc. In the process of connecting the target handshake simulation component node to the simulated RS422 bus, the following configuration may be used: Figure 2 The host computer test software shown performs a preliminary test to check whether the module can correctly connect to the simulated RS422 bus and verify whether the test data packets are sent and received normally. Finally, the dynamic link library (DLL) file corresponding to the target handshake simulation component node is obtained and saved in the simulation environment.
[0076] It should be noted that the dynamic link library file method of dynamic linking allows it to be loaded and called as needed during simulation runtime, greatly improving system flexibility and resource utilization. When saving the dynamic link library file to the simulation environment, it is necessary to ensure the integrity and correctness of the file. At the same time, it must be placed in the appropriate location according to the simulation environment's file management rules and path setting requirements so that it can be accurately loaded and used in subsequent simulation processes.
[0077] Step S14: Utilize the target handshake simulation component node connected to the simulation environment and the UAV mission system simulation node to execute the handshake interaction process between nodes; the UAV mission system simulation node is a node obtained after simulating the UAV mission system.
[0078] After the target handshake simulation component node has been successfully saved to the simulation environment, it can be used to execute the handshake interaction process between nodes with the drone mission system simulation node. The drone mission system simulation node is an abstraction and simulation of the actual drone mission system and a key component of the entire simulation system. The state and behavior of the drone mission system simulation node can reflect the operation of the actual drone mission system in the corresponding scenario.
[0079] In addition, the target handshake simulation component node has a clear functional positioning in this embodiment. Its design purpose is specific and it only focuses on realizing the handshake process simulation with the drone mission system simulation node. It does not have other actual additional functions such as data processing and complex calculations. It performs corresponding handshake operations based on the preset handshake data packet format and handshake interaction process.
[0080] As can be seen from the above, this application determines the data transceiver interface based on the simulated RS422 bus, and uses the data transceiver interface to construct an initial handshake simulation component node. According to the handshake data packet format and handshake interaction process of the initial handshake simulation component node, the working logic is configured to obtain the target handshake simulation component node. Finally, the target handshake simulation component node is configured and connected to the simulation environment, so that it executes the handshake interaction process with the drone mission system simulation node. In this way, this application can simulate the interaction of multiple payload nodes in the simulation environment, thereby ensuring the normal operation and testing of the drone mission system and improving the user experience.
[0081] See also Figure 3 and Figure 4 As shown, in order to enable the target handshake simulation component node and the drone mission system simulation node to execute the handshake interaction process between nodes, the embodiment of the present application further provides a specific inter-node handshake interaction simulation method, including:
[0082] Step S21: Send a handshake request packet to the target handshake simulation component node through the UAV mission system simulation node.
[0083] In the simulation environment, the single-payload node (corresponding to the UAV mission system simulation node) initiates the handshake process at time t0. Following the established communication protocol and data packet format requirements, it generates and sends a handshake request packet to the target handshake simulation component node. This packet contains the single-payload node's unique identification information, encoded using specific encoding rules so that the target handshake simulation component node can accurately identify its source. The request packet also carries a clear request flag, set to a specific value, to inform the target handshake simulation component node that the communication intention is to initiate a handshake request, indicating that the single-payload node is ready to enter the communication initialization phase and begin the handshake interaction process with the target handshake simulation component node.
[0084] Step S22: Identify the handshake request packet through the target handshake simulation component node to obtain an identification result; when the identification result indicates that the identification is successful, respond to the handshake request packet and send a handshake response packet to the UAV mission system simulation node.
[0085] The target handshake simulation component node is constantly listening, waiting to receive a handshake request packet from the single-payload node. Upon receiving a handshake request packet after time t0, the identification process begins. First, the handshake request packet format is verified to see if it conforms to the predefined handshake request packet structure. Next, the identity and request flags within the handshake request packet are parsed and verified. By comparing these with an internally stored list of valid node identifiers, the legitimacy of the sender and the validity of the request are confirmed.
[0086] In a specific embodiment, if the recognition result indicates that the recognition failed, the target handshake simulation component node can send an error feedback package to the UAV mission system simulation node so that the UAV mission system simulation node can clearly understand the reason why the handshake request was rejected, and thus can perform the corresponding operation of resending the handshake request package, so that the target handshake simulation component node receives the handshake request package again.
[0087] In another specific embodiment, if the recognition result indicates that everything is normal, that is, the recognition is successful, the target handshake simulation component node generates a handshake response packet containing the target handshake simulation component node confirmation information based on the received request information and its own configuration parameters at time t1. Assuming that there is a delay of 50ms between t0 and t1, then t1=t0+50ms. The response packet is encapsulated in accordance with the format specified by the communication protocol, and the confirmation information therein records in detail the status identification of the target handshake simulation component node being ready for communication and the confirmation feedback of the single-load node request. Subsequently, the handshake response packet is sent back to the single-load node through the communication interface in the simulation environment to complete the response operation to the handshake request and advance the handshake process to the next stage.
[0088] Step S23: After the UAV mission system simulation node confirms that the handshake is successful, it sends a handshake confirmation packet to the target handshake simulation component node.
[0089] After sending a handshake request packet, the single-load node continuously listens for responses from the target handshake simulation component node. Upon receiving the handshake response packet at time t1, the handshake response packet is checked according to the preset verification rules, including the accuracy of the confirmation information and the integrity check of the packet. If the verification passes, the single-load node generates a handshake confirmation packet at time t2. This packet sets a specific flag to confirm the success of the handshake and includes some possible communication initialization parameters, such as the baud rate and data bit length for subsequent data transmission. Assuming that there is a 50ms delay between t1 and t2, then t2 = t1 + 50ms. Finally, the handshake confirmation packet is sent back to the target handshake simulation component node, marking the successful completion of the handshake interaction process between the nodes. The two parties have successfully established a preliminary communication connection and can enter the subsequent formal data communication stage.
[0090] Accordingly, see Figure 5 As shown, an embodiment of the present application provides a device for simulating handshake interaction between nodes, including:
[0091] A node construction module 11 is used to determine a corresponding data sending interface and a data receiving interface based on a simulated RS422 bus in a simulation environment, and to construct an initial handshake simulation component node based on the simulated RS422 bus, the data sending interface, and the data receiving interface;
[0092] A node determination module 12 is configured to determine a handshake data packet format and a handshake interaction process of the initial handshake simulation component node, and configure a working logic of the initial handshake simulation component node based on the handshake data packet format and the handshake interaction process to obtain a target handshake simulation component node;
[0093] A node configuration module 13 is configured to configure the simulation environment based on the target handshake simulation component node to connect the target handshake simulation component node to the simulation environment;
[0094] The handshake interaction module 14 is used to use the target handshake simulation component node that has been connected to the simulation environment to execute the handshake interaction process between nodes with the drone mission system simulation node; the drone mission system simulation node is a node obtained after simulating the drone mission system.
[0095] As can be seen from the above, this application determines the data transceiver interface based on the simulated RS422 bus, and uses the data transceiver interface to construct an initial handshake simulation component node. According to the handshake data packet format and handshake interaction process of the initial handshake simulation component node, the working logic is configured to obtain the target handshake simulation component node. Finally, the target handshake simulation component node is configured and connected to the simulation environment, so that it executes the handshake interaction process with the drone mission system simulation node. In this way, this application can simulate the interaction of multiple payload nodes in the simulation environment, thereby ensuring the normal operation and testing of the drone mission system and improving the user experience.
[0096] In a specific implementation, the handshake interaction module 14 specifically includes:
[0097] A handshake request unit, configured to send a handshake request packet to the target handshake simulation component node via the UAV mission system simulation node;
[0098] a handshake response unit, configured to identify the handshake request packet through the target handshake simulation component node to obtain an identification result; when the identification result indicates successful identification, respond to the handshake request packet and send a handshake response packet to the UAV mission system simulation node;
[0099] The handshake confirmation unit is used to send a handshake confirmation packet to the target handshake simulation component node after the UAV mission system simulation node confirms that the handshake is successful.
[0100] In a specific implementation, the node determination module 12 specifically includes:
[0101] a format determination unit, configured to obtain data packet format information during actual data transmission using a data monitoring tool and / or a data analysis tool, and determine a handshake data packet format corresponding to the initial handshake simulation component node based on the data packet format information;
[0102] The process determination unit is used to obtain the handshake steps and handshake timestamps in the actual handshake communication process, and use the handshake steps and the handshake timestamps to determine the handshake interaction process corresponding to the initial handshake simulation component node.
[0103] In a specific implementation, the node determination module 12 specifically includes:
[0104] A node determination unit is used to determine logic code information based on the handshake data packet format, the handshake interaction process and the preset statement, and use the logic code information to configure the working logic of the initial handshake simulation component node to obtain a target handshake simulation component node.
[0105] In a specific implementation, the node configuration module 13 specifically includes:
[0106] A node initialization unit, configured to initialize the target handshake simulation component node based on a preset component initialization rule to complete a node initialization operation;
[0107] The node access unit is used to configure the communication parameters of the simulated RS422 bus in the simulation environment based on simulation requirements, and to access the target handshake simulation component node to the simulated RS422 bus.
[0108] In a specific implementation, the node configuration module 13 specifically includes:
[0109] The file saving unit is used to obtain a dynamic link library file corresponding to the target handshake simulation component node and save the dynamic link library file into the simulation environment.
[0110] In a specific implementation, the node construction module 11 specifically includes:
[0111] A sending interface determining unit, configured to determine a data sending interface based on a serial data frame format of a simulated RS422 bus, protocol requirements, and preset data sending code segment information;
[0112] The receiving interface determining unit is configured to determine a data receiving interface based on the serial data frame format, the protocol requirements, and preset data receiving code segment information.
[0113] Furthermore, the embodiment of the present application also discloses an electronic device, Figure 6 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be considered as any limitation on the scope of use of this application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the inter-node handshake interaction simulation method disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0114] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device. The communication protocol it follows is any communication protocol that can be applied to the technical solution of this application and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world. Its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0115] In addition, the memory 22 as a carrier for resource storage can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0116] The operating system 221 is used to manage and control the hardware devices and computer program 222 on the electronic device 20, and can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to implement the inter-node handshake interaction simulation method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to perform other specific tasks.
[0117] Furthermore, this application discloses a computer-readable storage medium for storing a computer program; wherein, when executed by a processor, the computer program implements the aforementioned disclosed method for simulating handshake interactions between nodes. The specific steps of this method can be found in the corresponding contents disclosed in the aforementioned embodiments and will not be further described here.
[0118] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from the other embodiments. Reference can be made to the descriptions of the identical or similar parts between the various embodiments. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple, and the relevant parts can be referred to the descriptions of the methods.
[0119] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0120] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0121] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.
[0122] The above is a detailed introduction to the technical solution provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for those skilled in the art, according to the ideas of the present application, there may be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A method for simulating handshake interaction between nodes, characterized in that: include: Determine a corresponding data transmission interface and a data receiving interface based on a simulated RS422 bus in a simulation environment, and construct an initial handshake simulation component node based on the simulated RS422 bus, the data transmission interface and the data receiving interface; Determine the handshake data packet format and the handshake interaction process of the initial handshake simulation component node, and configure the working logic of the initial handshake simulation component node based on the handshake data packet format and the handshake interaction process to obtain a target handshake simulation component node; Configuring the simulation environment based on the target handshake simulation component node to connect the target handshake simulation component node to the simulation environment; The target handshake simulation component node connected to the simulation environment is used to execute the handshake interaction process between nodes with the UAV mission system simulation node; the UAV mission system simulation node is a node obtained after simulating the UAV mission system.
2. The node handshake interaction simulation method according to claim 1, characterized in that: The handshake interaction process includes: Sending a handshake request packet to the target handshake simulation component node through the UAV mission system simulation node; The handshake request packet is identified by the target handshake simulation component node to obtain an identification result; when the identification result indicates that the identification is successful, the handshake request packet is responded to, and a handshake response packet is sent to the UAV mission system simulation node; When the UAV mission system simulation node confirms that the handshake is successful, a handshake confirmation packet is sent to the target handshake simulation component node.
3. The node handshake interaction simulation method according to claim 1, characterized in that: The determining of the handshake data packet format and handshake interaction process of the initial handshake simulation component node includes: Using a data monitoring tool and / or a data analysis tool to obtain data packet format information during actual data transmission, and determining a handshake data packet format corresponding to the initial handshake simulation component node based on the data packet format information; The handshake steps and handshake timestamps in the actual handshake communication process are obtained, and the handshake interaction process corresponding to the initial handshake simulation component node is determined using the handshake steps and the handshake timestamps.
4. The node handshake interaction simulation method according to claim 1, characterized in that: The configuring the working logic of the initial handshake simulation component node based on the handshake data packet format and the handshake interaction process to obtain the target handshake simulation component node includes: The logic code information is determined based on the handshake data packet format, the handshake interaction process and the preset statement, and the working logic of the initial handshake simulation component node is configured using the logic code information to obtain the target handshake simulation component node.
5. The node handshake interaction simulation method according to claim 1, characterized in that: The configuring the simulation environment based on the target handshake simulation component node includes: Initializing the target handshake simulation component node based on a preset component initialization rule to complete a node initialization operation; The communication parameters of the simulated RS422 bus in the simulation environment are configured based on simulation requirements, and the target handshake simulation component node is connected to the simulated RS422 bus.
6. The node handshake interaction simulation method according to claim 1, characterized in that: The step of connecting the target handshake simulation component node to the simulation environment includes: A dynamic link library file corresponding to the target handshake simulation component node is obtained, and the dynamic link library file is saved in the simulation environment.
7. The node handshake interaction simulation method according to any one of claims 1 to 6, characterized in that: Determining the corresponding data transmission interface and data receiving interface based on the simulated RS422 bus in the simulation environment includes: Determine the data transmission interface based on the serial data frame format, protocol requirements and preset data transmission code segment information of the simulated RS422 bus; A data receiving interface is determined based on the serial data frame format, the protocol requirements and preset data receiving code segment information.
8. A device for simulating handshake interaction between nodes, characterized in that: include: A node construction module, used for determining a corresponding data transmission interface and a data receiving interface based on a simulated RS422 bus in a simulation environment, and constructing an initial handshake simulation component node based on the simulated RS422 bus, the data transmission interface and the data receiving interface; A node determination module, used to determine the handshake data packet format and the handshake interaction process of the initial handshake simulation component node, and configure the working logic of the initial handshake simulation component node based on the handshake data packet format and the handshake interaction process to obtain a target handshake simulation component node; A node configuration module, configured to configure the simulation environment based on the target handshake simulation component node to connect the target handshake simulation component node to the simulation environment; The handshake interaction module is used to utilize the target handshake simulation component node connected to the simulation environment and the UAV mission system simulation node to execute the handshake interaction process between nodes; the UAV mission system simulation node is a node obtained after simulating the UAV mission system.
9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the inter-node handshake interaction simulation method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: Used to store a computer program; wherein, when the computer program is executed by a processor, the node handshake interaction simulation method according to any one of claims 1 to 7 is implemented.