Passing abnormality prediction method and system based on AI space-time graph neural network
Patent Information
- Application Number
- CN202610702244.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-21
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2046-05-21
AI Technical Summary
传统方法忽略了这些复杂的时空关联,难以从整体上把握人员通行的动态变化,从而无法准确预测可能出现的通行异常,给人员安防带来了一定的隐患
[0008]基于以上方面,通过获取预设区域内的历史通行记录序列,全面收集了不同人员在不同时刻的通行位置和通行方式信息,基于该历史通行记录序列构建通行时空关联链,以人员为关联节点,以不同人员在连续时间范围内的位置关联关系和时间协同关系为关联链路,并承载位置关联度和时间协同度,深入挖掘了人员之间复杂的时空关联特性,能够更准确地反映人员通行的动态模式。调用预训练的AI时空图神经网络对通行时空关联链进行动态关联建模处理,精确得到各关联链路的关联强度演化轨迹,有效捕捉了人员之间关联关系随时间的变化情况,基于关联强度演化轨迹挖掘异常关联簇,通过轨迹特征进行时空关联聚类,筛选出偏离常规演化规律的关联链路并按时空关联关系分组,能够准确识别出人员通行中可能存在的异常情况,如异常聚集、非法跟随等。最后根据异常关联簇生成包含异常发生时间范围和涉及人员的通行异常预测结果,为安防管理人员提供了详细、准确的异常信息,使其能够及时采取措施应对异常情况,有效预防安全事故的发生,显著提升了人员安防智慧通行场景下通行异常预测的准确性、及时性和实用性。
Smart Images

