Multi-node synchronization method, device, equipment and medium based on simulated local area network
By splitting the data of the teacher node into multiple data packets in LAN simulation training, and synchronizing using multi-threading and UDP protocols, combining different synchronization modes, the problem of poor synchronization between multiple nodes is solved, and the fluency and stability of simulation training is improved.
Patent Information
- Application Number
- CN202211652465.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-21
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2042-12-21
AI Technical Summary
In LAN simulation training, poor synchronization between multiple nodes leads to delayed information transmission, affecting the fluency and operation experience of simulation training.
By splitting the intended data of the teacher node into multiple data packets, and synchronizing these data packets to the student node using preset multi-threading and UDP protocols, combining the state synchronization mode and frame synchronization mode, different synchronization strategies are applied according to the update frequency of the data.
It improves the synchronization performance of LAN simulation, enhances data interaction efficiency, avoids congestion in data flow, and improves the stability of synchronous operation.
Smart Images

Figure CN116055507B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of simulation communication technology, and in particular to a multi-node synchronization method, device, equipment and medium based on a simulation local area network. Background Art
[0002] Action simulation based on indoor LAN is an important method for simulation training and tactics research, an effective way to improve action capabilities, and also provides a quantitative basis for the evaluation of simulation training effects. Simulation training usually requires trainees to join in different roles, carry out simulation actions according to their assigned tasks, and interact in real time in virtual scenes to cooperate with each other to complete collaborative action tasks.
[0003] In LAN simulation training, in order to achieve real-time interaction and coordinated actions between different roles, the synchronization of simulation is very critical. When there are many roles participating in the simulation training, once the lag in information transmission reaches a significant level, it will affect the fluency of the simulation training, thus giving the trainees a poor operating experience, and even causing freezes and difficulty in continuing the simulation training. Therefore, how to improve the synchronization performance of LAN simulation has become a technical problem that needs to be solved urgently. Summary of the invention
[0004] The present invention provides a multi-node synchronization method, device, equipment and medium based on a simulated local area network, which are used to solve the technical problem of how to improve the synchronization performance of a local area network simulation.
[0005] The present invention provides a multi-node synchronization method based on a simulated local area network, comprising:
[0006] Splitting the scenario data of the instructor node into multiple data packets;
[0007] The plurality of data packets are synchronized to the student node through a preset multi-thread and a user datagram UDP protocol;
[0008] The low-update frequency data between the student nodes are synchronized based on the state synchronization mode, and the high-update frequency data between the student nodes are synchronized based on the frame synchronization mode.
[0009] According to a multi-node synchronization method based on a simulated local area network provided by the present invention, splitting the assumption data of the teacher node into multiple data packets includes:
[0010] The assumption data of the teacher node is split according to the assumption type to obtain multiple data packets and the communication number corresponding to each of the data packets.
[0011] According to a multi-node synchronization method based on a simulated local area network provided by the present invention, after synchronizing the multiple data packets to the student node through the preset multi-threading and user datagram UDP protocol, the method includes:
[0012] Based on the preset multi-threading and the UDP protocol, the synchronization of each of the student nodes is monitored.
[0013] According to a multi-node synchronization method based on a simulated local area network provided by the present invention, after synchronizing the multiple data packets to the student node through the preset multi-threading and user datagram UDP protocol, it also includes:
[0014] Setting the synchronization frequency of the frame synchronization mode to be externally controllable, the frame synchronization mode being used to synchronize high update frequency data between the student nodes;
[0015] Based on the external controllability, the synchronization frequency is tested to obtain an optimal frequency;
[0016] A forwarding frequency of a synchronization server developed based on the UDP protocol is determined, and the forwarding frequency is higher than the optimal frequency.
[0017] According to a multi-node synchronization method based on a simulated local area network provided by the present invention, the synchronization of low-update frequency data between the student nodes based on the state synchronization mode includes:
[0018] Determining a transmission type of synchronization data between each of the student nodes, wherein the transmission type includes a low update frequency;
[0019] The data with low update frequency between the student nodes are synchronized based on the state synchronization mode, and the data with low update frequency includes text communication data.
[0020] According to a multi-node synchronization method based on a simulated local area network provided by the present invention, the sending type also includes a high update frequency; the high update frequency data between the student nodes synchronized based on the frame synchronization mode includes:
[0021] Open the synchronization port corresponding to the frame synchronization mode;
[0022] The data with high update frequency between each of the student nodes is classified, and the classified data with high update frequency is synchronized through the frame synchronization mode and the synchronization port.
[0023] The present invention also provides a multi-node synchronization device based on a simulated local area network, comprising:
[0024] A scenario data splitting module, used for splitting the scenario data of the instructor node into multiple data packets;
[0025] A data packet synchronization module, used for synchronizing the plurality of data packets to the student node through a preset multi-thread and a user datagram UDP protocol;
[0026] The data synchronization module is used to synchronize the low-update frequency data between the student nodes based on the state synchronization mode, and synchronize the high-update frequency data between the student nodes based on the frame synchronization mode.
[0027] The present invention also provides an electronic device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the multi-node synchronization method based on a simulated local area network as described above is implemented.
[0028] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the multi-node synchronization method based on a simulated local area network as described in any one of the above is implemented.
[0029] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the multi-node synchronization method based on a simulated local area network as described above is implemented.
[0030] The multi-node synchronization method, device, equipment and medium based on the simulated local area network provided by the present invention split the assumed data of the teacher node into multiple smaller data packets, and then synchronize the multiple data packets to the student node through preset multi-threading and UDP protocol. In combination with the different data sending types (high update frequency data and low update frequency data), different synchronization strategies (state synchronization mode and frame synchronization mode) are adopted accordingly, which can improve data interaction efficiency, avoid data flow congestion, increase the stability of synchronization operation, and improve the synchronization performance of local area network simulation. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the technical solutions in the present invention or 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 some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0032] Figure 1 This is one of the flow charts of the multi-node synchronization method based on the simulated local area network provided by the present invention;
[0033] Figure 2 It is a flow chart of a multi-node synchronization method based on a simulated local area network provided by the present invention;
[0034] Figure 3 This is the second flow chart of the multi-node synchronization method based on the simulated local area network provided by the present invention;
[0035] Figure 4It is a structural schematic diagram of a multi-node synchronization device based on a simulated local area network provided by the present invention;
[0036] Figure 5 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0037] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are 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 creative work are within the scope of protection of the present invention.
[0038] Combine the following Figure 1-Figure 3 The multi-node synchronization method based on simulated local area network of the present invention is described.
[0039] Please refer to Figure 1 The present invention provides a multi-node synchronization method based on a simulated local area network, comprising:
[0040] Step 100, splitting the assumption data of the teacher node into multiple data packets;
[0041] Specifically, in the hypothesis stage of training, the hypothesis data of the instructor side (i.e., the instructor node in this embodiment) is classified and split into several smaller data packets. For example, the hypothesis data of the instructor node is classified and split into several data packets according to the hypothesis type. The several data packets may include hypothesis data of hazardous sources, hypothesis data of injured persons, hypothesis data of decontamination personnel, hypothesis data of decontamination equipment, hypothesis data of decontamination vehicles, hypothesis data of weather factors, and hypothesis data of personnel allocation, etc. The split data packets are smaller in size and easier to develop and test.
[0042] Step 200, synchronizing the multiple data packets to the student node through a preset multi-thread and user datagram UDP protocol;
[0043] Specifically, a multi-person interconnection synchronization server is developed through the UDP (User Datagram Protocol) protocol. The several data packets obtained by the above classification and splitting can be synchronized to each student node through C# multi-threading and the multi-person interconnection synchronization server, such as Figure 2 As shown, synchronization within the same group and monitoring synchronization on the instructor side are achieved, reducing the performance consumption of data synchronization.
[0044] Step 300: synchronize the low-update frequency data between the student nodes based on the state synchronization mode, and synchronize the high-update frequency data between the student nodes based on the frame synchronization mode.
[0045] Specifically, the assumed data of the teacher node is split into multiple smaller data packets, and then different synchronization strategies (including state synchronization mode and frame synchronization mode) are used to synchronize the communication data between the student nodes in combination with the different data transmission types. For data with low update rate such as text communication and training evaluation (i.e., low update frequency data in this embodiment), the state synchronization mode is used for synchronization, such as Figure 2 As shown; for real-time updated data such as personnel data and vehicle data (ie, high update frequency data in this embodiment), frame synchronization mode is used for synchronization, such as Figure 2 shown.
[0046] This embodiment splits the assumed data of the instructor node into multiple smaller data packets, and then synchronizes the multiple data packets to the student node through preset multi-threading and UDP protocol. In combination with the different data sending types (high update frequency data and low update frequency data), different synchronization strategies (state synchronization mode and frame synchronization mode) are adopted accordingly. This can improve data interaction efficiency, avoid data flow congestion, increase the stability of synchronization operation, and improve the synchronization performance of LAN simulation.
[0047] In one embodiment, the multi-node synchronization method based on the simulated local area network provided in the embodiment of the present application may also include:
[0048] Step 101, splitting the assumption data of the teacher node according to the assumption type to obtain multiple data packets and the communication number corresponding to each of the data packets.
[0049] Specifically, the instructor computer (i.e., the instructor node in this embodiment) is operated by the instructor and is responsible for the training control, also known as the instructor terminal. The trainee computer is operated by the trainees in different roles, also known as the trainee terminal. The instructor terminal and the trainee terminal are connected through a local area network. The internal data synchronization is realized by relying on the UDP protocol. Without establishing a link, the instructor node can send encapsulated IP data packets to the trainee node.
[0050] Before the training begins, the instructor node edits the training scenario and classifies and splits the instructor node's scenario data into several items according to the scenario type, which may include scenario data of hazardous sources, scenario data of injured persons, scenario data of decontamination personnel, scenario data of decontamination equipment, scenario data of decontamination vehicles, scenario data of weather factors, and scenario data of personnel allocation, etc. A unique communication number (i.e., the communication number in this embodiment) is assigned to each piece of scenario data (package), so that the size of the data packet after the splitting is smaller, which is easier to develop and test.
[0051] This embodiment splits the assumed data of the teacher node into smaller data packets, so that the size of the split data packets is smaller and more convenient for development and testing.
[0052] In one embodiment, the multi-node synchronization method based on the simulated local area network provided in the embodiment of the present application may also include:
[0053] Step 400, monitoring the synchronization of each of the student nodes based on the preset multi-threading and the UDP protocol.
[0054] Specifically, Figure 2 As shown, the teacher node monitors the synchronization between the student nodes through C# multithreading and UDP protocol.
[0055] This embodiment reduces the performance consumption of data synchronization by monitoring synchronization through the teacher node.
[0056] Please refer to Figure 3 In one embodiment, the multi-node synchronization method based on the simulated local area network provided in the embodiment of the present application may also include:
[0057] Step 210, setting the synchronization frequency of the frame synchronization mode to be externally controllable, the frame synchronization mode being used to synchronize high update frequency data between the student nodes;
[0058] Step 220, based on the external controllability, testing the synchronization frequency to obtain an optimal frequency;
[0059] Step 230, determining a forwarding frequency of a synchronization server developed based on the UDP protocol, wherein the forwarding frequency is higher than the optimal frequency.
[0060] Specifically, for the frame synchronization mode of high-frequency data such as personnel data and vehicle data, the synchronization frequency of the frame synchronization mode is set to be externally controllable. By continuously testing the synchronization frequency of the frame synchronization mode, the optimal (synchronization) frequency is obtained to achieve a balance between effect and performance. Then, the forwarding frequency of the server (developed based on the UDP protocol for multi-person interconnection synchronization) is set higher than the data sending frequency (ie, the optimal synchronization frequency) to prevent the data flow of the multi-person interconnection synchronization server from being blocked.
[0061] This embodiment adjusts the synchronization frequency of the frame synchronization mode through testing to obtain the optimal synchronization frequency, thereby preventing the data flow of the multi-person interconnection synchronization server from being blocked.
[0062] In one embodiment, the multi-node synchronization method based on the simulated local area network provided in the embodiment of the present application may also include:
[0063] Step 310, determining a transmission type of synchronization data between each of the student nodes, wherein the transmission type includes a low update frequency;
[0064] Step 320: Synchronize the data with low update frequency between the student nodes based on the state synchronization mode, wherein the data with low update frequency includes text communication data.
[0065] Specifically, different synchronization strategies (including state synchronization modes) are used to synchronize the communication data between the student nodes in combination with different data transmission types. For data with low update rates such as text communication and training evaluation (i.e., low update frequency data in this embodiment), the state synchronization mode is used for synchronization, such as Figure 2 shown.
[0066] This embodiment adopts different synchronization strategies according to different data transmission types, thereby improving data interaction efficiency, avoiding data flow congestion, increasing the stability of synchronization operation, and improving the synchronization performance of local area network simulation.
[0067] In one embodiment, the multi-node synchronization method based on the simulated local area network provided in the embodiment of the present application may also include:
[0068] Step 330, opening the synchronization port corresponding to the frame synchronization mode;
[0069] Step 340: classify the data with high update frequency between the student nodes, and synchronize the classified data with high update frequency through the frame synchronization mode and the synchronization port.
[0070] Specifically, for real-time updated data such as personnel data and vehicle data, the frame synchronization mode is used for synchronization, such as Figure 2 An independent synchronization port (i.e., the synchronization port corresponding to the frame synchronization mode in this embodiment) is opened for the frame synchronization mode, and the synchronization data (i.e., the data with a high update frequency in this embodiment) is classified and processed to avoid mutual interference and increase the stability of operation.
[0071] This embodiment opens an independent synchronization port for the frame synchronization mode, classifies the synchronization data, avoids mutual interference, and increases the stability of operation.
[0072] The multi-node synchronization device based on the simulated local area network provided by the present invention is described below. The multi-node synchronization device based on the simulated local area network described below and the multi-node synchronization method based on the simulated local area network described above can correspond to each other.
[0073] Please refer to Figure 4 The present invention also provides a multi-node synchronization device based on a simulated local area network, comprising:
[0074] The scenario data splitting module 401 is used to split the scenario data of the teacher node into multiple data packets;
[0075] The data packet synchronization module 402 is used to synchronize the multiple data packets to the student node through a preset multi-thread and a user datagram UDP protocol;
[0076] The data synchronization module 403 is used to synchronize the low-update frequency data between the student nodes based on the state synchronization mode, and synchronize the high-update frequency data between the student nodes based on the frame synchronization mode.
[0077] Optionally, the scenario data splitting module includes:
[0078] The assumption data splitting unit is used to split the assumption data of the teacher node according to the assumption type to obtain multiple data packets and the communication number corresponding to each of the data packets.
[0079] Optionally, the multi-node synchronization device based on the simulated local area network includes:
[0080] A synchronization monitoring module is used to monitor the synchronization of each student node based on the preset multi-threading and the UDP protocol.
[0081] Optionally, the multi-node synchronization device based on the simulated local area network includes:
[0082] A synchronization frequency setting module, used to set the synchronization frequency of the frame synchronization mode to be externally controllable, wherein the frame synchronization mode is used to synchronize high update frequency data between the student nodes;
[0083] A synchronization frequency testing module, used for testing the synchronization frequency to obtain an optimal frequency based on the external controllability;
[0084] The forwarding frequency determination module is used to determine the forwarding frequency of the synchronization server developed based on the UDP protocol, and the forwarding frequency is higher than the optimal frequency.
[0085] Optionally, the data synchronization module includes:
[0086] A sending type determining unit, used to determine the sending type of synchronization data between each of the student nodes, wherein the sending type includes a low update frequency;
[0087] A high-update frequency data synchronization unit is used to synchronize the low-update frequency data between the student nodes based on a state synchronization mode, wherein the low-update frequency data includes text communication data.
[0088] Optionally, the sending type further includes a high update frequency; and the data synchronization module includes:
[0089] A synchronous port opening unit, used for opening a synchronous port corresponding to a frame synchronization mode;
[0090] The low update frequency data classification unit is used to classify the high update frequency data between each of the student nodes, and synchronize the classified high update frequency data through the frame synchronization mode and the synchronization port.
[0091] Figure 5 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 5 As shown, the electronic device may include: a processor 510, a communication interface 520, a memory 530 and a communication bus 540, wherein the processor 510, the communication interface 520 and the memory 530 communicate with each other via the communication bus 540. The processor 510 may call the logic instructions in the memory 530 to execute the multi-node synchronization method based on the simulated local area network.
[0092] In addition, the logic instructions in the above-mentioned memory 530 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0093] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the multi-node synchronization method based on a simulated local area network provided by the above-mentioned methods.
[0094] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the multi-node synchronization method based on a simulated local area network provided by the above-mentioned methods.
[0095] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0096] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0097] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A multi-node synchronization method based on a simulated local area network, characterized in that: include: Splitting the scenario data of the instructor node into multiple data packets; The plurality of data packets are synchronized to the student node through a preset multi-thread and a user datagram UDP protocol; Synchronize low-update frequency data between the student nodes based on the state synchronization mode, and synchronize high-update frequency data between the student nodes based on the frame synchronization mode; After synchronizing the plurality of data packets to the student node by presetting the multithreading and the user datagram UDP protocol, the following further comprises: Setting the synchronization frequency of the frame synchronization mode to be externally controllable, the frame synchronization mode being used to synchronize high update frequency data between the student nodes; Based on the external controllability, the synchronization frequency is tested to obtain an optimal frequency; Determining a forwarding frequency of a synchronization server developed based on the UDP protocol, wherein the forwarding frequency is higher than the optimal frequency; The synchronization of low update frequency data between the student nodes based on the state synchronization mode includes: Determining a transmission type of synchronization data between each of the student nodes, wherein the transmission type includes a low update frequency; Synchronize the data with low update frequency between the student nodes based on the state synchronization mode, wherein the data with low update frequency includes text communication data; The transmission type also includes a high update frequency; the high update frequency data between the student nodes synchronized based on the frame synchronization mode includes: Open the synchronization port corresponding to the frame synchronization mode; The data with high update frequency between each of the student nodes is classified, and the classified data with high update frequency is synchronized through the frame synchronization mode and the synchronization port.
2. The multi-node synchronization method based on a simulated local area network according to claim 1, characterized in that: The splitting of the assumption data of the teacher node into multiple data packets includes: The assumption data of the teacher node is split according to the assumption type to obtain multiple data packets and the communication number corresponding to each of the data packets.
3. The multi-node synchronization method based on simulated local area network according to claim 1, characterized in that: The method of synchronizing the plurality of data packets to the student node by presetting the multithreading and the user datagram UDP protocol comprises: Based on the preset multi-threading and the UDP protocol, the synchronization of each of the student nodes is monitored.
4. A multi-node synchronization device based on a simulated local area network, characterized in that: include: A scenario data splitting module, used for splitting the scenario data of the instructor node into multiple data packets; A data packet synchronization module, used for synchronizing the plurality of data packets to the student node through a preset multi-thread and a user datagram UDP protocol; A data synchronization module, used to synchronize low-update frequency data between the student nodes based on a state synchronization mode, and synchronize high-update frequency data between the student nodes based on a frame synchronization mode; A synchronization frequency setting module, used to set the synchronization frequency of the frame synchronization mode to be externally controllable, wherein the frame synchronization mode is used to synchronize high update frequency data between the student nodes; A synchronization frequency testing module, used for testing the synchronization frequency to obtain an optimal frequency based on the external controllability; A forwarding frequency determination module, used to determine the forwarding frequency of the synchronization server developed based on the UDP protocol, wherein the forwarding frequency is higher than the optimal frequency; The data synchronization module includes: A sending type determining unit, used to determine the sending type of synchronization data between each of the student nodes, wherein the sending type includes a low update frequency; A high-update frequency data synchronization unit, used for synchronizing the low-update frequency data between the student nodes based on the state synchronization mode, wherein the low-update frequency data includes text communication data; The transmission type also includes a high update frequency; the data synchronization module includes: A synchronous port opening unit, used for opening a synchronous port corresponding to a frame synchronization mode; The low update frequency data classification unit is used to classify the high update frequency data between each of the student nodes, and synchronize the classified high update frequency data through the frame synchronization mode and the synchronization port.
5. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the multi-node synchronization method based on the simulated local area network as described in any one of claims 1 to 3 is implemented.
6. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the multi-node synchronization method based on a simulated local area network as claimed in any one of claims 1 to 3 is implemented.
7. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the multi-node synchronization method based on a simulated local area network as claimed in any one of claims 1 to 3 is implemented.
Citation Information
Patent Citations
Online game state synchronization method and device, terminal and storage medium
CN111790155A
Automatic testing method and device for frame synchronization, and readable storage medium
CN113559506A