Train actual operation diagram data storage method and device

By uniformly numbering the actual operation diagram data of the train and separating the task of local cache files from the database, the problem of low storage efficiency of the actual operation diagram data of the train is solved, and efficient data storage and transmission are achieved.

CN113918742BActive Publication Date: 2025-03-21TRAFFIC CONTROL TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111152630.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-29
Publication Date
2025-03-21
Estimated Expiration
2041-09-29

AI Technical Summary

Technical Problem

The actual operation diagram data storage efficiency of the train is too low, resulting in serious lag in the reception of actual operation diagram data of the ATS operation workstation.

Method used

The main application server initializes the maximum serial number of the first historical actual operation graph data, obtains the initial serial number, receives the target actual operation graph data sent by the station extension, and numbers it based on the initial serial number, and stores it in the local cache file. The main application server obtains the actual running graph data that has not been uploaded based on the database and uploads it to the database to realize task separation and improve data forwarding efficiency.

Benefits of technology

It improves the storage efficiency of actual operation graph data, avoids the need to repeatedly query the serial number before inserting the database, and ensures the integrity of the data in database failure or cross-operation cycle scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113918742B_ABST
    Figure CN113918742B_ABST
Patent Text Reader

Abstract

The present invention provides a method and device for storing train actual operation diagram data, the method comprising: the main application server initializes the maximum sequence number to obtain an initial sequence number; the main application server receives the target actual operation diagram data sent by the station extension, numbers the target actual operation diagram data based on the initial sequence number, obtains and stores the numbered target actual operation diagram data in a first local cache file; the main application server obtains the actual operation diagram data that has not been uploaded in the first local cache file based on the database; and uploads the actual operation diagram data that has not been uploaded to the database. The present invention realizes the separation of the task of forwarding the actual operation diagram to the local cache file and the task of uploading to the database, improves the efficiency of forwarding the actual operation diagram data, greatly improves the storage efficiency of the actual operation diagram data, and ensures the integrity of the actual operation diagram data in the scenario of database failure and cross-operation cycle.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of rail transit technology, and in particular to a method and device for storing data of an actual train operation diagram. Background Art

[0002] When a train enters or leaves a station, the station extension of the Automatic Train Supervision (ATS) system generates actual operation diagram data of the train and sends the actual operation diagram data of the train to the application server of the ATS system. The actual operation diagram data processing thread of the application server periodically receives and sends the actual operation diagram data of the train to the operation workstation of the ATS system, and stores the actual operation diagram data of the train in the database.

[0003] In the related art, in order to solve the problem that the actual operation diagram data of the train is out of order in time due to the jump of the source time of the clock or the jump of the calibration time, all the actual operation diagram data of the same train are numbered in sequence according to the order of insertion into the database, and the number is used as the serial number of the actual operation diagram of the train. Before each actual operation diagram data of the train is inserted into the database, it is necessary to query the maximum serial number of the actual operation diagram of the train, and add 1 to the maximum serial number as the serial number of the actual operation diagram data of the train to be inserted into the database. This query method of traversing the actual operation diagram is inefficient. Furthermore, because the multiple tasks of receiving, saving, forwarding and uploading the actual operation diagram to the database are all processed by a single thread of the application server, when a large amount of actual operation diagram data is processed, it will cause the ATS operation workstation (hereinafter referred to as the operation workstation) to receive the actual operation diagram data seriously delayed.

[0004] Therefore, the problem of low storage efficiency of actual train operation diagram data in related technologies needs to be solved urgently. Summary of the invention

[0005] The present invention provides a method and device for storing data of an actual train operation diagram, so as to solve the problem that the data of the actual train operation diagram is too inefficient.

[0006] In a first aspect, the present invention provides a method for storing data of an actual train operation diagram, comprising:

[0007] The main application server obtains the maximum sequence number of the first historical actual operation diagram data within the operation period based on the first local cache file and the database, and initializes the maximum sequence number of the first historical actual operation diagram data to obtain an initial sequence number;

[0008] The main application server receives the target actual operation diagram data sent by the station extension, numbers the target actual operation diagram data based on the initial sequence number to obtain the numbered target actual operation diagram data, and stores the numbered target actual operation diagram data in the first local cache file;

[0009] The main application server obtains the maximum sequence number of the second historical actual operation diagram data within the operation period based on the database, and obtains the actual operation diagram data not uploaded in the first local cache file based on the maximum sequence number of the second historical actual operation diagram data;

[0010] The main application server uploads the actual operation diagram data that has not been uploaded to the database;

[0011] The first local cache file is a local cache file of the main application server within the operation period.

[0012] Optionally, the acquiring the actual operation diagram data that has not been uploaded in the first local cache file based on the maximum sequence number of the second historical actual operation diagram data specifically includes:

[0013] The main application server obtains the third historical actual operation diagram data corresponding to the maximum sequence number of the second historical actual operation diagram data in the first local cache file;

[0014] The main application server acquires the actual operation diagram data not uploaded in the first local cache file based on the third historical actual operation diagram data;

[0015] The actual operation diagram data that has not been uploaded is all the actual operation diagram data after the third historical actual operation diagram data in the first local cache file.

