A trajectory data storage method and system for edge environment

By distributing time alignment, road network matching and inverted index construction operators in the edge environment, and using distributed consistent hash rings and log structures to merge tree structure storage, combined with credit value flow control, the trajectory data in the edge environment is solved. The problem of low storage and computing performance is solved, and efficient trajectory data processing and storage are achieved.

CN118509434BActive Publication Date: 2024-10-29ZHEJIANG UNIV
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202410958872.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-17
Publication Date
2024-10-29
Estimated Expiration
2044-07-17

AI Technical Summary

Technical Problem

The existing trajectory analysis system cannot effectively solve the problem of reliable storage and computing between low-performance and heterogeneous nodes in the edge environment, and does not consider the flow control between multiple upstream operators and a single downstream operator, resulting in data transmission throughput Low and insufficient computing performance.

Method used

A trajectory data storage method for edge environments is designed, by distributing time alignment, road network matching and inverted index construction operators on edge computing nodes, and using distributed consistency hash ring algorithm and log structure merging tree structure For data storage, data transmission is combined with a flow control algorithm based on credit value to achieve an architecture of separation of storage and calculation.

Benefits of technology

It improves the efficiency and throughput of real-time trajectory analysis, makes full use of the computing resources and network bandwidth of computing nodes, solves the performance bottleneck of single master node management, and improves storage resource utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118509434B_ABST
    Figure CN118509434B_ABST
Patent Text Reader

Abstract

The present invention discloses a trajectory data storage method and system for edge environments, constructs a lightweight, network-aware general framework for edge trajectory analysis and storage, adopts a storage-computation separation architecture, divides the nodes on the edge into computing nodes and storage nodes, wherein the computing nodes are responsible for lightweight tasks such as time alignment of trajectories, road network matching, inverted index construction, customized compression, etc., and a credit-based co-flow control algorithm is used between different computing nodes for data transmission and communication, and a decentralized distributed consistent hashing algorithm is used for storage nodes to form a virtual connection ring, and a log structure is used to merge tree structures to store data. On the one hand, the computing resources of computing nodes are fully utilized, and data transmission between nodes fully utilizes network bandwidth resources, thereby improving computing efficiency and processing throughput; on the other hand, customized compression and decentralized mechanisms are used for autonomy between storage nodes, thereby improving storage resource utilization and high availability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of trajectory edge computing storage and analysis, and in particular, relates to a trajectory data storage method and system for edge environments. Background Art

[0002] With the popularity of location-aware devices, a large amount of data capturing the movement patterns of objects, usually called trajectory data, has emerged. These trajectory data are crucial in applications such as online vehicle navigation and real-time traffic prediction, which require real-time processing of trajectory data and instant response to user requests. For example, real-time path planning usually requires selecting a suitable path within milliseconds.

[0003] Implementing trajectory analysis and storage systems in edge environments has received increasing attention recently. Currently, most trajectory analysis systems run in the cloud, which brings additional data transmission overhead from the edge to the cloud. Implementing trajectory analysis and storage in edge environments can significantly improve the efficiency of real-time query response. Therefore, designing a lightweight trajectory analysis and storage system for edge environments has become an urgent need in academia and industry.

[0004] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:

[0005] First, the existing trajectory analysis system does not consider the low performance, reliable storage and computing between heterogeneous nodes in the edge environment, and therefore cannot be directly applied to the edge environment. In addition, the existing edge stream processing system does not consider the flow control problem between multiple upstream operators and a single downstream operator, which will limit the throughput of data transmission. At the same time, the scheduling of calculations and the storage scheduling of data are bound, resulting in poor computing performance. Summary of the invention

[0006] In view of the shortcomings of the prior art, the purpose of the embodiments of the present application is to provide a trajectory data storage method and system for edge environments, which can realize network-aware, lightweight trajectory analysis and storage without uploading data from the terminal to the cloud side, thereby significantly improving the efficiency and throughput of real-time trajectory analysis.

[0007] According to a first aspect of an embodiment of the present application, a trajectory data storage method for an edge environment is provided, including:

[0008] In response to the real-time trajectory stream data from the terminal, it includes time alignment operator, road network matching operator, inverted index construction operator, compression operator and distributes it to different edge computing nodes;

[0009] In response to a time alignment operator, time aligning the trajectory stream data;

[0010] In response to the road network matching operator, mapping the time-aligned trajectory stream data into the trajectory data constrained by the road network;

[0011] In response to the inverted index construction operator, an inverted index is constructed, i.e., a mapping of a road network segment ID to a trajectory segment in the trajectory data constrained by the road network, wherein the inverted index is used for trajectory data query;

[0012] In response to the compression operator, a memory table including a road network segment ID, a timestamp and a distance sequence is generated according to the trajectory data restricted by the road network, and the memory table is sent to any edge storage node, so that the edge storage node responds to the received memory table, adopts a distributed consistent hash ring algorithm to locate the edge storage node position to which the memory table is assigned, sends the data to the node and stores it using a log structure merged with a tree structure.

[0013] Furthermore, the trajectory stream data is time-aligned, specifically, data deviating from the time point is discarded, and the trajectory stream data is interpolated using a trajectory interpolation algorithm.

