Multi-system joint collaborative operation method and device
By designing event queues and time synchronization mechanisms in a multi-system joint operation system, the challenge of co-operation between event-driven systems and time-driven systems is solved, the certainty and flexibility of system time is achieved, and the efficiency and accuracy of message transmission are improved.
Patent Information
- Application Number
- CN202411984002.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-05-30
AI Technical Summary
In a multi-system joint operation system, there are challenges in co-operation between event-driven systems and time-driven systems, especially the issue of how to advance the run time after event processing is completed, and how to maintain system activity when there is no need to handle.
A multi-system joint collaborative operation method is designed to realize the transmission of information between the event driver system and the time-driven system by generating an event queue of messages and generating and synchronizing the system time according to the transmission requirements of the reply message. The specific steps include generating an event queue, generating and synchronizing the system time according to the transmission requirements of the reply message, and transmitting information through the event scheduling module.
The balance of certainty and flexibility between the event-driven system and the time-driven system is achieved, ensuring time consistency and efficiency of message transmission across systems, and improving the confidence and correctness of message reception.
Smart Images

Figure CN120066814A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of information interaction technologies, and particularly relates to a multi-system joint collaborative operation method and apparatus. Background Art
[0002] In a multi-system joint operation system based on the "system-in-the-loop" operation mechanism, different subsystems may adopt different operation mechanisms. For example, communication operations use discrete events as the operation driving source, while actual equipment uses time as the operation reference. To achieve the joint operation of multiple heterogeneous systems, it is necessary to solve the collaborative operation problem of the two basic communication systems of "event-driven" and "time-driven".
[0003] In the event-driven operation mode, when an event is processed, the operation kernel directly advances the operation time to the time point when the next event occurs. In the time-driven operation mode, the time between two events elapses freely.
[0004] In the event-driven mode, if there is no clear execution event in the system, the entire operation cannot advance or is stopped. In the time-driven mode, even if there is no processing requirement, the entire system remains active and waits for system inputs that may occur at any time.
[0005] The time-triggered mechanism sacrifices the flexibility of the system. When transmitting large-scale messages, the static and centralized control method makes it difficult for the system to adapt to and respond to subsequent events. Summary of the Invention
[0006] The objective of the present invention: To solve the interaction problem between event-driven systems and time-driven systems, achieve a balance between determinism and flexibility of time-driven systems and event-driven systems, construct an event scheduling module capable of interacting with time-driven systems, and attach a time tag to each event in the event-driven system so that events can be corresponding to time.
[0007] In a first aspect, this application provides a multi-system joint collaborative operation method, and the method includes:
[0008] Step 1, generating an event queue of messages; wherein, the messages include response messages;
[0009] Step 2, according to the transmission requirements of the response messages, using the round-trip correction time of different systems as the reference time, and generating the system time during system operation using the difference between the current time and the reference time;
[0010] Step 3: According to the system time, messages entering the event queue are transmitted using internal running event execution and external processing event execution threads, and are put into sleep and started according to the event running status, completing the information transmission between the event-driven system and the time-driven system of multiple systems.
[0011] Preferably, step 1 includes:
[0012] Sort the messages generated by different drive systems according to the transmission category, priority, transmission requirements, and message length;
[0013] The sorted messages form an event queue according to the classification control.
[0014] Preferably, step 2 includes:
[0015] According to the transmission requirements of the response message, fix the response time slot and the transmission time slot as T; where the time when system 1 sends the response message reaches is T1, the time when system 2 receives the response message reaches is T2, and the time difference between the systems is △t;
[0016] If the time of system 1 is used as the reference time, the synchronized time of system 2 is T1 + △t; if the time of system 2 is used as the reference time, the synchronized event of system 1 is T2 - △t.
[0017] Preferably, step 3 includes:
[0018] After the multi-system time synchronization, convert the externally accessed information into a running event, place the running event at the head of the event queue, and set the event time tag as the difference between the current time and the reference point time;
[0019] If the current running event execution thread is in the sleep state, activate it to process the newly inserted external event; otherwise, wait for the running event processing thread to complete the ongoing event processing and then immediately process the newly inserted external event.
[0020] In a second aspect, the present application also provides a multi-system joint collaborative operation device, and the device includes:
[0021] An event queue module, used to generate an event queue of messages; where the messages include response messages;
[0022] A time synchronization module, used to generate the system time during system operation by using the difference between the current time and the reference time, with the round-trip correction time of different systems as the reference time according to the transmission requirements of the response message;
[0023] An event scheduling module, which is used to transmit the messages entering the event queue by using internal running event execution and external processing event execution threads according to the system time, and to perform sleeping and starting according to the event running state, so as to complete the information transmission between the event-driven system and the time-driven system of multiple systems.
[0024] Preferably, the event queue module is also used to perform permission sorting on the messages generated by different drive systems according to the transmission category, priority, transmission requirements, and message length;
[0025] The event queue module is also used to form an event queue for the sorted messages according to the classification control.
[0026] Preferably, the time synchronization module is also used to fix the response time slot and the transmission time slot as T according to the transmission requirements of the response message; where, the time when the response message sent by System 1 arrives is T1, the time when System 2 receives the response message arrives is T2, and the time difference between the systems is △t;
[0027] The time synchronization module is also used to if the time of System 1 is used as the reference time, the synchronized time of System 2 is T1 + △t;
[0028] The time synchronization module is also used to if the time of System 2 is used as the reference time, the synchronized event of System 1 is T2 - △t.
[0029] Preferably, after the multi-system time synchronization, the event scheduling module is also used to convert the externally accessed information into a running event, and place the running event at the head of the event queue, and set the event time tag as the difference between the current time and the reference point time;
[0030] The event scheduling module is also used to if the current running event execution thread is in a sleeping state, activate it and process the newly inserted external event; otherwise, wait for the running event processing thread to complete the ongoing event processing, and then immediately process the newly inserted external event.
[0031] The beneficial technical effects of the present invention:
[0032] 1) The design of the event queue classification controller, through different transmission requirements, priorities, transmission types, etc., performs message function classification and queue sorting, realizes the timely sending of high-priority events, ensures the transmission efficiency of the messages to be transmitted, and realizes the fast sending and transmission of messages through the content-based permission queue design;
[0033] 2) Consider internal and external transmission requirements during the event queue transmission process. Implement the scheduling mechanism for internally generated messages (base cycle, event class messages) and the matching sending mechanism for external messages (reply messages) that require timely responses to ensure cross-system time consistency and improve the confidence and correctness of cross-system message reception.
[0034] 3) In terms of reference time, adopt an interrogation and response cycle mode. Through cross-platform clock synchronization, obtain the time matching function for thread operation in event scheduling, and achieve the collaborative operation ability of cross-system operation mechanism time synchronization and the efficiency of event reception. Brief Description of the Drawings
[0035] Figure 1 It is a schematic diagram of an operating mechanism based on system-in-the-loop provided by an embodiment of the present application;
[0036] Figure 2 It is a schematic diagram of the execution of events and time queues provided by an embodiment of the present application;
[0037] Figure 3 It is a schematic diagram of reply message time synchronization provided by an embodiment of the present application;
[0038] Figure 4 It is a flowchart of event real-time scheduling provided by an embodiment of the present application. Detailed Embodiment
[0039] It should be noted that in order to solve the problem of different systems adopting different operating mechanisms, the present invention aims to provide a multi-system joint collaborative operation method based on system-in-the-loop. During operation, different systems use the round-trip correction time as the reference time, and use the difference between the current time and the reference time as the system time during operation, so that the event-driven system can perform unified time management with the time-driven system. Through an event scheduler that can interact with the time-driven system, the interaction problem between event-driven messages and time-driven messages is solved.
[0040] Please refer to Figure 1 - Figure 4 , a multi-system joint collaborative operation device based on system-in-the-loop provided by the present invention, includes an event queue module and an event scheduling module. The principle of this method is as Figure 1 shown. The present invention comprehensively considers event-driven messages (event messages, relay messages, reply messages) and cycle-driven messages, and uses an event scheduler to solve the interaction problem between event-driven messages and time-driven messages.
[0041] Under the event-driven mechanism, the running kernel places events in an event queue in the order of their execution. During execution, the running kernel continuously retrieves events from the head of the queue and calls the event processing interface of the running model to process the running events until the event queue is empty or a preset running time limit is reached. In the event-driven running mode, the running does not need to care about the passage of time in the real world, but only focuses on the execution of running events. The time when a running event occurs is the current running time. In the running mode based on an event sequence, it is generally difficult to correspond to the wall clock time. Either it runs in super-real time (the running time is ahead of the wall clock time) or in under-real time (the running time lags behind the wall clock time). The principle of event execution and time control is as Figure 2 shown. How to obtain a reference event, and the principle of time synchronization is obtained by using response event execution and time control as Figure 3 shown. For a response event, judge the type of the response message and insert the response message into the next cycle queue of this message for transmission.
[0042] Therefore, the present invention adopts content-based event queue distribution control to classify and control cycle information, event information, and response information, uses the time synchronization of response information as a reference clock to customize a real-time event scheduler, so that it can perform real-time operation while achieving time synchronization for heterogeneous platforms, and can meet the interaction requirements of a time-driven system while supporting the event-driven mechanism.
[0043] In an embodiment of the present application, a multi-system joint collaborative running method based on in-the-loop system is provided. The main implementation process:
[0044] Event queue module: To sort the input messages according to a content-based queue, set up queues for messages according to message functions. Messages with the same message function are sorted in the queue according to the transmission type, priority, and transmission requirements. For response messages, when receiving such messages, they are sent in the next cycle of the message function queue; for event messages with a high priority, when receiving such messages, compare the priority with the messages required to be sent in the next cycle. If it is higher, insert it into the cycle queue. If the priority is lower than it, compare the priority with the messages in its next cycle, and cycle through the comparison to find a lower priority for sorting; for messages with a low priority and periodic transmission information, directly enter the message queue for sorting and waiting for transmission.
[0045] Event scheduling module: Use the clock synchronized by the response message as the reference time to transmit the messages entering the event queue. The transmission status is divided into internal running event execution and external processing event execution. Sleep and start according to the event running status to achieve cross-system drive event transmission.
[0046] The present invention uses a multi-system joint collaborative operation method based on system-in-the-loop in message transmission. An event queue module is established by a content-based permission queue design to complete the establishment of message queues of different transmission types and priorities, and cross-system time synchronization is achieved according to the cross-system reference time to solve the problem of the collaborative operation of the reference time of the two basic communication systems of "event-driven" and "time-driven".
[0047] In other embodiments of the present application, a multi-system joint collaborative operation method based on system-in-the-loop provided by the present application includes the following steps:
[0048] Step 1: Generation of an event queue
[0049] The generation of the event queue is based on a content-based permission queue design. Messages are functionally classified according to the transmission content and divided into several message function queues Seq ij , where i is the i-th message function and j is the j-th sequence in the i-th message function. As Figure 2 shown, when different message functions in the transmission message are reached, the transmission sequences are respectively marked as Message[k], indicating that the k-th message sequence is reached. The messages are sorted by permission according to information such as the transmission category, priority, transmission requirements, and message length of the transmission message. The sorted messages form an event transmission queue according to the classification control.
[0050] Among them, the specific steps of message classification control permission are as follows:
[0051] The control permission W = f(a, b, c, d) consists of four factors. a represents the transmission category (such as instruction event, periodic event, response event), and the transmission permission is set as w1. b represents the event priority (the priority consists of 1-6 with an interval of 1) and is set as w2. c represents the transmission requirements (bandwidth, delay, response) and is set as w3. d represents the transmission length (set as 1 within N, set as 2 between N-2N, and has the highest permission if it exceeds 4N and the priority is 6) and is set as w4. W = w1 + w2 + w3 + w4, and the least squares algorithm is used for processing.
[0052] Each Message has a W, and it is sorted into a queue according to the size of W. It is divided into a waiting queue and a sending queue. The sending queue compares the permission of the event information in the waiting queue. For the event that enters the sending queue from the waiting queue, the following processing is performed: The permission of transmission message 1 is W1, the permission of transmission message 2 is W2, the permission of transmission message 3 is W3, the permission of transmission message 4 is W4, and each message queue is set to store the sequence Seq 1,j [W]. When Seq 1,j+1 [W1] arrives, when Seq 1,j+1 [W1] > Seq 1,j [W], Seq1,j+1 [W1] Inserted into the current queue, Seq 1,j+1 [W1] Set to Seq 1,j [W1], Seq 1,j [W] Set as Seq 1,j+1 [W]; When Seq 1,j+1 [W1] < Seq 1,j [W] Put it into the next cycle for transmission.
[0053] Step 2: Reference time generation
[0054] Reference event generation is the core function of the event scheduling and queue module, the basis for the correct sending and receiving of event-driven and time-driven running threads, and the basic method for heterogeneous system time synchronization.
[0055] The fixed message sending time slot is T, that is, the response time slot and the sending time slot are T. The arrival time of the synchronization message sent by System 1 is T1, and the arrival time of the response message received by System 2 is T2. The time difference between the systems is △t = (T1 - T2 + T) / 2. Taking the time of System 1 as the reference event, the synchronization event of System 2 is T1 + △t, indicating the synchronization of the sending and receiving message time slots.
[0056] Step 3: Event scheduling thread operation
[0057] Internal event operation scheduling thread: A running thread based on the event-driven mechanism. After executing an event, the event scheduling thread does not advance the running time to the next event occurrence time, but the event scheduling thread goes to sleep and is awakened when the next event occurs, thus achieving matching with the reference time.
[0058] External event operation scheduling thread: Used to handle interactions with external systems (including time-driven systems and other event-driven systems). When this thread receives a message from an external system, it converts the message into a running event and places the event at the head of the running event queue. The event time tag is set to the difference between the current time and the reference point time. If the current running event execution thread is in a sleep state, it is activated to process the newly inserted external event; otherwise, it waits for the running event processing thread to complete the ongoing event processing and then immediately processes the newly inserted external event. If the event-driven system needs to send a message to a time-driven system or other event-driven systems, it directly calls the message sending interface of the external event processing system to achieve it.
[0059] Specifically as follows:
[0060] Step 1): Determine whether the event message has been executed. After completion, read the head of the queue. If there are untransmitted messages, enter the event transmission channel and proceed to Step 2). If all messages have been transmitted, jump to Step 3).
[0061] Step 2): For the information entering the event transmission channel, obtain the time when it reaches event T1 and compare it with the reference event T. If it is found that T1 > T, wait for a time of ΔT = T1 - T for the event thread, and set the event scheduling and running thread to the next event arrival event, and select the event execution module for transmission.
[0062] Step 3): After all event messages have been executed, the event running thread enters the sleep state. When sleeping, the thread event is calculated according to the specified reference time to ensure that the thread processing time is consistent with the reference time. When the event queue needs to transmit information again, trigger the thread wake-up mechanism and jump to Step 1).
Claims
1. A multi-system joint collaborative operation method, characterized in that: The method comprises: Step 1: Generate an event queue of messages; wherein the messages include reply messages; Step 2: according to the transmission requirements of the response message, the round trip correction time of different systems is used as the reference time, and the difference between the current time and the reference time is used to generate the system time during the system operation; Step 3: According to the system time, the message entering the event queue is transmitted using the internal running event execution and external processing event execution threads, and sleeps and starts according to the event running status to complete the information transmission between the event-driven system and the time-driven system of the multi-system.
2. The method according to claim 1, characterized in that The step 1 comprises: Sort the permissions of messages generated by different drive systems according to transmission category, priority, transmission requirements, and message length; The sorted messages form an event queue according to the classification control.
3. The method according to claim 1, characterized in that The step 2 comprises: According to the transmission requirements of the response message, the response time slot and the sending time slot are fixed to T; wherein, the time when the response message is sent by system 1 is T1, the time when the response message is received by system 2 is T2, and the time difference between the systems is △t; If the system 1 time is used as the base time, the system 2 synchronization time is T1+△t; if the system 2 time is used as the base time, the system 1 synchronization event is T2-△t.
4. The method according to claim 1, characterized in that The step 3 comprises: After the multi-system time is synchronized, the external access information is converted into a running event, and the running event is placed at the head of the event queue, and the event time label is set to the difference between the current time and the reference point time; If the current running event execution thread is in a dormant state, it will be activated to process the newly inserted external event; otherwise, after waiting for the running event processing thread to complete the ongoing event processing, the newly inserted external event will be processed immediately.
5. A multi-system joint cooperative operation device, characterized in that: The device comprises: An event queue module, used for generating an event queue of messages; wherein the messages include reply messages; A time synchronization module, used to use the round-trip correction time of different systems as reference time according to the transmission requirements of the response message, and use the difference between the current time and the reference time to generate the system time during system operation; The event scheduling module is used to transmit the messages entering the event queue according to the system time using the internal running event execution and external processing event execution threads, sleep and start according to the event running status, and complete the information transmission between the event-driven system and the time-driven system of multiple systems.
6. The device according to claim 5, characterized in that The event queue module is also used to sort the permissions of messages generated by different drive systems according to transmission category, priority, transmission requirements, and message length; The event queue module is also used to control the sorted messages to form an event queue according to classification.
7. The device according to claim 5, characterized in that The time synchronization module is also used to fix the response time slot and the sending time slot as T according to the transmission requirements of the response message; wherein the time when the system 1 sends the response message is T1, the time when the system 2 receives the response message is T2, and the time difference between the systems is △t; The time synchronization module is also used for taking the time of system 1 as the reference time, and the synchronization time of system 2 is T1+△t; The time synchronization module is also used for taking the time of system 2 as the reference time, and the synchronization event of system 1 is T2-Δt.
8. The device according to claim 5, characterized in that The event scheduling module is also used to convert external access information into a running event after multi-system time synchronization, and the running event is placed at the head of the event queue, and the event time label is set to the difference between the current time and the reference point time; The event scheduling module is also used to activate the current running event execution thread if it is in a dormant state to process the newly inserted external event; otherwise, wait for the running event processing thread to complete the ongoing event processing and then immediately process the newly inserted external event.