Track storage and retrieval method, system, device and computer storage readable medium
Through the combination of distributed log receiving service, data bus and big data computing engine, combined with time and space superposition filtering algorithm, the problem of rapid retrieval of massive historical track data is solved, millisecond-level retrieval efficiency is achieved, and the performance and performance of the system are improved. Availability.
Patent Information
- Application Number
- CN202110449955.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-25
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2041-04-25
AI Technical Summary
Existing technologies are difficult to quickly retrieve massive historical track data, resulting in time-consuming queries and high system performance requirements, making them unable to be widely used.
It adopts a combination of distributed log receiving service, distributed data bus, big data computing engine and distributed search engine, and achieves millisecond-level retrieval of track data through data fusion, time and space superposition filtering algorithms.
It realizes the timely and effective reception and storage of massive track data, and can quickly query and retrieve the required historical track data information without losing accuracy, which improves the efficiency and availability of the system.
Smart Images

Figure CN113177037B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of track storage and retrieval, and in particular to a track storage and retrieval method, system, device and computer storage readable medium. Background Art
[0002] my country has abundant rivers and coastal areas, and is a traditional fishing power. However, with the rapid development of my country's economy, my country's water resources are facing many problems, such as excess fishing capacity, serious decline in fishery resources, and near-exhaustion of economic fish resources. For this reason, the country has introduced a series of fishing bans and fishery protection zone policies, but my country's fisheries and water system modernization and informatization are relatively imperfect. Various smuggling, sand theft, and fish theft are rampant. Now large ports and key rivers are equipped with radars, and the government has also strengthened the management of AIS data. Through these data, various ships can be effectively supervised, but these devices generate massive spatiotemporal track data, which brings huge challenges to traditional database processing methods. With the rapid development of my country's fisheries and water system modernization and informatization, efficient processing of these massive spatiotemporal track data has become an urgent problem to be solved.
[0003] AIS data system is the abbreviation of Automatic Identification System. It is composed of shore-based (base station) facilities and ship-borne equipment. It is a ship positioning technology that receives AIS message information sent by ships through low-orbit satellites. The satellites will receive and decode the AIS message information and forward it to the corresponding earth station, so that land management agencies can grasp the relevant dynamic information of the ship and realize the monitoring of ships sailing in the distant sea areas.
[0004] After searching, the patent document CN112486473A discloses a quasi-real-time target track display method based on Kafka and Redis, including: constructing a front-end display program and a post-processing service, constructing a target track point data structure in the back-end processing service, and storing target track point data; constructing a target track data storage type in the Redis service, and storing different types of target track point data; establishing a Kafka consumer thread in the back-end processing service, obtaining the target track original data in the Kafka message queue in real time, converting and obtaining multiple target track point data, and updating the target track point data in the Redis service; the front-end display program obtains and parses the target track point data according to the screening conditions, and then displays the latest target position information and track path information on the geographic information system layer. The problem with this prior art is that although the target track point data can be obtained in real time, the historical data of the track cannot be retrieved quickly.
[0005] Patent document CN112562422A discloses a method for self-synchronizing track information in a dual-machine redundant mode of an air traffic control system. This prior art is suitable for track processing and can achieve real-time synchronization of the integrated track of the primary and backup systems. The primary and backup systems are synchronized and fully and accurately reflect the system's integrated situation information. However, this prior art cannot solve the technical problem of quickly retrieving historical track information.
[0006] Patent document CN110879067A discloses a fully automatic track acquisition method, device and ground station based on big data. The prior art is to send the operation area location information to the big data server through the ground station; download the available tracks from the big data server; select one of the available tracks as the operation track; upload the operation track to the drone. In the prior art, some trajectory routes that the drone can run are first preset and stored on the big data server. Then, when using, the available tracks of the drone on the download server are matched according to the drone position and the operation area, and then one of the flight paths is selected for use. This path is to store multiple drone preset paths and select one of them. This path is a small number of complete predefined paths. However, the prior art cannot solve the query, retrieval and matching of the actual massive historical track data, and cannot be customized according to actual needs.
[0007] Currently, the track data is numerous and complex. It is very time-consuming to query and retrieve the historical data of the track. Even if it is possible to query and retrieve the historical data of the track, the performance requirements of the query and retrieval system are extremely high and it cannot be widely used.
[0008] Therefore, there is an urgent need to develop and design a system and method that can timely and effectively receive and store Hailiang track data and can retrieve track data at the millisecond level. Summary of the invention
[0009] In view of the defects in the prior art, the purpose of the present invention is to provide a track storage and retrieval method, system, device and computer storage readable medium, which solves the problems of low efficiency and huge amount of data in traditional data processing, and has a large number of application scenarios in regulatory industries such as fishery border inspection.
[0010] A track storage and retrieval method provided by the present invention comprises the following steps:
[0011] Step S1: The data collection end collects track data through a data collector;
[0012] Step S2: Connect the track data to the distributed data bus through the distributed log receiving service;
[0013] Step S3: The distributed data bus manages data through partitions, and the distributed data bus records the use of data by the big data computing engine through consumer groups and offsets;
[0014] Step S4: Read the data in the distributed data bus through the big data computing engine to perform data fusion and unify the data recording target;
[0015] Step S5: storing the merged and unified data in a distributed search engine;
[0016] Step S6: Filter the data stored in the distributed search engine by time and space superposition, and obtain detailed tracks and sampled tracks by customizing data accuracy;
[0017] Among them, the big data computing engine reads the original track data on the data bus for data fusion. Data fusion is data ETL standardization, which integrates different data radar, AIS and other data of the same target and the same time into a unified track record. The fused results are stored in the distributed search engine. The big data computing engine is used for calculation, and the distributed search engine is used for storage and query.
[0018] Preferably, in step S1, track data is collected by a radar controller and an AIS device.
[0019] Preferably, the distributed log receiving service in step S2 includes:
[0020] Distributed receiving service: multiple different receiving services are deployed to receive the track data collected by different data collectors, and the master control server controls the data receiving status;
[0021] Distributed decoding service: Decode the collected track data using the configuration of different receiving services and convert it into recognizable character data;
[0022] Distributed Transfer Service: Sends character-recognizable data to the distributed data bus.
[0023] Preferably, the distributed data bus in step S3 stores the track data by topics and partitions, and the track data of the same topic are stored in different partitions, each partition includes a primary partition and a backup partition, and the primary partition and the backup partition are distributed on different nodes;
[0024] The data of each partition of the data bus is written through the primary partition, and the secondary partition synchronizes the data of the primary partition. The data stored in the primary partition and the secondary partition are the same. Both the primary partition and the secondary partition can be read by the big data computing engine, which improves the reading performance of the data bus. If the node of the primary partition unexpectedly crashes, multiple secondary partitions will select a secondary partition to upgrade to the primary partition, which improves the high availability of the data bus. The data bus is responsible for the unified access and distribution of data. The data is not modified and the data is deleted regularly.
[0025] Preferably, in step S4, the data of the distributed data bus is read by the big data computing engine to perform data fusion, and different data of the same target and the same time are fused into a unified track record.
[0026] Preferably, in step S5, the merged and unified data is stored in a distributed search engine, the data of each computing cycle is used as an index, each index includes a primary shard and a backup shard, the data is stored in different shards, and different storage strategies are matched to different field types;
[0027] The addition, deletion and modification of data in each shard of the distributed search engine is completed through the primary shard, and the secondary shard synchronizes the operations of the primary shard. The data stored in the primary shard and the secondary shard are the same. The data of the primary shard and the secondary shard can be used by the track query service, which improves the reading performance of the distributed search engine. If the node of the primary shard unexpectedly goes down, multiple secondary shards will select a secondary shard to upgrade to the primary shard, thereby improving the high availability of the distributed search engine.
[0028] Preferably, step S6 comprises the following steps:
[0029] Step S6.1: Establish a spatial grid, put all the track data into the spatial grid, and calculate the length S of each spatial grid by customizing the grid accuracy. tile , the calculation formula is as follows:
[0030] S tile =C*cos(latitude) / 2 zoomLevel
[0031] Where C represents the circumference of the earth, C = 2πr, r is the radius of the earth at the track point; latitude is the latitude value of the track point; zoomLevel is the grid accuracy customized by the query;
[0032] Step S6.2: retrieve all original track data within the time range specified by the query retrieval condition and put them into the first-level time data bucket;
[0033] Step S6.3: retrieve all the original track data according to the grid accuracy customized by the query retrieval condition and put them into the secondary spatial grid data bucket;
[0034] Step S6.4: Divide the primary time data bucket into secondary spatial grid data buckets, match the retrieved original track data to the corresponding primary and secondary data buckets according to the track point time and longitude and latitude, and retain one record in each secondary spatial grid data bucket.
[0035] A track storage and retrieval system provided according to the present invention comprises:
[0036] Module M1: The data collection end collects track data through a data collector;
[0037] Module M2: Connect the track data to the distributed data bus through the distributed log receiving service;
[0038] Module M3: The distributed data bus manages data through partitions. The distributed data bus records the use of data by the big data computing engine through consumer groups and offsets.
[0039] Module M4: reads data from the distributed data bus through the big data computing engine to perform data fusion and unify data recording targets;
[0040] Module M5: The merged and unified data is stored in the distributed search engine;
[0041] Module M6: The data stored in the distributed search engine is filtered by time and space superposition to obtain detailed tracks and sampled tracks.
[0042] According to a computer-readable storage medium storing a computer program provided by the present invention, when the computer program is executed by a processor, the steps of any one of the above methods are performed.
[0043] A track storage and retrieval device provided according to the present invention includes the above-mentioned track storage and retrieval system or the above-mentioned computer-readable storage medium storing a computer program.
[0044] Compared with the prior art, the present invention has the following beneficial effects:
[0045] 1. The present invention receives, stores and processes data through big data, and can timely and effectively receive and store massive track data.
[0046] 2. The present invention uses a track filtering algorithm that superimposes time and space, can customize track accuracy, and achieve millisecond-level retrieval of track data, solving the technical problems of traditional track data being numerous and complex and unable to query historical data.
[0047] 3. The present invention utilizes the map grid to perform temporal and spatial superposition filtering, and can query and retrieve the required historical track data information without losing accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Other features, objects and advantages of the present invention will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:
[0049] Figure 1 is a logic flow chart of the track storage and retrieval method of the present invention;
[0050] Figure 2 It is a network architecture diagram of the track storage and retrieval system in the present invention. DETAILED DESCRIPTION
[0051] The present invention is described in detail below in conjunction with specific embodiments. The following embodiments will help those skilled in the art to further understand the present invention, but are not intended to limit the present invention in any form. It should be noted that, for those of ordinary skill in the art, several changes and improvements can also be made without departing from the concept of the present invention. These all belong to the protection scope of the present invention.
[0052] like Figure 1 , Figure 2 As shown, the present invention provides a track storage and retrieval method, comprising the following steps:
[0053] Step S1: The data collection end collects track data through the radar controller and AIS equipment. Specifically:
[0054] The radar deployed on the tower on the shore scans and searches the radar coverage area according to the frequency, usually scanning once every 2.5 seconds, and monitors the targets within the radar scanning range. The radar control server controls the radar scanning and records the scanning results, and sends the data to the backend log receiving service.
[0055] AIS is a system that allows ships to continuously send their identity, location, heading, speed and other data to nearby ships and shore-based AIS receiving services on VHF public wireless channels. The AIS receiving device receives the AIS information sent by the ship, and the AIS receiving server records the information and sends the data to the backend log service.
[0056] Step S2: Connect the track data to the distributed data bus through the distributed log receiving service; the distributed log receiving service includes:
[0057] Distributed receiving service: By deploying multiple different receiving services, different receiving services receive data according to the location and type of radar and AIS equipment, and the master control server controls the data reception status.
[0058] Distributed decoding service: Decodes the track data collected by radar and AIS using the configuration of different receiving services and converts it into recognizable character data;
[0059] Distributed Transfer Service: Sends character-recognizable data to the distributed data bus.
[0060] Step S3: The distributed data bus manages data through partitions. The distributed data bus records the use of data by the big data computing engine through consumer groups and offsets. The distributed data bus stores track data through topics and partitions. The track data of the same topic is stored in different partitions. Each partition includes a primary partition and a backup partition. The primary partition and the backup partition are distributed on different nodes to ensure data security. At the same time, it manages the subscription of the big data computing engine to the topic and maintains the consumption log of the big data computing engine.
[0061] Step S4: The data in the distributed data bus is read by the big data computing engine to perform data fusion and fuse different data of the same target and the same time into a unified track record.
[0062] Step S5: The merged and unified data is stored in the distributed search engine. That is, the merged and unified data is stored in the distributed search engine, and the data of each computing cycle is used as an index. Each index includes a primary shard and a backup shard. The data is stored in different shards, and different storage strategies are matched for different field types. Specifically, it includes:
[0063] First, for text and string type fields, an inverted index table is established based on the keywords of the text and string. The keyword corresponding index list contains the ID of the document where the keyword is located, the number of times it appears in the document, and the location information of its appearance in the document.
[0064] Second, for numeric fields, such as ship speed, which require size comparison, using B-tree indexes to index data can further improve retrieval performance.
[0065] Third, for the longitude and latitude type fields, this is the most important field of the track. In order to perform various searches based on time and space, longitude and latitude need to be specially processed to generate a special type of geoPoint. The most common way to express geoPoint is as a string of "latitude, longitude", or as an array ["latitude", "longitude"]. It also supports writing in geoHash and WKT POINTprimitive.
[0066] When searching, the distributed search engine uses different types of indexes according to different search condition types. In addition, for one search, the corresponding data is distributed on shards of different nodes, and the search is performed in parallel, which can achieve millisecond-level response and very high search efficiency.
[0067] Step S6: Filter the data stored in the distributed search engine by time and space superposition, and obtain detailed tracks and sampled tracks by customizing data accuracy.
[0068] Preferably, step S6 comprises the following steps:
[0069] Step S6.1: Establish a spatial grid, put all the track data into the spatial grid, and calculate the length S of each spatial grid by customizing the grid accuracy. tile , the calculation formula is as follows:
[0070] S tile =C*cos(latitude) / 2 zoomLevel
[0071] Where C represents the circumference of the earth, C = 2πr, r is the radius of the earth at the track point; latitude is the latitude value of the track point; zoomLevel is the grid accuracy customized by the query;
[0072] Step S6.2: retrieve all original track data within the time range specified by the query retrieval condition and put them into the first-level time data bucket;
[0073] Step S6.3: retrieve all the original track data according to the grid accuracy customized by the query retrieval condition and put them into the secondary spatial grid data bucket;
[0074] Step S6.4: Divide the primary time data bucket into secondary spatial grid data buckets, match the retrieved original track data to the corresponding primary and secondary data buckets according to the track point time and longitude and latitude, and retain one record in each secondary spatial grid data bucket.
[0075] For example, for step S6, assume that the earth is basically round. In order to make it flat, we use an imaginary cylinder to cover it and then unfold it, so that the whole world can be seen as a picture. At this time, the map grid level corresponding to the map is 0, calculated based on the radius of the earth: 6372.7982km, and kept on the equator; for other latitudes, this value must be multiplied by the cosine of the latitude, then the length and width of the grid are 40041472m. If the map grid level is set to 1, then the map is divided into four, and the entire world map is divided into four grids. Then the length and width of the grid are 20020736m. By analogy, when the grid level is 29, the length and width of each map grid are 0.0745m, and the whole world is divided into 7.45cm*7.45cm grids. The corresponding grid accuracy is as follows:
[0076]
[0077]
[0078] Next, we will perform track retrieval. First, we will perform track retrieval based on time filtering:
[0079] That is, only one record is retained within the time range specified by the search conditions. For example, if 60 seconds is specified, the system will bucket all the original track data that meet the conditions according to the time of 60 seconds. For example, the time of track point A is 12:00:01 on XX / XX / XXXX, the time of track point B is 12:00:36 on XX / XX / XXXX, and the time of track point C is 12:01:24 on XX / XX / XXXX. Then track points A and B fall into the bucket of 12:00:00 on XX / XX / XXXX-12:01:00 on XX / XX / XXXX. Another track point C falls into the bucket of 12:01:00 on XX / XX / XXXX-12:02:00 on XX / XX / XXXX. Then one record can be retained in each bucket according to the bucket, that is, track retrieval based on time filtering can be realized.
[0080] Secondly, track retrieval based on spatial filtering:
[0081] That is, according to the grid accuracy specified by the search conditions, only one record is retained in each geographic grid. According to the grid accuracy specified by the search conditions, the whole world is divided into grids of corresponding accuracy. For example, if the grid accuracy is set to 22, then each grid is a 9.536M*9.536M rectangle. The longitude and latitude corresponding to track points A and B fall in the same 9.536M*9.536M grid G1, and the longitude and latitude corresponding to track point C fall in another 9.536M*9.536M grid G2. According to the bucketing rule, the program uses each grid as a data bucket and retains one record in each bucket, thus realizing space-based track filtering retrieval.
[0082] Again, track retrieval based on time-space superposition filtering:
[0083] That is, according to the filtering time range specified by the search conditions, such as 60 seconds, the first-level time data bucket is divided, and according to the spatial grid accuracy specified by the search conditions, the second-level spatial grid data bucket is divided in the first-level time data bucket. The retrieved original track data is matched with the corresponding first-level and second-level data buckets according to the track point time and longitude and latitude. Then, according to the rules, the system retains a record in each second-level spatial grid data bucket to realize track filtering retrieval based on time and space superposition.
[0084] A track storage and retrieval system provided according to the present invention comprises:
[0085] Module M1: The data collection end collects track data through a data collector;
[0086] Module M2: Connect the track data to the distributed data bus through the distributed log receiving service;
[0087] Module M3: The distributed data bus manages data through partitions. The distributed data bus records the use of data by the big data computing engine through consumer groups and offsets.
[0088] Module M4: reads data from the distributed data bus through the big data computing engine to perform data fusion and unify data recording targets;
[0089] Module M5: The merged and unified data is stored in the distributed search engine;
[0090] Module M6: The data stored in the distributed search engine is filtered by time and space superposition to obtain detailed tracks and sampled tracks.
[0091] The present invention also provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the steps of any of the above methods are performed.
[0092] The present invention also provides a track storage and retrieval device, including the above-mentioned track storage and retrieval system or the above-mentioned computer-readable storage medium storing a computer program.
[0093] With the vigorous development of fisheries and shipping, the widespread application of radar and AIS equipment, and the increasingly high requirements of relevant departments for the real-time longitude of tracks, a huge amount of track data has been generated.
[0094] Track data has spatiotemporal characteristics, that is, within a certain time range, track data has both the characteristics of high-speed spatial span and the characteristics of being stationary. Based on the massiveness and spatiotemporal characteristics of tracks, track data retrieval uses a spatiotemporal big data retrieval solution.
[0095] Track retrieval based on time-space superposition corresponds to massive track data with time-space characteristics, which can effectively reduce data, and the conditions are flexible and configurable. Track data with different time-space accuracy can be flexibly obtained according to needs.
[0096] Those skilled in the art know that, in addition to realizing the system and its various devices, modules, and units provided by the present invention in a purely computer-readable program code, it is entirely possible to realize the same functions in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, the system and its various devices, modules, and units provided by the present invention can be considered as a hardware component, and the devices, modules, and units included therein for realizing various functions can also be regarded as structures within the hardware component; the devices, modules, and units for realizing various functions can also be regarded as both software modules for realizing the method and structures within the hardware component.
[0097] The above describes the specific embodiments of the present invention. It should be understood that the present invention is not limited to the above specific embodiments, and those skilled in the art can make various changes or modifications within the scope of the claims, which does not affect the essence of the present invention. In the absence of conflict, the embodiments of the present application and the features in the embodiments can be combined with each other arbitrarily.
Claims
1. A track storage and retrieval method, It is characterized in that The steps include: Step S1: The data collection end collects track data through a data collector; Step S2: Connect the track data to the distributed data bus through the distributed log receiving service; Step S3: The distributed data bus manages data through partitions, and the distributed data bus records the use of data by the big data computing engine through consumer groups and offsets; Step S4: Read the data in the distributed data bus through the big data computing engine to perform data fusion and unify the data recording target; Step S5: storing the merged and unified data in a distributed search engine; Step S6: Filter the data stored in the distributed search engine by time and space superposition, and obtain detailed tracks and sampled tracks by customizing data accuracy; The step S6 comprises the following steps: Step S6.1: Establish a spatial grid, put all the track data into the spatial grid, and calculate the length S of each spatial grid by customizing the grid accuracy. tile , the calculation formula is as follows: S tile =C*cos( latitude ) / 2 zoomLevel Where C represents the circumference of the earth, C = 2Πr, r is the radius of the earth at the track point; latitude is the latitude value of the track point; zoomLevel is the grid accuracy customized by the query; Step S6.2: retrieve all original track data within the time range specified by the query retrieval condition and put them into the first-level time data bucket; Step S6.3: retrieve all the original track data according to the grid accuracy customized by the query retrieval condition and put them into the secondary spatial grid data bucket; Step S6.4: Divide the primary time data bucket into secondary spatial grid data buckets, match the retrieved original track data to the corresponding primary and secondary data buckets according to the track point time and longitude and latitude, and retain one record in each secondary spatial grid data bucket.
2. The track storage and retrieval method according to claim 1, It is characterized in that In step S1, track data is collected by the radar controller and the AIS equipment.
3. The track storage and retrieval method according to claim 1, It is characterized in that The distributed log receiving service in step S2 includes: Distributed receiving service: multiple different receiving services are deployed to receive the track data collected by different data collectors, and the master control server controls the data receiving status; Distributed decoding service: Decode the collected track data using the configuration of different receiving services and convert it into recognizable character data; Distributed Transfer Service: Sends character-recognizable data to the distributed data bus.
4. The track storage and retrieval method according to claim 1, It is characterized in that The distributed data bus in step S3 stores the track data through topics and partitions. The track data of the same topic are stored in different partitions. Each partition includes a primary partition and a backup partition. The primary partition and the backup partition are distributed on different nodes.
5. The track storage and retrieval method according to claim 1, It is characterized in that In step S4, the data of the distributed data bus is read by the big data computing engine to perform data fusion, and different data of the same target and the same time are fused into a unified track record.
6. The track storage and retrieval method according to claim 1, It is characterized in that In step S5, the merged and unified data is stored in a distributed search engine. The data of each computing cycle is used as an index. Each index includes a primary shard and a backup shard. The data is stored in different shards, and different storage strategies are matched to different field types.
7. A track storage and retrieval system, It is characterized in that include: Module M1: The data collection end collects track data through a data collector; Module M2: Connect the track data to the distributed data bus through the distributed log receiving service; Module M3: The distributed data bus manages data through partitions. The distributed data bus records the use of data by the big data computing engine through consumer groups and offsets. Module M4: reads data from the distributed data bus through the big data computing engine to perform data fusion and unify data recording targets; Module M5: The merged and unified data is stored in the distributed search engine; Module M6: Filter the data stored in the distributed search engine by time and space superposition to obtain detailed tracks and sampled tracks; The module M6 comprises the following steps: Module M6.1: Establish a spatial grid, put all the track data into the spatial grid, and calculate the length S of each spatial grid by customizing the grid accuracy. tile , the calculation formula is as follows: S tile =C*cos( latitude ) / 2 zoomLevel Where C represents the circumference of the earth, C = 2Πr, r is the radius of the earth at the track point; latitude is the latitude value of the track point; zoomLevel is the grid accuracy customized by the query; Module M6.2: retrieve all original track data within the time range specified by the query retrieval conditions and put them into the first-level time data bucket; Module M6.3: retrieve all original track data according to the grid accuracy customized by the query retrieval conditions and put them into the secondary spatial grid data bucket; Module M6.4: Divide the primary time data bucket into secondary spatial grid data buckets, match the retrieved original track data to the corresponding primary and secondary data buckets according to the track point time and longitude and latitude, and retain one record in each secondary spatial grid data bucket.
8. A computer-readable storage medium storing a computer program, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A track storage and retrieval device, It is characterized in that It includes the track storage and retrieval system of claim 7 or the computer-readable storage medium storing a computer program of claim 8.