[0014] Further, the time-aligned trajectory data is mapped to the trajectory data restricted by the road network, specifically: the time-aligned trajectory data is mapped from the latitude and longitude data in the free space to the trajectory data restricted by the road network , where the trajectory point Indicates that it contains road network segment information , the distance between the mapping point and the starting point of the road network segment And align timestamp information .

[0015] Furthermore, according to the road network representation trajectory data, a memory table including the road network segment ID, timestamp and distance sequence is generated, including:

[0016] A turn-based streaming trajectory compression algorithm is used to compress the road network segment ID into a binary bit array;

[0017] Using incremental compression algorithm, the timestamp sequence is compressed to the initial timestamp and sampling frequency;

[0018] Using floating point compression algorithm, the distance sequence is compressed into a binary bit array;

[0019] Sort the compressed data by trajectory ID and timestamp to form a memory table.

[0020] Furthermore, a turn-based streaming trajectory compression algorithm is used to compress the road network segment ID into a binary bit array, including:

[0021] For track points And the trajectory sequence ,in is the road network segment information, is the distance between the mapping point and the starting point of the road network segment, To align timestamps, get the road network segment sequence , thus obtaining the steering sequence ,in is Among all the adjacent edges of The adjacent edge, As the starting edge;

[0022] According to the steering sequence , calculated ;

[0023] When there is a subsequence , and satisfies , then the subsequence Compressed expression , if not satisfied, then retain the atomic sequence, where is an identifier used to identify the subsequent sequence as a compressed sequence. The length is , is the length of the compressed sequence.

[0024] Furthermore, for each operator located in the same edge computing node, a shared memory method is used for data communication;

[0025] For operators located at different edge computing nodes, TCP is used for data communication. If there are multiple upstream operators sending data to a single downstream operator, a credit-based flow control algorithm is used for flow control, specifically:

[0026] If the network load is lower than or equal to a first predetermined threshold, a first-come, first-served strategy is adopted;

[0027] If the network load is higher than the first predetermined threshold and the difference between the bandwidth of the upstream node and the average bandwidth is within the second predetermined threshold, the long queue priority strategy is adopted. ,in represents the upstream operator set, Indicates the upstream operator The final allocated cache size, Indicates the cache size requested by the upstream operator, that is, the length of the current data queue. Indicates the cache size available to the current downstream operator;

[0028] If the network load is higher than the first predetermined threshold and the difference between the bandwidth of the upstream node and the average bandwidth is outside the second predetermined threshold, the strategy of maximizing cache resource utilization is adopted to satisfy the formula , and satisfy the constraints , and for any ,satisfy ,in is an adjustable parameter. Indicates the upstream operator The final allocated cache size, Indicates the time for a round of data transmission between upstream and downstream operators. Indicates the upstream operator The size of the cache space, Indicates the cache size requested by the upstream operator.

[0029] According to a second aspect of an embodiment of the present application, a trajectory data storage method for an edge environment is provided, including:

[0030] In response to the received memory table, a distributed consistent hash ring algorithm is used to locate the edge storage node position to which the memory table is allocated, the data is sent to the node and stored using a log structure merged with a tree structure;

[0031] The memory table is obtained through the following process:

[0032] The edge computing node responds to the real-time trajectory stream data from the terminal, includes a time alignment operator, a road network matching operator, an inverted index construction operator, and a compression operator and distributes it to different edge computing nodes; responds to the time alignment operator, performs time alignment on the trajectory stream data; responds to the road network matching operator, maps the time-aligned trajectory stream data to the trajectory data restricted by the road network; responds to the inverted index construction operator, constructs an inverted index, that is, a mapping of the road network segment ID to the trajectory segment in the trajectory data restricted by the road network; responds to the compression operator, generates a memory table including the road network segment ID, timestamp and distance sequence according to the trajectory data restricted by the road network.

[0033] Furthermore, a distributed consistent hash ring algorithm is used to locate the edge storage node where the memory table is allocated, and the data is sent to the node, including:

[0034] According to the trajectory ID in the memory table, the ring position of the trajectory data is obtained using a distributed consistent hash ring algorithm, and the memory table and the ring position are sent to any edge storage node. If the ring position is within the data ring position range managed by the edge storage node, the search ends; otherwise, the edge storage node searches the local routing table for the edge storage node closest to the ring position from back to front, and forwards the memory table to the closest node, and so on, until an edge storage node whose ring position is within the node management range is found, that is, the edge storage node to which storage is allocated.

[0035] According to a third aspect of an embodiment of the present application, a trajectory data storage system for an edge environment is provided, comprising a computing layer and a storage layer, wherein the computing layer comprises a plurality of edge computing nodes, and the storage layer comprises a plurality of edge storage nodes;

[0036] The edge computing node responds to the real-time trajectory stream data from the terminal, includes a time alignment operator, a road network matching operator, an inverted index construction operator, and a compression operator and distributes it to different edge computing nodes; responds to the time alignment operator, performs time alignment on the trajectory stream data; responds to the road network matching operator, maps the time-aligned trajectory stream data to the trajectory data restricted by the road network; responds to the inverted index construction operator, constructs an inverted index, that is, a mapping of the road network segment ID to the trajectory segment in the trajectory data restricted by the road network; responds to the compression operator, generates a memory table including the road network segment ID, timestamp and distance sequence according to the trajectory data restricted by the road network, and sends the memory table to any edge storage node;

