CN115562892B - Redis-based simulation system time management method, system, device and equipment - Google Patents

Redis-based simulation system time management method, system, device and equipment Download PDF

Info

Publication number
CN115562892B
CN115562892B CN202211536730.4A CN202211536730A CN115562892B CN 115562892 B CN115562892 B CN 115562892B CN 202211536730 A CN202211536730 A CN 202211536730A CN 115562892 B CN115562892 B CN 115562892B
Authority
CN
China
Prior art keywords
interaction
redis
signal
information
simulation system
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202211536730.4A
Other languages
Chinese (zh)
Other versions
CN115562892A (en
Inventor
任雪峰
王亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Zhuoyi Intelligent Technology Co Ltd
Original Assignee
Beijing Zhuoyi Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Zhuoyi Intelligent Technology Co Ltd filed Critical Beijing Zhuoyi Intelligent Technology Co Ltd
Priority to CN202211536730.4A priority Critical patent/CN115562892B/en
Publication of CN115562892A publication Critical patent/CN115562892A/en
Application granted granted Critical
Publication of CN115562892B publication Critical patent/CN115562892B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/542Event management; Broadcasting; Multicasting; Notifications
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45504Abstract machines for programme code execution, e.g. Java virtual machine [JVM], interpreters, emulators
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/544Remote
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/547Messaging middleware
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/548Queue

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Debugging And Monitoring (AREA)

Abstract

A simulation system time management method based on Redis comprises the following steps: the master control system sends a plurality of interaction triggering signals to I/O multiplexing of Redis; redis sends a confirmation trigger signal to the master control system by connecting a response processor and a command request processor after confirming one or more of the interaction trigger signals; after receiving the confirmation trigger signal, the master control system sends interaction information and a first step message (step) signal to I/O multiplexing of Redis; redis sends a plurality of second step message (step) signals, a plurality of interaction request information and interaction information to a plurality of simulation system clients respectively through an event dispatcher and a command request processor based on the interaction information and a first step message (step) signal; and the simulation system client writes the interactive information into the simulation system client based on the second step message (step) signal and the interactive request information and sends a write state signal and an interactive completion signal to Redis. Corresponding systems, apparatuses, electronic devices and computer-readable storage media are also disclosed.

Description

Redis-based simulation system time management method, system, device and equipment
Technical Field
The present application relates to the field of time management for large-scale distributed analog simulation systems. Specifically, the application relates to a simulation system time management method and system based on Redis.
Background
The simulation time management service is used for describing a control mechanism of time advance of system members in the operation process of the system, coordinating data exchange and time advance states of all the system members, ensuring that the sequence of event generation observed by all the simulation members is the same, and coordinating related activities among the simulation members.
In the time management of the current typical simulation system, a time management mode based on an RTI/DDS is typical, and two time management modes, namely a polling mode and an asynchronous I/O mode, are generally supported. In polling mode, the federal member and the RTI share a single thread, and the RTI can only operate when the federal member invokes a marker function, in which mode the RTI may not have enough time to handle its internal work if it is so large that it does not invoke enough of the marker function. In asynchronous I/O mode, the RTI uses a separate internal thread that periodically wakes up the RTI to determine if RTI internal operations can be performed, so that in asynchronous I/O mode the flag function needs to be called only when the federation is ready to process the callback function.
The time management of the RTI/DDS class is feasible when supporting a simulation system of a general scale and a local area network, but the current simulation system is developed towards a large scale, a wide area network and a heterogeneous system, and the DDS/RTI class system is difficult to adapt to the development trend, which is mainly shown in the following steps:
(1) Wide area network support problem aspect: the RTI/DDS generally supports a high-bandwidth low-latency local area network very well, but the current novel simulation system generally needs to support a physically region-separated operation and a wide area network operation. Time management needs to be operated in an unstable bandwidth and low-speed network environment, but RTI/DDS does not have special support for the environment, so that the problem that simulation cannot be promoted is easily caused.
(2) In terms of data quality of service/QoS, the phenomena such as data packet loss and the like are generally considered to be very small probability events or even events which cannot occur in an RTI/DDS system, but in a modern large-scale simulation system, due to the fact that a plurality of subsystems also include a virtual-real combination part, data quality problems such as data packet loss and the like are very common, but the RTI/DDS system does not have the capability of processing the data quality problems.
(3) In the aspect of system heterogeneity, the RTI/DDS generally only supports development of c/c + + simulation applications under a pure windows system or a linux system, but in a novel simulation system, various systems are generally accessed, such as the linux system of an x86/64 system, applications under an arm system, and modules of a hardware operating system, and programming languages also relate to c/c + +, python, java, go, and the like.
Therefore, it is necessary to implement a novel simulation system time management method and system to solve the time management problem of the large-scale distributed analog simulation system.
Disclosure of Invention
The invention provides a simulation system time management method and a system based on Redis (Remote Dictionary service) in order to solve the defect that the prior simulation time management systems such as RTI/DDS (Remote digital service) in the prior art cannot adapt to the development trend of the ultra-large scale, isomerization and wide area network operation of the simulation system.
To achieve the above objects, a first embodiment of the present invention provides a method for managing simulation system time based on a Redis, wherein the Redis includes a plurality of sockets for I/O multiplexing, an event dispatcher connected to the I/O multiplexing, and a plurality of event handlers connected to the event dispatcher, wherein the plurality of event handlers includes a connection response handler, a command request handler, and a command reply handler, including:
s1, a master control system sends a plurality of interaction trigger signals to I/O multiplexing of Redis;
s2, after the Redis confirms one or more of the interaction triggering signals, the Redis sends confirmation triggering signals to the master control system through the connection response processor and the command request processor;
s3, after receiving the confirmation trigger signal, the master control system sends interaction information and a first step message (step) signal to I/O multiplexing of Redis;
s4, the Redis sends a plurality of second step message (step) signals, a plurality of interaction request information and interaction information to a plurality of simulation system clients respectively through the event dispatcher and the command request processor based on the interaction information and a first step message (step) signal;
and S5, the simulation system client writes the interactive information into the simulation system client based on the second step message (step) signal and the interactive request information and sends a writing state signal and an interactive completion signal to the Redis after the writing is completed.
Preferably, the method further includes, S6, after receiving the writing status signal and the interaction completion signal, the Redis forwards the writing status signal and the interaction completion signal to the master control system.
Preferably, the interaction trigger signal of S1 includes an interaction data ready trigger signal or a trigger signal for confirming that the sending of the interaction information is completed; the time of the simulation system client is controlled by a master control system, and the master control system is managed by an analog timer; the analog timer has an interface for time control.
Preferably, in the non-heterogeneous system, the plurality of interaction trigger signals, the plurality of second step message (step) signals, the plurality of interaction request information and the interaction information are received and transmitted by a Redis protocol interface or by a gPRC service protocol port; when the gPRC service protocol port receives and sends the data, the gPRC service protocol port communicates with a plurality of simulation system clients through a Protobuf protocol; correspondingly, after receiving the multiple interaction triggering signals, the Redis protocol interface sends the multiple interaction triggering signals to the multiple simulation system clients; the plurality of simulation system clients interacting with the Redis includes a polled time management service mode and an event-triggered time management service mode;
in the heterogeneous system, the plurality of interaction trigger signals, the plurality of second step message (step) signals, the plurality of interaction request information and the interaction information are received and sent by a Redis protocol interface and a gPRC service protocol port; when the gPRC service protocol port receives and sends data, the gPRC service protocol port communicates with a plurality of simulation system clients through a Protobuf protocol; correspondingly, after receiving the plurality of interaction trigger signals, the Redis protocol interface sends the plurality of interaction trigger signals to the plurality of simulation system clients; the plurality of simulation system clients interacting with the Redis includes a polled time management service mode and an event-triggered time management service mode.
Preferably, in S2, after the Redis confirms one or more of the interaction trigger signals, the sending a confirmation trigger signal to the master control system through the connection response processor and the command request processor includes:
the Redis confirms whether one or more of the interaction trigger signals correspond to interaction information of multi-frequency time;
if the interactive information corresponds to the multi-frequency time, sending a confirmation trigger signal to the master control system according to cycle management through the connection response processor of the Redis, a plurality of completion queues and a plurality of subscription channels in the command request processor; the subscription channel is used for the main control system to send out subscription information and receive subscribed information to be published;
if the interaction information of the multi-frequency time does not correspond, sending a confirmation trigger signal to the master control system through a completion queue and a subscription channel in the connection response processor and the command request processor of the Redis; the subscription channel is used for the main control system to send out subscription information and receive subscribed information to be published.
Preferably, the period management is configured to improve data service quality and perform frame loss processing, and includes:
for one or more pieces of interaction information corresponding to a single frequency time in the interaction trigger signals, if one or more pieces of the simulation system client ends cannot complete tasks in a first period, the master control system judges in the next period;
for the interaction information of one or more of the interaction trigger signals corresponding to the multiple frequency times, if one or more of the multiple simulation system clients cannot complete tasks in a first minimum period corresponding to the multiple frequencies, the master control system waits in a minimum common divisor period of the next multiple frequencies;
if a certain simulation system client fails to complete a task all the time, the condition that the whole system cannot step can occur; the system continues stepping by modifying the global variable; in this embodiment, the global variable is the number of all simulation system clients, and the influence on system simulation needs to be determined according to specific simulation services, and belongs to a process of subsequent processing, which is unrelated to the time management of the simulation system.
To achieve the above objects, a second aspect of the present invention provides a simulated system time management system based on a Redis, wherein the Redis includes a plurality of sockets for I/O multiplexing, an event dispatcher connected to the I/O multiplexing, and a plurality of event handlers connected to the event dispatcher, wherein the plurality of event handlers includes a connection response handler, a command request handler, and a command reply handler, including:
the interaction trigger signal sending module is used for sending a plurality of interaction trigger signals to I/O multiplexing of Redis;
the trigger signal confirmation module is used for sending a confirmation trigger signal after confirming one or more of the interaction trigger signals;
a first interaction and stepping message module for sending interaction information and a first stepping message (step) signal after receiving the confirmation trigger signal;
a second interaction and step message module for transmitting a plurality of second step message (step) signals, a plurality of interaction request information and interaction information, respectively, based on the interaction information and the first step message (step) signal;
and the time management module is used for writing the interactive information based on the second step message (step) signal and the interactive request information and sending a writing state signal and an interactive completion signal after the writing is completed.
As a preferred embodiment, the system further includes a forwarding module, configured to forward the write status signal and the interaction completion signal after receiving the write status signal and the interaction completion signal.
The third aspect of the present invention further provides a simulation system time management device based on Redis, including:
redis, including a plurality of sockets for I/O multiplexing, an event dispatcher connected with the I/O multiplexing, and a plurality of event handlers connected with the event dispatcher, wherein the plurality of event handlers includes a connection reply handler, a command request handler, and a command reply handler; after the Redis confirms one or more of the interaction trigger signals, the Redis sends confirmation trigger signals to the master control system through the connection response processor and the command request processor; sending a plurality of second step message (step) signals, a plurality of interaction request information, and interaction information to a plurality of simulation system clients, respectively, through the event dispatcher and the command request handler based on the interaction information and a first step message (step) signal; after receiving the writing state signal and the interaction completion signal, forwarding the writing state signal and the interaction completion signal to a master control system;
the main control system is used for sending a plurality of interaction triggering signals to I/O multiplexing of Redis; and sending the mutual information and a first step message (step) signal to the I/O multiplexing of Redis after receiving the confirmation trigger signal; and
and the simulation system is provided with a plurality of simulation system clients, writes the interactive information into the simulation system clients based on the second step message (step) signals and the interactive request information, and sends writing state signals and interactive completion signals to the Redis after the writing is completed.
In order to achieve the above object, an electronic device according to a fourth aspect of the present invention includes: a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method according to the embodiment of the first aspect of the present invention when executing the computer program.
To achieve the above object, a computer-readable storage medium is provided in an embodiment of a fifth aspect of the present invention, and the computer program is used to implement the method described in the embodiment of the first aspect of the present invention when executed by a processor.
The method, the management and control system, the electronic equipment and the computer readable storage medium can achieve the following effects:
the method and the system are based on a Redis distributed message queue and a data system, a brand-new simulation time management module is developed by using a memory database technology and a distributed message queue technology supported by the Redis system, multi-frame state data storage and a distributed message mechanism and an event mechanism provided by the Redis system support distributed, multi-granularity, wide area network, low data service quality and heterogeneous simulation system time management, and support multiple modes of stepping time propulsion, event-based time propulsion, speed regulation fast forward and the like, the problems of low data service quality, random delay and heterogeneous system data consistency are pertinently solved, and the time management requirements of a novel simulation system are effectively met, so that a simulation system time management module which runs more stably and has higher robustness can be obtained.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Drawings
FIG. 1 shows a flow chart of a simulation system time management method of the present application;
FIG. 2 illustrates a time management data flow schematic of the present application;
FIG. 3 illustrates a schematic diagram of a time manager of the present application;
FIG. 4 illustrates a heterogeneous system support principle flow diagram of the present application;
fig. 5 shows a schematic structural diagram of the electronic device of the present application.
Detailed Description
For the sake of brevity, only some numerical ranges are specifically disclosed herein. However, any lower limit may be combined with any upper limit to form ranges not explicitly recited; and any lower limit may be combined with any other lower limit to form a range not explicitly recited, and similarly any upper limit may be combined with any other upper limit to form a range not explicitly recited. Furthermore, each separately disclosed point or individual value may itself, as a lower or upper limit, be combined with any other point or individual value or with other lower or upper limits to form ranges not explicitly recited.
In the description herein, "above" and "below" include the present numbers unless otherwise specified.
Unless otherwise indicated, terms used in the present application have well-known meanings that are commonly understood by those skilled in the art. Unless otherwise indicated, the numerical values of the parameters mentioned in the present application can be measured by various measurement methods commonly used in the art (for example, the test can be performed according to the methods given in the examples of the present application).
A list of items to which the term "at least one of," "at least one of," or other similar term is connected may imply any combination of the listed items. For example, if items a and B are listed, the phrase "at least one of a and B" means a only; only B; or A and B. In another example, if items A, B and C are listed, the phrase "at least one of A, B and C" means only a; or only B; only C; a and B (excluding C); a and C (excluding B); b and C (excluding A); or A, B and all of C. Item A may comprise a single component or multiple components. Item B may comprise a single component or multiple components. Item C may comprise a single component or multiple components.
To further illustrate the technical means and effects of the present invention adopted to achieve the predetermined object, the following detailed description will be given to a specific implementation and effects of a distributed type unmanned aerial vehicle cluster control system according to the present invention with reference to the accompanying drawings and preferred embodiments.
Fig. 1 shows a flowchart of the unmanned aerial vehicle centralized management and control method based on the 5G network. It should be noted that the method for centralized control of an unmanned aerial vehicle based on a 5G network according to the embodiment of the present invention may be applied to the system for centralized control of an unmanned aerial vehicle based on a 5G network according to the embodiment of the present invention, and the system may be configured on an electronic device or may be configured in a server. Wherein the electronic device may be a PC or a mobile terminal. The embodiment of the present invention is not limited thereto.
As shown in fig. 1-2, a first embodiment of the present invention provides a method for managing emulated system time based on Redis, where the Redis includes a plurality of sockets for I/O multiplexing, an event dispatcher connected to the I/O multiplexing, and a plurality of event handlers connected to the event dispatcher, where the plurality of event handlers includes a connection response handler, a command request handler, and a command reply handler, including:
s1, a master control system sends a plurality of interaction trigger signals to I/O multiplexing of Redis;
s2, after the Redis confirms one or more of the interaction triggering signals, the Redis sends confirmation triggering signals to the master control system through the connection response processor and the command request processor;
s3, after receiving the confirmation trigger signal, the master control system sends interaction information and a first step message (step) signal to I/O multiplexing of Redis;
s4, the Redis sending a plurality of second step message (step) signals, a plurality of interaction request information, and interaction information to a plurality of simulation system clients, respectively, through the event dispatcher and the command request processor based on the interaction information and a first step message (step) signal;
and S5, the simulation system client writes the interactive information into the simulation system client based on the second step message (step) signal and the interactive request information and sends a writing state signal and an interactive completion signal to the Redis after the writing is completed.
As a preferred embodiment, the method further includes, S6, after receiving the write status signal and the interaction completion signal, the Redis forwards the write status signal and the interaction completion signal to the master control system.
As a preferred embodiment, the interaction trigger signal of S1 includes an interaction data ready trigger signal or an interaction information transmission completion confirmation trigger signal.
Referring to fig. 3, a schematic diagram of a time manager in this embodiment is shown, in which time of a client of a simulation system is controlled by a master control system, and the master control system manages through a simulation timer, in this embodiment, the simulation timer is implemented by using a non-blocking timer. The simulation system client is implemented as n simulation entities.
In a preferred embodiment, the analog timer has an interface for time control.
As a preferred embodiment, in the non-heterogeneous system, the plurality of interaction trigger signals, the plurality of second step message (step) signals, the plurality of interaction request information, and the interaction information are received and transmitted by a Redis protocol interface or by a gPRC service protocol port. And when the gPRC service protocol port receives and transmits the data, the gPRC service protocol port communicates with the plurality of simulation system clients through a Protobuf protocol. Correspondingly, after receiving the plurality of interaction trigger signals, the Redis protocol interface sends the plurality of interaction trigger signals to the plurality of simulation system clients.
The interaction between the multiple simulation system clients and the Redis comprises two modes, which are respectively:
the first one is a polling type time management service mode, a gPC service protocol port provides polling service, and a plurality of simulation system clients continuously and actively poll through the gPC service protocol port to judge whether the operation corresponding to a second step message (step) signal needs to be carried out or not;
the second one is an event-triggered time management service mode, the simulation system clients are passive, the simulation system clients provide event trigger interfaces, the gPRC service protocol port receives the first step message (step) signal, calls the event trigger interfaces and executes the operation after the event trigger, which is defined by the program in advance, and implements the operation after the event trigger based on the second step message (step) signal.
It should be known to those skilled in the art that the operations after event triggering include receiving only the published message corresponding to the publish subscription, capturing only the content in the published message, updating only the data change in the published message, or performing complex flow processing on the event after event triggering are within the scope of the present invention.
As a preferred embodiment, in the heterogeneous system, the plurality of interaction trigger signals, the plurality of second step message (step) signals, the plurality of interaction request information, and the interaction information are received and transmitted by a Redis protocol interface and a gPRC service protocol port. And when the gPRC service protocol port receives and transmits the data, the gPRC service protocol port communicates with the plurality of simulation system clients through a Protobuf protocol. Correspondingly, after receiving the plurality of interaction trigger signals, the Redis protocol interface sends the plurality of interaction trigger signals to the plurality of simulation system clients.
The interaction between the multiple simulation system clients and the Redis comprises two modes, which are respectively:
the first one is a polling type time management service mode, a gPC service protocol port provides polling service, and a plurality of simulation system clients continuously and actively poll through the gPC service protocol port to judge whether the operation corresponding to a second step message (step) signal needs to be carried out or not;
the second one is an event-triggered time management service mode, the multiple simulation system clients are in a passive mode, the multiple simulation system clients provide event trigger interfaces, after receiving a first step message (step) signal, the gPC service protocol port calls the event trigger interfaces and executes the operation after the event trigger, which is defined by a program in advance, and the operation after the event trigger is implemented based on the second step message (step) signal.
It should be known to those skilled in the art that the operations after event triggering include only receiving the published message corresponding to the publish subscription, only capturing the content in the published message, only updating the data change in the published message, or performing complex flow processing on the event after event triggering, which are all within the scope of the present invention.
Referring to fig. 4, the gRPC is used as a protocol port instead of the original HTTP protocol, which has no dependency on the program language, and the property of the attribute-free port makes it possible to define the service of the interaction trigger signal in one proto file at a time and use any supported language.
The gPRC (Google Remote Procedure Call), namely the Google Remote Procedure Call, is an open-source high-performance RPC framework which can be operated in any environment, can efficiently connect services in a data center and across the data center, supports pluggable load balancing, tracking, operation condition checking and identity verification, and is also suitable for last mile connection equipment of distributed computing, mobile application programs and browser back-end services. The gPRC provides Protobuf definition service, is designed based on an HTTP/2 transport layer standard protocol, and can be set to be in synchronous or asynchronous communication.
Heterogeneous system support. The heterogeneous service support of the system is mainly realized by a multilingual sdk client of redis and a standard Protobuf protocol based on gPC forwarding. Wherein sdk of redis can support java, C + +, python, PHP, lua, ruby, node. Js, C #, goLand. The forwarded Protobuf protocol can support more programming languages and operating systems such as C + +, C #, dart, GO, JAVA, kotlin, python and the like. Without much loss in performance.
As a preferred embodiment, in S2, after the Redis confirms one or more of the interaction trigger signals, the sending a confirmation trigger signal to the master control system through the connection response processor and the command request processor includes:
the Redis confirms whether one or more of the interaction trigger signals correspond to interaction information of multi-frequency time;
if the interactive information corresponds to the multi-frequency time, sending a confirmation trigger signal to the master control system according to cycle management through the connection response processor of the Redis, a plurality of completion queues and a plurality of subscription channels in the command request processor; the subscription channel is used for the main control system to send out subscription information and receive subscribed information to be published;
if the interaction information does not correspond to the multi-frequency time, sending a confirmation trigger signal to the master control system through one completion queue and one subscription channel in the connection response processor and the command request processor of the Redis; the subscription channel is used for the main control system to send out subscription information and receive subscribed information to be published.
As a preferred embodiment, the cycle management is configured to improve data service quality and perform frame loss processing, and includes:
for one or more pieces of interaction information corresponding to a single frequency time in the interaction trigger signals, if one or more pieces of the simulation system client ends cannot complete tasks in a first period, the master control system judges in the next period;
for the interaction information of one or more of the interaction trigger signals corresponding to a plurality of frequency times, if one or more of the plurality of simulation system clients can not complete all tasks in a first minimum period corresponding to a plurality of frequencies, the master control system waits in a minimum common divisor period of the next plurality of frequencies;
if a certain simulation system client fails to complete a task all the time, the condition that the whole system cannot step can occur; the system continues stepping by modifying the global variable; in this embodiment, the global variable is the number of all simulation system clients, and the influence on system simulation needs to be determined according to a specific simulation service, and belongs to a flow of subsequent processing, which is not related to the time management of the simulation system.
To achieve the above objects, a second aspect of the present invention provides a simulated system time management system based on a Redis, wherein the Redis includes a plurality of sockets for I/O multiplexing, an event dispatcher connected to the I/O multiplexing, and a plurality of event handlers connected to the event dispatcher, wherein the plurality of event handlers includes a connection response handler, a command request handler, and a command reply handler, including:
the interaction trigger signal sending module is used for sending a plurality of interaction trigger signals to I/O multiplexing of Redis;
the trigger signal confirmation module is used for sending a confirmation trigger signal after confirming one or more of the interaction trigger signals;
a first interaction and stepping message module, configured to send interaction information and a first step message (step) signal after receiving the confirmation trigger signal;
a second interaction and stepping message module for transmitting a plurality of second stepping message (step) signals, a plurality of interaction request information, and interaction information, respectively, based on the interaction information and the first stepping message (step) signal;
and the time management module is used for writing the interactive information based on the second step message (step) signal and the interactive request information and sending a writing state signal and an interactive completion signal after the writing is completed.
As a preferred embodiment, the system further includes a forwarding module, configured to forward the write status signal and the interaction completion signal after receiving the write status signal and the interaction completion signal.
The third aspect of the present invention further provides a simulation system time management device based on Redis, including:
redis, including a plurality of sockets for I/O multiplexing, an event dispatcher connected to the I/O multiplexing, and a plurality of event handlers connected to the event dispatcher, wherein the plurality of event handlers includes a connection reply handler, a command request handler, and a command reply handler; the Redis sends a confirmation trigger signal to the master control system through the connection response processor and the command request processor after confirming one or more of the interaction trigger signals; sending a plurality of second step message (step) signals, a plurality of interaction request information, and interaction information to a plurality of simulation system clients, respectively, through the event dispatcher and the command request handler based on the interaction information and a first step message (step) signal; after receiving the writing state signal and the interaction completion signal, forwarding the writing state signal and the interaction completion signal to a master control system;
the main control system is used for sending a plurality of interaction triggering signals to I/O multiplexing of Redis; and sending the mutual information and a first step message (step) signal to the I/O multiplexing of Redis after receiving the confirmation trigger signal; and
and the simulation system is provided with a plurality of simulation system clients, writes the interactive information into the simulation system clients based on the second step message (step) signals and the interactive request information, and sends writing state signals and interactive completion signals to the Redis after the writing is completed.
An apparatus according to an embodiment of the present invention, and referring to fig. 5 below, shows an electronic device (400 schematic structural diagram. The electronic device in the embodiment of the present invention may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), etc., and a fixed terminal such as a digital TV, a desktop computer, etc. the electronic device shown in fig. 5 is only an example and should not bring any limitation to the functions and the scope of use of the embodiment of the present invention.
As shown in fig. 4, electronic device 400 may include a processing device (e.g., central processing unit, graphics processor, etc.) 401 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM) 402 or a program loaded from a storage device 408 into a Random Access Memory (RAM) 403. In the RAM 403, various programs and data necessary for the operation of the electronic apparatus 400 are also stored. The processing device 401, the ROM402, and the RAM 403 are connected to each other by a bus 504. An input/output (I/O) interface 405 is also connected to bus 404.
Generally, the following devices may be connected to the I/O interface 405: input devices 406 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 407 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 408 including, for example, tape, hard disk, etc.; and a communication device 409. The communication means 409 may allow the electronic device 400 to communicate wirelessly or by wire with other devices to exchange data. While fig. 4 illustrates an electronic device 400 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, the processes described above with reference to the flowcharts may be implemented as a computer software program according to an embodiment of the present invention. For example, an embodiment of the invention includes a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication device 409, or from the storage device 408, or from the ROM 402. The computer program performs the above-described functions defined in the methods of embodiments of the invention when executed by the processing apparatus 401.
It should be noted that the computer readable medium of the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: receiving a video searching instruction; determining a first search video according to the video search instruction, wherein the first search video comprises one or more sub-videos; marking the first search video to obtain one or more sub-videos with the labels; and searching a target video according to the label of one or more sub-videos.
Alternatively, the computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: receiving a video searching instruction; determining a first search video according to the video search instruction, wherein the first search video comprises one or more sub-videos; marking the first search video to obtain one or more sub-videos with the labels; and searching a target video according to the label of one or more sub-videos.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including but not limited to an object oriented programming language such as Java, smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the 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 the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present invention may be implemented by software or hardware. Where the name of a unit does not in some cases constitute a limitation of the unit itself, for example, the first retrieving unit may also be described as a "unit for retrieving at least two internet protocol addresses".
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), system on a chip (SOCs), complex Programmable Logic Devices (CPLDs), and the like.
In the context of the present invention, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, 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 compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The foregoing description is only exemplary of the preferred embodiments of the invention and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents is encompassed without departing from the spirit of the disclosure. For example, the above features and (but not limited to) features having similar functions disclosed in the present invention are mutually replaced to form the technical solution.
Further, while operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the invention. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.
While certain exemplary embodiments of the present application have been illustrated and described, the present application is not limited to the disclosed embodiments. Rather, one of ordinary skill in the art will recognize that certain modifications and changes may be made to the described embodiments without departing from the spirit and scope of the present application as described in the appended claims.

