Disclosure of Invention
The invention provides a data synchronization method, device, equipment and storage medium of a rail transit signal system, which are used for solving the defect of redundant data transmission in the prior art, realizing real-time data synchronization and reducing network transmission pressure in the data synchronization process.
The invention provides a data synchronization method of a rail transit signal system, which comprises the following steps:
Under the condition that a first preset condition is met, the first node acquires state information of all station equipment and trains and generates all equipment state data, wherein the all equipment state data comprises all information and a first all information Identity (ID);
Writing the whole equipment state data into a time sequence data stream of a local memory of the first node, wherein the time sequence data stream is used for data synchronization of other nodes;
And 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.
According to the data synchronization method of the rail transit signal system provided by the invention, the first preset condition comprises:
The first node receives a whole request sent by other nodes, wherein the whole request is used for indicating the first node to update whole equipment state data in the time sequence data stream;
Or in case of the first node being started, determining that the second ensemble information ID does not exist in the time-series data stream.
The data synchronization method of the rail transit signal system provided by the invention further comprises the following steps:
Performing change detection based on the cache data of the first node, and determining information to be synchronized based on the result of the change detection;
And generating change data based on the information to be synchronized, and writing the change data into a time sequence data stream of the local memory of the first node, wherein the change data comprises change information and change information ID.
The data synchronization method of the rail transit signal system provided by the invention further comprises the following steps:
Responding to a whole cache data request sent by a standby machine of the first node, and packaging and sending whole data to the standby machine;
and performing change detection based on the cache data of the first node, determining change cache information based on the result of the change detection, and sending the change cache information to the standby machine.
The invention provides a data synchronization method of a rail transit signal system, which comprises the following steps:
determining a time sequence data stream to be synchronized according to synchronization configuration information under the condition that a first node is started or fails to recover, wherein the synchronization configuration information is used for indicating synchronization data of the first node;
determining whether a second overall information ID exists in the time sequence data stream to be synchronized;
in the case that a second global information ID exists in the time sequence data stream to be synchronized, the first node synchronizes the global equipment state data corresponding to the second global information ID and the change data after the second global information ID, or
And under the condition that the second whole message ID does not exist in the time sequence data stream to be synchronized, the first node sends a whole request to the node corresponding to the time sequence data stream to be synchronized.
The data synchronization method of the rail transit signal system provided by the invention further comprises the following steps:
Determining unconsumed data in the time sequence data stream to be synchronized according to the queue offset of the time sequence data stream to be synchronized;
And synchronizing the unconsumed data.
The data synchronization method of the rail transit signal system provided by the invention further comprises the following steps:
Responding to a whole cache data request sent by a standby machine of the first node, and packaging and sending whole data to the standby machine;
and performing change detection based on the cache data of the first node, determining change cache information based on the result of the change detection, and sending the change cache information to the standby machine.
The invention provides a data synchronization device of a rail traffic signal system, which comprises:
The system comprises a whole equipment state data generation module, a first node and a second node, wherein the whole equipment state data generation module is used for acquiring state information of whole station equipment and trains and generating whole equipment state data under the condition that a first preset condition is met, and the whole equipment state data comprises whole information and a first whole information Identity (ID);
The data writing module is used for writing the whole equipment state data into a time sequence data stream of the local memory of the first node, wherein the time sequence data stream is used for data synchronization of other nodes;
and the ID updating module is used for updating a second overall information ID according to the first overall information ID, and the second overall information ID is used for recording the latest first overall information ID.
The invention provides a data synchronization device of a rail traffic signal system, which comprises:
The system comprises a to-be-synchronized time sequence data stream determining module, a synchronization data stream determining module and a synchronization data stream determining module, wherein the to-be-synchronized time sequence data stream determining module is used for determining a to-be-synchronized time sequence data stream according to synchronization configuration information under the condition that the first node is started or fails to recover, and the synchronization configuration information is used for indicating synchronization data of the first node;
An ID determining module, configured to determine whether a second global information ID exists in the time-series data stream to be synchronized;
A data synchronization module for synchronizing, in the case where a second global information ID exists in the time-series data stream to be synchronized, global equipment status data corresponding to the second global information ID and change data after the second global information ID by the first node, or
And under the condition that the second whole message ID does not exist in the time sequence data stream to be synchronized, the first node sends a whole request to the node corresponding to the time sequence data stream to be synchronized.
The invention provides an electronic device, which comprises a memory, a processor and a computer program stored in the memory and capable of running on the processor, wherein the processor realizes the steps of the data synchronization method of the rail transit signal system when executing the program.
The present invention provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the rail transit signal system data synchronization method.
The present invention provides a computer program product comprising a computer program which when executed by a processor implements the steps of the rail transit signal system data synchronization method.
According to the method, the device, the equipment and the storage medium for synchronizing the data of the rail transit signal system, the data to be synchronized is stored in the time sequence data stream in the node memory, so that other nodes can synchronize, and under the condition that the first preset condition is met, the state data of all equipment is written in the time sequence data stream, so that the data redundancy transmission is reduced, the synchronized data is cached in the memory, and the real-time performance of the data synchronization is ensured.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Fig. 1 is a schematic flow chart of a data synchronization method of a track traffic signal system according to an embodiment of the present invention, as shown in fig. 1, the method includes the following steps:
And 100, under the condition that a first preset condition is met, the first node acquires state information of all the station equipment and trains and generates all the equipment state data, wherein the all the equipment state data comprises all the information and a first all the information Identity (ID).
Optionally, in the rail traffic signal system, each station may be a node, and the data center may also be a node, where data synchronization is performed between the nodes. The first node may be any node in a rail traffic signal system. It will be appreciated that the first node may be either the primary or the synchronized party to the data. In this embodiment, the first node as the synchronized party of the data stores the data into the time sequence data stream of the local memory of the first node, so that other nodes as the master synchronization party of the data can perform data synchronization.
And under the condition that the first preset condition is met, the first node acquires the state information of all the station equipment and trains and generates all the equipment state data. The corporate device status data includes corporate information and a first corporate information identity (Identity document, ID).
It should be noted that, the generated overall device state data is written as one piece of data into the time sequence data stream of the local memory of the first node for reading by other nodes, and the time sequence data stream contains a plurality of pieces of data, and each piece of data adopts a format of id+msg. It will be appreciated that the identity of the first global information in the global device state data is ID and the global information in the global device state data is Msg. Msg is specific data content, is formed by combining Key-value Key value pairs, and is a unique identifier of equipment or train attribute, and value is a corresponding value of the Key.
Step 101, writing the whole equipment state data into a time sequence data stream of a local memory of the first node, wherein the time sequence data stream is used for data synchronization of other nodes.
Optionally, the ID of the data in the time-series data stream is a sequence increasing with the writing time of the data, the first global information ID in the global device state data needs to be generated based on the current maximum ID in the time-series data stream, for example, the ID of the data in the time-series data stream is an arithmetic progression with a tolerance of 1, and the ID of the currently written data is 100 at the maximum, and then the ID of the global device state data written at this time is 101, that is, the first global information ID is 101.
Step 102, 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.
Alternatively, since other nodes cannot directly recognize that data in the time-series data stream is the overall device state data when synchronizing the data in the time-series data stream of the first node, it is necessary to record the ID of the data, that is, the first overall information ID, and update the second overall information ID based on the first overall information ID when newly generating the overall device state data.
For example, if the first overall information ID in the overall device status data is 101, the second overall information ID is updated to 101.
When other nodes synchronize the data of the first node, the other nodes find whether the second global information ID exists in the time sequence data stream, if not, the first node sends a message indicating that the first node updates the global equipment state data in the time sequence data stream, and after receiving the message, the first node regenerates the global equipment state data and stores the generated global equipment state data in the time sequence data stream, and updates the second global information ID.
According to the embodiment of the invention, the data to be synchronized is stored in the time sequence data stream in the node memory for other nodes to synchronize, and the whole equipment state data is written in the time sequence data stream under the condition that the first preset condition is met, so that the data redundancy transmission is reduced, the synchronized data is cached in the memory, and the real-time performance of the data synchronization is ensured.
In one embodiment, the first preset condition includes:
The first node receives a whole request sent by other nodes, wherein the whole request is used for indicating the first node to update whole equipment state data in the time sequence data stream;
Or in case of the first node being started, determining that the second ensemble information ID does not exist in the time-series data stream.
Optionally, when the other nodes act as a master synchronization party of the data to synchronize the data of the first node, when the total equipment state data in the time sequence data stream of the local memory of the first node cannot be acquired, the total information is sent to the first node, and when the total information is received by the first node, the first node acquires the state information of the total station equipment and the train and generates the total equipment state data. In addition, when the first node is started, it is determined whether or not there is data having the same ID as the second overall information ID in the time-series data stream, that is, whether or not there is the second overall information ID in the time-series data stream, and when it is determined that there is no second overall information ID in the time-series data stream, the first node acquires the status information of all the station equipment and trains, and generates overall equipment status data.
In the embodiment of the invention, when the first node receives the whole requests sent by other nodes or the first node is started, and the second whole information ID does not exist in the time sequence data stream, the first node acquires the state information of the whole station equipment and the train and generates the whole equipment state data, thereby reducing the data redundancy transmission, buffering the synchronous data in the memory and ensuring the real-time performance of the data synchronization.
In one embodiment, the method for synchronizing data of the track traffic signal system further includes writing the change information into a time sequence data stream of the local memory of the first node. Fig. 2 is a schematic flow chart of a time sequence data stream for writing change information into the local memory of the first node according to an embodiment of the present invention, as shown in fig. 2, the time sequence data stream for writing change information into the local memory of the first node includes the following sub-steps:
And 200, performing change detection based on the cache data of the first node, and determining information to be synchronized based on the result of the change detection.
Step 201, generating change data based on the information to be synchronized, and writing the change data into a time sequence data stream of the local memory of the first node, wherein the change data comprises change information and change information ID.
Optionally, the time sequence data stream of the local memory of the first node includes not only the whole equipment state data but also the change data. The change data includes change information and change information ID.
For example, the time sequence data stream includes 4 pieces of data, a first piece of data is overall device state data, wherein the first overall information ID is 1, the overall information includes state information a of device A, state information B of device B, state information C of device C, and state information D of device D, a second piece of data is change data, wherein the change ID of the second piece of data is 2, the change information is change information Δa of device A, a third piece of data is change data, wherein the change ID of the third piece of data is 3, the change information is change information Δb of device B, and a fourth piece of data is change data, wherein the change ID of the fourth piece of data is 4, and the change information is change information Δc of device C.
The state information of the station equipment and the train is stored in the cache data of the first node, the state change information of the station equipment and the train can be determined based on the change detection of the cache data of the first node, and the information in the time sequence data stream which needs to be stored in the memory of the first node, namely the information to be synchronized, is determined according to the change information. And generating change data based on the information to be synchronized, writing the change data into a time sequence data stream of the local memory of the first node, and changing the change information ID in the change data. The frequency of the change detection of the first node can be configured according to requirements, so that the flexibility of the data synchronization of the rail traffic signal system is improved.
According to the embodiment of the invention, the first node determines the information to be synchronized through the change detection, generates the change data based on the synchronization information, and stores the change data into the time sequence data stream, so that the redundant transmission of data is reduced, the synchronization data is cached in the memory, and the real-time performance of data synchronization is ensured.
In one embodiment, the track traffic signal system data synchronization method further includes:
Responding to a whole cache data request sent by a standby machine of the first node, and packaging and sending whole data to the standby machine;
and performing change detection based on the cache data of the first node, determining change cache information based on the result of the change detection, and sending the change cache information to the standby machine.
Optionally, the node cache adopts a redundant backup mechanism, and when the slave node starts, a whole cache data request is sent to the host node. It can be understood that the first node is a master node, and after receiving a total cache data request sent by the standby machine, the first node packages and sends the total data to the standby machine, wherein the total data is all data of the first node, and includes queue data in a time sequence data stream. And after the standby machine receives the whole data, the standby machine stores the change cache information.
In addition, the node cache adopts a mode of full synchronization and incremental synchronization, and the incremental synchronization process comprises the steps that a first node performs change detection based on cache data of the node, and determines change cache information based on a result of the change detection, for example, the first node performs write operation, the write operation generates change cache information, and the change cache information is sent to the standby machine. And after the standby machine receives the change cache information, the change cache information is stored and updated to cache data of the standby machine.
In the embodiment of the invention, the cache data is backed up in real time by adopting a mode of combining full synchronization with incremental synchronization between the master node and the slave node. And after the full-volume synchronization is finished, performing incremental synchronization, and synchronizing the change cache information of the master node into the slave node. And a main and standby redundancy mechanism is adopted to ensure the reliability of data synchronization.
Fig. 3 is a second flowchart of a data synchronization method of a track traffic signal system according to an embodiment of the present invention, as shown in fig. 1, the method includes the following steps:
And 300, determining a time sequence data stream to be synchronized according to synchronization configuration information under the condition that a first node is started or fails to recover, wherein the synchronization configuration information is used for indicating synchronization data of the first node.
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 is the primary synchronization party.
And when the first node is started or fails to recover, determining the time sequence data stream to be synchronized according to the synchronization configuration information.
Step 301, determining whether a second global information ID exists in the time sequence data stream to be synchronized.
Optionally, the second global information ID is used to record the latest first global information ID in the time-series data stream to be synchronized.
The first node searches whether the second whole information ID exists in the time sequence data stream to be synchronized, and if the second whole information ID exists, the first node searches whether the second whole information ID exists in the time sequence data stream to be synchronized.
Step 302, in the case that there is a second global information ID in the time-series data stream to be synchronized, the first node synchronizes global device state data corresponding to the second global information ID and change data after the second global information ID, or
And under the condition that the second whole message ID does not exist in the time sequence data stream to be synchronized, the first node sends a whole request to the node corresponding to the time sequence data stream to be synchronized.
Optionally, in the case that the second global information ID exists in the time-series data stream to be synchronized, the current device state data may be determined according to the global device state data corresponding to the second global information ID and the change data after the second global information ID by the first node, so that the first node synchronizes the global device state data corresponding to the second global information ID and the change data after the second global information ID.
When the second total message ID does not exist in the time sequence data stream to be synchronized, the first node cannot perform data synchronization at this time, and therefore, a total request is sent to the node corresponding to the time sequence data stream to be synchronized, where the total request is used to instruct the node corresponding to the time sequence data stream to update the total device state data in the time sequence data stream. And after receiving the total request, the node corresponding to the time sequence data stream to be synchronized generates total state data and stores the total state data into the time sequence data stream to be synchronized so as to enable the first node to perform data synchronization.
In the embodiment of the invention, under the condition that the first node is started or fails to recover, the time sequence data stream to be synchronized is determined according to the synchronization configuration information, and a whole request is sent to the node corresponding to the time sequence data stream to be synchronized under the condition that the second whole information ID does not exist in the time sequence data stream to be synchronized, and under the condition that the second whole information ID exists in the time sequence data stream to be synchronized. And synchronizing the whole equipment state data corresponding to the second whole information ID and the change data after the second whole information ID, so that the data redundancy transmission is reduced, and the synchronous data is cached in the memory, thereby ensuring the real-time performance of data synchronization.
In one embodiment, the track traffic signal system data synchronization method further includes:
Determining unconsumed data in the time sequence data stream to be synchronized according to the queue offset of the time sequence data stream to be synchronized;
And synchronizing the unconsumed data.
Optionally, when there is a new increase in data in the time-series data stream to be synchronized, the queue of the time-series data stream will shift, and the first node serves as a master synchronization party to detect the shift of the queue of the time-series data stream to be synchronized, determine the newly increased data, i.e. the unconsumed data, and synchronize the unconsumed data.
According to the embodiment of the invention, the first node determines the unconsumed data according to the queue offset, and does not need to synchronize all data in the time sequence data stream, so that redundant data transmission is reduced, synchronous data is cached in the memory, and the real-time performance of data synchronization is ensured.
In one embodiment, the track traffic signal system data synchronization method further includes:
Responding to a whole cache data request sent by a standby machine of the first node, and packaging and sending whole data to the standby machine;
and performing change detection based on the cache data of the first node, determining change cache information based on the result of the change detection, and sending the change cache information to the standby machine.
Optionally, the node cache adopts a redundant backup mechanism, and when the slave node starts, a whole cache data request is sent to the host node. It can be understood that the first node is a master node, and after receiving a total cache data request sent by the standby machine, the first node packages and sends the total data to the standby machine, wherein the total data is all data of the first node, and includes queue data in a time sequence data stream. And after the standby machine receives the whole data, the standby machine stores the change cache information.
In addition, the node cache adopts a mode of full synchronization and incremental synchronization, and the incremental synchronization process comprises the steps that a first node performs change detection based on cache data of the node, and determines change cache information based on a result of the change detection, for example, the first node performs write operation, the write operation generates change cache information, and the change cache information is sent to the standby machine. And after the standby machine receives the change cache information, the change cache information is stored and updated to cache data of the standby machine.
In the embodiment of the invention, the cache data is backed up in real time by adopting a mode of combining full synchronization with incremental synchronization between the master node and the slave node. And after the full-volume synchronization is finished, performing incremental synchronization, and synchronizing the change cache information of the master node into the slave node. And a main and standby redundancy mechanism is adopted to ensure the reliability of data synchronization.
The track traffic signal system data synchronization device provided by the invention is described below, and the track traffic signal system data synchronization device described below and the track traffic signal system data synchronization method described above can be correspondingly referred to each other.
Fig. 4 is a schematic structural diagram of a data synchronization device of a rail transit signal system according to an embodiment of the present invention, and as shown in fig. 4, the device includes a global device status data generating module 410, a data writing module 420 and an ID updating module 430, wherein,
The overall equipment state data generating module 410 is configured to, when a first preset condition is met, obtain state information of overall station equipment and trains by the first node, and generate overall equipment state data, where the overall equipment state data includes overall information and a first overall information identity ID;
a data writing module 420, configured to write the overall device state data into a time-series data stream of the local memory of the first node, where the time-series data stream is used for data synchronization by other nodes;
the ID updating module 430 is configured to update a second global information ID according to the first global information ID, where the second global information ID is used to record the latest first global information ID.
Optionally, the first preset condition includes:
The first node receives a whole request sent by other nodes, wherein the whole request is used for indicating the first node to update whole equipment state data in the time sequence data stream;
Or in case of the first node being started, determining that the second ensemble information ID does not exist in the time-series data stream.
Optionally, the data synchronization device of the rail traffic signal system further comprises a change information synchronization module, configured to:
Performing change detection based on the cache data of the first node, and determining information to be synchronized based on the result of the change detection;
And generating change data based on the information to be synchronized, and writing the change data into a time sequence data stream of the local memory of the first node, wherein the change data comprises change information and change information ID.
Optionally, the data synchronization device of the rail traffic signal system further comprises a backup module, configured to:
Responding to a whole cache data request sent by a standby machine of the first node, and packaging and sending whole data to the standby machine;
and performing change detection based on the cache data of the first node, determining change cache information based on the result of the change detection, and sending the change cache information to the standby machine.
The data synchronization device of the rail transit signal system provided by the invention can realize each process realized by the method embodiments of fig. 1 to 2 and achieve the same technical effects, and in order to avoid repetition, the description is omitted here.
Fig. 5 is a second schematic structural diagram of a data synchronization device of a track traffic signal system according to an embodiment of the present invention, as shown in fig. 5, the device includes a timing data stream determining module 510 to be synchronized, an ID determining module 520, and a data synchronizing module 530, where,
A to-be-synchronized time-series data stream determining module 510, configured to determine a to-be-synchronized time-series data stream according to synchronization configuration information when a first node is started or fails to recover, where the synchronization configuration information is used to indicate synchronization data of the first node;
An ID determining module 520, configured to determine whether a second global information ID exists in the time-series data stream to be synchronized;
A data synchronization module 530 for synchronizing, in the case where a second global information ID exists in the time-series data stream to be synchronized, global device state data corresponding to the second global information ID and change data after the second global information ID, or
And under the condition that the second whole message ID does not exist in the time sequence data stream to be synchronized, the first node sends a whole request to the node corresponding to the time sequence data stream to be synchronized.
Optionally, the data synchronization device of the rail traffic signal system further comprises an unconsumed data synchronization module, configured to:
Determining unconsumed data in the time sequence data stream to be synchronized according to the queue offset of the time sequence data stream to be synchronized;
And synchronizing the unconsumed data.
Optionally, the data synchronization device of the rail traffic signal system further comprises a backup module, configured to:
Responding to a whole cache data request sent by a standby machine of the first node, and packaging and sending whole data to the standby machine;
and performing change detection based on the cache data of the first node, determining change cache information based on the result of the change detection, and sending the change cache information to the standby machine.
The data synchronization device of the rail transit signal system provided by the invention can realize each process realized by the method embodiment of fig. 3 and achieve the same technical effect, and in order to avoid repetition, the description is omitted here.
Fig. 6 illustrates a physical schematic diagram of an electronic device, which may include a processor 610, a communication interface Communications Interface, a memory 630, and a communication bus 640, as shown in fig. 6, where the processor 610, the communication interface 620, and the memory 630 communicate with each other via the communication bus 640. The processor 610 may invoke logic instructions in the memory 630 to perform a rail transit signal system data synchronization method comprising:
Under the condition that a first preset condition is met, the first node acquires state information of all station equipment and trains and generates all equipment state data, wherein the all equipment state data comprises all information and a first all information Identity (ID);
Writing the whole equipment state data into a time sequence data stream of a local memory of the first node, wherein the time sequence data stream is used for data synchronization of other nodes;
And 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.
Or comprises:
determining a time sequence data stream to be synchronized according to synchronization configuration information under the condition that a first node is started or fails to recover, wherein the synchronization configuration information is used for indicating synchronization data of the first node;
determining whether a second overall information ID exists in the time sequence data stream to be synchronized;
in the case that a second global information ID exists in the time sequence data stream to be synchronized, the first node synchronizes the global equipment state data corresponding to the second global information ID and the change data after the second global information ID, or
And under the condition that the second whole message ID does not exist in the time sequence data stream to be synchronized, the first node sends a whole request to the node corresponding to the time sequence data stream to be synchronized.
Further, the logic instructions in the memory 630 may be implemented in the form of software functional units and stored in a computer-readable storage medium when sold or used as a stand-alone product. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. The storage medium includes a U disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, an optical disk, or other various media capable of storing program codes.
In another aspect, the present invention also provides a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, enable the computer to perform a method of synchronizing rail transit signal system data provided by the above methods, the method comprising:
Under the condition that a first preset condition is met, the first node acquires state information of all station equipment and trains and generates all equipment state data, wherein the all equipment state data comprises all information and a first all information Identity (ID);
Writing the whole equipment state data into a time sequence data stream of a local memory of the first node, wherein the time sequence data stream is used for data synchronization of other nodes;
And 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.
Or comprises:
determining a time sequence data stream to be synchronized according to synchronization configuration information under the condition that a first node is started or fails to recover, wherein the synchronization configuration information is used for indicating synchronization data of the first node;
determining whether a second overall information ID exists in the time sequence data stream to be synchronized;
in the case that a second global information ID exists in the time sequence data stream to be synchronized, the first node synchronizes the global equipment state data corresponding to the second global information ID and the change data after the second global information ID, or
And under the condition that the second whole message ID does not exist in the time sequence data stream to be synchronized, the first node sends a whole request to the node corresponding to the time sequence data stream to be synchronized.
In yet another aspect, the present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, is implemented to perform the above-provided rail traffic signal system data synchronization methods, the method comprising:
Under the condition that a first preset condition is met, the first node acquires state information of all station equipment and trains and generates all equipment state data, wherein the all equipment state data comprises all information and a first all information Identity (ID);
Writing the whole equipment state data into a time sequence data stream of a local memory of the first node, wherein the time sequence data stream is used for data synchronization of other nodes;
And 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.
Or comprises:
determining a time sequence data stream to be synchronized according to synchronization configuration information under the condition that a first node is started or fails to recover, wherein the synchronization configuration information is used for indicating synchronization data of the first node;
determining whether a second overall information ID exists in the time sequence data stream to be synchronized;
in the case that a second global information ID exists in the time sequence data stream to be synchronized, the first node synchronizes the global equipment state data corresponding to the second global information ID and the change data after the second global information ID, or
And under the condition that the second whole message ID does not exist in the time sequence data stream to be synchronized, the first node sends a whole request to the node corresponding to the time sequence data stream to be synchronized.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
It should be noted that the above-mentioned embodiments are merely for illustrating the technical solution of the present invention, and not for limiting the same, and although the present invention has been described in detail with reference to the above-mentioned embodiments, it should be understood by those skilled in the art that the technical solution described in the above-mentioned embodiments may be modified or some technical features may be equivalently replaced, and these modifications or substitutions do not make the essence of the corresponding technical solution deviate from the spirit and scope of the technical solution of the embodiments of the present invention.