A universal simulation method, system, device and medium for train operation scenarios

By adopting Redis lightweight message publishing and subscription mechanism and memory database in the train simulation system, the problems of large systems, low data storage efficiency and high development complexity in the existing technology are solved, and efficient and stable train operation scenario simulation is achieved.

CN116118826BActive Publication Date: 2025-03-25CASCO SIGNAL (JINAN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211690770.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-27
Publication Date
2025-03-25
Estimated Expiration
2042-12-27

AI Technical Summary

Technical Problem

The existing train simulation system has problems such as huge system, low data storage efficiency, and high development and debugging complexity under complex scenario simulation and high real-time requirements.

Method used

Redis lightweight message publishing and subscription mechanism and in-memory database are adopted, combining two into one, realizing database storage access and message communication functions. Through the simulation data driver module, data subscription module and scenario process driver module, real-time synchronization and rapid construction of train operation scenarios are achieved.

Benefits of technology

The system structure is simplified, data consistency and high-speed access are ensured, network communication efficiency is optimized, application decoupling is realized, system complexity is reduced, and simulation system deployment simplicity and operation stability are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116118826B_ABST
    Figure CN116118826B_ABST
Patent Text Reader

Abstract

The present invention relates to a general simulation method, system, device and medium for train operation scenarios. The method combines database storage access and message communication functions into one by using the Redis lightweight message publishing and subscription mechanism and the high performance of the memory database. While simulating the train operation status, the execution of each simulation scenario is synchronized in real time to achieve the rapid construction of the train operation simulation system. Compared with the prior art, the present invention simplifies the system structure, ensures the consistency and high-speed access of data, optimizes the network communication efficiency, achieves the decoupling between applications (systems), and also avoids the system complexity caused by the isolation of the network and the inconsistency of the development language, and improves the simplicity of simulation system deployment and the stability of operation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a train signal control system, and in particular to a general simulation method, system, equipment and medium for a train operation scenario. Background Art

[0002] In the context of the development of modern rail transit construction, the operation of trains is becoming more and more automated and intelligent, and more and more systems are involved. With the increasing size and complexity of the operation system, the handling of each fault and each scenario involves the linkage of multiple disciplines. The entire simulation system needs to deploy a complex network environment and frequent message interactions to complete. With the existing technology, a remote communication module will be developed or a message queue product will be used, and then deployed at the same time as the database. Such a software structure makes the system more and more bloated. When encountering subsystems with different development languages ​​or network access restrictions, it will become very difficult to deploy and run the entire simulation environment, and it will be difficult to troubleshoot the fault point when encountering problems. In addition, the scenario design of the simulation system needs to be able to be adjusted quickly, and the changes in software design caused by this often lead to a lot of development and testing pressure. Traditional SQL databases have weaknesses in data structure objectification, and are unable to store multiple states of complex equipment. In addition, the data of train simulation contains a large number of Boolean values, and the traditional database storage data space requirements are very large, and the cost of setting up the laboratory has also risen accordingly. In addition, the typical characteristics of the train simulation system are very fast data reading speed and high real-time requirements, which traditional SQL databases cannot meet.

[0003] Therefore, how to realize complex scene simulation to meet the increasing simulation needs of rail transit systems while ensuring that the system is not too large has become a technical problem that needs to be solved. Summary of the invention

[0004] The purpose of the present invention is to overcome the defects of the above-mentioned prior art and provide a general simulation method, system, equipment and medium for train operation scenarios.

[0005] The purpose of the present invention can be achieved by the following technical solutions:

[0006] According to the first aspect of the present invention, a general simulation method for train operation scenarios is provided. The method combines database storage access and message communication functions into one by means of the Redis lightweight message publishing and subscription mechanism and the high performance of the in-memory database. While simulating the train operation status, the execution of each simulation scenario is synchronized in real time, thereby realizing the rapid construction of a train operation simulation system.

[0007] As a preferred technical solution, the method specifically comprises the following steps:

[0008] Step 1: After the simulation software is started, three channels of the train operation scenario simulation system are created respectively: subscription channel, instruction channel and execution return channel;

[0009] Step 2: Each node, as a train simulation system client, connects to the Redis server, assigns a unique identification code, and subscribes to the required channel;

[0010] Step 3: The simulation data module of the simulation software starts to periodically generate data to simulate the actual operating status;

[0011] Step 4: The scene driving module of the simulation software starts working and issues the first set of instructions to the instruction channel;

[0012] Step 5: After each node obtains the instruction information through the subscribed instruction channel, it analyzes whether its own node is the receiver of the instruction. If it is the receiver of the instruction, it parses the instruction and executes it; if it is not the receiver of the instruction, it ignores the instruction.

[0013] Step 6: After executing the instruction, the node as the instruction receiver publishes the execution result to the execution result channel;

[0014] Step 7: The scenario process driving module of the simulation software subscribes to the execution result channel. After receiving the execution result, it first traverses the definition of the simulation process, determines the current execution branch, selects the next instruction or operation, and publishes it to the instruction subscription channel;

[0015] Step 8: The simulation system executes steps 5 and 6 again;

[0016] Step 9: After receiving the execution result, the scene process driving module determines whether the entire scene is executed. If so, the execution of the current scene is terminated.

[0017] As a preferred technical solution, the instruction channel is specifically:

[0018] The information released by the command channel is the action to be completed by a specific node in the scene process. For example, if you want to broadcast a voice message, the specific operation of the command can be defined by defining a command operator, and the specific operator represents a specific operation that can be identified.

[0019] As a preferred technical solution, the result return channel is specifically:

[0020] The message published by the result return channel is the execution result of the instruction. The return result of the instruction is not limited to completion or failure. Specific return codes can be defined to represent different execution results. The result can be recognized by the scene process control module that receives the message.

[0021] As a preferred technical solution, the subscription channel is specifically:

[0022] The information published by the subscription channel is the data changes stored in Redis; the scope of data changes is divided according to specific trains. For example, the data changes of train 1 are published in the mode of [train.1]. If a node needs to subscribe to the data changes of all trains, it needs to subscribe in the mode of [train.*].

[0023] As a preferred technical solution, the format of the identification code in step 2 is specifically:

[0024] Node group number: the node's device number.

[0025] As a preferred technical solution, the instruction format in step 4 is specifically:

[0026] Receiver identification code, number of instructions, instruction execution mode, instruction 1, instruction 2, instruction 3…

[0027] As a preferred technical solution, the instruction execution mode is specifically:

[0028] Single execution, multiple execution, loop execution.

[0029] As a preferred technical solution, the execution result format in step 6 is specifically:

[0030] Executor identification code, number of returned results, instruction 1, result 1, instruction 2, result 2…

[0031] According to a second aspect of the present invention, a system for the general simulation method for train operation scenarios is provided, comprising:

[0032] The simulation data driving module is used to simulate real scenes in real time and can generate random or preset simulation data;

[0033] The data subscription module is used to publish data changes to the subscription channel. The client that subscribes to the channel will obtain the status changes of the simulation device in real time.

[0034] The scene process driving module is used to issue the latest instructions to other nodes according to the preset steps of the scene, and receive the execution results to drive the next execution action.

[0035] According to a third aspect of the present invention, there is provided an electronic device, comprising a memory and a processor, wherein a computer program is stored in the memory, and the method described above is implemented when the processor executes the program.

[0036] According to a fourth aspect of the present invention, there is provided a computer-readable storage medium having a computer program stored thereon, wherein the program implements the method described when executed by a processor.

[0037] Compared with the prior art, the present invention has the following advantages:

[0038] 1) It simplifies the system structure, ensures data consistency and high-speed access, optimizes network communication efficiency, and achieves decoupling between applications (systems). It also avoids the system complexity caused by network isolation and inconsistent development languages, and improves the ease of simulation system deployment and operational stability.

