A method, device, equipment and storage medium for generating train arrival and departure information
The method addresses high computational difficulty in smart subway systems by real-time data processing and verification, enabling efficient generation of train arrival and departure information across diverse subway projects.
Patent Information
- Application Number
- CN202310029564.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-09
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2043-01-09
AI Technical Summary
Existing smart subway systems face high computational difficulty and cost in generating real-time train arrival and departure information due to the challenge of integrating train and signal data from diverse construction units.
A method involving real-time data acquisition, caching, sorting, data association, and integrity verification of point data sets to determine train arrival and departure, using a device with modules for data processing and generation.
Reduces calculation difficulty and cost by effectively generating real-time train arrival and departure information applicable to most subway projects, decoupling data acquisition and processing, and reducing project changes.
Smart Images

Figure CN116142263B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to the field of rail transit, and in particular, to a method, device, equipment, and storage medium for generating train arrival and departure information. Background Art
[0002] At present, subway, as an important mode of transportation for people, has brought great convenience to the lives of residents. With the development of subway, the functions of smart stations and smart lines have been gradually proposed and implemented. The original method based on offline plans and actual operation diagrams has gradually changed to real-time output requirements, and clear requirements have been put forward for the real-time arrival and departure data of trains. As an upper-level application system, smart subways mostly use message queues to receive vehicle data and signal data such as train position and speed. However, in the process of subway line construction, since the train and signal system are usually not built in the same project as the smart subway application, and due to the diversity of products provided by the construction unit, it is difficult for the smart subway application to obtain vehicle data and signal data, which makes the smart subway application have technical problems of high computational difficulty and high computational cost when generating real-time arrival and departure information of trains.
[0003] In summary, how to reduce the computational difficulty of generating real-time arrival and departure information of trains has become a technical problem that urgently needs to be solved. Summary of the invention
[0004] The embodiments of the present invention provide a method, device, equipment and storage medium for generating train arrival and departure information, which solves the technical problem that the prior art has high calculation difficulty and high calculation cost when generating real-time arrival and departure information of trains.
[0005] In a first aspect, an embodiment of the present invention provides a method for generating train arrival and departure information, comprising:
[0006] In each cycle, point data sent by different point data acquisition devices are received in real time and cached, and the cached point data in each cycle is used as the point data set of each cycle, and the point data is obtained by the point data acquisition device collecting data during the operation of the train;
[0007] Sorting the point data in each of the point data sets to obtain a target point data set corresponding to each of the point data sets;
[0008] Associating and checking the integrity of the point data in each of the target point data sets to obtain multiple groups of point data combinations for each of the target point data sets;
[0009] After it is determined that at least one target train has moved according to the combination of multiple sets of point data of two consecutive cycles, determining whether the target train has arrived at or left the station;
[0010] If the target train arrives at the station, the train arrival information of the target train is generated; if the target train leaves the station, the train departure information of the target train is generated.
[0011] In a second aspect, an embodiment of the present invention provides a device for generating train arrival and departure information, including:
[0012] A data cache module is used to receive and cache the point data sent by different point data acquisition devices in real time in each cycle, and use the cached point data in each cycle as the point data set of each cycle, wherein the point data is obtained by collecting data during the operation of the train by the point data acquisition device;
[0013] A data sorting module, used for sorting the point data in each of the point data sets to obtain a target point data set corresponding to each of the point data sets;
[0014] A data verification module is used to associate and verify the integrity of the point data in each target point data set to obtain multiple groups of point data combinations for each target point data set;
[0015] An arrival and departure determination module is used to determine whether the target train arrives at the station or leaves the station after it is determined that at least one target train has moved according to a combination of multiple sets of point data of two consecutive cycles;
[0016] The information generation module is used to generate the train arrival information of the target train if the target train arrives at the station; and to generate the train departure information of the target train if the target train leaves the station.
[0017] In a third aspect, an embodiment of the present invention further provides a device for generating train arrival and departure information, including a processor and a memory;
[0018] The memory is used to store a computer program and transmit the computer program to the processor;
[0019] The processor is used to execute a method for generating train arrival and departure information as described in the first aspect according to instructions in the computer program.
[0020] In a fourth aspect, an embodiment of the present invention further provides a storage medium storing computer executable instructions, wherein the computer executable instructions, when executed by a computer processor, are used to execute a method for generating train arrival and departure information as described in the first aspect.
[0021] As mentioned above, the embodiment of the present invention receives the point data sent by different point data acquisition devices in real time in each cycle and constructs a point data set, and then sorts the point data, performs data association and integrity verification to obtain multiple groups of point data combinations. When it is determined that at least one target train has moved based on the combination of multiple groups of point data in two consecutive cycles, it is determined whether the target train arrives or leaves the station; if the target train arrives, the train arrival information of the target train is generated; if the target train leaves, the train departure information of the target train is generated. The train arrival and departure information generation method provided by the embodiment of the present invention is highly applicable, meets the implementation conditions of most subway projects, can be applied to most subway lines, can reduce the calculation difficulty of generating real-time arrival and departure information of trains, and can effectively reduce the cost generated by project changes, solving the technical problem that the existing technology has high calculation difficulty and high calculation cost when generating real-time arrival and departure information of trains. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 A flowchart of a method for generating train arrival and departure information provided by an embodiment of the present invention.
[0023] Figure 2 A schematic diagram of a segment provided in an embodiment of the present invention.
[0024] Figure 3 A flowchart of another method for generating train arrival and departure information provided by an embodiment of the present invention.
[0025] Figure 4 A schematic diagram of train start and stop provided in an embodiment of the present invention.
[0026] Figure 5 A step structure diagram of a method for generating train arrival and departure information provided in an embodiment of the present invention.
[0027] Figure 6 A schematic diagram of the structure of a device for generating train arrival and departure information provided by an embodiment of the present invention.
[0028] Figure 7 A schematic diagram of the structure of a train arrival and departure information generating device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0029] The following description and accompanying drawings fully illustrate the specific embodiments of the present application so that those skilled in the art can practice them. The examples represent possible variations only. Unless explicitly required, separate components and functions are optional, and the order of operation can vary. The parts and features of some embodiments may be included in or replace the parts and features of other embodiments. The scope of the embodiments of the present application includes the entire scope of the claims, and all available equivalents of the claims. In this article, each embodiment may be represented individually or generally by the term "invention", which is only for convenience, and if more than one invention is disclosed in fact, it is not intended to automatically limit the scope of the application to any single invention or inventive concept. In this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, without requiring or implying any actual relationship or order between these entities or operations. Moreover, the term "include", "comprise" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method or device including a series of elements includes not only those elements, but also other elements that are not explicitly listed. The various embodiments are described in a progressive manner herein, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other. As for the structures, products, etc. disclosed in the embodiments, since they correspond to the parts disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method part.
[0030] like Figure 1 As shown, Figure 1 A flowchart of a method for generating train arrival and departure information provided in an embodiment of the present invention. The method for generating train arrival and departure information provided in an embodiment of the present invention can be executed by a train arrival and departure information generating device, and the train arrival and departure information generating device can be implemented by software and / or hardware. The train arrival and departure information generating device can be composed of two or more physical entities, or can be composed of one physical entity. For example, the train arrival and departure information generating device can be a computer, a host computer, a tablet and other devices. In addition, the train arrival and departure information generating device includes multiple distributed nodes, and different distributed nodes are used to execute a step in the method for generating train arrival and departure information provided in an embodiment of the present invention, or a specific function in a step, which is not specifically limited in this embodiment. The method includes the following steps:
[0031] Step 101, in each cycle, point data sent by different point data acquisition devices are received in real time and cached, and the cached point data in each cycle is used as the point data set of each cycle. The point data is obtained by collecting data from the point data acquisition device during the operation of the train.
[0032] In this embodiment, in each cycle, it is necessary to receive point data sent by different point data acquisition devices in real time, wherein the point data is obtained by collecting data from the point data acquisition device during the operation of the train. Specifically, in the construction of the smart subway, the data of the train and signal system are often collected through the comprehensive monitoring system and then uploaded to the smart subway platform. The comprehensive monitoring collects data through the model of line-station-system-equipment-point, and one point is a data collection point. Exemplarily, Guangzhou Line 5 (line)-Yuancun Station (station)-vehicle system (system)-train set 1 (equipment)-real-time speed (point), wherein the equipment is the point data acquisition device, and a point data acquisition device can obtain point data collected at multiple different points, and different point data include various status data of the train during operation.
[0033] In one embodiment, the point data includes vehicle data and signal data. The vehicle data includes the train set number. The signal data includes the train number, the train set number, the train destination station and the name of the section where the train is currently located. When sending the point data, the point data acquisition device also sends the collection time when the point data is collected.
[0034] Among them, a section refers to the use of rail insulation between track circuits to isolate two track circuits into independent circuit units that do not interfere with each other. Each track circuit unit is called a track circuit section. During operation, when a train passes through a section, the signal system can identify that the train is in a certain section. Figure 2 As shown. Logically, the section divides the track into continuous segments. When the train is running, it passes through a series of sections in sequence. When the train arrives at the station and stops, the location where the train stops is a clear section. In addition, when the point data acquisition device sends the point data to the train departure information generation device, it will also upload the time when the point data is collected, that is, the collection time. The collection time is not affected by factors such as the system time of the train departure information generation device.
[0035] In one embodiment, after different point data collection devices collect point data in real time, they can input the point data into Kafka, and then Kafka will transmit the point data to the train departure information generation device for processing. The use of Kafka can decouple the point data collection device from the train departure information generation device. Among them, Kafka is a high-throughput distributed publish-subscribe message system that can process all action stream data of consumers on the website. Kafka has the following characteristics: (1) It provides message persistence through O(1) disk data structure. This structure can maintain long-term stable performance even for TB of message storage. (2) High throughput: Even very ordinary hardware Kafka can support millions of messages per second. (3) Supports partitioning messages through Kafka servers and consumer machine clusters. (4) Supports Hadoop parallel data loading.
[0036] The point data transmitted by Kafka may not be processed by the train to the departure information generating device at the same time due to various factors such as network delay and source data end. Therefore, a data delay processing mechanism is added in this embodiment, that is, the point data received in each cycle is temporarily cached, and a water level is generated according to each point data, and an interval is generated between the water level and the current time, which can ensure that the point data entering the downstream distributed node is complete to a certain extent. For example, a 5-second cache cycle can be set, then the water level time is less than 5 seconds of the current time, and the point data within 5 seconds is temporarily cached. When the current time flows backward for 1 second, the water level also moves backward for 1 second, and the point data collected within this 1 second is sent to the downstream distributed node for processing, regardless of which time this data is received by the train to the departure information generating device in the 5-second cache cycle. It can be understood that in this embodiment, the time length of the cycle can be set according to actual needs, and is not specifically limited in this embodiment.
[0037] Step 102: sort the point data in each point data set to obtain a target point data set corresponding to each point data set.
[0038] After obtaining the point data set of each period, in order to ensure the accuracy of the subsequent association of the point data, it is necessary to further sort the point data in the point data set. Exemplarily, the point data can be sorted according to the acquisition time. After re-sorting the point data in each point data set, the target point data set corresponding to each point data set can be obtained.
[0039] On the basis of the above embodiment, in step 102, the point data in each point data set are sorted to obtain a target point data set corresponding to each point data set, including:
[0040] Step 1021: sort the point data in each point data set according to the acquisition time to obtain a target point data set corresponding to each point data set; wherein, when the acquisition time is the same, sort the point data according to the field name of the point data.
[0041] In one embodiment, when sorting the point data in the point data set, it is first necessary to sort the point data in each point data set according to the acquisition time. When the acquisition time is the same (the number of milliseconds is the same), the point data is sorted according to the weight of the name of the point data. Exemplarily, when the acquisition time of multiple point data is the same, the point data with the field name of the train number can be arranged first, and the point data with the field name of the current section name of the train number can be arranged at the end, so that when processing the target point data set later, the change of the train number can be processed first and then the change of the position.
[0042] On the basis of the above embodiment, step 1021, when the acquisition time is the same, sorting the point data according to the name of the point data includes:
[0043] Step 10211: When the collection time is the same, the point data are sorted in sequence according to the train number, train group number, train destination station and the name of the section where the train is currently located.
[0044] In one embodiment, when sorting the point data in the point data set, if the collection time is consistent, the point data is sorted according to the field name corresponding to the point data. Specifically, the point data is sorted according to the train number, the train group number, the train destination station and the name of the section where the train is currently located. The reason for re-sorting the point data in this embodiment is that the same collection point will collect point data of different trains at different collection times. For example, the same point will transmit data of two train numbers 15046601 and 14036020 at different collection times. Therefore, the train arrival and departure information generation device needs to first determine the change of the train number, and then determine the position change of the train corresponding to the train number.
[0045] Step 103: associate and perform integrity check on the point data in each target point data set to obtain multiple groups of point data combinations for each target point data set.
[0046] After obtaining the target point data set for each cycle, the train arrival and departure information generating device further outputs the target point data set to the next distributed node for processing. After receiving the target point data set, the next distributed node associates and verifies the integrity of the point data in the target point data set. Specifically, when associating the point data, the point data belonging to the same train number can be associated to obtain the complete data of a train, that is, the point data combination corresponding to each train number, and then each point data combination is checked for integrity to ensure that each point data in each point data combination has a corresponding value.
[0047] On the basis of the above embodiment, in step 103, the point data in each target point data set are associated and integrity checked to obtain multiple groups of point data combinations of each target point data set, including:
[0048] Step 1031: group the point data in each target point data set according to the data source, and associate the point data belonging to the same train in each group to obtain a combination of train point data corresponding to different trains in each target point data set.
[0049] In one embodiment, before associating the point data in the target point data set, the point data are first grouped according to the data source. Specifically, the point data in the target point data set can be grouped according to the data source of the point data (i.e., the point data acquisition device from which the point data originates). The reason for grouping according to the point data acquisition device from which the point data originates is that the complete point data of a train trip is generally in one point data acquisition device.
[0050] After grouping the point data in the target point data set, further associate the point data in the equipment point data combination, so as to associate the point data of the same train. It should be noted that since the distributed node does not receive all the data at once when receiving the data of the target point data set, but receives the data in a streaming manner, the distributed node can group and associate the point data of the target point data set while receiving the target point data set. For example, after receiving the point data sent by the upstream distributed node, if the received point data is the train number, the train group number, and the train destination station, the point data is cached; if the received train section name information is the train number, the train group number, and the train destination station, etc., point data are read from the cache and associated with the train section name information, so as to obtain the train point data combination corresponding to different trains.
[0051] Step 1032: perform integrity check on each set of train point data combination to obtain multiple sets of point data combinations for each target point data set.
[0052] After executing step 1031, each set of train point data combination is further checked for integrity to determine whether the point data in each set of train point data combination has a value. After the check is completed, multiple sets of point data combinations corresponding to each target point data set can be obtained, and then the multiple sets of point data combinations can be input into the downstream distributed nodes for processing. It should be noted that when multiple sets of point data combinations are input into the downstream, the point data in each set of point data combinations need to be integrated into the same data stream for transmission.
[0053] Step 104: after it is determined that at least one target train has moved based on the combination of multiple sets of point data of two consecutive cycles, it is determined whether the target train has arrived at or left the station.
[0054] After receiving the multiple sets of point data combinations sent from the upstream, the downstream distributed nodes can further determine whether the target train has arrived at the platform or left the platform after determining that at least one target train has moved based on the multiple sets of point data combinations in two consecutive cycles. Exemplarily, in two consecutive cycles, when the position of the train with the train number 01 is determined to be section A based on the train section name information in a certain point data combination in the first cycle, and the position of the train with the train number 01 is determined to be section B based on the train section name information in a certain point data combination in the second cycle, since the section occupied by the train with the train number 01 has changed, it can be determined that the target train with the train number 01 has moved, and at this time it can be further determined whether the target train has arrived at the station or left the station.
[0055] Based on the above embodiment, in step 104, after determining that at least one target train has moved according to the combination of multiple sets of point data of two consecutive cycles, determining whether the target train has arrived at or left the station includes:
[0056] Step 1041: for multiple groups of point data combinations of consecutive first periods and second periods, the multiple groups of point data combinations of the first period and the multiple groups of point data combinations of the second period are regrouped according to the vehicle group number to obtain the first point data combination corresponding to each vehicle group number in the first period and the second point data combination corresponding to each vehicle group number in the second period, wherein the first point data combination and the second point data combination include signal data corresponding to each vehicle group number.
[0057] In this embodiment, for the first cycle and the second cycle in two consecutive cycles, it is necessary to regroup the multiple groups of point data combinations in the first cycle and the multiple groups of point data in the second cycle according to the train set number. The reason for regrouping by the train set number is that the same train set number may run different trains. In some special cases, even the same train set number may run two trains in succession. Therefore, it is necessary to regroup the multiple groups of point data combinations in the first cycle and the second cycle according to the train set number, and obtain the first point data combination corresponding to each train set number in the first cycle and the second point data combination corresponding to each train set number in the second cycle. The first point data combination and the second point data combination both include the train set number and the signal data corresponding to each train set number, that is, they include {train set number, train number, train destination station, and the name of the section where the train is currently located}. It can be understood that the vehicle data and signal data in the point data can be matched by the train set number.
[0058] Step 1042: For each set of first point data combination, in the second point data combination, according to the target second point data combination with the same target train set number, after determining that the name of the section in which the train is currently located has changed, determine that the target train corresponding to the target train set number has moved, and determine whether the target train has arrived at or left the station.
[0059] Afterwards, for the first point position data combination corresponding to each train group number in the first cycle, according to the second point position data combination with the same target train group number in the second cycle, the name of the section where the train number of the target train group number is located is determined. If it is different from the name of the section where the train number of the target train group number is currently located in the first cycle, it can be determined that the target train corresponding to the target train group number moves. For example, a group of first point position data combinations in the first cycle is {train group number 01, train number 111, train number destination station S, train number current section name A}, and in the second cycle, the second point position data combination of train group number 01 is {train group number 01, train number 111, train number destination station S, train number current section name B}, which can determine the movement of the target train of train group number 01. Afterwards, the target first point position data combination corresponding to the target train group number in the first cycle can be output to the downstream distributed nodes, so that the downstream distributed nodes further determine whether the target train arrives or leaves the station according to the target first point position data combination. It should be noted that, since the point data collection device will collect point data corresponding to the train at different times when the train is running in a section, the train arrival and departure information generation device needs to ensure that the target first point data will be pushed to the downstream for processing only after the train position changes. In another embodiment, when the train number corresponding to the same train changes, the target first point data can also be pushed to the downstream for processing.
[0060] Based on the above embodiment, determining whether the target train arrives at or leaves the station in step 1042 includes:
[0061] Step 10421, cache the name of the section where the train number in the target first point data combination corresponding to the target train group number is currently located.
[0062] When determining whether the target train corresponding to the target train set number has arrived at or left the station, first obtain the target first point data combination corresponding to the target train set number in the first point data combination of the first cycle, and cache the name of the section where the train number in the target first point data combination is currently located.
[0063] Step 10422: Determine whether the target train has arrived or left the station based on the name of the section in which the currently cached train number is currently located and the name of the section in which the last cached train number corresponding to the target train set number is currently located.
[0064] After that, further determine whether the target train has arrived or left the station according to the name of the current section of the currently cached train number and the name of the current section of the last time the target train number corresponding to the train number moved. Specifically, determine whether the target train has arrived or left the station according to the name of the current section of the currently cached train number and the name of the current section of the last cached train number corresponding to the target train number, including:
[0065] Step 104221, determine whether the name of the section currently located by the currently cached train number is the name of the station section.
[0066] Step 104222: If it is the name of the station section, determine the arrival of the target train, and use the collection time of the target first point data combination as the arrival time of the target train.
[0067] In this embodiment, it is first determined whether the name of the section in which the currently cached train number is currently located is the name of the station section. If so, it means that the target train is currently located in the station section, and the arrival of the target train can be determined. The collection time of the target first point position data combination is used as the arrival time of the target train, and the arrival time and the target first point position data combination are cached. It can be understood that since the target first point position data combination only includes the point position data of a train with one train set number, the point position data of the same train are generally collected within the same collection time.
[0068] Step 104223: If it is not the name of the station section, determine whether the name of the section in which the train number corresponding to the target train set number cached last time is currently located is the name of the station section.
[0069] If the section name of the currently cached train number is not the name of the station section, it is necessary to obtain the section name of the currently cached train number corresponding to the target train set number after the last target train moved, and determine whether the section name of the currently cached train number is the name of the station section.
[0070] Step 104224: If it is the name of the station section, determine that the target train leaves the station, and use the collection time of the target first point data combination as the departure time of the target train.
[0071] If the name of the section where the last cached train is currently located is the name of the station section, it means that the target train entered the station section after the last movement, and the target train has moved again this time, then it can be considered that the target train has left the station section, so it can be determined that the target train has left the station. At this time, the acquisition time of the target first point data combination is used as the departure time of the target train, and the departure time and the target first point data combination are cached. It can be understood that since it takes a certain amount of time for the target train to stop at the station and start to leave the station, a large number of cycles will pass during this time, so the target first point data combination cached when confirming the arrival of the target train is not the same as the target first point data combination cached when confirming the departure of the target train.
[0072] Step 105: If the target train arrives at the station, generate the train arrival information of the target train; if the target train leaves the station, generate the train departure information of the target train.
[0073] After confirming the arrival of the target train, the arrival information of the target train can be generated according to the cached arrival time and the combination of the target first point data. For example, the arrival information can be: the train with the destination station S, the train group number 01, and the train number 111 arrives at station A at time XX. Similarly, the departure information of the target train can also be generated in the same way, which will not be repeated in this embodiment.
[0074] Based on the above embodiment, the vehicle data also includes the real-time speed of the train, and the first point data combination also includes the real-time speed of the train corresponding to each vehicle group number.
[0075] In this embodiment, the point data acquired by the point data acquisition device also includes the real-time speed of the train. When the first point data combination corresponding to the train set number is generated in each cycle, the first point data combination also includes the real-time speed of the train corresponding to each train set number. For example, the first point data combination is: {train set number 01, train number 111, train number destination station S, real-time speed xm / s, name of the current section of the train number B}.
[0076] In one embodiment, Figure 3 As shown, after generating the train arrival information and train departure information corresponding to the target train, the following steps are also included:
[0077] Step 106: According to the target train group number, obtain all first point position data combinations of the target train in the station section.
[0078] In one embodiment, after the arrival and departure information of the target train at a certain station is generated, since the segment has a length, the arrival time is actually the time when the target train enters the station segment, and the departure time is actually the time when the target train leaves the station segment. However, after the train enters the station segment, there will be a process of deceleration-stopping-starting, such as Figure 4 As shown. Therefore, the arrival time and departure time are inaccurate for the actual stop time and start time of the target train. Therefore, in this embodiment, the train arrival information and train departure information need to be further updated. Specifically, in this embodiment, it is first necessary to obtain all the first point position data combinations of the target train in the station section according to the target train set number. Exemplarily, all the first point position data combinations of the target train in the station section can be obtained according to the target train set number and the name of the station section.
[0079] Step 107, obtain the real-time speed of the train in all first point data combinations, determine the parking time and starting time of the train in the station section, update the train arrival information according to the parking time, and update the train departure information according to the starting time.
[0080] Afterwards, for all first-point data combinations of the target train in the station section, the real-time speed of the train is obtained from all the first-point data combinations respectively. When the real-time speed of the train becomes 0 and then becomes greater than 0, a pair of data of the target train stopping and restarting can be recorded. At the same time, according to the acquisition time of the corresponding first-point data, the stopping time and starting time of the target train in the station section can be recorded. Finally, the train arrival information is updated according to the stopping time, and the train departure information is updated according to the starting time, so as to obtain accurate arrival information and departure information. In one embodiment, the overall process is as follows: Figure 5 shown.
[0081] In addition, it is necessary to further explain that for certain specific situations, such as the situation where the train turns back before the station, there is a switch between the station and the previous station. After the train arrives at the destination station of the train, it will directly run in the opposite direction at the platform and switch to the up or down line through the switch between the previous station. At this time, the train number will change. In this case, when the arrival time and the target first point data combination are cached when the train arrives at the station, the train group number, the arrival time and the name of the current section of the train number can be bound and cached, so that even when the train number changes, since the train group number has not changed, the train number destination station can still be associated with the arrival information of the train group number. Specifically, the train number in the target first point data combination currently cached by the train is compared with the train number in the target first point data combination cached last time. If it is the same train number, it is a normal way to leave the station or turn back after the station. If it is a different train number, it can be judged as a way to turn back before the station. At this time, the arrival information and departure information of the train can be generated according to the different train numbers.
[0082] In addition, when the arrival and departure information are updated according to the start and stop times of the train, the start and stop times of multiple groups of trains may be included in the station section. This situation may be caused by the train not stopping in place, etc. When determining the start and stop times, the start and stop times of the group with the longest stop time can be used as the actual start and stop times.
[0083] As mentioned above, the embodiment of the present invention receives the point data sent by different point data acquisition devices in real time in each cycle and constructs a point data set, and then sorts the point data, performs data association and integrity verification to obtain multiple groups of point data combinations. When it is determined that at least one target train has moved based on the combination of multiple groups of point data in two consecutive cycles, it is determined whether the target train arrives or leaves the station; if the target train arrives, the train arrival information of the target train is generated; if the target train leaves, the train departure information of the target train is generated. The train arrival and departure information generation method provided by the embodiment of the present invention is highly applicable, meets the implementation conditions of most subway projects, can be applied to most subway lines, can reduce the calculation difficulty of generating real-time arrival and departure information of trains, and can effectively reduce the cost generated by project changes, solving the technical problem that the existing technology has high calculation difficulty and high calculation cost when generating real-time arrival and departure information of trains.
[0084] In addition, in the embodiment of the present invention, Kafka is also used to decouple the point data acquisition device from the train arrival and departure information generation device. At the same time, when the train arrival and departure information generation device processes the point data transmitted by Kafka, the data matching and data delay problems generated by Kafka in the data transmission process are considered. Therefore, Kafka can be used as a message middleware without the need for strict consistency in message transmission.
[0085] like Figure 6 As shown, Figure 6 A train arrival and departure information generating device provided by an embodiment of the present invention includes:
[0086] The data cache module 201 is used to receive and cache the point data sent by different point data acquisition devices in real time in each cycle, and use the cached point data in each cycle as the point data set of each cycle. The point data is obtained by collecting data during the operation of the train by the point data acquisition device;
[0087] The data sorting module 202 is used to sort the point data in each point data set to obtain a target point data set corresponding to each point data set;
[0088] The data verification module 203 is used to associate and verify the integrity of the point data in each target point data set to obtain multiple groups of point data combinations for each target point data set;
[0089] The arrival and departure determination module 204 is used to determine whether the target train arrives at the station or leaves the station after it is determined that at least one target train has moved according to the combination of multiple sets of point data of two consecutive cycles;
[0090] The information generation module 205 is used to generate the train arrival information of the target train if the target train arrives at the station; and to generate the train departure information of the target train if the target train leaves the station.
[0091] Based on the above embodiment, the point data includes vehicle data and signal data. The vehicle data includes the train set number. The signal data includes the train number, the train set number, the train destination station and the name of the section where the train is currently located. When sending the point data, the point data acquisition device also sends the collection time when the point data is collected.
[0092] Based on the above embodiment, the data sorting module 202 is specifically used to sort the point data in each point data set according to the acquisition time, and obtain the target point data set corresponding to each point data set; wherein, when the acquisition time is the same, the point data is sorted according to the field name of the point data.
[0093] On the basis of the above embodiment, the data sorting module 202 is specifically used to sort the point data according to the train number, train group number, train destination station and the name of the current section of the train when the collection time is the same.
[0094] Based on the above embodiment, the data verification module 203 includes:
[0095] The first grouping subunit is used to group the point data in each target point data set according to the data source, and associate the point data belonging to the same train in each group to obtain the train point data combination corresponding to different trains in each target point data set;
[0096] The array check subunit is used to perform integrity check on each set of train point data combination to obtain multiple sets of point data combinations for each target point data set.
[0097] Based on the above embodiment, the arrival and departure determination module 204 includes:
[0098] A second grouping subunit is used for regrouping the multiple groups of point data combinations of the first period and the second period according to the vehicle group number, so as to obtain the first point data combination corresponding to each vehicle group number in the first period and the second point data combination corresponding to each vehicle group number in the second period, wherein the first point data combination and the second point data combination both include the vehicle group number and the signal data corresponding to each vehicle group number;
[0099] The movement determination subunit is used to determine, for each group of first point data combinations, that after the name of the section in which the train is currently located changes according to the target second point data combination with the same target train set number in the second point data combination, determine that the target train corresponding to the target train set number has moved, and determine whether the target train has arrived at or left the station.
[0100] On the basis of the above embodiment, the mobile determination subunit is specifically used to cache the name of the current section of the train in the target first point data combination corresponding to the target train number; determine whether the target train has arrived at or left the station based on the current section name of the currently cached train number and the current section name of the train number corresponding to the target train number cached last time.
[0101] On the basis of the above embodiment, the mobile determination subunit is specifically used to determine whether the name of the section in which the currently cached train number is currently located is the name of the station section; if it is the name of the station section, the arrival of the target train is determined, and the collection time of the target first point data combination is used as the arrival time of the target train; if it is not the name of the station section, determine whether the name of the section in which the train number corresponding to the target train set number cached last time is currently located is the name of the station section; if it is the name of the station section, determine the departure of the target train, and use the collection time of the target first point data combination as the departure time of the target train.
[0102] Based on the above embodiment, the vehicle data further includes the real-time speed of the train, and the first point data combination further includes the real-time speed of the train corresponding to each vehicle group number;
[0103] The train arrival and departure information generating device also includes:
[0104] A data acquisition module is used to acquire all first point data combinations of the target train in the station section according to the target train group number;
[0105] The information update module is used to obtain the real-time speed of the train in all the first point data combinations, determine the parking time and starting time of the train in the station section, update the train arrival information according to the parking time, and update the train departure information according to the starting time.
[0106] This embodiment also provides a train arrival and departure information generating device, such as Figure 7 As shown, a train arrival and departure information generating device 30, the train arrival and departure information generating device comprises a processor 300 and a memory 301;
[0107] The memory 301 is used to store a computer program 302 and transmit the computer program 302 to the processor;
[0108] The processor 300 is used to execute the steps in the above-mentioned embodiment of the method for generating train arrival and departure information according to the instructions in the computer program 302.
[0109] Exemplarily, the computer program 302 may be divided into one or more modules / units, which are stored in the memory 301 and executed by the processor 300 to complete the present application. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program 302 in the train arrival and departure information generating device 30.
[0110] The train arrival and departure information generating device 30 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The train arrival and departure information generating device 30 may include, but is not limited to, a processor 300 and a memory 301. Those skilled in the art will appreciate that Figure 7 It is only an example of the train arrival and departure information generating device 30 and does not constitute a limitation of the train arrival and departure information generating device 30. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the train arrival and departure information generating device 30 may also include input and output devices, network access devices, buses, etc.
[0111] The processor 300 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0112] The memory 301 may be an internal storage unit of the train arrival and departure information generating device 30, such as a hard disk or memory of the train arrival and departure information generating device 30. The memory 301 may also be an external storage device of the train arrival and departure information generating device 30, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), etc. equipped on the train arrival and departure information generating device 30. Further, the memory 301 may also include both the internal storage unit of the train arrival and departure information generating device 30 and an external storage device. The memory 301 is used to store the computer program and other programs and data required by the train arrival and departure information generating device 30. The memory 301 may also be used to temporarily store data that has been output or is to be output.
[0113] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0114] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0115] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0116] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0117] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store computer programs.
[0118] An embodiment of the present invention further provides a storage medium containing computer executable instructions, wherein the computer executable instructions are used to execute a method for generating train arrival and departure information when executed by a computer processor, the method comprising the following steps:
[0119] In each cycle, the point data sent by different point data acquisition devices are received in real time and cached, and the cached point data in each cycle is used as the point data set of each cycle. The point data is obtained by collecting data from the point data acquisition device during the operation of the train;
[0120] Sorting the point data in each point data set to obtain a target point data set corresponding to each point data set;
[0121] Associating and checking the integrity of the point data in each target point data set to obtain multiple groups of point data combinations for each target point data set;
[0122] When it is determined that at least one target train has moved based on the combination of multiple sets of point data of two consecutive cycles, it is determined whether the target train has arrived at or left the station;
[0123] If the target train arrives at the station, the train arrival information of the target train is generated; if the target train leaves the station, the train departure information of the target train is generated.
[0124] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the embodiments of the present invention are not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the protection scope of the embodiments of the present invention. Therefore, although the embodiments of the present invention are described in more detail through the above embodiments, the embodiments of the present invention are not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the embodiments of the present invention, and the scope of the embodiments of the present invention is determined by the scope of the appended claims.
Claims
1. A method for generating train arrival and departure information, characterized in that: include: In each cycle, point data sent by different point data acquisition devices are received in real time and cached, and the cached point data in each cycle is used as the point data set of each cycle, and the point data is obtained by the point data acquisition device collecting data during the operation of the train; According to the collection time, the point data in each point data set are sorted to obtain a target point data set corresponding to each point data set; wherein, when the collection time is the same, the point data are sorted in turn according to the train number, the train group number, the train destination station and the name of the section where the train is currently located; the point data includes the train number, the train group number, the train destination station and the name of the section where the train is currently located; Associating and checking the integrity of the point data belonging to the same train number in each of the target point data sets to obtain multiple groups of point data combinations for each of the target point data sets; After it is determined that at least one target train has moved according to the combination of multiple sets of point data of two consecutive cycles, determining whether the target train has arrived at or left the station; Wherein, after determining that at least one target train has moved according to the combination of multiple sets of point data of two consecutive cycles, determining whether the target train has arrived at or left the station includes: In two consecutive cycles, when the current section name of the train with the same train number determined according to the current section name of the train number in the point data combination of the first cycle and the current section name of the train number in the point data combination of the second cycle changes, it is determined that the target train with the train number moves, and whether the target train arrives at or leaves the station; If the target train arrives at the station, the train arrival information of the target train is generated; if the target train leaves the station, the train departure information of the target train is generated.
2. A method for generating train arrival and departure information according to claim 1, characterized in that: The point data includes vehicle data and signal data. The vehicle data includes the train set number. The signal data includes the train number, the train set number, the train destination station and the name of the section where the train is currently located. When sending the point data, the point data acquisition device also sends the collection time when the point data is collected.
3. A method for generating train arrival and departure information according to claim 1, characterized in that: The step of associating and checking the integrity of the point data belonging to the same train number in each of the target point data sets to obtain multiple groups of point data combinations for each of the target point data sets includes: The point data in each target point data set are grouped according to data sources, and the point data belonging to the same train in each group are associated to obtain train point data combinations corresponding to different trains in each target point data set; An integrity check is performed on each group of the train point data combination to obtain multiple groups of point data combinations for each of the target point data sets.
4. A method for generating train arrival and departure information according to claim 2, characterized in that: After determining that at least one target train has moved according to the combination of multiple sets of point data of two consecutive cycles, determining whether the target train has arrived at or left the station includes: For the multiple sets of point data combinations of the consecutive first cycle and the second cycle, the multiple sets of point data combinations of the first cycle and the multiple sets of point data combinations of the second cycle are regrouped according to the vehicle group number to obtain the first point data combination corresponding to each vehicle group number in the first cycle and the second point data combination corresponding to each vehicle group number in the second cycle, wherein the first point data combination and the second point data combination both include the vehicle group number and the signal data corresponding to each vehicle group number; For each group of the first point data combination, in the second point data combination, according to the target second point data combination with the same target train set number, after determining that the name of the section in which the train is currently located has changed, it is determined that the target train corresponding to the target train set number has moved, and it is determined whether the target train has arrived at or left the station.
5. A method for generating train arrival and departure information according to claim 4, characterized in that: The determining whether the target train arrives at or leaves the station includes: Cache the name of the section where the train number in the target first point data combination corresponding to the target train group number is currently located; According to the name of the section where the currently cached train number is currently located, and the name of the section where the last cached train number corresponding to the target train group number is currently located, it is determined whether the target train has arrived at or left the station.
6. A method for generating train arrival and departure information according to claim 5, characterized in that: The determining whether the target train arrives at or leaves the station according to the name of the section currently located by the currently cached train number and the name of the section currently located by the train number corresponding to the target train group number cached last time includes: Determine whether the section name of the currently cached train number is the name of the station section; If it is the name of the station section, determine that the target train has arrived at the station, and use the collection time of the target first point data combination as the arrival time of the target train; If it is not the name of the station section, determine whether the name of the section where the last cached train number corresponding to the target train group number is currently located is the name of the station section; If it is the name of the station section, the departure of the target train is determined, and the collection time of the target first point data combination is used as the departure time of the target train.
7. A method for generating train arrival and departure information according to claim 6, characterized in that: The vehicle data also includes the real-time speed of the train, and the first point data combination also includes the real-time speed of the train corresponding to each of the vehicle group numbers; After generating the train arrival information and train departure information corresponding to the target train, the following steps are also included: According to the target train group number, all first point position data combinations of the target train in the station section are obtained; Acquire the real-time speed of the train in all the first point data combinations, determine the parking time and starting time of the train in the station section, update the arrival information of the train according to the parking time, and update the departure information of the train according to the starting time.
8. A train arrival and departure information generating device, characterized in that: include: A data cache module is used to receive and cache the point data sent by different point data acquisition devices in real time in each cycle, and use the cached point data in each cycle as the point data set of each cycle, wherein the point data is obtained by collecting data during the operation of the train by the point data acquisition device; A data sorting module is used to sort the point data in each point data set according to the collection time, and obtain a target point data set corresponding to each point data set; wherein, when the collection time is the same, the point data are sorted in turn according to the train number, the train group number, the train destination station and the name of the section where the train is currently located; the point data includes the train number, the train group number, the train destination station and the name of the section where the train is currently located; A data verification module is used to associate and verify the integrity of the point data belonging to the same train number in each target point data set to obtain multiple groups of point data combinations for each target point data set; An arrival and departure determination module is used to determine whether the target train arrives at the station or leaves the station after it is determined that at least one target train has moved according to a combination of multiple sets of point data of two consecutive cycles; The arrival and departure determination module is specifically used to determine whether the target train with the same train number has moved and whether the target train has arrived or left the station when the current section name of the train number in the point data combination of the first cycle and the current section name of the train number in the point data combination of the second cycle change in two consecutive cycles; The information generation module is used to generate the train arrival information of the target train if the target train arrives at the station; and to generate the train departure information of the target train if the target train leaves the station.
9. A train arrival and departure information generating device, characterized in that: The train arrival and departure information generating device comprises a processor and a memory; The memory is used to store a computer program and transmit the computer program to the processor; The processor is used to execute a method for generating train arrival and departure information as described in any one of claims 1 to 7 according to instructions in the computer program.
10. A storage medium storing computer executable instructions, characterized in that: The computer executable instructions are used to execute a method for generating train arrival and departure information as described in any one of claims 1 to 7 when executed by a computer processor.