Claims (10)

1. A method for managing time of a simulation system based on Redis, wherein the Redis includes a plurality of sockets for I/O multiplexing, an event dispatcher connected with the I/O multiplexing, and a plurality of event handlers connected with the event dispatcher, wherein the plurality of event handlers includes a connection reply handler, a command request handler, and a command reply handler, comprising:
s1, a master control system sends a plurality of interaction trigger signals to I/O multiplexing of Redis;
s2, after the Redis confirms one or more of the interaction triggering signals, the Redis sends confirmation triggering signals to the master control system through the connection response processor and the command request processor;
s3, after receiving the confirmation trigger signal, the master control system sends interaction information and a first further message signal to I/O multiplexing of Redis;
s4, the Redis sends a plurality of second step message signals, a plurality of interaction request information and interaction information to a plurality of simulation system clients respectively through the event dispatcher and the command request processor based on the interaction information and the first further message signal;
and S5, the simulation system client writes the interactive information into the simulation system client based on the second stepping message signal and the interactive request information and sends a writing state signal and an interactive completion signal to the Redis after the writing is completed.
2. The method according to claim 1, wherein the method further comprises, S6, after receiving the write status signal and the interaction completion signal, the Redis forwards the write status signal and the interaction completion signal to the master control system.
3. The method according to claim 1, wherein the interaction trigger signal in S1 comprises an interaction data ready trigger signal or a confirmation interaction information transmission completion trigger signal; the time of the simulation system client is controlled by a master control system, and the master control system is managed by an analog timer; the analog timer has an interface for time control.
4. The method of claim 3, wherein, in a non-heterogeneous system, the plurality of interworking trigger signals, the plurality of second step message signals, the plurality of interworking request messages, and the interworking information are received and transmitted by a Redis protocol interface or by a gPRC service protocol port; when the gPRC service protocol port receives and sends the data, the gPRC service protocol port communicates with a plurality of simulation system clients through a Protobuf protocol; correspondingly, after receiving the plurality of interaction trigger signals, the Redis protocol interface sends the plurality of interaction trigger signals to the plurality of simulation system clients; the plurality of simulation system clients interacting with the Redis includes a polled time management service mode and an event-triggered time management service mode;
in the heterogeneous system, the interaction trigger signals, the second step message signals, the interaction request messages and the interaction messages are received and sent by a Redis protocol interface and a gPRC service protocol port; when the gPRC service protocol port receives and sends the data, the gPRC service protocol port communicates with a plurality of simulation system clients through a Protobuf protocol; correspondingly, after receiving the plurality of interaction trigger signals, the Redis protocol interface sends the plurality of interaction trigger signals to the plurality of simulation system clients; the plurality of simulation system clients interacting with the Redis includes a polled time management service mode and an event-triggered time management service mode.
5. The method of claim 4, wherein, at S2, the Redis sending an acknowledgement trigger signal to the master control system through the connection reply processor and the command request processor after the Redis acknowledging one or more of the plurality of interaction trigger signals comprises:
the Redis confirms whether one or more of the interaction trigger signals correspond to interaction information of multi-frequency time;
if the interactive information corresponds to the multi-frequency time, sending a confirmation trigger signal to the master control system according to cycle management through the connection response processor of the Redis, a plurality of completion queues and a plurality of subscription channels in the command request processor; the subscription channel is used for the main control system to send out subscription information and receive subscribed information to be published;
if the interaction information of the multi-frequency time does not correspond, sending a confirmation trigger signal to the master control system through a completion queue and a subscription channel in the connection response processor and the command request processor of the Redis; the subscription channel is used for the main control system to send out subscription information and receive subscribed information to be published.
6. The method of claim 5, wherein the period management is used for improving data service quality and performing frame loss processing, and comprises:
for one or more pieces of interaction information corresponding to a single frequency time in the interaction trigger signals, if one or more pieces of the simulation system client ends cannot complete tasks in a first period, the master control system judges in the next period;
for the interaction information of one or more of the interaction trigger signals corresponding to the multiple frequency times, if one or more of the multiple simulation system clients cannot complete tasks in a first minimum period corresponding to the multiple frequencies, the master control system waits in a minimum common divisor period of the next multiple frequencies;
if a certain simulation system client fails to complete a task all the time, the condition that the whole system cannot step can occur; the system continues stepping by modifying the global variable; in this embodiment, the global variable is the number of all simulation system clients, and the influence on system simulation needs to be determined according to specific simulation services, and belongs to a process of subsequent processing, which is unrelated to the time management of the simulation system.
7. A Redis-based emulated system time management system for implementing the method of any of claims 1-6, wherein the Redis comprises a plurality of sockets for I/O multiplexing, an event dispatcher connected to the I/O multiplexing, and a plurality of event handlers connected to the event dispatcher, wherein the plurality of event handlers comprises a connection reply handler, a command request handler, and a command reply handler, comprising:
the interactive trigger signal sending module is used for sending a plurality of interactive trigger signals to I/O multiplexing of Redis;
the trigger signal confirmation module is used for sending a confirmation trigger signal after confirming one or more of the interaction trigger signals;
the first interaction and stepping message module is used for sending interaction information and a first stepping message signal after receiving the confirmation trigger signal;
a second interaction and stepping message module for respectively sending a plurality of second stepping message signals, a plurality of interaction request information and interaction information based on the interaction information and the first stepping message signal;
the time management module is used for writing the interactive information based on the second stepping message signal and the interactive request information and sending a writing state signal and an interactive completion signal after the writing is completed;
and the forwarding module is used for forwarding the writing state signal and the interaction completion signal after receiving the writing state signal and the interaction completion signal.
8. A simulation system time management apparatus based on Redis, comprising:
redis, including a plurality of sockets for I/O multiplexing, an event dispatcher connected with the I/O multiplexing, and a plurality of event handlers connected with the event dispatcher, wherein the plurality of event handlers includes a connection reply handler, a command request handler, and a command reply handler; after confirming one or more of the interaction trigger signals, the Redis sends confirmation trigger signals to the master control system through the connection response processor and the command request processor; sending a plurality of second step message signals, a plurality of interaction request information and interaction information to a plurality of simulation system clients respectively through the event dispatcher and the command request processor based on the interaction information and the first step message signal; after receiving the writing state signal and the interaction completion signal, forwarding the writing state signal and the interaction completion signal to a master control system;
the main control system is used for sending a plurality of interaction triggering signals to I/O multiplexing of Redis; after receiving the confirmation trigger signal, sending interaction information and a first further message signal to I/O multiplexing of Redis; and
and the simulation system is provided with a plurality of simulation system clients, writes the interactive information into the simulation system clients on the basis of the second stepping message signals and the interactive request information, and sends writing state signals and interactive completion signals to the Redis after the writing is completed.
9. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-6.
10. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-6.
CN202211536730.4A 2022-12-02 2022-12-02 Redis-based simulation system time management method, system, device and equipment Active CN115562892B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211536730.4A CN115562892B (en) 2022-12-02 2022-12-02 Redis-based simulation system time management method, system, device and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211536730.4A CN115562892B (en) 2022-12-02 2022-12-02 Redis-based simulation system time management method, system, device and equipment