[0039] 2) The present invention realizes the integration of publish-subscribe mechanism and in-memory database access. If it is realized by existing technology, a remote communication module will generally be developed or a message queue product will be adopted, and then deployed simultaneously with the database. Such a software structure makes the system more and more bloated. The present invention can greatly reduce the scale of the simulation system and realize the decoupling between heterogeneous applications (systems). Each subsystem can be developed in a different language. As long as the Redis lightweight publish-subscribe mechanism is called, the message interaction can be completed. The subsystems do not need to communicate directly, which reduces the complexity of developing and debugging the system. The generation of data and the sending of messages are decoupled. The generation of data corresponds to the business data model stored in Redis, and the sending of messages can be customized.

[0040] 3) The present invention realizes high efficiency of network deployment. Since the deployment of each subsystem requires specific network planning for each node, the network between each subsystem generally needs to be isolated, but as long as the public Redis service can be accessed, the subsystems can achieve message interconnection. This can greatly reduce the complexity of network planning for the simulation system, and can quickly and flexibly deploy the simulation system.

[0041] 4) The present invention utilizes the efficiency and reliability of Redis lightweight publish-subscribe mechanism to realize fast message delivery. Redis subscription publishing is simple, lightweight, and has low latency, which can ensure the rapid integration of services. As long as the publisher of the message pushes the message to the channel, the client can obtain the message from the channel in the first time.

[0042] 5) The present invention utilizes the characteristics of Redis memory data storage to achieve highly object-oriented and high-performance data structures. Redis supports a variety of data types, which can meet the needs of storing various data structures, especially hash slot type data, which can highly integrate the multiple states of a complex device. Redis also has the advantage of data storage space, and the use of bitmaps greatly saves storage space. The entire database is loaded in memory, which can provide data access speed that disk databases cannot provide. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 This is a schematic diagram of a general simulation structure of a train operation scenario of the present invention;

