A distributed real-time collaborative simulation system and method based on Windows system
By building a distributed real-time collaborative simulation system, the problems of high hardware dependence and large simulation timing error of embedded software testing in the existing technology are solved, low-cost and efficient system-level simulation are achieved, and the authenticity and reliability of software testing are improved.
Patent Information
- Application Number
- CN202210112577.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-29
- Publication Date
- 2025-08-12
- Estimated Expiration
- 2042-01-29
AI Technical Summary
When conducting embedded software testing, the existing Windows-based simulation platform has problems such as high hardware dependence, high cost, large simulation timing error, data delay and poor communication data authenticity, resulting in software defects and omissions, affecting the reliability and security of satellite-borne software.
A distributed real-time collaborative simulation system based on Windows system is built, including a strong real-time data sharing network, target machine simulation system, dynamic simulation system, process communication and synchronization module, real-time cycle operation kernel and initialization setting module, to realize joint simulation of multiple target machines, and data interaction and synchronization control are carried out through virtual interfaces and shared memory.
It realizes an efficient and easy-to-use simulation environment at the system level under Windows systems, reduces simulation costs, improves the authenticity of the simulation environment and the accuracy of timing simulation, can effectively discover software problems, and improves the effectiveness and reliability of software testing.
Smart Images

Figure CN114625023B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a distributed real-time collaborative simulation system based on Windows system, which is mainly used for designing and realizing satellite control system simulation system and constructing system-level control system embedded software simulation environment, belonging to the field of spacecraft control technology. Background Art
[0002] With the development of space mission requirements and spacecraft control technology, control systems are becoming larger, system structures and control sequences are becoming more complex, and the variety of component stand-alone products and interface types is also increasing. On the one hand, due to the characteristics of embedded software and its high dependence on the hardware environment, the cost of embedded software testing is very high. Traditional semi-physical simulation environments can no longer meet mission requirements. There is an urgent need to build an efficient and easy-to-use real-time simulation environment based on the Windows system. On the other hand, to verify the effectiveness and consistency of the interfaces and timing between platform software and each stand-alone software, and to improve the efficiency of software development, it is necessary to build a distributed multi-target simulation verification system and establish a system-level simulation verification environment to achieve joint testing of platform software and stand-alone software.
[0003] Existing Windows-based simulation platforms generally conduct software testing on a single target machine separately. The dynamics of the software under test, including peripheral interfaces, are simulated on the ground. During closed-loop testing, it is necessary to simulate the dynamic operation of another target machine, provide dynamic data, and transmit it to the other target machine according to the interface protocol. Because the system has strict real-time requirements and complex timing logic, in order to achieve ideal test results and fully discover problems with onboard software, it is necessary to confirm that the simulation timing of components in the test environment should be consistent with the timing of real components. However, in the above-mentioned simulation platform test environment, only the platform software uses the real target machine system, while the various sensors / actuators that serve as the data input source rely on the software in the dynamic computer for simulation. As a result, there are certain errors in the timing simulation of the confirmation test environment, which are manifested as follows:
[0004] (1) Due to factors such as calculation time, data packaging time, and sampling period, there is often a certain delay between the generation and reception of the output data of the real sensor / actuator by the satellite end. However, it is difficult to simulate accurately when using dynamic software, resulting in the satellite time corresponding to the input data received by the software often being inconsistent with the real environment.
[0005] (2) Real components and stand-alone machines usually process functions with strict real-time requirements through interrupts, but when simulated by dynamics software, they are often simulated through periodic queries, which causes errors in the timing corresponding to certain data in the simulation.
[0006] (3) The simulation cycle of some real components is much shorter than that of the dynamics software. The dynamics software completes the simulation calculation with a specific step size, and the output data is somewhat different from the output data of the real components.
[0007] (4) The actual communication between the platform and the component will include many messages or protocol data that are not used in closed-loop testing. These data are usually not processed during ground simulation, which will lead to differences in the authenticity of the communication data between the platform and the component.
[0008] Due to the simulation errors introduced by the above-mentioned confirmation test environment, some software timing problems and interface protocol problems cannot be discovered in the confirmation test environment, resulting in the omission of software defects, which affects the reliability and safety of the onboard software.
[0009] By establishing a multi-target simulation system and a system-level simulation verification environment, joint testing of platform software and stand-alone software can be achieved. There is no need to simulate the interface protocol and timing of the component stand-alone on the ground, that is, to ensure the authenticity of the interface protocol and communication timing. This can effectively improve the authenticity of the confirmation test environment and thus effectively discover software problems. Summary of the Invention
[0010] The technical problem solved by the present invention is to overcome the shortcomings of the existing methods and provide a distributed real-time collaborative simulation system and method based on the Windows system based on the efficiency, ease of use and stability of the control system embedded software simulation environment.
[0011] The technical solution of the present invention is: a distributed real-time collaborative simulation system based on the Windows system, comprising a strong real-time data sharing network and computers interconnected through the network, each computer running one or more network nodes, the network nodes including a target machine simulation system, a dynamics simulation system, a process communication and synchronization controller, a real-time periodic operation kernel and an initialization setting module;
[0012] The strong real-time data sharing network virtualizes a globally shared network memory among all interconnected network nodes, and realizes communication between network nodes and data transmission between interconnected computers through the network memory;
[0013] The target machine simulation system runs under the Windows system and includes one or more target system simulators, each simulator being used to run a target machine simulation model representing different functional behaviors of the software under test, thereby simulating the functional behaviors of the target software under test;
[0014] The dynamics simulation system includes a dynamics simulation model and a protocol simulation module. The dynamics simulation model completes the dynamics calculation of the simulation system under the scheduling of the real-time cycle running kernel. The protocol simulation module receives the control instructions of the target system simulator and outputs the real-time dynamics calculation results.
[0015] The real-time periodic operation kernel controls the operation of the entire collaborative simulation system, including scheduling the operation of various simulation models and periodic or sporadic discrete event control;
[0016] The process communication and synchronization controller realizes the communication and management between multiple target system simulators and the local synchronization control of different processes;
[0017] The initialization setting module is used to complete the initialization of the dynamic simulation model of the dynamic simulation system, the physical memory allocation of the target machine simulation system, the virtual interface type, interface address and register configuration, and the target code and source code loading matters.
[0018] Preferably, the dynamics simulation model includes a track dynamics model, an attitude dynamics model, a motor drive model, a propulsion storage model, and a pressure sensor model, which are used for dynamic calculation of the controlled object;
[0019] Preferably, the target machine simulation model is encapsulated into an independent Windows dynamic link library, and data exchange and control transfer between target machine simulation models are subject to the scheduling of the real-time cycle running kernel.
[0020] Preferably, the target machine simulation model includes a virtual target machine, a virtual interface, and a clock simulator; the virtual target machine is the carrier for the operation of the software under test, and is used to simulate the central processing unit, registers, interrupts, and internal and external storage units of the software under test, completely simulate the running process and status of the software on a real computer, complete the instruction interpretation simulation execution for the software under test, and realize the functional behavior level simulation of the software under test; the virtual interface is the peripheral interface of the virtual target machine, and a virtual chip is generated in the form of a dynamic link library; the virtual chip performs software simulation on the communication between the virtual target machine and the peripheral equipment, and is linked to the virtual target machine in a hanging manner to complete the data exchange and control transfer between the virtual target machine and the peripheral equipment; the clock simulator is the time generator of the target machine simulation model, and is used to realize the pause, resume, and double-speed operation of the target machine simulation model.
[0021] Preferably, the virtual interface includes analog quantity (AD) / digital quantity (DA), I / O status quantity, RS422, 1553B bus (RT, BC), CAN bus, and SpaceWire bus.
[0022] A distributed real-time collaborative simulation method based on Windows system includes the following steps:
[0023] Step 1: Establishing the system status. The system status establishment includes the following steps:
[0024] (1) Start the target machine simulation system and dynamics simulation system;
[0025] (2) Initialization settings, including dynamic model initialization, target machine simulation system physical memory allocation, virtual interface type, interface address and register configuration, target code and source code loading;
[0026] (3) creating a real-time process, wherein the real-time process refers to the clock cycle during the operation of the simulation system;
[0027] (4) Creating and opening a shared memory real-time network, wherein creating and opening a shared memory real-time network means creating a shared memory space, mapping a memory mapping object to the address space of a process, and realizing data interaction between processes by reading and writing this memory space by different processes;
[0028] Step 2: Co-simulation process. The co-simulation process includes the following steps:
[0029] (5) The process communication and synchronization module first sends synchronization-related parameters to each target system simulator, including the number of target system simulators participating in synchronization, the number of each simulator, and the synchronization period. At the same time, a timer is created according to the synchronization period. The target system simulator receives and executes the process communication and synchronization module commands, and at the same time, feeds back the operation status message to the process communication and synchronization module during operation.
[0030] (6) Determine whether the synchronization is completed. Whenever the target machine simulator runs to the synchronization baseline timing event, the process communication and synchronization module queries whether all other target system simulators have run to the synchronization baseline. Only when it is confirmed that all target system simulators have run to the synchronization baseline will it continue to run and go to step (7). Otherwise, it goes to step (5) and waits until the synchronization condition is met.
[0031] (7) Run the dynamics simulation system, perform dynamic calculations on the object under test, run the target machine simulation system, and complete data interaction through virtual interfaces and a strong real-time data sharing network.
[0032] Preferably, the dynamic model is a mathematical model that simulates the attitude and orbital motion laws of the spacecraft control system; the physical memory allocation of the target machine system refers to the allocation of capacity and address space to the virtual target machine memory; the virtual interface type, interface address and register configuration refer to the definition of the peripheral interface of the virtual target machine, and the allocation and configuration of register addresses; the target code and source code loading refers to loading the source program and the compiled target code into the virtual target machine.
[0033] Preferably, the synchronization baseline is a timer created by the process communication and synchronization controller according to the synchronization period.
[0034] The beneficial effects of the present invention compared with the prior art are:
[0035] (1) The present invention addresses the shortcomings of traditional control system embedded software semi-physical simulation environments, which have long development cycles and high costs. The present invention is based on a distributed collaborative simulation system for Windows systems, which implements system-level simulation under Windows systems and provides an accurate digital hardware environment model for the operation of embedded software, thereby eliminating the dependence of embedded software on hardware during operation. The invention has the advantages of low cost, short development cycle, and high effectiveness.
[0036] (2) In the traditional control system simulation environment, only the main control software runs on the real target machine, and the lower machine uses the board card or software simulation method, which brings about the difficulty of timing, protocol and data simulation. The present invention can realize the joint simulation of multiple target machines, and each target machine runs the real on-board software, which reduces the simulation difficulty of the simulation environment and ensures the effectiveness of the test environment and the authenticity of the timing simulation. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 Schematic diagram of the composition of the simulation system of the present invention;
[0038] Figure 2 Schematic diagram of the simulation system information flow; DETAILED DESCRIPTION
[0039] The present invention is further described below with reference to the accompanying drawings. A distributed real-time collaborative simulation system based on Windows not only effectively utilizes the advantages of Windows, but also ensures the real-time and timing authenticity of the system. Simultaneously, it implements system-level simulation, effectively improving the authenticity and effectiveness of the software testing and verification environment, thereby effectively discovering software problems.
[0040] 1. Simulation system structure
[0041] like Figure 1 As shown, the present invention is a distributed real-time collaborative simulation system based on the Windows system, which includes a strong real-time data sharing network and computers interconnected through the network. One or more network nodes run on each computer, and the network nodes include a target machine simulation system, a dynamic simulation system, a process communication and synchronization controller, a real-time periodic operation kernel and an initialization setting module.
[0042] The strong real-time data sharing network is a real-time data transmission network that virtualizes a globally shared network memory in all interconnected network nodes, and realizes communication between network nodes and data transmission between interconnected computers through the network memory.
[0043] The target machine simulation system is composed of one or more target system simulators. The target system simulator is composed of target machine simulation models under the unified scheduling of the real-time cycle running kernel. The data exchange and control transfer between models in the target system simulator are also subject to the scheduling of the real-time cycle running kernel.
[0044] The target machine simulation model includes a virtual target machine, a virtual interface and a clock simulator. The target system simulator runs on a Windows platform to realize the simulation of the computer board in the real target machine.
[0045] The virtual target machine is the platform for the software under test. It simulates the software's central processing unit (CPU), registers, interrupts, and internal and external memory units, fully simulating the software's execution process and state on a real computer. It interprets and simulates the software's instructions, achieving functional and behavioral simulation of the software under test. The virtual target machine primarily includes CPU instruction set simulation, internal CPU registers, RAM / ROM, serial ports, and interrupts. The virtual target machine is the platform for embedded software execution, running the embedded software under test and interacting with other components through the virtual target machine's peripheral interfaces. The virtual target machine runs on a Windows platform. It emulates the computer board in the real target machine, primarily emulating the CPU, RAM, ROM, and interrupts. It interprets and simulates the instructions of the simulated target system, achieving functional and behavioral simulation of the target system's software. Within the virtual target machine, the CPU simulator simulates the target CPU's core, translating target machine instructions into instructions for execution on the host machine, thereby enabling the execution of target machine code on the host machine. Virtual memory simulates the memory chips.
[0046] The virtual interface is a peripheral interface of the virtual target machine, including analog (AD) / digital (DA), I / O status, RS422, 1553B bus (RT, BC), CAN bus, SpaceWire bus, etc. Software simulates the hardware characteristics of these interfaces and generates a virtual chip in the form of a dynamic link library. The virtual chip performs software simulation of communication between the virtual target machine and peripheral devices, including serial ports, parallel ports, interrupt controllers, 1553B bus controllers, etc., and is connected to the virtual target machine in a hooked manner to complete data exchange and control transfer between the virtual target machine and peripheral devices.
[0047] The clock simulator is a time generator for the target machine simulation model to run, and can also realize the suspension, resumption and double-speed running of the simulation model.
[0048] The dynamics simulation system includes a dynamics simulation model and a protocol simulation module. The dynamics simulation model completes the dynamics calculation of the simulation system under the scheduling of the real-time cycle running kernel. The protocol simulation module receives control instructions from the target computer and outputs real-time orbit data, attitude data, sensor measurement data and other dynamics calculation results of the controlled object.
[0049] Due to the dynamic decoupling between the center-of-mass motion of a mechanical system and the system's motion relative to the center-of-mass, orbital dynamics and attitude dynamics can generally be established separately. The dynamic simulation model includes an orbital dynamics model, an attitude dynamics model, a motor drive model, a propulsion storage model, a pressure sensor model, and other components. The orbital dynamics model and the attitude dynamics model calculate the orbital and attitude dynamics of the control system. During model initialization, the initial orbit and attitude are set. The model inputs are actuator control commands, including information such as thruster jet pulse width, momentum wheel control commands, control torque gyro control commands, magnetic torquer control commands, and sailboard drive mechanism control commands. The model outputs include real-time orbit data, satellite attitude, and measurement data from various sensors. The model output data serves as the data source for sensor and actuator simulations.
[0050] The motor drive model completes the closed-loop control simulation of permanent magnet motors (such as control torque gyroscopes) and stepper motors (such as sailboard drive mechanisms); the propulsion storage and supply model completes the control simulation of the propulsion system's Bang-Bang, pressure, flow, temperature, solenoid valves, etc.; the pressure sensor model completes the simulation of high-precision and high-stability pressure sensors.
[0051] The process communication and synchronization controller realizes the communication and management between multiple simulators and the local synchronization control of different processes;
[0052] The real-time periodic operation kernel controls the operation of the entire system, including scheduling the operation of various simulation models, periodic or sporadic discrete event control, etc.
[0053] The initialization setting module is used to complete the initialization of the dynamic model of the simulation system, the physical memory allocation of the target machine simulation system, the virtual interface type, interface address and register configuration, and the target code and source code loading matters;
[0054] 2. Simulation system process
[0055] like Figure 2 The flowchart of the distributed real-time collaborative simulation system based on Windows system of the present invention is shown as follows:
[0056] Step 1: Establishing the system status. The system status establishment includes the following steps:
[0057] (1) Start the target machine simulation system and dynamics simulation system;
[0058] (2) Initialization settings, including dynamic model initialization, target machine simulation system physical memory allocation, virtual interface type, interface address and register configuration, target code and source code loading;
[0059] (3) creating a real-time process, wherein the real-time process refers to the clock cycle during the operation of the simulation system;
[0060] (4) Creating and opening a shared memory real-time network. Opening a shared memory real-time network means creating a shared memory space, mapping a memory mapping object to the address space of a process, and realizing data interaction between processes by reading and writing this memory space by different processes.
[0061] Step 2: Co-simulation process. The co-simulation process includes the following steps:
[0062] (5) The process communication and synchronization module first sends synchronization-related parameters to each target system simulator, including the number of target system simulators participating in synchronization, the number of each simulator, and the synchronization period. At the same time, a timer is created according to the synchronization period. The target system simulator receives and executes the process communication and synchronization module commands, and at the same time, feeds back the operation status message to the process communication and synchronization module during operation.
[0063] (6) Whether the synchronization is completed. Whenever the target machine simulator runs to the synchronization baseline timing event, the process communication and synchronization module queries whether all other target system simulators have run to the synchronization baseline. When it is confirmed that all target system simulators have run to the synchronization baseline, it will continue to run and go to step (7). Otherwise, it will go to step (5) and wait until the synchronization condition is met.
[0064] (7) Run the dynamics simulation system, perform dynamic calculations on the object under test, run the target machine simulation system, and complete data interaction through virtual interfaces and a strong real-time data sharing network.
[0065] The contents not described in detail in the specification of the present invention belong to the common knowledge of those skilled in the art.
Claims
1. A distributed real-time collaborative simulation system based on Windows system, characterized by: The invention comprises a strong real-time data sharing network and computers interconnected with the strong real-time data sharing network, wherein each computer runs one or more network nodes, wherein the network nodes include a target machine simulation system, a dynamics simulation system, a process communication and synchronization controller, a real-time periodic operation kernel and an initialization setting module; The strong real-time data sharing network virtualizes a globally shared network memory among all interconnected network nodes, and realizes communication between network nodes and data transmission between interconnected computers through the network memory; The target machine simulation system runs under the Windows system and includes one or more target system simulators, each simulator being used to run a target machine simulation model representing different functional behaviors of the software under test, thereby simulating the functional behaviors of the target software under test; The dynamics simulation system includes a dynamics simulation model and a protocol simulation module. The dynamics simulation model completes the dynamics calculation of the simulation system under the scheduling of the real-time cycle running kernel. The protocol simulation module receives the control instructions of the target system simulator and outputs the real-time dynamics calculation results. The real-time periodic operation kernel controls the operation of the entire collaborative simulation system, including scheduling the operation of various simulation models and periodic or sporadic discrete event control; The process communication and synchronization controller realizes the communication and management between multiple target system simulators and the local synchronization control of different processes; The initialization setting module is used to complete the initialization of the dynamic simulation model of the dynamic simulation system, the physical memory allocation of the target machine simulation system, the virtual interface type, interface address and register configuration, and the target code and source code loading matters.
2. The system according to claim 1, wherein: The dynamics simulation model includes a track dynamics model, a posture dynamics model, a motor drive model, a propulsion storage model, and a pressure sensor model, and is used for dynamic calculation of the controlled object.
3. The system according to claim 1, wherein: The target machine simulation model is encapsulated into an independent Windows dynamic link library, and the data exchange and control transfer between the target machine simulation models are subject to the scheduling of the real-time cycle running kernel.
4. The system according to claim 1, wherein: The target machine simulation model includes a virtual target machine, a virtual interface, and a clock simulator; the virtual target machine is the carrier for the operation of the software under test, and is used to simulate the central processing unit, registers, interrupts, and internal and external storage units of the software under test, completely simulating the running process and status of the software on a real computer, completing the instruction interpretation simulation execution for the software under test, and realizing the functional behavior level simulation of the software under test; the virtual interface is the peripheral interface of the virtual target machine, and a virtual chip is generated in the form of a dynamic link library; the virtual chip performs software simulation on the communication between the virtual target machine and the peripheral devices, and is connected to the virtual target machine in a hanging manner to complete the data exchange and control transfer between the virtual target machine and the peripheral devices; The clock simulator is the time generator of the target machine simulation model, which is used to realize the pause, resume and double-speed operation of the target machine simulation model.
5. The system according to claim 4, characterized in that: The virtual interfaces include analog AD / digital DA, I / O status, RS422, 1553B bus RT, 1553B bus BC, CAN bus, and SpaceWire bus.
6. A distributed real-time collaborative simulation method based on Windows system, characterized in that The steps include: Step 1: Establishing the system status. The system status establishment includes the following steps: (1) Start the target machine simulation system and dynamics simulation system; (2) Initialization settings, including dynamic model initialization, target machine simulation system physical memory allocation, virtual interface type, interface address and register configuration, target code and source code loading; (3) creating a real-time process, wherein the real-time process refers to the clock cycle during the operation of the simulation system; (4) Creating and opening a shared memory real-time network, wherein creating and opening a shared memory real-time network means creating a shared memory space, mapping a memory mapping object to the address space of a process, and realizing data interaction between processes by reading and writing this memory space by different processes; Step 2: Co-simulation process. The co-simulation process includes the following steps: (5) The process communication and synchronization module first sends synchronization-related parameters to each target system simulator, including the number of target system simulators participating in synchronization, the number of each simulator, and the synchronization period. At the same time, a timer is created according to the synchronization period. The target system simulator receives and executes the process communication and synchronization module commands, and at the same time, feeds back the operation status message to the process communication and synchronization module during operation. (6) Determine whether the synchronization is completed. Whenever the target machine simulator runs to the synchronization baseline timing event, the process communication and synchronization module queries whether all other target system simulators have run to the synchronization baseline. Only when it is confirmed that all target system simulators have run to the synchronization baseline will it continue to run and go to step (7). Otherwise, it goes to step (5) and waits until the synchronization condition is met. (7) Run the dynamics simulation system, perform dynamic calculations on the object under test, run the target machine simulation system, and complete data interaction through virtual interfaces and a strong real-time data sharing network.
7. The method according to claim 6, characterized in that: The dynamic model is a mathematical model that simulates the attitude and orbital motion laws of the spacecraft control system; the physical memory allocation of the target machine system refers to the allocation of capacity and address space to the virtual target machine memory; the virtual interface type, interface address and register configuration refer to the definition of the peripheral interface of the virtual target machine, and the allocation and configuration of register addresses; the target code and source code loading refers to loading the source program and the compiled target code into the virtual target machine.
8. The method according to claim 6, wherein: The synchronization baseline is a timer created by the process communication and synchronization controller according to the synchronization period.
Citation Information
Patent Citations
Satellite simulator integration and simulation system and simulation method
CN103970031A