[0037] In response to the received memory table, the edge storage node uses a distributed consistent hash ring algorithm to locate the edge storage node position to which the memory table is allocated, sends the data to the node and stores it using a log structure merged with a tree structure.

[0038] According to a fourth aspect of an embodiment of the present application, a trajectory data query method based on the system according to the third aspect is provided, comprising:

[0039] In response to the trajectory query request, the edge computing node sends the trajectory ID to the edge storage node, wherein the trajectory ID is directly obtained from the trajectory query request or is obtained by mapping the road network segment ID in the trajectory query request through an inverted index;

[0040] In response to the trajectory ID, the edge storage node locates the node where the trajectory ID is located through a distributed consistent hash ring algorithm, and obtains the trajectory data of the trajectory ID by retrieving the local log structure of the node and merging the position index data in the tree structure.

[0041] The technical solution provided by the embodiments of the present application may have the following beneficial effects:

[0042] As can be seen from the above embodiments, the present application constructs a lightweight, network-aware general framework for the analysis and storage of edge trajectories. This framework adopts a storage-computation separation architecture, dividing the nodes on the edge into computing nodes and storage nodes, where computing nodes are responsible for lightweight tasks such as time alignment of trajectories, road network matching, and inverted index construction. Different computing nodes use a credit-based co-flow control algorithm for data transmission and communication, and storage nodes use a decentralized distributed consistent hashing algorithm to form a virtual connection ring. At the same time, a customized compression algorithm is used to compress the trajectory data, and a log structure is used to merge the tree structure to store the data. On the one hand, the lightweight operator of trajectory processing and analysis makes full use of the computing resources of the computing nodes, while the data transmission between nodes makes full use of the network bandwidth resources, improving the computing efficiency and processing throughput. On the other hand, a customized compression algorithm is used to compress the trajectory data, and a decentralized mechanism is used for autonomy between storage nodes, which improves the utilization of storage resources and solves the performance bottleneck of single master node management.

[0043] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0045] Figure 1 It is a schematic diagram of a trajectory data storage system for edge environments according to an exemplary embodiment.

[0046] Figure 2 The invention is a flowchart showing an edge computing node responding to a compression operator according to an exemplary embodiment.

[0047] Figure 3 The invention is a flowchart showing an edge storage node responding to a memory table according to an exemplary embodiment.

[0048] Figure 4 The present invention is a flowchart of a trajectory data query method for an edge environment according to an exemplary embodiment.

[0049] Figure 5 is a schematic diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION

[0050] Here, exemplary embodiments are described in detail, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application.

[0051] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0052] It should be understood that although the terms first, second, third, etc. may be used in the present application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0053] This application provides a trajectory data storage system for edge environments, such as Figure 1 As shown, it includes a computing layer and a storage layer, the computing layer includes a number of edge computing nodes, and the storage layer includes a number of edge storage nodes;

[0054] The edge computing node responds to the real-time trajectory stream data from the terminal, distributes the time alignment operator, the road network matching operator, the inverted index construction operator, and the compression operator corresponding to the trajectory stream data to different edge computing nodes; responds to the time alignment operator, performs time alignment on the trajectory stream data; responds to the road network matching operator, maps the time-aligned trajectory stream data to the trajectory data restricted by the road network; responds to the inverted index construction operator, constructs an inverted index, that is, a mapping between the road network segment ID and the trajectory segment in the trajectory data restricted by the road network; responds to the compression operator, generates a memory table including the road network segment ID, the timestamp and the distance sequence according to the trajectory data restricted by the road network, and sends the memory table to any edge storage node;

[0055] In response to the received memory table, the edge storage node uses a distributed consistent hash ring algorithm to locate the edge storage node position to which the memory table is allocated, sends the data to the node and stores it using a log structure merged with a tree structure.

[0056] It can be seen from the above embodiments that the present application constructs a lightweight, network-aware general framework for the analysis and storage of edge trajectories. This framework adopts a storage-computation separation architecture, dividing the nodes on the edge into computing nodes and storage nodes, where computing nodes are responsible for lightweight tasks such as time alignment of trajectories, road network matching, and inverted index construction. Different computing nodes use a credit-based co-flow control algorithm for data transmission and communication, and physical nodes use a decentralized distributed consistent hashing algorithm to form a virtual connection ring. At the same time, a customized compression algorithm is used to compress the trajectory data, and a log structure is used to merge the tree structure to store data. On the one hand, the lightweight operator of trajectory processing makes full use of the computing resources of the computing nodes, and the data transmission between nodes makes full use of the network bandwidth resources, improving the computing efficiency and processing throughput. On the other hand, a customized compression algorithm is used to compress the trajectory data, and a decentralized mechanism is used for autonomy between storage nodes, which improves the utilization of storage resources and solves the performance bottleneck of single master node management.