Figure CN122572541B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent access control technology for personnel security, and more specifically, to a method and system for predicting traffic anomalies based on AI spatiotemporal graph neural networks. Background Technology
[0002] In intelligent access control scenarios for personnel security, ensuring safe passage and timely identification and handling of abnormal passage situations are crucial. Currently, common personnel access management methods mainly rely on traditional monitoring systems and simple rule-based judgments. Traditional monitoring systems capture images of people passing through cameras and rely on manual observation or pre-set simple algorithms to detect abnormal behavior, such as people entering restricted areas or abnormal gatherings. However, the above methods have many limitations.
[0003] On the one hand, manual observation is easily affected by subjective factors, and when faced with a large amount of surveillance footage, it is difficult to achieve real-time and comprehensive monitoring, which can easily lead to missed detections and misjudgments. On the other hand, simple algorithms can usually only identify some predefined fixed patterns of abnormal behavior. For some complex and atypical abnormal passage situations, such as potentially dangerous behaviors caused by special interactions between people, traditional methods often cannot effectively identify them.
[0004] Furthermore, existing access control methods do not fully consider the spatiotemporal relationships between people. In actual pedestrian traffic scenarios, the movement trajectories and schedules of different individuals often influence each other. For example, at large events, the flow and gathering of people create specific spatiotemporal patterns. Traditional methods ignore these complex spatiotemporal relationships, making it difficult to grasp the dynamic changes in pedestrian traffic as a whole. Consequently, they cannot accurately predict potential traffic anomalies, posing certain security risks to personnel. Summary of the Invention
[0005] In view of the above-mentioned problems, and in conjunction with the first aspect of the present invention, embodiments of the present invention provide a method for predicting traffic anomalies based on an AI spatiotemporal graph neural network, the method comprising: Obtain a historical passage record sequence within a preset area. The historical passage record sequence contains the passage location information and passage mode information of multiple passage subjects at different times. Based on the historical passage record sequence, a passage spatiotemporal association chain is constructed. The passage spatiotemporal association chain takes the passage subject as the association node and the position association relationship and time coordination relationship of different passage subjects within a continuous time range as the association link. The association link carries the position association degree and time coordination degree. The pre-trained AI spatiotemporal graph neural network is invoked to perform dynamic association modeling on the travel spatiotemporal association chain, thereby obtaining the association strength evolution trajectory of each association link in the travel spatiotemporal association chain; Based on the correlation strength evolution trajectory, abnormal correlation clusters among the passing subjects are mined. Spatiotemporal correlation clustering is performed by using the trajectory features of the correlation strength evolution trajectory output by the AI spatiotemporal graph neural network. Correlation links that deviate from the normal evolution law are screened out and grouped according to spatiotemporal correlation relationship to form abnormal correlation clusters. Based on the abnormal association cluster, a traffic anomaly prediction result is generated, which includes the time range of anomaly occurrence and the subjects involved in the passage. The time range corresponding to all associated links in the abnormal association cluster is extracted and integrated into the time range of anomaly occurrence. The subjects corresponding to the associated nodes involved in all associated links in the abnormal association cluster are extracted as the subjects involved in the passage. The time range of anomaly occurrence and the subjects involved in the passage are associated to form the traffic anomaly prediction result.
[0006] Furthermore, embodiments of the present invention also provide a traffic anomaly prediction system based on AI spatiotemporal graph neural networks, characterized in that it includes: A processor; a machine-readable storage medium for storing machine-executable instructions of the processor; wherein the processor is configured to execute the above-described traffic anomaly prediction method based on an AI spatiotemporal graph neural network by executing the machine-executable instructions.
[0007] In another aspect, embodiments of the present invention also provide a computer program product, the computer program product including machine-executable instructions, the machine-executable instructions being stored in a computer-readable storage medium, a processor of a computer device reading the machine-executable instructions from the computer-readable storage medium, the processor executing the machine-executable instructions, causing the computer device to execute the above-mentioned traffic anomaly prediction method based on AI spatiotemporal graph neural network.
[0008] Based on the above, by acquiring historical passage record sequences within a preset area, comprehensive information on the passage locations and modes of passage of different individuals at different times was collected. A spatiotemporal correlation chain was constructed based on this historical passage record sequence, using individuals as correlation nodes and the positional and temporal coordination relationships of different individuals within a continuous time range as correlation links, carrying both positional correlation and temporal coordination degrees. This deeply explores the complex spatiotemporal correlation characteristics between individuals, enabling a more accurate reflection of the dynamic patterns of personnel passage. A pre-trained AI spatiotemporal graph neural network was invoked to dynamically model the spatiotemporal correlation chain, accurately obtaining the correlation strength evolution trajectory of each correlation link. This effectively captured the changes in the correlation relationships between individuals over time. Based on the correlation strength evolution trajectory, abnormal correlation clusters were mined, and spatiotemporal correlation clustering was performed through trajectory features. Correspondence links deviating from the conventional evolutionary patterns were filtered out and grouped according to spatiotemporal correlation relationships, accurately identifying possible anomalies in personnel passage, such as abnormal aggregation and illegal following. Finally, based on the abnormal association clusters, the prediction results of passage anomalies are generated, including the time range of the anomaly occurrence and the personnel involved. This provides security management personnel with detailed and accurate anomaly information, enabling them to take timely measures to deal with abnormal situations, effectively prevent the occurrence of security accidents, and significantly improve the accuracy, timeliness and practicality of passage anomaly prediction in the context of intelligent personnel security passage. Attached Figure Description
[0009] Figure 1 This is a schematic diagram of the execution flow of the traffic anomaly prediction method based on AI spatiotemporal graph neural network provided in an embodiment of the present invention.
[0010] Figure 2 This is a schematic diagram of exemplary hardware and software components of the traffic anomaly prediction system based on AI spatiotemporal graph neural network provided in an embodiment of the present invention. Detailed Implementation
[0011] The present invention will now be described in detail with reference to the accompanying drawings. Figure 1 This is a flowchart illustrating a traffic anomaly prediction method based on an AI spatiotemporal graph neural network according to an embodiment of the present invention. The following is a detailed description of the traffic anomaly prediction method based on an AI spatiotemporal graph neural network.
[0012] Step S110: Obtain the historical passage record sequence within the preset area. The historical passage record sequence contains the passage location information and passage mode information of multiple passage subjects at different times.
[0013] In this embodiment, the preset area is set as a corporate park under a smart access control scenario. This corporate park includes multiple functional areas such as office buildings, production workshops, R&D centers, employee dormitories, and canteens, each equipped with access control systems, surveillance cameras, facial recognition devices, and other security access control equipment. The acquisition of historical access record sequences is achieved by integrating data collected by the aforementioned security access control devices. During data collection, privacy protection technologies are employed for handling sensitive data. For example, the facial image data of the access subject is anonymized, retaining only the feature vector used for identification, and this feature vector is encrypted and stored using an irreversible hash algorithm. The identity information of the access subject is replaced with a virtual identity identifier; the original identity information is only stored in an authorized security management system, and access requires multiple authorization verifications.
[0014] The historical access records include individuals within the park, visitors, and suppliers. Access location information at different times is represented by location markers recorded by access control systems and surveillance cameras in various areas, such as the lobby access control on the first floor of the office building, the entrance to production workshop A area, and the corridor on the third floor of the R&D center. These location markers correspond one-to-one with the physical spatial layout of the park, ensuring the accuracy of the location information. Access method information is recorded based on the actual access verification method, such as facial recognition access, IC card access, fingerprint access, or visitor registration accompanied by staff.
[0015] Step S120: Construct a spatiotemporal association chain for passage based on the historical passage record sequence. The spatiotemporal association chain for passage takes the passage subject as the association node and the position association relationship and time coordination relationship of different passage subjects within a continuous time range as the association link. The association link carries the position association degree and time coordination degree.
[0016] Step S121: Extract all passage times and corresponding passage location information of each passage subject from the historical passage record sequence, arrange them in chronological order of passage times, and generate a passage spatiotemporal record for each passage subject.
[0017] For each entity using the park's access routes, the passage time and corresponding location information for each passage are extracted from the historical access record sequence. The passage time is accurate to the second, and the location information is the specific area marker traversed during that passage. The extracted information is then arranged chronologically to form a spatiotemporal record for each entity. For example, for an employee, their spatiotemporal record might include the time and location of passing through the office building's lobby access control on a weekday morning, the time and location of entering production workshop A in the morning, and the time and location of going to the cafeteria at noon, etc. These records are arranged sequentially by time.
[0018] Step S122: Divide the total time range covered by the historical passage record sequence into multiple consecutive time segments with the same duration, and assign a unique time identifier to each time segment.
[0019] Determine the total time range covered by the historical access record sequence, such as the past three months. Divide this total time range into multiple consecutive time segments of equal duration. The duration of each time segment can be set according to actual security management needs, such as one hour. Assign a unique time identifier to each time segment. The time identifier can be represented by the start time of the time period. For example, if a time segment starts at 8:00 AM and ends at 9:00 AM, its time identifier would be the start time.
[0020] Step S123: For a given time segment, extract the portion of the spatiotemporal records of all passing subjects that belongs to that time segment, forming the subject passing set for that time segment.
[0021] Select a time segment, such as the segment from 8:00 AM to 9:00 AM. Iterate through the spatiotemporal records of all passing entities, extracting the passing records whose times belong to this time segment, including the corresponding passing entity and location information. Combine these extracted records to form a subject-specific passing set for that time segment. This subject-specific passing set contains the passage information of all passing entities within the park during that time segment.
[0022] Step S124: Select any two different passing subjects from the main passing subject set of this time segment, and determine the passing position information and passing time of the two passing subjects in this time segment.
[0023] Two different entities are randomly selected from the aforementioned access set, such as employee A and employee B. All access location information and corresponding access times for employees A and B within the specified time segment are extracted from the access set. This information will be used for subsequent analysis of the locational and temporal relationships between the two entities.
[0024] Step S125: Extract all the passage location information of the first passage subject within the time segment, and calculate the spatial region composed of all the passage location information of the first passage subject within the time segment using the convex hull algorithm, which is taken as the location region of the first passage subject.
[0025] Taking employee A as an example, extract all their location information within that time segment, such as the lobby on the first floor of the office building, the office on the third floor of the R&D center, and the break room. Mark these locations within the physical spatial layout of the park, and then use the convex hull algorithm to process these marked points, obtaining a minimum convex polygon that contains all the marked points. The spatial area enclosed by this minimum convex polygon is employee A's location area within that time segment. This location area reflects the range of employee A's activity space within that time segment.
[0026] Step S126: Extract all passage location information of the second passage subject within the time segment, and calculate the spatial region composed of all passage location information of the second passage subject within the time segment using the convex hull algorithm, which is taken as the location region of the second passage subject.
[0027] For employee B, the same method as in step S125 is used to extract all his access location information within the time segment, such as production workshop B area, warehouse, conference room on the second floor of office building, etc. After marking these locations in the physical space layout of the park, the convex hull algorithm is used to calculate the smallest convex polygon containing these locations, and the location area of employee B within the time segment is obtained.
[0028] Step S127: Calculate the intersection area and union area of the two location regions, and use the ratio of the intersection area to the union area as the location correlation degree.
[0029] The locations of employee A and employee B are superimposed, and the area of their overlap (intersection area) and the total area covered by the combined area (union area) are calculated. Then, the intersection area is divided by the union area to obtain the positional correlation degree between employee A and employee B within that time segment. The magnitude of the positional correlation degree reflects the closeness of spatial connection between the two entities; a higher value indicates a greater degree of overlap in their activity spaces within that time segment.
[0030] Step S128: Extract all passage times of the first passage subject within the time segment to form the first time set; extract all passage times of the second passage subject within the time segment to form the second time set.
[0031] Extract all passage times of employee A and employee B within the time segment. Arrange employee A's passage times in sequence to form the first time set; arrange employee B's passage times in sequence to form the second time set. The above time sets record the specific passage times of the two passing entities within the time segment.
[0032] Step S129: Calculate the number of intersection times and the number of union times of the two time sets, and use the ratio of the number of intersection times to the number of union times as the time synergy.
[0033] Compare the first and second time sets to identify the common moments and count their number (intersection time count). Then, merge all moments from both sets, remove duplicates, and count the total number (union time count). Divide the intersection time count by the union time count to obtain the time coordination degree between employee A and employee B within that time segment. The time coordination degree reflects the degree of coordination between the two participants in time; a higher value indicates a greater overlap in their travel times within that time segment.
[0034] Step S1210: If both the location correlation and time coordination are greater than the preset threshold, then the two passing entities are used as the associated nodes to establish the association link for the time segment, and the location correlation and time coordination are used as the carrying information of the association link for the time segment.
[0035] Two thresholds are preset: a location association threshold and a time coordination threshold. These thresholds are set based on the park's personnel security management experience and historical data statistics. The calculated location association degree between employee A and employee B is compared with both the location association threshold and the time coordination degree. If both the location association degree and the time coordination degree are greater than the location association threshold, then employee A and employee B are considered to have a strong location association and time coordination relationship within that time segment. In this case, an association link is established in the spatiotemporal association chain with employee A and employee B as the association nodes, and the calculated location association degree and time coordination degree are stored as the carrying information of this association link.
[0036] Step S1211: Repeat the above steps from selecting two passing subjects to establishing the association link of the time segment until all pairs of passing subjects in the subject passing set of the time segment have been processed.
[0037] Within the main travel set of this time segment, other different pairwise travel combinations are selected, such as employee A and employee C, employee B and employee C, etc. Following the methods in steps S124 to S1210, the positional correlation and temporal coordination of each pair of travel entities are calculated sequentially, and the corresponding association link is established when the conditions are met. This process continues until all possible pairwise travel combinations within this time segment have been processed.
[0038] Step S1212: Connect the associated links of each associated node in different time segments according to the time identifier order, so that the associated links of the same group of associated nodes in different time segments form a continuous link sequence.
[0039] For each pair of connected entities (i.e., connected nodes) that have established a link, their links in different time segments are connected sequentially according to the time identifiers of the time segments. For example, if employee A and employee B have one link in the time segment from 8:00 AM to 9:00 AM on the first day, and another link in the time segment from 9:00 AM to 10:00 AM on the first day, then these two links are connected in chronological order to form a continuous link sequence. This link sequence reflects the changes in the connection between employee A and employee B in different time segments.
[0040] Step S1213: Integrate the continuous link sequences of all associated nodes, adjust the time segment identifiers of the continuous link sequences of each associated node, so that the continuous link sequence of each associated node is consistent with the continuous link sequences of other associated nodes in the time dimension, and generate a travel spatiotemporal association chain.
[0041] All entities using the passage within the park are treated as associated nodes, and all continuous link sequences formed between them are integrated as a whole. During the integration process, the time segment identifiers of the continuous link sequences of each associated node are checked for consistency. If inconsistencies exist in the time segment division, adjustments are made to ensure consistency, guaranteeing that all associated link sequences are based on the same time segment division. After integration, a spatiotemporal link chain is formed, with the entities using the passage as associated nodes and the spatiotemporal relationships between different entities as associated links. This spatiotemporal link chain fully reflects the spatiotemporal relationships of various entities using the passage within the park over a historical time frame.
[0042] Step S130: Call the pre-trained AI spatiotemporal graph neural network to perform dynamic association modeling on the travel spatiotemporal association chain, and obtain the association strength evolution trajectory of each association link in the travel spatiotemporal association chain.
[0043] Step S131: Extract the historical passage frequency information of the passage subject corresponding to each associated node and the location correlation degree and time coordination degree corresponding to each associated link from the passage spatiotemporal association chain.
[0044] From the spatiotemporal association chain, for each associated node (i.e., the passing entity), the total number of passes in the historical passing record sequence is counted to obtain historical passing frequency information, which reflects the activity level of the passing entity within the park. Simultaneously, for each association link, its location correlation and temporal coordination are extracted; these data form the basis for subsequent dynamic association modeling.
[0045] Step S132: Encode the historical passage frequency information of the associated nodes into basic node features, and encode the location correlation and time coordination of the associated links into basic link features.
[0046] The historical passage frequency information of associated nodes is encoded and converted into a computer-recognizable numerical vector form, i.e., the node's basic features. During the encoding process, normalization can be performed based on the range of historical passage frequencies to ensure that the historical passage frequency information of different passing entities falls within the same numerical range. The location correlation and temporal coordination of associated links are also encoded, combining the two into a single vector as the link's basic features. These basic features simultaneously reflect the location and temporal characteristics of the associated links.
[0047] Step S133: For each associated node, collect the basic node features of its adjacent associated nodes and the basic link features of the associated links connecting the two. The basic node features of the adjacent associated nodes and the corresponding basic link features are dynamically fused through the spatiotemporal coupling module of the AI spatiotemporal graph neural network. During the fusion process, the spatial dimension fusion weight is adjusted according to the positional correlation and the temporal dimension fusion weight is adjusted according to the temporal coordination to generate the associated message of the adjacent node.
[0048] For each associated node, identify all adjacent associated nodes with which it has a link. Collect the basic node features of these adjacent associated nodes and the basic link features of the links connecting the current node to its adjacent associated nodes. Input these features into the spatiotemporal coupling module of the AI spatiotemporal graph neural network. This module is responsible for dynamically fusing the basic node features and corresponding link features of adjacent associated nodes. During the fusion process, the spatial dimension fusion weight is dynamically adjusted based on the positional correlation in the link features. The higher the positional correlation, the greater the spatial dimension fusion weight, indicating a closer spatial connection and requiring more consideration of the spatial features of adjacent nodes. Simultaneously, the temporal dimension fusion weight is dynamically adjusted based on the temporal synergy in the link features. The higher the temporal synergy, the greater the temporal dimension fusion weight, indicating stronger temporal synergy and requiring more attention to the temporal features of adjacent nodes. After fusion using the above dynamic weight adjustment method, an adjacent node association message reflecting the spatiotemporal relationship between adjacent nodes and the current node is generated.
[0049] Step S134: Dynamically assign weights to all adjacent node association messages. During the weight assignment process, the attention mechanism module of the AI spatiotemporal graph neural network is used to adjust the weights by combining the trend of the association strength between adjacent nodes and the current associated node in the historical time segment, so as to obtain weighted adjacent node association messages.
[0050] The generated neighbor node association messages are input into the attention mechanism module of the AI spatiotemporal graph neural network. This attention mechanism module can analyze the trend of the association strength between each neighboring node and the current node over multiple historical time segments. For example, the association strength between some neighboring nodes and the current node may gradually increase in recent time segments, while that of others may gradually decrease. Based on these trends, the attention mechanism module assigns a dynamic weight to each neighboring node association message. Neighboring node association messages with an increasing trend in association strength are given higher weights, and vice versa. After weight allocation, the weighted neighboring node association messages are obtained.
[0051] Step S135: Accumulate all weighted adjacent node association messages, then concatenate them with the node basic features of the current associated node. Use the feature enhancement module of the AI spatiotemporal graph neural network to perform nonlinear transformation on the concatenation result to enhance the spatiotemporal association information and generate the spatiotemporal association message vector of the current associated node.
[0052] The weighted neighbor node association messages are summed to obtain a comprehensive message reflecting the influence of all neighboring nodes on the current node. This comprehensive message is then concatenated with the current node's own basic node features to form a combined feature vector containing both the current node's own features and the influence features of neighboring nodes. This combined feature vector is input into the feature enhancement module of the AI spatiotemporal graph neural network. This module processes the combined feature vector through multiple layers of nonlinear activation functions, performing nonlinear transformations to further enhance the spatiotemporal association information, highlighting important feature patterns, and ultimately generating the spatiotemporal association message vector of the current node. This spatiotemporal association message vector comprehensively reflects the spatiotemporal association state of the current node.
[0053] Step S136: Arrange the spatiotemporal association message vectors of each associated node in different time segments into a node time sequence message sequence according to the time segment order.
[0054] For each associated node, the spatiotemporal association message vectors generated in each time segment are arranged sequentially according to the order of the time segments to form a node time-series message sequence. This node time-series message sequence reflects the changes in the spatiotemporal association state of the associated nodes over time.
[0055] Step S137: Input the node time-series message sequence into the time recursion module of the AI spatiotemporal graph neural network, capture the dependency relationship of the node time-series message sequences of adjacent time segments through the gating mechanism, calculate the evolution difference between the message state of the current time segment and the message state of the previous time segment, and generate a time-series associated message vector.
[0056] Step S1371: Initialize the message state of the first time segment as the initial message state of the previous time segment. The initial message state is generated by fusing the node time sequence message vector of the first time segment with the initial weights pre-stored in the AI spatiotemporal graph neural network.
[0057] In the time recursion module, the message state of the first time segment is first initialized. The node time-series message vector corresponding to the first time segment in the node time-series message sequence is fused with the initial weights saved during the pre-training process of the AI spatiotemporal graph neural network. The fusion method can be the addition of a bias term after multiplying the vector and the weight matrix to obtain the initial message state of the first time segment, which serves as the basis for calculating the message state of subsequent time segments.
[0058] Step S1372: Enter the second time segment and extract the node time sequence message vector of this time segment as the message input of the current time segment.
[0059] After processing the first time segment, we move on to the second time segment. We extract the node time-series message vector corresponding to the time segment from the node time-series message sequence and use it as the message input for the current time segment to calculate the message state of the time segment.
[0060] Step S1373: Input the message input of the current time segment and the message state of the previous time segment into the input gate module of the AI spatiotemporal graph neural network, and calculate the input update coefficients through the activation function. The input update coefficients reflect the degree of contribution of the current message input to the new message state.
[0061] The message input from the current time segment and the message state from the previous time segment are simultaneously input into the input gate module of the AI spatiotemporal graph neural network. The input gate module contains a fully connected layer, the weights of which are determined during pre-training. The concatenated message input and the message state from the previous time segment are then input into the fully connected layer. The output of the fully connected layer is then processed by an activation function (such as the sigmoid function) to obtain the input update coefficients. The values of the input update coefficients range from 0 to 1; the closer to 1, the greater the contribution of the current message input to the new message state; the closer to 0, the smaller the contribution.
[0062] Step S1374: Input the message input of the current time segment and the message state of the previous time segment into the forget gate module of the AI spatiotemporal graph neural network, and calculate the forgetting coefficient through the activation function. The forgetting coefficient reflects the degree to which the message state of the previous time segment retains the new message state.
[0063] Similar to the input gate module, the message input from the current time segment and the message state from the previous time segment are input into the forget gate module. The forget gate module also contains a fully connected layer with pre-trained weights to process the concatenated input, and then calculates the forgetting coefficient using an activation function (such as the sigmoid function). The forgetting coefficient ranges from 0 to 1; the closer it is to 1, the greater the degree to which the message state from the previous time segment is retained in the new message state; the closer it is to 0, the greater the degree to which the message state from the previous time segment is forgotten.
[0064] Step S1375: Input the message input of the current time segment into the candidate gate module of the AI spatiotemporal graph neural network, and generate candidate message states through the hyperbolic tangent activation function. The candidate message states contain the latent features of the current message input.
[0065] The message input for the current time segment is fed separately into the candidate gate module. The candidate gate module contains a fully connected layer whose weights are pre-trained. After processing the message input, it generates candidate message states using the hyperbolic tangent activation function (tanh function). The candidate message state takes values between -1 and 1, and it contains potential features from the current message input that may contribute to the new message state.
[0066] Step S1376: Through the state update module of the AI spatiotemporal graph neural network, the message state of the previous time segment is multiplied with the forgetting coefficient to obtain the decayed historical state, the candidate message state is multiplied with the input update coefficient to obtain the weighted candidate state, and the decayed historical state and the weighted candidate state are accumulated to generate the intermediate message state of the current time segment.
[0067] In the state update module, the message state of the previous time segment is first multiplied element-wise by the forgetting coefficient to obtain the decayed historical state, which represents the remaining part of the message state after forgetting. Then, the candidate message state is multiplied element-wise by the input update coefficient to obtain the weighted candidate state, which represents the portion of the current message input selected for updating the new message state. Finally, the decayed historical state and the weighted candidate state are added element-wise to obtain the intermediate message state of the current time segment.
[0068] Step S1377: Input the intermediate message state of the current time segment into the output gate module of the AI spatiotemporal graph neural network, and calculate the output coefficients through the activation function. The output coefficients reflect the proportion of features that need to be retained in the intermediate message state of the current time segment.
[0069] The intermediate message state of the current time segment is input into the output gate module. The output gate module also contains a fully connected layer with pre-trained weights. After processing the intermediate message state, the output coefficients are calculated using an activation function (such as the sigmoid function). The output coefficients take values between 0 and 1, and they determine which features in the intermediate message state need to be retained and used as the final message state output for the current time segment.
[0070] Step S1378: After processing the intermediate message state of the current time segment through the hyperbolic tangent activation function, multiply it with the output coefficient to generate the message state of the current time segment.
[0071] The intermediate message state of the current time segment is processed by the hyperbolic tangent activation function (tanh function) to obtain a state vector with a value range between -1 and 1. Then, the state vector is multiplied element by element with the output coefficients to obtain the message state of the current time segment. This message state integrates the historical information of the previous time segment and the new information of the current time segment.
[0072] Step S1379: Use the message state of the current time segment as the message state of the previous time segment for the next time segment, and repeat the above steps from extracting the message input of the current time segment to generating the message state of the current time segment until all time segments have been processed.
[0073] Save the message state generated in the current time segment as the message state of the previous time segment for the next time segment. Then, following the process from steps S1372 to S1378, process each subsequent time segment in turn until the message states of all time segments have been calculated.
[0074] Step S13710: Using the difference calculation module of the AI spatiotemporal graph neural network, calculate the Euclidean distance between the message state of each time segment and the message state of the previous time segment as the evolutionary difference value, integrate the evolutionary difference value into the message state of the corresponding time segment, and generate the temporal associated message vector sequence of each associated node.
[0075] In the difference calculation module, for each time segment (except the first time segment), the Euclidean distance between the message state of that time segment and the message state of the previous time segment is calculated. The Euclidean distance is calculated by first finding the difference between corresponding elements of the two message state vectors, then summing the squares of these differences, and finally taking the square root of the sum. The result is the evolutionary difference value, which reflects the degree of change in message states between adjacent time segments. This evolutionary difference value is incorporated as an additional feature into the message state of the corresponding time segment. For example, the evolutionary difference value can be concatenated with the message state vector to form a temporally associated message vector sequence for each associated node. This temporally associated message vector sequence not only contains the message state of each time segment but also includes evolutionary difference information between adjacent time segments.
[0076] Step S138: For each associated link, extract the temporal associated message vectors of the two associated nodes connected to it in different time segments, calculate the cosine similarity of the two temporal associated message vectors through the similarity calculation module of AI spatiotemporal graph neural network, and map the cosine similarity to the association strength value of the associated link within the time segment.
[0077] For each link in the spatiotemporal association chain, the link connects two associated nodes. The temporal association message vectors of these two nodes at different time segments are extracted. The two temporal association message vectors within the same time segment are then input into the similarity calculation module of the AI spatiotemporal graph neural network. In this module, the cosine similarity of the two vectors is calculated. The cosine similarity is calculated by first taking the dot product of the two vectors and then dividing by the product of their magnitudes. After obtaining the cosine similarity, it is converted into an association strength value for the link within that time segment using a mapping function. This mapping function can be linear or nonlinear, ensuring that the association strength value is within a reasonable range and reflects the closeness of the association between the two nodes within that time segment.
[0078] Step S139: Arrange the association strength values of each associated link in different time segments into a continuous trajectory according to the time segment order. Perform spatiotemporal consistency processing on the continuous trajectory through the trajectory smoothing module of the AI spatiotemporal graph neural network to generate the association strength evolution trajectory of each associated link in the passing spatiotemporal association chain.
[0079] The association strength values of each link at different time segments are arranged chronologically to form a continuous trajectory. Since the original association strength values may contain noise or fluctuations, the trajectory smoothing module of the AI spatiotemporal graph neural network processes this continuous trajectory. The trajectory smoothing module uses a sliding window approach to perform a weighted average of the association strength value of each time segment with its adjacent time segments. The weights are set according to the time distance; the closer the distance, the greater the weight, and the farther the distance, the smaller the weight. Through this spatiotemporal consistency processing, noise and abnormal fluctuations in the trajectory are removed, resulting in a smoothed association strength evolution trajectory that clearly reflects the changing trend of the association strength of the links over time.
[0080] Step S140: Based on the correlation strength evolution trajectory, anomaly correlation clusters among the passing subjects are mined. Spatiotemporal correlation clustering is performed using the trajectory features of the correlation strength evolution trajectory output by the AI spatiotemporal graph neural network. Correlation links that deviate from the normal evolution law are selected and grouped according to spatiotemporal correlation relationship to form anomaly correlation clusters.
[0081] Step S141: Collect the evolution trajectory of the association strength of all association links in the spatiotemporal association chain, extract the temporal dimension change slope and the feature vector corresponding to the spatial association of each association strength evolution trajectory, and form a trajectory feature set.
[0082] The evolution trajectory of association strength for all links in the spatiotemporal association chain is collected. For each association strength evolution trajectory, in the time dimension, the ratio of the change in association strength value between adjacent time segments to the time interval is calculated to obtain the time dimension change slope, which reflects the rate and trend of association strength change over time. In terms of spatial association, features reflecting spatial association characteristics are extracted based on the location information of the two associated nodes connected by the association link and the spatial distribution in historical travel records. These features are combined into a feature vector corresponding to the spatial association. The time dimension change slope and the feature vector corresponding to the spatial association are combined as the trajectory features of each association strength evolution trajectory. The trajectory features of all associated links constitute the trajectory feature set.
[0083] Step S142: Select trajectory features of the correlation strength evolution trajectory corresponding to the regular traffic scenario from the trajectory feature set, and generate a regular trajectory feature template through unsupervised learning.
[0084] Based on the routine passage rules and historical data in the context of intelligent access control for personnel security, trajectory features that conform to the evolution of association strength in a regular passage pattern are selected from the trajectory feature set. For example, during normal working hours on weekdays, the evolution of association strength between employees and colleagues in the office area usually exhibits certain regularities, and these trajectory features are selected. Then, unsupervised learning algorithms (such as K-means clustering) are used to perform cluster analysis on the selected trajectory features, grouping similar trajectory features into one class. The central feature vector of each class serves as a regular trajectory feature template. The regular trajectory feature template represents the typical characteristics of the association strength evolution trajectory of associated links under regular passage scenarios.
[0085] Step S143: Calculate the feature distance between the trajectory features of each correlation strength evolution trajectory in the trajectory feature set and the feature template of the conventional trajectory feature template as the deviation value.
[0086] Step S1431: Extract the conventional time change slope sequence and conventional spatial feature vector from the conventional trajectory feature template, and arrange them in the order of time segments to form a conventional feature sequence.
[0087] For each conventional trajectory feature template, a conventional time-varying slope sequence and a conventional spatial feature vector are extracted. The conventional time-varying slope sequence is formed by arranging the time-varying slopes of each time segment in the template in chronological order, while the conventional spatial feature vector is the spatial correlation feature vector in the template. The conventional time-varying slope sequence and the conventional spatial feature vector are combined in chronological order to form a conventional feature sequence.
[0088] Step S1432: Extract the time change slope sequence and spatial feature vector corresponding to the trajectory features of an evolution trajectory of correlation strength from the trajectory feature set, and arrange them in the order of time segments as the feature sequence to be analyzed.
[0089] The trajectory features of an evolutionary trajectory with correlation strength are selected from the trajectory feature set, and its temporal slope sequence and spatial feature vector are extracted. They are also arranged in the order of time segments to form the feature sequence to be analyzed.
[0090] Step S1433: Input the regular feature sequence and the feature sequence to be analyzed into the feature alignment module of the AI spatiotemporal graph neural network, align the regular feature sequence and the feature sequence to be analyzed in terms of time dimension, and adjust the number of time segments so that the number of time segments of the regular feature sequence and the feature sequence to be analyzed are consistent and the corresponding time intervals are matched.
[0091] The regular feature sequence and the feature sequence to be analyzed are input into the feature alignment module of the AI spatiotemporal graph neural network. Since different trajectory features may correspond to different time ranges or time segment divisions, the feature alignment module first standardizes the time segment division criteria, then adjusts the number of time segments in both the regular and feature sequences. For sequences with shorter time ranges, missing time segment features are supplemented through interpolation; for sequences with longer time ranges, the time interval corresponding to another sequence is retained through truncation. This ensures that after alignment, the number of time segments in the regular and feature sequences to be analyzed is the same, and the time intervals corresponding to each time segment match each other.
[0092] Step S1434: Standardize the time change slope sequence and spatial feature vector in the aligned regular feature sequence to obtain a standardized regular time sequence and a standardized regular spatial sequence. Standardize the time change slope sequence and spatial feature vector in the aligned feature sequence to be analyzed to obtain a standardized time sequence to be analyzed and a standardized spatial sequence to be analyzed.
[0093] After alignment, the time-varying slope sequences and spatial eigenvectors in the regular feature sequences and the feature sequences to be analyzed are standardized. The standardization process involves subtracting the mean of the feature sequence from each eigenvalue and then dividing by the standard deviation of the feature sequence, resulting in a mean of 0 and a standard deviation of 1 for the processed eigenvalues. After standardization, standardized regular time series, standardized regular spatial series, standardized time series to be analyzed, and standardized spatial series to be analyzed are obtained, eliminating the influence of dimensions between different features.
[0094] Step S1435: Concatenate the standardized regular time series and the standardized regular spatial series into a regular high-dimensional feature series, and concatenate the standardized time series to be analyzed and the standardized spatial series to be analyzed into a high-dimensional feature series to be analyzed.
[0095] The temporal slope of each time segment in the standardized conventional time series is concatenated with the spatial feature vector of the corresponding time segment in the standardized conventional spatial series to form a high-dimensional feature vector in the conventional high-dimensional feature sequence. This high-dimensional feature vector is then arranged in order of time segments to obtain the conventional high-dimensional feature sequence. Using the same method, the standardized time series and the standardized spatial series to be analyzed are concatenated to form the high-dimensional feature sequence to be analyzed.
[0096] Step S1436: Calculate the covariance matrix of the conventional high-dimensional feature sequence, and perform the inverse operation on the covariance matrix through the matrix processing module of the AI spatiotemporal graph neural network to obtain the inverse covariance matrix.
[0097] The covariance matrix of all high-dimensional feature vectors in a conventional high-dimensional feature sequence is calculated. The covariance matrix reflects the correlation between different feature dimensions. Then, the covariance matrix is input into the matrix processing module of the AI spatiotemporal graph neural network. In this module, the covariance matrix is inverted to obtain the inverse covariance matrix, which is used for subsequent calculation of feature distance.
[0098] Step S1437: For each time segment, calculate the difference vector between the regular high-dimensional feature vector and the high-dimensional feature vector to be analyzed.
[0099] For each time segment, the high-dimensional feature vector of that time segment in the conventional high-dimensional feature sequence is subtracted element-wise from the high-dimensional feature vector of the corresponding time segment in the high-dimensional feature sequence to be analyzed, to obtain the difference vector of that time segment. This difference vector reflects the difference between the feature sequence to be analyzed and the conventional feature sequence in that time segment.
[0100] Step S1438: Perform matrix multiplication on the difference vector and the inverse covariance matrix, and then perform matrix multiplication on the result and the transpose of the difference vector to obtain the distance component of the time segment.
[0101] The difference vector of each time segment is multiplied by the inverse covariance matrix to obtain an intermediate vector. Then, the intermediate vector is multiplied by the transpose of the difference vector to obtain a scalar value. This scalar value is the distance component of that time segment, which takes into account the influence of the correlation between different feature dimensions on the distance.
[0102] Step S1439: Perform a weighted summation of the distance components of all time segments. The weights are determined by the importance coefficient of each time segment in a normal traffic scenario, and the overall distance between the trajectory features of the correlation strength evolution trajectory and the normal trajectory feature template is obtained.
[0103] Based on the importance of each time segment in a typical traffic scenario, a weight is assigned to the distance component of each time segment. For example, time segments during working hours have a higher importance coefficient, while those during non-working hours have a lower importance coefficient. The distance component of each time segment is multiplied by its corresponding weight, and then all products are summed to obtain the overall distance between the feature sequence to be analyzed and the typical feature sequences.
[0104] Step S14310: Use the overall distance as the deviation value of the trajectory feature of the correlation strength evolution trajectory. Repeat the above steps from extracting the feature sequence to be analyzed to calculating the deviation value until the trajectory features of all correlation strength evolution trajectories in the trajectory feature set have been processed.
[0105] The calculated overall distance is used as the deviation value of the trajectory feature of the correlation strength evolution trajectory. The larger the deviation value, the greater the difference between the trajectory feature and the conventional trajectory feature template, and the more likely it is to be an anomalous trajectory. Following the above steps, the trajectory features of all correlation strength evolution trajectories in the trajectory feature set are processed sequentially, and the deviation value of each trajectory feature from the conventional trajectory feature template is calculated.
[0106] Step S144: Mark the correlation strength evolution trajectory corresponding to the trajectory feature of the correlation strength evolution trajectory whose deviation value exceeds the preset deviation threshold as an abnormal trajectory.
[0107] A preset deviation threshold is established, which is set based on historical data statistics under normal traffic scenarios and security management requirements. The deviation value of each correlation strength evolution trajectory is compared with the preset deviation threshold. If the deviation value exceeds the preset deviation threshold, the correlation strength evolution trajectory is marked as an abnormal trajectory, indicating that the correlation strength evolution of the corresponding correlation link does not conform to the normal pattern.
[0108] Step S145: Extract the associated links corresponding to all abnormal trajectories to form an abnormal link set, and extract the location features and time coordination features of the main body of passage for each abnormal link in the abnormal link set.
[0109] Collect all the association strength evolution trajectories marked as anomalous trajectories, extract the corresponding association links of these trajectories, and combine the above association links to form an anomalous link set. For each anomalous link in the anomalous link set, extract the location features (such as activity areas and frequently visited locations within the park) and temporal coordination features (such as the time intervals and time intervals of co-occurrence) of the two entities it connects.
[0110] Step S146: Perform density clustering on the location features and time coordination features of the main passage entities of the abnormal link. During the clustering process, dynamically adjust the clustering radius according to the spatial distance of the location features and the time interval of the time features.
[0111] Step S1461: Extract the set of location coordinates of each abnormal link's passing entities from the location features of the passing entities in the abnormal link, and calculate the geometric center of the set of location coordinates as the location center feature.
[0112] For each abnormal link in the abnormal link set, it involves two passing entities. The set of location coordinates within the park is extracted from the location features of each passing entity; these coordinates are based on the park's local coordinate system. The geometric center of each set of location coordinates, i.e., the arithmetic mean of all location coordinates, is calculated. This geometric center is used as the location center feature of that passing entity, reflecting the main activity center location of that entity.
[0113] Step S1462: Extract the time coordination interval corresponding to each abnormal link from the time coordination features of the abnormal links, and calculate the midpoint time of the time coordination interval as the time center feature.
[0114] Extract the corresponding time coordination interval from the time coordination characteristics of the abnormal link. The time coordination interval refers to the time period during which two traveling entities exhibit a time coordination relationship on the link. Calculate the midpoint of this time coordination interval and use it as the time center feature of the abnormal link, reflecting the central time point of the time coordination relationship of the abnormal link.
[0115] Step S1463: Standardize the location center features to obtain standardized location features, and standardize the time center features to obtain standardized time features.
[0116] The location center features of all abnormal links are standardized by converting the location center coordinates to a uniform numerical range. For example, this is done by subtracting the mean of all location center coordinates and dividing by the standard deviation to obtain standardized location features. Similarly, the time center features are standardized by converting the midpoint time into a standardized time value relative to a certain reference time to obtain standardized time features.
[0117] Step S1464: Concatenate the standardized location features and standardized time features into a spatiotemporal center feature vector, with each abnormal link corresponding to a spatiotemporal center feature vector.
[0118] The standardized location features and standardized time features of each abnormal link are combined and concatenated into a vector, namely the spatiotemporal center feature vector. This spatiotemporal center feature vector contains both the spatial and temporal center information of the abnormal link, and each abnormal link corresponds to one of the above vectors.
[0119] Step S1465: Calculate the mean spatial distance and mean time interval of all spatiotemporal center feature vectors. Use half of the mean spatial distance as the initial spatial clustering radius and half of the mean time interval as the initial temporal clustering radius.
[0120] Calculate the average spatial distance between all spatiotemporal center feature vectors to obtain the mean spatial distance; calculate the average time interval between all spatiotemporal center feature vectors to obtain the mean time interval. Set half of the mean spatial distance as the initial spatial cluster radius, and half of the mean time interval as the initial temporal cluster radius, as the initial parameters for density clustering.
[0121] Step S1466: Select an unlabeled spatiotemporal center feature vector as the initial core vector, and calculate the spatial distance and time interval between the initial core vector and all other spatiotemporal center feature vectors.
[0122] Randomly select an unlabeled vector from all spatiotemporal center feature vectors as the initial core vector. Then, calculate the spatial distance (based on standardized location features) and time interval (based on standardized time features) between this initial core vector and all other spatiotemporal center feature vectors.
[0123] Step S1467: Mark the spatiotemporal center feature vectors whose spatial distance is less than the initial spatial clustering radius and whose time interval is less than the initial temporal clustering radius as the neighbor vectors of the initial core vector, and count the number of neighbor vectors.
[0124] Feature vectors with spatial distances smaller than the initial spatial cluster radius and time intervals smaller than the initial temporal cluster radius are labeled as neighbor vectors of the initial core vector. The number of neighbor vectors is counted, reflecting the density around the initial core vector at the initial cluster radius.
[0125] Step S1468: If the number of neighbor vectors exceeds the preset core threshold, the initial core vector and the neighbor vectors are grouped into the same initial cluster, and the neighbor vectors are marked as core vectors.
[0126] A core threshold is preset, which is set based on the number and distribution of abnormal links. If the number of neighbor vectors exceeds the preset core threshold, the initial core vector is considered a core point, and the initial core vector and all its neighbor vectors are grouped into the same initial cluster. At the same time, the aforementioned neighbor vectors are also marked as core vectors for subsequent expansion of the cluster scope.
[0127] Step S1469: For each newly labeled core vector, repeat the above steps of calculating neighbor vectors and counting their numbers to expand the range of the initial cluster until no new neighbor vectors are added.
[0128] For each newly labeled core vector, its neighbor vectors are calculated and counted according to steps S1466 to S1468. If the number of neighbor vectors exceeds the core threshold, the aforementioned neighbor vectors are added to the current initial cluster and marked as core vectors. This process is repeated to continuously expand the range of the initial cluster until no new neighbor vectors can be added.
[0129] Step S14610: If the number of neighbor vectors does not reach the preset core threshold, the initial core vector is marked as a noise vector and is not included in any cluster for the time being.
[0130] If the number of neighbor vectors of the initial core vector does not reach the preset core threshold, the vector is considered a noise point, marked as a noise vector, and temporarily not included in any cluster.
[0131] Step S14611: During the expansion process, the spatial distance standard deviation and time interval standard deviation of all spatiotemporal center feature vectors in the current cluster are calculated in real time through the radius adjustment module of the AI spatiotemporal graph neural network. The spatial clustering radius is adjusted to the product of the initial spatial clustering radius and the spatial distance standard deviation, and the temporal clustering radius is adjusted to the product of the initial temporal clustering radius and the time interval standard deviation.
[0132] During cluster expansion, the radius adjustment module of the AI spatiotemporal graph neural network can calculate the spatial distance standard deviation and time interval standard deviation of all spatiotemporal center feature vectors within the current cluster in real time. The spatial distance standard deviation reflects the spatial dispersion of vectors within the cluster, while the time interval standard deviation reflects the temporal dispersion of vectors within the cluster. Multiplying the initial spatial cluster radius by the spatial distance standard deviation yields the adjusted spatial cluster radius; multiplying the initial temporal cluster radius by the time interval standard deviation yields the adjusted temporal cluster radius. By dynamically adjusting the cluster radius as described above, the clustering process can adapt to the distribution density of data within different clusters.
[0133] Step S14612: Repeat the above steps from selecting unlabeled spatiotemporal center feature vectors to adjusting the cluster radius until all spatiotemporal center feature vectors are labeled as core vectors or noise vectors.
[0134] Following the process of steps S1466 to S14611, unlabeled spatiotemporal center feature vectors are selected sequentially for processing until all spatiotemporal center feature vectors are labeled as core vectors (belonging to a certain cluster) or noise vectors.
[0135] Step S14613: Remove the abnormal links corresponding to the noise vectors, merge the remaining initial clusters, and perform the following operations: calculate the proportion of the spatial overlap range of the two initial clusters to the total spatial range of the two initial clusters, calculate the proportion of the time overlap interval of the two initial clusters to the total time range of the two initial clusters, and if the proportion of the spatial overlap range exceeds the preset overlap ratio and the proportion of the time overlap interval exceeds the preset overlap duration ratio, then merge the two initial clusters into a new cluster.
[0136] After labeling all spatiotemporal center feature vectors, outlier links corresponding to noise vectors are removed. Then, the remaining initial clusters are merged. For any two initial clusters, their spatial overlap range (the volume of the overlapping spatial regions of the two clusters) and their total spatial range (the volume after merging the spatial regions of the two clusters) are calculated. The ratio of the spatial overlap range to the total spatial range is the spatial overlap ratio. Simultaneously, the temporal overlap interval between the two initial clusters is calculated (the duration of the overlapping temporal ranges of the two clusters) and their total temporal range (the duration after merging the temporal ranges of the two clusters). The ratio of the temporal overlap interval to the total temporal range is the temporal overlap ratio. Preset thresholds for both the spatial overlap ratio and the temporal overlap duration are applied. If the spatial overlap ratio of two initial clusters exceeds the preset overlap ratio and the temporal overlap ratio exceeds the preset overlap duration ratio, the two initial clusters are merged into a new cluster to reduce the number of clusters and improve the accuracy of the clustering results.
[0137] Step S14614: Integrate all new clusters and unmerged initial clusters to form the final clustering result.
[0138] After merging, all newly generated clusters and the initial clusters that were not merged are combined to form the final density clustering result. This density clustering result divides the abnormal links in the abnormal link set into different clusters, and the abnormal links in each cluster have similar spatial location characteristics and temporal coordination characteristics.
[0139] Step S147: Verify the association of abnormal links within the same cluster in the clustering results by calculating the spatiotemporal association coefficient between each abnormal link in the cluster and other abnormal links. The spatiotemporal association coefficient is obtained by weighting the location association coefficient and the time association coefficient.
[0140] For each cluster in the density clustering results, association verification is performed on the anomalous links within the cluster. For each anomalous link within a cluster, its spatiotemporal association coefficient with every other anomalous link in the cluster is calculated. The spatiotemporal association coefficient is calculated as follows: first, the positional association coefficient between the two anomalous links is calculated, which can be determined by the similarity of their positional central features; then, the temporal association coefficient between the two anomalous links is calculated, which can be determined by the similarity of their temporal central features; finally, the positional association coefficient and the temporal association coefficient are multiplied by a weight and then summed to obtain the spatiotemporal association coefficient. The weights are set according to the importance of position and time factors in association verification.
[0141] Step S148: Filter out abnormal links whose spatiotemporal correlation coefficients exceed the preset correlation threshold to form a subset of valid links within the cluster.
[0142] A preset association threshold is established, which is set according to the requirements of abnormal link association verification. The spatiotemporal correlation coefficient of each abnormal link within the cluster with other abnormal links is compared with the preset association threshold. Abnormal links whose spatiotemporal correlation coefficient exceeds the preset association threshold are selected, indicating a strong correlation between them. The selected abnormal links are then combined to form a subset of valid links within the cluster.
[0143] Step S149: Perform an integrity check on the subset of valid links within the cluster and perform the following operations: check whether there is at least one common associated node among the passing subjects involved in all abnormal links within the subset of valid links within the cluster, check whether there is any overlap in the time range of all abnormal links within the subset of valid links within the cluster, and retain only the subset of valid links within the cluster that satisfies both checks.
[0144] An integrity check is performed on a subset of valid links within a cluster to ensure that the abnormal links within the subset can form a meaningful associated cluster. The first check examines whether there is at least one common associated node among the travel subjects involved in all abnormal links within the subset; that is, whether there is a travel subject with abnormal links in multiple other travel subjects. The second check examines whether the time ranges of all abnormal links within the subset overlap; that is, whether there are common time intervals. Only subsets of valid links within a cluster that simultaneously meet both checks are retained, ensuring that the abnormal links within this subset have a certain degree of correlation and integrity in terms of travel subjects and time.
[0145] Step S1410: Select the subset of valid links within a cluster that meets the integrity requirements as an abnormal association cluster, and generate an abnormal association cluster between the passing entities.
[0146] After integrity checks, the subset of valid links within a cluster that meets the requirements is identified as anomaly association clusters. Each anomaly association cluster consists of a group of interconnected anomaly links. The entities involved in these links have strong spatiotemporal relationships, and the evolution trajectory of their association strength deviates from the normal pattern, which may pose security risks or abnormal passage behaviors.
[0147] Step S150: Generate a traffic anomaly prediction result containing the time range of anomaly occurrence and the subjects involved in the traffic based on the anomaly association cluster. Extract the time range corresponding to all associated links in the anomaly association cluster and integrate them into the time range of anomaly occurrence. Extract the subjects corresponding to the associated nodes involved in all associated links in the anomaly association cluster as the subjects involved in the traffic. Associate the time range of anomaly occurrence with the subjects involved in the traffic to form a traffic anomaly prediction result.
[0148] Step S151: For an abnormal association cluster, extract the time coordination intervals corresponding to all association links within the abnormal association cluster to form a time interval set.
[0149] For each anomalous association cluster, extract the time coordination intervals corresponding to all anomalous links within the cluster. These time coordination intervals are the time periods during which the two traveling entities in each anomalous link exhibit a time coordination relationship. Combine these time coordination intervals to form a set of time intervals.
[0150] Step S152: Merge overlapping or adjacent time intervals in the time interval set to generate a preliminary merged time interval.
[0151] Step S1521: Sort all time intervals in the time interval set according to their starting time to obtain an ordered time interval sequence.
[0152] Sort all time intervals in the time interval set according to their starting time to obtain an ordered time interval sequence, which facilitates subsequent interval merging operations.
[0153] Step S1522: Select the first time interval in the ordered time interval sequence as the initial interval of the current merge interval.
[0154] Select the first time interval from the ordered time interval sequence and use it as the initial interval for the current merge interval.
[0155] Step S1523: Extract the next time interval from the ordered time interval sequence as the interval to be merged.
[0156] Extract the next time interval immediately following the initial interval from the ordered time interval sequence, and use it as the interval to be merged.
[0157] Step S1524: Calculate the time difference between the end time of the current merge interval and the start time of the interval to be merged.
[0158] Calculate the time difference between the end time of the current merge interval and the start time of the interval to be merged. This time difference reflects the degree of interval between the two intervals.
[0159] Step S1525: If the time difference is less than the preset adjacent threshold, the end time of the current merge interval is updated to the time with the larger value between the end time of the current merge interval and the end time of the interval to be merged, thus forming a new current merge interval.
[0160] A preset adjacency threshold is established, which is set according to the accuracy requirements of time interval merging. If the calculated time difference is less than the preset adjacency threshold, the current merging interval and the interval to be merged are considered to be adjacent or overlapping. The end time of the current merging interval is then updated to the larger of the end time of the current merging interval and the end time of the interval to be merged, forming a new current merging interval, thus merging the two intervals.
[0161] Step S1526: If the time difference is not less than the preset adjacent threshold, the current merge interval is stored in the result set as a preliminary merge time interval, and the interval to be merged is used as the initial interval of the new current merge interval.
[0162] If the time difference is not less than the preset adjacent threshold, the current merge interval and the interval to be merged are considered not adjacent. The current merge interval is stored in the result set, and then the interval to be merged is used as the initial interval of the new current merge interval to continue the subsequent merge operation.
[0163] Step S1527: Repeat the above steps from extracting the interval to be merged to updating the current merge interval until all time intervals in the ordered time interval sequence have been processed.
[0164] Following the process of steps S1523 to S1526, all time intervals in the ordered time interval sequence are processed sequentially until all intervals have been processed.
[0165] Step S1528: Store the last current merge interval into the result set. If there are multiple preliminary merge time intervals in the result set, calculate the time length of each preliminary merge time interval.
[0166] After processing all time intervals, the last currently merged interval is stored in the result set. If the result set contains multiple preliminary merged time intervals, the time length of each preliminary merged time interval is calculated, which is the difference between the end time and the start time.
[0167] Step S1529: If there is a preliminary merging time interval with a time length less than the preset minimum time length, then find the preliminary merging time intervals adjacent to the preliminary merging time interval with a time length less than the preset minimum time length, and calculate the time difference between the preliminary merging time interval with a time length less than the preset minimum time length and the adjacent preliminary merging time intervals.
[0168] A minimum time length is preset, which is set according to the minimum granularity requirement of the time range of the anomaly occurrence. The preliminary merged time intervals in the inspection result set are checked. If there is an interval with a time length shorter than the preset minimum time length, the adjacent preliminary merged time intervals before and after that interval are found, and the time difference between that interval and the preceding adjacent interval and the following adjacent interval are calculated.
[0169] Step S15210: If the time difference between the initial merged time interval with a time length less than the preset minimum time length and the previous adjacent initial merged time interval is less than the preset merge threshold, then the initial merged time interval with a time length less than the preset minimum time length and the previous adjacent initial merged time interval are merged into a new initial merged time interval.
[0170] A preset merging threshold is used to determine whether a short time interval needs to be merged with its adjacent interval. If the time difference between the short time interval and the previous adjacent interval is less than the preset merging threshold, the two intervals are merged into a new preliminary merged time interval. The start time of the new interval is the start time of the previous adjacent interval, and the end time is the end time of the short time interval.
[0171] Step S15211: If the time difference between the initial merged time interval with a time length less than the preset minimum time length and the next adjacent initial merged time interval is less than the preset merge threshold, then the initial merged time interval with a time length less than the preset minimum time length and the next adjacent initial merged time interval are merged into a new initial merged time interval.
[0172] If the time difference between the short time interval and the next adjacent interval is less than the preset merging threshold, the two intervals will be merged into a new preliminary merged time interval. The start time of the new interval is the start time of the short time interval, and the end time is the end time of the next adjacent interval.
[0173] Step S15212: Integrate all eligible preliminary merge time intervals to generate the final set of preliminary merge time intervals.
[0174] After the above merging process, all the preliminary merged time intervals that meet the requirements are integrated to form the final set of preliminary merged time intervals. The time intervals in this set of preliminary merged time intervals no longer contain excessively short time intervals, and the intervals do not overlap or are adjacent to each other.
[0175] Step S153: Calculate the start and end times of the initial merging time interval, and extract the earliest start time in the time interval set that is earlier than the start time of the initial merging time interval as the correction start time.
[0176] For each preliminary merge time interval in the initial merge time interval set, determine its start and end times. Then, review the original time interval set and find the start times of all time intervals earlier than the start time of the initial merge time interval. Select the earliest start time from these and use it as the corrected start time of the initial merge time interval to expand the time range and avoid missing possible abnormal time points.
[0177] Step S154: Extract the latest end time from the time interval set that is later than the end time of the initial merged time interval, and use it as the corrected end time.
[0178] Similarly, find the end times of all time intervals later than the end time of the initial merged time interval from the original set of time intervals, and select the latest end time from them as the corrected end time of the initial merged time interval.
[0179] Step S155: The interval formed by the correction start time and the correction end time is taken as the anomaly occurrence time range of the anomaly association cluster.
[0180] The correction start time and correction end time are combined to form a new time interval, which is the time range of anomaly occurrence for this anomaly association cluster. This time range of anomaly occurrence can more comprehensively cover the time coordination interval of all anomaly links in the anomaly association cluster.
[0181] Step S156: Extract all associated nodes connected by associated links within the abnormal association cluster, determine the access subject corresponding to each associated node, and form a access subject list.
[0182] For example, step S1561: Initialize an empty list as the pass list.
[0183] Create an empty list to store the pass subjects involved within the abnormal association cluster.
[0184] Step S1562: For a single association link within the abnormal association cluster, determine the two association nodes connected by that association link.
[0185] For each association link within an abnormal association cluster, determine the two association nodes connected by the link, with each association node corresponding to a passage subject.
[0186] Step S1563: Find the access subject identifier corresponding to each associated node from the historical access record sequence, verify the uniqueness of the access subject identifier through the subject matching module of the AI spatiotemporal graph neural network, and retain only the unique access subject identifier corresponding to each associated node.
[0187] Based on the information of the associated nodes, the system retrieves the corresponding access entity identifier for each associated node from the historical access record sequence, such as employee ID or visitor ID. The retrieved access entity identifier is then input into the entity matching module of the AI spatiotemporal graph neural network. This module verifies the access entity identifier to ensure that each associated node corresponds to a unique access entity identifier, avoiding duplicate or incorrect identifiers.
[0188] Step S1564: Add the access subject identifier corresponding to the first associated node to the access subject list.
[0189] Add the access subject identifier corresponding to the first verified associated node to the access subject list.
[0190] Step S1565: Add the access subject identifier corresponding to the second associated node to the access subject list.
[0191] Similarly, add the access entity identifier corresponding to the second associated node to the access entity list.
[0192] Step S1566: Repeat the above steps from determining the two associated nodes connected by the associated link to adding them to the list of passing subjects, until all associated links within the abnormal associated cluster have been processed.
[0193] Following the process of steps S1562 to S1565, all associated links within the abnormal association cluster are processed sequentially, and the access subject identifiers involved in each link are added to the access subject list.
[0194] Step S1567: Input the list of access subjects into the list processing module of the AI spatiotemporal graph neural network, and sort the access subject identifiers in the list of access subjects using the bubble sort algorithm so that the access subject identifiers in the list of access subjects are arranged in alphabetical or numerical order.
[0195] The list of accessible entities is input into the list processing module of the AI spatiotemporal graph neural network. In this module, the bubble sort algorithm is used to sort the accessible entity identifiers in the list. Sorting can be done alphabetically (for alphabetical identifiers) or numerically (for numeric identifiers), ensuring the accessible entity identifiers are neatly arranged for easier subsequent processing.
[0196] Step S1568: Check the sorted list of access entities. If there are consecutive duplicate access entity identifiers, delete the duplicate access entity identifiers and keep the first one that appears.
[0197] The sorted list of access entities is checked. Since multiple related links may involve the same access entity, there may be duplicate access entity identifiers in the list. For consecutive duplicate identifiers, subsequent duplicate identifiers are deleted, and only the first one is retained to ensure that each access entity identifier in the list is unique.
[0198] Step S1569: For each access entity identifier in the processed access entity list, extract the access entity name and access mode type corresponding to the access entity identifier from the historical access record sequence, and add them to the access entity list to form an access entity list containing complete information.
[0199] For each access entity identifier in the processed access entity list, the access entity name (such as employee name, visitor name, etc.) and access method type (such as facial recognition, IC card swiping, etc.) corresponding to the identifier are queried from the historical access record sequence. The above information is then added to the access entity list to make the list contain complete information about the access entity, thus forming the final access entity list.
[0200] Step S157: Remove duplicate access entities from the access entity list using a hash mapping algorithm, retain the unique identifier information of each access entity, and form a set of access entities involved.
[0201] The list of access subjects is processed using a hash mapping algorithm. Each access subject in the list is stored as a key in the hash mapping. Since the keys in the hash mapping are unique, duplicate access subjects are automatically filtered out. After processing, all keys are extracted from the hash mapping to obtain the set of access subjects involved. This set of access subjects involved contains the unique identifiers of all non-duplicate access subjects within the abnormal association cluster.
[0202] Step S158: Match the passage mode information of each passage subject in the set of passage subjects with the passage mode information in the historical passage record sequence, and generate a detailed information list of passage subjects.
[0203] For each access entity in the access entity set, its access method information, such as commonly used verification methods and recently used access methods, is extracted from the historical access record sequence. The access entity's unique identifier, name, and access method information are combined to generate a detailed access entity list.
[0204] Step S159: Associate and bind the time range of the anomaly occurrence of the anomaly association cluster with the list of detailed information of the passing subject to generate the anomaly prediction sub-result of the anomaly association cluster.
[0205] The anomaly occurrence time range of the anomaly association cluster is associated with the list of detailed information of the passing subjects, so that the detailed information of each passing subject corresponds to the anomaly occurrence time range. This generates an anomaly prediction sub-result for the anomaly association cluster, which includes the time range of anomaly occurrence within the cluster and the detailed information of the passing subjects involved.
[0206] Step S1510: Repeat the above steps from extracting the time coordination intervals corresponding to all associated links within the abnormal association cluster to generating the abnormal prediction sub-results of the abnormal association cluster, and process all abnormal association clusters.
[0207] Following the process of steps S151 to S159, all abnormal association clusters are processed sequentially, and a corresponding abnormal prediction sub-result is generated for each abnormal association cluster.
[0208] Step S1511: Sort the anomaly prediction sub-results of all anomaly association clusters according to the starting time of the anomaly occurrence time range of the anomaly association clusters, and generate the passage anomaly prediction results that include the anomaly occurrence time range of all anomaly association clusters and the passage subjects involved.
[0209] The anomaly prediction sub-results of all anomaly-related clusters are sorted chronologically according to the start time of the anomaly occurrence time range to form a complete access anomaly prediction result. This access anomaly prediction result can clearly show the anomaly occurrence time and the involved access entities of different anomaly-related clusters within the park, so that management personnel can take appropriate security measures in a timely manner.
[0210] Based on the same inventive concept, please refer to Figure 2 This diagram illustrates a schematic block diagram of a traffic anomaly prediction system 100 based on an AI spatiotemporal graph neural network, provided in an embodiment of this application, for executing the aforementioned traffic anomaly prediction method based on an AI spatiotemporal graph neural network. The traffic anomaly prediction system 100 may include a communication unit 110, a machine-readable storage medium 120, and a processor 130. Alternatively, the machine-readable storage medium 120 may be integrated into the processor 130 and can communicate and interact with external systems through the communication unit 110. The machine-readable storage medium 120 stores machine-executable instructions for executing the scheme of this application, and the processor 130 executes the machine-executable instructions stored in the machine-readable storage medium 120 to implement the traffic anomaly prediction method based on an AI spatiotemporal graph neural network provided in the aforementioned method embodiment.
[0211] It should be noted that, in order to simplify the description of the present invention and thus help to understand one or more embodiments of the invention, multiple features may sometimes be grouped into one embodiment, drawing or description thereof in the foregoing description of the embodiments of the present invention.
Claims
1. A method for predicting traffic anomalies based on AI spatiotemporal graph neural networks, characterized in that, The method includes: Obtain a historical passage record sequence within a preset area. The historical passage record sequence contains the passage location information and passage mode information of multiple passage subjects at different times. Based on the historical passage record sequence, a passage spatiotemporal association chain is constructed. The passage spatiotemporal association chain takes the passage subject as the association node and the position association relationship and time coordination relationship of different passage subjects within a continuous time range as the association link. The association link carries the position association degree and time coordination degree. The pre-trained AI spatiotemporal graph neural network is invoked to perform dynamic association modeling on the travel spatiotemporal association chain, thereby obtaining the association strength evolution trajectory of each association link in the travel spatiotemporal association chain; Based on the correlation strength evolution trajectory, abnormal correlation clusters among the passing subjects are mined. Spatiotemporal correlation clustering is performed by using the trajectory features of the correlation strength evolution trajectory output by the AI spatiotemporal graph neural network. Correlation links that deviate from the normal evolution law are screened out and grouped according to spatiotemporal correlation relationship to form abnormal correlation clusters. Based on the abnormal association cluster, a traffic anomaly prediction result is generated that includes the time range of anomaly occurrence and the subjects involved in the passage. The time range corresponding to all associated links in the abnormal association cluster is extracted and integrated into the time range of anomaly occurrence. The subjects corresponding to the associated nodes involved in all associated links in the abnormal association cluster are extracted as the subjects involved in the passage. The time range of anomaly occurrence and the subjects involved in the passage are associated to form the traffic anomaly prediction result. The process of calling a pre-trained AI spatiotemporal graph neural network to perform dynamic association modeling on the travel spatiotemporal association chain yields the evolution trajectory of the association strength of each association link in the travel spatiotemporal association chain, including: Extract the historical passage frequency information of the passage subject corresponding to each associated node and the location correlation and time coordination degree of each associated link from the passage spatiotemporal association chain; The historical passage frequency information of associated nodes is encoded as the basic features of nodes, and the location correlation and time coordination of associated links are encoded as the basic features of links. For each associated node, the basic node features of its adjacent associated nodes and the basic link features of the associated links connecting the two are collected. The basic node features and corresponding link features of the adjacent associated nodes are dynamically fused through the spatiotemporal coupling module of the AI spatiotemporal graph neural network. During the fusion process, the spatial dimension fusion weight is adjusted according to the positional correlation and the temporal dimension fusion weight is adjusted according to the temporal coordination to generate the associated message of the adjacent node. Dynamic weight allocation is performed on all adjacent node related messages. During the weight allocation process, the attention mechanism module of the AI spatiotemporal graph neural network is used to adjust the weights by combining the trend of the association strength between adjacent nodes and the current associated node in the historical time segment, so as to obtain the weighted adjacent node related messages. The weighted neighboring node association messages are accumulated and then concatenated with the node basic features of the current associated node. The concatenation result is then subjected to nonlinear transformation by the feature enhancement module of the AI spatiotemporal graph neural network to enhance the spatiotemporal association information and generate the spatiotemporal association message vector of the current associated node. Arrange the spatiotemporal association message vectors of each associated node in different time segments into a node time sequence message sequence according to the time segment order; The node time-series message sequence is input into the time recursion module of the AI spatiotemporal graph neural network. The dependency relationship between the node time-series message sequences of adjacent time segments is captured through the gating mechanism. The evolution difference between the message state of the current time segment and the message state of the previous time segment is calculated to generate a time-series associated message vector. For each associated link, the temporal associated message vectors of the two associated nodes connected to it in different time segments are extracted. The cosine similarity of the two temporal associated message vectors is calculated by the similarity calculation module of the AI spatiotemporal graph neural network. The cosine similarity is then mapped to the association strength value of the associated link within that time segment. The association strength values of each associated link in different time segments are arranged into a continuous trajectory according to the time segment order. The trajectory smoothing module of the AI spatiotemporal graph neural network is used to perform spatiotemporal consistency processing on the continuous trajectory to generate the association strength evolution trajectory of each associated link in the passing spatiotemporal association chain.
2. The method for predicting traffic anomalies based on AI spatiotemporal graph neural networks according to claim 1, characterized in that, The step of inputting the node time-series message sequence into the time recursive module of the AI spatiotemporal graph neural network, capturing the dependency relationship of node time-series message sequences in adjacent time segments through a gating mechanism, calculating the evolutionary difference between the message state of the current time segment and the message state of the previous time segment, and generating a time-series associated message vector includes: The message state of the first time segment is initialized as the initial message state of the previous time segment. The initial message state is generated by fusing the node time sequence message vector of the first time segment with the initial weights pre-stored in the AI spatiotemporal graph neural network. Entering the second time segment, extract the node time sequence message vector of this time segment as the message input of the current time segment; The message input of the current time segment and the message state of the previous time segment are input into the input gate module of the AI spatiotemporal graph neural network. The input update coefficient is calculated through the activation function. The input update coefficient reflects the degree of contribution of the current message input to the new message state. The message input of the current time segment and the message state of the previous time segment are input into the forget gate module of the AI spatiotemporal graph neural network. The forgetting coefficient is calculated through the activation function. The forgetting coefficient reflects the degree to which the message state of the previous time segment retains the new message state. The message input of the current time segment is fed into the candidate gate module of the AI spatiotemporal graph neural network, and the candidate message state is generated by the hyperbolic tangent activation function. The candidate message state contains the latent features of the current message input. The state update module of the AI spatiotemporal graph neural network multiplies the message state of the previous time segment with the forgetting coefficient to obtain the decayed historical state, multiplies the candidate message state with the input update coefficient to obtain the weighted candidate state, and accumulates the decayed historical state and the weighted candidate state to generate the intermediate message state of the current time segment. The intermediate message state of the current time segment is input into the output gate module of the AI spatiotemporal graph neural network, and the output coefficients are calculated through the activation function. The output coefficients reflect the proportion of features that need to be retained in the intermediate message state of the current time segment. The intermediate message state of the current time segment is processed by the hyperbolic tangent activation function and then multiplied with the output coefficients to generate the message state of the current time segment. Use the message state of the current time segment as the message state of the previous time segment for the next time segment, and repeat the above steps from extracting the message input of the current time segment to generating the message state of the current time segment until all time segments have been processed. The difference calculation module of the AI spatiotemporal graph neural network calculates the Euclidean distance between the message state of each time segment and the message state of the previous time segment as the evolutionary difference value. The evolutionary difference value is then integrated into the message state of the corresponding time segment to generate a temporal associated message vector sequence for each associated node.
3. The method for predicting traffic anomalies based on AI spatiotemporal graph neural networks according to claim 1, characterized in that, The method of mining abnormal association clusters among passing subjects based on the association strength evolution trajectory involves performing spatiotemporal association clustering using the trajectory features of the association strength evolution trajectory output by the AI spatiotemporal graph neural network. This process filters out association links that deviate from the normal evolutionary pattern and groups them according to spatiotemporal association relationships to form abnormal association clusters, including: Collect the evolution trajectory of the association strength of all association links in the spatiotemporal association chain, extract the temporal dimension change slope and the feature vector corresponding to the spatial association of each association strength evolution trajectory, and form a trajectory feature set; Trajectory features of the correlation strength evolution trajectory corresponding to the regular traffic scenario are selected from the trajectory feature set, and regular trajectory feature templates are generated through unsupervised learning; The deviation value is calculated as the feature distance between the trajectory features of each correlation strength evolution trajectory in the trajectory feature set and the feature distance between the trajectory features and the conventional trajectory feature template. The correlation strength evolution trajectory corresponding to the trajectory features of the correlation strength evolution trajectory whose deviation value exceeds the preset deviation threshold is marked as an abnormal trajectory; Extract the associated links corresponding to all abnormal trajectories to form an abnormal link set, and extract the location features and time coordination features of the main body of passage in each abnormal link in the abnormal link set; Density clustering is performed on the location and temporal coordination features of the main traffic entities in the abnormal links. During the clustering process, the clustering radius is dynamically adjusted based on the spatial distance of the location features and the time interval of the temporal features. The abnormal links within the same cluster in the clustering results are correlated and verified by calculating the spatiotemporal correlation coefficient between each abnormal link in the cluster and other abnormal links. The spatiotemporal correlation coefficient is obtained by weighting the location correlation coefficient and the time correlation coefficient. Abnormal links with spatiotemporal correlation coefficients exceeding a preset correlation threshold are filtered out to form a subset of valid links within the cluster; Perform an integrity check on the subset of valid links within the cluster, and perform the following operations: check whether there is at least one common associated node among the passing subjects involved in all abnormal links within the subset of valid links within the cluster, and check whether there is any overlap in the time range of all abnormal links within the subset of valid links within the cluster. Only retain the subset of valid links within the cluster that satisfies both of the above checks. The subset of valid links within a cluster that meets the integrity requirements is used as an abnormal association cluster to generate abnormal association clusters between passing entities.
4. The method for predicting traffic anomalies based on AI spatiotemporal graph neural networks according to claim 3, characterized in that, The calculation of the deviation value, which is the feature distance between the trajectory features of each correlation strength evolution trajectory in the trajectory feature set and the regular trajectory feature template, includes: Extract the conventional temporal slope sequence and conventional spatial feature vector from the conventional trajectory feature template, and arrange them in the order of time segments to form a conventional feature sequence; Extract the temporal change slope sequence and spatial feature vector corresponding to the trajectory features of an evolution trajectory of correlation strength from the trajectory feature set, and arrange them in the order of time segments as the feature sequence to be analyzed; The regular feature sequence and the feature sequence to be analyzed are input into the feature alignment module of the AI spatiotemporal graph neural network. The time dimension of the regular feature sequence and the feature sequence to be analyzed is aligned, and the number of time segments is adjusted to make the number of time segments of the regular feature sequence and the feature sequence to be analyzed consistent and the corresponding time intervals match. The time change slope sequence and spatial feature vector in the aligned regular feature sequence are standardized to obtain the standardized regular time sequence and the standardized regular spatial sequence. The time change slope sequence and spatial feature vector in the aligned feature sequence to be analyzed are standardized to obtain the standardized time sequence to be analyzed and the standardized spatial sequence to be analyzed. Standardized regular time series and standardized regular spatial series are concatenated into a regular high-dimensional feature series, and standardized time series to be analyzed and standardized spatial series to be analyzed are concatenated into a high-dimensional feature series to be analyzed; The covariance matrix of a conventional high-dimensional feature sequence is calculated, and the inverse covariance matrix is obtained by performing an inversion operation on the covariance matrix through the matrix processing module of the AI spatiotemporal graph neural network. For each time segment, calculate the difference vector between the regular high-dimensional feature vector and the high-dimensional feature vector to be analyzed. Perform matrix multiplication on the difference vector and the inverse covariance matrix, and then perform matrix multiplication on the result and the transpose of the difference vector to obtain the distance component of the time segment. The distance components of all time segments are weighted and summed, with the weights determined by the importance coefficient of each time segment in a normal traffic scenario, to obtain the overall distance between the trajectory features of the correlation strength evolution trajectory and the normal trajectory feature template. The overall distance is used as the deviation value of the trajectory feature of the correlation strength evolution trajectory. The above steps from extracting the feature sequence to be analyzed to calculating the deviation value are repeated until the trajectory features of all correlation strength evolution trajectories in the trajectory feature set have been processed.
5. The method for predicting traffic anomalies based on AI spatiotemporal graph neural networks according to claim 3, characterized in that, The method of density clustering based on the location and temporal coordination characteristics of the main traffic entities in the abnormal links, and dynamically adjusting the clustering radius according to the spatial distance of the location characteristics and the time interval of the temporal characteristics during the clustering process, includes: Extract the set of location coordinates of each abnormal link from the location features of the passing entities involved in the abnormal link, and calculate the geometric center of the set of location coordinates as the location center feature; Extract the time coordination interval corresponding to each abnormal link from the time coordination features of the abnormal links, and calculate the midpoint time of the time coordination interval as the time center feature. The location center features are standardized to obtain standardized location features, and the time center features are standardized to obtain standardized time features. Standardized location features and standardized time features are concatenated into a spatiotemporal center feature vector, with each abnormal link corresponding to a spatiotemporal center feature vector; Calculate the mean spatial distance and mean time interval of all spatiotemporal center feature vectors, and use half of the mean spatial distance as the initial spatial cluster radius, and half of the mean time interval as the initial temporal cluster radius; Select an unlabeled spatiotemporal center feature vector as the initial core vector, and calculate the spatial distance and time interval between the initial core vector and all other spatiotemporal center feature vectors; The spatiotemporal center feature vectors whose spatial distance is less than the initial spatial clustering radius and whose time interval is less than the initial temporal clustering radius are marked as the neighbor vectors of the initial core vector, and the number of neighbor vectors is counted. If the number of neighbor vectors exceeds the preset core threshold, the initial core vector and neighbor vectors are grouped into the same initial cluster, and the neighbor vectors are marked as core vectors. For each newly labeled core vector, repeat the steps above to calculate the neighbor vectors and count their numbers, expanding the range of the initial cluster until no new neighbor vectors are added; If the number of neighbor vectors does not reach the preset core threshold, the initial core vector is marked as a noise vector and will not be included in any cluster for the time being. During the expansion process, the radius adjustment module of the AI spatiotemporal graph neural network calculates in real time the spatial distance standard deviation and time interval standard deviation of all spatiotemporal center feature vectors in the current cluster, adjusts the spatial clustering radius to the product of the initial spatial clustering radius and the spatial distance standard deviation, and adjusts the temporal clustering radius to the product of the initial temporal clustering radius and the time interval standard deviation. Repeat the above steps from selecting unlabeled spatiotemporal center feature vectors to adjusting the cluster radius until all spatiotemporal center feature vectors are labeled as core vectors or noise vectors; Remove the abnormal links corresponding to the noise vectors, merge the remaining initial clusters, and perform the following operations: calculate the proportion of the spatial overlap range of the two initial clusters to the total spatial range of the two initial clusters, calculate the proportion of the time overlap interval of the two initial clusters to the total time range of the two initial clusters, and if the proportion of the spatial overlap range exceeds the preset overlap ratio and the proportion of the time overlap interval exceeds the preset overlap duration ratio, then merge the two initial clusters into a new cluster. All new clusters and unmerged initial clusters are integrated to form the final clustering result.
6. The method for predicting traffic anomalies based on AI spatiotemporal graph neural networks according to claim 1, characterized in that, The step of generating a traffic anomaly prediction result based on the anomaly association cluster, which includes the time range of anomaly occurrence and the involved traffic entities, involves extracting the time ranges corresponding to all associated links in the anomaly association cluster and integrating them into the anomaly occurrence time range, extracting the traffic entities corresponding to the associated nodes involved in all associated links in the anomaly association cluster as the involved traffic entities, and associating the anomaly occurrence time range with the involved traffic entities to form the traffic anomaly prediction result, including: For an abnormal association cluster, extract the time coordination intervals corresponding to all association links within the abnormal association cluster to form a time interval set; The overlapping or adjacent time intervals in the set of time intervals are merged to generate a preliminary merged time interval; Calculate the start and end times of the initial merging time interval, and extract the earliest start time in the time interval set that is earlier than the start time of the initial merging time interval as the correction start time; Extract the latest end time from the time interval set that is later than the end time of the initial merged time interval, and use it as the corrected end time; The interval between the start time and the end time of the correction is taken as the time range of the anomaly occurrence of this anomaly association cluster; Extract all associated nodes connected by all associated links within the abnormal association cluster, determine the access subject corresponding to each associated node, and form a list of access subjects. Duplicate access entities in the access entity list are removed by a hash mapping algorithm, while retaining the unique identifier information of each access entity, thus forming a set of access entities involved. For each passage subject in the set of passage subjects, match the passage method information of that passage subject in the historical passage record sequence, and generate a detailed list of passage subject information; The anomaly occurrence time range of the anomaly association cluster is associated and bound with the detailed information list of the passage subject to generate an anomaly prediction sub-result for the anomaly association cluster; Repeat the above steps from extracting the time coordination intervals corresponding to all associated links within the abnormal association cluster to generating the abnormal prediction sub-results for the abnormal association cluster, until all abnormal association clusters are processed; The anomaly prediction sub-results of all anomaly association clusters are sorted according to the starting time of the anomaly occurrence time range of all anomaly association clusters, generating a passage anomaly prediction result that includes the anomaly occurrence time range of all anomaly association clusters and the passage subjects involved.
7. The method for predicting traffic anomalies based on AI spatiotemporal graph neural networks according to claim 6, characterized in that, The step of merging overlapping or adjacent time intervals in the set of time intervals to generate preliminary merged time intervals includes: Sort all time intervals in the time interval set according to their starting time to obtain an ordered time interval sequence; Select the first time interval in the ordered time interval sequence as the initial interval for the current merge interval; Extract the next time interval from the ordered time interval sequence as the interval to be merged; Calculate the time difference between the end time of the current merge interval and the start time of the interval to be merged; If the time difference is less than the preset adjacent threshold, the end time of the current merge interval will be updated to the time with the larger value between the end time of the current merge interval and the end time of the interval to be merged, thus forming a new current merge interval. If the time difference is not less than the preset adjacent threshold, the current merge interval is stored in the result set as a preliminary merge time interval, and the interval to be merged is used as the initial interval of the new current merge interval. Repeat the above steps from extracting the interval to be merged to updating the current merge interval until all time intervals in the ordered time interval sequence have been processed. Store the last current merge interval into the result set. If there are multiple preliminary merge time intervals in the result set, calculate the time length of each preliminary merge time interval. If there is a preliminary merging time interval with a time length less than the preset minimum time length, then find the preliminary merging time intervals that are adjacent to the preliminary merging time interval with a time length less than the preset minimum time length, and calculate the time difference between the preliminary merging time interval with a time length less than the preset minimum time length and the adjacent preliminary merging time intervals. If the time difference between the initial merge time interval with a time length less than the preset minimum time length and the previous adjacent initial merge time interval is less than the preset merge threshold, then the initial merge time interval with a time length less than the preset minimum time length and the previous adjacent initial merge time interval will be merged into a new initial merge time interval. If the time difference between the initial merge time interval with a time length less than the preset minimum time length and the next adjacent initial merge time interval is less than the preset merge threshold, then the initial merge time interval with a time length less than the preset minimum time length and the next adjacent initial merge time interval will be merged into a new initial merge time interval. Integrate all eligible preliminary merge time intervals to generate the final set of preliminary merge time intervals.
8. The method for predicting traffic anomalies based on AI spatiotemporal graph neural networks according to claim 1, characterized in that, The passage spatiotemporal association chain is constructed based on the historical passage record sequence. This chain uses the passage subject as the association node and the positional and temporal coordination relationships of different passage subjects within a continuous time range as the association links. Each association link carries positional correlation and temporal coordination, including: Extract all passage times and corresponding passage location information for each passage subject from the historical passage record sequence, arrange them in chronological order of passage times, and generate a passage spatiotemporal record for each passage subject; The total time range covered by the historical access record sequence is divided into multiple consecutive time segments with the same duration, and a unique time identifier is assigned to each time segment. For a given time segment, extract the portion of the spatiotemporal records of all passing subjects that belongs to that time segment, forming the subject passing set for that time segment; Select any two different traffic entities from the main traffic set of this time segment, and determine the traffic location information and traffic time of the two traffic entities within this time segment; Extract all the passage location information of the first passage subject within the time segment, and use the convex hull algorithm to calculate the spatial region composed of all the passage location information of the first passage subject within the time segment, which is taken as the location region of the first passage subject; Extract all passage location information of the second passage subject within the time segment, and calculate the spatial region composed of all passage location information of the second passage subject within the time segment using the convex hull algorithm, which is taken as the location region of the second passage subject; Calculate the intersection area and the union area of two location regions, and use the ratio of the intersection area to the union area as the location correlation degree; Extract all passage times of the first passing subject within this time segment to form the first time set; Extract all passage times of the second passage subject within this time segment to form a second time set; Calculate the number of intersection times and the number of union times of two time sets, and use the ratio of the number of intersection times to the number of union times as the time synergy degree; If both the location correlation and time coordination are greater than the preset threshold, then the two passing entities are used as the correlation nodes to establish the correlation link for this time segment, and the location correlation and time coordination are used as the carrying information of the correlation link for this time segment. Repeat the above steps from selecting two passage subjects to establishing the association link for that time segment until all pairwise combinations of passage subjects in the passage subject set for that time segment have been processed; By connecting the associated links of each associated node in different time segments according to the time identifier order, the associated links of the same group of associated nodes in different time segments form a continuous link sequence. The continuous link sequences of all associated nodes are integrated, and the time segment identifiers of the continuous link sequences of each associated node are adjusted to ensure that the continuous link sequence of each associated node is consistent with the continuous link sequences of other associated nodes in the time dimension, thereby generating a passing spatiotemporal association chain.
9. A traffic anomaly prediction system based on AI spatiotemporal graph neural network, characterized in that, include: processor; A machine-readable storage medium for storing machine-executable instructions of the processor; The processor is configured to execute the traffic anomaly prediction method based on an AI spatiotemporal graph neural network according to any one of claims 1 to 8 by executing the machine-executable instructions.
Citation Information
Patent Citations
Industrial management system and method based on cloud edge collaboration
CN117391454A
Smart park personnel trajectory tracking method and system based on data analysis
CN120656208A