Train working diagram management method and system
By using a data synchronization mechanism driven by periodic detection and status identifiers, the problem of data update lag and incomplete synchronization caused by database connection anomalies in urban rail transit train timetable management was solved, thereby improving the system's stability and fault tolerance.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-11
- Publication Date
- 2026-04-14
AI Technical Summary
In existing technologies, the management of urban rail transit train timetables lacks an effective data caching and synchronization mechanism when the database connection is abnormal, which results in data not being updated in a timely manner and may lead to incomplete data synchronization after recovery.
By periodically checking the connection status between the SCH workstation and the database, a database connection status identifier is generated. Based on the identifier, the corresponding data synchronization process of the running graph is executed or the data is loaded from the local disk. A new running graph is generated and updated in real time. The SQL statement is stored and executed immediately when the connection is normal. The SQL statement queue is designed to pause execution in case of an anomaly, ensuring data synchronization and recovery.
This improves the stability and fault tolerance of the train dispatching system, ensuring timely data synchronization during database connection anomalies, reducing the impact on system operation, and preventing data loss or corruption.
Smart Images

Figure CN121858581A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of rail transit technology, and in particular to a train timetable management method and a train timetable management system. Background Technology
[0002] In existing technologies, the management of urban rail transit train timetables mainly relies on database connections to load and update the timetables. When a database connection fails, the traditional solution usually relies on a backup database and restores the system through manual switching. However, this approach lacks an effective data caching and synchronization mechanism, resulting in the train timetable data not being updated in a timely manner when the database connection is abnormal, and incomplete data synchronization may occur after recovery. Summary of the Invention
[0003] In view of the above problems, the present invention is proposed to provide a train timetable management method and a corresponding train timetable management system that overcome or at least partially solve the above problems.
[0004] This invention discloses a train timetable management method, the method comprising: The connection status between the SCH workstation and the database is periodically checked, and a database connection status identifier is generated based on the connection status of the previous period and the current period. The database connection status identifier includes a recovered connection identifier, a normal connection identifier, and an abnormal connection identifier. Select the execution of the runtime graph data synchronization process based on the database connection status identifier, or load the basic runtime graph and line base data from the database or local disk; A new planned operation diagram is generated based on the basic operation diagram and route basic data, and the planned operation diagram in memory is updated in real time to the new planned operation diagram, as well as SQL statements for writing the new planned operation diagram into the database. Store the SQL statement used to write the new plan run graph to the database, and execute the SQL statement used to write the new plan run graph to the database immediately when the database connection status is marked as a normal connection.
[0005] Optionally, a database connection status identifier is generated based on the connection status of the previous cycle and the connection status of the current cycle, including: If the current periodic connection status is abnormal, an abnormal connection identifier is generated; If the current cycle connection status is normal, then determine whether the previous cycle connection status was normal or abnormal. If the connection status in the previous cycle was normal, a normal connection identifier is generated; If the connection status in the previous cycle was abnormal, a recovery connection identifier is generated.
[0006] Optionally, based on the database connection status identifier, the execution of the run graph data synchronization process can be selected, or the basic run graph and line base data can be loaded from the database or local disk, including: If the database connection status is marked as a restored connection, then the data synchronization process is executed. If the database connection status is marked as a normal connection, then the basic operation diagram and basic line data are loaded from the database. If the database connection status is marked as an abnormal connection, then the basic operation graph and line basic data are loaded from the local disk.
[0007] Optionally, if the database connection status identifier is a restored connection identifier, then the runtime data synchronization process is executed, including: If the database connection status is a recovery connection, the SQL statements used to write the new plan run chart to the database are executed sequentially in the order they were generated to synchronize the run chart data to the database, and the recovery connection status is updated to a normal connection status after execution.
[0008] Optionally, the method further includes: Determine whether to immediately execute the stored SQL statement used to write the new plan run graph to the database based on the database connection status flag; If the database connection status is normal, the SQL statement used to write the new plan run graph to the database is executed immediately. If the database connection status is marked as an abnormal connection, the execution of the SQL statement used to write the new plan run graph to the database is suspended.
[0009] Optionally, after the step of periodically checking the connection status between the SCH workstation and the database, the following steps are also included: If the current cycle connection status is determined to be normal, then check whether the latest basic operation diagram and line basic data have been backed up on the local disk; If the latest basic operation diagram and line basic data have not been backed up on the local disk, then a local backup operation will be performed on the latest basic operation diagram and line basic data.
[0010] Optionally, the database stores the SQL statements used to write the new schedule run graph, including: The SQL statements used to write the new plan run graph to the database are queued in the order they are generated and cached in memory, and then written to disk synchronously.
[0011] Optionally, the SQL statement queue is enqueued and dequeued according to the first-in, first-out (FIFO) principle.
[0012] Optionally, the database shall store at least the basic operation chart, the planned operation chart, and the actual operation chart.
[0013] The present invention also discloses a train timetable management system, the system comprising: The database connection status monitoring module is used to periodically detect the connection status between the SCH workstation and the database, and generate a database connection status identifier based on the connection status of the previous period and the current period. The database connection status identifier includes a recovered connection identifier, a normal connection identifier, and an abnormal connection identifier. The data synchronization and basic operation graph loading module is used to select the execution of the operation graph data synchronization process based on the database connection status identifier, or to load the basic operation graph and line basic data from the database or local disk. The planned operation diagram generation and update module is used to generate a new planned operation diagram based on the basic operation diagram and route basic data, update the planned operation diagram in memory in real time to the new planned operation diagram, and generate SQL statements for writing the new planned operation diagram to the database. The SQL statement management and execution module stores the SQL statements used to write new program run graphs to the database, and executes the SQL statements used to write new program run graphs to the database immediately when the database connection status is marked as a normal connection.
[0014] Optionally, the database connection status monitoring module is also used for: If the current periodic connection status is abnormal, an abnormal connection identifier is generated; If the current cycle connection status is normal, then determine whether the previous cycle connection status was normal or abnormal. If the connection status in the previous cycle was normal, a normal connection identifier is generated; If the connection status in the previous cycle was abnormal, a recovery connection identifier is generated.
[0015] Optionally, the data synchronization and basic runtime graph loading module is also used for: If the database connection status is marked as a restored connection, then the data synchronization process is executed. If the database connection status is marked as a normal connection, then the basic operation diagram and basic line data are loaded from the database. If the database connection status is marked as an abnormal connection, then the basic operation graph and line basic data are loaded from the local disk.
[0016] Optionally, the data synchronization and basic runtime graph loading module is also used for: If the database connection status is a recovery connection, the SQL statements used to write the new plan run chart to the database are executed sequentially in the order of generation to synchronize the run chart data to the database. After the execution is completed, the database connection status monitoring module is notified to update the recovery connection status to a normal connection status.
[0017] Optionally, the SQL statement management and execution module is also used for: Determine whether to immediately execute the stored SQL statement used to write the new plan run graph to the database based on the database connection status flag; If the database connection status is normal, the SQL statement used to write the new plan run graph to the database is executed immediately. If the database connection status is marked as an abnormal connection, the execution of the SQL statement used to write the new plan run graph to the database is suspended.
[0018] Optionally, the database connection status monitoring module is also used for: If the current cycle connection status is determined to be normal, then check whether the latest basic operation diagram and line basic data have been backed up on the local disk; If the latest basic operation diagram and line basic data have not been backed up on the local disk, then a local backup operation will be performed on the latest basic operation diagram and line basic data.
[0019] Optionally, the SQL statement management and execution module is also used for: The SQL statements used to write the new plan run graph to the database are queued in the order they are generated and cached in memory, and then written to disk synchronously.
[0020] Optionally, the SQL statement queue is enqueued and dequeued according to the first-in, first-out (FIFO) principle.
[0021] Optionally, the database shall store at least the basic operation chart, the planned operation chart, and the actual operation chart.
[0022] This invention has the following advantages: The train timetable management method of this invention periodically checks the connection status between the SCH workstation and the database, and generates a recovery, normal, or abnormal status identifier based on the status of the previous cycle. According to the identifier, corresponding operations are performed: when the connection is restored, SQL statements are executed sequentially to synchronize data, and the identifier is updated to a normal connection identifier after the update is completed; during a normal connection, basic timetable data and line basic data are loaded from the database; during an abnormal connection, data is loaded from the local disk; a new planned timetable is generated based on the loaded data, the timetable in memory is updated in real time, and SQL statements are generated and written to the database. These SQL statements are stored and executed immediately during a normal connection, and execution is paused during an abnormal connection until recovery. This method effectively addresses database connection failures and improves the stability and fault tolerance of the train dispatching system. Attached Figure Description
[0023] Figure 1This is a flowchart of the steps of a train timetable management method provided in an embodiment of the present invention; Figure 2 This is an identification and connection diagram of an urban rail transit train operation system provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the SCH workstation data distribution and storage medium provided in an embodiment of the present invention; Figure 4 This is a flowchart of the database connection monitoring and recovery thread provided in an embodiment of the present invention; Figure 5 This is the basic runtime graph fast loading processing flow provided by the embodiments of the present invention when a database connection is abnormal; Figure 6 This is the real-time update and SQL replay synchronization process for database connection anomalies provided in this embodiment of the invention. Detailed Implementation
[0024] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0025] Reference Figure 1 The diagram illustrates a flowchart of a train timetable management method provided in an embodiment of the present invention, which may specifically include the following steps: Step 101: Periodically check the connection status between the SCH workstation and the database, and generate a database connection status identifier based on the connection status of the previous period and the current period; the database connection status identifier includes a recovered connection identifier, a normal connection identifier, and an abnormal connection identifier. Step 102: Select to execute the runtime graph data synchronization process based on the database connection status identifier, or load the basic runtime graph and line basic data from the database or local disk; Step 103: Generate a new planned operation diagram based on the basic operation diagram and route basic data, update the planned operation diagram in memory to the new planned operation diagram in real time, and generate SQL statements for writing the new planned operation diagram to the database. Step 104: Store the SQL statement used to write the new plan run graph to the database, and immediately execute the SQL statement used to write the new plan run graph to the database when the database connection status is marked as a normal connection.
[0026] Optionally, a database connection status identifier is generated based on the connection status of the previous cycle and the connection status of the current cycle, including: If the current periodic connection status is abnormal, an abnormal connection identifier is generated; If the current cycle connection status is normal, then determine whether the previous cycle connection status was normal or abnormal. If the connection status in the previous cycle was normal, a normal connection identifier is generated; If the connection status in the previous cycle was abnormal, a recovery connection identifier is generated.
[0027] Optionally, based on the database connection status identifier, the execution of the run graph data synchronization process can be selected, or the basic run graph and line base data can be loaded from the database or local disk, including: If the database connection status is marked as a restored connection, then the data synchronization process is executed. If the database connection status is marked as a normal connection, then the basic operation diagram and basic line data are loaded from the database. If the database connection status is marked as an abnormal connection, then the basic operation graph and line basic data are loaded from the local disk.
[0028] Optionally, if the database connection status identifier is a restored connection identifier, then the runtime data synchronization process is executed, including: If the database connection status is a recovery connection, the SQL statements used to write the new plan run chart to the database are executed sequentially in the order they were generated to synchronize the run chart data to the database, and the recovery connection status is updated to a normal connection status after execution.
[0029] Optionally, the method further includes: Determine whether to immediately execute the stored SQL statement used to write the new plan run graph to the database based on the database connection status flag; If the database connection status is normal, the SQL statement used to write the new plan run graph to the database is executed immediately. If the database connection status is marked as an abnormal connection, the execution of the SQL statement used to write the new plan run graph to the database is suspended.
[0030] Optionally, after the step of periodically checking the connection status between the SCH workstation and the database, the following steps are also included: If the current cycle connection status is determined to be normal, then check whether the latest basic operation diagram and line basic data have been backed up on the local disk; If the latest basic operation diagram and line basic data have not been backed up on the local disk, then a local backup operation will be performed on the latest basic operation diagram and line basic data.
[0031] Optionally, the database stores the SQL statements used to write the new schedule run graph, including: The SQL statements used to write the new plan run graph to the database are queued in the order they are generated and cached in memory, and then written to disk synchronously.
[0032] Optionally, the SQL statement queue is enqueued and dequeued according to the first-in, first-out (FIFO) principle.
[0033] Optionally, the database shall store at least the basic operation chart, the planned operation chart, and the actual operation chart.
[0034] The urban rail transit train operation system of this invention adopts a two-level architecture design, such as... Figure 2 As shown, it includes two levels: a database server and a SCH workstation. The database server serves as the centralized storage node for urban rail transit train timetable data, responsible for storing data such as the basic timetable, the planned timetable, and the actual timetable. Figure 3 This diagram illustrates the data distribution and storage media of the SCH workstation. The SCH workstation, as the only device directly communicating with the database server, loads the basic operation diagram from the database server, converts it into a planned operation diagram, and then sends it to the application server. The SCH workstation is connected to the application server, which in turn connects to each execution terminal to achieve instruction distribution and status feedback. Specifically, it sends instructions to each execution terminal according to the planned operation diagram, and the operating status of each execution terminal is fed back to the SCH workstation through the application server, forming the actual operation diagram. This two-tier architecture avoids the data fusion complexity caused by multiple devices directly accessing the database. To address the problem of operation diagram management interruption due to connection failures between the database server and the SCH workstation, this invention provides a train operation diagram management method for database connection failures. This method is based on the following strategies integrated into the application of the SCH workstation.
[0035] (1) Core processing strategy for database connection monitoring and recovery SCH has a built-in database connection monitoring and recovery thread that periodically updates its connection status with the database. This thread continuously monitors the database connection to ensure the system can respond to faults promptly and avoid interruptions in train timetable management. The database connection status is represented by the status flag STATUS, which has three values: DB_NORMAL (database connection normal), DB_EMERGENCY (database connection abnormal), and DB_RECOVERING (database connection in recovery). STATUS(k) represents the connection status value after the k-th loop; DB_NORMAL indicates a normal connection, DB_EMERGENCY indicates an abnormal connection, and DB_RECOVERING represents the intermediate state between the abnormal and normal states.
[0036] Taking the k-th iteration as an example, as shown in Figure 4, the specific steps are as follows: The thread first checks the actual database connection: If the connection fails, immediately set the status flag to STATUS(k)=DB_EMERGENCY, indicating that the result of this round of detection is abnormal, and skip the subsequent processing and directly enter the next round of loop; If the connection is normal, proceed to check whether the basic operation diagram and line data required within the last 7 days have been backed up locally. If they have been backed up, skip this step; otherwise, perform the backup operation.
[0037] Subsequently, the thread further checks the state STATUS(k) of the previous loop. 1): If STATUS(k) 1)=DB_NORMAL indicates that the database connection status is continuously normal, so directly set STATUS(k)=DB_NORMAL; If STATUS(k) 1) If the database connection status changes from abnormal to normal (not DB_NORMAL), the data synchronization process begins. At this point, STATUS(k) is first set to DB_RECOVERING, and the statements in the SQL statement queue are immediately dequeued and executed sequentially to complete the data synchronization to the database system. After synchronization is complete, STATUS(k) is updated to DB_NORMAL.
[0038] To prevent memory overflow, the counter k is reset to zero and the counting restarts after every M loops.
[0039] The database connection status identifier STATUS is updated in real time by the database connection monitoring and recovery thread. The loading and issuing strategies of the basic SCH operation graph, as well as the real-time update strategy of the planned operation graph, are all based on the real-time status of STATUS.
[0040] (2) Basic operation chart loading and issuing strategy Before train operations commence, the SCH system needs to load a designated basic timetable to determine the day's train schedule. The data loading source is determined by the database connection status. If the database connection is normal, the basic timetable and route data are loaded from the database; if the connection is abnormal, backup data is loaded from the local disk. This ensures fast data loading when the database connection is normal and reliance on local backup data when the connection is abnormal, guaranteeing timely loading of the train timetable. Figure 5 As shown, the loading strategy includes the following steps: First, determine the basic runtime graph version used that day. Then, check the database connection status: If the connection status is normal (STATUS=DB_NORMAL), the specified basic operation diagram and line basic data are loaded from the database, and the planned operation diagram for the day is generated accordingly. If the connection status is abnormal (STATUS≠DB_NORMAL), the corresponding basic operation chart and basic line data are loaded from the local disk (this data is backed up in advance by the database connection monitoring and recovery thread), and the planned operation chart for the day is generated.
[0041] After the planned execution graph is generated, the system generates SQL commands for writing to the database in batches according to a time sequence and enqueues them into the SQL statement queue in order. Then, the database connection status is checked again. If the connection status is normal (STATUS=DB_NORMAL), the SQL statements in the queue will be dequeued and executed in sequence according to the FIFO principle. If the connection status is abnormal (STATUS≠DB_NORMAL), the statements in the SQL statement queue will not be executed temporarily, and only the plan will be issued.
[0042] (3) Real-time update strategy for the planned operation chart During train operation, the planned train schedule needs to be updated in real time based on operational conditions. If the database is offline at this time, to ensure that the updated data from the offline period can be synchronized after the connection is restored, the SCH system performs corresponding operations based on the real-time received operational data. This enables real-time updates to the planned train schedule, promptly reflecting adjustments made during train operation. The processing flow is as follows: Figure 6 As shown, the specific steps include: First, based on the real-time received runtime data, a plan execution chart modification instruction is generated, and the plan execution chart in memory is updated in real time. Then, corresponding database update SQL statements are generated based on the updated content and enqueued into the SQL statement queue in the order of generation to ensure consistent execution order.
[0043] Next, check the database connection status: If the connection status is normal (STATUS=DB_NORMAL), then the SQL statements are dequeued from the queue in sequence according to the first-in-first-out (FIFO) principle and executed to synchronize the updated content with the database system. If the connection status is abnormal (STATUS≠DB_NORMAL), the statements in the SQL statement queue will not be executed temporarily, and the next round of data reception and processing will begin.
[0044] (4) SQL statement replay strategy after database connection failure recovery To ensure that plan execution graph update instructions generated during database connection failures are not lost, SCH employs a mechanism for SQL statement queue persistence and replay after recovery. The specific strategy is as follows: When the database connection status is abnormal (STATUS ≠ DB_NORMAL), all generated SQL statements will be queued into the SQL statement queue in the order they were generated and synchronously written to disk, but will not be executed immediately. This queue supports both memory caching and disk persistence mechanisms to ensure the safe preservation of data during the abnormal period.
[0045] Once the database connection status is restored (STATUS changes from DB_EMERGENCY or DB_RECOVERING to DB_NORMAL), the system immediately triggers the SQL statement queue replay process: State transition identification: State transition events are identified by the database connection state monitoring and recovery thread; SQL replay trigger: After the system switches to recovery state (STATUS=DB_RECOVERING), the SQL statement queue parsing and execution process is automatically started; The SQL commands are executed sequentially in the order they are enqueued (FIFO) to ensure that the updated content of the plan run chart generated during database offline time can be successfully synchronized to the database, thus ensuring data consistency. Status Update: After all SQL execution is complete, the status will be updated to STATUS=DB_NORMAL, and normal operation will resume.
[0046] This invention solves the problems of difficult loading, delayed updates, and data asynchrony caused by abnormal database connections in existing technologies. The technical solution of this invention can effectively improve the stability and fault tolerance of the train dispatching system, with the following specific effects: 1) Improve system stability: Through the database connection status monitoring and recovery mechanism, operation can continue even during database connection anomalies, reducing the impact of failures on system operation.
[0047] 2) Ensure data synchronization: Through SQL statement queue management and recovery mechanism, ensure that the data during the abnormal period can be synchronized to the database system in a timely and accurate manner after the database connection is restored.
[0048] 3) Improved fault tolerance: The solution of this invention can avoid data loss or chaos by using local caching and queue management when the database connection fails, thereby improving the fault tolerance of the system.
[0049] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.
[0050] The train timetable management system provided in this embodiment of the invention may specifically include the following modules: The database connection status monitoring module is used to periodically detect the connection status between the SCH workstation and the database, and generate a database connection status identifier based on the connection status of the previous period and the current period. The database connection status identifier includes a recovered connection identifier, a normal connection identifier, and an abnormal connection identifier. The data synchronization and basic operation graph loading module is used to select the execution of the operation graph data synchronization process based on the database connection status identifier, or to load the basic operation graph and line basic data from the database or local disk. The planned operation diagram generation and update module is used to generate a new planned operation diagram based on the basic operation diagram and route basic data, update the planned operation diagram in memory in real time to the new planned operation diagram, and generate SQL statements for writing the new planned operation diagram to the database. The SQL statement management and execution module stores the SQL statements used to write new program run graphs to the database, and executes the SQL statements used to write new program run graphs to the database immediately when the database connection status is marked as a normal connection.
[0051] Optionally, the database connection status monitoring module is also used for: If the current periodic connection status is abnormal, an abnormal connection identifier is generated; If the current cycle connection status is normal, then determine whether the previous cycle connection status was normal or abnormal. If the connection status in the previous cycle was normal, a normal connection identifier is generated; If the connection status in the previous cycle was abnormal, a recovery connection identifier is generated.
[0052] Optionally, the data synchronization and basic runtime graph loading module is also used for: If the database connection status is marked as a restored connection, then the data synchronization process is executed. If the database connection status is marked as a normal connection, then the basic operation diagram and basic line data are loaded from the database. If the database connection status is marked as an abnormal connection, then the basic operation graph and line basic data are loaded from the local disk.
[0053] Optionally, the data synchronization and basic runtime graph loading module is also used for: If the database connection status is a recovery connection, the SQL statements used to write the new plan run chart to the database are executed sequentially in the order of generation to synchronize the run chart data to the database. After the execution is completed, the database connection status monitoring module is notified to update the recovery connection status to a normal connection status.
[0054] Optionally, the SQL statement management and execution module is also used for: Determine whether to immediately execute the stored SQL statement used to write the new plan run graph to the database based on the database connection status flag; If the database connection status is normal, the SQL statement used to write the new plan run graph to the database is executed immediately. If the database connection status is marked as an abnormal connection, the execution of the SQL statement used to write the new plan run graph to the database is suspended.
[0055] Optionally, the database connection status monitoring module is also used for: If the current cycle connection status is determined to be normal, then check whether the latest basic operation diagram and line basic data have been backed up on the local disk; If the latest basic operation diagram and line basic data have not been backed up on the local disk, then a local backup operation will be performed on the latest basic operation diagram and line basic data.
[0056] Optionally, the SQL statement management and execution module is also used for: The SQL statements used to write the new plan run graph to the database are queued in the order they are generated and cached in memory, and then written to disk synchronously.
[0057] Optionally, the SQL statement queue is enqueued and dequeued according to the first-in, first-out (FIFO) principle.
[0058] Optionally, the database shall store at least the basic operation chart, the planned operation chart, and the actual operation chart.
[0059] As the system implementation is basically similar to the method implementation, it is described in a relatively simple way. For relevant details, please refer to the description of the method implementation.
[0060] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0061] The various embodiments in this specification are described in a related manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.
[0062] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of protection of the present invention.
Claims
1. A train timetable management method, characterized in that, The method includes: The connection status between the SCH workstation and the database is periodically checked, and a database connection status identifier is generated based on the connection status of the previous period and the current period. The database connection status identifier includes a recovered connection identifier, a normal connection identifier, and an abnormal connection identifier. Select the execution of the runtime graph data synchronization process based on the database connection status identifier, or load the basic runtime graph and line base data from the database or local disk; A new planned operation diagram is generated based on the basic operation diagram and route basic data, and the planned operation diagram in memory is updated in real time to the new planned operation diagram, as well as SQL statements for writing the new planned operation diagram into the database. Store the SQL statement used to write the new plan run graph to the database, and execute the SQL statement used to write the new plan run graph to the database immediately when the database connection status is marked as a normal connection.
2. The method according to claim 1, characterized in that, A database connection status identifier is generated based on the connection status of the previous cycle and the connection status of the current cycle, including: If the current periodic connection status is abnormal, an abnormal connection identifier is generated; If the current cycle connection status is normal, then determine whether the previous cycle connection status was normal or abnormal. If the connection status in the previous cycle was normal, a normal connection identifier is generated; If the connection status in the previous cycle was abnormal, a recovery connection identifier is generated.
3. The method according to claim 1, characterized in that, Based on the database connection status identifier, select to execute the run graph data synchronization process, or load the basic run graph and line base data from the database or local disk, including: If the database connection status is marked as a restored connection, then the data synchronization process is executed. If the database connection status is marked as a normal connection, then the basic operation diagram and basic line data are loaded from the database. If the database connection status is marked as an abnormal connection, then the basic operation graph and line basic data are loaded from the local disk.
4. The method according to claim 3, characterized in that, If the database connection status is set to "recovered connection," then the data synchronization process is executed, including: If the database connection status is a recovery connection, the SQL statements used to write the new plan run chart to the database are executed sequentially in the order they were generated to synchronize the run chart data to the database, and the recovery connection status is updated to a normal connection status after execution.
5. The method according to claim 1, characterized in that, The method further includes: Determine whether to immediately execute the stored SQL statement used to write the new plan run graph to the database based on the database connection status flag; If the database connection status is normal, the SQL statement used to write the new plan run graph to the database is executed immediately. If the database connection status is marked as an abnormal connection, the execution of the SQL statement used to write the new plan run graph to the database is suspended.
6. The method according to claim 1, characterized in that, After the step of periodically checking the connection status between the SCH workstation and the database, the following steps are also included: If the current cycle connection status is determined to be normal, then check whether the latest basic operation diagram and line basic data have been backed up on the local disk; If the latest basic operation diagram and line basic data have not been backed up on the local disk, then a local backup operation will be performed on the latest basic operation diagram and line basic data.
7. The method according to claim 1, characterized in that, The database stores the SQL statements used to write the new schedule run graph, including: The SQL statements used to write the new plan run graph to the database are queued in the order they are generated and cached in memory, and then written to disk synchronously.
8. The method according to claim 1, characterized in that, The SQL statement queue is enqueued and dequeued according to the first-in, first-out (FIFO) principle.
9. The method according to claim 1, characterized in that, The database should store at least the basic operation chart, the planned operation chart, and the actual operation chart.
10. A train timetable management system, characterized in that, include: The database connection status monitoring module is used to periodically detect the connection status between the SCH workstation and the database, and generate a database connection status identifier based on the connection status of the previous period and the current period. The database connection status identifier includes a recovered connection identifier, a normal connection identifier, and an abnormal connection identifier. The data synchronization and basic operation graph loading module is used to select the execution of the operation graph data synchronization process based on the database connection status identifier, or to load the basic operation graph and line basic data from the database or local disk. The planned operation diagram generation and update module is used to generate a new planned operation diagram based on the basic operation diagram and route basic data, update the planned operation diagram in memory in real time to the new planned operation diagram, and generate SQL statements for writing the new planned operation diagram to the database. The SQL statement management and execution module stores the SQL statements used to write new program run graphs to the database, and executes the SQL statements used to write new program run graphs to the database immediately when the database connection status is marked as a normal connection.