Simulator simulation data remote recording device, method and equipment and storage medium
By transferring the acquisition and writing operations of simulation data to the remote computer during the simulator simulation process, and using the dual cache mechanism to ensure data integrity, the problems of high CPU load and data loss in the simulator high-frequency simulation are solved, and the stability of the simulation process and the integrity of data recording are improved.
Patent Information
- Application Number
- CN202411309953.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-19
- Publication Date
- 2025-02-25
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
During the high-frequency simulation of the simulator, directly reading and writing hard disk files in the main program leads to an increase in CPU load and limited read and write speed, which may cause incomplete or lost data records.
The remote recording of simulation data is realized by setting the simulation data acquisition module in the simulation computer and the remote computer equipped with the network data acquisition module and the simulation data writing module. The simulation data acquisition module sends data packets to the network data acquisition module of the remote computer according to the preset simulation cycle. The network data acquisition module writes the data to the receiving cache queue and transfers it to the write cache queue. Finally, the simulation data writes the data to the data storage file.
It reduces the CPU load of the simulation computer, avoids simulation cycle delays or data loss caused by frequent hard disk reading and writing, improves the stability of the simulation process, and ensures data integrity through the double cache mechanism.
Smart Images

Figure CN119520437A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a remote recording device, method, equipment and storage medium for simulator simulation data. Background Art
[0002] During the simulation operation of the simulator, it is very important to record the simulation data of each simulation system. These recorded simulation data can be replayed after the training or test is completed for detailed training review and test review analysis.
[0003] In the related art, when the simulator is performing high-frequency simulation, directly reading and writing hard disk files in the main program will increase the CPU load, and the reading and writing speed is limited by the physical characteristics of the hard disk, which is much slower than the CPU and memory. This may cause incomplete data recording and loss of some data entries.
[0004] Therefore, how to better record simulator simulation data has become an urgent problem to be solved in the industry. Summary of the invention
[0005] The present invention provides a simulator simulation data remote recording device, method, equipment and storage medium, which are used to solve the problems of the simulator simulation data recording device, method, equipment and storage medium in the prior art.
[0006] The present invention provides a simulator simulation data remote recording system, comprising: A simulation data acquisition module is arranged in the simulation computer, and a remote computer is provided with a network data acquisition module and a simulation data writing module; wherein the network data acquisition module is respectively connected to the simulation data acquisition module and the simulation data writing module in communication; Wherein, the simulation data acquisition module is used to send the simulation data group package to the network data acquisition module in the remote computer according to the preset simulation cycle; The network data acquisition module is used to write the received simulation data into the receiving cache queue, and when there is simulation data in the receiving cache queue, continuously write the simulation data from the receiving cache queue into the writing cache queue; The simulation data writing module is used to write the data in the write cache queue into a data storage file.
[0007] According to a simulator simulation data remote recording system provided by the present invention, the simulation data acquisition module is specifically used for: When receiving a start recording instruction, the simulation data is packaged according to a preset simulation cycle, and the packaged simulation data in each cycle is sent to the remote computer until the end recording instruction is given, and the acquisition of the simulation data is stopped; Wherein, different simulation data are separated by interval identifiers.
[0008] According to a simulator simulation data remote recording system provided by the present invention, the network data acquisition module is specifically used for: After the network data acquisition module is started and initialized, the received data is written into the receiving cache queue; When there is data in the receiving cache queue, continuously taking out the head data in the receiving cache queue and writing it into the write cache queue, and deleting the taken out data from the receiving cache queue; When the receiving cache queue is empty and the length of the data received by the receiving cache queue is zero, the writing of the head data in the receiving cache queue to the writing cache queue is stopped.
[0009] According to a simulator simulation data remote recording system provided by the present invention, the simulation data writing module is specifically used for: Start the simulation data receiving sub-thread, continue to wait for receiving simulation data, and continuously monitor whether the write cache queue is empty through the main thread; If the write cache queue is not empty, reset the write cache queue empty times counter to zero, take out the data in the write cache queue and write it to the data storage file, and delete the taken out data from the write cache queue; When the write cache queue is empty, the count of the write cache queue empty times counter is increased by one; When the count of the write cache queue empty times counter exceeds a preset threshold, the simulation data receiving sub-thread is suspended.
[0010] The present invention also provides a simulator simulation data remote recording method based on the simulator simulation data remote recording system, comprising: After the simulation data acquisition module acquires the simulation data of the simulation computer, the simulation data group is sent to the network data acquisition module in the remote computer according to the preset simulation cycle; The network data acquisition module writes the received simulation data into the receiving cache queue, and when there is simulation data in the receiving cache queue, continuously writes the simulation data from the receiving cache queue to the writing cache queue until the data in the receiving cache queue is empty; The simulation data writing module writes the data in the write cache queue into a data storage file.
[0011] According to the remote recording method of simulator simulation data provided by the embodiment of the present application, after the simulation data acquisition module acquires the simulation data of the simulation computer, the simulation data group is sent to the network data acquisition module in the remote computer according to the preset simulation cycle, including: When receiving a start recording instruction, recording simulation data of the simulation computer; Packaging the simulation data according to a preset simulation cycle, and sending the simulation data packaged in each cycle to the remote computer; When receiving the end recording instruction, the simulation computer stops recording the simulation data; wherein different simulation data are separated by interval identifiers.
[0012] According to the simulator simulation data remote recording method provided by the embodiment of the present application, the network data acquisition module writes the received simulation data into the receiving cache queue, and when there is simulation data in the receiving cache queue, continuously writes the simulation data from the receiving cache queue to the writing cache queue until the data in the receiving cache queue is empty, including: After the network data acquisition module is started and initialized, the received data is written into the receiving cache queue; When there is data in the receiving cache queue, continuously taking out the head data in the receiving cache queue and writing it into the write cache queue, and deleting the taken out data from the receiving cache queue; When the receiving cache queue is empty and the length of the data received by the receiving cache queue is zero, the writing of the head data in the receiving cache queue to the writing cache queue is stopped.
[0013] According to the simulator simulation data remote recording method provided by the embodiment of the present application, the simulation data writing module writes the data in the write cache queue into the data storage file, including: The simulation data writing module starts the simulation data receiving sub-thread, continuously waits for receiving simulation data, and continuously monitors whether the write cache queue is empty through the main thread; If the write cache queue is not empty, reset the write cache queue empty times counter to zero, take out the data in the write cache queue and write it to the data storage file, and delete the taken out data from the write cache queue; When the write cache queue is empty, the count of the write cache queue empty times counter is increased by one; When the count of the write cache queue empty times counter exceeds a preset threshold, the simulation data receiving sub-thread is suspended.
[0014] 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 remote recording method for simulator simulation data as described above is implemented.
[0015] 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 remote recording method of simulator simulation data as described in any one of the above is implemented.
[0016] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the above-mentioned methods for remotely recording simulation data of a simulator.
[0017] The simulator simulation data remote recording device, method, equipment and storage medium provided by the present invention allocate the writing function of the simulation computer to the remote computer used for data recording operations. The simulation computer no longer performs file writing operations, but is used to obtain simulation data. Since the acquisition and writing operations of simulation data are transferred to the remote computer, the main CPU of the simulation computer can focus on the calculation of simulation logic instead of data storage, thereby reducing the CPU load, while also avoiding simulation cycle delays or data loss caused by frequent hard disk read and write operations, and improving the stability of the simulation process. On the other hand, by using a dual cache mechanism of a receive cache and a write cache, the integrity of the data during transmission and storage is ensured, reducing the risk of data loss due to operation conflicts or hardware limitations. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] 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.
[0019] Figure 1 A schematic diagram of the structure of a remote recording system for simulator simulation data provided in an embodiment of the present application; Figure 2 A schematic diagram of a simulation data acquisition process provided in an embodiment of the present application; Figure 3 A schematic diagram of a simulation data receiving process provided in an embodiment of the present application; Figure 4A schematic diagram of a simulation data writing process provided in an embodiment of the present application; Figure 5 A method for remotely recording simulation data of a simulator provided in an embodiment of the present application; Figure 6 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0020] 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.
[0021] Figure 1 The schematic diagram of the structure of the simulator simulation data remote recording system provided in the embodiment of the present application is as follows: Figure 1 As shown, it includes: a simulation data acquisition module 11 that is communicatively connected to a simulation computer 10, and a remote computer 14 that is provided with a network data acquisition module 12 and a simulation data writing module 13; wherein the network data acquisition module 12 is communicatively connected to the simulation data acquisition module 11 and the simulation data writing module 13 respectively; Wherein, the simulation data acquisition module 11 is used to send the simulation data group package to the network data acquisition module in the remote computer according to the preset simulation cycle; The network data acquisition module 12 is used to write the received simulation data into the receiving cache queue, and when there is simulation data in the receiving cache queue, continuously write the simulation data from the receiving cache queue into the writing cache queue; The simulation data writing module 13 is used to write the data in the write cache queue into a data storage file.
[0022] In the embodiment of the present application, the simulation data acquisition module may be deployed in the simulation computer to acquire simulation data and package it. Optionally, the simulation data acquisition module is also a part of the simulation computer, and is mounted on the same simulation platform as the flight, avionics, airborne, fire control and other simulation function parts, and acquires simulation data through the communication method provided by the simulation platform.
[0023] More specifically, the simulation data acquisition module is responsible for real-time monitoring and capturing simulation data of the simulation computer during the simulation process.
[0024] The captured simulation data is then organized into network packets, a process called “network packetization.” Packaging is the process of encapsulating data into a format suitable for network transmission, which usually includes serialization and packaging of data.
[0025] After the data is packaged, it is sent to the remote computer in the same LAN via the SOCKET network protocol. SOCKET is a commonly used network communication mechanism that supports data transmission between different computers.
[0026] The network data acquisition module of the remote computer is responsible for monitoring and receiving the data packets transmitted by the simulation data acquisition module. Once the network data acquisition module receives the data, it will pass it to the simulation data writing module for further processing.
[0027] Optionally, the simulation data acquisition module is specifically used to: When receiving a start recording instruction, the simulation data is packaged according to a preset simulation cycle, and the packaged simulation data in each cycle is sent to the remote computer until the end recording instruction is given, and the acquisition of the simulation data is stopped; Wherein, different simulation data are separated by interval identifiers.
[0028] Figure 2 The following is a schematic diagram of the simulation data acquisition process provided in the embodiment of the present application, such as Figure 2 As shown, including: The simulation data acquisition module is dynamically loaded when the simulation main program is started. After the module is loaded, the SOCKET is initialized first to determine the IP and port settings of the remote computer.
[0029] Establish a subscription relationship with the simulation data that needs to be recorded to clarify which simulation data needs to be packaged. Then wait for the "start recording" command, and package the data after receiving the command. In the same simulation cycle, package the data to be recorded into a string record. In order to ensure that different data in the record are clearly identifiable, use spaces or symbols such as "|" as separators between different data.
[0030] After the package is completed, the data is sent to the remote computer through SOCKET communication, completing a cycle of simulation data packaging and sending.
[0031] Unless the "stop recording" command is received, the module will continue to perform data packaging and sending operations according to the set operating frequency. When the "stop recording" command is received, the data acquisition module ends its operation and determines whether the simulation main program has ended. If the simulation main program has not ended, it waits for the next round of "start recording" command.
[0032] Optionally, the network data acquisition module is specifically used to: After the network data acquisition module is started and initialized, the received data is written into the receiving cache queue; When there is data in the receiving cache queue, continuously taking out the head data in the receiving cache queue and writing it into the write cache queue, and deleting the taken out data from the receiving cache queue; When the receiving cache queue is empty and the length of the data received by the receiving cache queue is zero, the writing of the head data in the receiving cache queue to the writing cache queue is stopped.
[0033] In an embodiment of the present application, the simulation data receiving module is deployed on a remote computer, and is used to receive data records sent by the simulation computer and add the network data to a cache queue.
[0034] In the embodiment of the present application, the remote computer is an independent device independent of the simulation computer.
[0035] Figure 3 The following is a schematic diagram of the simulation data receiving process provided in the embodiment of the present application, such as Figure 3 As shown in the figure, when the program starts, the system first initializes and defines two key data structures: network data receiving cache queue and data writing queue. These queues are used as data buffers to temporarily store received network data and data to be written.
[0036] Next, the system starts a dedicated network simulation data receiving sub-thread. The main responsibility of this sub-thread is to continuously monitor and receive data from the network.
[0037] When the child thread receives network data, it will immediately write the data to the receive buffer queue. Then, the system will check whether there is any data to be processed in the receive queue. If there is, the system will continue to take data from the receive queue and write it to the write buffer queue until the receive queue is empty.
[0038] In order to maintain the consistency and integrity of data operations in a multi-threaded environment, the system introduces a mutex lock when writing data. The mutex lock ensures that only one thread can operate on the write cache queue at any time, thereby avoiding race conditions that may occur when multiple threads access the same resource at the same time. The use of mutex locks not only prevents uncertain behavior, but also ensures data synchronization and security across threads. This means that even in high concurrency situations, data writing and processing can be carried out safely and orderly.
[0039] The continuous network data reception and processing mechanism of the child thread can ensure that there will be no network data packet loss even if there are differences in simulation frequencies between different computers. This is because the receiving buffer can store all received data in real time without being affected by the differences in simulation frequencies.
[0040] The design of the receive buffer ensures that the received network data can be written in real time and will not be overwritten by the arrival of new data. This provides a guarantee for further processing of the data and ensures the integrity of the data.
[0041] By setting up a write cache, data receiving and data writing operations are effectively isolated. This isolation avoids conflicts in operations performed on a single cache and reduces the risk of potential data loss caused by mutual exclusion of thread operations.
[0042] Data written to the cache can be further processed according to the system design, such as sorting, filtering, or formatting to meet specific storage or analysis requirements.
[0043] Optionally, the simulation data writing module is specifically used to: Start the simulation data receiving sub-thread, continue to wait for receiving simulation data, and continuously monitor whether the write cache queue is empty through the main thread; If the write cache queue is not empty, reset the write cache queue empty times counter to zero, take out the data in the write cache queue and write it to the data storage file, and delete the taken out data from the write cache queue; When the write cache queue is empty, the count of the write cache queue empty times counter is increased by one; When the count of the write cache queue empty times counter exceeds a preset threshold, the simulation data receiving sub-thread is suspended.
[0044] In an embodiment of the present application, a simulation data writing module is deployed on a remote computer and is used to write received network simulation data into a data storage file.
[0045] Figure 4 The following is a schematic diagram of the simulation data writing process provided in the embodiment of the present application, such as Figure 4 As shown in the figure, when the program starts, the system performs a series of initialization operations, defines the network data receiving cache queue, the data writing queue, and a nullCounter, which is the number of times the write cache queue is empty. The purpose of nullCounter is to monitor the status of the write cache queue to determine whether the data recording should be terminated.
[0046] The system starts a network simulation data receiving sub-thread, which is responsible for continuously receiving network data from the simulation computer to ensure that the data can be received and processed in a timely manner.
[0047] The main thread is responsible for monitoring the status of the write cache queue. If there is data in the queue, nullCounter will be reset, indicating that data recording is still in progress. The main thread will extract data from the write cache queue and write it to the data storage file.
[0048] When the write cache queue is empty, nullCounter will increment. The system will set a maximum limit nullCounterMax. When nullCounter reaches this limit, the system will assume that the simulation computer has stopped sending data, thus ending the current data recording.
[0049] When performing data access operations to write cache queues, the system uses a mutex lock to ensure the atomicity of the operation. This lock area is small and the lock time is short, which avoids long-term locks in file IO operations and reduces the impact on program concurrency performance. Because the use of mutex locks is precisely controlled, it will not introduce deadlocks, nor will it cause program performance to degrade due to long-term locks.
[0050] The remote computer is dedicated to receiving and writing data. It does not execute other simulation logic, so it can focus on data writing operations and have more execution time. Although data file writing is a time-consuming IO operation, due to the specific role of the remote computer, it will not be interfered by other tasks, ensuring the efficiency of data writing and the independence of simulation logic. Unwritten data will be safely stored in the cache queue and wait for the next simulation cycle to be executed before being written. This mechanism ensures that data will not be overwritten by newly received data, thereby protecting the integrity of the data.
[0051] The following is a description of the simulator simulation data remote recording method provided by the present invention. The simulator simulation data remote recording method described below and the simulator simulation data remote recording device described above can be referenced to each other.
[0052] Figure 5 The simulator simulation data remote recording method provided in the embodiment of the present application is as follows: Figure 5 As shown, including: Step 510, after the simulation data acquisition module acquires the simulation data of the simulation computer, the simulation data group is sent to the network data acquisition module in the remote computer according to a preset simulation cycle; Step 520, the network data acquisition module writes the received simulation data into the receiving cache queue, and if there is simulation data in the receiving cache queue, continuously writes the simulation data from the receiving cache queue to the writing cache queue until the data in the receiving cache queue is empty; Step 530: the simulation data writing module writes the data in the write cache queue into a data storage file.
[0053] Optionally, according to the simulator simulation data remote recording method provided in the embodiment of the present application, after the simulation data acquisition module acquires the simulation data of the simulation computer, the simulation data group is sent to the network data acquisition module in the remote computer according to a preset simulation cycle, including: When receiving a start recording instruction, recording simulation data of the simulation computer; Packaging the simulation data according to a preset simulation cycle, and sending the simulation data packaged in each cycle to the remote computer; When receiving the end recording instruction, the simulation computer stops recording the simulation data; wherein different simulation data are separated by interval identifiers.
[0054] According to the simulator simulation data remote recording method provided by the embodiment of the present application, the network data acquisition module writes the received simulation data into the receiving cache queue, and when there is simulation data in the receiving cache queue, continuously writes the simulation data from the receiving cache queue to the writing cache queue until the data in the receiving cache queue is empty, including: After the network data acquisition module is started and initialized, the received data is written into the receiving cache queue; When there is data in the receiving cache queue, continuously taking out the head data in the receiving cache queue and writing it into the write cache queue, and deleting the taken out data from the receiving cache queue; When the receiving cache queue is empty and the length of the data received by the receiving cache queue is zero, the writing of the head data in the receiving cache queue to the writing cache queue is stopped.
[0055] According to the simulator simulation data remote recording method provided by the embodiment of the present application, the simulation data writing module writes the data in the write cache queue into the data storage file, including: The simulation data writing module starts the simulation data receiving sub-thread, continuously waits for receiving simulation data, and continuously monitors whether the write cache queue is empty through the main thread; If the write cache queue is not empty, reset the write cache queue empty times counter to zero, take out the data in the write cache queue and write it to the data storage file, and delete the taken out data from the write cache queue; When the write cache queue is empty, the count of the write cache queue empty times counter is increased by one; When the count of the write cache queue empty times counter exceeds a preset threshold, the simulation data receiving sub-thread is suspended.
[0056] In the embodiments of the present application, the above-mentioned simulator simulation data remote recording methods are all implemented based on the above-mentioned simulator simulation data remote recording device. Its specific implementation method can refer to the above-mentioned device embodiment and will not be repeated here.
[0057] In the embodiment of the present application, the writing function of the simulation computer is assigned to the remote computer used for data recording operations. The simulation computer no longer performs file writing operations, but is used to obtain simulation data. Since the acquisition and writing operations of simulation data are transferred to the remote computer, the main CPU of the simulation computer can focus on the calculation of simulation logic instead of data storage, thereby reducing the CPU load, while also avoiding simulation cycle delays or data loss caused by frequent hard disk read and write operations, and improving the stability of the simulation process. On the other hand, by using a dual cache mechanism of receiving cache and writing cache, the integrity of data during transmission and storage is ensured, reducing the risk of data loss due to operation conflicts or hardware limitations.
[0058] Figure 6 is a schematic diagram of the structure of the electronic device provided by the present invention, such as Figure 6 As shown, the electronic device may include: a processor 610, a communications interface 620, a memory 630 and a communication bus 640, wherein the processor 610, the communications interface 620 and the memory 630 communicate with each other through the communication bus 640. The processor 610 may call the logic instructions in the memory 630 to execute the remote recording method of the simulator simulation data, the method comprising: after the simulation data acquisition module acquires the simulation data of the simulation computer, according to the preset simulation cycle, the simulation data group package is sent to the network data acquisition module in the remote computer; The network data acquisition module writes the received simulation data into the receiving cache queue, and when there is simulation data in the receiving cache queue, continuously writes the simulation data from the receiving cache queue to the writing cache queue until the data in the receiving cache queue is empty; The simulation data writing module writes the data in the write cache queue into a data storage file.
[0059] In addition, the logic instructions in the above-mentioned memory 630 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.
[0060] On the other hand, the present invention also provides a computer program product, the computer program product includes a computer program, the computer program can be stored in a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the simulator simulation data remote recording method provided by the above methods, the method comprising: after the simulation data acquisition module acquires the simulation data of the simulation computer, the simulation data group is sent to the network data acquisition module in the remote computer according to a preset simulation cycle; The network data acquisition module writes the received simulation data into the receiving cache queue, and when there is simulation data in the receiving cache queue, continuously writes the simulation data from the receiving cache queue to the writing cache queue until the data in the receiving cache queue is empty; The simulation data writing module writes the data in the write cache queue into a data storage file.
[0061] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to execute the simulator simulation data remote recording method provided by the above methods, the method comprising: after the simulation data acquisition module acquires the simulation data of the simulation computer, the simulation data group is sent to the network data acquisition module in the remote computer according to a preset simulation cycle; The network data acquisition module writes the received simulation data into the receiving cache queue, and when there is simulation data in the receiving cache queue, continuously writes the simulation data from the receiving cache queue to the writing cache queue until the data in the receiving cache queue is empty; The simulation data writing module writes the data in the write cache queue into a data storage file.
[0062] 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.
[0063] 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, 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.
[0064] 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 simulator simulation data remote recording system, characterized in that: include: A simulation data acquisition module is arranged in the simulation computer, and a remote computer is provided with a network data acquisition module and a simulation data writing module; wherein the network data acquisition module is respectively connected to the simulation data acquisition module and the simulation data writing module in communication; Wherein, the simulation data acquisition module is used to send the simulation data group package to the network data acquisition module in the remote computer according to the preset simulation cycle; The network data acquisition module is used to write the received simulation data into the receiving cache queue, and when there is simulation data in the receiving cache queue, continuously write the simulation data from the receiving cache queue into the writing cache queue; The simulation data writing module is used to write the data in the write cache queue into a data storage file.
2. The simulator simulation data remote recording system according to claim 1, characterized in that: The simulation data acquisition module is specifically used for: When receiving a start recording instruction, the simulation data is packaged according to a preset simulation cycle, and the packaged simulation data in each cycle is sent to the remote computer until the end recording instruction is given, and the acquisition of the simulation data is stopped; Wherein, different simulation data are separated by interval identifiers.
3. The simulator simulation data remote recording system according to claim 1, characterized in that: The network data acquisition module is specifically used for: After the network data acquisition module is started and initialized, the received data is written into the receiving cache queue; When there is data in the receiving cache queue, continuously taking out the head data in the receiving cache queue and writing it into the write cache queue, and deleting the taken out data from the receiving cache queue; When the receiving cache queue is empty and the length of the data received by the receiving cache queue is zero, the writing of the head data in the receiving cache queue to the writing cache queue is stopped.
4. The simulator simulation data remote recording system according to claim 1, characterized in that: The simulation data writing module is specifically used for: Start the simulation data receiving sub-thread, continue to wait for receiving simulation data, and continuously monitor whether the write cache queue is empty through the main thread; If the write cache queue is not empty, reset the write cache queue empty times counter to zero, take out the data in the write cache queue and write it to the data storage file, and delete the taken out data from the write cache queue; When the write cache queue is empty, the count of the write cache queue empty times counter is increased by one; When the count of the write cache queue empty times counter exceeds a preset threshold, the simulation data receiving sub-thread is suspended.
5. A method for remote recording of simulator simulation data based on the simulator simulation data remote recording system according to any one of claims 1 to 4, characterized in that: include: After the simulation data acquisition module acquires the simulation data of the simulation computer, the simulation data group is sent to the network data acquisition module in the remote computer according to the preset simulation cycle; The network data acquisition module writes the received simulation data into the receiving cache queue, and when there is simulation data in the receiving cache queue, continuously writes the simulation data from the receiving cache queue to the writing cache queue until the data in the receiving cache queue is empty; The simulation data writing module writes the data in the write cache queue into a data storage file.
6. The method for remotely recording simulator simulation data according to claim 5, characterized in that: After the simulation data acquisition module acquires the simulation data of the simulation computer, the simulation data group is sent to the network data acquisition module in the remote computer according to the preset simulation cycle, including: When receiving a start recording instruction, recording simulation data of the simulation computer; Packaging the simulation data according to a preset simulation cycle, and sending the simulation data packaged in each cycle to the remote computer; When receiving the end recording instruction, the simulation computer stops recording the simulation data; wherein different simulation data are separated by interval identifiers.
7. The method for remotely recording simulator simulation data according to claim 5, characterized in that: The network data acquisition module writes the received simulation data into a receiving cache queue, and when there is simulation data in the receiving cache queue, continuously writes the simulation data from the receiving cache queue to a write cache queue until the data in the receiving cache queue is empty, including: After the network data acquisition module is started and initialized, the received data is written into the receiving cache queue; When there is data in the receiving cache queue, continuously taking out the head data in the receiving cache queue and writing it into the write cache queue, and deleting the taken out data from the receiving cache queue; When the receiving cache queue is empty and the length of the data received by the receiving cache queue is zero, the writing of the head data in the receiving cache queue to the writing cache queue is stopped.
8. The method for remotely recording simulator simulation data according to claim 5, characterized in that: The simulation data writing module writes the data in the write cache queue into the data storage file, including: The simulation data writing module starts the simulation data receiving sub-thread, continuously waits for receiving simulation data, and continuously monitors whether the write cache queue is empty through the main thread; If the write cache queue is not empty, reset the write cache queue empty times counter to zero, take out the data in the write cache queue and write it to the data storage file, and delete the taken out data from the write cache queue; When the write cache queue is empty, the count of the write cache queue empty times counter is increased by one; When the count of the write cache queue empty times counter exceeds a preset threshold, the simulation data receiving sub-thread is suspended.
9. 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 simulator simulation data remote recording method as claimed in any one of claims 5 to 8 is implemented.
10. 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 method for remotely recording simulator simulation data as claimed in any one of claims 5 to 8 is implemented.
Citation Information
Patent Citations
Log recording method and apparatus
CN106951488A
Design method of data recording software architecture for digital simulation experiment
CN108228638A
Data storage method and device, terminal equipment and storage medium
CN109597568A
Interaction system and method for distributed simulation data
CN114647946A
Data cache queue processing method and device, electronic equipment and storage medium
CN118276765A
Cited By
Hardware simulation system, control method, electronic equipment and storage medium
CN119903791A
Airborne system simulation experiment data recording system and design method thereof
CN120180762A