[0057] In the computing layer, the edge computing node first obtains real-time trajectory stream data from the vehicle terminal. Specifically, in the Internet of Vehicles scenario, a large number of vehicles move over time, and tens of thousands of trajectory stream data are generated at every moment, that is, it contains several continuous trajectory points with timestamps and geographic location information. For example, within a certain period of time, the vehicle moves from the starting point to the end point, and a series of trajectory points represented by triples (longitude, latitude, timestamp) are obtained. It should be noted that the vehicle terminal will select the nearest edge computing node for transmission.

[0058] After receiving the trajectory flow data, the edge computing node constructs the time alignment operator, road network matching operator, inverted index construction operator, and compression operator corresponding to the trajectory flow data and submits them to the master node in the computing node. The master node evenly distributes them to different edge computing nodes according to the round-robin algorithm to make full use of the computing resources of different nodes. Specifically, the edge computing node receives the trajectory flow data. Assigning a unique identifier , and create a new directed acyclic logical execution plan The logical execution plan includes a time alignment operator, a road network matching operator, an inverted index construction operator, and a compression operator: The trajectory points are interpolated and discarded so that different trajectory stream data maintain the same sampling rate. ; The road network matching operator will Mapping from latitude and longitude data in free space to trajectory data identified by road network , where the trajectory point Indicates that it contains road network segment information , the distance between the mapping point and the starting point of the road network segment And align timestamp information ; The inverted index construction operator is used to construct Map to The inverted index of is used to facilitate subsequent trajectory search. The compression operator is used to compress the road network segment ID, timestamp and distance sequence according to the trajectory data restricted by the road network, and the compressed multi-column data is formed into a memory table, and sorted according to the trajectory ID and timestamp. In addition, in order to continuously input the same trajectory stream into the logical execution plan, it is necessary to register the master node in the computing node Mapping relationship can avoid data loss and wrong sending problems.

[0059] For edge computing nodes that receive the time alignment operator, they time-align the trajectory stream data, discard the data that deviates from the time point, and re-interpolate; specifically, in order to eliminate the noise in the original trajectory data, the trajectory interpolation algorithm is used to interpolate the original trajectory so that all trajectory data maintain the same sampling rate. This is also of great help for subsequent compression storage and sub-trajectory query.

[0060] For the edge computing node that receives the road network matching operator, it performs road network mapping on the time-aligned trajectory data to obtain the trajectory data restricted by the road network. , where the trajectory point Indicates that it contains road network segment information , the distance between the mapping point and the starting point of the road network segment And align timestamp information Specifically, for each original trajectory point , can find a road network segment , so that for any , all satisfied ,in represents a set of road network segments, Indicates the distance from a point to a line segment. The original trajectory point In the road network The projection point of ,in To calculate the Euclidean distance between two points, Indicates road network segment The starting point.

[0061] For the edge computing node that receives the inverted index construction operator, it uses the trajectory ID and road network segment ID restricted by the road network to build an inverted index, that is, the trajectory ID can be indexed by the road network segment ID; specifically, an inverted index table is stored in the metadata center. Passed the road network section , then the index table Add a When performing a trajectory range query, a series of nodes passing through the road network segment can be located according to the index table. , and then through Complete the query of specific trajectory data.

[0062] For the edge computing node that receives the compression operator, it compresses the road network segment ID, timestamp, and distance sequence, forms a memory table with the compressed multi-column data, and sorts them according to the trajectory ID and timestamp, such as Figure 2 As shown, specifically:

[0063] S11: Using a turn-based streaming trajectory compression algorithm, the road network segment ID is compressed into a binary bit array;

[0064] Specifically, for the trajectory point And the trajectory sequence , we can get the road network segment sequence , so that the steering sequence can be obtained ,in ,express is Among all the adjacent edges of The adjacent edge, As the starting edge, the calculation method is recorded as In particular, when Direction and When the directions are consistent, . Will turn to sequence After taking the minimum value of each item in the sequence , recorded as . When there is a subsequence , and satisfies , then the subsequence Compressed expression , if not satisfied, the atomic sequence is retained. is a string of special identifiers used to identify the subsequent sequence as a compressed sequence. The length is , is the length of the subsequent compressed sequence, The length is ,Right now By redesigning the calculation method of trajectory segment steering, the trajectory lossless compression is optimized and the storage volume of trajectory data is reduced.

[0065] S12: using an incremental compression algorithm to compress the timestamp sequence into an initial timestamp and a sampling frequency;

[0066] Specifically, for the trajectory point And the trajectory sequence , we can get the timestamp sequence , since the time of the trajectories is aligned, that is, the sampling rate of all trajectories is the same, so ,in That is, the sampling frequency is fixed. Then the timestamp sequence can be rewritten as , through the incremental compression algorithm, we can get ,in No storage is required, the final timestamp sequence can be kept only data, making the compression ratio approximately equal to 1.

[0067] S13: Using a floating point number compression algorithm, compress the distance sequence into a binary bit array;

[0068] Specifically, for the trajectory point And the trajectory sequence , we can get the distance sequence ,because is a floating point number. The distance sequence is a sequence of floating point numbers. Therefore, the optimal floating point compression algorithm Elf is used to compress the sequence. Compress and obtain a binary bit array.