[0016] Optionally, the initializing the maximum sequence number of the first historical actual operation diagram data to obtain an initial sequence number specifically includes:

[0017] The main application server sums the maximum sequence number of the first historical actual operation diagram data and a preset threshold to obtain an initial sequence number.

[0018] Optionally, after obtaining the initial sequence number, the method further includes:

[0019] The primary application server sends a sequence number synchronization message of the historical actual operation diagram data in the first local cache file to the backup application server.

[0020] Optionally, after uploading the actual operation diagram data that has not been uploaded to the database, the method further includes:

[0021] The primary application server sends a serial number synchronization message of the uploaded actual operation diagram data to the backup application server within a preset period.

[0022] Optionally, before the main application server obtains the maximum sequence number of the first historical actual operation diagram data within the operation cycle based on the first local cache file and the database, it also includes:

[0023] When an abnormality occurs in the main application server, the backup application server is upgraded to the main application server;

[0024] Alternatively, when the primary application server does not exist, the backup application server is upgraded to the primary application server.

[0025] In a second aspect, the present invention provides a data storage device for an actual train operation diagram, comprising:

[0026] A sequence number initialization unit, configured for the main application server to obtain the maximum sequence number of the first historical actual operation diagram data within the operation cycle based on the first local cache file and the database, and to initialize the maximum sequence number of the first historical actual operation diagram data to obtain an initial sequence number;

[0027] A data storage unit, configured for the main application server to receive the target actual operation diagram data sent by the station extension, number the target actual operation diagram data based on the initial sequence number to obtain the numbered target actual operation diagram data, and store the numbered target actual operation diagram data in the first local cache file;

[0028] A data acquisition unit, configured for the main application server to acquire the maximum sequence number of the second historical actual operation diagram data within the operation period based on the database, and to acquire the actual operation diagram data not uploaded in the first local cache file based on the maximum sequence number of the second historical actual operation diagram data;

[0029] A data uploading unit, used for the main application server to upload the actual operation diagram data that has not been uploaded to the database;

[0030] The first local cache file is a local cache file of the main application server within the operation period.

[0031] Optionally, the data acquisition unit specifically includes:

[0032] A first acquisition subunit is used for the main application server to acquire the third historical actual operation diagram data corresponding to the maximum sequence number of the second historical actual operation diagram data in the first local cache file;

[0033] A second acquisition subunit is used for the main application server to acquire the actual operation diagram data that is not uploaded in the first local cache file based on the third historical actual operation diagram data;

[0034] The actual operation diagram data that has not been uploaded is all the actual operation diagram data after the third historical actual operation diagram data in the first local cache file.

[0035] In a third aspect, the present invention further provides 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 method for storing actual train operation diagram data as described in the first aspect are implemented.

[0036] In a fourth aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method for storing actual train operation diagram data as described in the first aspect.

[0037] The train actual operation diagram data storage method and device provided by the present invention initialize the maximum serial number of the first historical actual operation diagram data through the main application server to obtain the initial serial number, receive the target actual operation diagram data sent by the station extension, number the target actual operation diagram data based on the initial serial number, obtain and store the numbered target actual operation diagram data in the first local cache file, the main application server obtains the actual operation diagram data that has not been uploaded in the first local cache file based on the database, uploads the actual operation diagram data that has not been uploaded to the database, realizes the separation of the task of forwarding the actual operation diagram to the local cache file and the task of uploading to the database, improves the efficiency of forwarding the actual operation diagram data, and uniformly numbers the actual operation diagram data, so that there is no need to repeatedly query the serial number before the actual operation diagram data is inserted into the database each time, greatly improves the storage efficiency of the actual operation diagram data, and ensures the integrity of the actual operation diagram data in the scenario of database failure and across operation cycles. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. 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.

[0039] Figure 1 It is a schematic diagram of the flow of the method for storing data of the actual train operation diagram provided by the present invention;

[0040] Figure 2It is a timing diagram of forwarding actual train operation diagram data to a local cache file provided by the present invention;

[0041] Figure 3 It is a timing diagram for uploading the actual train operation diagram data to the database provided by the present invention;

[0042] Figure 4 It is a structural schematic diagram of the data storage device for the actual train operation diagram provided by the present invention;

[0043] Figure 5 This is a schematic structural diagram of an electronic device provided by the present invention. DETAILED DESCRIPTION

[0044] 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.

[0045] In order to solve the problem of low efficiency in storing data of the actual operation diagram of a train, an embodiment of the present invention provides a method for storing data of the actual operation diagram of a train. Figure 1 FIG. 1 is a flow chart of a method for storing actual train operation diagram data provided by an embodiment of the present invention. Figure 1 As shown, the method comprises the following steps:

[0046] Step 100: The main application server obtains the maximum sequence number of the first historical actual operation diagram data within the operation cycle based on the first local cache file and the database, initializes the maximum sequence number of the first historical actual operation diagram data, and obtains an initial sequence number.

[0047] It should be noted that the main application server separates the single actual operation diagram data processing thread in the prior art into a thread for receiving and forwarding the actual operation diagram data to the local cache thread and a thread for uploading the actual operation diagram data to the database. This processing method enables the operating workstation to display the actual operation diagram in real time, effectively improving the forwarding efficiency of the actual operation diagram data.

