A data storage and analysis system and method applied to databases
By constructing directed fingerprint graphs and trajectory fingerprint tables, the problems of large storage space occupied by terminal trajectory data and slow query response are solved, achieving efficient trajectory analysis and trend capture, and improving database query efficiency.
Patent Information
- Application Number
- CN202611250086.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-18
- Publication Date
- 2026-11-17
AI Technical Summary
In existing technologies, the trajectory data reported by the terminal contains a large number of extended fields, which leads to the rapid growth of the database table file, which occupies a large amount of storage space. Furthermore, the full-field scanning method results in huge I/O overhead and slow query response. Existing trajectory behavior analysis methods can only capture local instantaneous behavior and cannot perceive changes in movement trends across multiple points.
A directed fingerprint graph is constructed with trajectory points as nodes and correlation degree as edge weights to generate a trajectory fingerprint table. A constrained, layer-by-layer expansion algorithm is used to match trajectory analysis requests. Only the fingerprint table is scanned to reduce I/O overhead, and multi-scale features are used to capture changes in motion trends.
It effectively reduces I/O overhead, improves matching speed, can capture sudden changes in movement trends within a short period of time, supports rapid positioning by vehicle and time range, avoids result redundancy, and improves query efficiency.
Smart Images

Figure CN123115195A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of stored data analysis technology, specifically a stored data analysis system and method applied to databases. Background Technology
[0002] In existing gateway parsing and database import solutions, the trajectory data reported by terminals contains a large number of extended fields, requiring the system to split each field into an independent column and write it into a wide table. A complete trajectory record often contains hundreds of fields, many of which contain null or default values, resulting in a massive single record size. With the high frequency of terminal reporting, the database table file grows rapidly, consuming a huge amount of storage space. More importantly, during subsequent business analysis, the system needs to read the entire wide table record and traverse all fields, even if most fields are irrelevant to the analysis requirements. This full-field scanning method results in huge I / O overhead and slow query response.
[0003] Furthermore, current mainstream trajectory behavior analysis typically only examines the speed and direction changes between adjacent trajectory points, judging events such as acceleration, deceleration, and turning through preset fixed thresholds. These methods can only capture local, instantaneous behavior and cannot perceive changes in motion trends across multiple points.
[0004] Therefore, this invention discloses a data storage and analysis system and method applied to databases to solve the above problems. Summary of the Invention
[0005] The purpose of this invention is to provide a data storage and analysis system and method for databases, in order to solve the problems raised in the prior art.
[0006] To achieve the above objectives, the present invention provides the following technical solution: a method for analyzing stored data applied to a database, the method comprising the following steps: S1: For each trajectory point sequence, analyze the correlation between each point and its predecessor and successor points, construct a directed fingerprint graph with trajectory points as nodes and correlation as edge weights; analyze the behavioral fingerprint code of each node; S2: Generate a trajectory fingerprint table based on vehicle identifier, trajectory start time, and trajectory end time, and store the original trajectory point sequence and trajectory fingerprint table separately; S3: When a trajectory analysis request is received, candidate trajectories are filtered, and the behavioral process described in the trajectory analysis request is transformed into a target fingerprint subgraph template; in the directed fingerprint graph of the target vehicle, subgraphs with the same node connection pattern as the target fingerprint subgraph template are searched, and all fully matching subgraphs are located using a constrained layer-by-layer expansion algorithm. S4: Record the deviation between the actual edge weight and the expected weight level boundary in each match; correct the boundary value of the weight level.
[0007] S1 includes the following: S101: Obtain a time-ordered sequence of trajectory points, where each trajectory point contains at least a timestamp, instantaneous velocity, direction angle, and latitude and longitude coordinates; for each pair of predecessor and successor nodes that are adjacent in time order, analyze the velocity correlation and direction correlation between the predecessor and successor nodes. The velocity correlation is equal to the smaller of the instantaneous velocity of the predecessor node and the instantaneous velocity of the successor node divided by the larger value, and then multiplied by the velocity consistency coefficient; the directional correlation is equal to the cosine of the difference between the directional angles of the predecessor node and the successor node, and then multiplied by the directional smoothing factor; the directional smoothing factor is a preset positive number less than or equal to 1. The speed consistency coefficient is determined according to the following rules: if there is a previous trajectory point of the predecessor node, and the speed change direction of the successor node relative to the predecessor node is the same as the speed change direction of the predecessor node relative to the previous trajectory point, then the speed consistency coefficient is a first speed consistency constant; otherwise, it is a second speed consistency constant. If there is no previous trajectory point, then the speed consistency coefficient is a first speed consistency constant. S102: Using each trajectory point as a node; for each pair of predecessor and successor nodes that are adjacent in time order, establish a forward directed edge from the predecessor node to the successor node and a reverse directed edge from the successor node to the predecessor node; the weight of the forward directed edge is equal to the product of the velocity correlation degree and the direction correlation degree; the weight of the reverse directed edge is equal to the product of the weight of the forward directed edge and a preset weight coefficient; the preset weight coefficient is less than 1; construct a directed fingerprint graph based on the forward directed edge and the reverse directed edge; S103: If a node has a direct predecessor node, the weight of the reverse directed edge from the node to the direct predecessor node is recorded as the first-level incoming edge weight; if there is no direct predecessor node, the first-level incoming edge weight is set to a preset invalid value; if a node has a direct successor node, the weight of the forward directed edge from the node to the direct successor node is recorded as the first-level outgoing edge weight; if there is no direct successor node, the first-level outgoing edge weight is set to a preset invalid value. If a node has a direct predecessor node, analyze the velocity correlation and direction correlation between the node and the direct predecessor node of the node's direct predecessor node, and record the product of the velocity correlation and direction correlation as the jump point backward correlation; if a node does not have a direct predecessor node, the jump point backward correlation is set to a preset invalid value. If a node has a direct successor node, analyze the velocity correlation and direction correlation between the node and the direct successor node of the node's direct successor node, and record the product of the velocity correlation and direction correlation as the jump point forward correlation; if a node does not have a direct successor node, the jump point forward correlation is set to a preset invalid value. The first-level incoming edge weight, the first-level outgoing edge weight, the jump point forward correlation degree, and the jump point backward correlation degree are concatenated in sequence into a quadruple, which serves as the behavior fingerprint of the node. This application, by simultaneously establishing forward and reverse directed edges, not only records the temporal sequence information of the trajectory but also preserves the irreversibility of time, enabling the fingerprint map to distinguish between normal driving and abnormal behaviors such as reversing / backwarding, thus enhancing the completeness of the behavior description. The introduction of forward / backward correlation of jump points ensures that each node's fingerprint code includes not only its relationship with direct neighbors but also secondary correlation information for jumps at intervals. This multi-scale feature effectively captures sudden changes in movement trends within a short period, while single-neighbor point analysis cannot perceive such interval behavior.
[0008] S2 includes the following: S201: Generate a trajectory fingerprint table based on vehicle identifier, trajectory start time, and trajectory end time as indexes. The trajectory fingerprint table also includes node fingerprint code sequence, edge weight list, and global weight distribution histogram. The node fingerprint code sequence is generated as follows: the four element values in the behavior fingerprint code of each node are quantized into integers, each behavior fingerprint code is concatenated into a binary string in sequence, and the binary strings of all nodes are concatenated in time order and stored in the binary large object field. The edge weight list is generated by retrieving the original weight values of all forward directed edges in chronological order, quantizing each weight value into an integer, and storing the quantized byte sequence into a binary large object field. The global weight distribution histogram is generated as follows: the interval from zero to one is divided into several consecutive sub-intervals, the original weight values of all forward edges of the same trajectory are traversed, the number of edges falling into each sub-interval is counted, and a statistical value vector is obtained. S202: Store the original trajectory point sequence separately in the original data table, and save a pointer field in the trajectory fingerprint table pointing to the storage location of the original message.
[0009] The original message of this application is fully preserved in a separate table, while the fingerprint table only stores structured features. During analysis and querying, only the smaller fingerprint table needs to be scanned, significantly reducing I / O overhead; the required original message is read only after a successful match via a pointer, avoiding full loading. Using vehicle identifier and trajectory start time as the primary key, it supports fast location by vehicle and time range, suitable for common business scenarios involving querying the behavior of a specific vehicle during a specific time period.
[0010] S3 includes the following: S301: When a trajectory analysis request is received, candidate trajectories are filtered: Based on the motion pattern or intensity of motion in the request, extract the corresponding preset expected edge weight distribution vector. The expected edge weight distribution vector is a non-negative integer vector, and the value of each dimension represents the expected number of edges falling within the corresponding sub-interval. For each trajectory in the trajectory fingerprint table, the actual statistical value vector is read from the trajectory fingerprint table, and the Manhattan distance between the actual statistical value vector and the expected edge weight distribution vector is calculated. The Manhattan distance is compared with a preset distance threshold, and only trajectories with a Manhattan distance less than or equal to the threshold are retained as candidate trajectories. S302: Transform the behavioral process described in the trajectory analysis request into a target fingerprint subgraph template, wherein the target fingerprint subgraph template includes the number of template nodes and template edge weight constraints; S303: In the directed fingerprint graph of the target vehicle, traverse all candidate trajectories in chronological order as the starting candidate nodes of the subgraph, and perform a layer-by-layer expansion search process for each starting candidate node: Starting from the current candidate node, find all direct successor nodes of the node in the directed fingerprint graph. For each direct successor node, extract the weight value of the forward edge from the candidate node to the direct successor node. If the weight value of the forward edge meets the weight level required from the first node to the second node in the target fingerprint subgraph template, then record the direct successor node as the candidate second node and form a partial subgraph. For the formed partial subgraph, taking the current last node as the current tail node, find all direct successor nodes of the current tail node in the directed fingerprint graph. For each direct successor node, verify the following constraints in sequence. Does the weight value of the forward edge from the current tail node to the direct successor node meet the weight level requirements between the corresponding adjacent nodes in the target fingerprint subgraph template? If the target fingerprint subgraph template specifies a second-level jump edge constraint from the starting candidate node to the direct successor node of the current tail node, then calculate the forward correlation degree of the jump point from the starting candidate node to the direct successor node of the current tail node, and verify whether it meets the weight level required by the target fingerprint subgraph template. A direct successor node is added to a subgraph only when the actual weights of all involved edges meet the weight levels specified by the target fingerprint subgraph template; if any constraint is not met, the path expansion is terminated immediately. When the number of nodes in the expanded partial subgraph is equal to the number of nodes in the target fingerprint subgraph template, the partial subgraph is determined to be a fully matching subgraph, and the time period covered by the fully matching subgraph and the node index range are recorded. S304: Perform a merge and deduplication operation on all fully matching subgraphs obtained from the search; Specifically, this includes: for any two perfectly matched subgraphs, obtaining the start time and end time respectively, calculating the time overlap rate of the two time periods, and the overlap rate is equal to the intersection length of the two time periods divided by the union length; If the overlap rate is greater than the overlap rate threshold, it is determined that the two fully matching subgraphs describe the same behavioral event, and only one of the fully matching subgraphs is retained. The retention rule is as follows: calculate the sum of the absolute values of the deviations between the actual weight values of all matching edges in each perfectly matched subgraph and the expected weight center values of the target fingerprint subgraph template, and retain the perfectly matched subgraphs with the smaller total deviation. Output all the final fully matched subgraphs. Each fully matched subgraph contains at least a start timestamp, an end timestamp, and a node index range. Use the pointer field in the trajectory fingerprint table to read the corresponding complete trajectory data from the original data table. This application first performs coarse screening using a global histogram or first / last feature analysis, and then performs fine-grained fingerprint subgraph matching on the candidate set. This hierarchical strategy avoids performing complex graph searches on invalid trajectories, significantly improving matching speed. Transforming natural language behavior descriptions into structured fingerprint subgraph templates enables the system to understand and execute higher-order behavior queries such as rapid acceleration followed by rapid deceleration, rather than just single-point or fragment matching. Since starting node offsets may lead to overlapping matches, the merging and deduplication step ensures that each behavior interval outputs a result only once, avoiding result redundancy.
[0011] During the expansion process, the constraints of all related edges are immediately verified upon adding each node, and the path is terminated immediately if any constraint is violated. This early stopping strategy significantly reduces the search space, avoids exponential explosion, and allows the matching algorithm to complete in polynomial time. The template can specify the jump point correlation requirements from the starting node to the successor node of the current node, such as requiring that a rapid acceleration cannot be followed by an immediate rapid deceleration. This constraint can match more refined behavioral patterns, such as distinguishing between smooth acceleration-constant speed-smooth deceleration and rapid acceleration-sudden stop-rapid acceleration.
[0012] S4 includes the following: S401: For each successfully matched behavior pattern subgraph, record the expected weight level of each directed edge defined by the target fingerprint subgraph template in the fully matched subgraph and the actual edge weight value read from the directed fingerprint graph; compare the actual edge weight value of each edge with the boundary value of the expected level; record the matching situation where the difference between the actual edge weight value and the boundary value is less than the product of the template interval width and the width coefficient as a touch event, and count the proportion of the total number of touch events in the past several matches to the total number of matched edges; S402: If the proportion is greater than the first threshold, the boundary value of the corresponding desired level is expanded outward; if the proportion is less than the second threshold, the boundary value of the corresponding desired level is expanded inward; the adjusted boundary values of each level are persisted to the configuration center; for newly received trajectory data, the new parameters are directly used to construct a directed fingerprint graph; for historical trajectories that have been stored but not processed, the directed fingerprint graph structure is recalculated using the new parameters when the system is idle, and the fingerprint code sequence and edge weight list in the database are updated. This application uses the frequency with which the actual weight values in the matching results touch the boundary of a gear level to automatically determine whether the current segmentation is too strict or too broad. For example, if a large number of matching results are close to the upper boundary, it indicates that the boundary setting is too low, and the system will expand outward to improve the recall rate; if there are very few touching events but many false negatives, the system will contract inward to improve the accuracy rate. This closed-loop optimization requires no manual intervention.
[0013] A storage data analysis system for databases is provided, wherein the system is implemented using the aforementioned storage data analysis method for databases, and the system includes an association feature analysis module, a compressed storage module, a homomorphic constraint matching module, and a matching deviation correction module. The association feature analysis module is used to analyze the association degree between each point and its predecessor and successor points for each trajectory point sequence, construct a directed fingerprint graph with trajectory points as nodes and association degree as edge weights, and analyze the behavioral fingerprint code of each node; The compressed storage module is used to generate a trajectory fingerprint table based on vehicle identification, trajectory start time, and trajectory end time, and to store the original trajectory point sequence and trajectory fingerprint table separately. The homomorphic constraint matching module is used to filter candidate trajectories when a trajectory analysis request is received, and to convert the behavior process described in the trajectory analysis request into a target fingerprint subgraph template; to search for subgraphs with the same node connection pattern as the target fingerprint subgraph template in the directed fingerprint graph of the target vehicle, and to locate all fully matching subgraphs using a constrained layer-by-layer expansion algorithm. The matching deviation correction module is used to record the deviation between the actual edge weight and the expected weight level boundary in each matching; and to correct the boundary value of the weight level.
[0014] The association feature analysis module includes an association analysis unit, a fingerprint map analysis unit, and a fingerprint code analysis unit; The correlation analysis unit is used to obtain the trajectory point sequence sorted by time. For each pair of predecessor and successor nodes that are adjacent in time order, the unit analyzes the velocity correlation and direction correlation between the predecessor and successor nodes. The fingerprint analysis unit is used to treat each trajectory point as a node; for each pair of predecessor and successor nodes that are adjacent in time sequence, a forward directed edge from the predecessor node to the successor node and a reverse directed edge from the successor node to the predecessor node are established; and a directed fingerprint graph is constructed based on the forward directed edge and the reverse directed edge. The fingerprint analysis unit is used to sequentially concatenate the first-level incoming edge weight, the first-level outgoing edge weight, the jump point forward correlation degree, and the jump point backward correlation degree into a quadruple, which serves as the behavior fingerprint of the node. The compression storage module includes a data compression unit and a storage association unit; The data compression unit is used to generate a trajectory fingerprint table based on vehicle identification, trajectory start time, and trajectory end time as indexes. The trajectory fingerprint table also includes a node fingerprint code sequence, an edge weight list, and a global weight distribution histogram. The storage association unit is used to store the original trajectory point sequence separately into the original data table, and to store a pointer field in the trajectory fingerprint table pointing to the storage location of the original message.
[0015] The homomorphic constraint matching module includes a trajectory filtering unit, a target fingerprint sub-graph template construction unit, a constraint expansion unit, and a merging and deduplication unit. The trajectory filtering unit is used to filter candidate trajectories when a trajectory analysis request is received; The target fingerprint subgraph template construction unit is used to convert the behavioral process described in the trajectory analysis request into a target fingerprint subgraph template; The constraint expansion unit is used to traverse all candidate trajectory nodes in the directed fingerprint graph of the target vehicle in chronological order as the starting candidate nodes of the subgraph, and perform a layer-by-layer expansion search process for each starting candidate node. The merging and deduplication unit is used to perform a merging and deduplication operation on all fully matching subgraphs obtained from the search. The matching deviation correction module includes a deviation analysis unit and a deviation correction unit; The deviation analysis unit is used to record the expected weight level of each directed edge defined by the target fingerprint subgraph template in the fully matched subgraph obtained for each successful behavior pattern matching, as well as the actual edge weight value read from the directed fingerprint graph; compare the actual edge weight value of each edge with the boundary value of the expected level; record the matching situation where the difference between the actual edge weight value and the boundary value is less than the product of the template interval width and the width coefficient as a touch event, and count the proportion of the total number of all touch events in the past several matches to all matched edges; The deviation correction unit is used to expand the boundary value of the corresponding desired level outward if the proportion is greater than the first threshold of proportion; and expand the boundary value of the corresponding desired level inward if the proportion is less than the second threshold of proportion; persist the adjusted boundary values of each level to the configuration center; for newly received trajectory data, directly use the new parameters to construct a directed fingerprint graph; for historical trajectories that have been stored but not processed, recalculate the directed fingerprint graph structure using the new parameters when the system is idle, and update the fingerprint code sequence and edge weight list in the database. Compared with existing technologies, the beneficial effects of this invention are as follows: By simultaneously establishing forward and reverse directed edges, this application not only records the temporal sequence information of the trajectory but also preserves the irreversibility of time, enabling the fingerprint map to distinguish between normal driving and abnormal behaviors such as reversing / backwarding, thus enhancing the completeness of the behavior description. The introduction of forward / backward correlation of jump points ensures that the fingerprint code of each node not only includes the relationship with its direct neighbors but also the secondary correlation information of jumps at intervals. This multi-scale feature can effectively capture sudden changes in movement trends within a short period of time, while single neighbor point analysis cannot perceive such interval behavior. The original message of this application is completely preserved in an independent table, and the fingerprint table only stores structured features. During analysis and querying, only the smaller fingerprint table needs to be scanned, significantly reducing I / O overhead; the required original message is read only after a successful match via a pointer, avoiding full loading. Using vehicle identifier and trajectory start time as the primary key, it supports fast positioning by vehicle and time range, suitable for common business scenarios of querying the behavior of a vehicle at a certain time period. This application first performs coarse screening using a global histogram or first and last features, and then performs fine fingerprint subgraph matching on the candidate set. This hierarchical strategy avoids performing complex graph searches on invalid trajectories, significantly improving matching speed. Transforming natural language behavior descriptions into structured fingerprint subgraph templates enables the system to understand and execute higher-order behavior queries such as rapid acceleration followed by rapid deceleration, rather than just single-point or fragment matching. Since starting node offsets may lead to overlapping matches, the merging and deduplication step ensures that each behavior interval outputs a result only once, avoiding redundancy. This application uses statistical analysis of the frequency with which actual weight values in the matching results touch gear boundaries to automatically determine whether the current division is too strict or too broad. Attached Figure Description
[0016] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings: Figure 1 This is a flowchart illustrating a data storage and analysis method applied to a database according to the present invention. Figure 2 This is a schematic diagram of the structure of a data storage and analysis system applied to a database according to the present invention. Detailed Implementation
[0017] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0018] Please see Figure 1 The present invention provides a technical solution: a method for analyzing stored data applied to a database, the method comprising the following steps: S1: For each trajectory point sequence, analyze the correlation between each point and its predecessor and successor points, construct a directed fingerprint graph with trajectory points as nodes and correlation as edge weights; analyze the behavioral fingerprint code of each node; S1 includes the following: S101: Obtain a time-ordered sequence of trajectory points, where each trajectory point contains at least a timestamp, instantaneous velocity, orientation angle, and latitude and longitude coordinates; for each pair of predecessor and successor nodes that are adjacent in time order, analyze the velocity correlation and orientation correlation between the predecessor and successor nodes. The velocity correlation is equal to the smaller of the instantaneous velocities of the predecessor node and the successor node divided by the larger of the two, and then multiplied by the velocity consistency coefficient; the directional correlation is equal to the cosine of the difference between the directional angles of the predecessor node and the successor node, and then multiplied by the directional smoothing factor; the directional smoothing factor is a preset positive number less than or equal to 1. The rules for determining the velocity consistency coefficient are as follows: if there is a previous trajectory point of the predecessor node, and the velocity change direction of the successor node relative to the predecessor node is the same as the velocity change direction of the predecessor node relative to the previous trajectory point, then the velocity consistency coefficient is taken as the first velocity consistency constant; otherwise, it is taken as the second velocity consistency constant. If there is no previous trajectory point, then the velocity consistency coefficient is taken as the first velocity consistency constant. S102: Treat each trajectory point as a node; for each pair of predecessor and successor nodes that are adjacent in time order, establish a forward directed edge from the predecessor node to the successor node and a reverse directed edge from the successor node to the predecessor node; the weight of the forward directed edge is equal to the product of the velocity correlation degree and the direction correlation degree; the weight of the reverse directed edge is equal to the product of the weight of the forward directed edge and the preset weight coefficient; the preset weight coefficient is less than 1; construct a directed fingerprint graph based on the forward directed edge and the reverse directed edge; S103: If a node has a direct predecessor node, the weight of the reverse directed edge from the node to the direct predecessor node is taken as the first-level incoming edge weight; if there is no direct predecessor node, the first-level incoming edge weight is set to a preset invalid value; if a node has a direct successor node, the weight of the forward directed edge from the node to the direct successor node is taken as the first-level outgoing edge weight; if there is no direct successor node, the first-level outgoing edge weight is set to a preset invalid value. If a node has a direct predecessor node, analyze the velocity correlation and directional correlation between the node and the direct predecessor node of the node's direct predecessor node, and record the product of the velocity correlation and directional correlation as the jump point backward correlation; if a node does not have a direct predecessor node, the jump point backward correlation is set to a preset invalid value. If a node has a direct successor node, analyze the velocity correlation and direction correlation between the node and the direct successor node of the node's direct successor node, and record the product of the velocity correlation and direction correlation as the jump point forward correlation; if a node does not have a direct successor node, the jump point forward correlation is set to a preset invalid value. The first-level incoming edge weight, the first-level outgoing edge weight, the forward correlation of the jump point, and the backward correlation of the jump point are concatenated into a quadruple in order, which serves as the behavior fingerprint of the node. S2: Generate a trajectory fingerprint table based on vehicle identifier, trajectory start time, and trajectory end time, and store the original trajectory point sequence and trajectory fingerprint table separately; S2 includes the following: S201: Generate a trajectory fingerprint table based on vehicle identifier, trajectory start time and trajectory end time as indexes. The trajectory fingerprint table also includes node fingerprint code sequence, edge weight list and global weight distribution histogram. The node fingerprint code sequence is generated as follows: the four element values in the behavior fingerprint code of each node are quantized into integers, each behavior fingerprint code is concatenated into a binary string in sequence, and the binary strings of all nodes are concatenated in time order and stored in the binary large object field. Example 1: In this example, the behavior fingerprint quantization formula is: the quantization value is equal to the original element value multiplied by 15 and then rounded down. If the original value is an invalid placeholder, the quantization value is set to a preset specific value. The edge weight list is generated by retrieving the original weight values of all forward directed edges in chronological order, quantizing each weight value into an integer, and storing the quantized byte sequence into a binary large object field. Example 2: In this example, the weight value quantization formula is: the quantized value is equal to the original weight value multiplied by 255 and then rounded down; The global weight distribution histogram is generated as follows: the interval from zero to one is divided into several consecutive sub-intervals, the original weight values of all forward edges of the same trajectory are traversed, the number of edges falling into each sub-interval is counted, and a statistical value vector is obtained. S202: Store the original trajectory point sequence separately in the original data table, and save a pointer field in the trajectory fingerprint table pointing to the storage location of the original message.
[0019] S3: When a trajectory analysis request is received, candidate trajectories are filtered, and the behavioral process described in the trajectory analysis request is transformed into a target fingerprint subgraph template; in the directed fingerprint graph of the target vehicle, subgraphs with the same node connection pattern as the target fingerprint subgraph template are searched, and all fully matching subgraphs are located using a constrained layer-by-layer expansion algorithm. S3 includes the following: S301: When a trajectory analysis request is received, candidate trajectories are filtered: Based on the motion pattern or intensity of motion in the request, extract the corresponding preset expected edge weight distribution vector. The expected edge weight distribution vector is a non-negative integer vector, and the value of each dimension represents the expected number of edges falling within the corresponding sub-interval. For each trajectory in the trajectory fingerprint table, the actual statistical value vector is read from the trajectory fingerprint table, and the Manhattan distance between the actual statistical value vector and the expected edge weight distribution vector is calculated. The Manhattan distance is compared with a preset distance threshold, and only trajectories with a Manhattan distance less than or equal to the threshold are retained as candidate trajectories. S302: Transform the behavioral process described in the trajectory analysis request into a target fingerprint subgraph template, which includes the number of template nodes and template edge weight constraints. Example 3: In this example, the request is to find a vehicle that suddenly decelerates significantly while driving, then maintains a low speed for a short distance, and then suddenly accelerates significantly. Therefore, this example includes three stages: before deceleration, during deceleration, after deceleration, and during acceleration. Thus, the template has 4 nodes, which are recorded in chronological order as the first node, the second node, the third node, and the fourth node. S303: In the directed fingerprint graph of the target vehicle, traverse all candidate trajectories in chronological order as the starting candidate nodes of the subgraph, and perform a layer-by-layer expansion search process for each starting candidate node: Starting from the current candidate node, find all direct successor nodes of the node in the directed fingerprint graph. For each direct successor node, extract the weight value of the forward edge from the candidate node to the direct successor node. If the weight value of the forward edge meets the weight level required from the first node to the second node in the target fingerprint subgraph template, then record the direct successor node as the candidate second node and form a partial subgraph. For the formed partial subgraph, taking the current last node as the current tail node, find all direct successor nodes of the current tail node in the directed fingerprint graph. For each direct successor node, verify the following constraints in sequence. Does the weight value of the forward edge from the current tail node to the direct successor node meet the weight level requirements between the corresponding adjacent nodes in the target fingerprint subgraph template? If the target fingerprint subgraph template specifies a second-level jump edge constraint from the starting candidate node to the direct successor node of the current tail node, then calculate the forward correlation degree of the jump point from the starting candidate node to the direct successor node of the current tail node, and verify whether it meets the weight level required by the target fingerprint subgraph template. A direct successor node is added to a subgraph only when the actual weights of all involved edges meet the weight levels specified by the target fingerprint subgraph template; if any constraint is not met, the path expansion is terminated immediately. When the number of nodes in the expanded partial subgraph is equal to the number of nodes in the target fingerprint subgraph template, the partial subgraph is determined to be a fully matching subgraph, and the time period covered by the fully matching subgraph and the node index range are recorded. S304: Perform a merge and deduplication operation on all fully matching subgraphs obtained from the search; Specifically, this includes: for any two perfectly matched subgraphs, obtaining the start time and end time respectively, calculating the time overlap rate of the two time periods, and the overlap rate is equal to the intersection length of the two time periods divided by the union length; If the overlap rate is greater than the overlap rate threshold, it is determined that the two fully matching subgraphs describe the same behavioral event, and only one of the fully matching subgraphs is retained. The retention rule is as follows: calculate the sum of the absolute values of the deviations between the actual weight values of all matching edges in each perfectly matched subgraph and the expected weight center values of the target fingerprint subgraph template, and retain the perfectly matched subgraphs with the smaller total deviation. Output all the final fully matched subgraphs. Each fully matched subgraph contains at least a start timestamp, an end timestamp, and a node index range. Use the pointer field in the trajectory fingerprint table to read the corresponding complete trajectory data from the original data table. S4: Record the deviation between the actual edge weight and the expected weight level boundary in each match; correct the boundary value of the weight level.
[0020] S4 includes the following: S401: For each successfully matched behavior pattern subgraph, record the expected weight level of each directed edge defined by the target fingerprint subgraph template in the fully matched subgraph and the actual edge weight value read from the directed fingerprint graph; compare the actual edge weight value of each edge with the boundary value of the expected level; record the matching situation where the difference between the actual edge weight value and the boundary value is less than the product of the template interval width and the width coefficient as a touch event, and count the proportion of the total number of touch events in the past several matches to the total number of matched edges; S402: If the proportion is greater than the first threshold, the boundary value of the corresponding desired level is expanded outward; if the proportion is less than the second threshold, the boundary value of the corresponding desired level is expanded inward; the adjusted boundary values of each level are persisted to the configuration center; for newly received trajectory data, the new parameters are directly used to construct a directed fingerprint graph; for historical trajectories that have been stored but not processed, the directed fingerprint graph structure is recalculated using the new parameters when the system is idle, and the fingerprint code sequence and edge weight list in the database are updated. Please see Figure 2 The present invention provides a technical solution: a data storage and analysis system applied to a database, the system comprising an association feature analysis module, a compressed storage module, a homomorphic constraint matching module, and a matching deviation correction module; The correlation feature analysis module is used to analyze the correlation between each point and its predecessor and successor points for each trajectory point sequence, construct a directed fingerprint graph with trajectory points as nodes and correlation as edge weights, and analyze the behavioral fingerprint code of each node; The compressed storage module is used to generate a trajectory fingerprint table based on vehicle identification, trajectory start time, and trajectory end time, and stores the original trajectory point sequence and trajectory fingerprint table separately; The homomorphic constraint matching module is used to filter candidate trajectories when a trajectory analysis request is received, and to transform the behavior process described in the trajectory analysis request into a target fingerprint subgraph template; it searches for subgraphs with the same node connection pattern as the target fingerprint subgraph template in the directed fingerprint graph of the target vehicle, and uses a constrained layer-by-layer expansion algorithm to locate all fully matching subgraphs. The matching deviation correction module is used to record the deviation between the actual edge weight and the expected weight level boundary in each matching; and to correct the boundary value of the weight level.
[0021] The association feature analysis module includes an association analysis unit, a fingerprint analysis unit, and a fingerprint code analysis unit; The correlation analysis unit is used to obtain the trajectory point sequence sorted by time. For each pair of predecessor and successor nodes that are adjacent in time order, the velocity correlation and directional correlation between the predecessor and successor nodes are analyzed. The fingerprint analysis unit is used to treat each trajectory point as a node; for each pair of predecessor and successor nodes that are adjacent in time sequence, a forward directed edge from the predecessor node to the successor node and a reverse directed edge from the successor node to the predecessor node are established; and a directed fingerprint graph is constructed based on the forward directed edge and the reverse directed edge. The fingerprint analysis unit is used to sequentially concatenate the first-level incoming edge weight, the first-level outgoing edge weight, the forward correlation degree of the jump point, and the backward correlation degree of the jump point into a quadruple, which serves as the behavior fingerprint of the node. The compressed storage module includes a data compression unit and a storage association unit; The data compression unit is used to generate a trajectory fingerprint table based on vehicle identification, trajectory start time, and trajectory end time as indexes. The trajectory fingerprint table also includes node fingerprint code sequences, edge weight list, and global weight distribution histogram. The storage association unit is used to store the original trajectory point sequence separately into the original data table, and to store a pointer field in the trajectory fingerprint table pointing to the storage location of the original message.
[0022] The homomorphic constraint matching module includes a trajectory filtering unit, a target fingerprint subgraph template construction unit, a constraint expansion unit, and a merging and deduplication unit; The trajectory filtering unit is used to filter candidate trajectories when a trajectory analysis request is received; The target fingerprint subgraph template construction unit is used to transform the behavioral process described in the trajectory analysis request into a target fingerprint subgraph template; The constraint expansion unit is used to traverse all candidate trajectory nodes in the directed fingerprint graph of the target vehicle in chronological order as the starting candidate nodes of the subgraph, and perform a layer-by-layer expansion search process for each starting candidate node. The merge and deduplication unit is used to perform a merge and deduplication operation on all fully matching subgraphs obtained from the search. The matching deviation correction module includes a deviation analysis unit and a deviation correction unit; The deviation analysis unit is used to record the expected weight level of each directed edge defined by the target fingerprint subgraph template in the fully matched subgraph obtained for each successful behavior pattern matching, as well as the actual edge weight value read from the directed fingerprint graph; compare the actual edge weight value of each edge with the boundary value of the expected level; record the matching situation where the difference between the actual edge weight value and the boundary value is less than the product of the template interval width and the width coefficient as a touch event, and count the proportion of the total number of all touch events in the past several matches to all matched edges; The deviation correction unit is used to expand the boundary value of the corresponding desired level outward if the proportion is greater than the first threshold of proportion; and expand the boundary value of the corresponding desired level inward if the proportion is less than the second threshold of proportion. The adjusted boundary values of each level are persisted to the configuration center. For newly received trajectory data, the new parameters are directly used to construct a directed fingerprint graph. For historical trajectories that have been stored but not processed, the directed fingerprint graph structure is recalculated using the new parameters when the system is idle, and the fingerprint code sequence and edge weight list in the database are updated. It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "include," "contain," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus.
[0023] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from its spirit or essential characteristics. Therefore, the embodiments should be considered in all respects as exemplary and non-limiting, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the present invention. No reference numerals in the claims should be construed as limiting the scope of the claims.
Claims
1. A method for analyzing stored data applied to a database, characterized in that, The method includes the following steps: S1: For each trajectory point sequence, analyze the correlation between each point and its predecessor and successor points, construct a directed fingerprint graph with trajectory points as nodes and correlation as edge weights; analyze the behavioral fingerprint code of each node; S2: Generate a trajectory fingerprint table based on vehicle identifier, trajectory start time, and trajectory end time, and store the original trajectory point sequence and trajectory fingerprint table separately; S3: When a trajectory analysis request is received, candidate trajectories are filtered, and the behavioral process described in the trajectory analysis request is transformed into a target fingerprint subgraph template; in the directed fingerprint graph of the target vehicle, subgraphs with the same node connection pattern as the target fingerprint subgraph template are searched, and all fully matching subgraphs are located using a constrained layer-by-layer expansion algorithm. S4: Record the deviation between the actual edge weight and the expected weight level boundary in each match; correct the boundary value of the weight level.
2. The data storage and analysis method applied to a database according to claim 1, characterized in that: S1 includes the following: S101: Obtain a time-ordered sequence of trajectory points, where each trajectory point contains at least a timestamp, instantaneous velocity, direction angle, and latitude and longitude coordinates; for each pair of predecessor and successor nodes that are adjacent in time order, analyze the velocity correlation and direction correlation between the predecessor and successor nodes. S102: Take each trajectory point as a node; for each pair of predecessor and successor nodes that are adjacent in time order, establish a forward directed edge from the predecessor node to the successor node and a reverse directed edge from the successor node to the predecessor node. S103: If a node has a direct predecessor node, the weight of the reverse directed edge from the node to the direct predecessor node is recorded as the first-level incoming edge weight; if there is no direct predecessor node, the first-level incoming edge weight is set to a preset invalid value; if a node has a direct successor node, the weight of the forward directed edge from the node to the direct successor node is recorded as the first-level outgoing edge weight. If there is no direct successor node, the first-level outgoing edge weight is set to a preset invalid value; If a node has a direct predecessor node, analyze the velocity correlation and directional correlation between the node and the direct predecessor node of the node's direct predecessor node, and record the product of the velocity correlation and directional correlation as the jump point backward correlation. If a node does not have a direct predecessor node, the backward correlation of the jump point is set to a preset invalid value. If a node has a direct successor node, analyze the velocity correlation and direction correlation between the node and the direct successor node of the node's direct successor node, and record the product of the velocity correlation and direction correlation as the jump point forward correlation; if a node does not have a direct successor node, the jump point forward correlation is set to a preset invalid value. The first-level incoming edge weight, the first-level outgoing edge weight, the jump point forward correlation, and the jump point backward correlation are concatenated in sequence into a quadruple, which serves as the behavior fingerprint of the node.
3. The data storage and analysis method applied to a database according to claim 2, characterized in that: The velocity correlation is equal to the smaller of the instantaneous velocity of the predecessor node and the instantaneous velocity of the successor node divided by the larger value, and then multiplied by the velocity consistency coefficient; the directional correlation is equal to the cosine of the difference between the directional angles of the predecessor node and the successor node, and then multiplied by the directional smoothing factor; the directional smoothing factor is a preset positive number less than or equal to 1.
4. The data storage and analysis method applied to a database according to claim 3, characterized in that: The speed consistency coefficient is determined according to the following rules: if there is a previous trajectory point of the predecessor node, and the speed change direction of the successor node relative to the predecessor node is the same as the speed change direction of the predecessor node relative to the previous trajectory point, then the speed consistency coefficient is a first speed consistency constant; otherwise, it is a second speed consistency constant. If there is no previous trajectory point, then the speed consistency coefficient is a first speed consistency constant.
5. The data storage and analysis method applied to a database according to claim 4, characterized in that: S2 includes the following: S201: Generate a trajectory fingerprint table based on vehicle identifier, trajectory start time, and trajectory end time as indexes. The trajectory fingerprint table also includes node fingerprint code sequence, edge weight list, and global weight distribution histogram. S202: Store the original trajectory point sequence separately in the original data table, and save a pointer field in the trajectory fingerprint table pointing to the storage location of the original message.
6. The data storage and analysis method applied to a database according to claim 4, characterized in that: The node fingerprint code sequence is generated as follows: the four element values in the behavior fingerprint code of each node are quantized into integers, each behavior fingerprint code is concatenated into a binary string in sequence, and the binary strings of all nodes are concatenated in time order and stored in the binary large object field. The edge weight list is generated by retrieving the original weight values of all forward directed edges in chronological order, quantizing each weight value into an integer, and storing the quantized byte sequence into a binary large object field. The global weight distribution histogram is generated as follows: the interval from zero to one is divided into several consecutive sub-intervals, the original weight values of all forward edges of the same trajectory are traversed, the number of edges falling into each sub-interval is counted, and a statistical value vector is obtained.
7. The data storage and analysis method applied to a database according to claim 4, characterized in that: S3 includes the following: S301: When a trajectory analysis request is received, candidate trajectories are filtered. S302: Transform the behavioral process described in the trajectory analysis request into a target fingerprint subgraph template, wherein the target fingerprint subgraph template includes the number of template nodes and template edge weight constraints; S303: In the directed fingerprint graph of the target vehicle, traverse all candidate trajectories in chronological order as the starting candidate nodes of the subgraph, and perform a layer-by-layer expansion search process for each starting candidate node. S304: Perform a merge and deduplication operation on all fully matching subgraphs obtained from the search.
8. The data storage and analysis method applied to a database according to claim 4, characterized in that: The process of expanding the search layer by layer is as follows: Starting from the current candidate node, find all direct successor nodes of the node in the directed fingerprint graph. For each direct successor node, extract the weight value of the forward edge from the candidate node to the direct successor node. If the weight value of the forward edge meets the weight level required from the first node to the second node in the target fingerprint subgraph template, then record the direct successor node as the candidate second node and form a partial subgraph. For the formed partial subgraph, taking the current last node as the current tail node, find all direct successor nodes of the current tail node in the directed fingerprint graph. For each direct successor node, verify the following constraints in sequence. Does the weight value of the forward edge from the current tail node to the direct successor node meet the weight level requirements between the corresponding adjacent nodes in the target fingerprint subgraph template? If the target fingerprint subgraph template specifies a second-level jump edge constraint from the starting candidate node to the direct successor node of the current tail node, then calculate the forward correlation degree of the jump point from the starting candidate node to the direct successor node of the current tail node, and verify whether it meets the weight level required by the target fingerprint subgraph template. A direct successor node is added to a subgraph only when the actual weights of all involved edges meet the weight levels specified by the target fingerprint subgraph template; if any constraint is not met, the path expansion is terminated immediately. When the number of nodes in the expanded partial subgraph is equal to the number of nodes in the target fingerprint subgraph template, the partial subgraph is determined to be a fully matching subgraph, and the time period covered by the fully matching subgraph and the node index range are recorded.
9. A method for storing and analyzing data applied to a database according to claim 4, characterized in that: S4 includes the following: S401: For each successfully matched behavior pattern subgraph, record the expected weight level of each directed edge defined by the target fingerprint subgraph template in the fully matched subgraph and the actual edge weight value read from the directed fingerprint graph; compare the actual edge weight value of each edge with the boundary value of the expected level; record the matching situation where the difference between the actual edge weight value and the boundary value is less than the product of the template interval width and the width coefficient as a touch event, and count the proportion of the total number of touch events in the past several matches to the total number of matched edges; S402: If the proportion is greater than the first threshold, the boundary value of the corresponding desired level will be expanded outward; if the proportion is less than the second threshold, the boundary value of the corresponding desired level will be expanded inward; the adjusted boundary values of each level will be persisted to the configuration center; for newly received trajectory data, the new parameters will be used to directly construct a directed fingerprint graph; for historical trajectories that have been stored but not processed, the directed fingerprint graph structure will be recalculated using the new parameters when the system is idle, and the fingerprint code sequence and edge weight list in the database will be updated.
10. A storage data analysis system applied to a database, wherein the system is implemented using the storage data analysis method for a database as described in any one of claims 1-9, characterized in that, The system includes an association feature analysis module, a compressed storage module, a homomorphic constraint matching module, and a matching deviation correction module; The association feature analysis module is used to analyze the association degree between each point and its predecessor and successor points for each trajectory point sequence, construct a directed fingerprint graph with trajectory points as nodes and association degree as edge weights, and analyze the behavioral fingerprint code of each node; The compressed storage module is used to generate a trajectory fingerprint table based on vehicle identification, trajectory start time, and trajectory end time, and to store the original trajectory point sequence and trajectory fingerprint table separately. The homomorphic constraint matching module is used to filter candidate trajectories when a trajectory analysis request is received, and to convert the behavior process described in the trajectory analysis request into a target fingerprint subgraph template; to search for subgraphs with the same node connection pattern as the target fingerprint subgraph template in the directed fingerprint graph of the target vehicle, and to locate all fully matching subgraphs using a constrained layer-by-layer expansion algorithm. The matching deviation correction module is used to record the deviation between the actual edge weight and the expected weight level boundary in each matching; and to correct the boundary value of the weight level.