[0069] S14: sorting the compressed data according to the trajectory ID and timestamp to form a memory table;

[0070] According to the continuous input of data in the trajectory flow, the memory table will be sorted according to the trajectory ID and timestamp, where the road network segment ID sequence, timestamp sequence, and distance sequence are stored using the column storage method. When the size of the memory table exceeds the threshold, the writing of the old memory table will be stopped, and the memory table will be sent to any edge storage node for storage, and a new memory table will be created to maintain the writing of the trajectory flow.

[0071] It should be noted that there is corresponding data communication between the operators assigned to each edge computing node based on the computing tasks to be performed.

[0072] The flow control algorithm will not be used for different logical operators distributed to the same physical node; specifically, the logical operators located on the same physical node will use shared memory to communicate data without involving network IO. Therefore, the flow control algorithm will not be used for data communication in this scenario.

[0073] TCP will be used for data communication between operators distributed to different physical nodes, so a flow control algorithm is needed. For scenarios where multiple upstream operators send data to a single downstream operator, a credit-based co-flow control algorithm will be used. Before sending data, the upstream operator will first apply to the downstream operator for the size of the data to be sent, and the downstream operator will make a global allocation. The upstream operator will then send the data of the corresponding size to the downstream operator; specifically, a credit-based flow control algorithm will be used for data communication between operators across physical nodes. The upstream operator needs to confirm the allocatable cache size with the downstream operator before sending the data, and the downstream operator will comprehensively consider the historical cache requests of different upstream operators to dynamically allocate the cache size. At the same time, the algorithm will dynamically adjust the flow control strategy according to different network loads, including the first-come-first-served strategy, the long queue priority strategy, and the strategy to maximize cache resource utilization. In the scenario where the network load is low (the data buffer space occupancy rate of the data source node, i.e. the node that receives the vehicle terminal trajectory data transmission, is less than or equal to 70%), the First Come First Serve (FCFS) strategy will be adopted, that is, the upstream operators are sorted according to their request time, and the upstream operators with earlier request times are given priority. In the scenario where the network load is high (i.e. the data buffer space occupancy rate of the data source node is greater than 70%) but the physical nodes where the upstream nodes are located have similar bandwidths (i.e. the node bandwidth is within the average bandwidth of the node bandwidth), the upstream operators are sorted according to their request time, and the upstream operators with earlier request times are given priority. In the scenario of , the long queue first strategy (LQF) will be adopted, that is, the cache is allocated to the upstream operator with more backlog data first. The specific cache allocation strategy is: ,in represents the upstream operator set, Indicates the upstream operator The final allocated cache size, Indicates the cache size requested by the upstream operator, that is, the length of the current data queue. Indicates the available cache size of the current downstream operator. When the network load is high (that is, the data buffer space occupancy rate of the data source node is greater than 70%) and the physical node bandwidth varies greatly (that is, the node bandwidth is not within the average bandwidth), In the scenario of , the Maximum Buffer Utility (MBU) strategy will be adopted. This strategy will take into account the backlog data of the upstream operator and the network bandwidth of the upstream operator. The specific cache allocation strategy satisfies the formula , and satisfy the constraints , and for any ,satisfy .in is an adjustable parameter. Indicates the upstream operator The final allocated cache size, Indicates the time for a round of data transmission between upstream and downstream operators. Indicates the upstream operator The size of the cache space, Indicates the cache size requested by the upstream operator. The above credit-based co-flow control algorithm solves the flow control in multiple production and single consumption scenarios, thereby improving the computing throughput of the system in the edge environment.

[0074] For the edge storage node that receives the memory table, it uses the distributed consistent hash ring algorithm to locate the edge storage node where the memory table is assigned, sends the data to the node, and uses the log structure to merge the tree structure for storage. Figure 3 As shown, the following sub-steps may be included:

[0075] S21: According to the trajectory ID in the memory table, the ring position of the trajectory data is obtained by using a distributed consistent hash ring algorithm, and the memory table and the ring position are sent to any edge storage node. If the ring position is within the data ring position range managed by the edge storage node, the search ends; otherwise, the edge storage node searches the local routing table for the edge storage node closest to the ring position from back to front, and forwards the memory table to the closest node, and so on, until the edge storage node whose ring position is within the node management range is found, that is, the edge storage node to which storage is allocated;

[0076] Specifically, according to the edge physical node, each node Each has a unique identifier , and the ring position can be calculated ,in Yes After the hash value is calculated by the distributed consistent hashing algorithm, the modulus is taken. Responsible for storing the ring position in Each node maintains a routing table locally, which contains at most records to locate resources, where is the bit width of NodeId. The entry represents the node A subsequent node , and the node Contains at least one ring position greater than Data indicating the mapping of ring position ranges to nodes.

[0077] According to the trajectory ID, that is, , we can get its ring position . Set the memory table and ring position Send to any edge storage node .node Search for entries in your own routing table from back to front ,satisfy , get the node ID of the table entry , forwarding data to the node , and so on. If the data is still not found after traversing the entire table, it means that the data is stored in the node No subsequent search is required. At this time, the node The data will be retrieved and returned. It is easy to get the time complexity of the search process is ,in is the total number of storage nodes.

