Implementation method of a virtual simulation system with redundancy characteristics
By compiling executable code using an instruction set simulator and combining it with virtual single-machine comparison and queue management for horizontal and vertical processing, the reliability and speed issues of redundant architecture in virtual simulation systems are solved, thus realizing a highly efficient virtual simulation system with redundant characteristics.
Patent Information
- Application Number
- CN202310675966.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-08
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2043-06-08
AI Technical Summary
Existing virtual simulation systems, when implementing redundant architectures, struggle to simultaneously guarantee both software reliability and simulation speed.
The executable code is compiled using an instruction set simulator. Redundant voting is achieved through virtual single-machine comparison and queue management in both horizontal and vertical processing. Assembly language is used to ensure the accuracy of data exchange and processing.
It improves the reliability and efficiency of the virtual simulation system, and ensures data consistency and processing speed across multiple standalone systems.
Smart Images

Figure CN116680039B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of virtual simulation system construction, and in particular relates to a method for implementing a virtual simulation system with redundancy characteristics. Background Technology
[0002] Virtual simulation systems can use software to simulate the operating environment, which can reduce the burden on real stand-alone machines to some extent.
[0003] In a virtual simulation system environment, a virtual machine runs on a host machine, and the physical performance of the host machine determines the speed at which the virtual machine runs. The key to implementing a virtual machine lies in DSP virtualization, which uses software simulation to model the working modes of a DSP chip, including instruction set simulators, pipelines, and parallel instruction processing. Simultaneously, information exchange is achieved through the establishment of virtual peripherals. Accurate implementation of the instruction set simulator provides reliability for the virtual machine, while optimization of the pipeline and parallel instruction processing improves its running speed.
[0004] Redundant voting is commonly used in fields such as control and aerospace. When dealing with critical data processing, multiple machines can be used to run the process, and the results can be compared and analyzed to improve the reliability of the results.
[0005] For virtual simulation systems that can utilize virtual single machines to achieve redundant architectures, a method is urgently needed to address this special design of redundant architectures. On the one hand, it can ensure the reliability of software operation, and on the other hand, it is also necessary to appropriately improve the simulation speed. Summary of the Invention
[0006] The technical objective of this invention is to provide a method for implementing a virtual simulation system with redundancy characteristics, so as to improve the reliability of multi-machine operation.
[0007] To solve the above problems, the technical solution of the present invention is as follows:
[0008] A method for implementing a virtual simulation system with redundancy characteristics includes the following steps:
[0009] The executable code is compiled using an instruction set simulator to obtain an executable file;
[0010] Perform horizontal processing: Data exchange occurs between virtual machines. The data collection elements of each virtual machine are sent to the comparison module for comparison and judgment. The redundancy characteristics are processed to obtain the redundancy voting result. Perform vertical processing: Based on the redundancy voting result, each virtual machine is instructed to perform corresponding tasks, such as running executable files or copying data.
[0011] Two queue data spaces are created, including a first queue and a second queue. The first queue is used to store the data collection elements that need to be compared, and the second queue is used to store the data collection elements of the comparison module that have not yet produced comparison results.
[0012] The executable code is fetched, decoded, and executed by an instruction set simulator to obtain an executable file, which is compiled in assembly language.
[0013] Specifically, the virtual single machine includes a main virtual single machine, a first secondary virtual single machine, and a second secondary virtual single machine;
[0014] The main virtual machine is used to enable simultaneous horizontal and vertical processing;
[0015] The first and second virtual machines are used to perform lateral processing or vertical processing.
[0016] For the main virtual machine, while performing horizontal processing, vertical processing continues to be performed. The data collected from the main virtual machine is the data before the vertical processing was performed.
[0017] Specifically, the data acquisition elements of each virtual machine are compared, resulting in three outcomes: the register values of all three virtual machines are the same, the register values of all three virtual machines are different, and the register values of only two virtual machines are the same.
[0018] If the register values in the primary virtual machine, the first secondary virtual machine, and the second secondary virtual machine are all the same, then the primary virtual machine runs the executable file, and the first and second secondary virtual machines copy the data from the primary virtual machine.
[0019] If only the register values in the primary virtual machine and the first secondary virtual machine are the same, then the primary virtual machine runs the executable file, and the second secondary virtual machine copies the data from the primary virtual machine.
[0020] If the register values in the primary virtual machine and the second virtual machine are the same, then the primary virtual machine runs the executable file, and the first virtual machine copies the data from the primary virtual machine.
[0021] If only the register values in the first and second virtual machines are the same, then the primary virtual machine runs the executable file, and at the same time, the primary virtual machine copies the data from the first virtual machine.
[0022] If the register values in the primary virtual machine, the first secondary virtual machine, and the second secondary virtual machine are all different, then the corresponding executable files will be run in the primary virtual machine, the first secondary virtual machine, and the second secondary virtual machine.
[0023] More preferably, the method further includes the following steps: if the register values in the master virtual machine, the first slave virtual machine, and the second slave virtual machine are all the same, the values in each register in the head of the second queue are assigned to the first slave virtual machine and the second slave virtual machine, and the head of the first queue and the second queue are dequeued.
[0024] If the register value of the primary virtual machine is the same as that of either the first or second virtual machine, then the first and second queues will be dequeued.
[0025] More preferably, the method further includes the following steps: if the element count in the first queue and the second queue only enters the queue but does not leave it, and the element count in both queues exceeds the threshold, then an error is reported.
[0026] Because the present invention adopts the above technical solution, it has the following advantages and positive effects compared with the prior art:
[0027] This invention proposes and implements a method for creating a virtual simulation system with redundancy. Relying on the comparison of target code assembly language, the data acquisition elements are stored as arrays for comparison and copying. Simultaneously, two queues are allocated to store process data during the comparison process, thereby achieving a redundant architecture in the virtual simulation system. Attached Figure Description
[0028] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention.
[0029] Figure 1 This is a schematic diagram of the data acquisition elements of the present invention;
[0030] Figure 2 This is a schematic diagram illustrating the implementation of the redundancy feature of the present invention;
[0031] Figure 3 This is a schematic diagram of redundant voting results in the virtual system of the present invention;
[0032] Figure 4 This is a schematic diagram of queue data in the virtual system of the present invention. Detailed Implementation
[0033] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the specific implementation methods of the present invention will be described below with reference to the accompanying drawings. Obviously, the drawings described below are merely some embodiments of the present invention. For those skilled in the art, other drawings and other implementation methods can be obtained based on these drawings without any creative effort.
[0034] To keep the drawings concise, only the parts relevant to the invention are shown schematically in each figure, and they do not represent the actual structure of the product. Furthermore, for ease of understanding, in some figures, only one of components with the same structure or function is shown schematically, or only one is labeled. In this document, "one" can mean not only "only one" but also "more than one".
[0035] The following detailed description, in conjunction with the accompanying drawings and specific embodiments, provides a more detailed explanation of the implementation method of a virtual simulation system with redundancy characteristics proposed in this invention. The advantages and features of this invention will become clearer from the following description and claims.
[0036] Example
[0037] Because different chips have different registers, for ease of description, the DSP chip described in this invention is based on the C6000 series chip. Redundancy design is a widely adopted design scheme to improve software reliability. Currently, dual redundancy, triple redundancy, and quadruple redundancy are commonly used. The redundancy design mentioned in this embodiment is based on triple redundancy. Specifically, in this embodiment, the virtual machines that are redundant with each other include a primary virtual machine (virtual machine 1), a first secondary virtual machine (virtual machine 2), and a second secondary virtual machine (virtual machine 3), with the following priority: primary virtual machine > first secondary virtual machine > second secondary virtual machine.
[0038] For a virtual simulation system with redundancy, the execution of instructions from a real C6000 chip is simulated using a virtual single machine, including instruction set simulators, pipelines, and parallel instruction processing. Simultaneously, information exchange is achieved through the establishment of virtual peripherals. To implement a virtual simulation system with redundancy, it is essential to ensure that the system still relies on multiple sets of data for a final decision, and secondly, to ensure the system's high efficiency.
[0039] In summary, see Figures 1 to 4 This embodiment provides a method for implementing a virtual simulation system with redundancy characteristics, including the following steps:
[0040] In a virtual single-machine environment, a virtual simulation system is used to simulate the execution of executable code on a real target machine. The executable code is fetched, decoded, and executed by an instruction set simulator, compiled into an executable file, and then run in the virtual simulation environment. The executable file is compiled using assembly language, and the executable file is essentially assembly object code, thus ensuring that the executable file can run correctly in a single virtual single-machine environment.
[0041] Next, see Figure 2In the virtual simulation environment, horizontal processing is performed first: data exchange occurs between the virtual machines, and the data acquisition elements of each virtual machine are compared and judged. These data acquisition elements are stored using an array of length 40. Figure 1 For example, the data acquisition element refers to the values selected from 40 registers. Based on redundancy characteristics, the redundancy voting result is obtained. Here, the virtual implementation of the redundancy voting process is entirely consistent with the redundancy voting principle in a real single-machine environment.
[0042] Then, see Figure 3 Vertical processing is then performed: based on the results of redundant voting, each virtual machine is instructed to perform corresponding tasks, either running executable files or copying data. The executable files are based on assembly object code. Each virtual machine then continues running the next function, with each function acting as a comparison module. Before running on different virtual machines, each comparison module performs data collection element comparisons.
[0043] For the primary virtual machine, both lateral and vertical processing can be performed simultaneously to prevent lateral processing from causing the virtual machine to idle and waste time and resources. While performing lateral processing, the primary virtual machine is selected to continue vertical processing. However, the first and second secondary virtual machines can only choose to perform either lateral or vertical processing.
[0044] Finally, see Figure 4 To facilitate horizontal and vertical processing, two queue data spaces are allocated: a first queue and a second queue. The first queue is a circular queue used to store data collection elements that need to be compared. Data at the head of the queue is released promptly after a successful comparison. The second queue is also a circular queue used to store data collection elements from comparison modules that have not yet produced comparison results. Data at the head of the queue is released promptly after a successful assignment. Based on the redundancy voting results, enqueue and dequeue operations are performed on the data in the first and second queues.
[0045] Preferably, in addition to performing horizontal data comparison and assignment with the first and second virtual machines, the main virtual machine also runs subsequent modules to be compared.
[0046] See Figure 3 The following is a detailed explanation of the data collection element identification and redundant voting results in this application:
[0047] Specifically, in the horizontal processing, the data acquisition elements of each virtual machine are compared, resulting in three outcomes: the register values of all three virtual machines are the same, the register values of all three virtual machines are different, and the register values of only two virtual machines are the same.
[0048] The register values in the primary virtual machine, the first secondary virtual machine, and the second secondary virtual machine are all identical: The primary virtual machine is selected for comparison of the data stored in the first queue required by the current comparison module. Since the data acquisition elements in all three virtual machines are the same, the primary virtual machine runs the executable file. The first and second secondary virtual machines copy the data from the primary virtual machine, that is, the values in the registers at the head of the second queue are assigned to the two secondary virtual machines, and the head of the first and second queues is dequeued.
[0049] If only the register values in the primary virtual machine and the first secondary virtual machine are identical, then the primary virtual machine runs the executable file, and the second secondary virtual machine copies the data from the primary virtual machine. Specifically, the value of the data acquisition element array in the second queue header is assigned to the second secondary virtual machine, and the contents of the head of the first and second queues are released. (This process is repeated twice in the original text.)
[0050] If only the register values in the first and second virtual machines are the same, then the master virtual machine runs the executable file and copies the data from the first virtual machine. Specifically, the current data acquisition element from the first virtual machine is assigned to the data acquisition element in the master virtual machine, while the values in the first and second queues are cleared. The master virtual machine then recalculates from the next comparison module and writes the calculation result into the first and second queues.
[0051] If the register values in the primary virtual machine, the first secondary virtual machine, and the second secondary virtual machine are all different, then the corresponding current comparison module is run in all three virtual machines. The contents of the first and second queues are then cleared, and the enqueue operation restarts from the current module, awaiting the next instruction cycle for re-comparison.
[0052] If the data collected by the main virtual machine fails to match the data collected by the first and second virtual machines, the main virtual machine, the first virtual machine, and the second virtual machine will each run the next comparison module and re-compare.
[0053] Preferably, the process also includes the following steps: if the element counts in the first and second queues only enter the queue but do not exit, and both queues exceed the threshold, an error is reported. This means that if the comparison results of the modules in the three virtual machines are inconsistent when the number of consecutive comparisons exceeds the threshold, the virtual machines may malfunction and require manual reset and restart.
[0054] The embodiments of the present invention have been described in detail above with reference to the accompanying drawings, but the present invention is not limited to the above embodiments. Even if various changes are made to the present invention, if these changes fall within the scope of the claims of the present invention and their equivalents, they shall still fall within the protection scope of the present invention.
Claims
1. A method for implementing a virtual simulation system with redundancy characteristics, characterized in that, Includes the following steps: The executable code is compiled using an instruction set simulator to obtain an executable file; Perform horizontal processing: Data exchange occurs between virtual machines. The data collection elements of each virtual machine are sent to the comparison module for comparison and judgment. The redundancy characteristics are processed to obtain the redundancy voting result. Perform vertical processing: According to the redundancy voting result, each virtual machine is instructed to perform corresponding work, such as running the executable file or copying data. Two queue data spaces are created, including a first queue and a second queue, wherein the first queue is used to store the data collection elements that need to be compared, and the second queue is used to store the data collection elements of the comparison module that have not yet produced comparison results; The virtual single machine includes a main virtual single machine, a first secondary virtual single machine, and a second secondary virtual single machine; The main virtual machine is used to simultaneously perform horizontal and vertical processing. The first and second virtual machines are used to perform horizontal or vertical processing. The data acquisition elements of each virtual machine were compared, and three results were obtained: the register values of all three virtual machines were the same, the register values of all three virtual machines were different, and the register values of only two virtual machines were the same. Data acquisition elements refer to the values in several selected registers, which are then processed based on redundancy characteristics to obtain the redundancy voting result.
2. The method for implementing a virtual simulation system with redundancy characteristics according to claim 1, characterized in that, The executable code is fetched, decoded, and executed using an instruction set simulator to obtain the executable file, which is compiled in assembly language.
3. The method for implementing a virtual simulation system with redundancy characteristics according to claim 1, characterized in that, For the main virtual machine, while performing horizontal processing, vertical processing continues to be performed. The data collection elements collected for the main virtual machine are the data before the vertical processing was performed.
4. The method for implementing a virtual simulation system with redundancy characteristics according to claim 3, characterized in that, If the register values in the primary virtual machine, the first secondary virtual machine, and the second secondary virtual machine are all the same, then the primary virtual machine runs the executable file, and the first and second secondary virtual machines copy the data from the primary virtual machine.
5. The method for implementing a virtual simulation system with redundancy characteristics according to claim 4, characterized in that, If only the register values in the primary virtual machine and the first secondary virtual machine are the same, then the primary virtual machine runs the executable file, and the second secondary virtual machine copies the data from the primary virtual machine. If only the register values in the primary virtual machine and the second secondary virtual machine are the same, then the primary virtual machine runs the executable file, and the first secondary virtual machine copies the data from the primary virtual machine. If only the register values in the first and second sub-virtual machines are the same, then the primary virtual machine runs the executable file, and at the same time, the primary virtual machine copies the data from the first sub-virtual machine.
6. The method for implementing a virtual simulation system with redundancy characteristics according to claim 5, characterized in that, If the register values in the primary virtual machine, the first secondary virtual machine, and the second secondary virtual machine are all different, then the corresponding executable file is run in each of the primary virtual machine, the first secondary virtual machine, and the second secondary virtual machine.
7. The method for implementing a virtual simulation system with redundancy characteristics according to claim 6, characterized in that, The process also includes the following steps: if the register values in the primary virtual machine, the first secondary virtual machine, and the second secondary virtual machine are all the same, assign the values in each register in the head of the second queue to the first secondary virtual machine and the second secondary virtual machine, and perform a dequeue operation on the head of the first queue and the second queue. If the register value of the primary virtual machine is the same as that of only one of the first and second secondary virtual machines, then the first and second queues will be dequeued.
8. The method for implementing a virtual simulation system with redundancy characteristics according to claim 7, characterized in that, It also includes the following steps: if the element count in the first queue and the second queue is only enqueued and not enqueued, and the element count in both queues exceeds the threshold, then an error is reported.
Citation Information
Patent Citations
Security redundancy compiling operation method, computer equipment and readable storage medium
CN114780382A
Device for Improving the Fault Tolerance of a Processor
US20120233499A1