[0048] It should be noted that the main application server improves the technical solution of numbering the actual operation diagram data of a single train in the prior art to uniformly numbering the actual operation diagram data of all trains, and there is no need to repeatedly query the serial number each time the actual operation diagram data is inserted into the database, which can greatly improve the storage efficiency of the actual operation diagram data.

[0049] The first local cache file is a local cache file of the main application server within the operation cycle.

[0050] The operation cycle is the periodic operation time of the train in the station. For example, the operation cycle is from 4:00 a.m. of the current day to 4:00 a.m. of the next day.

[0051] Among them, if the operation cycle is exceeded, the serial number of the actual operation diagram data is initialized to 0.

[0052] The first local cache file stores actual operation diagram data of all trains in the operation cycle.

[0053] It should be noted that there is a one-to-one correspondence between the first local cache file and the operation cycle, and different first local cache files store actual operation diagram data of all trains in different operation cycles.

[0054] The database stores the actual operation diagram data of all trains in all operation cycles.

[0055] The first historical actual operation diagram data is the historical actual operation diagram data of all trains in the operation cycle in the first local cache file and the database.

[0056] It should be noted that due to the low data transmission efficiency in the current communication network, there may be inconsistency in the amount of historical actual operation diagram data in the local cache files corresponding to different application servers. After the application server is upgraded to the main application server, the amount of actual operation diagram data in the first local cache file of the main application server may be smaller than the amount of actual operation diagram data in the database during the operation cycle. Therefore, it is necessary to obtain the maximum serial number of the first historical actual operation diagram data within the operation cycle from the first local cache file and the database at the same time, so as to avoid repeated uploading of the actual operation diagram data when the amount of actual operation diagram data in the first local cache file is smaller than the amount of actual operation diagram data in the database during the operation cycle, resulting in reduced storage efficiency of the actual operation diagram data.

[0057] In one implementation, after the application server is started, it is upgraded to the main application server. The main application server uses the actual operation diagram data to receive and forward it to the local cache thread, obtains the maximum serial number of the first historical actual operation diagram data within the operation cycle from the first local cache file and database, and initializes the maximum serial number of the first historical actual operation diagram data to obtain an initial serial number.

[0058] Step 101: The main application server receives target actual operation diagram data sent by the station extension, numbers the target actual operation diagram data based on the initial sequence number to obtain the numbered target actual operation diagram data, and stores the numbered target actual operation diagram data to the first local cache file.

[0059] In one implementation, numbering the target actual operation diagram data based on the initial sequence number specifically includes:

[0060] The main application server numbers each received target actual operation diagram data in ascending order starting from the initial sequence number according to the order in which the target actual operation diagram data is received.

[0061] For example, the initial sequence number is N, the sequence number of the first target actual operation diagram data received is N+1, and the sequence number of the second target actual operation diagram data is N+2.

[0062] It should be noted that in order to solve the problem of loss of actual operation diagram data that has not been uploaded due to database failure and across operation cycles, the embodiment of the present invention adds a fault persistence storage mechanism.

[0063] Among them, the fault persistence storage mechanism is to store the numbered target actual operation diagram data in JS object notation (JavaScript Object Notation, JSON) format in the first local cache file for persistent storage.

[0064] In one implementation, the main application server forwards the target actual operation diagram data to the local cache thread, receives the target actual operation diagram data sent by the station extension, and numbers each received target actual operation diagram data in ascending order starting from the initial serial number in the order in which the target actual operation diagram data is received, obtains the numbered target actual operation diagram data, and stores the numbered target actual operation diagram data in JSON format to the first local cache file for persistent storage.

[0065] Furthermore, the main application server forwards the numbered target actual operation diagram data to the operation workstation, and the operation workstation displays the numbered target actual operation diagram data in real time.

[0066] Step 102: The main application server obtains the maximum sequence number of the second historical actual operation diagram data within the operation cycle based on the database, and obtains the actual operation diagram data that has not been uploaded in the first local cache file based on the maximum sequence number of the second historical actual operation diagram data.

[0067] The second historical actual operation diagram data is the historical actual operation diagram data of all trains in the operation cycle in the database.

[0068] Optionally, the acquiring the actual operation diagram data that has not been uploaded in the first local cache file based on the maximum sequence number of the second historical actual operation diagram data specifically includes:

[0069] The main application server obtains the third historical actual operation diagram data corresponding to the maximum sequence number of the second historical actual operation diagram data in the first local cache file;

[0070] The main application server obtains the actual operation diagram data that has not been uploaded in the first local cache file based on the third historical actual operation diagram data.

[0071] It should be noted that, when the main application server obtains the maximum serial number of the first historical actual operation diagram data within the operation cycle based on the first local cache file and the database, if the maximum serial number of the first historical actual operation diagram data is the serial number of the actual operation diagram data in the first local cache file, indicating that the amount of historical actual operation diagram data in the first local cache file is greater than the amount of historical actual operation diagram data in the operation cycle in the database, then the step of the main application server obtaining the third historical actual operation diagram data corresponding to the maximum serial number of the second historical actual operation diagram data in the first local cache file is executed.