[0044] Figure 2 It is a flow chart of the universal simulation method of train operation scenario of the present invention. DETAILED DESCRIPTION

[0045] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0046] The present invention provides a method for a more reliable, efficient, easy-to-use lightweight train simulation system based on a memory database, which can realize complex scene simulation, meet the current increasing demand for rail transit system simulation, but ensure that the system is not too large. It can realize the decoupling of various subsystems, and ensure that the development, testing, deployment and maintenance of the simulation system can be completed efficiently.

[0047] The present invention provides a train operation scenario simulation method, which combines database and network communication functions into one by means of a Redis lightweight message publishing and subscription mechanism and a simulation method of memory database performance, thereby realizing a convenient and lightweight operation scenario simulation system. The present invention simplifies the system structure, utilizes the high performance of a key-value memory database, ensures data consistency and high-speed access, can establish an object-structured data model of train information, and simulates the data changes of the train in real time to simulate the running status of the train. Through the Redis server relay, the message is sent quickly and reliably to the relevant nodes. The network communication efficiency is optimized, the decoupling between applications (systems) is realized, and the system complexity caused by the isolation of the network and the inconsistency of the development language is also avoided, thereby improving the simplicity of simulation system deployment and the stability of operation.

[0048] like Figure 1 and Figure 2 As shown, a general simulation method for urban rail transit train operation scenarios includes the following steps:

[0049] Step 1. After the simulation software is started, three channels of the train operation scenario simulation system are created: subscription channel, instruction channel and execution return channel. The scale and setting of each channel can be flexibly customized according to the actual business, and mode subscription can be adopted, such as dividing according to the subsystems of each train equipment ([Train 1. Business 1], [Train 1. Business 2], etc.);

[0050] Step 2: Each node, as a client of the train operation scenario simulation system, connects to the Redis server, assigns a unique identification code, and subscribes to the required channels (the client can subscribe to multiple channels, with no limit on the number. The subscription channel is subscribed in the usage mode to achieve the isolation of multiple train information). Generally, the node identifier is uniquely identified by [group number.node number];

[0051] Step 3: The simulation software starts to generate data periodically to simulate the actual operation status. The data generation strategy can provide random, timing and scenarios, such as simulating the scenario of a train running on the main line, opening the door first and then closing it after arriving at a platform. Such scenario simulation is closer to the actual operation situation;

[0052] Step 4: The scenario driving module of the simulation software starts working and issues the first set of instructions to the instruction channel. The specific instructions are related to the scenario design, and it will be more intuitive to define the scenario process in the form of a flowchart;

[0053] Step 5: After each node obtains the instruction information through the subscribed instruction channel, it analyzes whether its own node is the receiver of the instruction. If it is the receiver of the instruction, it parses the instruction and executes it; if it is not the receiver of the instruction, it ignores the instruction.

[0054] Step 6: After executing the instruction, the node that receives the instruction publishes the execution result to the execution result channel. If the execution result is not written back to the message channel under certain circumstances, the scenario flow module will handle it according to the timeout rule;

[0055] Step 7. The scenario process driver module of the simulation software subscribes to the execution result channel. After receiving the execution result, it first traverses the definition of the simulation process, determines the current execution branch, selects the next instruction or operation, and publishes it to the instruction subscription channel. The judgment of the scenario requires the scenario driver module to record the execution status of the scenario and the simulation status of the current device.

[0056] Step 8: The simulation system executes steps 5 and 6 again;

[0057] Step 9: After receiving the execution result, the scene process driving module determines that the scene process is complete, and then ends the execution of the current scene.

[0058] The above is an introduction to a method embodiment. The following is a further explanation of the solution of the present invention through a system embodiment.

[0059] like Figure 1 As shown, the system of the present invention includes a simulation data driving module, a data subscription module and a scene process driving module, wherein the simulation data driving module simulates the real scene in real time and can generate random or preset simulation data. The data subscription module publishes the data changes to the subscription channel, and the client subscribing to the channel will obtain the state changes of the simulation device in real time. The scene process driving module publishes the latest instructions to other nodes according to the preset steps of the scene, and receives the execution results to drive the next execution action. Compared with the prior art, the present invention simplifies the system structure, ensures the consistency and high-speed access of data, optimizes the network communication efficiency, realizes the decoupling between applications (systems), and also avoids the system complexity caused by the isolation of the network and the inconsistency of the development language, and improves the simplicity of the simulation system deployment and the stability of operation.

