Synchronization method and synchronization device for real-time simulation synchronization architecture
By obtaining the clock pulse frequency and model data volume in the real-time simulation synchronization architecture, and generating and delaying the synchronization pulse signal for logical operations, the problem of mismatch between the synchronization signal and the model data volume is solved, and the real-time and accuracy of the simulation model is improved. Avoid idle hardware resources.
Patent Information
- Application Number
- CN202411153975.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-21
- Publication Date
- 2024-12-03
AI Technical Summary
In the prior art, the mismatch between the synchronization signal and the model data volume leads to idle hardware resources, which reduces the real-time and accuracy of the simulation model, especially in the real-time simulation field.
By obtaining the clock pulse frequency, simulation step size and model data volume, generating and delaying the synchronization pulse signal for logic and calculation, triggering the counter, and logically comparing the counting result with the comparison value, flexibly allocating the synchronization pulse to match the model data volume, ensuring that The effectiveness of synchronous operations and resource utilization.
It effectively avoids idle hardware resources, improves the real-time and accuracy of the simulation model, and ensures the effectiveness of synchronous operations and efficient utilization of resources.
Smart Images

Figure CN119066859A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of synchronization architectures, and in particular to a synchronization method, a synchronization device, a computer-readable storage medium, and a computer program product for a real-time simulation synchronization architecture. Background Art
[0002] Simulation technology is an effective tool for studying and understanding the characteristics of renewable energy and power electronic equipment, and for power system analysis and fault prevention. The simulation rate of offline simulation is relatively slow, and the required simulation time is also relatively long, while the real-time simulation time is consistent with the real physical time. In the real-time simulation model, under the real-time requirement, the simulation step size of power electronic devices is generally microsecond or sub-microsecond level, so as to achieve more computing tasks in the same time, thereby completing the solution workload required by the actual physical time limit.
[0003] Whether it is real-time simulation or offline simulation, the synchronization of simulation models is very important. When the electrical information in the model is not processed synchronously, the time-physical relationship of the simulation model cannot be truly and accurately reflected. Even due to the asynchronous model data information, the final solution result diverges and is completely distorted. In the simulation model, the usual synchronization method is to generate a synchronization pulse every clock frequency according to the solution step, and at the same time, a synchronization pulse is assigned to the model data to be processed in natural order, so that each model data to be processed is assigned synchronization information, and then addressing operations or solutions are performed according to the synchronization pulses assigned to these model data. This synchronization method generates synchronization pulses every clock frequency, and assigns synchronization pulses to the model data to be processed in sequence according to the sequence of synchronization pulses. Regardless of whether there is valid data input externally, each generated synchronization pulse opens up a fixed address space in sequence to reserve, so as to solve the model data. When there is no valid model data information to be processed externally, the above synchronization method will still open up an address space to be reserved, forming an idle state, wasting hardware resources.
[0004] When hardware resources are sufficient, the use of the above general synchronization method will not affect the solution and operation of the model, but will only occupy more hardware resources and incur more time costs, which is relatively less economical. However, in power electronic systems, occupying more hardware resources and time costs will reduce the real-time and accuracy of the simulation model, especially in the field of real-time simulation. Summary of the invention
[0005] The main purpose of the present application is to provide a synchronization method, a synchronization device, a computer-readable storage medium and a computer program product for a real-time simulation synchronization architecture, so as to at least solve the problem in the prior art that the hardware resources are idle due to the mismatch between the synchronization signal and the model data volume.
[0006] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a synchronization method for a real-time simulation synchronization architecture is provided, including: obtaining a clock pulse frequency, a simulation step size and a model data volume, wherein the model data volume is the amount of data to be simulated and solved in the simulation model; generating a first synchronization pulse signal according to the clock pulse frequency, and delaying the first synchronization pulse signal by one simulation step size and performing an inversion operation to obtain a second synchronization pulse signal; performing a logical AND operation on the first synchronization pulse signal and the second synchronization pulse signal to obtain a first output result, wherein the first output result is 0 or 1, 1 indicates that a counter is triggered, and 0 indicates that the counter is not triggered; when the first output result is 1, the counter is used to perform Count to obtain a counting result, and perform a logical comparison operation on the counting result and a comparison value to obtain a second output result, the counting result is less than the model data volume, the comparison value is 0 or the model data volume minus 1, and the second output result is 0 or 1. Perform the logical AND operation on the first output result and the second output result to obtain a third output result, the third output result is 0 or 1, 1 indicates that the current synchronization starts or the current synchronization ends, and 0 indicates that synchronization processing is in progress; when the counting result is 0 and the third output result is 1, a synchronization start signal is issued to prompt the simulation model to perform a synchronization operation of the simulation solution, and the synchronization operation includes at least one of the following: synchronous storage of data and synchronous reading of data.
[0007] Optionally, the first synchronization pulse signal is delayed by one simulation step and inverted to obtain a second synchronization pulse signal, including: delaying the first synchronization pulse signal by one simulation step to obtain a third synchronization pulse signal; and inverting the third synchronization pulse signal to obtain the second synchronization pulse signal.
[0008] Optionally, when the first output result is 1, counting is performed using a counter, and after obtaining the counting result, the method further includes: when the counting result is the model data amount, clearing the counter.
[0009] Optionally, when the first output result is 1, a counter is used to count, and after obtaining the counting result, the method further includes: assigning corresponding data address information to the data to be processed according to the counting result, and the data address information is the address space information of the data to be processed; and synchronously processing the data to be processed according to the data address information.
[0010] Optionally, the second output result is divided into a fifth output result and a sixth output result, and the counting result is logically compared with the comparison value to obtain the second output result, including: inputting the counting result into the first comparator and the second comparator at the same time, the comparison value of the first comparator is 0, and the comparison value of the second comparator is the model data amount minus 1; when the counting result is 0, the fifth output result output by the first comparator is obtained, and the fifth output result is 1; when the counting result is not 0, the fifth output result output by the first comparator is obtained, and the fifth output result is 0; when the counting result is the model data amount minus 1, the sixth output result output by the second comparator is obtained, and the sixth output result is 1; when the counting result is not the model data amount minus 1, the sixth output result output by the second comparator is obtained, and the sixth output result is 0.
[0011] Optionally, the third output result is divided into a seventh output result and an eighth output result, the seventh output result is used to indicate whether the current synchronization has started, and the eighth output result is used to indicate whether the current synchronization has ended, and the first output result is logically ANDed with the second output result to obtain the third output result, including: performing the logical AND operation on the first output result and the fifth output result; when the result of the logical AND operation is true, obtaining the seventh output result, the seventh output result is 1, indicating that the current synchronization has started; when the result of the logical AND operation is false, obtaining the seventh output result, the seventh output result is 0; performing the logical AND operation on the first output result and the sixth output result; when the result of the logical AND operation is true, obtaining the eighth output result, the eighth output result is 1, indicating that the current synchronization has ended; when the result of the logical AND operation is false, obtaining the eighth output result, the eighth output result is 0.
[0012] Optionally, after performing the logical AND operation on the first output result and the second output result to obtain a third output result, the method further includes: when the counting result is the model data amount minus 1 and the third output result is 1, issuing a synchronization end signal to prompt the simulation model that the current synchronization operation has ended.
[0013] According to another aspect of the present application, a synchronization device for a real-time simulation synchronization architecture is provided, the device comprising: an acquisition unit, used to acquire a clock pulse frequency, a simulation step size and a model data volume, wherein the model data volume is the amount of data to be simulated and solved in the simulation model; a generation unit, used to generate a first synchronization pulse signal according to the clock pulse frequency, and delay the first synchronization pulse signal by one simulation step size and perform an inversion operation to obtain a second synchronization pulse signal; a first logic operation unit, used to perform a logic AND operation on the first synchronization pulse signal and the second synchronization pulse signal to obtain a first output result, wherein the first output result is 0 or 1, 1 indicates that a counter is triggered, and 0 indicates that the counter is not triggered; a counting unit, used to, when the first output result is 1, use the A counter performs counting to obtain a counting result, and performs a logical comparison operation on the counting result and a comparison value to obtain a second output result, wherein the counting result is less than the model data volume, the comparison value is 0 or the model data volume minus 1, and the second output result is 0 or 1; a second logic operation unit is used to perform the logic AND operation on the first output result and the second output result to obtain a third output result, wherein the third output result is 0 or 1, 1 indicates the start or end of synchronization, and 0 indicates that synchronization is being processed; a first issuing unit is used to issue a synchronization start signal when the counting result is 0 and the third output result is 1, so as to prompt the simulation model to perform a synchronization operation of simulation solution, wherein the synchronization operation includes at least one of the following: synchronous storage of data and synchronous reading of data.
[0014] According to another aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute any one of the methods described.
[0015] According to another aspect of the present application, a computer program product is provided, comprising computer instructions, wherein when the computer instructions are executed by a processor, any one of the methods described above is implemented.
[0016] Applying the technical solution of the present application, in a synchronization method of a real-time simulation synchronization architecture, first, a clock pulse frequency, a simulation step size and a model data volume are obtained, wherein the model data volume is the data volume to be simulated and solved in the simulation model; then, a first synchronization pulse signal is generated according to the clock pulse frequency, and the first synchronization pulse signal is delayed by one of the simulation step sizes and inverted to obtain a second synchronization pulse signal; then, a logical AND operation is performed on the first synchronization pulse signal and the second synchronization pulse signal to obtain a first output result, wherein the first output result is 0 or 1, wherein 1 indicates that a counter is triggered and 0 indicates that the counter is not triggered; then, when the first output result is 1, the counter is used to count to obtain Counting result, and perform a logical comparison operation on the counting result and the comparison value to obtain a second output result, the counting result is less than the model data volume, the comparison value is 0 or the model data volume minus 1, and the second output result is 0 or 1; then, the first output result and the second output result are subjected to the above-mentioned logical AND operation to obtain a third output result, the third output result is 0 or 1, 1 indicates the current synchronization starts or the current synchronization ends, and 0 indicates that synchronization processing is in progress; finally, when the counting result is 0 and the third output result is 1, a synchronization start signal is issued to prompt the simulation model to perform the synchronization operation of the simulation solution, and the synchronization operation includes at least one of the following: synchronous storage of data and synchronous reading of data. The present application generates a synchronization pulse signal at every other clock pulse frequency to detect the validity of the synchronization pulse signal, that is, when the first output result is 1, it indicates that the pulse signal is valid, and when the pulse signal is valid, the counter is triggered, and the allocation of synchronization pulses is flexibly realized according to the amount of model data to be processed. The present application solves the problem of idle hardware resources caused by the mismatch between the synchronization signal and the model data volume in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 A hardware structure block diagram of a mobile terminal for executing a synchronization method of a real-time simulation synchronization architecture provided in an embodiment of the present application is shown;
[0018] Figure 2 A schematic flow chart of a synchronization method of a real-time simulation synchronization architecture provided according to an embodiment of the present application is shown;
[0019] Figure 3 A schematic diagram of the structure of a real-time simulation synchronization architecture provided according to an embodiment of the present application is shown;
[0020] Figure 4 A flowchart of a generation process of each structural module in a real-time simulation synchronization architecture provided according to an embodiment of the present application is shown;
[0021] Figure 5 A structural block diagram of a synchronization device of a real-time simulation synchronization architecture provided according to an embodiment of the present application is shown.
[0022] The above drawings include the following reference numerals:
[0023] 102, processor; 104, memory; 106, transmission device; 108, input and output devices. DETAILED DESCRIPTION
[0024] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0025] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0027] As introduced in the background technology, in the prior art, in power electronic systems, occupying more hardware resources and time overhead will reduce the real-time and accuracy of the simulation model, especially in the field of real-time simulation, the impact will be more serious. In order to solve the problem of idle hardware resources caused by the mismatch between the synchronization signal and the model data volume in the prior art, the embodiments of the present application provide a synchronization method, synchronization device, computer-readable storage medium and computer program product of a real-time simulation synchronization architecture.
[0028] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0029] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 FIG. 1 is a hardware structure block diagram of a mobile terminal of a synchronization method of a real-time simulation synchronization architecture according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0030] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the display method of device information in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, the above method is implemented. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof. The transmission device 106 is used to receive or send data via a network. The above-mentioned specific examples of the network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0031] In this embodiment, a synchronization method for a real-time simulation synchronization architecture running on a mobile terminal, a computer terminal or a similar computing device is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0032] Figure 2 1 is a flow chart of a synchronization method of a real-time simulation synchronization architecture according to an embodiment of the present application. Figure 2 As shown, the method comprises the following steps:
[0033] Step S201, obtaining the clock pulse frequency, simulation step size and model data volume, where the model data volume is the data volume to be simulated and solved in the simulation model.
[0034] Specifically, the simulation system is initialized, the clock pulse frequency f and the simulation step size Ts of the simulation system are obtained, and the amount of data or data dimension required for simulation solution is determined according to the synchronization architecture of the simulation system. The amount of model data to be processed needs to be set in advance, denoted as N.
[0035] Step S202, generating a first synchronization pulse signal according to the clock pulse frequency, delaying the first synchronization pulse signal by one of the simulation steps and performing an inversion operation to obtain a second synchronization pulse signal.
[0036] Specifically, the pulse signal P1, i.e., the first synchronization pulse signal, is generated according to the clock frequency of the simulation system, in order to establish a reference signal, which is synchronized with the clock frequency of the simulation system to ensure that all simulation operations are performed under a unified time reference. The second synchronization pulse signal is obtained by sequentially delaying and inverting the first synchronization pulse signal, in order to detect that there is valid model data information outside the simulation system, and the synchronization pulse signal is valid.
[0037] Step S203, performing a logic AND operation on the first synchronization pulse signal and the second synchronization pulse signal to obtain a first output result, wherein the first output result is 0 or 1, 1 indicates that the counter is triggered, and 0 indicates that the counter is not triggered.
[0038] Specifically, by performing a logic "AND" operation on the original synchronization pulse signal (i.e., the first synchronization pulse signal) and the inverted signal (i.e., the second synchronization pulse signal), the validity of the signal can be detected. If the two signals are completely synchronized, that is, the first synchronization pulse signal is at a high level (1) at the time point when it is generated, after being delayed and inverted, the second synchronization pulse signal should still be at a high level (1) at the time point, and the result of the logic "AND" operation will be 1. If there is any asynchrony, that is, the two signals are at different time points, the result of the logic "AND" operation will be 0. In this way, whether the synchronization pulse signal is valid can be determined by detecting the result of the logic "AND" operation.
[0039] Step S204, when the above-mentioned first output result is 1, the above-mentioned counter is used to count to obtain a counting result, and the above-mentioned counting result is logically compared with the comparison value to obtain a second output result, the above-mentioned counting result is less than the above-mentioned model data amount, the above-mentioned comparison value is 0 or the above-mentioned model data amount minus 1, and the above-mentioned second output result is 0 or 1.
[0040] Specifically, the first output result T_en is used as the enable signal of the counter. When the synchronization pulse signal is valid, that is, when the first output result is 1, the counter is triggered, and the counter starts counting from 0 with a step of 1. Whenever the first output result is 1, the counting result of the counter is increased by 1 to the value of the previous counting result until the counting result of the counter reaches N-1, which is recorded as T_dat. The counting result T_dat is logically compared with 0, and the counting result T_dat is also logically compared with N-1 to obtain the second output result.
[0041] Step S205, performing the above-mentioned logical AND operation on the above-mentioned first output result and the above-mentioned second output result to obtain the third output result, and the above-mentioned third output result is 0 or 1, 1 indicates that the current synchronization starts or the current synchronization ends, and 0 indicates that the synchronization is being processed.
[0042] Specifically, the above-mentioned first output result and the above-mentioned second output result are subjected to the above-mentioned logical AND operation, and 1 is output if the result is true, and 0 is output if the result is false.
[0043] Step S206, when the counting result is 0 and the third output result is 1, a synchronization start signal is issued to prompt the simulation model to perform a synchronization operation of the simulation solution, wherein the synchronization operation includes at least one of the following: synchronous storage of data and synchronous reading of data.
[0044] Specifically, the above counting result is 0, which means that the corresponding synchronization pulses and address space have been allocated to the model data currently required to be processed, and the next round of synchronization can be entered. Therefore, when the above counting result is 0 and the above third output result is 1, a synchronization start signal is issued, which is a signal that identifies the start of a simulation cycle of the simulation model or a simulation task synchronization processing process, and is used to trigger and start the entire synchronization processing process.
[0045] In this embodiment, first, the clock pulse frequency, the simulation step size and the model data volume are obtained, and the above-mentioned model data volume is the amount of data to be simulated and solved in the simulation model; then, a first synchronization pulse signal is generated according to the above-mentioned clock pulse frequency, and the above-mentioned first synchronization pulse signal is delayed by the above-mentioned simulation step size and inverted to obtain a second synchronization pulse signal; then, the above-mentioned first synchronization pulse signal and the above-mentioned second synchronization pulse signal are logically ANDed to obtain a first output result, and the above-mentioned first output result is 0 or 1, 1 indicates that the counter is triggered, and 0 indicates that the above-mentioned counter is not triggered; then, when the above-mentioned first output result is 1, the above-mentioned counter is used to count to obtain a counting result, and the above-mentioned counting result is The counting result is logically compared with the comparison value to obtain a second output result, the counting result is less than the model data volume, the comparison value is 0 or the model data volume minus 1, and the second output result is 0 or 1; then, the first output result is logically ANDed with the second output result to obtain a third output result, the third output result is 0 or 1, 1 indicates the current synchronization starts or the current synchronization ends, and 0 indicates that synchronization processing is in progress; finally, when the counting result is 0 and the third output result is 1, a synchronization start signal is issued to prompt the simulation model to perform the synchronization operation of the simulation solution, and the synchronization operation includes at least one of the following: synchronous storage of data and synchronous reading of data. The present application generates a synchronization pulse signal at every other clock pulse frequency to detect the validity of the synchronization pulse signal, that is, when the first output result is 1, it indicates that the pulse signal is valid, and when the pulse signal is valid, the counter is triggered, and the allocation of synchronization pulses is flexibly realized according to the amount of model data to be processed. The present application solves the problem of idle hardware resources caused by the mismatch between the synchronization signal and the model data volume in the prior art.
[0046] In order to enable those skilled in the art to more clearly understand the technical solution of the present application, the implementation process of the synchronization method of the real-time simulation synchronization architecture of the present application will be described in detail below in combination with specific embodiments.
[0047] In order to detect the validity of the synchronization pulse signal to reduce the occupation of hardware resources, in an optional implementation manner, the above step S202 includes:
[0048] Step S2021, delaying the first synchronization pulse signal by a simulation step length to obtain a third synchronization pulse signal;
[0049] Step S2022, performing the above-mentioned inversion operation on the above-mentioned third synchronization pulse signal to obtain the above-mentioned second synchronization pulse signal.
[0050] In the above embodiment, the above first synchronization pulse signal P1 is delayed by 1 simulation step length Ts to obtain a third synchronization pulse signal P3 after a time delay of 1 simulation step length, and the third synchronization pulse signal P3 is logically inverted (that is, 0 becomes 1 or 1 becomes 0) to obtain the inverted synchronization pulse signal P2, that is, the above second synchronization pulse signal. The purpose of the delay operation is to create a time offset, which can be used to detect the synchronization state of the signal. If the signal can still maintain this time offset after being processed by the simulation system, then it can be considered that the signal is synchronized. The purpose of the inversion operation is to logically create a signal relative to the original synchronization pulse signal (that is, the above first synchronization pulse signal), which can be used for subsequent logical judgments to detect the validity of the signal.
[0051] In order to avoid hardware resource idling and occupation caused by the mismatch between the synchronization signal and the model data volume, in an optional implementation manner, after the above step S204, the method further includes:
[0052] Step S301, when the counting result is the model data amount, clear the counter.
[0053] In the above embodiment, it is ensured that the counter starts counting from the initial state to avoid erroneous data synchronization. In a simulation cycle or simulation task, only valid synchronization pulse signals are counted according to the model data volume to avoid hardware resource idleness and occupation caused by mismatch between synchronization signals and model data volume. When the above counting result is the above model data volume, the counter is cleared to start the synchronization pulse allocation of the next simulation cycle or simulation task, and the counting is repeated from 0 to N-1.
[0054] In order to ensure correct processing and synchronization of data during the simulation process, in an optional implementation manner, after the above step S204, the method further includes:
[0055] Step S401, assigning corresponding data address information to the data to be processed according to the counting result, wherein the data address information is the address space information of the data to be processed;
[0056] Step S402: synchronously process the data to be processed according to the data address information.
[0057] In the above embodiment, if Figure 3As shown, the synchronization architecture includes an enable module, an end state module, a start state module and a data address module. After the counter counts, the counting result T_dat obtained will be used as a signal of the data address module. The process is as follows Figure 4 As shown, the above counting result mainly represents the data address information signal of the data to be processed, and at the same time assigns a synchronization information address identification signal, which can assign corresponding data address information to the data to be processed according to the above counting result, so as to synchronize the above data to be processed according to the above data address information, thereby ensuring the correct processing and synchronization of the data during the simulation process.
[0058] In order to improve the accuracy of the simulation model so as to accurately determine the start and end of synchronization, in an optional implementation manner, the above step S204 includes:
[0059] Step S2041, inputting the counting result into the first comparator and the second comparator at the same time, the comparison value of the first comparator is 0, and the comparison value of the second comparator is the model data amount minus 1;
[0060] Step S2042, when the counting result is 0, obtaining a fifth output result output by the first comparator, and the fifth output result is 1;
[0061] Step S2043, when the counting result is not 0, obtaining the fifth output result output by the first comparator, and the fifth output result is 0;
[0062] Step S2044, when the counting result is the model data amount minus 1, obtaining a sixth output result output by the second comparator, the sixth output result being 1;
[0063] Step S2045, when the counting result is not the model data amount minus 1, the sixth output result output by the second comparator is obtained, and the sixth output result is 0.
[0064] In the above embodiment, the second output result is divided into a fifth output result and a sixth output result. The counting result T_dat of the counter is input into the first comparator and compared with 0. When the counting result T_dat is 0, the output of the first comparator is 1, otherwise the output is 0. The output result of the first comparator is recorded as T_sta0, i.e., the fifth output result. The counting result T_dat of the counter is input into the second comparator and compared with N-1. When the counting result T_dat is N-1, the output of the second comparator is 1, otherwise the output is 0. The output result of the second comparator is recorded as T_end0, i.e., the sixth output result.
[0065] In order to reduce the flexibility and accuracy of the simulation model, in an optional implementation manner, the above step S205 includes:
[0066] Step S2051, performing the above-mentioned logical AND operation on the above-mentioned first output result and the above-mentioned fifth output result;
[0067] Step S2052, when the result of the above logic AND operation is true, the above seventh output result is obtained, and the above seventh output result is 1, indicating that the above current synchronization starts;
[0068] Step S2053, when the result of the above logic AND operation is false, obtaining the above seventh output result, the above seventh output result is 0;
[0069] Step S2054, performing the above-mentioned logical AND operation on the above-mentioned first output result and the above-mentioned sixth output result;
[0070] Step S2055, when the result of the above logic AND operation is true, the above eighth output result is obtained, and the above eighth output result is 1, indicating that the above current synchronization is completed;
[0071] Step S2056, when the result of the above logic AND operation is false, the above eighth output result is obtained, and the above eighth output result is 0.
[0072] In the above embodiment, the third output result is divided into a seventh output result and an eighth output result. The seventh output result is used to indicate whether the current synchronization has started, and the eighth output result is used to indicate whether the current synchronization has ended. The fifth output result T_sta0 and the first output result T_en are subjected to a logic "AND" operation. The result is a true output 1, and the result is a false output 0. The output result is recorded as T_sta, i.e., the seventh output result, which is the signal indicating the start of the synchronization architecture, and is the synchronization start signal. The sixth output result T_end0 and the first output result T_en are subjected to a logic "AND" operation. The result is a true output 1, and the result is a false output 0. The output result is recorded as T_end, i.e., the eighth output result, which is the signal indicating the end of the synchronization architecture, and is the synchronization end signal. In order to calculate the start and end conditions of the synchronization process, and by precisely controlling the synchronization pulse, the efficiency, flexibility and accuracy of the simulation model are improved.
[0073] It should also be noted that if Figure 3 The four modules in the synchronous architecture shown in the figure, namely, the enabling module, the end state module, the start state module and the data address module, can be used as global variables in the simulation model. The generation diagram of each module is as follows Figure 4As shown, the data address information signal T_dat can be used as the address input signal of the register and other hardware resources, used for the identification of the simulation model data, and given the address information of the model data to be processed, T_sta is used as the start signal of the pipeline synchronization process, T_end is used as the end or reset signal of the pipeline synchronization process, and T_en is used to judge the validity of the synchronization pulse signal. Of course, the functions of the above signals are not limited to this, for example, T_en can also be used for the separate extraction and processing of the simulation model data.
[0074] In order to ensure that the simulation system is performed accurately according to the predetermined time sequence, in an optional implementation manner, after the above step S205, the method further includes:
[0075] Step S501, when the counting result is the model data amount minus 1 and the third output result is 1, a synchronization end signal is issued to prompt the simulation model that the current synchronization operation has ended.
[0076] In the above embodiment, the above counting result is the above model data amount minus 1, which means that the model data amount currently needing to be processed has been fully allocated with corresponding synchronization pulses and address space, and the current synchronization processing has been completed, and the next round of synchronization can be entered. Therefore, when the above counting result is the model data amount minus 1 and the above third output result is 1, a synchronization end signal is issued, which indicates the end of a simulation cycle or simulation task, and is used to ensure that the simulation system is accurately carried out according to the predetermined timing.
[0077] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0078] The embodiment of the present application also provides a kind of synchronization device of real-time simulation synchronization framework, it should be noted that the synchronization device of the real-time simulation synchronization framework of the embodiment of the present application can be used to execute the synchronization method for real-time simulation synchronization framework provided by the embodiment of the present application. The device is used to implement the above-mentioned embodiment and preferred implementation mode, and the description has been made no more. As used below, the term "module" can realize the combination of software and / or hardware of predetermined functions. Although the device described in the following embodiments is preferably realized with software, the realization of hardware, or the combination of software and hardware is also possible and conceived.
[0079] The following introduces the synchronization device of the real-time simulation synchronization architecture provided in the embodiment of the present application.
[0080] Figure 5is a structural block diagram of a synchronization device of a real-time simulation synchronization architecture according to an embodiment of the present application. Figure 5 As shown, the device comprises:
[0081] The acquisition unit 10 is used to acquire the clock pulse frequency, the simulation step size and the model data volume, where the model data volume is the data volume to be simulated and solved in the simulation model.
[0082] Specifically, the simulation system is initialized, the clock pulse frequency f and the simulation step size Ts of the simulation system are obtained, and the amount of data or data dimension required for simulation solution is determined according to the synchronization architecture of the simulation system. The amount of model data to be processed needs to be set in advance, denoted as N.
[0083] The generating unit 20 is used to generate a first synchronization pulse signal according to the clock pulse frequency, and delay the first synchronization pulse signal by one of the simulation steps and perform an inversion operation to obtain a second synchronization pulse signal.
[0084] Specifically, the pulse signal P1, i.e., the first synchronization pulse signal, is generated according to the clock frequency of the simulation system, in order to establish a reference signal, which is synchronized with the clock frequency of the simulation system to ensure that all simulation operations are performed under a unified time reference. The second synchronization pulse signal is obtained by sequentially delaying and inverting the first synchronization pulse signal, in order to detect that there is valid model data information outside the simulation system, and the synchronization pulse signal is valid.
[0085] The first logic operation unit 30 is used to perform a logic AND operation on the first synchronization pulse signal and the second synchronization pulse signal to obtain a first output result. The first output result is 0 or 1, 1 indicates triggering the counter, and 0 indicates not triggering the counter.
[0086] Specifically, by performing a logic "AND" operation on the original synchronization pulse signal (i.e., the first synchronization pulse signal) and the inverted signal (i.e., the second synchronization pulse signal), the validity of the signal can be detected. If the two signals are completely synchronized, that is, the first synchronization pulse signal is at a high level (1) at the time point when it is generated, after being delayed and inverted, the second synchronization pulse signal should still be at a high level (1) at the time point, and the result of the logic "AND" operation will be 1. If there is any asynchrony, that is, the two signals are at different time points, the result of the logic "AND" operation will be 0. In this way, whether the synchronization pulse signal is valid can be determined by detecting the result of the logic "AND" operation.
[0087] The counting unit 40 is used to, when the first output result is 1, use the counter to count to obtain a counting result, and perform a logical comparison operation on the counting result and a comparison value to obtain a second output result. The counting result is less than the model data amount, the comparison value is 0 or the model data amount minus 1, and the second output result is 0 or 1.
[0088] Specifically, the first output result T_en is used as the enable signal of the counter. When the synchronization pulse signal is valid, that is, when the first output result is 1, the counter is triggered, and the counter starts counting from 0 with a step of 1. Whenever the first output result is 1, the counting result of the counter is increased by 1 to the value of the previous counting result until the counting result of the counter reaches N-1, which is recorded as T_dat. The counting result T_dat is logically compared with 0, and the counting result T_dat is also logically compared with N-1 to obtain the second output result.
[0089] The second logic operation unit 50 is used to perform the above-mentioned logic AND operation on the above-mentioned first output result and the above-mentioned second output result to obtain a third output result. The above-mentioned third output result is 0 or 1, 1 indicates that the current synchronization starts or the current synchronization ends, and 0 indicates that the synchronization is being processed.
[0090] Specifically, the above-mentioned first output result and the above-mentioned second output result are subjected to the above-mentioned logical AND operation, and 1 is output if the result is true, and 0 is output if the result is false.
[0091] The first sending unit 60 is used to send a synchronization start signal when the above-mentioned counting result is 0 and the above-mentioned third output result is 1, so as to prompt the above-mentioned simulation model to perform a synchronization operation of simulation solution, and the above-mentioned synchronization operation includes at least one of the following: synchronous storage of data and synchronous reading of data.
[0092] Specifically, the above counting result is 0, which means that the corresponding synchronization pulses and address space have been allocated to the current amount of model data that needs to be processed, and the next round of synchronization can be entered. Therefore, when the above counting result is 0 and the above third output result is 1, a synchronization start signal is issued, which is a signal that identifies the start of a simulation cycle of the simulation model or a simulation task synchronization processing process, and is used to trigger and start the entire synchronization processing process.
[0093] In this embodiment, the acquisition unit is used to acquire the clock pulse frequency, the simulation step size and the model data volume, and the above-mentioned model data volume is the amount of data to be simulated and solved in the simulation model; the generation unit is used to generate a first synchronization pulse signal according to the above-mentioned clock pulse frequency, and delay the above-mentioned first synchronization pulse signal by the above-mentioned simulation step size and perform an inversion operation to obtain a second synchronization pulse signal; the first logic operation unit is used to perform a logic AND operation on the above-mentioned first synchronization pulse signal and the above-mentioned second synchronization pulse signal to obtain a first output result, and the above-mentioned first output result is 0 or 1, 1 indicates that the counter is triggered, and 0 indicates that the above-mentioned counter is not triggered; the counting unit is used to use the above-mentioned counter to count when the above-mentioned first output result is 1 to obtain a counting result. The counting result and the comparison value are logically compared to obtain a second output result, the counting result is less than the model data volume, the comparison value is 0 or the model data volume minus 1, and the second output result is 0 or 1; the second logic operation unit is used to perform the above-mentioned logic AND operation on the first output result and the second output result to obtain a third output result, the third output result is 0 or 1, 1 indicates the start or end of synchronization, and 0 indicates that synchronization is being processed; the first issuing unit is used to issue a synchronization start signal when the counting result is 0 and the third output result is 1, so as to prompt the simulation model to perform the synchronization operation of simulation solution, and the synchronization operation includes at least one of the following: synchronous storage of data and synchronous reading of data. The present application generates a synchronization pulse signal at every other clock pulse frequency to detect the validity of the synchronization pulse signal, that is, when the first output result is 1, it indicates that the pulse signal is valid, and when the pulse signal is valid, the counter is triggered, and the allocation of synchronization pulses is flexibly realized according to the amount of model data to be processed. The present application solves the problem of idle hardware resources caused by the mismatch between the synchronization signal and the model data volume in the prior art.
[0094] In order to detect the validity of the synchronization pulse signal to reduce the occupation of hardware resources, in an optional implementation, the generation unit includes:
[0095] A delay module, delaying the first synchronization pulse signal by a simulation step length to obtain a third synchronization pulse signal;
[0096] The inversion module performs the inversion operation on the third synchronization pulse signal to obtain the second synchronization pulse signal.
[0097] In the above embodiment, the above first synchronization pulse signal P1 is delayed by 1 simulation step length Ts to obtain a third synchronization pulse signal P3 after a time delay of 1 simulation step length, and the third synchronization pulse signal P3 is logically inverted (that is, 0 becomes 1 or 1 becomes 0) to obtain the inverted synchronization pulse signal P2, that is, the above second synchronization pulse signal. The purpose of the delay operation is to create a time offset, which can be used to detect the synchronization state of the signal. If the signal can still maintain this time offset after being processed by the simulation system, then it can be considered that the signal is synchronized. The purpose of the inversion operation is to logically create a signal relative to the original synchronization pulse signal (that is, the above first synchronization pulse signal), which can be used for subsequent logical judgments to detect the validity of the signal.
[0098] In order to avoid hardware resource idleness and occupation caused by mismatch between synchronization signal and model data volume, in an optional implementation manner, the device further includes:
[0099] The clearing unit is used to use a counter to count when the first output result is 1, and after obtaining the counting result, clear the counter when the counting result is the model data amount.
[0100] In the above embodiment, it is ensured that the counter starts counting from the initial state to avoid erroneous data synchronization. In a simulation cycle or simulation task, only valid synchronization pulse signals are counted according to the model data volume to avoid hardware resource idleness and occupation caused by mismatch between synchronization signals and model data volume. When the above counting result is the above model data volume, the counter is cleared to start the synchronization pulse allocation of the next simulation cycle or simulation task, and the counting is repeated from 0 to N-1.
[0101] In order to ensure the correct processing and synchronization of data during the simulation process, in an optional implementation manner, the device further includes:
[0102] an information assigning unit, for, when the first output result is 1, using a counter to count, and after obtaining the counting result, assigning corresponding data address information to the data to be processed according to the counting result, wherein the data address information is address space information of the data to be processed;
[0103] A synchronous processing unit is used to synchronously process the above-mentioned data to be processed according to the above-mentioned data address information.
[0104] In the above embodiment, if Figure 3 As shown in FIG. 1 , the synchronous architecture includes an enable module, an end state module, a start state module and a data address module. After the counter counts, the counting result T_dat obtained will be used as a signal of the data address module. The generation diagram of each module is shown in FIG. Figure 4 As shown, the above counting result mainly represents the data address information signal of the data to be processed, and at the same time assigns a synchronization information address identification signal, which can assign corresponding data address information to the data to be processed according to the above counting result, so as to synchronize the above data to be processed according to the above data address information, thereby ensuring the correct processing and synchronization of the data during the simulation process.
[0105] In order to improve the accuracy of the simulation model so as to accurately determine the start and end of synchronization, in an optional implementation manner, the counting unit includes:
[0106] An input module, inputting the counting result to a first comparator and a second comparator at the same time, wherein the comparison value of the first comparator is 0, and the comparison value of the second comparator is the model data amount minus 1;
[0107] A first output module, when the counting result is 0, obtains a fifth output result output by the first comparator, and the fifth output result is 1;
[0108] A second output module, when the counting result is not 0, obtains the fifth output result output by the first comparator, and the fifth output result is 0;
[0109] A third output module, when the counting result is the model data amount minus 1, obtains a sixth output result output by the second comparator, and the sixth output result is 1;
[0110] The fourth output module obtains the sixth output result output by the second comparator when the counting result is not the model data amount minus 1, and the sixth output result is 0.
[0111] In the above embodiment, the second output result is divided into a fifth output result and a sixth output result. The counting result T_dat of the counter is input into the first comparator and compared with 0. When the counting result T_dat is 0, the output of the first comparator is 1, otherwise the output is 0. The output result of the first comparator is recorded as T_sta0, i.e., the fifth output result. The counting result T_dat of the counter is input into the second comparator and compared with N-1. When the counting result T_dat is N-1, the output of the second comparator is 1, otherwise the output is 0. The output result of the second comparator is recorded as T_end0, i.e., the sixth output result.
[0112] In order to reduce the flexibility and accuracy of the simulation model, in an optional implementation manner, the second logic operation unit includes:
[0113] A first logic operation module performs the above-mentioned logic AND operation on the above-mentioned first output result and the above-mentioned fifth output result;
[0114] A fifth output module, when the result of the logic AND operation is true, obtains the seventh output result, the seventh output result is 1, indicating that the current synchronization has started;
[0115] The sixth output module obtains the seventh output result when the result of the logic AND operation is false, and the seventh output result is 0;
[0116] A second logic operation module performs the above-mentioned logic AND operation on the above-mentioned first output result and the above-mentioned sixth output result;
[0117] The seventh output module obtains the eighth output result when the result of the logic AND operation is true, and the eighth output result is 1, indicating that the current synchronization is completed;
[0118] The eighth output module obtains the eighth output result when the result of the logic AND operation is false, and the eighth output result is 0.
[0119] In the above embodiment, the third output result is divided into a seventh output result and an eighth output result. The seventh output result is used to indicate whether the current synchronization has started, and the eighth output result is used to indicate whether the current synchronization has ended. The fifth output result T_sta0 and the first output result T_en are subjected to a logic "AND" operation. The result is a true output 1, and the result is a false output 0. The output result is recorded as T_sta, i.e., the seventh output result, which is the signal indicating the start of the synchronization architecture, and is the synchronization start signal. The sixth output result T_end0 and the first output result T_en are subjected to a logic "AND" operation. The result is a true output 1, and the result is a false output 0. The output result is recorded as T_end, i.e., the eighth output result, which is the signal indicating the end of the synchronization architecture, and is the synchronization end signal. In order to calculate the start and end conditions of the synchronization process, and by precisely controlling the synchronization pulse, the efficiency, flexibility and accuracy of the simulation model are improved.
[0120] It should also be noted that if Figure 3 The four modules in the synchronous architecture shown in the figure, namely, the enabling module, the end state module, the start state module and the data address module, can be used as global variables in the simulation model. The generation diagram of each module is as follows Figure 4As shown, the data address information signal T_dat can be used as the address input signal of the register and other hardware resources, used for the identification of the simulation model data, and given the address information of the model data to be processed, T_sta is used as the start signal of the pipeline synchronization process, T_end is used as the end or reset signal of the pipeline synchronization process, and T_en is used to judge the validity of the synchronization pulse signal. Of course, the functions of the above signals are not limited to this, for example, T_en can also be used for the separate extraction and processing of the simulation model data.
[0121] In order to ensure that the simulation system is performed accurately according to the predetermined timing, in an optional implementation manner, the device further includes:
[0122] The second sending unit is used for sending a synchronization end signal after performing the above-mentioned logical AND operation on the above-mentioned first output result and the above-mentioned second output result to obtain the third output result, when the above-mentioned counting result is the above-mentioned model data amount minus 1 and the above-mentioned third output result is 1, to prompt the above-mentioned simulation model that the current above-mentioned synchronization operation has ended.
[0123] In the above embodiment, the above counting result is the above model data amount minus 1, which means that the model data amount currently needing to be processed has been fully allocated with corresponding synchronization pulses and address space, and the current synchronization processing has been completed, and the next round of synchronization can be entered. Therefore, when the above counting result is the model data amount minus 1 and the above third output result is 1, a synchronization end signal is issued, which indicates the end of a simulation cycle or simulation task, and is used to ensure that the simulation system is accurately carried out according to the predetermined timing.
[0124] The synchronization device of the real-time simulation synchronization architecture includes a processor and a memory. The acquisition unit, the generation unit and the first logic operation unit are stored in the memory as program units, and the processor executes the program units stored in the memory to implement corresponding functions. The modules are all located in the same processor; or, the modules are located in different processors in any combination.
[0125] The processor includes a kernel, which retrieves the corresponding program unit from the memory. One or more kernels can be set, and the problem of idle hardware resources caused by the mismatch between synchronization signals and model data volume in the prior art can be solved by adjusting kernel parameters.
[0126] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0127] An embodiment of the present invention provides a computer-readable storage medium, which includes a stored program, wherein when the program is running, the device where the computer-readable storage medium is located is controlled to execute the synchronization method of the real-time simulation synchronization architecture.
[0128] Specifically, the synchronization method of the real-time simulation synchronization architecture includes:
[0129] Step S201, obtaining a clock pulse frequency, a simulation step size and a model data volume, where the model data volume is the data volume to be simulated and solved in the simulation model;
[0130] Step S202, generating a first synchronization pulse signal according to the clock pulse frequency, and delaying the first synchronization pulse signal by one of the simulation steps and performing an inversion operation to obtain a second synchronization pulse signal;
[0131] Step S203, performing a logic AND operation on the first synchronization pulse signal and the second synchronization pulse signal to obtain a first output result, wherein the first output result is 0 or 1, 1 indicates that the counter is triggered, and 0 indicates that the counter is not triggered;
[0132] Step S204, when the first output result is 1, the counter is used to count to obtain a counting result, and the counting result is logically compared with a comparison value to obtain a second output result, the counting result is less than the model data amount, the comparison value is 0 or the model data amount minus 1, and the second output result is 0 or 1;
[0133] Step S205, performing the above-mentioned logical AND operation on the above-mentioned first output result and the above-mentioned second output result to obtain a third output result, wherein the above-mentioned third output result is 0 or 1, 1 indicates that the current synchronization starts or the current synchronization ends, and 0 indicates that the synchronization is being processed;
[0134] Step S206, when the counting result is 0 and the third output result is 1, a synchronization start signal is issued to prompt the simulation model to perform a synchronization operation of the simulation solution, wherein the synchronization operation includes at least one of the following: synchronous storage of data and synchronous reading of data.
[0135] An embodiment of the present invention provides a processor, and the processor is used to run a program, wherein the synchronization method of the real-time simulation synchronization architecture is executed when the program is running.
[0136] Specifically, the synchronization method of the real-time simulation synchronization architecture includes:
[0137] Step S201, obtaining a clock pulse frequency, a simulation step size and a model data volume, where the model data volume is the data volume to be simulated and solved in the simulation model;
[0138] Step S202, generating a first synchronization pulse signal according to the clock pulse frequency, and delaying the first synchronization pulse signal by one of the simulation steps and performing an inversion operation to obtain a second synchronization pulse signal;
[0139] Step S203, performing a logic AND operation on the first synchronization pulse signal and the second synchronization pulse signal to obtain a first output result, wherein the first output result is 0 or 1, 1 indicates that the counter is triggered, and 0 indicates that the counter is not triggered;
[0140] Step S204, when the first output result is 1, the counter is used to count to obtain a counting result, and the counting result is logically compared with a comparison value to obtain a second output result, the counting result is less than the model data amount, the comparison value is 0 or the model data amount minus 1, and the second output result is 0 or 1;
[0141] Step S205, performing the above-mentioned logical AND operation on the above-mentioned first output result and the above-mentioned second output result to obtain a third output result, wherein the above-mentioned third output result is 0 or 1, 1 indicates that the current synchronization starts or the current synchronization ends, and 0 indicates that the synchronization is being processed;
[0142] Step S206, when the counting result is 0 and the third output result is 1, a synchronization start signal is issued to prompt the simulation model to perform a synchronization operation of the simulation solution, wherein the synchronization operation includes at least one of the following: synchronous storage of data and synchronous reading of data.
[0143] An embodiment of the present invention provides a synchronization architecture, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, at least the following steps are implemented:
[0144] Step S201, obtaining a clock pulse frequency, a simulation step size and a model data volume, where the model data volume is the data volume to be simulated and solved in the simulation model;
[0145] Step S202, generating a first synchronization pulse signal according to the clock pulse frequency, and delaying the first synchronization pulse signal by one of the simulation steps and performing an inversion operation to obtain a second synchronization pulse signal;
[0146] Step S203, performing a logic AND operation on the first synchronization pulse signal and the second synchronization pulse signal to obtain a first output result, wherein the first output result is 0 or 1, 1 indicates that the counter is triggered, and 0 indicates that the counter is not triggered;
[0147] Step S204, when the first output result is 1, the counter is used to count to obtain a counting result, and the counting result is logically compared with a comparison value to obtain a second output result, the counting result is less than the model data amount, the comparison value is 0 or the model data amount minus 1, and the second output result is 0 or 1;
[0148] Step S205, performing the above-mentioned logical AND operation on the above-mentioned first output result and the above-mentioned second output result to obtain a third output result, wherein the above-mentioned third output result is 0 or 1, 1 indicates that the current synchronization starts or the current synchronization ends, and 0 indicates that the synchronization is being processed;
[0149] Step S206, when the counting result is 0 and the third output result is 1, a synchronization start signal is issued to prompt the simulation model to perform a synchronization operation of the simulation solution, wherein the synchronization operation includes at least one of the following: synchronous storage of data and synchronous reading of data.
[0150] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program for initializing at least the following method steps:
[0151] Step S201, obtaining a clock pulse frequency, a simulation step size and a model data volume, where the model data volume is the data volume to be simulated and solved in the simulation model;
[0152] Step S202, generating a first synchronization pulse signal according to the clock pulse frequency, and delaying the first synchronization pulse signal by one of the simulation steps and performing an inversion operation to obtain a second synchronization pulse signal;
[0153] Step S203, performing a logic AND operation on the first synchronization pulse signal and the second synchronization pulse signal to obtain a first output result, wherein the first output result is 0 or 1, 1 indicates that the counter is triggered, and 0 indicates that the counter is not triggered;
[0154] Step S204, when the first output result is 1, the counter is used to count to obtain a counting result, and the counting result is logically compared with a comparison value to obtain a second output result, the counting result is less than the model data amount, the comparison value is 0 or the model data amount minus 1, and the second output result is 0 or 1;
[0155] Step S205, performing the above-mentioned logical AND operation on the above-mentioned first output result and the above-mentioned second output result to obtain a third output result, wherein the above-mentioned third output result is 0 or 1, 1 indicates that the current synchronization starts or the current synchronization ends, and 0 indicates that the synchronization is being processed;
[0156] Step S206, when the counting result is 0 and the third output result is 1, a synchronization start signal is issued to prompt the simulation model to perform a synchronization operation of the simulation solution, wherein the synchronization operation includes at least one of the following: synchronous storage of data and synchronous reading of data.
[0157] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0158] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0159] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0160] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0161] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0162] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0163] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0164] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0165] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0166] From the above description, it can be seen that the above embodiments of the present application achieve the following technical effects:
[0167] 1) The synchronization method of the real-time simulation synchronization architecture of the present application, first, obtain the clock pulse frequency, simulation step size and model data volume, the above-mentioned model data volume is the amount of data to be simulated and solved in the simulation model; then, generate a first synchronization pulse signal according to the above-mentioned clock pulse frequency, and delay the above-mentioned first synchronization pulse signal by one of the above-mentioned simulation step size and perform an inversion operation to obtain a second synchronization pulse signal; then, perform a logical AND operation on the above-mentioned first synchronization pulse signal and the above-mentioned second synchronization pulse signal to obtain a first output result, the above-mentioned first output result is 0 or 1, 1 indicates that the counter is triggered, and 0 indicates that the above-mentioned counter is not triggered; then, when the above-mentioned first output result is 1, use the above-mentioned counter to count and obtain a counting result The result is obtained by performing a logical comparison operation on the counting result and the comparison value to obtain a second output result. The counting result is less than the model data volume, the comparison value is 0 or the model data volume minus 1, and the second output result is 0 or 1. After that, the first output result and the second output result are subjected to the above-mentioned logical AND operation to obtain a third output result. The third output result is 0 or 1, 1 indicates that the current synchronization starts or the current synchronization ends, and 0 indicates that synchronization processing is in progress. Finally, when the counting result is 0 and the third output result is 1, a synchronization start signal is issued to prompt the simulation model to perform the synchronization operation of the simulation solution. The synchronization operation includes at least one of the following: synchronous storage of data and synchronous reading of data. The present application generates a synchronization pulse signal at every other clock pulse frequency to detect the validity of the synchronization pulse signal, that is, when the first output result is 1, it indicates that the pulse signal is valid. When the pulse signal is valid, the counter is triggered to flexibly realize the allocation of synchronization pulses according to the amount of model data to be processed. The present application solves the problem of idle hardware resources caused by the mismatch between the synchronization signal and the model data volume in the prior art.
[0168] 2) The synchronization device of the real-time simulation synchronization architecture of the present application, the acquisition unit is used to acquire the clock pulse frequency, the simulation step size and the model data volume, the above-mentioned model data volume is the amount of data to be simulated and solved in the simulation model; the generation unit is used to generate a first synchronization pulse signal according to the above-mentioned clock pulse frequency, and delay the above-mentioned first synchronization pulse signal by the above-mentioned simulation step size and perform an inversion operation to obtain a second synchronization pulse signal; the first logic operation unit is used to perform a logic AND operation on the above-mentioned first synchronization pulse signal and the above-mentioned second synchronization pulse signal to obtain a first output result, the above-mentioned first output result is 0 or 1, 1 indicates that the counter is triggered, and 0 indicates that the above-mentioned counter is not triggered; the counting unit is used to use the above-mentioned counter to count when the above-mentioned first output result is 1, A counting result is obtained, and a logic comparison operation is performed on the counting result and the comparison value to obtain a second output result, the counting result is less than the model data volume, the comparison value is 0 or the model data volume minus 1, and the second output result is 0 or 1; a second logic operation unit is used to perform the above-mentioned logic AND operation on the first output result and the second output result to obtain a third output result, the third output result is 0 or 1, 1 indicates the start or end of synchronization, and 0 indicates that synchronization is being processed; a first issuing unit is used to issue a synchronization start signal when the counting result is 0 and the third output result is 1, so as to prompt the simulation model to perform a synchronization operation of simulation solution, and the synchronization operation includes at least one of the following: synchronous storage of data and synchronous reading of data. The present application generates a synchronization pulse signal at every other clock pulse frequency to detect the validity of the synchronization pulse signal, that is, when the first output result is 1, it indicates that the pulse signal is valid, and when the pulse signal is valid, the counter is triggered, and the allocation of synchronization pulses is flexibly realized according to the amount of model data to be processed. The present application solves the problem of idle hardware resources caused by the mismatch between the synchronization signal and the model data volume in the prior art.
[0169] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A synchronization method for a real-time simulation synchronization architecture, characterized in that: include: Obtaining a clock pulse frequency, a simulation step size, and a model data volume, wherein the model data volume is the amount of data to be simulated and solved in the simulation model; Generate a first synchronization pulse signal according to the clock pulse frequency, and delay the first synchronization pulse signal by one simulation step and perform an inversion operation to obtain a second synchronization pulse signal; Performing a logic AND operation on the first synchronization pulse signal and the second synchronization pulse signal to obtain a first output result, wherein the first output result is 0 or 1, 1 indicates that the counter is triggered, and 0 indicates that the counter is not triggered; When the first output result is 1, the counter is used to count to obtain a counting result, and the counting result is logically compared with a comparison value to obtain a second output result, the counting result is less than the model data amount, the comparison value is 0 or the model data amount minus 1, and the second output result is 0 or 1; Performing the logic AND operation on the first output result and the second output result to obtain a third output result, wherein the third output result is 0 or 1, 1 indicates that the current synchronization starts or the current synchronization ends, and 0 indicates that the synchronization is being processed; When the counting result is 0 and the third output result is 1, a synchronization start signal is issued to prompt the simulation model to perform a synchronization operation of simulation solution, and the synchronization operation includes at least one of the following: synchronous storage of data and synchronous reading of data.
2. The method according to claim 1, characterized in that: The first synchronization pulse signal is delayed by one simulation step and inverted to obtain a second synchronization pulse signal, comprising: Delaying the first synchronization pulse signal by a simulation step length to obtain a third synchronization pulse signal; The third synchronization pulse signal is subjected to the inversion operation to obtain the second synchronization pulse signal.
3. The method according to claim 1, characterized in that When the first output result is 1, counting is performed using a counter, and after obtaining the counting result, the method further includes: When the counting result is the model data amount, the counter is cleared.
4. The method according to claim 1, characterized in that When the first output result is 1, counting is performed using a counter, and after obtaining the counting result, the method further includes: Assigning corresponding data address information to the data to be processed according to the counting result, wherein the data address information is address space information of the data to be processed; The data to be processed is synchronously processed according to the data address information.
5. The method according to claim 1, characterized in that The second output result is divided into a fifth output result and a sixth output result. The counting result is logically compared with the comparison value to obtain the second output result, including: Inputting the counting result into a first comparator and a second comparator at the same time, wherein the comparison value of the first comparator is 0, and the comparison value of the second comparator is the model data amount minus 1; When the counting result is 0, a fifth output result output by the first comparator is obtained, and the fifth output result is 1; When the counting result is not 0, obtaining the fifth output result output by the first comparator, and the fifth output result is 0; When the counting result is the model data amount minus 1, a sixth output result output by the second comparator is obtained, and the sixth output result is 1; When the counting result is not the model data amount minus 1, the sixth output result output by the second comparator is obtained, and the sixth output result is 0.
6. The method according to claim 5, characterized in that The third output result is divided into a seventh output result and an eighth output result, the seventh output result is used to indicate whether the current synchronization has started, and the eighth output result is used to indicate whether the current synchronization has ended. The first output result and the second output result are subjected to the logical AND operation to obtain a third output result, including: Performing the logic AND operation on the first output result and the fifth output result; When the result of the logic AND operation is true, the seventh output result is obtained, and the seventh output result is 1, indicating that the current synchronization starts; When the result of the logic AND operation is false, the seventh output result is obtained, and the seventh output result is 0; Performing the logic AND operation on the first output result and the sixth output result; When the result of the logic AND operation is true, the eighth output result is obtained, and the eighth output result is 1, indicating that the current synchronization is completed; When the result of the logic AND operation is false, the eighth output result is obtained, and the eighth output result is 0.
7. The method according to claim 1, characterized in that After performing the logic AND operation on the first output result and the second output result to obtain a third output result, the method further includes: When the counting result is the model data amount minus 1 and the third output result is 1, a synchronization end signal is issued to prompt the simulation model that the current synchronization operation has ended.
8. A synchronization device for real-time simulation synchronization architecture, characterized in that: The device comprises: An acquisition unit, used to acquire a clock pulse frequency, a simulation step size and a model data volume, wherein the model data volume is a data volume to be simulated and solved in a simulation model; A generating unit, configured to generate a first synchronization pulse signal according to the clock pulse frequency, and delay the first synchronization pulse signal by one simulation step and perform an inversion operation to obtain a second synchronization pulse signal; A first logic operation unit, used for performing a logic AND operation on the first synchronization pulse signal and the second synchronization pulse signal to obtain a first output result, wherein the first output result is 0 or 1, 1 indicates triggering the counter, and 0 indicates not triggering the counter; a counting unit, configured to, when the first output result is 1, use the counter to count to obtain a counting result, and perform a logical comparison operation on the counting result and a comparison value to obtain a second output result, the counting result being less than the model data amount, the comparison value being 0 or the model data amount minus 1, and the second output result being 0 or 1; A second logic operation unit is used to perform the logic AND operation on the first output result and the second output result to obtain a third output result, where the third output result is 0 or 1, 1 indicates the start or end of synchronization, and 0 indicates that synchronization is being processed; The first issuing unit is used to issue a synchronization start signal when the counting result is 0 and the third output result is 1, so as to prompt the simulation model to perform a synchronization operation of simulation solution, and the synchronization operation includes at least one of the following: synchronous storage of data and synchronous reading of data.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the method according to any one of claims 1 to 7.
10. A computer program product comprising computer instructions, characterized in that When the computer instructions are executed by a processor, the method according to any one of claims 1 to 7 is implemented.