[0078] S22: Using the log structure to merge the tree structure, the trajectory data in the memory table is stored in order according to the trajectory ID and timestamp;

[0079] Specifically, the memory table is formed into a sorted string table file, wherein the data in the memory table is stored in order according to the columns. In addition, the sorted string table file also stores metadata such as the starting network segment ID and the starting timestamp, as well as index data for locating the starting positions of different trajectories in the file.

[0080] Based on the above system, the present application also provides a trajectory data storage method for edge environment, which is applied to edge computing nodes and includes:

[0081] In response to the real-time trajectory stream data from the terminal, the time alignment operator, the road network matching operator, the inverted index construction operator, and the compression operator corresponding to the trajectory stream data are distributed to different edge computing nodes;

[0082] In response to a time alignment operator, time aligning the trajectory stream data;

[0083] In response to the road network matching operator, mapping the time-aligned trajectory stream data into the trajectory data constrained by the road network;

[0084] In response to the inverted index construction operator, an inverted index is constructed, i.e., a mapping of the road network segment IDs to the trajectory segments in the trajectory data constrained by the road network;

[0085] In response to the compression operator, a memory table including a road network segment ID, a timestamp and a distance sequence is generated according to the trajectory data restricted by the road network, and the memory table is sent to any edge storage node, so that the edge storage node responds to the received memory table, adopts a distributed consistent hash ring algorithm to locate the edge storage node position to which the memory table is assigned, sends the data to the node and stores it using a log structure merged with a tree structure.

[0086] Based on the above system, the present application also provides a trajectory data storage method for edge environment, which is applied to edge storage nodes and includes:

[0087] In response to the received memory table, a distributed consistent hash ring algorithm is used to locate the edge storage node position to which the memory table is allocated, the data is sent to the node and stored using a log structure merged with a tree structure;

[0088] The memory table is obtained through the following process:

[0089] In response to the real-time trajectory stream data from the terminal, the edge computing node distributes the time alignment operator, the road network matching operator, the inverted index construction operator, and the compression operator corresponding to the trajectory stream data to different edge computing nodes; in response to the time alignment operator, the trajectory stream data is time-aligned; in response to the road network matching operator, the time-aligned trajectory stream data is mapped to the trajectory data restricted by the road network; in response to the inverted index construction operator, an inverted index is constructed, that is, the mapping of the road network segment ID to the trajectory segment in the trajectory data restricted by the road network; in response to the compression operator, a memory table including the road network segment ID, timestamp and distance sequence is generated according to the trajectory data restricted by the road network, and the memory table is sent to any edge storage node.

[0090] Regarding the above-mentioned trajectory data storage method for edge environment, the specific implementation of each step has been described in detail in the embodiment of the above-mentioned trajectory data storage system for edge environment, and will not be elaborated here.

[0091] Based on the above system, the present application also provides a trajectory data query method for edge environments, such as Figure 4 As shown, including:

[0092] S31: In response to a trajectory ID query request and / or a trajectory space range query request from a terminal, wherein the trajectory ID query request includes a trajectory ID and a time range, the trajectory space range query request includes a road network segment ID set, and the trajectory ID query request, the edge computing node sends the trajectory ID and the time range to the edge storage node; for the trajectory space range query request, the edge computing node maps all road network segment IDs into trajectory IDs by querying the inverted index, and sends the trajectory ID to the edge storage node;

[0093] S32: In response to the trajectory ID, the edge storage node locates the node where the trajectory ID is located through a distributed consistent hash ring algorithm, and retrieves the location index data in the local log structure of the node and merges the location index data in the tree structure, thereby filtering out the trajectory data that meets the above trajectory ID and time range.

[0094] Specifically, the specific implementation of locating the node where the trajectory ID is located by using the distributed consistent hash ring algorithm has been introduced above and will not be repeated here.

[0095] Specifically, the result of the trajectory ID query is the trajectory of the corresponding vehicle within a certain time range, and the result of the trajectory space range query is the trajectory of the vehicle passing through certain road network segments. It should be noted that the trajectory space range query request can also include a road network time range, and the query result at this time is the trajectory of the vehicle passing through certain road network segments within a certain road network time range, and further can include a trajectory time range, and the query result at this time is the trajectory of the vehicle passing through certain road network segments within a certain road network time range within a certain trajectory time range.

[0096] Accordingly, the present application also provides an electronic device, including: one or more processors; a memory for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement the above-mentioned trajectory data storage method for edge environments. Figure 5 As shown, a hardware structure diagram of a trajectory data storage system for edge environments provided by an embodiment of the present invention is provided for any device with data processing capabilities, except Figure 5 In addition to the processor, memory and network interface shown, any device with data processing capability in which the apparatus in the embodiment is located may also include other hardware, generally based on the actual functions of the device with data processing capability, which will not be described in detail.

