Rail transit signal system data synchronization method, device, equipment and storage medium
By using time-series data streams in the rail transit signal system for data synchronization, the problems of redundant data transmission and high network pressure are solved, real-time synchronization and high reliability of data are achieved, and the system's demand for real-time and reliability is met. .
Patent Information
- Application Number
- CN202111117105.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-23
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2041-09-23
AI Technical Summary
The TCP/IP-based data synchronization method in the existing rail transit signal system has problems such as redundant data transmission and high network transmission pressure, which is difficult to meet the high reliability and real-time requirements of the system.
By generating and storing time-series data streams in node memory, data synchronization is performed, data redundant transmission is reduced, and device status data is updated and synchronized under certain conditions, a full and incremental synchronization mechanism is adopted to ensure the real-timeness of the data.
It effectively reduces data redundant transmission, improves the real-time data synchronization and the reliability of the system, reduces network transmission pressure, and meets the high reliability and real-time requirements of the rail transit signal system for data synchronization.
Smart Images

Figure CN114051036B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method, device, equipment and storage medium for synchronizing data in a rail transit signal system. Background Art
[0002] In the rail transit signal system, data synchronization is required between different station-level nodes and between the primary and standby control centers. The rail transit signal control system has extremely high reliability and real-time requirements for data synchronization. At present, the commonly used data synchronization method between multiple nodes in the rail transit signal control system is to synchronize data through the Transmission Control Protocol (TCP) or Internet Protocol (IP) connection to transmit private protocols, and synchronize data between the primary and standby data centers through cold copy or cold switching.
[0003] With the development of signal system business, the amount and types of data between different nodes of rail transit signal system are increasing. At the same time, the requirements for system reliability and real-time performance are constantly improving. The TCP / IP synchronization method based on private protocol has problems such as redundant data transmission and high network transmission pressure. Summary of the invention
[0004] The present invention provides a rail transit signal system data synchronization method, device, equipment and storage medium, which are used to solve the defect of redundant data transmission in the prior art, realize real-time data synchronization, and reduce the network transmission pressure during data synchronization.
[0005] The present invention provides a rail transit signal system data synchronization method, comprising:
[0006] When the first preset condition is met, the first node obtains status information of all station equipment and trains and generates status data of all equipment; wherein the status data of all equipment includes all information and a first identity ID of all information;
[0007] Writing the overall device status data into a time series data stream in the local memory of the first node, wherein the time series data stream is used for data synchronization by other nodes;
[0008] The second overall information ID is updated according to the first overall information ID, where the second overall information ID is used to record the latest first overall information ID.
[0009] According to the rail transit signal system data synchronization method provided by the present invention, the first preset condition includes:
[0010] The first node receives a general request sent by other nodes; wherein the general request is used to instruct the first node to update the state data of all devices in the time series data stream;
[0011] Alternatively, when the first node is started, it is determined that the second overall information ID does not exist in the time series data stream.
[0012] The rail transit signal system data synchronization method provided by the present invention also includes:
[0013] Performing change detection based on the cached data of the first node, and determining information to be synchronized based on a result of the change detection;
[0014] Generate change data based on the information to be synchronized, and write the change data into the time series data stream of the local memory of the first node, wherein the change data includes change information and change information ID.
[0015] The rail transit signal system data synchronization method provided by the present invention also includes:
[0016] In response to a request for all cached data sent by a backup machine of the first node, pack all the data and send them to the backup machine;
[0017] Perform change detection based on the cache data of the first node, determine change cache information based on the result of the change detection, and send the change cache information to the standby machine.
[0018] The present invention provides a rail transit signal system data synchronization method, comprising:
[0019] When the first node is started or a fault is recovered, determining the time series data stream to be synchronized according to the synchronization configuration information; wherein the synchronization configuration information is used to indicate the synchronization data of the first node;
[0020] Determine whether the second overall information ID exists in the time series data stream to be synchronized;
[0021] In the case where the second overall information ID exists in the time series data stream to be synchronized, the first node synchronizes the overall device status data corresponding to the second overall information ID and the change data after the second overall message ID; or,
[0022] When the second global message ID does not exist in the time series data stream to be synchronized, the first node sends a global request to the nodes corresponding to the time series data stream to be synchronized.
[0023] The rail transit signal system data synchronization method provided by the present invention also includes:
[0024] Determining unconsumed data in the time series data stream to be synchronized according to the queue offset of the time series data stream to be synchronized;
[0025] The unconsumed data is synchronized.
[0026] The rail transit signal system data synchronization method provided by the present invention also includes:
[0027] In response to a request for all cached data sent by a backup machine of the first node, pack all the data and send them to the backup machine;
[0028] Perform change detection based on the cache data of the first node, determine change cache information based on the result of the change detection, and send the change cache information to the standby machine.
[0029] The present invention provides a data synchronization device for a rail transit signal system, comprising:
[0030] The module for generating the state data of all equipment is used for obtaining the state information of all station equipment and trains by the first node and generating the state data of all equipment when the first preset condition is met; wherein the state data of all equipment includes the state information of all equipment and the first identity ID of the whole information;
[0031] A data writing module, used for writing the state data of all devices into a time series data stream in the local memory of the first node, wherein the time series data stream is used for data synchronization by other nodes;
[0032] The ID updating module is used to update the second overall information ID according to the first overall information ID, where the second overall information ID is used to record the latest first overall information ID.
[0033] The present invention provides a data synchronization device for a rail transit signal system, comprising:
[0034] A module for determining a time series data stream to be synchronized, used to determine a time series data stream to be synchronized according to synchronization configuration information when the first node is started or a fault is recovered; wherein the synchronization configuration information is used to indicate synchronization data of the first node;
[0035] An ID determination module, used to determine whether a second overall information ID exists in the time series data stream to be synchronized;
[0036] a data synchronization module, configured to synchronize, by the first node, all device status data corresponding to the second all information ID and change data after the second all message ID when there is a second all information ID in the time series data stream to be synchronized; or
[0037] When the second global message ID does not exist in the time series data stream to be synchronized, the first node sends a global request to the nodes corresponding to the time series data stream to be synchronized.
[0038] The present invention provides an electronic device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the rail transit signal system data synchronization method when executing the program.
[0039] The present invention provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the rail transit signal system data synchronization method are implemented.
[0040] The present invention provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the steps of the rail transit signal system data synchronization method are implemented.
[0041] The rail transit signal system data synchronization method, device, equipment and storage medium provided by the present invention store the data to be synchronized in a time series data stream in the node memory for synchronization by other nodes, and write the status data of all devices in the time series data stream when a first preset condition is met, thereby reducing redundant data transmission, caching the synchronized data in the memory, and ensuring the real-time nature of data synchronization. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0043] Figure 1 This is one of the flow charts of the rail transit signal system data synchronization method provided by the present invention;
[0044] Figure 2 A schematic diagram of a flow chart of a time series data flow for writing change information into the local memory of the first node provided by the present invention;
[0045] Figure 3 This is the second flow chart of the rail transit signal system data synchronization method provided by the present invention;
[0046] Figure 4 This is one of the structural schematic diagrams of the rail transit signal system data synchronization device provided by the present invention;
[0047] Figure 5This is the second structural schematic diagram of the rail transit signal system data synchronization device provided by the present invention;
[0048] Figure 6 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0049] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings 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 are within the scope of protection of the present invention.
[0050] Figure 1 One of the flow charts of the rail transit signal system data synchronization method provided by the embodiment of the present invention is as follows: Figure 1 As shown, the method comprises the following steps:
[0051] Step 100: When a first preset condition is met, the first node obtains status information of all station equipment and trains and generates overall equipment status data; wherein the overall equipment status data includes overall information and a first overall information identity ID.
[0052] Optionally, in the rail transit signal system, each station can be used as a node, and the data center can also be used as a node, and data synchronization is performed between nodes. The first node can be any node in the rail transit signal system. It can be understood that the first node can be both the main synchronizer of the data and the synchronized party of the data. In this embodiment, the first node, as the synchronized party of the data, stores the data in the time series data stream of the local memory of the first node for data synchronization by other nodes that are the main synchronizers of the data.
[0053] When the first preset condition is met, the first node obtains status information of all station equipment and trains and generates all equipment status data. The all equipment status data includes all information and a first all information identity document (ID).
[0054] It should be noted that the generated overall device status data is written as a piece of data into the time series data stream of the local memory of the first node for reading by other nodes, and the time series data stream contains multiple pieces of data, each of which is in the format of ID+Msg. It can be understood that the first overall information identity in the overall device status data is ID, and the overall information in the overall device status data is Msg. Msg is the specific data content, which is composed of Key-value pairs. Key is the unique identifier of the device or train attribute, and value is the corresponding value of the key.
[0055] Step 101: Write the overall device status data into a time series data stream in the local memory of the first node, where the time series data stream is used for data synchronization with other nodes.
[0056] Optionally, the ID of the data in the timing data stream is a sequence that increases with the data writing time, and the first overall information ID in the overall device status data needs to be generated based on the current maximum ID in the timing data stream. For example, the ID of the data in the timing data stream is an arithmetic progression with 1 as the common difference, and the maximum ID of the currently written data is 100. Then the ID of the overall device status data written at this time is 101, that is, the first overall information ID is 101.
[0057] Step 102: Update the second overall information ID according to the first overall information ID, where the second overall information ID is used to record the latest first overall information ID.
[0058] Optionally, since other nodes cannot directly identify which data in the timing data stream is the overall device status data when synchronizing the data in the timing data stream of the first node, it is necessary to record the ID of the data, that is, the first overall information ID, when newly generating the overall device status data, and update the second overall information ID based on the first overall information ID.
[0059] For example, when the first overall information ID in the overall device status data is generated to be 101, the second overall information ID is updated to be 101.
[0060] Due to the limited storage space in the memory, new data will overwrite old data, or other reasons will cause the loss of the overall device status data. When other nodes synchronize the data of the first node, they will check whether there is a second overall information ID in the timing data stream. If not, it is considered that there is no overall device status data in the timing data stream. At this time, a message instructing the first node to update the overall device status data in the timing data stream will be sent. After receiving the message, the first node will regenerate an overall device status data and store it in the timing data stream, and update the second overall information ID.
[0061] The embodiment of the present invention reduces redundant data transmission by storing the data to be synchronized in the time series data stream in the node memory for other nodes to synchronize, and writes the status data of all devices in the time series data stream when the first preset condition is met. The synchronized data is cached in the memory, thereby ensuring the real-time nature of data synchronization.
[0062] In one embodiment, the first preset condition includes:
[0063] The first node receives a general request sent by other nodes; wherein the general request is used to instruct the first node to update the state data of all devices in the time series data stream;
[0064] Alternatively, when the first node is started, it is determined that the second overall information ID does not exist in the time series data stream.
[0065] Optionally, when other nodes, as the main data synchronization party, synchronize data with the first node, when they cannot obtain the status data of all devices in the time series data stream of the local memory of the first node, they send a whole message to the first node. When the first node receives the whole message, the first node obtains the status information of all station equipment and trains and generates the status data of all equipment. In addition, when the first node is started, it will determine whether there is data with the same ID as the second whole information ID in the time series data stream, that is, whether the second whole information ID exists in the time series data stream. When it is determined that the second whole information ID does not exist in the time series data stream, the first node obtains the status information of all station equipment and trains and generates the status data of all equipment.
[0066] In an embodiment of the present invention, when a first node receives a global request sent by other nodes, or when the first node is started and it is determined that the second global information ID does not exist in the time series data stream, the first node obtains the status information of all station equipment and trains, generates global equipment status data, reduces redundant data transmission, and synchronizes data cache in memory, thereby ensuring the real-time nature of data synchronization.
[0067] In one embodiment, the rail transit signal system data synchronization method further includes writing the change information into the time series data stream of the local memory of the first node. Figure 2 A flow chart of a time series data flow for writing change information into the local memory of the first node provided by an embodiment of the present invention, such as Figure 2 As shown, the time series data flow of writing the change information into the local memory of the first node includes the following sub-steps:
[0068] Step 200: Perform change detection based on the cached data of the first node, and determine the information to be synchronized based on the result of the change detection.
[0069] Step 201: Generate change data based on the information to be synchronized, and write the change data into the time series data stream of the local memory of the first node, wherein the change data includes change information and change information ID.
[0070] Optionally, the time series data stream in the local memory of the first node includes not only the overall device status data but also change data, wherein the change data includes change information and change information ID.
[0071] For example, the timing data stream includes 4 data, the first data is the status data of all devices, wherein the first overall information ID is 1, and the overall information includes status information a of device A, status information b of device B, status information c of device C, and status information d of device D; the second data is change data, wherein the change ID of the second data is 2, and the change information is change information △a of device A; the third data is change data, wherein the change ID of the third data is 3, and the change information is change information △b of device B; the fourth data is change data, wherein the change ID of the fourth data is 4, and the change information is change information △c of device C.
[0072] The cache data of the first node stores the status information of the station equipment and the train. By performing change detection based on the cache data of the first node, the status change information of the station equipment and the train can be determined. Based on the change information, the information to be stored in the timing data stream of the first node memory is determined, that is, the information to be synchronized. Change data is generated based on the information to be synchronized, and the change data is written into the timing data stream of the local memory of the first node, and the change information ID in the change data. Among them, the frequency of change detection performed by the first node can be configured according to demand to improve the flexibility of data synchronization of the rail transit signal system.
[0073] In an embodiment of the present invention, the first node determines the information to be synchronized through change detection, generates change data based on the synchronization information, and stores the change data in a time series data stream, thereby reducing redundant data transmission. The synchronization data is cached in the memory, thereby ensuring the real-time nature of data synchronization.
[0074] In one embodiment, the rail transit signal system data synchronization method further includes:
[0075] In response to a request for all cached data sent by a backup machine of the first node, pack all the data and send them to the backup machine;
[0076] Perform change detection based on the cache data of the first node, determine change cache information based on the result of the change detection, and send the change cache information to the standby machine.
[0077] Optionally, the node cache adopts a redundant backup mechanism, and when the slave node is started, a request for all cached data is sent to the host node. It can be understood that the first node is the master node, and after receiving the request for all cached data sent by the backup machine, the first node packages all data and sends it to the backup machine, wherein the all data is all data of the first node, including queue data in the time series data stream. After receiving the all data, the backup machine saves the changed cache information.
[0078] In addition, the node cache adopts the method of full synchronization plus incremental synchronization. The incremental synchronization process includes: the first node performs change detection based on the cache data of this node, and determines the change cache information based on the result of the change detection. For example, if the first node performs a write operation, the write operation will generate a change cache information, and the change cache information will be sent to the standby machine. After the standby machine receives the change cache information, it saves the change cache information and updates the cache data of the standby machine.
[0079] In the embodiment of the present invention, the master node and the slave node use a full synchronization combined with incremental synchronization to back up cache data in real time. When the slave node starts, full synchronization is performed; after the full synchronization is completed, incremental synchronization is performed to synchronize the change cache information of the master node to the slave node. The master-slave redundancy mechanism is used to ensure the reliability of data synchronization.
[0080] Figure 3 The second flowchart of the rail transit signal system data synchronization method provided by the embodiment of the present invention is as follows Figure 1 As shown, the method comprises the following steps:
[0081] Step 300: When the first node is started or recovered from a fault, determine the time series data stream to be synchronized according to the synchronization configuration information; wherein the synchronization configuration information is used to indicate the synchronization data of the first node.
[0082] Optionally, the synchronization configuration information specifies information to be synchronized of the first node, that is, data information that needs to be synchronized when the first node acts as a master synchronizer.
[0083] When the first node is started or recovers from a failure, the time series data stream to be synchronized is determined according to the synchronization configuration information.
[0084] Step 301: Determine whether there is a second overall information ID in the time series data stream to be synchronized.
[0085] Optionally, the second overall information ID is used to record the latest first overall information ID in the time series data stream to be synchronized.
[0086] The first node searches the time series data stream to be synchronized for the second overall information ID. If the second overall information ID exists, overall device status data exists in the time series data stream to be synchronized.
[0087] Step 302: When there is a second overall information ID in the time series data stream to be synchronized, the first node synchronizes the overall device status data corresponding to the second overall information ID and the change data after the second overall message ID; or
[0088] When the second global message ID does not exist in the time series data stream to be synchronized, the first node sends a global request to the nodes corresponding to the time series data stream to be synchronized.
[0089] Optionally, when there is a second overall information ID in the time series data stream to be synchronized, the current device status data can be determined based on the overall device status data corresponding to the second overall information ID and the change data after the second overall message ID determined by the first node. Therefore, the first node synchronizes the overall device status data corresponding to the second overall information ID and the change data after the second overall message ID.
[0090] In the case where the second collective message ID does not exist in the time series data stream to be synchronized, the first node cannot perform data synchronization at this time, and therefore, sends a collective request to the node corresponding to the time series data stream to be synchronized, and the collective request is used to instruct the node corresponding to the synchronization data stream to update the overall device status data in the time series data stream. After receiving the collective request, the node corresponding to the time series data stream to be synchronized will generate overall status data and store it in the time series data stream to be synchronized for the first node to perform data synchronization.
[0091] In the embodiment of the present invention, when the first node is started or the fault is recovered, the time series data stream to be synchronized is determined according to the synchronization configuration information, and when the second overall message ID does not exist in the time series data stream to be synchronized, a general request is sent to the node corresponding to the time series data stream to be synchronized, and when the second overall information ID exists in the time series data stream to be synchronized. Synchronizing the overall device status data corresponding to the second overall information ID and the change data after the second overall message ID reduces data redundant transmission, and the synchronization data is cached in the memory, ensuring the real-time nature of data synchronization.
[0092] In one embodiment, the rail transit signal system data synchronization method further includes:
[0093] Determining unconsumed data in the time series data stream to be synchronized according to the queue offset of the time series data stream to be synchronized;
[0094] The unconsumed data is synchronized.
[0095] Optionally, when there is new data in the time series data stream to be synchronized, the queue of the time series data stream will be offset. The first node, as the main synchronization party, detects the queue offset of the time series data stream to be synchronized, determines the newly added data, that is, the unconsumed data, and synchronizes the unconsumed data.
[0096] In the embodiment of the present invention, the first node determines the unconsumed data according to the queue offset without synchronizing all the data in the time series data stream, thereby reducing redundant data transmission, caching the synchronized data in the memory, and ensuring the real-time performance of data synchronization.
[0097] In one embodiment, the rail transit signal system data synchronization method further includes:
[0098] In response to a request for all cached data sent by a backup machine of the first node, pack all the data and send them to the backup machine;
[0099] Perform change detection based on the cache data of the first node, determine change cache information based on the result of the change detection, and send the change cache information to the standby machine.
[0100] Optionally, the node cache adopts a redundant backup mechanism, and when the slave node is started, a request for all cached data is sent to the host node. It can be understood that the first node is the master node, and after receiving the request for all cached data sent by the backup machine, the first node packages all data and sends it to the backup machine, wherein the all data is all data of the first node, including queue data in the time series data stream. After receiving the all data, the backup machine saves the changed cache information.
[0101] In addition, the node cache adopts the method of full synchronization plus incremental synchronization. The incremental synchronization process includes: the first node performs change detection based on the cache data of this node, and determines the change cache information based on the result of the change detection. For example, if the first node performs a write operation, the write operation will generate a change cache information, and the change cache information will be sent to the standby machine. After the standby machine receives the change cache information, it saves the change cache information and updates the cache data of the standby machine.
[0102] In the embodiment of the present invention, the master node and the slave node use a full synchronization combined with incremental synchronization to back up cache data in real time. When the slave node starts, full synchronization is performed; after the full synchronization is completed, incremental synchronization is performed to synchronize the change cache information of the master node to the slave node. The master-slave redundancy mechanism is used to ensure the reliability of data synchronization.
[0103] The rail transit signal system data synchronization device provided by the present invention is described below. The rail transit signal system data synchronization device described below and the rail transit signal system data synchronization method described above can be referenced to each other.
[0104] Figure 4 FIG. 1 is one of the structural diagrams of the rail transit signal system data synchronization device provided by an embodiment of the present invention, such as Figure 4 As shown, the device includes a whole device status data generation module 410, a data writing module 420 and an ID update module 430, wherein:
[0105] The overall equipment status data generating module 410 is used for, when a first preset condition is met, the first node obtains the status information of all station equipment and trains and generates overall equipment status data; wherein the overall equipment status data includes overall information and a first overall information identity ID;
[0106] A data writing module 420, used for writing the overall device status data into a time series data stream in the local memory of the first node, the time series data stream being used for data synchronization by other nodes;
[0107] The ID updating module 430 is used to update the second overall information ID according to the first overall information ID, where the second overall information ID is used to record the latest first overall information ID.
[0108] Optionally, the first preset condition includes:
[0109] The first node receives a general request sent by other nodes; wherein the general request is used to instruct the first node to update the state data of all devices in the time series data stream;
[0110] Alternatively, when the first node is started, it is determined that the second overall information ID does not exist in the time series data stream.
[0111] Optionally, the rail transit signal system data synchronization device further includes a change information synchronization module, which is used to:
[0112] Performing change detection based on the cached data of the first node, and determining information to be synchronized based on a result of the change detection;
[0113] Generate change data based on the information to be synchronized, and write the change data into the time series data stream of the local memory of the first node, wherein the change data includes change information and change information ID.
[0114] Optionally, the rail transit signal system data synchronization device further includes a backup module, which is used to:
[0115] In response to a request for all cached data sent by a backup machine of the first node, pack all the data and send them to the backup machine;
[0116] Perform change detection based on the cache data of the first node, determine change cache information based on the result of the change detection, and send the change cache information to the standby machine.
[0117] The rail transit signal system data synchronization device provided by the present invention can realize Figure 1 to Figure 2 The various processes implemented by the method embodiment and achieving the same technical effect are not described here to avoid repetition.
[0118] Figure 5 FIG. 2 is a second structural diagram of a data synchronization device for a rail transit signal system provided by an embodiment of the present invention. Figure 5 As shown, the device includes a time series data stream determination module 510 to be synchronized, an ID determination module 520 and a data synchronization module 530, wherein:
[0119] The module 510 for determining the time series data stream to be synchronized is used to determine the time series data stream to be synchronized according to the synchronization configuration information when the first node is started or the failure is recovered; wherein the synchronization configuration information is used to indicate the synchronization data of the first node;
[0120] An ID determination module 520, configured to determine whether a second overall information ID exists in the time series data stream to be synchronized;
[0121] The data synchronization module 530 is configured to synchronize, by the first node, the overall device status data corresponding to the second overall information ID and the change data after the second overall message ID when there is a second overall information ID in the time series data stream to be synchronized; or
[0122] When the second global message ID does not exist in the time series data stream to be synchronized, the first node sends a global request to the nodes corresponding to the time series data stream to be synchronized.
[0123] Optionally, the rail transit signal system data synchronization device further includes an unconsumed data synchronization module, which is used to:
[0124] Determining unconsumed data in the time series data stream to be synchronized according to the queue offset of the time series data stream to be synchronized;
[0125] The unconsumed data is synchronized.
[0126] Optionally, the rail transit signal system data synchronization device further includes a backup module, which is used to:
[0127] In response to a request for all cached data sent by a backup machine of the first node, pack all the data and send them to the backup machine;
[0128] Perform change detection based on the cache data of the first node, determine change cache information based on the result of the change detection, and send the change cache information to the standby machine.
[0129] The rail transit signal system data synchronization device provided by the present invention can realize Figure 3 The various processes implemented by the method embodiment and achieving the same technical effect are not described here to avoid repetition.
[0130] Figure 6 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 6 As shown, the electronic device may include: a processor 610, a communication interface 620, a memory 630 and a communication bus 640, wherein the processor 610, the communication interface 620 and the memory 630 communicate with each other through the communication bus 640. The processor 610 may call the logic instructions in the memory 630 to execute the rail transit signal system data synchronization method, which includes:
[0131] When the first preset condition is met, the first node obtains status information of all station equipment and trains and generates status data of all equipment; wherein the status data of all equipment includes all information and a first identity ID of all information;
[0132] Writing the overall device status data into a time series data stream in the local memory of the first node, wherein the time series data stream is used for data synchronization by other nodes;
[0133] The second overall information ID is updated according to the first overall information ID, where the second overall information ID is used to record the latest first overall information ID.
[0134] Or, include:
[0135] When the first node is started or a fault is recovered, determining the time series data stream to be synchronized according to the synchronization configuration information; wherein the synchronization configuration information is used to indicate the synchronization data of the first node;
[0136] Determine whether the second overall information ID exists in the time series data stream to be synchronized;
[0137] In the case where the second overall information ID exists in the time series data stream to be synchronized, the first node synchronizes the overall device status data corresponding to the second overall information ID and the change data after the second overall message ID; or,
[0138] When the second global message ID does not exist in the time series data stream to be synchronized, the first node sends a global request to the nodes corresponding to the time series data stream to be synchronized.
[0139] In addition, the logic instructions in the above-mentioned memory 630 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0140] On the other hand, the present invention further provides a computer program product, the computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions, when the program instructions are executed by a computer, the computer can execute the rail transit signal system data synchronization method provided by the above methods, the method comprising:
[0141] When the first preset condition is met, the first node obtains status information of all station equipment and trains and generates status data of all equipment; wherein the status data of all equipment includes all information and a first identity ID of all information;
[0142] Writing the overall device status data into a time series data stream in the local memory of the first node, wherein the time series data stream is used for data synchronization by other nodes;
[0143] The second overall information ID is updated according to the first overall information ID, where the second overall information ID is used to record the latest first overall information ID.
[0144] Or, include:
[0145] When the first node is started or a fault is recovered, determining the time series data stream to be synchronized according to the synchronization configuration information; wherein the synchronization configuration information is used to indicate the synchronization data of the first node;
[0146] Determine whether the second overall information ID exists in the time series data stream to be synchronized;
[0147] In the case where the second overall information ID exists in the time series data stream to be synchronized, the first node synchronizes the overall device status data corresponding to the second overall information ID and the change data after the second overall message ID; or,
[0148] When the second global message ID does not exist in the time series data stream to be synchronized, the first node sends a global request to the nodes corresponding to the time series data stream to be synchronized.
[0149] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for synchronizing data of a rail transit signal system provided above is implemented, and the method comprises:
[0150] When the first preset condition is met, the first node obtains status information of all station equipment and trains and generates status data of all equipment; wherein the status data of all equipment includes all information and a first identity ID of all information;
[0151] Writing the overall device status data into a time series data stream in the local memory of the first node, wherein the time series data stream is used for data synchronization by other nodes;
[0152] The second overall information ID is updated according to the first overall information ID, where the second overall information ID is used to record the latest first overall information ID.
[0153] Or, include:
[0154] When the first node is started or a fault is recovered, determining the time series data stream to be synchronized according to the synchronization configuration information; wherein the synchronization configuration information is used to indicate the synchronization data of the first node;
[0155] Determine whether the second overall information ID exists in the time series data stream to be synchronized;
[0156] In the case where the second overall information ID exists in the time series data stream to be synchronized, the first node synchronizes the overall device status data corresponding to the second overall information ID and the change data after the second overall message ID; or,
[0157] When the second global message ID does not exist in the time series data stream to be synchronized, the first node sends a global request to the nodes corresponding to the time series data stream to be synchronized.
[0158] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0159] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0160] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A rail transit signal system data synchronization method, characterized in that: include: When the first preset condition is met, the first node obtains status information of all station equipment and trains and generates status data of all equipment; wherein the status data of all equipment includes all information and a first identity ID of all information; Writing the overall device status data into a time series data stream in the local memory of the first node, wherein the time series data stream is used for data synchronization by other nodes; The second overall information ID is updated according to the first overall information ID, and the second overall information ID is used to record the latest first overall information ID. When other nodes synchronize the data of the first node, they will search whether the second overall information ID exists in the time series data stream. If not, it is considered that there is no overall device status data in the time series data stream. At this time, a message instructing the first node to update the overall device status data in the time series data stream will be sent. After receiving the message, the first node will regenerate an overall device status data and store it in the time series data stream, and update the second overall information ID; Also includes: In response to a request for all cached data sent by a backup machine of the first node, pack all the data and send them to the backup machine; Perform change detection based on the cache data of the first node, determine change cache information based on the result of the change detection, and send the change cache information to the standby machine.
2. The rail transit signal system data synchronization method according to claim 1, characterized in that: The first preset condition includes: The first node receives a general request sent by other nodes; wherein the general request is used to instruct the first node to update the state data of all devices in the time series data stream; Alternatively, when the first node is started, it is determined that the second overall information ID does not exist in the time series data stream.
3. The rail transit signal system data synchronization method according to claim 1, characterized in that: Also includes: Performing change detection based on the cached data of the first node, and determining information to be synchronized based on a result of the change detection; Generate change data based on the information to be synchronized, and write the change data into the time series data stream of the local memory of the first node, wherein the change data includes change information and change information ID.
4. A rail transit signal system data synchronization method, characterized in that: include: When the first node is started or a fault is recovered, determining the time series data stream to be synchronized according to the synchronization configuration information; wherein the synchronization configuration information is used to indicate the synchronization data of the first node; Determine whether there is a second whole information ID in the time series data stream to be synchronized, where the second whole information ID is used to record the latest first whole information ID in the time series data stream to be synchronized; In the case where there is a second overall information ID in the time series data stream to be synchronized, the first node synchronizes the overall device status data corresponding to the second overall information ID and the change data after the second overall information ID; or, In the case that the second overall information ID does not exist in the time series data stream to be synchronized, the first node cannot perform data synchronization at this time, and therefore, sends an overall request to the node corresponding to the time series data stream to be synchronized, and the overall request is used to instruct the node corresponding to the synchronization data stream to update the overall device status data in the time series data stream. After receiving the overall request, the node corresponding to the time series data stream to be synchronized will generate overall status data and store it in the time series data stream to be synchronized, so as to provide the first node with data synchronization; Also includes: In response to a request for all cached data sent by a backup machine of the first node, pack all the data and send them to the backup machine; Perform change detection based on the cache data of the first node, determine change cache information based on the result of the change detection, and send the change cache information to the standby machine.
5. The rail transit signal system data synchronization method according to claim 4, characterized in that: Also includes: Determining unconsumed data in the time series data stream to be synchronized according to the queue offset of the time series data stream to be synchronized; The unconsumed data is synchronized.
6. A data synchronization device for a rail transit signal system, characterized in that: include: The module for generating the state data of all equipment is used for obtaining the state information of all station equipment and trains by the first node and generating the state data of all equipment when the first preset condition is met; wherein the state data of all equipment includes the state information of all equipment and the first identity ID of the whole information; A data writing module, used for writing the state data of all devices into a time series data stream in the local memory of the first node, wherein the time series data stream is used for data synchronization by other nodes; An ID update module, used for updating a second overall information ID according to the first overall information ID, wherein the second overall information ID is used for recording the latest first overall information ID. When other nodes synchronize the data of the first node, they will search whether the second overall information ID exists in the time series data stream. If not, it is considered that there is no overall device status data in the time series data stream. At this time, a message instructing the first node to update the overall device status data in the time series data stream will be sent. After receiving the message, the first node will regenerate an overall device status data and store it in the time series data stream, and update the second overall information ID. Also includes: In response to a request for all cached data sent by a backup machine of the first node, pack all the data and send them to the backup machine; Perform change detection based on the cache data of the first node, determine change cache information based on the result of the change detection, and send the change cache information to the standby machine.
7. A data synchronization device for a rail transit signal system, characterized in that: include: A module for determining a time series data stream to be synchronized, used to determine a time series data stream to be synchronized according to synchronization configuration information when the first node is started or a fault is recovered; wherein the synchronization configuration information is used to indicate synchronization data of the first node; An ID determination module, used to determine whether there is a second overall information ID in the time series data stream to be synchronized, where the second overall information ID is used to record the latest first overall information ID in the time series data stream to be synchronized; a data synchronization module, configured to synchronize, by the first node, the overall device status data corresponding to the second overall information ID and the change data after the second overall information ID when there is a second overall information ID in the time series data stream to be synchronized; or In the case that the second overall information ID does not exist in the time series data stream to be synchronized, the first node cannot perform data synchronization at this time, and therefore, sends an overall request to the node corresponding to the time series data stream to be synchronized, and the overall request is used to instruct the node corresponding to the synchronization data stream to update the overall device status data in the time series data stream. After receiving the overall request, the node corresponding to the time series data stream to be synchronized will generate overall status data and store it in the time series data stream to be synchronized, so as to provide the first node with data synchronization; Also includes: In response to a request for all cached data sent by a backup machine of the first node, pack all the data and send them to the backup machine; Perform change detection based on the cache data of the first node, determine change cache information based on the result of the change detection, and send the change cache information to the standby machine.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps of the rail transit signal system data synchronization method as described in any one of claims 1 to 3 are implemented, or the steps of the rail transit signal system data synchronization method as described in any one of claims 4 or 5 are implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the rail transit signal system data synchronization method as described in any one of claims 1 to 3 are implemented, or the steps of the rail transit signal system data synchronization method as described in any one of claims 4 or 5 are implemented.
Citation Information
Patent Citations
Cache data updating method and device
CN106815329A
Method and apparatus for data backup
CN109032837A
Host and backup machine data synchronization method and device, and computer device
CN109194720A
Address book synchronization method and apparatus, computer storage medium and terminal
CN109246247A
Data storage method and system, apparatus, and storage medium
CN109359222A
