Train data storage method, query method, device and equipment and train system
By determining the time sequence of on-board data packets in the train data storage system and storing the data as full data or jump data, the problem of inefficient data storage and query in the prior art is solved, and efficient data storage and fast-responsive data query are realized.
Patent Information
- Application Number
- CN202311196063.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-15
- Publication Date
- 2025-03-18
AI Technical Summary
The prior art cannot meet the needs of users to store historical data for a long time, and it is also difficult to meet the needs of quickly responding to queries, resulting in inefficient data storage and query.
By acquiring the on-board data stream, determine the time sequence of the on-board data packets in the current frame and the on-board data packets of the last time node stored in the database, store the data as full data or jump data according to the order, reduce the amount of stored data, and use the full data and jump data to complete data during query to achieve fast response.
It reduces the processing pressure of storage programs, reduces disk space usage on the storage side, ensures data security and stability, and at the same time reduces query time and improves the efficiency of data query.
Smart Images

Figure CN119646056A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of railway transportation technology, and in particular to a train data storage method, query method, device, equipment and train system. Background Art
[0002] Currently, the train data storage method adopts the full storage method. With the increase of the amount of on-board data, the data storage engine faces increasing pressure on data transmission and data storage. It cannot meet the user's needs for long-term historical data storage, and it is also difficult to meet the needs of rapid response to queries.
[0003] Therefore, how to meet the current train data storage needs is an important issue that the industry urgently needs to solve. Summary of the invention
[0004] In view of this, an embodiment of the present invention provides a train data storage method, device, equipment and medium to solve the problem that the existing technology cannot meet the user's needs for long-term historical data storage, and it is also difficult to meet the needs of rapid response to queries.
[0005] According to a first aspect, an embodiment of the present invention provides a train data storage method, the method comprising:
[0006] Acquire a vehicle data stream; the vehicle data stream is composed of a plurality of frames of vehicle data packets;
[0007] Determine the temporal sequence of the vehicle-borne data packet of the current frame and the vehicle-borne data packet of the last time node stored in the database; the database stores a number of vehicle-borne data packets of full data type and jump data type;
[0008] Determine that the vehicle-borne data packet of the current frame is behind, and store data of the vehicle-borne data packet of the current frame that is different from the vehicle-borne data packet of the last time node in the database;
[0009] Determine that the vehicle-mounted data packet of the current frame is in front, and store the vehicle-mounted data packet of the current frame in the database.
[0010] In combination with the first aspect, in a first implementation of the first aspect, determining that the vehicle data packet of the current frame is subsequent, and storing data of the vehicle data packet of the current frame that is different from the vehicle data packet of the last time node in the database specifically includes:
[0011] Determine that the vehicle-borne data packet of the current frame is behind;
[0012] Obtain a first point value corresponding to a first point, and obtain a second point value corresponding to a second point; the first point is a data point corresponding to the vehicle data packet of the current frame, and the second point is a data point corresponding to the vehicle data packet of the last time node;
[0013] Acquire a correspondence relationship between the first point and the second point, and determine a point change between the first point and the second point and change data corresponding to the point change based on the correspondence relationship;
[0014] The point change and the change data corresponding to the point change are stored in the database.
[0015] In combination with the first aspect, in a second implementation of the first aspect, determining that the vehicle-mounted data packet of the current frame is in front, and storing the vehicle-mounted data packet of the current frame in the database specifically includes:
[0016] Determine that the vehicle-borne data packet of the current frame is in front;
[0017] Determine whether the database stores all data points at the same time node as the vehicle-borne data packet of the current frame and point data corresponding to the data points;
[0018] Determine that all data points at the same time node and point data corresponding to the data points are not stored;
[0019] The vehicle-mounted data packet of the current frame is stored in the database.
[0020] In combination with the first aspect, in a third implementation of the first aspect, the method further includes:
[0021] At every preset frame, the vehicle-borne data packet corresponding to the corresponding time node is stored in the database.
[0022] According to a second aspect, an embodiment of the present invention further provides a train data query method, the method comprising:
[0023] Obtain a query request from a user that carries a time node to be queried;
[0024] Based on the query request, a first data packet located before the time node to be queried and with the closest time distance is obtained from a database; the database stores a plurality of first data packets and second data packets, the first data packet is an on-board data packet of a full data type, the second data packet is an on-board data packet of a jump data type, and the second data packet is change data between two frames of on-board data packets, and each of the on-board data packets has a corresponding time node;
[0025] Obtain the second data packet between the time node corresponding to the first data packet and the time node to be queried;
[0026] Train data is synthesized based on the first data packet and the second data packet.
[0027] According to a third aspect, an embodiment of the present invention further provides a train data storage device, the device comprising:
[0028] A first acquisition module is used to acquire a vehicle data stream; the vehicle data stream is composed of a plurality of frames of vehicle data packets;
[0029] A node determination module is used to determine the temporal sequence of the vehicle data packet of the current frame and the vehicle data packet of the last time node stored in the database; the database stores a number of vehicle data packets of full data type and jump data type;
[0030] A data filtering module, used for determining that the vehicle-borne data packet of the current frame is behind, and storing data of the vehicle-borne data packet of the current frame that is different from the vehicle-borne data packet of the last time node in the database;
[0031] The data storage module is used to determine that the vehicle-mounted data packet of the current frame is in front, and store the vehicle-mounted data packet of the current frame in the database.
[0032] According to a fourth aspect, an embodiment of the present invention further provides a train data query device, the device comprising:
[0033] The second acquisition module is used to acquire a query request from a user that carries a time node to be queried;
[0034] A first query module is used to obtain, based on the query request, a first data packet that is located before the time node to be queried and has the closest time distance from the database; the database stores a plurality of first data packets and second data packets, the first data packet is an in-vehicle data packet of a full data type, the second data packet is an in-vehicle data packet of a jump data type, and each of the in-vehicle data packets has a corresponding time node;
[0035] A second query module, used to obtain the second data packet between the time node corresponding to the first data packet and the time node to be queried;
[0036] A data synthesis module is used to synthesize train data based on the first data packet and the second data packet.
[0037] According to a fifth aspect, an embodiment of the present invention provides a train system, the system comprising:
[0038] A database, used to store a first data packet and a second data packet; the first data packet is an in-vehicle data packet of a full data type, and the second data packet is an in-vehicle data packet of a jump data type, and each of the in-vehicle data packets has a corresponding time node;
[0039] A data filtering engine, used to determine the temporal sequence of the vehicle-borne data packet of the current frame and the vehicle-borne data packet of the last time node stored in the database, and obtain the first data packet / the second data packet according to the sequence;
[0040] A data storage engine, used for storing the first data packet / the second data packet obtained by the data filtering engine into the database;
[0041] Interface routing is used to obtain a query request from a user that carries a time node to be queried, and based on the query request, obtain from the database the second data packet that is located before the time node to be queried and is closest in time distance, and between the time node corresponding to the first data packet and the time node to be queried, synthesize the first data packet and the second data packet into train data, and feed back the train data to the user.
[0042] According to the sixth aspect, an embodiment of the present invention provides an electronic device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the computer instructions to execute the train data storage method described in the first aspect or any one of the preferred embodiments of the first aspect, or to execute the train data query method described in the preferred embodiments of the second aspect.
[0043] According to the seventh aspect, an embodiment of the present invention provides a computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable the computer to execute the train data storage method described in the first aspect or any preferred embodiment of the first aspect, or to execute the train data query method described in the preferred embodiment of the second aspect.
[0044] The train data storage method, query method, device, equipment and train system provided by the present invention determine the temporal sequence of the on-board data packet of the current frame and the on-board data packet of the last time node stored in the database based on the characteristics of the time series, obtain the full amount of data or jump data according to the sequence, reduce the amount of data to be stored, thereby reducing the amount of data actually written to the disk, reducing the processing pressure of the storage program, and reducing the disk space occupied by the storage end, ensuring data security and stability;
[0045] A first data packet including a full data type and a second data packet of a jump data type are stored in a database. After obtaining a query request from a user carrying a time node to be queried, a first data packet that is before the time node to be queried and is closest in time is obtained from the database, and a second data packet between the time node corresponding to the first data packet and the time node to be queried is obtained. The first data packet and the second data packet are used to complete the full data and push responses, thereby automatically completing the data, reducing data queries but keeping the results unchanged, and reducing query time. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] The features and advantages of the present invention will be more clearly understood by referring to the accompanying drawings, which are schematic and should not be construed as limiting the present invention in any way. In the accompanying drawings:
[0047] Figure 1 This is one of the flow charts of the train data storage method according to an embodiment of the present application;
[0048] Figure 2 This is a second flow chart of the train data storage method according to an embodiment of the present application;
[0049] Figure 3 is a flow chart of a train data query method according to an embodiment of the present application;
[0050] Figure 4 is a schematic diagram of the structure of a train data storage device according to an embodiment of the present application;
[0051] Figure 5 is a structural schematic diagram of a train data query device according to an embodiment of the present application;
[0052] Figure 6 is a schematic structural diagram of a train system according to an embodiment of the present application;
[0053] Figure 7 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0054] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0055] Today, the rail transit industry is developing rapidly. With the iteration and update of technology and the increase in the number of operating trains, the on-board train data has exploded. Some train operation and maintenance systems have data processing and storage requirements of more than 500,000 points / second. As time accumulates, the train operation and maintenance system faces performance problems such as large historical data storage space and low query efficiency. In serious cases, the system may experience excessive processing pressure and server crashes.
[0056] The current train data storage method uses full storage. Since the on-board data is highly real-time, large in quantity, and high in frequency, as the amount of data increases, the data storage engine faces increasing pressure on data transmission and data storage. It cannot meet the user's needs for long-term historical data storage, and it is also difficult to meet the needs of rapid response to queries.
[0057] For example, one of the existing real-time stream data processing framework processes is to send the onboard data packets sent by the train to the ground server, parse them into Json format data through the data parsing program, and then use the Kafka message queue as the message middleware for message storage. The Flink program consumes the data in Kafka and writes the data to Hbase to achieve onboard data storage. As the onboard data collected by the train increases, the above-mentioned real-time stream data processing framework faces increasing data storage and data storage pressure, data delays, and database downtime due to excessive pressure.
[0058] In order to solve the above problems, a train data storage system, method, device and equipment are provided in the present embodiment. The technical solution of the embodiment of the present invention and how the technical solution of the embodiment of the present invention solves the above technical problems will be described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present invention will be described in detail below in conjunction with specific drawings.
[0059] The present invention provides a train data storage method, which aims to reduce the processing pressure of the storage program, reduce the disk space occupied by the storage end, and ensure data security and stability. It can be understood that the train data storage method of the present invention can be used in electronic devices, including but not limited to computers, mobile terminals, etc. Figure 1 is a flow chart of a train data storage method according to an embodiment of the present invention. Figure 1 As shown, the method comprises the following steps:
[0060] S10, obtaining a vehicle data stream. In the embodiment of the present invention, the vehicle data stream is composed of a plurality of frames of vehicle data packets, that is, obtaining a vehicle data stream composed of frames of vehicle data packets.
[0061] S20, determining the temporal sequence of the vehicle-borne data packet of the current frame and the vehicle-borne data packet of the last time node stored in the database, wherein the database stores a number of vehicle-borne data packets of full data type and jump data type.
[0062] S30, determine that the vehicle-borne data packet of the current frame is behind, and store the data of the vehicle-borne data packet of the current frame that is different from the vehicle-borne data packet of the last time node in the database. The change data between the two data is the jump data.
[0063] S40, determining that the vehicle-borne data packet of the current frame is in front, and storing the vehicle-borne data packet of the current frame in the database.
[0064] It should be noted that if no data has been stored in the database, that is, the current frame vehicle-mounted data packet is the first frame vehicle-mounted data packet, since there is no vehicle-mounted data packet of any time node in the database, that is, the current frame vehicle-mounted data packet cannot be judged in time sequence, it is still stored in full, and the first frame vehicle-mounted data packet is saved in full through the memory.
[0065] In this method, before the vehicle data is stored, the vehicle data packet is filtered according to the change of the data point, so as to obtain the full data / jump data. Specifically, in this method, by comparing the vehicle data packets before and after to see whether there is any change or update in each point data, the updated data points are filtered out and output as jump data, reducing the amount of stored data, so that the data storage engine only needs to store jump data in most cases, thereby reducing the amount of data actually stored on the disk, reducing the full data, and reducing the processing and storage pressure.
[0066] The data types of the points of the vehicle-mounted data packet mainly include digital quantities and analog quantities, among which digital quantities, that is, Boolean type (Bool) values, account for the vast majority, of which digital quantities account for more than 90%. Compared with the data points of analog quantities, the data points of digital quantities remain unchanged or change very little under most conditions, so by comparing the data before and after, the points after the change only account for a very small part of the original data. In the implementation of the present invention, most of the data filtered out by steps S20 to S40 are jump data. By adopting the method of data jump storage and restoring the full amount of data based on the jump data, it will be able to save a lot of storage space and reduce the I / O pressure of data storage.
[0067] In step S20, the comparison between the previous and the next is performed based on the time series. For example, the current frame vehicle data packet is the third frame in the vehicle data stream, and the database stores the vehicle data packet of the first frame of the full data type and the vehicle data packet of the second frame of the jump data type. Then, the vehicle data packet of the last time node stored in the database is the vehicle data packet of the second frame, and the vehicle data packet of the third frame is located after the vehicle data packet of the second frame in the time series.
[0068] For each frame of vehicle-mounted data packet in a continuous and complete time series, the previous and subsequent data points will be compared, so that the data stored in the database is a jump data stream.
[0069] The train data storage method provided by the present invention determines the time sequence of the on-board data packet of the current frame and the on-board data packet of the last time node stored in the database based on the characteristics of the time series, obtains the full data or the jump data according to the sequence, reduces the amount of data that needs to be stored, thereby reducing the amount of data actually written to the disk, reduces the processing pressure of the storage program, and at the same time reduces the disk space occupied by the storage end, ensuring data security and stability.
[0070] In the embodiment of the present invention, step S30 specifically includes the following steps:
[0071] S31, determining that the vehicle-mounted data packet of the current frame is at the rear.
[0072] S32, obtaining a first point value corresponding to the first point, and obtaining a second point value corresponding to the second point. In the embodiment of the present invention, the first point is the data point corresponding to the vehicle data packet of the current frame, and the second point is the data point corresponding to the vehicle data packet of the last time node. Each vehicle data packet in the vehicle data stream has a corresponding data point, and each data point has a corresponding data point value. For two different frames of vehicle data packets, there is a situation where new data points are added.
[0073] S33, obtaining the correspondence between the first point and the second point, and determining the point change between the first point and the second point and the change data corresponding to the point change based on the correspondence. In this step, check whether the data point value at each corresponding data point between the two vehicle-borne data packets has been updated, and filter out the updated data points, and then output the point change and the change data corresponding to the point change as a jump data flow to the next level of data storage process.
[0074] S34. Store the point changes and the change data corresponding to the point changes in a database.
[0075] In the embodiment of the present invention, step S40 specifically includes:
[0076] S41, determine that the vehicle data packet of the current frame is in the front. Considering that there may be time-discontinuous disordered data in the vehicle data stream, in order to ensure the accuracy and integrity of the data, the vehicle data packet of the current frame that is located before the vehicle data packet of the last time node stored in the database in the time series is not filtered, and the full amount of data is output.
[0077] S42, determining whether all data points at the same time node as the vehicle-borne data packet of the current frame and point data corresponding to the data points are stored in the database.
[0078] S43, determine that all data points and point data corresponding to the data points at the same time node are not stored. For out-of-order vehicle data packets, this step will determine whether the vehicle data packet of the frame has been stored in the database, and if it is determined that the vehicle data packet of the frame is not stored, the vehicle data packet of the frame is transferred to the next level of data storage process as the full data flow.
[0079] S44. The vehicle-mounted data packet of the current frame is stored in the database.
[0080] Combine the following Figure 2 The vehicle data storage method of the present invention is described, and the method also includes:
[0081] S50, considering that for data completion, the vehicle data packet corresponding to the corresponding time node is stored in the database every preset frame. For example, the first stored frame number is set, such as the 5th frame, and the vehicle data packet of the 5th frame is stored in the database as the full data, and then every 50 frames (preset frames), the next storage is to store the vehicle data packet of the 55th frame as the full data in the database, and so on.
[0082] The present invention provides a train data query method, which aims to reduce the time required for querying data. It is understandable that the train data query method of the present invention can be used in electronic devices, including but not limited to computers, mobile terminals, etc. Figure 3 FIG. 1 is a flow chart of a train data query method according to an embodiment of the present invention. Figure 3 As shown, the method comprises the following steps:
[0083] A10, obtaining a query request from a user with a time node to be queried. For example, the query request from the user is to query the data of the 10th frame in the vehicle data stream, that is, the vehicle data packet.
[0084] A20. Based on the query request, obtain from the database the first data packet that is located before the time node to be queried and is closest in time distance, wherein the database stores a plurality of first data packets and second data packets, the first data packet is an on-board data packet of the full data type, the second data packet is an on-board data packet of the jump data type, the second data packet is the change data between the previous and next two frames of on-board data packets, and each on-board data packet has a corresponding time node.
[0085] In this method, when the on-board data packet is stored and the on-board data stream is read, the first frame of the on-board data packet is fully stored, that is, the on-board data packet of the first frame is saved through the memory, and after the on-board data packet of the second frame is obtained, it is compared with the on-board data packet of the first frame to check whether the data of each point is updated, and the updated data points are filtered out, and the output is a jump data stream to the next level of data storage process. Subsequent on-board data packets are compared with the previous and subsequent data in turn, and the jump data stream is output and transferred to the next level of data storage process. In order to facilitate data completion, a full amount of data is inserted at a specific interval. Taking into account that there may be time-discontinuous disordered data in the data stream, in order to ensure the accuracy and integrity of the data, for data time that is less than the time of the previous data packet, no filtering is performed and the full amount of data is output.
[0086] A30. Obtain a second data packet between a time node corresponding to the first data packet and a time node to be queried.
[0087] To give a specific example, the user's query request is to query the data of the 10th frame in the vehicle data stream. The database stores vehicle data packets of the full data type of the first frame and the 7th frame, as well as vehicle data packets of the jump data type of the 2nd, 3rd, 4th, 5th, 6th, 8th, 9th and 10th frames. The first data packet before the time node to be queried and with the closest time distance is the vehicle data packet of the full data type of the 7th frame, and the second data packet between the time node corresponding to the first data packet and the time node to be queried is the vehicle data packet of the jump data type of the 8th, 9th and 10th frames.
[0088] A40. Synthesize train data based on the first data packet and the second data packet.
[0089] It can be seen that the data stored in the database has changed and is no longer full data. The existing data interface routing cannot meet the data query requirements. When querying, the data interface of this method queries the required data from the database through time and related parameters, obtains the most recent full data packet within the time range, and obtains other data. At this time, the other data is jump data. After obtaining the jump data, the jump points with null values are completed and filled through the full data packet. The specific filling logic is to find a non-null value at the point, and then fill the null with the value. After the data is completed, the full data response is pushed.
[0090] Since the amount of data actually obtained from the database is much less than the full amount of data, the network overhead of interacting with the database is reduced. The data filling and completion are performed in the memory. The time overhead of data completion is very small and can be ignored, which is reflected in the data interface routing response time, and a faster response speed is obtained.
[0091] The train data query method provided by the present invention utilizes a first data packet including a full data type and a second data packet of a jump data type stored in a database. After obtaining a query request from a user carrying a time node to be queried, the first data packet located before the time node to be queried and closest in time is obtained from the database, and the second data packet between the time node corresponding to the first data packet and the time node to be queried is obtained. The first data packet and the second data packet are used to complete the full data and push responses, thereby realizing automatic data completion, reducing data queries but keeping the results unchanged, and reducing query time.
[0092] In the embodiment of the present invention, step A40 specifically includes:
[0093] A41. Obtain data points corresponding to the first data packet and the second data packet and point values corresponding to the data points.
[0094] This step is similar to Figure 1 as well as Figure 2 The step S30 shown is similar and will not be described in detail here.
[0095] A42. Based on the time sequence, determine the point changes between data points and the change data corresponding to the point changes.
[0096] A43. Based on the point change and the change data corresponding to the point change, the first data packet is completed with the second data packet to synthesize the train data.
[0097] When determining point changes, data are compared in pairs from back to front. For example, if the first data packet is the on-board data packet of the full data type of the 7th frame, and the second data packet is the on-board data packet of the jump data type of the 8th, 9th, and 10th frames, data completion is first performed by comparing the second data packet of the jump data type of the 9th and 10th frames, and then the data after the first completion is used to complete the data with the second data packet of the jump data type of the 8th frame, and then the data after the second completion is used to complete the data with the first data packet of the full data type of the 7th frame to obtain the data that needs to be queried, and the data is returned to the user in response to the user's query request.
[0098] The device provided by the present invention is described below. The device described below and the method described above can be referenced to each other.
[0099] The present invention provides a train data storage device in an embodiment, which aims to reduce the processing pressure of the storage program, reduce the disk space occupied by the storage end, and ensure data security and stability. It can be understood that the train data storage device in the embodiment of the present invention can be used in electronic devices, including but not limited to computers, mobile terminals, etc. Figure 4 is a schematic diagram of the structure of a train data storage device according to an embodiment of the present invention. Figure 4 As shown, the device comprises:
[0100] The first acquisition module 10 is used to acquire the vehicle data stream. In the embodiment of the present invention, the vehicle data stream is composed of a plurality of frames of vehicle data packets, that is, the vehicle data stream composed of frames of vehicle data packets is acquired.
[0101] The node determination module 20 is used to determine the temporal sequence between the vehicle data packet of the current frame and the vehicle data packet of the last time node stored in the database, wherein the database stores a number of vehicle data packets of full data type and jump data type.
[0102] The data filtering module 30 is used to determine that the vehicle-borne data packet of the current frame is behind, and store the data of the vehicle-borne data packet of the current frame that is different from the vehicle-borne data packet of the last time node in the database. The change data between the two data is the jump data.
[0103] The data storage module 40 is used to determine that the vehicle-borne data packet of the current frame is in front, and store the vehicle-borne data packet of the current frame in the database.
[0104] It should be noted that if no data has been stored in the database, that is, the current frame vehicle-mounted data packet is the first frame vehicle-mounted data packet, since there is no vehicle-mounted data packet of any time node in the database, that is, the current frame vehicle-mounted data packet cannot be judged in time sequence, it is still stored in full, and the first frame vehicle-mounted data packet is saved in full through the memory.
[0105] In the device, before the vehicle data is stored, the vehicle data packet is filtered according to the change of the data point, so as to obtain the full data / jump data. Specifically, the device compares the vehicle data packets before and after to see whether there is any change or update in each point data, filters out the updated data points, and outputs them as jump data, reducing the amount of stored data, so that the data storage engine only needs to store jump data in most cases, thereby reducing the amount of data actually stored on the disk, reducing the full data, and reducing the processing and storage pressure.
[0106] The data types of the points of the vehicle-mounted data packet mainly include digital quantities and analog quantities, among which digital quantities, that is, Boolean type (Bool) values, account for the vast majority, of which digital quantities account for more than 90%. Compared with the data points of analog quantities, the data points of digital quantities remain unchanged or change very little under most conditions, so by comparing the data before and after, the points after the change only account for a very small part of the original data. In the implementation of the present invention, most of the data filtered out by steps S20 to S40 are jump data. By adopting a device for data jump storage and restoring the full amount of data based on the jump data, it will be possible to save a lot of storage space and reduce the I / O pressure of data storage.
[0107] The before-after comparison in the device is performed based on the time series. For example, the current frame vehicle data packet is the third frame in the vehicle data stream, and the database stores the vehicle data packet of the first frame of the full data type and the vehicle data packet of the second frame of the jump data type. Then the vehicle data packet of the last time node stored in the database is the vehicle data packet of the second frame, and the vehicle data packet of the third frame is located after the vehicle data packet of the second frame in the time series.
[0108] For each frame of vehicle-mounted data packet in a continuous and complete time series, the previous and subsequent data points will be compared, so that the data stored in the database is a jump data stream.
[0109] The train data storage device provided by the present invention determines the time sequence of the on-board data packet of the current frame and the on-board data packet of the last time node stored in the database based on the characteristics of the time series, obtains the full data or the jump data according to the sequence, reduces the amount of data that needs to be stored, thereby reducing the amount of data actually written to the disk, reduces the processing pressure of the storage program, and at the same time reduces the disk space occupied by the storage end, ensuring data security and stability.
[0110] The present invention also provides a train data query device in an embodiment, which is intended to reduce the time required for querying data. It is understandable that the train data query device in an embodiment of the present invention can be used in electronic devices, including but not limited to computers, mobile terminals, etc. Figure 5 is a schematic diagram of the structure of a train data query device according to an embodiment of the present invention. Figure 5 As shown, the device comprises:
[0111] The second acquisition module 50 acquires a query request from a user with a time node to be queried, for example, the query request from the user is to query the data of the 10th frame in the vehicle data stream, that is, the vehicle data packet.
[0112] The first query module 60 is used to obtain, based on a query request, a first data packet that is located before a time node to be queried and is closest in time distance from the database, wherein a plurality of first data packets and second data packets are stored in the database, the first data packet is an on-board data packet of a full data type, the second data packet is an on-board data packet of a jump data type, the second data packet is change data between two frames of on-board data packets, and each on-board data packet has a corresponding time node.
[0113] In this device, when the on-board data packet is stored and the on-board data stream is read, the first frame of the on-board data packet is fully stored, that is, the on-board data packet of the first frame is saved through the memory, and after the on-board data packet of the second frame is obtained, it is compared with the on-board data packet of the first frame to check whether the data of each point is updated, and the updated data points are filtered out, and the output is a jump data stream to the next level of data storage process. Subsequent on-board data packets are compared with the previous and subsequent data in turn, and the jump data stream is output and transferred to the next level of data storage process. In order to facilitate data completion, a full data is inserted at a specific interval. Taking into account that there may be time-discontinuous disordered data in the data stream, in order to ensure the accuracy and integrity of the data, for data time that is less than the time of the previous data packet, no filtering is performed and the full data is output.
[0114] The second query module 70 is used to obtain a second data packet between a time node corresponding to the first data packet and a time node to be queried.
[0115] To give a specific example, the user's query request is to query the data of the 10th frame in the vehicle data stream. The database stores vehicle data packets of the full data type of the first frame and the 7th frame, as well as vehicle data packets of the jump data type of the 2nd, 3rd, 4th, 5th, 6th, 8th, 9th and 10th frames. The first data packet before the time node to be queried and with the closest time distance is the vehicle data packet of the full data type of the 7th frame, and the second data packet between the time node corresponding to the first data packet and the time node to be queried is the vehicle data packet of the jump data type of the 8th, 9th and 10th frames.
[0116] The data synthesis module 80 is used to synthesize train data based on the first data packet and the second data packet.
[0117] It can be seen that the data stored in the database has changed and is no longer full data. The existing data interface routing cannot meet the data query requirements. When the device queries, the data interface queries the required data from the database through time and related parameters, obtains the most recent full data packet within the time range, and obtains other data. At this time, the other data is jump data. After obtaining the jump data, the jump points with null values are completed and filled through the full data packet. The specific filling logic is to find a non-null value at the point, and then fill the null with the value. After the data is completed, the full data response is pushed.
[0118] Since the amount of data actually obtained from the database is much less than the full amount of data, the network overhead of interacting with the database is reduced. The data filling and completion are performed in the memory. The time overhead of data completion is very small and can be ignored, which is reflected in the data interface routing response time, and a faster response speed is obtained.
[0119] The train data query device provided by the present invention utilizes a first data packet including a full data type and a second data packet of a jump data type stored in a database. After obtaining a query request from a user carrying a time node to be queried, the device obtains a first data packet that is located before the time node to be queried and is closest in time from the database, and obtains a second data packet between the time node corresponding to the first data packet and the time node to be queried. The device uses the first data packet and the second data packet to complete the full data and push responses, thereby automatically completing the data, reducing data queries but keeping the results unchanged, and reducing query time.
[0120] The train data storage device provided by the present invention collects the brake cylinder image when the train is running, separates the brake cylinder part from it through preprocessing and binarization processing, and performs secondary identification to obtain the actual extension distance of the telescopic rod. It can quickly and accurately identify the state of the brake cylinder piston rod and generate a real-time brake cylinder state. It can identify the brake cylinder state of a vehicle running at high speed and provide real-time feedback of the identification result, thereby providing protection for the driving safety of railway trains.
[0121] A train system is also provided in an embodiment of the present invention, which aims to reduce the processing pressure of the storage program, while reducing the disk space occupied by the storage end, ensuring data security and stability, and reducing the time required for querying data. Figure 6 is a schematic diagram of the structure of a train system according to an embodiment of the present invention. Figure 6 As shown, the system includes:
[0122] A database, used to store a first data packet and a second data packet, wherein the first data packet is an in-vehicle data packet of a full data type, and the second data packet is an in-vehicle data packet of a jump data type, and each in-vehicle data packet has a corresponding time node;
[0123] The data filtering engine is used to determine the temporal sequence of the vehicle data packet of the current frame and the vehicle data packet of the last time node stored in the database, and obtain the first data packet / the second data packet according to the sequence.
[0124] The data storage engine is used to store the first data packet / the second data packet obtained by the data filtering engine into a database.
[0125] Interface routing is used to obtain a query request from a user that carries a time node to be queried. Based on the query request, a second data packet that is located before the time node to be queried and is closest in time distance, as well as a second data packet between the time node corresponding to the first data packet and the time node to be queried, is obtained from the database, the first data packet and the second data packet are combined into train data, and the train data is fed back to the user.
[0126] The train system adds a data filtering engine before the data storage program, modifies the data storage engine to improve it, and completes the data in the data query module. The data filtering engine is used to filter the data. By comparing the on-board data packets before and after, it can determine whether the data at each point has been updated, filter out the updated data points, and output them as jump data to reduce the amount of data flowing into the storage program. The storage engine only stores jump data, thereby reducing the amount of data actually stored on the disk. In this way, the full amount of data is reduced, reducing the processing and storage pressure. At the same time, for external interface routing, since only jump variables are stored in the actual amount of data stored, a lot of duplicate data is missing, and additional data recovery and completion logic is required to restore the original full amount of data.
[0127] The train system provided by the present invention determines the temporal sequence of the on-board data packet of the current frame and the on-board data packet of the last time node stored in the database based on the characteristics of the time series, obtains the full amount of data or the jump data according to the sequence, reduces the amount of data to be stored, thereby reducing the amount of data actually written to the disk, reduces the processing pressure of the storage program, and reduces the disk space occupied by the storage end, ensuring data security and stability;
[0128] A first data packet including a full data type and a second data packet of a jump data type are stored in a database. After obtaining a query request from a user carrying a time node to be queried, a first data packet that is before the time node to be queried and is closest in time is obtained from the database, and a second data packet between the time node corresponding to the first data packet and the time node to be queried is obtained. The first data packet and the second data packet are used to complete the full data and push responses, thereby automatically completing the data, reducing data queries but keeping the results unchanged, and reducing query time.
[0129] Figure 7An example of a physical structure diagram of an electronic device is shown in FIG. Figure 7 As shown, the electronic device may include: a processor 510, a communication interface 520, a memory 530 and a communication bus 540, wherein the processor 510, the communication interface 520 and the memory 530 communicate with each other through the communication bus 540. The processor 510 may call the logic command in the memory 530 to execute the train data storage method, which includes:
[0130] Acquire a vehicle data stream; the vehicle data stream is composed of a plurality of frames of vehicle data packets;
[0131] Determine the temporal sequence of the vehicle-borne data packet of the current frame and the vehicle-borne data packet of the last time node stored in the database; the database stores a number of vehicle-borne data packets of full data type and jump data type;
[0132] Determine that the vehicle-borne data packet of the current frame is behind, and store data of the vehicle-borne data packet of the current frame that is different from the vehicle-borne data packet of the last time node in the database;
[0133] Determine that the vehicle-mounted data packet of the current frame is in front, and store the vehicle-mounted data packet of the current frame in the database.
[0134] Alternatively, a train data query method is executed, the method comprising:
[0135] Obtain a query request from a user that carries a time node to be queried;
[0136] Based on the query request, a first data packet located before the time node to be queried and with the closest time distance is obtained from a database; the database stores a plurality of first data packets and second data packets, the first data packet is an on-board data packet of a full data type, the second data packet is an on-board data packet of a jump data type, the second data packet is change data between two frames of on-board data packets, and each of the on-board data packets has a corresponding time node;
[0137] Obtain the second data packet between the time node corresponding to the first data packet and the time node to be queried;
[0138] Train data is synthesized based on the first data packet and the second data packet.
[0139] In addition, the logic commands in the above-mentioned memory 530 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software medium, and the computer software medium is stored in a storage medium, including several commands to enable 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 methods of various embodiments 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 program codes.
[0140] On the other hand, the present invention further provides a computer program medium, the computer program medium includes a computer program, the computer program can be stored on a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the train data storage method provided by the above methods, the method comprising:
[0141] Acquire a vehicle data stream; the vehicle data stream is composed of a plurality of frames of vehicle data packets;
[0142] Determine the temporal sequence of the vehicle-borne data packet of the current frame and the vehicle-borne data packet of the last time node stored in the database; the database stores a number of vehicle-borne data packets of full data type and jump data type;
[0143] Determine that the vehicle-borne data packet of the current frame is behind, and store data of the vehicle-borne data packet of the current frame that is different from the vehicle-borne data packet of the last time node in the database;
[0144] Determine that the vehicle-mounted data packet of the current frame is in front, and store the vehicle-mounted data packet of the current frame in the database.
[0145] Alternatively, a train data query method is executed, the method comprising:
[0146] Obtain a query request from a user that carries a time node to be queried;
[0147] Based on the query request, a first data packet located before the time node to be queried and with the closest time distance is obtained from a database; the database stores a plurality of first data packets and second data packets, the first data packet is an on-board data packet of a full data type, the second data packet is an on-board data packet of a jump data type, and the second data packet is change data between two frames of on-board data packets, and each of the on-board data packets has a corresponding time node;
[0148] Obtain the second data packet between the time node corresponding to the first data packet and the time node to be queried;
[0149] Train data is synthesized based on the first data packet and the second data packet.
[0150] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the train data storage method provided by the above methods is implemented, and the method includes:
[0151] Acquire a vehicle data stream; the vehicle data stream is composed of a plurality of frames of vehicle data packets;
[0152] Determine the temporal sequence of the vehicle-borne data packet of the current frame and the vehicle-borne data packet of the last time node stored in the database; the database stores a number of vehicle-borne data packets of full data type and jump data type;
[0153] Determine that the vehicle-borne data packet of the current frame is behind, and store data of the vehicle-borne data packet of the current frame that is different from the vehicle-borne data packet of the last time node in the database;
[0154] Determine that the vehicle-mounted data packet of the current frame is in front, and store the vehicle-mounted data packet of the current frame in the database.
[0155] Alternatively, a train data query method is executed, the method comprising:
[0156] Obtain a query request from a user that carries a time node to be queried;
[0157] Based on the query request, a first data packet located before the time node to be queried and with the closest time distance is obtained from a database; the database stores a plurality of first data packets and second data packets, the first data packet is an on-board data packet of a full data type, the second data packet is an on-board data packet of a jump data type, the second data packet is change data between two frames of on-board data packets, and each of the on-board data packets has a corresponding time node;
[0158] Obtain the second data packet between the time node corresponding to the first data packet and the time node to be queried;
[0159] Train data is synthesized based on the first data packet and the second data packet.
[0160] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, i.e., they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative effort.
[0161] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software medium, and the computer software medium can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of commands to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or some parts of the embodiment.
[0162] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A train data storage method, characterized in that: The method comprises: Acquire a vehicle data stream; the vehicle data stream is composed of a plurality of frames of vehicle data packets; Determine the temporal sequence of the vehicle-borne data packet of the current frame and the vehicle-borne data packet of the last time node stored in the database; the database stores a number of vehicle-borne data packets of full data type and jump data type; Determine that the vehicle-borne data packet of the current frame is behind, and store data of the vehicle-borne data packet of the current frame that is different from the vehicle-borne data packet of the last time node in the database; Determine that the vehicle-mounted data packet of the current frame is in front, and store the vehicle-mounted data packet of the current frame in the database.
2. The train data storage method according to claim 1, characterized in that: The step of determining that the vehicle-borne data packet of the current frame is behind, and storing data of the vehicle-borne data packet of the current frame that is different from the vehicle-borne data packet of the last time node in the database specifically includes: Determine that the vehicle-borne data packet of the current frame is behind; Obtain a first point value corresponding to a first point, and obtain a second point value corresponding to a second point; the first point is a data point corresponding to the vehicle data packet of the current frame, and the second point is a data point corresponding to the vehicle data packet of the last time node; Acquire a correspondence relationship between the first point and the second point, and determine a point change between the first point and the second point and change data corresponding to the point change based on the correspondence relationship; The point change and the change data corresponding to the point change are stored in the database.
3. The train data storage method according to claim 1, characterized in that: The determining that the vehicle-mounted data packet of the current frame is in front and storing the vehicle-mounted data packet of the current frame in the database specifically includes: Determine that the vehicle-borne data packet of the current frame is in front; Determine whether the database stores all data points at the same time node as the vehicle-borne data packet of the current frame and point data corresponding to the data points; Determine that all data points at the same time node and point data corresponding to the data points are not stored; The vehicle-mounted data packet of the current frame is stored in the database.
4. The train data storage method according to claim 1, characterized in that: The method further comprises: At every preset frame, the vehicle-borne data packet corresponding to the corresponding time node is stored in the database.
5. A train data query method, characterized in that: The method comprises: Obtain a query request from a user that carries a time node to be queried; Based on the query request, a first data packet located before the time node to be queried and with the closest time distance is obtained from a database; the database stores a plurality of first data packets and second data packets, the first data packet is an on-board data packet of a full data type, the second data packet is an on-board data packet of a jump data type, the second data packet is change data between two frames of on-board data packets, and each of the on-board data packets has a corresponding time node; Obtain the second data packet between the time node corresponding to the first data packet and the time node to be queried; Train data is synthesized based on the first data packet and the second data packet.
6. A train data storage device, characterized in that: The device comprises: A first acquisition module is used to acquire a vehicle data stream; the vehicle data stream is composed of a plurality of frames of vehicle data packets; A node determination module is used to determine the temporal sequence of the vehicle data packet of the current frame and the vehicle data packet of the last time node stored in the database; the database stores a number of vehicle data packets of full data type and jump data type; A data filtering module, used for determining that the vehicle-borne data packet of the current frame is behind, and storing data of the vehicle-borne data packet of the current frame that is different from the vehicle-borne data packet of the last time node in the database; The data storage module is used to determine that the vehicle-mounted data packet of the current frame is in front, and store the vehicle-mounted data packet of the current frame in the database.
7. A train data query device, characterized in that: The device comprises: The second acquisition module is used to acquire a query request from a user that carries a time node to be queried; A first query module is used to obtain, based on the query request, a first data packet that is located before the time node to be queried and has the closest time distance from the database; the database stores a plurality of first data packets and second data packets, the first data packet is an in-vehicle data packet of a full data type, the second data packet is an in-vehicle data packet of a jump data type, and each of the in-vehicle data packets has a corresponding time node; A second query module, used to obtain the second data packet between the time node corresponding to the first data packet and the time node to be queried; A data synthesis module is used to synthesize train data based on the first data packet and the second data packet.
8. A train system, characterized in that: The system comprises: A database, used to store a first data packet and a second data packet; the first data packet is an in-vehicle data packet of a full data type, and the second data packet is an in-vehicle data packet of a jump data type, and each of the in-vehicle data packets has a corresponding time node; A data filtering engine, used to determine the temporal sequence of the vehicle-borne data packet of the current frame and the vehicle-borne data packet of the last time node stored in the database, and obtain the first data packet / the second data packet according to the sequence; A data storage engine, used for storing the first data packet / the second data packet obtained by the data filtering engine into the database; Interface routing is used to obtain a query request from a user that carries a time node to be queried, and based on the query request, obtain from the database the second data packet that is located before the time node to be queried and is closest in time distance, and between the time node corresponding to the first data packet and the time node to be queried, synthesize the first data packet and the second data packet into train data, and feed back the train data to the user.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps of the train data storage method according to any one of claims 1 to 4 are implemented, or the steps of the train data query method according to claim 5 are implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the train data storage method according to any one of claims 1 to 4 are implemented, or the steps of the train data query method according to claim 5 are implemented.