[0097] Correspondingly, the present application also provides a computer-readable storage medium on which computer instructions are stored, and when the instructions are executed by the processor, the trajectory data storage method for the edge environment as described above is implemented. The computer-readable storage medium can be an internal storage unit of any device with data processing capabilities described in any of the aforementioned embodiments, such as a hard disk or a memory. The computer-readable storage medium can also be an external storage device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), an SD card, a flash card (Flash Card), etc. equipped on the device. Furthermore, the computer-readable storage medium can also include both an internal storage unit and an external storage device of any device with data processing capabilities. The computer-readable storage medium is used to store the computer program and other programs and data required by any device with data processing capabilities, and can also be used to temporarily store data that has been output or is to be output.

[0098] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the contents disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary technical means in the art that are not disclosed in the present application.

[0099] It should be understood that the present application is not limited to the exact construction that has been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof.

Claims

1. A trajectory data storage method for edge environments, characterized in that: include: In response to the real-time trajectory stream data from the terminal, it includes time alignment operator, road network matching operator, inverted index construction operator, compression operator and distributes it to different edge computing nodes; In response to a time alignment operator, time aligning the trajectory stream data; In response to the road network matching operator, mapping the time-aligned trajectory stream data into the trajectory data constrained by the road network; In response to the inverted index construction operator, an inverted index is constructed, i.e., a mapping of a road network segment ID to a trajectory segment in the trajectory data constrained by the road network, wherein the inverted index is used for trajectory data query; In response to the compression operator, a memory table including a road network segment ID, a timestamp and a distance sequence is generated according to the trajectory data restricted by the road network, and the memory table is sent to any edge storage node, so that the edge storage node responds to the received memory table, uses a distributed consistent hash ring algorithm to locate the edge storage node position to which the memory table is allocated, sends the data to the node and stores it using a log structure merge tree structure; Among them, according to the road network representation trajectory data, a memory table including the road network segment ID, timestamp and distance sequence is generated, including: A turn-based streaming trajectory compression algorithm is used to compress the road network segment ID into a binary bit array; Using incremental compression algorithm, the timestamp sequence is compressed to the initial timestamp and sampling frequency; Using floating point compression algorithm, the distance sequence is compressed into a binary bit array; Sort the compressed data by trajectory ID and timestamp to form a memory table; Among them, a turning-based streaming trajectory compression algorithm is used to compress the road network segment ID into a binary bit array, including: For track points And the trajectory sequence ,in is the road network segment information, is the distance between the mapping point and the starting point of the road network segment, To align timestamps, get the road network segment sequence , thus obtaining the steering sequence ,in is Among all the adjacent edges of The adjacent edge, As the starting edge; According to the steering sequence , calculated ; When there is a subsequence , and satisfies , then the subsequence Compressed expression , if not satisfied, then retain the atomic sequence, where is an identifier used to identify the subsequent sequence as a compressed sequence. The length is , is the length of the compressed sequence.

2. The method according to claim 1, characterized in that The trajectory stream data is time-aligned, specifically, data deviating from the time point is discarded, and the trajectory stream data is interpolated using a trajectory interpolation algorithm.

3. The method according to claim 1, characterized in that Map the time-aligned trajectory data to the trajectory data restricted by the road network, specifically: map the time-aligned trajectory data from the latitude and longitude data in the free space to the trajectory data restricted by the road network , where the trajectory point Indicates that it contains road network segment information , the distance between the mapping point and the starting point of the road network segment And align timestamp information .

4. The method according to claim 1, characterized in that: For operators located on the same edge computing node, data communication is carried out using shared memory; For operators located at different edge computing nodes, TCP is used for data communication. If there are multiple upstream operators sending data to a single downstream operator, a credit-based flow control algorithm is used for flow control, specifically: If the network load is lower than or equal to a first predetermined threshold, a first-come, first-served strategy is adopted; If the network load is higher than the first predetermined threshold and the difference between the bandwidth of the upstream node and the average bandwidth is within the second predetermined threshold, the long queue priority strategy is adopted. ,in represents the upstream operator set, Indicates the upstream operator The final allocated cache size, Indicates the cache size requested by the upstream operator, that is, the length of the current data queue. Indicates the cache size available to the current downstream operator; If the network load is higher than the first predetermined threshold and the difference between the bandwidth of the upstream node and the average bandwidth is outside the second predetermined threshold, the strategy of maximizing cache resource utilization is adopted to satisfy the formula , and satisfy the constraints , and for any ,satisfy ,in is an adjustable parameter. Indicates the upstream operator The final allocated cache size, Indicates the time for a round of data transmission between upstream and downstream operators. Indicates the upstream operator The size of the cache space, Indicates the cache size requested by the upstream operator.