Publications (2)

Publication Number Publication Date
CN115562892A CN115562892A (en) 2023-01-03
CN115562892B true CN115562892B (en) 2023-03-24

Family

ID=84770215

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211536730.4A Active CN115562892B (en) 2022-12-02 2022-12-02 Redis-based simulation system time management method, system, device and equipment

Country Status (1)

Country Link
CN (1) CN115562892B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110457747A (en) * 2019-07-02 2019-11-15 浙江工业大学 A kind of network control system synergy emulation method based on NS3 and MATLAB
CN111897300A (en) * 2020-07-31 2020-11-06 上海交通大学 OPC-UA (OLE for process control-user agent) -based software/hardware combined simulation system and self-adaptive cooperation method thereof

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130166447A1 (en) * 2011-12-21 2013-06-27 Verizon Patent And Licensing Inc. Gateway applications for transaction services

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110457747A (en) * 2019-07-02 2019-11-15 浙江工业大学 A kind of network control system synergy emulation method based on NS3 and MATLAB
CN111897300A (en) * 2020-07-31 2020-11-06 上海交通大学 OPC-UA (OLE for process control-user agent) -based software/hardware combined simulation system and self-adaptive cooperation method thereof

Also Published As

Publication number Publication date
CN115562892A (en) 2023-01-03