[0060] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the described module can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0061] The electronic device of the present invention includes a central processing unit (CPU), which can perform various appropriate actions and processes according to computer program instructions stored in a read-only memory (ROM) or loaded from a storage unit into a random access memory (RAM). In the RAM, various programs and data required for device operation can also be stored. The CPU, ROM and RAM are connected to each other via a bus. An input / output (I / O) interface is also connected to the bus.

[0062] Multiple components in the device are connected to the I / O interface, including: input units, such as keyboards, mice, etc.; output units, such as various types of displays, speakers, etc.; storage units, such as disks, optical disks, etc.; and communication units, such as network cards, modems, wireless communication transceivers, etc. The communication unit allows the device to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunication networks.

[0063] The processing unit performs the various methods and processes described above, such as the method of the present invention. For example, in some embodiments, the method of the present invention can be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit. In some embodiments, part or all of the computer program can be loaded and / or installed on the device via a ROM and / or a communication unit. When the computer program is loaded into RAM and executed by the CPU, one or more steps of the method of the present invention described above can be performed. Alternatively, in other embodiments, the CPU can be configured to perform the method of the present invention by any other appropriate means (e.g., by means of firmware).

[0064] The functions described above herein 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), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0065] The program code for implementing the method of the present invention can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code can be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or server.

[0066] In the context of the present invention, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A 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, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0067] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A general simulation method for train operation scenarios, characterized in that: This method uses the Redis lightweight message publishing and subscription mechanism and the high performance of the in-memory database to combine database storage access and message communication functions into one. While simulating the train operation status, it synchronizes the execution of each simulation scene in real time, thus realizing the rapid construction of the train operation simulation system. The method specifically comprises the following steps: Step 1: After the simulation software is started, three channels of the train operation scenario simulation system are created respectively: subscription channel, instruction channel and execution return channel; Step 2: Each node, as a train simulation system client, connects to the Redis server, assigns a unique identification code, and subscribes to the required channel; Step 3: The simulation data module of the simulation software starts to periodically generate data to simulate the actual operating status; Step 4: The scene driving module of the simulation software starts working and issues the first set of instructions to the instruction channel; Step 5: After each node obtains the instruction information through the subscribed instruction channel, it analyzes whether its own node is the receiver of the instruction. If it is the receiver of the instruction, it parses the instruction and executes it; if it is not the receiver of the instruction, it ignores the instruction. Step 6: After executing the instruction, the node as the instruction receiver publishes the execution result to the execution result channel; Step 7: The scenario process driving module of the simulation software subscribes to the execution result channel. After receiving the execution result, it first traverses the definition of the simulation process, determines the current execution branch, selects the next instruction or operation, and publishes it to the instruction subscription channel; Step 8: The simulation system executes steps 5 and 6 again; Step 9: After receiving the execution result, the scene process driving module determines whether the entire scene is executed. If so, the execution of the current scene is terminated.

2. A general simulation method for train operation scenarios according to claim 1, characterized in that: The command channel is specifically: The information released by the command channel is the action to be completed by a specific node in the scene process.

3. A universal simulation method for train operation scenarios according to claim 1, characterized in that: The result return channel is specifically: The message published by the result return channel is the execution result of the instruction. The return result of the instruction is not limited to completion or failure. Specific return codes can be defined to represent different execution results. The result can be recognized by the scene process control module that receives the message.

4. A general simulation method for train operation scenarios according to claim 1, characterized in that: The subscription channels are specifically: The information published by the subscription channel is the data changes stored in Redis; the scope of data changes is divided according to specific trains.

5. A universal simulation method for train operation scenarios according to claim 1, characterized in that: The format of the identification code in step 2 is specifically: Node group number: the node's device number.

6. A universal simulation method for train operation scenarios according to claim 1, characterized in that: The instruction format in step 4 is specifically: Receiver identification code, number of instructions, instruction execution mode, instruction 1, instruction 2, instruction 3… 7. A universal simulation method for train operation scenarios according to claim 6, characterized in that: The instruction execution mode is specifically: Single execution, multiple execution, loop execution.

8. A universal simulation method for train operation scenarios according to claim 1, characterized in that: The execution result format in step 6 is specifically as follows: Executor identification code, number of returned results, instruction 1, result 1, instruction 2, result 2… 9. A system for the universal simulation method for train operation scenarios according to claim 1, characterized in that: include: The simulation data driving module is used to simulate real scenes in real time and can generate random or preset simulation data; The data subscription module is used to publish data changes to the subscription channel. The client that subscribes to the channel will obtain the status changes of the simulation device in real time. The scene process driving module is used to issue the latest instructions to other nodes according to the preset steps of the scene, and receive the execution results to drive the next execution action.

10. An electronic device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the processor executes the program, the method according to any one of claims 1 to 8 is implemented.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Rail transit vehicle simulation control system

    CN110136537A

  • Rail transit operation simulation method and system

    CN113343422A