[0072] If the maximum serial number of the first historical actual operation diagram data is the serial number of the actual operation diagram data within the operation cycle in the database, indicating that the amount of historical actual operation diagram data in the first local cache file is less than the amount of historical actual operation diagram data within the operation cycle in the database, the step of the main application server obtaining the third historical actual operation diagram data corresponding to the maximum serial number of the second historical actual operation diagram data in the first local cache file is not executed, and the main application server directly uploads the received target actual operation diagram data to the database.

[0073] It should be noted that, according to the maximum serial number of the second historical actual operation diagram data in the database, the third historical actual operation diagram data corresponding to the maximum serial number in the first local cache file is obtained, indicating that the third historical actual operation diagram data is the resumed upload location of the actual operation diagram data uploaded from the first local cache file to the database.

[0074] The actual operation diagram data that have not been uploaded are all the actual operation diagram data after the third historical actual operation diagram data in the first local cache file.

[0075] In one implementation, the main application server uses the actual operation diagram data to upload to the database thread, obtains the maximum serial number of the second historical actual operation diagram data within the operation cycle from the database, and obtains the third historical actual operation diagram data corresponding to the maximum serial number of the second historical actual operation diagram data in the first local cache file, wherein all actual operation diagram data after the third historical actual operation diagram data are actual operation diagram data that have not been uploaded.

[0076] Step 103: The main application server uploads the actual operation diagram data that has not been uploaded to the database.

[0077] In one implementation, the main application server uses the actual operation diagram data to upload to the database thread, batch reads the actual operation diagram data that has not been uploaded, and uploads the actual operation diagram data that has not been uploaded to the database. If the upload is successful, the upload progress of the actual operation diagram data is updated. If the upload fails, it is uploaded again in the next cycle of the upload database thread.

[0078] The train actual operation diagram data storage method provided by the embodiment of the present invention initializes the maximum serial number of the first historical actual operation diagram data through the main application server to obtain the initial serial number, receives the target actual operation diagram data sent by the station extension, and numbers the target actual operation diagram data based on the initial serial number to obtain and store the numbered target actual operation diagram data in the first local cache file. The main application server obtains the actual operation diagram data that has not been uploaded in the first local cache file based on the database, and uploads the actual operation diagram data that has not been uploaded to the database, thereby realizing the separation of the task of forwarding the actual operation diagram to the local cache file and the task of uploading it to the database, improving the efficiency of forwarding the actual operation diagram data, and uniformly numbering the actual operation diagram data, so that there is no need to repeatedly query the serial number before the actual operation diagram data is inserted into the database each time, which greatly improves the storage efficiency of the actual operation diagram data and ensures the integrity of the actual operation diagram data in the scenario of database failure and across operation cycles.

[0079] Based on the content of the above embodiment, the initialization processing of the maximum sequence number of the first historical actual operation diagram data to obtain the initial sequence number specifically includes:

[0080] The main application server sums the maximum sequence number of the first historical actual operation diagram data and a preset threshold to obtain an initial sequence number.

[0081] It should be noted that initializing the maximum serial number of the first historical actual operation diagram data can effectively ensure that the actual operation diagram data of all trains in the operation cycle can be numbered in a unified manner, and the serial number of each actual operation diagram data is different.

[0082] In one implementation, the main application server obtains the maximum sequence number in the first historical actual operation diagram data, sums the maximum sequence number with a preset threshold, and obtains an initial sequence number. For example, the preset threshold is 200,000.

[0083] In the method for storing actual train operation diagram data provided by an embodiment of the present invention, a main application server obtains the maximum sequence number in the first historical actual operation diagram data, sums the maximum sequence number with a preset threshold, and obtains an initial sequence number, thereby realizing unified numbering management of the actual operation diagram data, thereby making it unnecessary to query the sequence number before the actual operation diagram data is inserted into the database each time, thereby greatly improving the storage efficiency of the actual operation diagram data.

[0084] Based on the content of the above embodiment, after obtaining the initial sequence number, the method further includes:

[0085] The primary application server sends a sequence number synchronization message of the historical actual operation diagram data in the first local cache file to the backup application server.

[0086] Optionally, the standby application server updates the serial number of the historical actual operation diagram data in the second local cache file based on the serial number synchronization message.

[0087] It should be noted that the primary application server sends the serial number synchronization message of the historical actual operation diagram data in the first local cache file to the backup application server in order to ensure that the serial number of the same actual operation diagram data in the second local cache file is the same as that in the first local cache file, and thus is suitable for the application scenario of primary-backup switchover.

[0088] The second local cache file is a local cache file of the standby application server within the operation cycle.

[0089] The second local cache file stores the actual operation diagram data of all trains in the operation cycle.

[0090] There is a one-to-one correspondence between each second local cache file and an operation cycle, and different second local cache files store actual operation diagram data of all trains in different operation cycles.

[0091] Among them, within the same operation cycle, the actual operation diagram data of the second local cache file is the same as that of the first local cache file, and the serial numbers of the same actual operation diagram data are the same.

[0092] In one implementation, the main application server sends a serial number synchronization message of the historical actual operation diagram data in the first local cache file to the backup application server, and the backup application server updates the serial number of the historical actual operation diagram data in the second local cache file based on the serial number synchronization message, wherein the second local cache file is the local cache file of the backup application server within the operation cycle.

[0093] The train actual operation diagram data storage method provided by the embodiment of the present invention, in which the main application server sends a serial number synchronization message of the historical actual operation diagram data in the first local cache file to the backup application server, and the backup application server updates the serial number of the historical actual operation diagram data in the second local cache file based on the serial number synchronization message, can be effectively applied to the application scenario of the main-backup switching, and the uniqueness and accuracy of the serial number of the actual operation diagram during startup, forwarding to the local cache thread, main-backup switching and cross-operation cycle can be ensured through the main application server and the backup application server.

[0094] Based on the content of the above embodiment, after the standby application server updates the serial number of the historical actual operation diagram data in the second local cache file based on the serial number synchronization message, the method further includes:

[0095] The standby application server receives the target actual operation diagram data sent by the station extension;

[0096] The standby application server numbers the target actual operation diagram data based on the serial number of the historical actual operation diagram data in the updated second local cache file to obtain the numbered target actual operation diagram data;

[0097] The standby application server stores the numbered target actual operation diagram data in the updated second local cache file.

[0098] In one implementation, the standby application server numbers the target actual operation diagram data based on the serial number of the historical actual operation diagram data in the updated second local cache file, specifically including:

[0099] The standby application server obtains the initial serial number of the historical actual operation diagram data within the operation cycle from the updated second local cache file and database;

[0100] The target actual operation diagram data are numbered in ascending order starting from the initial sequence number.

[0101] It should be noted that the initial sequence number is a sequence number obtained by initializing the maximum sequence number of the first historical actual operation diagram data.

[0102] In one implementation, the station extension sends the target actual operation diagram data to the main application server and the backup application server at the same time. The backup application server obtains the initial serial number of the historical actual operation diagram data within the operation cycle from the updated second local cache file and the database, and starts to number the target actual operation diagram data in ascending order after the initial serial number to obtain the numbered target actual operation diagram data. The backup application server stores the numbered target actual operation diagram data in JSON format in the updated second local cache file for persistent storage.

[0103] In the method for storing actual train operation diagram data provided by an embodiment of the present invention, a station extension sends target actual operation diagram data to a main application server and a backup application server at the same time; the backup application server obtains the initial serial number of the historical actual operation diagram data within the operation cycle from an updated second local cache file and a database, and starts to number the target actual operation diagram data in ascending order after the initial serial number to obtain the numbered target actual operation diagram data; the backup application server stores the numbered target actual operation diagram data in a JSON format in an updated second local cache file for persistent storage; the management of local cache threads is realized by multiple machines of the main application server and the backup application server, and can be effectively applied to the application scenario of primary-backup switching.

[0104] Based on the content of the above embodiment, after uploading the actual operation diagram data that has not been uploaded to the database, the method further includes:

[0105] The primary application server sends a serial number synchronization message of the uploaded actual operation diagram data to the backup application server within a preset period.

[0106] The serial number synchronization message of the uploaded actual operation diagram data indicates the maximum serial number position of the uploaded actual operation diagram data.

[0107] It should be noted that in the scenario of active-standby switching, the standby application server is upgraded to the active application server. The actual operation diagram data that has not been uploaded in the second local cache file is obtained according to the maximum serial number position of the uploaded actual operation diagram data, and the actual operation diagram data that has not been uploaded continues to be uploaded to the database.

[0108] In one embodiment, after the main application server successfully uploads the actual operation diagram data that has not been uploaded in the first local cache file to the database, it sends a serial number synchronization message of the uploaded actual operation diagram data to the backup application server, and the backup application server obtains the maximum serial number position of the uploaded actual operation diagram data.

[0109] Furthermore, if all actual operation diagram data in the first local cache file within the operation cycle are uploaded to the database, the first local cache file and the second local cache file within the operation cycle are deleted respectively.

[0110] The method for storing actual train operation diagram data provided by an embodiment of the present invention, after the main application server successfully uploads the actual operation diagram data that has not been uploaded in the first local storage file to the database, sends a serial number synchronization message of the uploaded actual operation diagram data to the backup application server, and the backup application server obtains the maximum serial number position of the uploaded actual operation diagram data. If all the actual operation diagram data in the first local cache file within the operation cycle are uploaded to the database, the first local cache file and the second local cache file within the operation cycle are deleted respectively. The method can be effectively applied to the application scenario of active-standby switching, and the uniqueness and accuracy of the serial number of the actual operation diagram during startup, forwarding to the local cache thread, active-standby switching and across operation cycles are guaranteed by the main application server and the backup application server, thereby ensuring the integrity of the actual operation diagram data in the scenario of database failure and across operation cycles.

[0111] Based on the content of the above embodiment, the method for storing actual train operation diagram data further includes:

[0112] When an abnormality occurs in the main application server, the backup application server is upgraded to the main application server;

[0113] Alternatively, when the primary application server does not exist, the backup application server is upgraded to the primary application server.

[0114] It should be noted that when the primary application server is abnormal or does not exist, the backup application server is upgraded to the primary application server, and the upgraded backup application server repeatedly performs the relevant operations of the primary application server in the above embodiment, which will not be repeated here.

[0115] The method for storing actual train operation diagram data provided by an embodiment of the present invention upgrades the backup application server to the main application server when an exception occurs in the main application server or the main application server does not exist. The upgraded backup application server repeatedly executes the relevant operations of the main application server in the above embodiment. The uniqueness and accuracy of the serial number of the actual operation diagram during startup, forwarding to the local cache thread, main-backup switching and across operation cycles are guaranteed through the main application server and the backup application server, thereby ensuring the integrity of the actual operation diagram data in the scenario of database failure and across operation cycles.

[0116] Combination Figure 2 Specifically describe the process of the main application server forwarding the actual train operation diagram data to the local cache file. Figure 2This is a timing diagram of forwarding actual train operation diagram data to a local cache file provided by an embodiment of the present invention. Figure 2 As shown, the method comprises the following steps:

[0117] Step 200: After the application server is started, it is upgraded to the main application server. The main application server queries the local cache file of the main application server and the maximum sequence number of the actual operation diagram data of the operation cycle in the database, and adds 200000 to the maximum sequence number to obtain the initial sequence number SN;

[0118] Step 201: The primary application server sends a sequence number synchronization message to the backup application server;

[0119] Step 202: The standby application server updates the sequence number of the data operation diagram data in the local cache file of the standby application server based on the sequence number synchronization message;

[0120] Step 203: After the station extension sends the actual operation diagram data to the main application server, steps 206 and 207 are executed respectively;

[0121] Step 204: the station extension sends the actual operation diagram data to the standby application server, and executes step 205;

[0122] Step 205: The standby application server numbers the received actual operation diagram data as SN+1, and stores the numbered actual operation diagram data in a local cache file of the standby application server;

[0123] Step 206: The main application server numbers the received actual operation diagram data as SN+1, and executes step 209;

[0124] Step 207, the main application server forwards the numbered actual operation diagram data to the operation workstation, and executes step 208;

[0125] Step 208, the operating workstation displays the actual operation diagram data in real time;

[0126] Step 209: The main application server stores the numbered actual operation diagram data in a local cache file of the main application server.

[0127] Combination Figure 3 Specifically describe the process of the main application server uploading the actual train operation diagram data to the database. Figure 3 It is a timing diagram of uploading the actual train operation diagram data to the database provided by the embodiment of the present invention. Figure 3 As shown, the method comprises the following steps:

[0128] Step 300: The main application server searches for the maximum sequence number of the actual operation diagram data within the operation cycle in the database, and searches for the position corresponding to the maximum sequence number in the local cache file of the main application server as the resume transmission position;

[0129] Step 301: The main application server reads the actual operation diagram data that has not been uploaded based on the resume transmission position, where the actual operation diagram data that has not been uploaded is all the actual operation diagram data after the resume transmission position;

[0130] Step 302: The main application server uploads the actual operation diagram data that has not been uploaded to the database;

[0131] Step 303: The database saves the actual operation diagram data that has not been uploaded;

[0132] Step 304: The database returns a message indicating successful data upload to the main application server;

[0133] Step 305: The main application server updates the progress of the continued transmission of the actual running graph data in the local cache file of the main application server;

[0134] Step 306: The primary application server sends a synchronization message of the progress of the actual operation diagram data to the backup application server;

[0135] Step 307: The standby application server updates the resumed transmission progress of the actual operation diagram data in the local cache file of the standby application server based on the received resumed transmission progress synchronization message.

[0136] The train actual operation diagram data storage device provided by the present invention is described below. The train actual operation diagram data storage device described below and the train actual operation diagram data storage method described above can be referenced to each other.

[0137] Figure 4 This is a schematic diagram of the structure of the data storage device for the actual train operation diagram provided by an embodiment of the present invention. Figure 4 As shown, the data storage device for the actual train operation diagram includes: a sequence number initialization unit 400, a data storage unit 410, a data acquisition unit 420 and a data upload unit 430, wherein:

[0138] The sequence number initialization unit 400 is used for the main application server to obtain the maximum sequence number of the first historical actual operation diagram data within the operation period based on the first local cache file and the database, and to initialize the maximum sequence number of the first historical actual operation diagram data to obtain an initial sequence number;

[0139] The data storage unit 410 is used for the main application server to receive the target actual operation diagram data sent by the station extension, number the target actual operation diagram data based on the initial sequence number to obtain the numbered target actual operation diagram data, and store the numbered target actual operation diagram data in the first local cache file;

[0140] A data acquisition unit 420 is used for the main application server to acquire the maximum sequence number of the second historical actual operation diagram data within the operation period based on the database, and acquire the actual operation diagram data that has not been uploaded in the first local cache file based on the maximum sequence number of the second historical actual operation diagram data;

[0141] A data uploading unit 430, configured for the main application server to upload the actual operation diagram data that has not been uploaded to the database;

[0142] The first local cache file is a local cache file of the main application server within the operation period.

[0143] The train actual operation diagram data storage device provided by the embodiment of the present invention initializes the maximum serial number of the first historical actual operation diagram data through the main application server to obtain the initial serial number, receives the target actual operation diagram data sent by the station extension, numbers the target actual operation diagram data based on the initial serial number, obtains and stores the numbered target actual operation diagram data in the first local cache file, and the main application server obtains the actual operation diagram data that has not been uploaded in the first local cache file based on the database, and uploads the actual operation diagram data that has not been uploaded to the database, thereby realizing the separation of the task of forwarding the actual operation diagram to the local cache file and the task of uploading it to the database, improving the efficiency of forwarding the actual operation diagram data, and uniformly numbering the actual operation diagram data, so that there is no need to repeatedly query the serial number before the actual operation diagram data is inserted into the database each time, which greatly improves the storage efficiency of the actual operation diagram data and ensures the integrity of the actual operation diagram data in the scenario of database failure and across operation cycles.

[0144] Optionally, the data acquisition unit 420 specifically includes:

[0145] A first acquisition subunit is used for the main application server to acquire the third historical actual operation diagram data corresponding to the maximum sequence number of the second historical actual operation diagram data in the first local cache file;

[0146] A second acquisition subunit is used for the main application server to acquire the actual operation diagram data that is not uploaded in the first local cache file based on the third historical actual operation diagram data;

[0147] The actual operation diagram data that has not been uploaded is all the actual operation diagram data after the third historical actual operation diagram data in the first local cache file.

[0148] Optionally, the sequence number initialization unit 400 is specifically configured to:

[0149] The main application server sums the maximum sequence number of the first historical actual operation diagram data and a preset threshold to obtain an initial sequence number.

[0150] Optionally, the train actual operation diagram data storage device further includes:

[0151] The first message sending unit is used for the primary application server to send a sequence number synchronization message of the historical actual operation diagram data in the first local cache file to the backup application server.

[0152] Optionally, the train actual operation diagram data storage device further includes:

[0153] The second message sending unit is used for the primary application server to send a serial number synchronization message of the uploaded actual operation diagram data to the backup application server within a preset period.

[0154] Optionally, the train actual operation diagram data storage device further includes: an upgrading unit, which is used to:

[0155] When an abnormality occurs in the main application server, the backup application server is upgraded to the main application server;

[0156] Alternatively, when the primary application server does not exist, the backup application server is upgraded to the primary application server.

[0157] The train actual operation diagram data storage device provided by the present invention can realize Figures 1 to 3 The various processes implemented by the method embodiment and achieving the same technical effect are not described here to avoid repetition.

[0158] Figure 5 A schematic diagram of the structure of an electronic device provided by the present invention, such as Figure 5 As shown, the electronic device may include: a processor 510, a communication interface 520, a memory 530 and a communication bus 540, wherein the processor 510, the communication interface 520 and the memory 530 communicate with each other through the communication bus 540. The processor 510 may call the logic instructions in the memory 530 to execute the train actual operation diagram data storage method, which includes:

[0159] The main application server obtains the maximum sequence number of the first historical actual operation diagram data within the operation period based on the first local cache file and the database, and initializes the maximum sequence number of the first historical actual operation diagram data to obtain an initial sequence number;

[0160] The main application server receives the target actual operation diagram data sent by the station extension, numbers the target actual operation diagram data based on the initial sequence number to obtain the numbered target actual operation diagram data, and stores the numbered target actual operation diagram data in the first local cache file;

[0161] The main application server obtains the maximum sequence number of the second historical actual operation diagram data within the operation period based on the database, and obtains the actual operation diagram data not uploaded in the first local cache file based on the maximum sequence number of the second historical actual operation diagram data;

[0162] The main application server uploads the actual operation diagram data that has not been uploaded to the database;

[0163] The first local cache file is a local cache file of the main application server within the operation period.

[0164] In addition, the logic instructions in the above-mentioned memory 530 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 is essentially 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), random access memory (RAM), disk or optical disk and other media that can store program codes.

[0165] 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, and when the program instructions are executed by a computer, the computer can execute the method for storing actual train operation diagram data provided by the above methods, the method comprising:

[0166] The main application server obtains the maximum sequence number of the first historical actual operation diagram data within the operation period based on the first local cache file and the database, and initializes the maximum sequence number of the first historical actual operation diagram data to obtain an initial sequence number;

[0167] The main application server receives the target actual operation diagram data sent by the station extension, numbers the target actual operation diagram data based on the initial sequence number to obtain the numbered target actual operation diagram data, and stores the numbered target actual operation diagram data in the first local cache file;

[0168] The main application server obtains the maximum sequence number of the second historical actual operation diagram data within the operation period based on the database, and obtains the actual operation diagram data not uploaded in the first local cache file based on the maximum sequence number of the second historical actual operation diagram data;

[0169] The main application server uploads the actual operation diagram data that has not been uploaded to the database;

[0170] The first local cache file is a local cache file of the main application server within the operation period.

[0171] 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 storing actual train operation diagram data provided in the above embodiments is implemented, and the method includes:

[0172] The main application server obtains the maximum sequence number of the first historical actual operation diagram data within the operation period based on the first local cache file and the database, and initializes the maximum sequence number of the first historical actual operation diagram data to obtain an initial sequence number;

[0173] The main application server receives the target actual operation diagram data sent by the station extension, numbers the target actual operation diagram data based on the initial sequence number to obtain the numbered target actual operation diagram data, and stores the numbered target actual operation diagram data in the first local cache file;