Similar Documents

Publication Publication Date Title
CN110781373B (en) List updating method and device, readable medium and electronic equipment
US20210194774A1 (en) System and method for a generic key performance indicator platform
CN113553178A (en) Task processing method and device and electronic equipment
CN110619100A (en) Method and apparatus for acquiring data
CN113760991A (en) Data operation method and device, electronic equipment and computer readable medium
CN112015816A (en) Data synchronization method, device, medium and electronic equipment
CN113419841B (en) Message scheduling method and device, electronic equipment and computer readable medium
CN115357350A (en) Task configuration method and device, electronic equipment and computer readable medium
CN111309304A (en) Method, device, medium and electronic equipment for generating IDL file
CN110764983A (en) Test method, device, medium and electronic equipment
CN110489219B (en) Method, device, medium and electronic equipment for scheduling functional objects
CN115562892B (en) Redis-based simulation system time management method, system, device and equipment
CN112152879A (en) Network quality determination method and device, electronic equipment and readable storage medium
CN115022328A (en) Server cluster, server cluster testing method and device and electronic equipment
CN114979241A (en) Communication method, communication apparatus, storage medium, and electronic device
CN115134254A (en) Network simulation method, device, equipment and storage medium
CN112328184A (en) Cluster capacity expansion method, device, equipment and storage medium
CN111314457B (en) Method and device for setting virtual private cloud
CN113761548B (en) Data transmission method and device for Shuffle process
CN116319322B (en) Power equipment node communication connection method, device, equipment and computer medium
CN111736976B (en) Task processing method, device, computing equipment and medium
CN112311833B (en) Data updating method and device
CN112583614B (en) Host cluster management method, device and computer readable medium
CN113467883A (en) Container management method and device in application development and computer-readable storage medium
CN114020310A (en) Task processing method, device, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant