A method for data synchronization and exchange based on soft bus
By employing a PC-based synchronization method in embedded software testing and utilizing a soft bus to control the synchronization between nodes, the problem of incomplete data interaction in redundant design software within a fully digital simulation environment was solved, achieving high-precision data synchronization and interaction.
Patent Information
- Application Number
- CN202211252245.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-13
- Publication Date
- 2026-01-09
- Estimated Expiration
- 2042-10-13
AI Technical Summary
In existing fully digital simulation environments, redundant embedded software testing struggles to achieve high-precision data interaction and synchronization, especially when multiple interactions occur within a short period, leading to data loss and truncation issues.
A synchronization method based on PC values is adopted. The synchronization position between software is set as the target code line through a soft bus. The master node controls the synchronization of the child nodes to ensure that all child nodes run to the same position at the same time and then exchange data.
It achieves high-precision data synchronization and interaction in a system-level fully digital simulation environment with redundant design software, ensuring data integrity and timeliness, and solving the shortcomings of the periodic time synchronization mode in the existing technology.
Smart Images

Figure CN115827259B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to embedded software testing, and particularly relates to a data synchronization and exchange method based on a soft bus BACKGROUND
[0002] Embedded software testing mainly includes real environment testing, semi-physical simulation environment testing and full-digital simulation environment testing. Real environment testing and semi-physical simulation environment testing depend on the hardware running environment of embedded software, and it is difficult to carry out testing work under the condition that the hardware is not available. Therefore, at present, many researches are carried out on full-digital simulation environment testing of embedded software.
[0003] Generally, the full-digital simulation testing environment simulates the peripheral device of a single embedded software. For the embedded software of redundancy design, there is no full-digital simulation testing environment supporting the testing of this type of software, and the system-level testing environment in the past simulates the interaction between different software, and adopts a periodic synchronization mechanism, the precision of which cannot meet the testing environment requirement of the software of redundancy design. Therefore, it is particularly important to design a data interaction and synchronization mechanism between software, so that the testing work of the software of redundancy design can be carried out smoothly in the full-digital environment. SUMMARY
[0004] On the basis of the full-digital simulation environment of the software of redundancy design, the present application provides a data synchronization and exchange method based on a soft bus, adopts a PC value synchronization-based method, sets the synchronization position between software as a target code line, solves the synchronization problem between software, and also ensures the integrity of the interactive data.
[0005] A data synchronization and exchange method based on a soft bus comprises the following steps:
[0006] (1) building a full-digital simulation testing environment of a single software;
[0007] (2) building a system-level testing environment of a multi-machine interactive software of redundancy design;
[0008] (3) configuring the PC value of the execution synchronization position of each sub-node;
[0009] (4) running the system-level testing environment of the multi-machine interactive software, and the main node controls all sub-nodes on the soft bus to complete synchronization;
[0010] (5) the full-digital simulation environment on each sub-node runs the software to be tested;
[0011] (6) when the software runs to the code line corresponding to the PC value specified in step (3), the synchronization signal of other sub-nodes is waited for, and after all the signals are received, synchronization is completed;
[0012] (7) continue to execute, run to the PC value position in the next step (3), repeat step (6),
[0013] until the software run ends.
[0014] Preferably, the specific implementation method of step (2) comprises:
[0015] A. Take the soft bus as the interactive channel between the multiple machines, and specify the channel of the soft bus in the form of a configuration file
[0016] number, master node and slave node;
[0017] B. The master node sends a synchronization heartbeat to all slave nodes, and the slave nodes reply to the master node after receiving the heartbeat
[0018] The master node determines that the synchronization is completed after receiving the replies of all slave nodes;
[0019] C. After the synchronization between the nodes is completed, the full-digital simulation environment as the slave node starts to run the software to be tested.
[0020] Preferably, the master node serves as the control node on the soft bus, and controls the nodes on the bus to keep synchronization.
[0021] Preferably, the slave node comprises a plurality of full-digital simulation environments, which are distinguished in the configuration file.
[0022] Preferably, the specific implementation method of step (3) comprises:
[0023] a. When running to a fixed position, the software starts to perform synchronization handshake and data interaction, and the interaction process comprises sending data, synchronization handshake, and receiving data;
[0024] b. Each line of target code in the software corresponds to a unique PC value, the PC value corresponding to the synchronization position in the target code of the software to be tested is identified, and the PC value corresponding to the synchronization position is added in the synchronization node [SynAddress] of the configuration file of each slave node;
[0025] c. When the software runs to the code line corresponding to the specified PC value, the synchronization between the slave nodes is performed, and it is confirmed that all slave nodes run to the same position at the same time;
[0026] d. After all slave nodes run to the specified synchronization position, the data interaction and handshake synchronization are performed, and after the data interaction is completed, the execution continues.
[0027]
[0028]
[0029] Preferably, the specific implementation method of step (4) comprises: the master node sends a synchronization heartbeat to all the slave nodes, the slave nodes reply to the master node after receiving the heartbeat, and the master node determines that the synchronization is completed after receiving the replies of all the slave nodes.
[0030] The soft bus-based data synchronization and exchange method of the application solves the problem that in the previous system-level full-digital simulation environment, the periodic time synchronization mode is used to control the data interaction between software, but cannot meet the requirement of multiple interactions in a short time. In the system-level full-digital simulation environment of the redundant design software, the periodic time synchronization mode is used, even if the synchronization period is set to the microsecond level, there are still a large number of data packet loss, truncation and other problems when the software interacts; the PC value synchronization-based method of the application sets the synchronization position between software as the target code line, effectively solves the synchronization problem between software, and also ensures the integrity of the interaction data. BRIEF DESCRIPTION OF DRAWINGS
[0031] Figure 1 is the node configuration information screenshot of the soft bus-based data synchronization and exchange method of embodiment one;
[0032] Figure 2 is the node interaction flowchart of the soft bus-based data synchronization and exchange method of embodiment one;
[0033] Figure 3 is the data interaction flowchart between slave nodes of the soft bus-based data synchronization and exchange method of embodiment one. DETAILED DESCRIPTION
[0034] The technical solutions of the application will be further described in detail below with reference to the drawings and specific embodiments. Obviously, the described embodiments are only some of the embodiments of the application, but not all the embodiments. Based on the embodiments of the application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of the application.
[0035] The soft bus-based data synchronization and exchange method disclosed in the embodiments of the application has the following specific implementation manners and steps:
[0036] (1) complete the construction of the full-digital simulation test environment of a single software;
[0037] (2) configure the soft bus channel number and the master node and the slave nodes, and each single computer full-digital simulation test environment is taken as a slave node;
[0038] (3) configure the PC value of the execution synchronization position of each slave node;
[0039] (4) Run the redundant design software multi-machine interactive system level test environment, the main node controls all the sub-nodes on the soft bus to complete synchronization;
[0040] (5) The all-digital simulation environment on each sub-node runs the software under test;
[0041] (6) When the software runs to the code line corresponding to the PC value specified in (3), wait for the synchronization signals of other sub-nodes, and complete synchronization after receiving all the signals;
[0042] (7) Continue to execute, and when running to the PC value position in the next step (3), repeat step (6),
[0043] until the software runs to the end.
[0044] The embodiments of the present application include two parts of redundant design software multi-machine interactive system level test environment building and PC value based multi-machine interactive synchronization mechanism. The redundant design embedded software contains multiple identical software, and the software interacts with each other at a specific position. The redundant design software multi-machine interactive system level test environment includes a soft bus control program, each software and its all-digital simulation environment, the software running on each all-digital simulation environment as a sub-node of the soft bus, and the control program controls all the nodes on the bus to synchronize. The PC value based multi-machine interactive synchronization mechanism focuses on the synchronization position of each sub-node on the code line, and the software runs to the code line corresponding to the PC value, and the sub-nodes are synchronized.
[0045] The step (2) of building the redundant design software multi-machine interactive system level test environment includes:
[0046] A. Take the soft bus as the interactive channel between the machines, and specify the channel number, master node (master) and sub-node (slave) of the soft bus through the form of a configuration file as shown in Figure 1 .
[0047] The master node is the control node on the soft bus, controls the nodes on the bus to keep synchronization, and a plurality of all-digital simulation environments are sub-nodes, which are distinguished in the configuration file.
[0048] B. As shown in Figure 2 , the master node first controls the time synchronization between all the sub-nodes. The specific process is that the master node sends a synchronization heartbeat to all the sub-nodes, the sub-nodes reply to the master node after receiving the heartbeat, and the master node determines that the synchronization is completed after receiving the replies of all the sub-nodes.
[0049] C. After the nodes complete synchronization, the all-digital simulation environment as a sub-node starts to run the software under test.
[0050] The PC value-based multi-machine interaction synchronization mechanism of step (3) includes:
[0051] a. When running to a fixed position, the software starts to perform a synchronization handshake and data interaction, as shown in Figure 3 The interaction process includes sending data, a synchronization handshake, and receiving data.
[0052] b. Each line of target code in the software corresponds to a unique PC value. The PC values corresponding to the synchronization positions in the target code of the software under test are identified, and these PC values are added to the configuration files of the respective child nodes.
[0053] c. When the software runs to the code line corresponding to the specified PC value, the child nodes perform synchronization, and it is confirmed that all child nodes run to the same position at the same time.
[0054] d. After all child nodes run to the specified synchronization position, a data interaction and a handshake synchronization are performed, and after the data interaction is completed, execution continues.
[0055] The above description of disclosed embodiments enables those skilled in the art to carry out or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the scope of the present application. Therefore, the present application will not be limited to these embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for data synchronization and exchange based on soft bus, characterized in that, The method comprises the following steps: (1) building a full-digital simulation test environment for a single software; (2) building a multi-machine interactive system-level test environment for a software with redundancy design; (3) configuring each sub-node to execute a PC value at a synchronous position; a. When running to the fixed position, the software starts to execute a synchronous handshake and data interaction, and the interaction process comprises sending data, a synchronous handshake, and receiving data; b. Each line of target code in the software corresponds to a unique PC value, the PC value corresponding to the synchronous position in the target code of the software under test is identified, and the PC value corresponding to the synchronous position is added to the synchronous node [SynAddress] in the configuration file of each sub-node; c. When the software runs to the code line corresponding to the specified PC value, the sub-nodes execute synchronization to confirm that all sub-nodes run to the same position at the same time; d. After all sub-nodes run to the specified synchronous position, data interaction and handshake synchronization are executed, and after the data interaction is completed, execution continues; (4) running the multi-machine interactive system-level test environment of the software, and the master node controls all sub-nodes on the software bus to complete synchronization; (5) the full-digital simulation environment on each sub-node runs the software under test; (6) when the software runs to the code line corresponding to the PC value specified in step (3), the synchronous signal of the other sub-nodes is waited for, and after all signals are received, synchronization is completed; (7) execution continues, and when running to the PC value position in the next step (3), step (6) is repeated until the software runs to the end.
2. The soft bus based data synchronization and exchange method according to claim 1, wherein, The specific implementation method of step (2) comprises: A. The software bus is used as the interactive channel between the multiple machines, and the channel number, master node master, and sub-node slave of the software bus are specified in the form of a configuration file; B. The master node sends a synchronous heartbeat to all sub-nodes, the sub-nodes reply to the master node after receiving the heartbeat, and the master node determines that synchronization is completed after receiving the replies of all sub-nodes; C. After the nodes complete synchronization, the full-digital simulation environment of the sub-nodes starts to run the software under test.
3. The soft bus based data synchronization and exchange method according to claim 2, wherein, The master node serves as a control node on the software bus, and controls the nodes on the bus to keep synchronization.
4. The soft bus based data synchronization and exchange method of claim 2, wherein, The sub-nodes comprise a plurality of full-digital simulation environments, which are distinguished in the configuration file.
5. The soft bus based data synchronization and exchange method according to claim 1, wherein, The specific implementation method of step (4) comprises that the master node sends a synchronous heartbeat to all sub-nodes, the sub-nodes reply to the master node after receiving the heartbeat, and the master node determines that synchronization is completed after receiving the replies of all sub-nodes.
Citation Information
Patent Citations
Combined synchronization method of multi-module electronic system
CN101221523A
Processor verification method based on internal memory monitoring
CN101615209A