Method, device and equipment for generating a virtual clock system based on a CBTC simulation system
By calculating the time difference value and updating the simulation time, the cumbersome operation problems caused by time mismatch in the CBTC simulation system are solved, and the automatic matching of simulation time and local time is realized, which improves the convenience of practical training and system stability. .
Patent Information
- Application Number
- CN202011427151.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-09
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2040-12-09
AI Technical Summary
In the CBTC simulation system, due to the special nature of subway operations, the operation conditions of each time period are different, resulting in students needing to frequently re-compile the operation chart during training to match the current time, which is cumbersome and has poor convenience.
By obtaining the target simulation time and local time, calculating the time difference value, obtaining the calculation formula of the simulation time, and determining whether the time difference value needs to be updated based on the time interval, the automatic matching of the simulation time and local time is achieved, and the time calculation caused by manual modification is avoided. Error and system exceptions.
Automatic matching of simulation time and local time in CBTC simulation system is realized, reducing the cumbersomeness of manual operation, avoiding time calculation errors and system abnormalities, and improving the convenience and stability of practical training.
Smart Images

Figure CN112597635B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of clock technology, and in particular relates to a method, device and equipment for generating a virtual clock system based on a CBTC simulation system. Background Art
[0002] CBTC (Communication Based Train Control System) is a train operation control system based on communication technology, which has emerged with the rapid development of communication technology, especially radio technology. In order to enable students to better understand the CBTC system, its workflow and principles, and improve their ability to quickly integrate into the work environment after graduation, students are usually required to learn in real scenarios. However, due to the limitations of real-life scenarios, students cannot be immersed in the cognitive system, nor can they fully observe the entire system operation process. Therefore, a CBTC simulation system is usually set up in schools.
[0003] The CBTC simulation system includes the ATP (Automatic Train Protection) simulation system, the ATO (Automatic Train Operation) simulation system and the ATS (Automatic Train Supervision) simulation system, as well as the operation diagram simulation system and the train entry and exit plan management simulation system. Combined with the real city subway line scene built with 3D virtual simulation technology, a simulation system that restores the real system functions 1:1 has been built. All systems complement and interact with each other.
[0004] However, due to the particularity of subway operation, there will be different situations in each time period. When students are doing practical training, the start time of the practical training is not fixed, and the simulation time required for each practical training scenario is also not fixed, resulting in the need to re-compile the operation diagram every time to match the current computer to complete the matching of train departure and operation diagram, or modify the computer time to meet the simulation time requirements. The operation process is cumbersome and inconvenient. Summary of the invention
[0005] In order to at least solve the above problems existing in the prior art, the present invention provides a method, device and equipment for generating a virtual clock system based on a CBTC simulation system to achieve automatic matching of simulation time and local time, thereby making practical training more convenient.
[0006] The technical solution provided by the present invention is as follows:
[0007] On the one hand, a method for generating a virtual clock system based on a CBTC simulation system includes:
[0008] Get the target simulation time and local time;
[0009] Calculate a first time difference according to the target simulation time and the local time;
[0010] According to the first time difference, obtaining a calculation formula for simulation time;
[0011] Calculate a second time difference based on the calculation formula and the first time interval;
[0012] Determine whether the difference between the second time difference and the first time difference is less than a difference threshold; the difference threshold is greater than the first time interval;
[0013] If the difference between the second time difference and the first time difference is greater than a difference threshold, the first time difference is updated.
[0014] Optionally, calculating the second time difference based on the calculation formula and the first time interval includes:
[0015] At intervals of the first time interval, calculating the second time difference;
[0016] The second time difference is the difference between the local time and the last simulation time.
[0017] Optionally, also include:
[0018] Based on the current date and the simulation time, the full simulation date is determined.
[0019] Optionally, updating the first time difference includes:
[0020] The current local time and the current virtual time are obtained, and a new first time difference is calculated according to the current local time and the current virtual time; and the calculation formula is updated according to the new first time difference.
[0021] Optionally, it also includes: if the second time difference is less than the difference threshold, the last simulation time is equal to the simulation time.
[0022] In another aspect, a generation device of a virtual clock system based on a CBTC simulation system includes: an acquisition module, a first calculation module, a determination module, a second calculation module, a judgment module, and an update module;
[0023] The acquisition module is used to acquire the target simulation time and the local time;
[0024] The first calculation module is used to calculate a first time difference according to the target simulation time and the local time;
[0025] The determining module is used to obtain a calculation formula for simulation time according to the first time difference;
[0026] The second calculation module is used to calculate a second time difference based on the calculation formula and the first time interval;
[0027] The judging module is used to judge whether the difference between the second time difference and the first time difference is less than a difference threshold; the difference threshold is greater than the first time interval;
[0028] The updating module is used to update the first time difference when the difference between the second time difference and the first time difference is greater than a difference threshold.
[0029] Optionally, the second calculation module is used to calculate the second time difference at the first time interval; the second time difference is the difference between the local time and the last simulation time.
[0030] Optionally, the updating module is used to obtain the current local time and the current virtual time, calculate a new first time difference according to the current local time and the current virtual time; and update the calculation formula according to the new first time difference.
[0031] Optionally, the updating module is further used to determine that the last simulation time is equal to the simulation time when the second time difference is less than a difference threshold.
[0032] In another aspect, a device for generating a virtual clock system based on a CBTC simulation system includes: a processor, and a memory connected to the processor;
[0033] The memory is used to store a computer program, and the computer program is used to at least execute the method for generating a virtual clock system based on a CBTC simulation system as described in any of the above items;
[0034] The processor is used to call and execute the computer program in the memory.
[0035] The beneficial effects of the present invention are:
[0036] The generation method, device and equipment of the virtual clock system based on the CBTC simulation system provided by the embodiment of the present invention obtains the target simulation time and the local time; calculates the first time difference according to the target simulation time and the local time; obtains the calculation formula of the simulation time according to the first time difference; calculates the second time difference based on the calculation formula and the first time interval; determines whether the difference between the second time difference and the first time difference is less than the difference threshold; the difference threshold is greater than the first time interval; if the difference between the second time difference and the first time difference is greater than the difference threshold, the first time difference is updated. Among them, the calculation of the simulation time is realized by subtracting the difference from the computer time, thereby avoiding the technical problem of time calculation error caused by unstable interval when manually calculating the time; the automatic repair idea of the simulation time avoids the system abnormality caused by the simulation time jump caused by artificial modification of the system time during the software operation. This system can set the starting point of the time to be simulated by the students in this practical training, without modifying the current time of the computer, which is convenient and fast. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in 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 only 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.
[0038] Figure 1 A flowchart of a method for generating a virtual clock system based on a CBTC simulation system provided by an embodiment of the present invention;
[0039] Figure 2 A schematic diagram of the structure of a device for generating a virtual clock system based on a CBTC simulation system provided by an embodiment of the present invention;
[0040] Figure 3 A schematic diagram of the structure of a device for generating a virtual clock system based on a CBTC simulation system provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0041] To make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be described in detail below. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other implementation methods obtained by ordinary technicians in this field without creative work belong to the scope of protection of the present invention.
[0042] In order to at least solve the technical problem proposed in the present invention, an embodiment of the present invention provides a method for generating a virtual clock system based on a CBTC simulation system.
[0043] Figure 1 A schematic diagram of a method for generating a virtual clock system based on a CBTC simulation system according to an embodiment of the present invention is provided. Figure 1 The method provided by the embodiment of the present invention may include the following steps:
[0044] S11. Obtain target simulation time and local time.
[0045] In a specific implementation process, the CBTC simulation system of any school can be defined as the target simulation system. Then, based on the target simulation system, the clock system can be generated using the method for generating a virtual clock system based on the CBTC simulation system of the present application, thereby facilitating students' practical training.
[0046] For example, the time point to be simulated, i.e., the target simulation time, can be set by an administrator such as a teacher or a monitor. For example, the target simulation time is 8:00 a.m. The clock system is started, and the system obtains the target simulation time and the current time of the local computer, i.e., the local time. For example, the local time is 10:00 a.m. It is worth noting that the target simulation time and the local time are only listed here, and are not limited. In this embodiment, in order to illustrate the scheme, the entire scheme is explained based on the listed 8:00 a.m. and 10:00 a.m. as examples.
[0047] After the training starts, the local time changes and the simulation time also changes.
[0048] S12. Calculate a first time difference according to the target simulation time and the local time.
[0049] For example, to explain the solution clearly and conveniently, after the system is started, the local time obtained is counted as L. Then the first time difference S=local time L-target simulation time. In this embodiment, the first time difference S=10:00 am-8:00 am=2 hours. For ease of calculation, the unit of the difference S can be set to milliseconds.
[0050] S13. Obtain a calculation formula for simulation time according to the first time difference.
[0051] For example, after obtaining the first time difference S, the calculation formula of the simulation time is obtained, that is, the simulation time C=current local time L-the first time difference S.
[0052] In some embodiments, optionally, it also includes: determining a complete simulation date based on the current date and the simulation time.
[0053] For example, after obtaining the simulation time, add the current date to obtain a complete simulation date + time.
[0054] S14. Calculate a second time difference based on a calculation formula and the first time interval.
[0055] In some embodiments, optionally, calculating the second time difference based on a calculation formula and a first time interval includes: calculating the second time difference at intervals of the first time interval; the second time difference is the difference between the local time and the last simulation time.
[0056] After obtaining the simulation time calculation formula, determine whether the system is shut down. If not, start a separate thread to calculate the second time difference S1 every first time interval. For example, the first time interval can be 10 milliseconds, and a new difference is calculated every 10 milliseconds, that is, the second time difference S1. The second time difference S1 = current local time L - last simulation time O. The initial last simulation time 0 = simulation time C.
[0057] S15. Determine whether the difference between the second time difference and the first time difference is less than a difference threshold; the difference threshold is greater than the first time interval.
[0058] After the second time difference S1 is calculated, the difference between the second time difference S1 and the first time difference S is calculated, and the difference between the second time difference S1 and the first time difference S is compared with the difference threshold. For example, in this embodiment, the difference threshold can be set to 100 milliseconds, and the system calculates the second time difference S1 every 10 milliseconds, and determines whether the error between S1 and S is within 100 milliseconds.
[0059] S16: If the difference between the second time difference and the first time difference is greater than the difference threshold, update the first time difference.
[0060] In some embodiments, optionally, updating the first time difference includes: obtaining the current local time and the current virtual time, calculating a new first time difference according to the current local time and the current virtual time; and updating a calculation formula according to the new first time difference.
[0061] For example, if the error between S1 and S exceeds 100 milliseconds, it means that the computer time may have been modified manually. In order not to affect the stability of the running system and avoid time travel, the logic performs automatic repair calculations and calculates a new difference based on the current simulation time again to replace the first time difference S used previously, ensuring that the simulation time will not jump as the current time is modified.
[0062] The method for generating a virtual clock system based on a CBTC simulation system provided by an embodiment of the present invention is as follows: obtaining a target simulation time and a local time; calculating a first time difference according to the target simulation time and the local time; obtaining a calculation formula for the simulation time according to the first time difference; calculating a second time difference based on the calculation formula and a first time interval; judging whether the difference between the second time difference and the first time difference is less than a difference threshold; the difference threshold is greater than the first time interval; if the difference between the second time difference and the first time difference is greater than the difference threshold, then updating the first time difference. The simulation time is calculated by subtracting the difference from the computer time, thereby avoiding the technical problem of time calculation errors caused by unstable intervals when manually calculating the time; the automatic repair idea of the simulation time avoids system anomalies caused by simulation time jumps caused by manual modification of the system time during the software operation.
[0063] Based on a general inventive concept, an embodiment of the present invention further provides a device for generating a virtual clock system based on a CBTC simulation system.
[0064] Figure 2 For a structural diagram of a device for generating a virtual clock system based on a CBTC simulation system provided by an embodiment of the present invention, please refer to Figure 2 , the device provided by the embodiment of the present invention may include the following structures: an acquisition module 21, a first calculation module 22, a determination module 23, a second calculation module 24, a judgment module 25 and an update module 26;
[0065] An acquisition module 21 is used to acquire a target simulation time and a local time;
[0066] A first calculation module 22, used for calculating a first time difference according to a target simulation time and a local time;
[0067] A determination module 23, used to obtain a calculation formula for simulation time according to the first time difference;
[0068] A second calculation module 24, configured to calculate a second time difference based on a calculation formula and the first time interval;
[0069] A judging module 25, used to judge whether the difference between the second time difference and the first time difference is less than a difference threshold; the difference threshold is greater than the first time interval;
[0070] The updating module 26 is configured to update the first time difference when the difference between the second time difference and the first time difference is greater than a difference threshold.
[0071] In some embodiments, optionally, the second calculation module is used to calculate a second time difference at intervals of the first time interval; the second time difference is the difference between the local time and the last simulation time.
[0072] In some embodiments, optionally, an update module is used to obtain the current local time and the current virtual time, calculate a new first time difference according to the current local time and the current virtual time; and update the calculation formula according to the new first time difference.
[0073] In some embodiments, optionally, the updating module is further configured to determine that the last simulation time is equal to the simulation time when the second time difference is less than a difference threshold.
[0074] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0075] The generation device of the virtual clock system based on the CBTC simulation system provided by the embodiment of the present invention obtains the target simulation time and the local time; calculates the first time difference according to the target simulation time and the local time; obtains the calculation formula of the simulation time according to the first time difference; calculates the second time difference based on the calculation formula and the first time interval; determines whether the difference between the second time difference and the first time difference is less than the difference threshold; the difference threshold is greater than the first time interval; if the difference between the second time difference and the first time difference is greater than the difference threshold, the first time difference is updated. The simulation time is calculated by subtracting the difference from the computer time, thereby avoiding the technical problem of time calculation error caused by unstable interval when manually calculating the time; the automatic repair idea of the simulation time avoids the system abnormality caused by the simulation time jump caused by artificial modification of the system time during the software operation.
[0076] Based on a general inventive concept, an embodiment of the present invention further provides a device for generating a virtual clock system based on a CBTC simulation system.
[0077] Figure 3 A schematic diagram of a generation device structure of a virtual clock system based on a CBTC simulation system provided by an embodiment of the present invention is provided in FIG. Figure 3 , a device for generating a virtual clock system based on a CBTC simulation system provided by an embodiment of the present invention includes: a processor 31, and a memory 32 connected to the processor.
[0078] The memory 32 is used to store a computer program, and the computer program is used at least for the method for generating a virtual clock system based on a CBTC simulation system as described in any one of the above embodiments;
[0079] The processor 31 is used to call and execute the computer program in the memory.
[0080] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
[0081] It can be understood that the same or similar parts of the above embodiments can be referenced to each other, and the contents not described in detail in some embodiments can refer to the same or similar contents in other embodiments.
[0082] It should be noted that, in the description of the present invention, the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of the present invention, unless otherwise specified, the meaning of "plurality" refers to at least two.
[0083] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present invention belong.
[0084] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0085] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0086] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0087] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.
[0088] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0089] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.
Claims
1. A method for generating a virtual clock system based on a CBTC simulation system, characterized in that: include: Get the target simulation time and local time; Calculate a first time difference according to the target simulation time and the local time; According to the first time difference, a calculation formula for simulation time is obtained; wherein the calculation formula for simulation time is simulation time = current local time - first time difference; Determine whether the CBTC simulation system is shut down. If the CBTC simulation system is shut down, the process ends; if the CBTC simulation system is not shut down, start a separate thread; in the separate thread, calculate a second time difference based on the calculation formula and the first time interval at each first time interval; wherein, calculating the second time difference based on the calculation formula and the first time interval includes: calculating the second time difference at each first time interval; the second time difference is the difference between the local time and the last simulation time; Determine whether the difference between the second time difference and the first time difference is less than a difference threshold; the difference threshold is greater than the first time interval; If the difference between the second time difference and the first time difference is greater than the difference threshold, updating the first time difference; Wherein, the updating of the first time difference includes: obtaining the current local time and the current virtual time, calculating a new first time difference according to the current local time and the current virtual time; and updating the calculation formula according to the new first time difference; It also includes: if the difference between the second time difference and the first time difference is less than or equal to the difference threshold, the last simulation time is equal to the simulation time.
2. The method according to claim 1, characterized in that Also includes: Based on the current date and the simulation time, the full simulation date is determined.
3. A device for generating a virtual clock system based on a CBTC simulation system, characterized in that: include: An acquisition module, a first calculation module, a determination module, a second calculation module, a judgment module and an update module; The acquisition module is used to acquire the target simulation time and the local time; The first calculation module is used to calculate a first time difference according to the target simulation time and the local time; The determination module is used to obtain a calculation formula for simulation time according to the first time difference; wherein the calculation formula for simulation time is simulation time = current local time - first time difference; The second calculation module is used to determine whether the CBTC simulation system is shut down. If the CBTC simulation system is shut down, the process ends; if the CBTC simulation system is not shut down, a separate thread is started; in the separate thread, at each first time interval, a second time difference is calculated based on the calculation formula and the first time interval; specifically, the second time difference is calculated at each first time interval; the second time difference is the difference between the local time and the last simulation time; The judging module is used to judge whether the difference between the second time difference and the first time difference is less than a difference threshold; the difference threshold is greater than the first time interval; The updating module is used to update the first time difference if the difference between the second time difference and the first time difference is greater than a difference threshold; wherein, the updating of the first time difference includes: obtaining the current local time and the current virtual time, and calculating a new first time difference according to the current local time and the current virtual time; updating the calculation formula according to the new first time difference; and also for, if the difference between the second time difference and the first time difference is less than or equal to the difference threshold, then the last simulation time is equal to the simulation time.
4. A device for generating a virtual clock system based on a CBTC simulation system, characterized in that: include: A processor, and a memory connected to the processor; The memory is used to store a computer program, and the computer program is used to at least execute the method for generating a virtual clock system based on a CBTC simulation system according to any one of claims 1 to 2; The processor is used to call and execute the computer program in the memory.
Citation Information
Patent Citations
Method and system for automatically correcting sampling clocks in digital video system
CN101989417A
Method and device for calibrating local clock
CN103413070A
Distributed file system time error correction method and system
CN103914452A
Data correction method and electronic device
CN105260227A
Fault tolerance processing method and device for clock jumping
CN106033376A