[0174] The main application server obtains the maximum sequence number of the second historical actual operation diagram data within the operation period based on the database, and obtains the actual operation diagram data not uploaded in the first local cache file based on the maximum sequence number of the second historical actual operation diagram data;

[0175] The main application server uploads the actual operation diagram data that has not been uploaded to the database;

[0176] The first local cache file is a local cache file of the main application server within the operation period.

[0177] 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.

[0178] 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.

[0179] 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 method for storing data of an actual train operation diagram, characterized in that: include: The main application server obtains the maximum sequence number of the first historical actual operation diagram data within the operation period based on the first local cache file and the database, and initializes the maximum sequence number of the first historical actual operation diagram data to obtain an initial sequence number; The main application server receives the target actual operation diagram data sent by the station extension, numbers the target actual operation diagram data based on the initial sequence number to obtain the numbered target actual operation diagram data, and stores the numbered target actual operation diagram data in the first local cache file; The main application server obtains the maximum sequence number of the second historical actual operation diagram data within the operation period based on the database, and obtains the actual operation diagram data not uploaded in the first local cache file based on the maximum sequence number of the second historical actual operation diagram data; The main application server uploads the actual operation diagram data that has not been uploaded to the database; Wherein, the first local cache file is a local cache file of the main application server within the operation period; The acquiring the actual operation diagram data not uploaded in the first local cache file based on the maximum sequence number of the second historical actual operation diagram data specifically includes: The main application server obtains the third historical actual operation diagram data corresponding to the maximum sequence number of the second historical actual operation diagram data in the first local cache file; The main application server acquires the actual operation diagram data not uploaded in the first local cache file based on the third historical actual operation diagram data; The actual operation diagram data that has not been uploaded is all the actual operation diagram data after the third historical actual operation diagram data in the first local cache file.

2. The method for storing actual train operation diagram data according to claim 1, characterized in that: The initializing process of the maximum sequence number of the first historical actual operation diagram data to obtain the initial sequence number specifically includes: The main application server sums the maximum sequence number of the first historical actual operation diagram data and a preset threshold to obtain an initial sequence number.

3. The method for storing actual train operation diagram data according to claim 1, characterized in that: After obtaining the initial sequence number, the method further includes: The primary application server sends a sequence number synchronization message of the historical actual operation diagram data in the first local cache file to the backup application server.

4. The method for storing actual train operation diagram data according to claim 1, characterized in that: After uploading the actual operation diagram data that has not been uploaded to the database, the method further includes: The primary application server sends a serial number synchronization message of the uploaded actual operation diagram data to the backup application server within a preset period.

5. The method for storing actual train operation diagram data according to claim 1, characterized in that: Before the main application server obtains the maximum sequence number of the first historical actual operation diagram data within the operation cycle based on the first local cache file and the database, it also includes: When an abnormality occurs in the main application server, the backup application server is upgraded to the main application server; Alternatively, when the primary application server does not exist, the backup application server is upgraded to the primary application server.

6. A data storage device for actual train operation diagram, characterized in that: include: A sequence number initialization unit, configured for the main application server to obtain the maximum sequence number of the first historical actual operation diagram data within the operation cycle based on the first local cache file and the database, and to initialize the maximum sequence number of the first historical actual operation diagram data to obtain an initial sequence number; A data storage unit, used for the main application server to receive the target actual operation diagram data sent by the station extension, number the target actual operation diagram data based on the initial sequence number to obtain the numbered target actual operation diagram data, and store the numbered target actual operation diagram data in the first local cache file; A data acquisition unit, configured for the main application server to acquire the maximum sequence number of the second historical actual operation diagram data within the operation period based on the database, and to acquire the actual operation diagram data not uploaded in the first local cache file based on the maximum sequence number of the second historical actual operation diagram data; A data uploading unit, used for the main application server to upload the actual operation diagram data that has not been uploaded to the database; Wherein, the first local cache file is a local cache file of the main application server within the operation period; The main application server obtains the actual operation diagram data not uploaded in the first local cache file based on the maximum sequence number of the second historical actual operation diagram data, specifically including: The main application server obtains the third historical actual operation diagram data corresponding to the maximum sequence number of the second historical actual operation diagram data in the first local cache file; The main application server acquires the actual operation diagram data not uploaded in the first local cache file based on the third historical actual operation diagram data; The actual operation diagram data that has not been uploaded is all the actual operation diagram data after the third historical actual operation diagram data in the first local cache file.

7. The train actual operation diagram data storage device according to claim 6, characterized in that: The data acquisition unit specifically includes: A first acquisition subunit is used for the main application server to acquire the third historical actual operation diagram data corresponding to the maximum sequence number of the second historical actual operation diagram data in the first local cache file; A second acquisition subunit is used for the main application server to acquire the actual operation diagram data that is not uploaded in the first local cache file based on the third historical actual operation diagram data; The actual operation diagram data that has not been uploaded is all the actual operation diagram data after the third historical actual operation diagram data in the first local cache file.

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 computer program, the steps of the method for storing actual train operation diagram data as described in any one of claims 1 to 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 method for storing actual train operation diagram data as claimed in any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Method and device for storing data of cross-line running charts

    CN107562839A

  • System and method for automatically compiling urban rail transit driver cross-road table

    CN110163501A