5. A trajectory data storage method for edge environments, characterized in that: include: In response to the received memory table, a distributed consistent hash ring algorithm is used to locate the edge storage node position to which the memory table is allocated, the data is sent to the node and stored using a log structure merged with a tree structure; The memory table is obtained through the following process: The edge computing node responds to the real-time trajectory stream data from the terminal, includes a time alignment operator, a road network matching operator, an inverted index construction operator, and a compression operator and distributes it to different edge computing nodes; responds to the time alignment operator, performs time alignment on the trajectory stream data; responds to the road network matching operator, maps the time-aligned trajectory stream data to the trajectory data restricted by the road network; responds to the inverted index construction operator, constructs an inverted index, that is, a mapping of the road network segment ID to the trajectory segment in the trajectory data restricted by the road network; responds to the compression operator, generates a memory table including the road network segment ID, timestamp and distance sequence according to the trajectory data restricted by the road network; Among them, according to the road network representation trajectory data, a memory table including the road network segment ID, timestamp and distance sequence is generated, including: A turn-based streaming trajectory compression algorithm is used to compress the road network segment ID into a binary bit array; Using incremental compression algorithm, the timestamp sequence is compressed to the initial timestamp and sampling frequency; Using floating point compression algorithm, the distance sequence is compressed into a binary bit array; Sort the compressed data by trajectory ID and timestamp to form a memory table; Among them, a turning-based streaming trajectory compression algorithm is used to compress the road network segment ID into a binary bit array, including: For track points And the trajectory sequence ,in is the road network segment information, is the distance between the mapping point and the starting point of the road network segment, To align timestamps, get the road network segment sequence , thus obtaining the steering sequence ,in is Among all the adjacent edges of The adjacent edge, As the starting edge; According to the steering sequence , calculated ; When there is a subsequence , and satisfies , then the subsequence Compressed expression , if not satisfied, then retain the atomic sequence, where is an identifier used to identify the subsequent sequence as a compressed sequence. The length is , is the length of the compressed sequence.

6. The method according to claim 5, characterized in that Use the distributed consistent hash ring algorithm to locate the edge storage node where the memory table is allocated, and send the data to the node, including: According to the trajectory ID in the memory table, the ring position of the trajectory data is obtained using a distributed consistent hash ring algorithm, and the memory table and the ring position are sent to any edge storage node. If the ring position is within the data ring position range managed by the edge storage node, the search ends; otherwise, the edge storage node searches the local routing table for the edge storage node closest to the ring position from back to front, and forwards the memory table to the closest node, and so on, until an edge storage node whose ring position is within the node management range is found, that is, the edge storage node to which storage is allocated.

7. A trajectory data storage system for edge environments, characterized in that: It includes a computing layer and a storage layer, wherein the computing layer includes a plurality of edge computing nodes, and the storage layer includes a plurality of edge storage nodes; The edge computing node responds to the real-time trajectory flow data from the terminal, includes a time alignment operator, a road network matching operator, an inverted index construction operator, a compression operator and distributes it to different edge computing nodes; responds to the time alignment operator, and time-aligns the trajectory flow data; In response to the road network matching operator, mapping the time-aligned trajectory stream data into the trajectory data constrained by the road network; In response to the inverted index construction operator, an inverted index is constructed, i.e., a mapping of the road network segment IDs to the trajectory segments in the trajectory data constrained by the road network; In response to the compression operator, a memory table including a road network segment ID, a timestamp, and a distance sequence is generated according to the trajectory data constrained by the road network, and the memory table is sent to any edge storage node; The edge storage node responds to the received memory table by using a distributed consistent hash ring algorithm to locate the edge storage node position to which the memory table is allocated, sends the data to the node and stores it by using a log structure merged with a tree structure; Among them, according to the road network representation trajectory data, a memory table including the road network segment ID, timestamp and distance sequence is generated, including: A turn-based streaming trajectory compression algorithm is used to compress the road network segment ID into a binary bit array; Using incremental compression algorithm, the timestamp sequence is compressed to the initial timestamp and sampling frequency; Using floating point compression algorithm, the distance sequence is compressed into a binary bit array; Sort the compressed data by trajectory ID and timestamp to form a memory table; Among them, a turning-based streaming trajectory compression algorithm is used to compress the road network segment ID into a binary bit array, including: For track points And the trajectory sequence ,in is the road network segment information, is the distance between the mapping point and the starting point of the road network segment, To align timestamps, get the road network segment sequence , thus obtaining the steering sequence ,in is Among all the adjacent edges of The adjacent edge, As the starting edge; According to the steering sequence , calculated ; When there is a subsequence , and satisfies , then the subsequence Compressed expression , if not satisfied, then retain the atomic sequence, where is an identifier used to identify the subsequent sequence as a compressed sequence. The length is , is the length of the compressed sequence.

8. A trajectory data query method based on the system of claim 7, characterized in that: include: In response to the trajectory query request, the edge computing node sends the trajectory ID to the edge storage node, wherein the trajectory ID is directly obtained from the trajectory query request or is obtained by mapping the road network segment ID in the trajectory query request through an inverted index; In response to the trajectory ID, the edge storage node locates the node where the trajectory ID is located through a distributed consistent hash ring algorithm, and obtains the trajectory data of the trajectory ID by retrieving the local log structure of the node and merging the position index data in the tree structure.

Citation Information

Patent Citations

  • Road network matching method, device and equipment and storage medium

    CN112035591A

  • User trajectory calculation method and device, and electronic equipment

    CN112040413A

  • Big data and edge computing-based data integration method and the storage medium

    CN113515367A

  • Trajectory data processing method, trajectory data processing program and trajectory data processing device

    JP2017174230A

  • Route Computation Based on Route-Oriented Vehicle Trajectories

    US20110208429A1