Distributed joint simulation clock synchronization method based on finite-state machine
By using a finite state machine to process discrete time domain signals in the Velo Cloud distributed joint simulation system, the clock synchronization problem of discrete and continuous model joint simulation under the distributed architecture is solved, and stable state value maintenance and multi-platform joint are achieved. simulation.
Patent Information
- Application Number
- CN202411533705.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-02-11
AI Technical Summary
Under a distributed architecture, clock synchronization cannot be achieved when the joint simulation of discrete and continuous models is simulated, especially the clock synchronization problem of discrete models, which affects the simulation efficiency of vehicle-road cloud integrated system.
The method based on the finite state machine is adopted to obtain discrete time domain signals in real time, and dynamic state transitions are performed inside the finite state machine to generate continuous time domain signals, and the simulation signal after clock synchronization is obtained through sampling.
It effectively solves the clock synchronization problem of joint simulation of discrete and continuous models under distributed architecture, ensures that there is output data at every communication moment, and supports multi-platform joint simulation.
Smart Images

Figure CN119416508A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the technical field of vehicle-road-cloud joint simulation, and in particular to a distributed joint simulation clock synchronization method based on a finite state machine. Background Art
[0002] Modeling is to establish a real-time, systematic cognitive model of the physical world, predict the state of the physical world in the digital world, simulate the operation of the physical world, simplify the reconstruction of the physical world, and then drive the physical world to optimize its operation. It can coordinate the full life cycle data of the physical world with the business process data to achieve the coordination of business processes and production processes. The vehicle-road-cloud integrated system is a complex system that crosses domains, disciplines, and regions, involving multiple technologies such as automobiles, transportation, autonomous driving, mobile communications, distributed computing, artificial intelligence, and the Internet of Things, and requires the integrated development of different technologies.
[0003] The fusion modeling of the vehicle-road-cloud integrated system involves the fusion of multi-scale models from different simulation platforms. Fusion usually requires large-scale computing resources. Parallel computing can accelerate the process of model fusion and improve the computing power of model fusion to support the task of completing multi-scale simulation within a reasonable time. In order to improve the efficiency of the fusion modeling and simulation of the vehicle-road-cloud integrated system, the multi-disciplinary model fusion method of the vehicle-road-cloud integrated system should adopt distributed technology. Distributed technology mostly adopts the client / server architecture, as shown in 0.
[0004] There are many ways to solve the problem of joint simulation of discrete and continuous models. The traditional method is to integrate the discrete event system model and the continuous system model into a unified simulation environment, and use discrete signals to drive the operation of the continuous system. However, under a distributed architecture, the model solutions of each platform are carried out synchronously and distributed on different nodes, and cannot be applied in an integrated environment. Therefore, the traditional method cannot solve the problem of joint simulation of discrete and continuous models under a distributed architecture, especially the clock synchronization problem of discrete models under a distributed architecture. In view of this, the present invention is proposed. Summary of the invention
[0005] The embodiment of the present invention provides a distributed joint simulation clock synchronization method based on a finite state machine to solve the above technical problems.
[0006] In a first aspect, an embodiment of the present invention provides a distributed joint simulation clock synchronization method based on a finite state machine, which is applied to a vehicle-road-cloud distributed joint simulation architecture, and the method includes:
[0007] Obtain the discrete time domain signal of any node in real time and input it into the finite state machine of the simulation platform;
[0008] In the finite state machine, a dynamic state transition is performed according to the discrete time domain signal, and according to the dynamic situation of the state transition, each non-zero discrete value in the discrete time domain signal is maintained until the moment before the next non-zero discrete value arrives, so as to obtain a continuous time domain signal;
[0009] According to the communication clock interval between the nodes, the continuous time domain signal is sampled to obtain a clock-synchronized simulation signal, which is used for joint simulation with other clock-synchronized simulation signals.
[0010] In a second aspect, an embodiment of the present invention provides an electronic device, the electronic device comprising:
[0011] one or more processors;
[0012] a memory for storing one or more programs,
[0013] When the one or more programs are executed by the one or more processors, the one or more processors implement the distributed joint simulation clock synchronization method based on a finite state machine as described in any embodiment.
[0014] In a third aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the distributed joint simulation clock synchronization method based on a finite state machine as described in any embodiment.
[0015] To summarize, an embodiment of the present invention proposes a joint simulation strategy for maintaining discrete signals using a finite state machine. When the discrete simulation platform cannot guarantee output data, the finite state machine is used to decompose the originally complex multiple control logics of the discrete simulation platform into a finite number of stable states, and the definition and behavior of each state are clarified to maintain a stable state value, thereby ensuring that the discrete simulation platform has output data at each communication moment to support the solution calculation of the simulation platform related to it. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0017] Figure 1 It is a schematic diagram of the architecture of a vehicle-road-cloud distributed joint simulation provided by an embodiment of the present invention;
[0018] Figure 2It is a schematic diagram of a heterogeneous platform solving timeline communication provided by an embodiment of the present invention;
[0019] Figure 3 This is a schematic diagram of a discrete signal that has an error after communication provided by an embodiment of the present invention;
[0020] Figure 4 It is a schematic diagram of a model of a zero-order holder maintaining a discrete signal provided by an embodiment of the present invention;
[0021] Figure 5 It is an output curve diagram of each module in a model of a zero-order holder maintaining a discrete signal provided by an embodiment of the present invention;
[0022] Figure 6 It is a schematic diagram of a model of a finite state machine maintaining a discrete signal provided by an embodiment of the present invention;
[0023] Figure 7 It is a state transition diagram inside a finite state machine provided by an embodiment of the present invention;
[0024] Figure 8 It is a flow chart of a distributed joint simulation clock synchronization method based on a finite state machine provided by an embodiment of the present invention;
[0025] Fig. 9 It is an output curve diagram of each module in a model of a finite state machine maintaining a discrete signal provided by an embodiment of the present invention;
[0026] Fig.10 It is a schematic diagram of a simulation application of a cloud-controlled vehicle speed sending function module provided by an embodiment of the present invention;
[0027] Fig.11 It is a graph of effective states and output continuous signals in a simulated cloud control scenario provided by an embodiment of the present invention;
[0028] Fig.12 An intelligent network-connected vehicle green wave passage experiment and its digital mapping space diagram provided by an embodiment of the present invention;
[0029] Fig.13 is a schematic diagram of a vehicle running state loss situation in a discrete time simulation tool provided by an embodiment of the present invention;
[0030] Fig.14 A histogram showing a situation where vehicle speed information is lost in a discrete time simulation tool provided by an embodiment of the present invention;
[0031] Fig.15 It is a bar graph of the disorder of the timing of vehicle speed information in a discrete time simulation tool provided by an embodiment of the present invention;
[0032] Fig.16 It is a histogram of vehicle speed information maintained by a finite state machine in a discrete time simulation tool provided by an embodiment of the present invention;
[0033] Fig.17 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0034] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be described clearly and completely below. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work belong to the scope of protection of the present invention.
[0035] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.
[0036] In the description of the present invention, it is also necessary to explain that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0037] The embodiment of the present invention provides a distributed joint simulation clock synchronization method based on a finite state machine. In order to illustrate the method, the clock synchronization problem of discrete models in the vehicle-road-cloud distributed joint simulation is first analyzed. Usually in the same joint simulation, different models independently set the communication step size and solution step size according to their own dynamic characteristics (frequency, time scale, etc.). During the joint simulation process, the simulation time and communication step size (also called communication clock interval) of the main node and each simulation node of the distributed joint simulation must be consistent, and the interactive data is always synchronized at the communication time, as shown in 0. Regardless of whether the three models have a fixed step size or whether the solution step size is equal, data interaction is performed at a communication step size of every Δt, so as to ensure the correctness of the distributed joint simulation results, where T0, T 1*Δt ,…T n*Δt They represent n+1 communication moments respectively.
[0038] It can be seen that when models built on various simulation platforms participate in distributed joint simulation, they all need to ensure that there are solution values at the communication time. At the communication time, the continuous system only needs to use the value of the integral solution at that time as the node's solution value for data interaction; as a discrete system, it cannot guarantee that discrete signals will be sent at any time, and the content and form of data interaction at the communication time without discrete signals cannot be determined. As shown in 0, the horizontal axis in the figure represents time (seconds) and the vertical axis represents the signal value. The original discrete signal is shown in the original data curve, the communication clock interval is shown in the communication curve, and the communication step is 10s. The signal received at the distributed joint simulation server is shown in the data received curve. It can be clearly seen that the signal only transmits part of the falling edge signal. The rising edge signal is not triggered at the communication time, so it is not correctly transmitted to the server.
[0039] Specifically speaking of the vehicle-road-cloud distributed joint simulation architecture, in the process of integrated vehicle-road-cloud system fusion modeling, discrete models are usually perception models or control models, such as vehicle beyond-visual-range perception, vehicle optimal path planning, safety warning system, and traffic dynamic control and other multi-level cloud control basic platform and application platform models. In the perception model, one or more perception objects only change their values at discrete times; in the control model, one or several signals are a string of pulse data. Although they can be understood as discrete models in concept, they lack mathematical precision and cannot be modeled in advance in the form of pulse sequences. Instead, they form signals, messages, and events under some random trigger conditions. The trigger conditions and applicable scenarios of this type of discrete model are shown in Figure 0.
[0040] Table 1 Discrete model of vehicle-road-cloud integrated system
[0041]
[0042] The above trigger conditions are closely related to the driver's driving behavior, traffic characteristics, road conditions, weather conditions, and traffic management needs. Any of these trigger conditions is irregular, and they cannot be described by mathematical expressions for discrete behaviors, so it is impossible to establish a discrete mathematical model. In the process of fusion modeling of the vehicle-road-cloud integrated system, a processing module is required to complete the conversion between discrete signals and continuous signals.
[0043] Furthermore, there are many ways to convert discrete signals into continuous signals, mainly including digital-to-analog converters, discrete-time Fourier transforms, interpolation, signal reconstruction, etc. In related technologies, existing offline signal conversion methods are achieved by using curve fitting and constructing continuously differentiable objective functions, or through full-phase Fourier reconstruction and linear interpolation. The above-mentioned conversion methods require the input digital signal to be decomposed into a series of discrete sampling sequences in advance. These sampling sequences are usually sampled at fixed time intervals or the complete content of the sequence is already known in advance. Since the discrete model in the vehicle-road-cloud integrated system cannot send discrete signals at fixed time intervals, the previous conversion methods cannot be applied to the conversion of discrete to continuous signals in the vehicle-road-cloud integrated system.
[0044] The holder is an important part in digital control systems, used to convert discrete signals into continuous signals. The holder is divided into first-order holder and zero-order holder. The holder converts discrete sampling signals into continuous signals based on the principle of time domain extrapolation.
[0045] The principle of the zero-order holder is to keep the discrete signal sent at the current moment until the moment before the next sampling period (the zero-order holder itself has a sampling period, which determines the length of the signal holding). This can turn a pulse sequence into a continuous step signal. The principle of the first-order holder is to add a continuous signal between the discrete signal sent at the current moment and the discrete signal sent at the next moment. The continuous signal is a first-order function. The first-order holder needs to calculate the continuous function between the two based on the signal values at the current moment and the next moment. For discrete models without discrete time functions and unknown discrete sequences, a zero-order holder can be used to keep the last discrete signal value sent until the next discrete signal value is sent, but the premise is that the sampling period of the zero-order holder itself is set to be the same as the interval between discrete signals, which is difficult to achieve in practical applications.
[0046] Specifically, in the fusion modeling of the vehicle-road-cloud integrated system, a zero-order holder can be added to Simulink according to the principle. The model is built as shown in 0, and the basic sampling time (or simulation step) is 0.1s. Discrete is a discrete signal sending model, and communicate is a step communication model in the distributed simulation architecture of the model. Original data is the original discrete signal; communication interval is the communication interval step. In the figure, data is sent and received at a communication interval of 10s; hold out is the output result of the zero-order holder. The zero-order holder itself samples and holds the signal at a sampling interval of 5s. Data received is the data received by the distributed joint simulation server. Figure 5 Output signals for each module.
[0047] Specifically, the time domain function gh(t) of the zero-order holder can be expressed as:
[0048] gh(t)=1(t)-1(tT)
[0049] Among them, 1(t) represents the unit step function, and T represents the sampling interval of the zero-order holder itself (such as 5s above). When t ≥ T, the function value is 0, indicating that the unit step is maintained within a period T.
[0050] Assuming that the original data in the figure is a discrete vehicle acceleration guidance sequence, it can be concluded from the principle of the zero-order holder that the original data sent acceleration information once at t=4.9s. After the zero-order holder holdout, the acceleration information was kept until t=9.9s. At t=10s, no acceleration information was sent, and the zero-order holder cleared the acceleration information until the deceleration information was received at t=20s, and then the second acceleration information was output. From the hold out curve, it can be seen that at t=10s, the acceleration information was not effectively held, resulting in the server data receiving not receiving the acceleration information that the vehicle should have received at t=10s when communicating at 10s, and all subsequent acceleration information was lost for the same reason. It can be concluded that the zero-order holder in Simulink cannot meet the requirements of converting discrete signals to continuous signals in the vehicle-road-cloud integrated distributed joint simulation system (referred to as the vehicle-road-cloud distributed joint simulation system).
[0051] Based on the above problems, this embodiment introduces a finite state machine in the vehicle-cloud-road distributed joint simulation system to maintain discrete signals. A finite state machine is a mathematical model that clearly describes the system behavior by defining the system state, input and output signals, and state transition rules. In order to achieve the conversion from discrete signals to continuous signals, this embodiment uses a finite state machine as a bridge to convert Figure 4 The zero-order holder is replaced by a finite state machine, and the model is constructed as follows Figure 6 shown.
[0052] Different from the zero-order holder principle, for the same discrete signal source, step communication interval and communication model, the finite state machine does not need to set its own sampling interval to maintain the discrete signal state, but relies on the state transition rule to maintain the discrete signal state. In a specific implementation, the finite state machine can be constructed in the following way:
[0053] Step 1: Construct a finite state machine module in a simulation platform (such as Simulink) and build a discrete signal retention model based on the finite state machine module, such as Figure 6 Model shown.
[0054] Step 2: define the input signal of the finite state machine module as a discrete time domain signal.
[0055] Step 3: Construct a finite number of states of the finite state machine module according to the characteristics of the discrete time domain signal. Optionally, two states can be constructed according to the characteristics of the discrete time domain signal with data and without data: a state with data and a hold state.
[0056] Step 4: Construct a state transition rule according to the defined state. Optionally, the following state transition rule can be constructed: in response to the value of the input signal being non-zero, transition to the state with data; in response to the value of the input signal being zero, transition to the state of holding.
[0057] Step 5: construct the output signal of the finite state machine module according to the state transfer rule. Optionally, the following output signal can be constructed: in response to the data state after the transfer, the most recent non-zero value in the input signal is used as the current output of the finite state machine; in response to the hold state after the transfer, the output of the finite state machine in the previous state is used as the current output.
[0058] For example, still taking the case where the original data is a discrete vehicle acceleration guide sequence, and there is only acceleration and deceleration information, a finite state machine can be established for this scenario to maintain the correct vehicle speed sequence state signal to be transmitted to the communication module. Specifically, this embodiment expects the finite state machine to take the acceleration discrete time domain signal as input, output acceleration when the input signal>0, output deceleration when the input signal<0, and output the acceleration or deceleration of the previous state when the input signal=0. In order to achieve the above expectations, the following is still adopted: Figure 6 The model shown can be used to construct a finite state machine as follows:
[0059] First, define the acceleration state in the finite state machine as S up , the deceleration state is S down , the vehicle speed is maintained at S hold , the input signal is D in Then, the state transfer matrix is defined in the finite state machine, where the state transfer matrix is a two-dimensional array, the rows represent the current state, the columns represent the next possible state, and the element values can represent the rules for transferring from the current state to the next state. The state transfer matrix is:
[0060]
[0061] The state transition diagram inside the finite state machine is shown in Figure 7.
[0062] Assume that x(n) is a discrete time input signal sequence, where n is a number of discrete signal instructions that are independent of time, and i is the sequence number of the most recent discrete signal received by the finite state machine up to the current moment. y(t) is the continuous output function of the finite state machine, where t is a time variable, is the simulation time step of the finite state machine (the simulation time step is smaller than the communication clock interval, such as 50 times, 100 times, etc.), then the value of y(t) at each state holding and switching moment is shown as 0.
[0063] Table 2 Finite state machine state retention and switching output value table
[0064]
[0065] Based on the above finite state machine, Figure 8 This is a flow chart of a distributed joint simulation clock synchronization method based on a finite state machine provided in an embodiment of the present invention. This method is applicable to the case of performing communication clock synchronization on discrete time domain signals in a vehicle-road-cloud distributed joint simulation, and is executed by an electronic device, which may be a node providing discrete time domain signals, or a simulation server receiving discrete time domain signals, or a middleware deployed between a node providing discrete time domain signals and a simulation server, etc. This embodiment does not impose any specific restrictions. Figure 8 As shown, the method specifically includes:
[0066] S110, acquiring the discrete time domain signal of any node in real time, and inputting the signal into the finite state machine of the simulation platform.
[0067] This embodiment starts to obtain specific signal values at the same time when the discrete time domain signal is generated, and inputs them into the simulation platform for real-time processing, that is, the signal is processed while it is generated.
[0068] Among them, any of the nodes can be a node that provides discrete time domain signals, or a node that receives discrete time domain signals, or other nodes related to discrete time domain signals in the vehicle-road-cloud distributed joint simulation system. The simulation platform can be a simulation software or simulation module deployed in any of the nodes, such as Simulink software or one of its modules, in which the finite state machine as described above is pre-built in the simulation platform to achieve the response and maintenance of discrete signals.
[0069] S120. Within the finite state machine, a dynamic state transition is performed according to the discrete time domain signal, and according to the dynamic situation of the state transition, each non-zero discrete value in the discrete time domain signal is maintained until the moment before the next non-zero discrete value arrives, so as to obtain a continuous time domain signal.
[0070] After the discrete time domain signal is input into the finite state machine of the simulation platform, the following operations are performed in sequence inside the finite state machine:
[0071] First, a dynamic state transition is performed according to the real-time signal value of the discrete time domain signal. Optionally, in response to the current value of the discrete time domain signal being non-0, the state is transferred to the data state; in response to the current value of the discrete time domain signal being 0, the state is transferred to the hold state. Exemplarily, referring to the above state transition matrix (1), in response to the current acceleration in the discrete time domain signal being >0, the state is transferred to the acceleration state; in response to the current acceleration in the discrete time domain signal being <0, the state is transferred to the deceleration state; in response to the current acceleration in the discrete time domain signal being 0, the state is transferred to the hold state.
[0072] Then, according to the dynamic situation of the state transition, a continuous time domain signal is output. Optionally, in response to the data state after the transition, a non-zero discrete value closest to the current moment in the discrete time domain signal is used as the current output of the finite state machine; in response to the hold state after the transition, the output of the finite state machine at the previous moment is used as the current output; the output of the finite state machine at each moment together constitutes a continuous time domain signal. Exemplarily, referring to Table 2, in response to the hold state after the transition, In other cases, y(t)=x(i); the output of the finite state machine at each time together constitutes a continuous time domain signal.
[0073] S130. Sample the continuous time domain signal according to the communication clock interval between the nodes to obtain a clock-synchronized simulation signal for joint simulation with other clock-synchronized simulation signals.
[0074] Still taking the example that the original data is a discrete vehicle acceleration guidance sequence, and there is only acceleration and deceleration information, Fig. 9 The output signals of each module after the zero-order holder is replaced by a finite state machine. Fig. 9 , the original data original data sent acceleration information (such as vehicle acceleration) at t=4.9s. After receiving the acceleration information, the finite state machine stateflow entered the upshifting_state (acceleration) state. At t=5.0s, the original data original data sent data 0, and the finite state machine state flow maintained the acceleration information. The original data original data sent deceleration information at t=19.9s. After receiving the deceleration information, the finite state machine state flow entered the downshifting_state (deceleration) state. At t=20.0s, the original data original data sent data 0, and the finite state machine state flow maintained the deceleration information. It can be seen from the state flow output curve (i.e., the continuous time domain signal obtained by S120) that at t=10s, the acceleration information was effectively maintained, and the server datareceived (i.e., the simulation signal after clock synchronization obtained by S130) received the acceleration information of the vehicle at t=10s.
[0075] It can be concluded that the finite state machine effectively solves the problem of zero-order keeper data loss. The finite state machine decomposes the original complex control logic of the discrete system into a finite number of stable states, each of which has a clear definition and behavior. This decomposition makes the discrete system logic easier to understand, the transition between discrete behaviors more predictable, and the visual transition is more conducive to problem analysis, which helps to simplify the code structure, reduce programming difficulty, and reduce logical errors and confusion.
[0076] Further, in another specific implementation, the continuous signal in the simulator also takes values in very short time steps, and the output is displayed as an approximately continuous curve. In this embodiment, these very short time steps are referred to as simulation steps, wherein each simulation step is smaller than the communication clock interval. When considering the simulation step, the following operations are performed in sequence in each simulation step of the finite state machine:
[0077] S10. In response to the discrete time domain signal taking a value other than 0 at the current simulation step, the state is transferred to a data state at the current simulation step; in response to the current discrete signal taking a value of 0 at the current simulation step, the state is transferred to a hold state at the current simulation step.
[0078] S20. In response to the current simulation step being in a data state, the non-zero discrete value closest to the current moment is used as the output of the finite state machine at the current simulation step; in response to the current simulation step being in a hold state, the output of the finite state machine at the previous simulation step is used as the output of the current simulation step; the outputs of the finite state machine at each simulation step together constitute a continuous time domain signal.
[0079] Furthermore, when the simulation step of the finite state machine is not very small, in order to balance the simulation accuracy and simulation efficiency, the simulation step of the finite state machine can also be dynamically adjusted according to the minimum time interval between the existing non-zero values in the discrete time domain signal. Optionally, within each simulation step of the finite state machine, after executing S10 and S20, the minimum time interval between the existing non-zero values in the discrete time domain signal can also be calculated; if the minimum time interval is less than the current simulation step, the next simulation step is adjusted to be less than the minimum time interval, and the operation within the next simulation step is performed with the new simulation step. This cycle repeats until the discrete time domain signal terminates.
[0080] Optionally, when the discrete time domain signal and the finite state machine come from different simulation platforms, the discrete time domain signal may also have its own output step length, called the simulation step length of the discrete time domain signal, which is independent of the simulation step length of the finite state machine, and the relationship between the two may be greater than, less than or equal to, but no matter which relationship, both are less than the communication clock interval. In this case, the above method of dynamically adjusting the simulation step length of the finite state machine according to the discrete time domain signal is very meaningful, and can well balance the simulation efficiency and simulation accuracy between the joint simulations across simulation platforms.
[0081] Furthermore, in order to prove the effectiveness of the method of this embodiment, the following introduces the application examples of the method in two simulation scenarios:
[0082] The first scenario simulates the cloud-controlled vehicle speed function. Figure 6 In the modeling process, the discrete signal sending model is replaced by the cloud control platform of the vehicle-road-cloud integrated system. The vehicle speed information is sent to the cloud control platform to control the speed of the intelligent networked vehicle. The finite state machine is set as a bridge between the cloud control platform and the communication model participating in the distributed joint simulation. The state transfer matrix (1) and Table 2 can be referred to inside the finite state machine. Only the input signal is replaced by the discrete vehicle speed signal.
[0083] The APP design tool in Matlab is used to establish a simulation application of the cloud-controlled vehicle speed sending function module, and the expected vehicle speed is sent to the vehicle model through the fusion interface based on the communication client. Fig.10 When the Send Speed button is clicked, the cloud-controlled vehicle speed sending function module sends the vehicle speed input in the input box to the fusion interface module. The relationship sequence between vehicle speed and time is shown in FIG0.
[0084] Table 3 Discrete vehicle speed signal table
[0085]
[0086]
[0087] Before the fusion interface sends the discrete signal, the discrete vehicle speed pulse signal is converted into a continuous signal through the finite state machine, ensuring the accuracy of the interactive data of the fusion interface module. Fig.11 The effective state and output continuous signal curve graph are shown.
[0088] The second scenario is the green wave traffic scenario. The method of this embodiment can be effectively applied in the green wave traffic scenario. The green wave traffic experiment of the intelligent networked vehicle and the digital mapping space formed synchronously are as follows: Fig.12 shown.
[0089] Cloud control obtains vehicle operation status information through the on-board communication module of the connected vehicle and the perception of non-connected vehicles, supports collaborative computing based on the status information, and formulates the green wave communication speed distribution strategy based on the calculation results. In the digital mapping space, cloud control obtains vehicle operation status information through the on-board communication module of the connected vehicle. This study uses Veins to support vehicle communication in Sumo, implements the communication module, and completes communication with Sumo by running the Veins open source framework in the OMNeT++ discrete event simulation tool.
[0090] The Veins framework running based on discrete time simulation tools may lose the vehicle speed information received from Sumo, such as Fig.13 In order to better reflect the loss of vehicle speed status information, this embodiment extracts the vehicle speed information from the vehicle status information to form a bar graph, as shown in Fig.14 shown.
[0091] It can be seen from 0 that at the 4th communication moment, the discrete simulation tool did not send the vehicle speed information to the cloud control information receiving end. If the receiving end continues to wait for the arrival of the vehicle speed information, the simulation will not be able to continue. If the receiving end does not set a waiting mechanism and receives the data at the 5th communication moment as the data at the 4th moment, the simulation data will have a timing disorder problem, such as Fig.15 shown.
[0092] The distributed joint simulation method based on the finite state machine of this embodiment is used to Fig.13 After the discrete speed signal shown in FIG. 1 is processed, the finite state machine of the Veins communication module is transferred to the holding state according to the 0 vehicle speed signal at the loss moment (the fourth communication moment), and the speed before the loss is maintained until the next speed arrives according to the holding state to fill the lost vehicle speed signal, and finally the updated vehicle speed information bar graph is obtained, as shown in FIG. Fig.16 It can be concluded that using a finite state machine to maintain the state of discrete data in a discrete simulation tool can solve the problem of data accuracy caused by timing disorder in distributed joint simulation based on Jacobi coupling. This is an additional beneficial effect of the method of this embodiment in the green wave traffic scenario.
[0093] In summary, this embodiment proposes a joint simulation strategy for maintaining discrete signals using a finite state machine. When the discrete simulation platform cannot guarantee output data, the finite state machine is used to decompose the originally complex multiple control logics of the discrete simulation platform into a finite number of stable states, and the definition and behavior of each state are clarified to maintain a stable state value, thereby ensuring that the discrete simulation platform has output data at each communication moment to support the solution calculation of the simulation platform related to it.
[0094] In addition, when the simulation step size of the finite state machine is not very small, the simulation step size of the finite state machine can be dynamically adjusted according to the minimum time interval between the existing non-zero values in the discrete time domain signal, so as to take into account both simulation accuracy and simulation efficiency. This is particularly suitable for the case where the discrete time domain signal and the finite state machine come from different simulation platforms, and can strike a good balance between simulation efficiency and simulation accuracy in joint simulations across simulation platforms.
[0095] In particular, applying the method provided in this embodiment to the green wave traffic scenario can automatically fill in the lost vehicle speed control information and solve the data accuracy problem caused by timing disorder in the distributed joint simulation based on Jacobi coupling. This is an additional beneficial effect that the method can produce in addition to discrete data retention.
[0096] Fig.17 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention is shown in FIG. Fig.17 As shown, the device includes a processor 60, a memory 61, an input device 62 and an output device 63; the number of processors 60 in the device can be one or more. Fig.17 A processor 60 is taken as an example; the processor 60, the memory 61, the input device 62 and the output device 63 in the device can be connected by a bus or other means. Fig.17 The example of connecting through bus is taken in the following.
[0097] The memory 61, as a computer-readable storage medium, can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the distributed joint simulation clock synchronization method based on a finite state machine in the embodiment of the present invention. The processor 60 executes various functional applications and data processing of the device by running the software programs, instructions and modules stored in the memory 61, that is, realizing the above-mentioned distributed joint simulation clock synchronization method based on a finite state machine.
[0098] The memory 61 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 61 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 61 may further include a memory remotely arranged relative to the processor 60, and these remote memories may be connected to the device 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 combinations thereof.
[0099] The input device 62 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the device. The output device 63 may include a display device such as a display screen.
[0100] An embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the distributed joint simulation clock synchronization method based on a finite state machine of any embodiment is implemented.
[0101] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, a device or a device or used in combination with it.
[0102] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0103] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0104] Computer program code for performing the operations of the present invention may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as C or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0105] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the technical solutions of the embodiments of the present invention.
Claims
1. A distributed joint simulation clock synchronization method based on a finite state machine, characterized in that: Applied to a vehicle-road-cloud distributed joint simulation architecture, the method includes: Obtain the discrete time domain signal of any node in real time and input it into the finite state machine of the simulation platform; In the finite state machine, a dynamic state transition is performed according to the discrete time domain signal, and according to the dynamic situation of the state transition, each non-zero discrete value in the discrete time domain signal is maintained until the moment before the next non-zero discrete value arrives, so as to obtain a continuous time domain signal; According to the communication clock interval between the nodes, the continuous time domain signal is sampled to obtain a clock-synchronized simulation signal, which is used for joint simulation with other clock-synchronized simulation signals.
2. The method according to claim 1, characterized in that The step of performing a dynamic state transition according to the discrete time domain signal and maintaining each non-zero discrete value in the discrete time domain signal until a moment before the next non-zero discrete value arrives according to the dynamic situation of the state transition to obtain a continuous time domain signal includes: S1, in response to the current value of the discrete time domain signal being non-0, transferring to a data state; in response to the current value of the discrete time domain signal being 0, transferring to a hold state; S2, in response to the data state after the transfer, taking the non-zero discrete value closest to the current moment in the discrete time domain signal as the current output of the finite state machine; in response to the hold state after the transfer, taking the output of the finite state machine at the previous moment as the current output; S3. The output of the finite state machine at each time together constitutes a continuous time domain signal.
3. The method according to claim 2, characterized in that The steps composed of S1-S3 include: The following operations are performed in sequence within each simulation step of the finite state machine: In response to the discrete time domain signal taking a value other than 0 at the current simulation step, transferring to a data state at the current simulation step; in response to the discrete time domain signal taking a value of 0 at the current simulation step, transferring to a hold state at the current simulation step; In response to the current simulation step being in a data state, taking the non-zero discrete value closest to the current moment as the output of the finite state machine at the current simulation step; in response to the current simulation step being in a hold state, taking the output of the finite state machine at the previous simulation step as the output of the current simulation step; The output of the finite state machine at each simulation step together constitutes a continuous time domain signal; Wherein, each simulation step length is smaller than the communication clock interval.
4. The method according to claim 3, characterized in that The operations within each simulation step of the finite state machine also include: Calculating the minimum time interval between existing non-zero values in the discrete time domain signal; If the minimum time interval is smaller than the current simulation step length, the next simulation step length is adjusted to be smaller than the minimum time interval.
5. The method according to claim 4, characterized in that The real-time acquisition of a discrete time domain signal of any node includes: According to the simulation step length of any node, a discrete time domain signal of any node is obtained, wherein the simulation step length of any node is independent of the simulation step length of the finite state machine and both are smaller than the communication clock interval.
6. The method according to claim 1, characterized in that The discrete time domain signal includes a discrete time domain signal of vehicle acceleration; The step of performing a dynamic state transition according to the discrete time domain signal and maintaining each non-zero discrete value in the discrete time domain signal until a moment before the next non-zero discrete value arrives according to the dynamic situation of the state transition to obtain a continuous time domain signal includes: In response to the current acceleration in the discrete time domain signal being greater than 0, the state is transferred to the acceleration state; in response to the current acceleration in the discrete time domain signal being less than 0, the state is transferred to the deceleration state; in response to the current acceleration in the discrete time domain signal being 0, the state is transferred to the holding state; In response to the acceleration state or the deceleration state, a non-zero acceleration in the discrete time domain signal closest to the current moment is used as the current output of the finite state machine; in response to the holding state after the transfer, the output of the finite state machine at the previous moment is used as the current output; The output of the finite state machine at each moment together constitutes a continuous time domain signal of vehicle acceleration.
7. The method according to claim 1, characterized in that Before the finite state machine of the input simulation platform, it also includes: Build finite state machine modules in the simulation platform; Defining the input signal of the finite state machine module as a discrete time domain signal; According to the characteristics of the discrete time domain signal, construct a finite number of states of the finite state machine module, including a data state and a hold state; According to the defined state, a state transition rule is constructed: in response to the value of the input signal being non-zero, the state is transferred to the state with data; in response to the value of the input signal being zero, the state is transferred to the state of holding; According to the state transfer rule, the output signal of the finite state machine module is constructed: in response to the data state after the transfer, the most recent non-zero value in the input signal is used as the current output of the finite state machine; in response to the hold state after the transfer, the output of the finite state machine in the previous state is used as the current output.
8. The method according to claim 1, characterized in that The real-time acquisition of a discrete time domain signal of any node includes: real-time acquisition of a discrete time domain signal of the vehicle speed of any vehicle in the green wave traffic scene, and inputting the signal into a finite state machine of the simulation platform; The finite state machine performs a dynamic state transition according to the discrete time domain signal, and maintains each non-zero discrete value in the discrete time domain signal until the moment before the next non-zero discrete value arrives according to the dynamic situation of the state transition, so as to obtain a continuous time domain signal, including: when the vehicle speed discrete time domain signal is lost, the finite state machine transfers to the holding state according to the 0 vehicle speed signal at the moment of loss, and maintains the speed before the loss according to the holding state until the moment before the next vehicle speed arrives, so as to fill the lost vehicle speed signal and obtain a vehicle speed continuous time domain signal.
9. An electronic device, characterized in that: include: one or more processors; a memory for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the distributed joint simulation clock synchronization method based on a finite state machine as described in any one of claims 1-8.
10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the program is executed by a processor, the distributed joint simulation clock synchronization method based on a finite state machine as described in any one of claims 1-8 is implemented.