An abnormal transaction rollback method in intelligent parking lot non-inductive payment
Patent Information
- Application Number
- CN202611060368.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-16
- Publication Date
- 2026-10-20
AI Technical Summary
[0005]本申请提供一种智慧停车场无感支付中的异常交易回滚方法,旨在解决固定回滚阈值无法动态适配停车场实时运营状态变化,导致异常交易误判或漏判的问题
通过融合停车场静态空间拓扑结构与动态运营时序数据,构建基于时空指纹的无监督模式识别机制,为每类典型运营模式建立以状态节点间耗时分位值为权重的状态跃迁图谱,使回滚阈值随实时运营状态动态匹配调整,提升了异常交易检测的准确性与响应灵敏度。该方案仅基于业务流程关键节点构建轻量级图结构,参数来源于实际观测数据统计,无需在线训练或引入外部依赖,且图谱具备可审计性与运维透明性,便于故障定位与策略调优。同时,该机制将物理空间可达性、资源饱和度与服务通道承载力统一编码为可聚类的时空指纹向量,在缺乏用户画像与历史标签的情况下仍能感知运营态势,适用于冷启动阶段或低频交易场景,不同停车场可独立建模、无需中心化训练平台即可规模化部署。
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_3
Abstract
Description
Technical Field
[0001] This invention relates to the field of smart parking transaction security management technology, and in particular to a method for rolling back abnormal transactions in smart parking contactless payment. Background Technology
[0002] The contactless payment system for smart parking lots is widely used in various scenarios such as urban transportation hubs, commercial complexes, and property management. It enables vehicles to pass quickly through automatic license plate recognition, automatic billing calculation, and payment channel linkage. Among these, the rollback processing of abnormal transactions is a key link to ensure payment consistency and smooth lane flow.
[0003] Current mainstream solutions for rolling back abnormal transactions include: using fixed-duration thresholds to judge timeouts at key nodes such as payment feedback and barrier gate commands, triggering a rollback if the timeout is exceeded; some solutions use the sliding window method to calculate the average time consumption over historical periods to generate a fixed threshold template; and a few platforms introduce lightweight rule engines or risk scores for static labeling judgment. The above methods are simple to implement and have been applied to some extent in standard parking lots with balanced traffic.
[0004] However, the existing technologies mentioned above have the following shortcomings: First, fixed or semi-fixed thresholds cannot adapt to sudden changes in traffic volume, fluctuations in device load, and differences in payment channel response at different times, leading to increased misjudgment rates during periods of high traffic volume and delayed responses during periods of low traffic volume. Second, methods based on historical statistics are susceptible to interference from non-periodic factors such as seasons and holidays, making it difficult to reflect the real-time operational status in a timely manner. Third, simple rules lack the integration of spatial dynamic features such as parking lot entrance and exit structures, parking space distribution, and real-time traffic flow, causing threshold determination to deviate from actual business flow. Fourth, while introducing complex models can improve adaptability, they are difficult to deploy and have uncontrollable computational latency, failing to meet the low-power and low-latency requirements of edge gateways. Therefore, existing methods have significant limitations in flexibly responding to dynamic operational scenarios and ensuring transaction security and efficiency. Summary of the Invention
[0005] This application provides a method for rolling back abnormal transactions in contactless payment for smart parking lots, aiming to solve the problem that fixed rollback thresholds cannot dynamically adapt to changes in the real-time operating status of parking lots, leading to misjudgment or missed judgment of abnormal transactions.
[0006] This application provides a method for rolling back abnormal transactions in contactless payment for smart parking lots, specifically including: Acquire static geographic topology data and dynamic runtime sequence data of the target parking lot; Based on the fusion encoding process of the static geographic topology data and the dynamic runtime sequence data, a spatiotemporal fingerprint vector of the parking lot is generated, which represents the comprehensive status of the parking lot in the current time period in three dimensions: spatial accessibility, resource saturation and channel carrying capacity. Unsupervised clustering operations are performed on multiple parking lot spatiotemporal fingerprint vectors generated within the historical period to automatically classify several typical operation modes with inherently consistent state evolution patterns. For each of the typical operating modes, a state transition graph is constructed with key state nodes in the transaction lifecycle as vertices and the P90 quantile of the measured time consumption distribution between states as edge weights. The parking lot spatiotemporal fingerprint vector generated by the real-time transaction is input into the mapping association for matching operation to determine the target typical operation mode to which the current transaction belongs, and the subsequent node tolerance window of the current state node is extracted from the state transition graph corresponding to the target typical operation mode. The upper limit of the tolerance window of the subsequent node is set as the dynamic rollback trigger threshold for this transaction, and it is determined whether the dwell time of the real-time transaction in the current state node exceeds the dynamic rollback trigger threshold. If the dwell time exceeds the dynamic rollback trigger threshold, an abnormal transaction rollback instruction is executed to cancel the current payment request and a rollback log is recorded; otherwise, the current transaction status is maintained and monitoring continues until the transaction is completed or timeout occurs.
[0007] This application provides a method for rolling back abnormal transactions in contactless payment for smart parking lots, which has the following beneficial effects: By integrating the static spatial topology of parking lots with dynamic operational time-series data, an unsupervised pattern recognition mechanism based on spatiotemporal fingerprints is constructed. This mechanism establishes a state transition graph for each typical operational mode, weighted by the time quantile values between state nodes. The rollback threshold is dynamically adjusted according to real-time operational status, improving the accuracy and responsiveness of abnormal transaction detection. This solution builds a lightweight graph structure based solely on key nodes of the business process, with parameters derived from actual observation data statistics. It requires no online training or external dependencies, and the graph is auditable and transparent, facilitating fault location and strategy optimization. Furthermore, this mechanism uniformly encodes physical space accessibility, resource saturation, and service channel capacity into clusterable spatiotemporal fingerprint vectors. Even without user profiles and historical tags, it can still perceive operational status, making it suitable for cold start phases or low-frequency transaction scenarios. Different parking lots can be independently modeled, and it can be deployed at scale without a centralized training platform. Attached Figure Description
[0008] Figure 1 This is the main flowchart of an abnormal transaction rollback method in a smart parking lot contactless payment system.
[0009] Figure 2 This is a sub-flowchart of an abnormal transaction rollback method in a smart parking lot contactless payment system.
[0010] Figure 3This is another sub-flowchart of an abnormal transaction rollback method in a smart parking lot contactless payment system. Detailed Implementation
[0011] Embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.
[0012] The following disclosure provides many different embodiments or examples for implementing different structures of the invention. To simplify the disclosure, specific examples of components and arrangements are described below. Of course, these are merely examples and are not intended to limit the invention. Furthermore, reference numerals and / or letters may be repeated in different examples; such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed.
[0013] like Figure 1 As shown, this application provides a method for rolling back abnormal transactions in contactless payment for smart parking lots, specifically including: S1: Obtain static geographic topology data and dynamic runtime sequence data of the target parking lot. Static geographic topology data includes the number of entrances and exits, lane flow connection relationships, and parking space density distribution. Dynamic runtime sequence data includes the number of vehicles entering and exiting at a preset time granularity, the curve of the change in the proportion of vacant parking spaces in the area, and the success rate and average response time of each payment channel.
[0014] S2: Based on the fusion encoding of static geographic topology data and dynamic runtime sequence data, a spatiotemporal fingerprint vector of the parking lot is generated, which represents the comprehensive status of the parking lot in the current time period in three dimensions: spatial accessibility, resource saturation and channel carrying capacity.
[0015] S3: Perform unsupervised clustering operations on multiple parking lot spatiotemporal fingerprint vectors generated within the historical period, automatically classify several typical operation modes with inherent consistent state evolution laws, and establish a mapping relationship between typical operation modes and parking lot spatiotemporal fingerprint vectors.
[0016] S4: For each typical operating mode, a state transition graph representing the evolution law of the transaction state under this mode is constructed, with key state nodes in the transaction life cycle as vertices and the P90 quantile of the measured time consumption distribution between states as edge weights.
[0017] S5: Input the current parking lot spatiotemporal fingerprint vector generated by the real-time transaction into the mapping association for matching operation, determine the target typical operation mode to which the current transaction belongs, and extract the subsequent node tolerance window of the current state node from the state transition graph corresponding to the target typical operation mode.
[0018] S6: Set the upper limit of the tolerance window of subsequent nodes as the dynamic rollback trigger threshold for this transaction, and determine whether the residence time of the real-time transaction on the current state node exceeds the dynamic rollback trigger threshold.
[0019] S7: If the judgment result is that the real-time transaction dwell time exceeds the dynamic rollback trigger threshold, then execute the abnormal transaction rollback instruction to cancel the current payment request and record the rollback log; otherwise, maintain the current transaction status and continue monitoring until the transaction is completed or timeout occurs.
[0020] Step S1: Obtain the static geographic topology data and dynamic runtime sequence data of the target parking lot. The static geographic topology data includes the number of entrances and exits, lane flow connections, and parking space density distribution. The dynamic runtime sequence data includes the number of vehicles entering and exiting at a preset time granularity, the curve of the change in the proportion of vacant parking spaces in the area, and the success rate and average response time of each payment channel. Specifically, this includes: S1.1: Digitally scan and process the layout information of parking lot infrastructure, extract spatial structure parameters such as the number of entrances and exits, lane flow connection relationships, and parking space density distribution, to generate a standardized static geographic topology dataset as the initial input condition for characterizing the physical spatial constraints of the parking lot.
[0021] By calling a high-precision LiDAR or visual SLAM mapping module, the 3D point cloud data inside the parking lot is processed into a grid, and the boundaries of the entrance and exit channels, driving lanes and parking space areas are identified and segmented to generate an original spatial layer containing geometric coordinate information.
[0022] Based on the original spatial layer, the physical connectivity of the entrance and exit passages is analyzed, the total number of independent entrances and exits is counted, and a unique identifier ID is defined for each entrance and exit, forming a set of entrance and exit nodes, and establishing the basic interface for interaction between the parking lot and the external traffic network.
[0023] Traverse the driving lane area, extract the lane centerline skeleton, construct a set of directed edges based on the vehicle driving direction arrows and the location of physical barriers, clarify the one-way or two-way passage permissions between each node, and generate a directed graph structure describing the connection relationship of lane flow.
[0024] The parking area is divided into grids, the number of effective parking spaces per unit area is calculated, and the parking space type (such as standard space, charging space, and accessible space) is classified and statistically analyzed to generate a parking space density distribution matrix for each area, thereby quantifying the local concentration of spatial resources.
[0025] The set of entrance and exit nodes, the directed graph structure, and the berth density distribution matrix are encapsulated in a structured manner. The node connection relationship is stored in the form of an adjacency list, and the density distribution is stored in a two-dimensional array to generate a standardized static geographic topology dataset.
[0026] Through the aforementioned digital scanning and structured encapsulation processing methods, unstructured parking lot physical environment information is transformed into a standardized static geographic topology dataset that can be processed by computers. This achieves accurate digital mapping of the physical spatial constraints of the parking lot, providing a stable spatial benchmark for subsequent dynamic data spatiotemporal alignment.
[0027] For example, in a three-level underground parking garage, point cloud data was acquired using LiDAR scanning to identify four entrance / exit nodes, numbered E1 to E4. Lane skeleton analysis revealed that E1 and E2 allow bidirectional traffic, E3 allows entry only, and E4 allows exit only. A connected graph containing 12 key intersection nodes and 18 directed edges was constructed. The B1 level parking area was rasterized, and the standard parking space density was calculated to be 0.8 spaces / square meter, and the charging space density to be 0.1 spaces / square meter. The resulting static geographic topology dataset contains information on the four entrance / exit nodes, 18 directed edge connections, and a hierarchical parking space density matrix. This dataset is used as a fixed parameter input to step S2.1 to construct the static topological adjacency matrix, ensuring accurate spatial structural constraints for subsequent spatiotemporal fingerprint generation.
[0028] S1.2: Based on the preset time granularity, the raw traffic flow data reported by the IoT sensor terminal is time-series aligned and missing value interpolated. The curve of the change in the proportion of vacant parking spaces in each area and the statistics of the number of vehicles entering and exiting are calculated to generate a high-fidelity dynamic traffic flow time-series characteristic sequence, realizing the conversion from discrete sensor readings to continuous operating status indicators.
[0029] The system receives raw discrete traffic flow data streams reported by IoT sensor terminals. The data streams include geomagnetic sensor trigger signals, video recognition license plate events, and barrier gate lifting and lowering status logs. There are issues with timestamp asynchrony and inconsistent sampling frequencies among the data sources.
[0030] A unified time base alignment process is performed on the multi-source heterogeneous raw data. A linear interpolation algorithm is used to fill the short-term data loss caused by sensor communication packet loss, with a preset 15-minute fixed time granularity window, to construct a continuous time series reference axis.
[0031] Based on the aligned time series, the Boolean value sequence of geomagnetic occupancy status of each parking area is extracted. The average number of occupied parking spaces within each time granularity is calculated using the sliding window statistical method. Combined with the total number of parking spaces in the area, a curve showing the change in the proportion of vacant parking spaces in the area is generated.
[0032] To count the number of vehicles entering and exiting, the video recognition and capture records are deduplicated and duplicate recognition records of the same license plate within a very short period of time are removed, and the net number of vehicles entering and exiting is aggregated according to the time granularity to generate statistics.
[0033] An exponentially weighted moving average algorithm is introduced to smooth the original traffic flow fluctuation data and suppress instantaneous noise interference. The formula is as follows: in for Traffic flow indicators after smoothing These are the original observations. This is a smoothing coefficient, with a value ranging from 0.1 to 0.3. This is the smoothed value from the previous time step.
[0034] Through the above-mentioned time alignment, missing value interpolation and smoothing filtering, discrete sensor readings are transformed into high-fidelity dynamic traffic flow time sequence features, realizing the transformation from unstructured underlying data to continuous operating status indicators, and providing standardized input for subsequent spatiotemporal fingerprint generation.
[0035] For example, a parking lot contains 500 parking spaces, divided into two areas, A and B. The system is set to a time granularity of 15 minutes and a smoothing coefficient. The threshold was set to 0.2. From 9:00 to 9:15, geomagnetic detection in Area A showed an average of 400 occupied parking spaces, with an initial vehicle flow of 50 vehicles. After linear interpolation to repair two data gaps, the calculated vacancy rate for Area A was 20%. The EMA formula was used to smooth the vehicle flow over four consecutive time periods, eliminating the ±5 vehicle counting error caused by network jitter. The smoothed vehicle flow value was 48.5 vehicles. The final generated feature sequence accurately reflects the morning peak congestion trend, with data integrity improved to 99.9%, significantly enhancing the stability of subsequent cluster analysis.
[0036] S1.3: Utilize payment gateway interface logs to parse and aggregate transaction messages from various channels, extract the average success rate and average response time of different payment channels, and generate a multi-dimensional payment channel load feature vector to quantify the impact of the external payment environment on the transaction process's carrying capacity.
[0037] Obtain the original transaction message logs reported by the payment gateway interface within a preset time granularity. The logs include the unique transaction identifier, payment channel type, request initiation timestamp, and response status code.
[0038] The original transaction messages are parsed and fields are extracted. Based on the payment channel type, the transaction records are divided into three independent data subsets: WeChat, Alipay and ETC, and an index mapping is established at the channel level.
[0039] For each data subset, invalid records are cleaned and duplicate request messages caused by network jitter are removed to ensure the uniqueness and validity of the sample data, forming a standardized channel transaction time sequence.
[0040] Calculate the transaction success rate of each channel within a unit time window, and use the sliding window statistical method to aggregate the number of successful responses and the total number of requests to generate a success rate indicator sequence that reflects the stability of the channels.
[0041] The average response time for each channel is calculated using the following formula: in, For average response time, The number of valid transaction samples, For the first The timestamp indicating the completion of the transaction response. The timestamp for initiating the request for the corresponding transaction.
[0042] The calculated average success rate and average response time are concatenated into a vector to construct a payment channel load feature vector containing multi-dimensional load information.
[0043] Through the above-mentioned parsing and aggregation processing methods, discrete payment gateway logs are transformed into quantified multi-dimensional payment channel load feature vectors, thereby achieving an accurate characterization of the impact on the carrying capacity of the external payment environment.
[0044] For example, with a time granularity of 15 minutes, payment logs from a parking lot during the morning rush hour were collected. Parsing revealed a WeChat Pay subset containing 120 valid records, of which 118 were successful, with a total processing time of 36,000 milliseconds. Substituting these into the formula, the average response time was calculated to be 300 milliseconds, resulting in a success rate of 98.3%. Similarly, metrics for Alipay and ETC channels were calculated, ultimately generating a three-dimensional load feature vector [0.983, 300, 0.995, 150, 0.999, 50], corresponding to the success rate and average processing time of each channel, significantly improving the accuracy of payment congestion perception in subsequent spatiotemporal fingerprint construction.
[0045] S1.4: Perform multimodal data fusion encoding on the static geographic topology dataset, dynamic traffic flow time-series feature sequence, and multidimensional payment channel load feature vector to establish an association mapping index between spatial structure and temporal behavior data, so as to generate a comprehensive data package of the original parking lot operation status containing full-element perception information, and complete the unified formatting and encapsulation of multi-source heterogeneous data.
[0046] The system receives the standardized static geographic topology dataset generated by S1.1, the high-fidelity dynamic traffic flow time-series feature sequence generated by S1.2, and the multi-dimensional payment channel load feature vector generated by S1.3 as the initial input objects for multimodal data fusion encoding.
[0047] A multi-source heterogeneous data association mapping index based on timestamp alignment is constructed. With a preset time granularity of 15 minutes, the spatial node IDs in static geographic topology data are matched with the time slices in the dynamic traffic flow time series feature sequence by Cartesian product matching to establish a spatiotemporal reference coordinate system.
[0048] By employing tensor splicing technology, the static topological adjacency matrix is expanded into a constant slice in the time dimension, so that its spatial structure remains unchanged in each time step, forming a static spatial constraint basis.
[0049] The curves showing the change in the number of vehicles entering and exiting and the proportion of vacant parking spaces in a region in the dynamic traffic flow time-series feature sequence are mapped to the corresponding spatial nodes. The missing time point data is filled in by linear interpolation to ensure the continuity of the time dimension.
[0050] The average success rate and average response time in the multi-dimensional payment channel load feature vector are aggregated into the corresponding time slices according to the transaction timestamps in the payment gateway logs to form a payment environment load time series matrix.
[0051] Using a weighted fusion algorithm, the static spatial constraint basis, the dynamic traffic flow state matrix, and the payment environment load matrix are multiplied element by element to generate an original high-dimensional fusion feature tensor that includes the coupling relationship between spatial accessibility, resource saturation, and channel carrying capacity.
[0052] The original high-dimensional fusion feature tensor is serialized and encapsulated, and a unique parking lot identifier, a data collection time window start and end marker, and data version number metadata are added to generate an original comprehensive data package of parking lot operation status containing full-element perception information.
[0053] By using a multimodal data fusion coding process, the scattered static topology, dynamic traffic flow, and payment load data from the previous step are transformed into a unified format comprehensive data packet, realizing the structured integration and semantic alignment of multi-source heterogeneous data, and providing a complete and consistent data foundation for the subsequent generation of spatiotemporal fingerprint vectors.
[0054] For example, for an underground parking lot with 3 entrances / exits and 500 parking spaces, the static geographic topology dataset contains a 3×3 entrance / exit adjacency matrix and a 500-dimensional parking space distribution vector. The dynamic traffic flow time-series feature sequence is granular at 15-minute intervals, containing the entry / exit traffic flow and vacant parking space ratio for 96 time slices. The multi-dimensional payment channel load feature vector contains the success rate and response time of WeChat, Alipay, and ETC channels. The system uses a 15-minute time window to replicate the static adjacency matrix 96 times to form a static basis. The entry / exit traffic flow in the t-th time slice is mapped to the corresponding entrance / exit node, and the vacant parking space ratio is mapped to the corresponding area node. The average response time of each payment channel in the t-th time slice is aggregated into a load vector. Through weighted fusion, the static basis is multiplied by the dynamic state matrix to generate a 96×(3+500+3) dimensional original fused feature tensor. Finally, it is packaged into a comprehensive data packet of the original parking lot operation status, which includes the parking lot ID "PARK_001", the time window "2023-10-01 00:00:00 to 2023-10-01 23:45:00" and the version "V1.0", thus realizing the precise correlation between spatial structure and temporal behavior data.
[0055] S1.5: Perform outlier removal and normalization on the original parking lot operation status integrated data packet to eliminate dimensional differences and filter noise interference, so as to output the cleaned static geographic topology data and dynamic runtime sequence data of the target parking lot, ensuring the consistency of data quality and computational reliability of subsequent fusion coding processing.
[0056] like Figure 2 As shown, step S2 involves fusing and encoding static geographic topology data with dynamic runtime sequence data to generate a spatiotemporal fingerprint vector representing the comprehensive status of the parking lot in the current time period across three dimensions: spatial accessibility, resource saturation, and channel carrying capacity. Specifically, this includes: S2.1: Perform graph structure mapping processing on the number of entrances and exits, lane flow connection relationships and parking space density distribution in the acquired static geographic topology data to construct a static topological adjacency matrix that represents the physical spatial constraints of the parking lot, and use this static topological adjacency matrix as the basic input object for subsequent dimension alignment.
[0057] The S2.1 sub-step aims to transform the discrete physical spatial parameters of the parking lot into a computer-processable graph theory structure, providing a topological benchmark for subsequent spatiotemporal data alignment. It receives the static geographic topological data cleaned in S1.5, including the set of entrance / exit coordinates, a list of lane connection relationships, and parking space area division information.
[0058] Construct a directed weighted graph model G=(V,E), where the vertex set V represents the key spatial nodes within the parking lot, including entrances and exits, main road intersections, and the center points of independent parking areas. Based on lane flow connections, determine the directed edges E between vertices. If a one-way path exists from node i to node j, then a directed edge is established.<i,j> .
[0059] Initialize the static topological adjacency matrix A with dimensions N×N, where N is the total number of vertices, and set all initial element values to 0. Traverse all directed edges, and for existing connections...<i,j> The weight w is calculated based on the Euclidean distance between the two points or the actual driving path length. ij And assign the matrix element A[i][j] the value w. ij For two-way traffic sections, the values of A[i][j] and A[j][i] are set simultaneously. For the parking space density distribution, the value of v for each parking area node is calculated. k Number of berths per unit area density k The density value is embedded as a node attribute into the diagonal element A[k][k] of the adjacency matrix to characterize the resource aggregation degree of the node. Through the above mapping, unstructured geographic layout information is converted into a standardized static topological adjacency matrix.
[0060] By using graph structure mapping, the static geographic topology data from the previous step is transformed into a static topological adjacency matrix with spatial connectivity and resource density attributes, thereby realizing the digital representation of the physical spatial constraints of the parking lot and providing a basic input object for the spatial node index alignment of subsequent dynamic time-series data.
[0061] For example, a parking lot contains 2 entrances / exits, 4 main intersections, and 6 parking areas, totaling 12 spatial nodes. A 12×12 adjacency matrix A is constructed. There is a one-way connection between entrance node 1 and intersection node 3, with a path length of 50 meters, so A[1][3]=50. Parking area node 7 has an area of 200 square meters and 20 parking spaces, with a density of 0.1 spaces / square meter, so the diagonal element A[7][7]=0.1. The elements between other nodes without direct connections remain 0. The final generated matrix A completely encodes the spatial topology and resource distribution characteristics of the parking lot, ensuring that subsequent dynamic traffic flow data can be accurately mapped to specific spatial nodes.
[0062] S2.2: Based on the spatial node index of the static topological adjacency matrix, spatiotemporal alignment interpolation is performed on dynamic runtime sequence data such as the number of vehicles entering and exiting, the change curve of the proportion of vacant parking spaces in the area, and the success rate and average response time of each payment channel under the preset time granularity, so as to generate a dynamic state time sequence tensor with a unified timestamp and spatial node dimension.
[0063] Substep S2.2 aims to address the inconsistency in dimensionality and time reference between static topology and dynamic temporal data by generating a unified dynamic state temporal tensor through spatiotemporal alignment interpolation. This step receives the static topological adjacency matrix generated in the preceding step and the cleaned dynamic runtime temporal data as input.
[0064] Based on the spatial node index system defined in the static topological adjacency matrix, a spatial dimension mapping table is established to logically map the discrete distribution of IoT sensor locations to specific node or edge sets in the topological graph, thereby achieving spatial alignment of physical sensing data to graph structure data.
[0065] For traffic flow time-series data such as the number of vehicles entering and exiting and the proportion of vacant parking spaces in a region at a preset time granularity, a linear interpolation algorithm is used to fill in the missing values in the time series caused by sensor communication delays or packet loss, ensuring the continuity of data on the time axis and generating a complete time series vector.
[0066] For the success rate and average response time metrics of each payment channel, since they are event-triggered data rather than periodically sampled data, a sliding window aggregation method is adopted. A fixed-duration window is traced back from the current timestamp, and the weighted statistical value of the transaction records within the window is calculated, which is then transformed into a continuous time-series signal with the same time granularity as the traffic flow data.
[0067] The multi-source data, after spatial mapping and temporal completion, are stacked according to the structure of [time step, spatial node, feature dimension] to construct a three-dimensional dynamic state temporal tensor. The first dimension represents the time evolution sequence, the second dimension corresponds to the spatial node in the topology graph, and the third dimension covers multi-dimensional feature indicators such as traffic density, parking status, and payment load.
[0068] By using the above spatiotemporal alignment interpolation method, the heterogeneous and asynchronous original monitoring data in the previous step are transformed into dynamic state time series tensors with unified timestamps and spatial node dimensions. This achieves strict alignment of multimodal data on the spatiotemporal reference, laying the data structure foundation for subsequent tensor product fusion operations and extraction of high-dimensional fusion feature vectors.
[0069] For example, the parking lot topology is set to include 10 key spatial nodes, with a time dimension of 15 minutes. For the vacant parking space data missing at a certain node at time T, the value at time T is calculated to be 80% using linear interpolation based on the observations of 85% and 75% at T-15 minutes and T+15 minutes, respectively. For ETC payment response time, 50 transactions within a 30-minute window before and after time T are selected, and their average response time is calculated to be 200ms. Finally, a dynamic state time series tensor of shape [96, 10, 5] is constructed, where 96 represents 96 15-minute time intervals per day, 10 represents spatial nodes, and 5 represents five feature dimensions: vehicle flow, vacancy rate, WeChat success rate, Alipay success rate, and ETC response latency, ensuring data consistency for subsequent clustering analysis.
[0070] S2.3: The multi-scale normalization algorithm is used to perform dimension elimination and extreme value compression on the numerical values of each dimension in the dynamic state time series tensor, so as to output a standard normalized state feature sequence with eliminated dimension differences and convergent numerical distribution, ensuring that the operating parameters with different physical meanings have a fusionable calculation benchmark.
[0071] S2.4: Based on the standard normalized state feature sequence and the static topological adjacency matrix, perform tensor product fusion operation to inject spatial structure constraint weights into the time evolution features, so as to generate the original high-dimensional fusion feature vector containing the coupling relationship between spatial accessibility, resource saturation and channel carrying capacity.
[0072] The system receives the standard normalized state feature sequence obtained from S2.3 and the static topological adjacency matrix constructed in S2.1 as dual input sources for the tensor product fusion operation. The static topological adjacency matrix is defined as a spatial constraint weight tensor, where non-zero elements represent the connectivity and path reachability strength between physical nodes within the parking lot. The standard normalized state feature sequence undergoes a dimensionality expansion operation, reconstructing it from a one-dimensional time series into a three-dimensional state tensor that matches the number of spatial nodes, ensuring alignment of the temporal evolution data in the spatial dimension. The tensor product fusion operation is then performed, using the Einstein summation convention to perform an element-wise weighted mapping between the spatial constraint weight tensor and the three-dimensional state tensor, as shown in the following formula: in, For the fusion of the first The spatial node at the _ The time slice and the first The values of each feature dimension For nodes in the static topological adjacency matrix To the node The connection weights, For nodes In the corresponding spatiotemporal dimension, the normalized state value, This represents the total number of parking space nodes.
[0073] This operation injects structural constraints of spatial topology into dynamic traffic flow and payment load data, resulting in a enhanced coupling effect from state changes of adjacent highly connected nodes. Nonlinear activation processing is applied to the intermediate results generated by the fusion operation, and the ReLU function is used to remove negative redundant interference, retaining effective feature components reflecting the positive correlation between resource saturation and channel carrying capacity. The processed multidimensional data is flattened into a one-dimensional vector, forming an original high-dimensional fusion feature vector containing the deep coupling relationship between spatial accessibility, resource saturation, and channel carrying capacity.
[0074] By using tensor product fusion processing, the standard normalized state features from the previous step are transformed into original high-dimensional fusion feature vectors with spatial structure perception capabilities, thereby achieving deep semantic binding between dynamic operating states and static physical constraints.
[0075] It should be noted that spatial accessibility is represented by the topological connectivity strength component of each spatial node after fusion, resource saturation is represented by the occupancy status component of each parking space after fusion, and channel carrying capacity is represented by the performance component of each payment channel after fusion. The components of these three dimensions together constitute the values of each dimension of the parking lot spatiotemporal fingerprint vector.
[0076] For example, for a medium-sized parking lot with 4 entrances / exits and 200 parking spaces, the number of spatial nodes N is set to 24 (including entrances / exits and key intersections). In the static topological adjacency matrix A, the weight of directly connected nodes is set to 1.0, and the weight of indirectly connected nodes is set to 0.5. During the morning peak hours, the normalized value of the vehicle inflow rate of a certain entrance node is 0.85, and the normalized value of the ETC lane response time is 0.2. Through tensor product operation, the state values of highly connected neighbor nodes (such as the main lane) of this entrance node are given higher weights. In the fused feature vector, the spatial accessibility score of this area is significantly improved, while the state influence of remote corner parking areas is suppressed. The final generated original high-dimensional fused feature vector has a dimension of 576, accurately reflecting the potential obstruction risk of entrance congestion during peak hours on the overall payment process, and providing a high signal-to-noise ratio input for subsequent dimensionality reduction.
[0077] S2.5: Perform principal component dimensionality reduction projection processing on the original high-dimensional fusion feature vector, extract the principal component components whose cumulative contribution rate exceeds the preset threshold and perform linear recombination, so as to finally generate a low-dimensional dense parking lot spatiotemporal fingerprint vector that retains key scene information, and complete the transformation from multi-dimensional heterogeneous data to a single scene identifier.
[0078] The system receives the original high-dimensional fusion feature vector generated in the previous steps, which contains the coupling relationship between spatial accessibility, resource saturation, and channel carrying capacity. This vector has a high dimension and contains information redundancy, so it needs to be dimensionality reduced to extract the core scene identifier.
[0079] We construct the covariance matrix of the original high-dimensional fusion feature vector, calculate the linear correlation between features of each dimension, quantify the degree of covariance of different physical quantities in the spatiotemporal dimension, and provide a statistical basis for subsequent principal component extraction.
[0080] Eigenvalue decomposition is performed on the covariance matrix to solve for the eigenvalues and corresponding eigenvectors of the matrix. The magnitude of the eigenvalue represents the contribution of the data variance along the corresponding principal component direction, and the eigenvector defines the principal axis direction in the new coordinate system.
[0081] Calculate the cumulative contribution rate of each principal component, traverse the sorted eigenvalue sequence, select the smallest principal component set that satisfies the condition that the cumulative contribution rate exceeds the threshold, and remove noise interference and low variance redundant components.
[0082] The original high-dimensional fused feature vector is projected onto a low-dimensional subspace composed of selected feature vectors, and a linear transformation operation is performed to generate a low-dimensional, dense parking lot spatiotemporal fingerprint vector that retains key scene information.
[0083] By using principal component dimensionality reduction projection processing, the high-dimensional redundant data from the previous step is transformed into a low-dimensional and compact parking lot spatiotemporal fingerprint vector, achieving efficient conversion from multi-dimensional heterogeneous data to a single scene identifier, reducing the complexity of subsequent clustering calculations and improving the real-time performance of pattern matching.
[0084] For example, the original high-dimensional fusion feature vector has a dimension of 120, covering parameters such as entrance / exit topology, parking space distribution, traffic density, and payment response. A 120×120 covariance matrix is constructed, and eigenvalue decomposition is performed to obtain 120 eigenvalues. These are sorted from largest to smallest, and the cumulative contribution rate is calculated. When the top 8 principal components are selected, the cumulative contribution rate reaches 96.2%, exceeding the preset threshold of 95%. The top 8 feature vectors are extracted to form a 120×8 projection matrix. The original 120-dimensional vector is multiplied by this projection matrix to generate an 8-dimensional parking lot spatiotemporal fingerprint vector. This vector retains the core variation information about spatial congestion and payment load in the original data, reducing the data volume by 93.3%, significantly improving the execution efficiency of subsequent unsupervised clustering algorithms, and ensuring millisecond-level response capabilities on edge computing nodes.
[0085] Step S3: Perform unsupervised clustering on multiple parking lot spatiotemporal fingerprint vectors generated within the historical period to automatically classify several typical operation modes with inherently consistent state evolution patterns, and establish a mapping relationship between typical operation modes and parking lot spatiotemporal fingerprint vectors. Specifically, this includes: S3.1: Standardize and preprocess the original parking lot spatiotemporal fingerprint vector set collected within the historical period. Use the Z-Score normalization algorithm to eliminate the dimensional differences of the three dimensions of spatial accessibility, resource saturation and channel carrying capacity, and generate a standardized parking lot spatiotemporal fingerprint vector set to eliminate the interference of different physical quantities on subsequent distance calculations.
[0086] S3.2: Based on the standardized parking lot spatiotemporal fingerprint vector set, the density peak clustering algorithm is used to calculate the local density and relative distance of each standardized parking lot spatiotemporal fingerprint vector, and generate feature-enhanced parking lot spatiotemporal fingerprint vectors containing local density values and relative distance values, so as to quantify the density and isolation of each vector in the data space.
[0087] The system receives a set of parking lot spatiotemporal fingerprint vectors that have been normalized by Z-Score and uses them as the input data source for the density peak clustering algorithm to establish the distribution benchmark of each vector in the multidimensional feature space.
[0088] Traverse each vector element in the standardized parking lot spatiotemporal fingerprint vector set, calculate its Euclidean distance with all other vectors in the set, and construct a full distance matrix to quantify the spatial proximity relationship between vectors.
[0089] Based on a preset cutoff distance parameter, the number of neighbor vectors whose distance to each vector is less than the cutoff distance parameter is counted. The local density value of each vector is calculated by weighted summation using a Gaussian kernel function, reflecting the frequency and clustering of this operation pattern in historical data.
[0090] The local density of the i-th standardized parking lot spatiotemporal fingerprint vector is calculated using the following formula: in, Indicates the first Local density values of vectors, Representing vectors and The Euclidean distance between them This is the truncation distance parameter, used to control the neighborhood range.
[0091] For the vector with the highest local density, its relative distance is defined as the maximum distance; for the remaining vectors, the closest vector among all vectors with a local density greater than itself is found, and the minimum distance of this vector is defined as the relative distance of the current vector, thus measuring the degree of isolation of the vector relative to the high-density region.
[0092] The calculated local density value and relative distance value are added as new dimensions and appended to the end of the original standardized parking lot spatiotemporal fingerprint vector to generate a feature-enhanced parking lot spatiotemporal fingerprint vector containing information on the density and isolation of the distribution.
[0093] By using the density peak clustering algorithm to measure both local density and relative distance of the standardized vector, the single feature vector from the previous step is transformed into a feature-enhanced vector containing topological distribution characteristics. This achieves a quantitative representation of the potential cluster centers of typical parking lot operation modes, providing a high-precision decision-making basis for subsequent automatic identification of operation mode prototypes.
[0094] For example, set the cutoff distance d c The system calculates a standardized spatiotemporal fingerprint vector containing 1000 time periods, with a density of 0.5. For a vector representing the morning peak mode, the local density is 120.5 and the relative distance is 0.85; while for a vector representing the nighttime idle mode, the local density is 15.2 and the relative distance is 1.20. The system appends these two values to the original vector, forming an enhanced vector with increased dimensionality. This significantly improves the separability of different operating modes in the feature space, resulting in a substantial increase in the accuracy of subsequent cluster center identification.
[0095] S3.3: Utilize the local density values and relative distance values in the feature-enhanced parking lot spatiotemporal fingerprint vectors to execute automatic cluster center identification logic, select several vectors with the largest product of local density values and relative distance values as initial cluster center points, generate a typical operation mode prototype vector set, and determine the baseline state features representing different operation modes.
[0096] The system receives a set of feature-enhanced parking lot spatiotemporal fingerprint vectors, which includes the local density value and relative distance value of each vector, as the input data source for cluster center identification.
[0097] For each feature-enhanced vector in the set, a decision value calculation operation is performed, multiplying the local density value with the relative distance value to generate a representation vector that becomes a comprehensive decision index of the probability of cluster centers.
[0098] The decision value of the i-th vector is calculated using the following formula: in, For the first The decision value of each vector represents its probability of becoming a cluster center. For the first Local density values of vectors, For the first The minimum distance of a vector relative to a higher density point.
[0099] All calculated decision values are sorted in descending order to construct a priority sequence based on the size of the decision values, in order to quantify the representativeness of each vector in the pattern partitioning.
[0100] Based on the preset threshold for the number of typical operating modes, a corresponding number of vectors are extracted from the top of the priority sequence and marked as initial cluster center candidate points.
[0101] The initial cluster center candidate points are spatially distributed and verified. Redundant center points with Euclidean distance less than the preset minimum interval threshold are removed to ensure the distinguishability of various operating modes in the feature space.
[0102] The remaining verified vectors are combined into a typical operating mode prototype vector set, in which each vector represents a parking lot operating status benchmark with significant differences.
[0103] By maximizing the product of local density and relative distance and performing spatial deduplication, high-dimensional feature vectors are transformed into a set of typical operational model prototypes with clear physical meaning, thereby enabling the automatic establishment of operational benchmarks under unsupervised conditions.
[0104] For example, setting the local density cutoff distance dc to 2.5, for a spatiotemporal fingerprint vector A in a certain time period, its local density ρ is 18.4, its relative distance δ is 3.2, and the calculated decision value γ is 58.88. Another vector B has ρ of 15.1, δ of 4.5, and a decision value γ of 67.95. The system sorts all vectors by their γ values and selects the vectors corresponding to the top 5 largest values as candidate centers. If the distance between vector C and vector D is 0.8, which is less than the minimum interval threshold of 1.0, then vector D with the larger decision value is retained, and vector C is discarded. The final output is a set of typical operational mode prototype vectors containing 4 prototypes, corresponding to morning peak, evening peak, off-peak, and nighttime modes, providing a classification basis for subsequent state transition map construction.
[0105] S3.4: Based on the typical operation mode prototype vector set, perform the minimum Euclidean distance assignment operation on each remaining feature-enhanced parking lot spatiotemporal fingerprint vector, assign each feature-enhanced parking lot spatiotemporal fingerprint vector to the category to which the nearest typical operation mode prototype vector belongs, and generate a set of classified parking lot spatiotemporal fingerprint vectors with typical operation mode labels to complete the automatic classification of operation modes.
[0106] The system receives the set of typical operation mode prototype vectors generated by step S3.3, and the complete set of feature-enhanced parking lot spatiotemporal fingerprint vectors containing local density and relative distance information output by step S3.2. Using the feature-enhanced parking lot spatiotemporal fingerprint vectors to be classified as the query object, the system iterates through each prototype vector in the set of typical operation mode prototype vectors.
[0107] The Euclidean distance metric algorithm is used to calculate the geometric spatial distance between the current vector to be classified and each prototype vector, that is, to calculate the square root of the sum of the squares of the differences in each dimension between the two vectors.
[0108] Perform a minimum value search operation on all calculated distance values to identify the category identifier corresponding to the prototype vector with the smallest distance to the current vector space to be classified. Assign the typical operation mode identifier corresponding to the minimum distance to the current parking lot spatiotemporal fingerprint vector to complete the mode classification determination for a single sample.
[0109] The distance calculation and label assignment process described above is iteratively executed until all remaining feature-enhanced parking lot spatiotemporal fingerprint vectors within the historical period are assigned to a unique typical operation mode category. All labeled vectors are then aggregated to form a set of categorized parking lot spatiotemporal fingerprint vectors with clearly defined operation mode labels.
[0110] By using the minimum Euclidean distance allocation method, the spatial proximity relationship between the cluster centers determined in the previous step and the remaining samples is transformed into specific operational mode category label data, realizing the automated and refined pattern division of the historical operation status of parking lots, and providing an accurate data foundation for the subsequent construction of differentiated state transition maps.
[0111] S3.5: Based on the set of spatiotemporal fingerprint vectors of parking lots with typical operation mode labels, construct a bidirectional index mapping table, establish the association relationship between the typical operation mode identifier and the storage address of all spatiotemporal fingerprint vectors of parking lots under the corresponding category, and generate a mapping association library between typical operation modes and parking lot spatiotemporal fingerprint vectors to support fast pattern matching queries in real-time transaction scenarios.
[0112] Obtain a set of spatiotemporal fingerprint vectors for categorized parking lots labeled with typical operating models, which will serve as the input data source for constructing a bidirectional index mapping table. This set contains low-dimensional dense feature vectors for each historical time period and their respective cluster category identifiers.
[0113] A hash index is constructed on the spatiotemporal fingerprint vector set of classified parking lots. An independent storage bucket address is assigned to each unique typical operation mode identifier, and a physical mapping skeleton from the mode identifier to the vector list is established.
[0114] Iterate through each category vector in the set, read the typical operating mode label it carries, and append the memory pointer or storage offset of the vector to the storage bucket list of the corresponding mode identifier to achieve the association and binding of vector and mode.
[0115] For each pattern identifier, a locality optimization sort is performed on the vector list. The vector pointers are rearranged according to the timestamp sequence to ensure that the historical states of the same pattern are temporally continuous in the storage space, thereby improving the cache hit rate.
[0116] Generate a bidirectional index header file containing pattern identifiers, vector counts, and metadata of the starting storage address. The forward index supports quick retrieval of all associated vectors from the pattern ID, while the reverse index supports tracing back to the pattern prototype to which a vector belongs from its ID.
[0117] The completed bidirectional index mapping table is serialized and persistently stored in a high-speed cache database, forming a mapping association library between typical operating models and parking lot spatiotemporal fingerprint vectors, which can be directly called by the real-time transaction matching module.
[0118] It should be noted that the bidirectional index mapping table is a specific implementation of mapping association, used to support the rapid retrieval of typical operating modes based on the spatiotemporal fingerprint vector of parking lots in real-time transaction scenarios.
[0119] Through the bidirectional index construction and persistence process described above, the discrete classification results generated in the previous step are transformed into a structured mapping association library with O(1) query complexity, achieving the expected technical effect of millisecond-level pattern matching and threshold extraction in real-time transaction scenarios.
[0120] For example, the system collects 10,080 spatiotemporal fingerprint vectors at a 15-minute granularity from a parking lot of a large commercial center over a week. After S3.4 clustering, these vectors are divided into five typical operating modes. When constructing the bidirectional index, a separate storage area is allocated for the "morning peak entry surge" mode (ID: Mode01), which contains 1,200 vectors. The system stores the storage addresses of these 1,200 vectors in the index linked list of Mode01 in chronological order. When a real-time transaction generates the current fingerprint vector and matches Mode01, the system directly locates the Mode01 storage area through the index head, without requiring a full scan. Actual testing shows that compared to linear search, the pattern matching query time based on the bidirectional index is reduced from an average of 15ms to 0.8ms, significantly improving the real-time response capability of dynamic threshold generation and ensuring low-latency characteristics for seamless payment judgment during peak traffic periods.
[0121] like Figure 3 As shown, step S4: For each typical operating mode, using key state nodes in the transaction lifecycle as vertices and the P90 quantile of the measured time consumption distribution between states as edge weights, construct a state transition graph representing the evolution law of transaction states under this mode. Specifically, this includes: S4.1: Based on the preset typical operation mode classification results, semantic mapping processing is performed on discrete business actions within the transaction lifecycle to generate a standard set of state nodes including license plate recognition completion node, billing initiation node, payment request issuance node, payment result return node, and barrier lifting instruction issuance node, thus establishing the vertex basis of the state transition graph.
[0122] The system receives the set of spatiotemporal fingerprint vectors of categorized parking lots labeled with typical operating modes from the output of step S3, which serves as the contextual constraint for constructing the state transition graph. It then extracts all historical transaction records belonging to the same typical operating mode category, forming a subset of the original business action logs for that specific operating scenario.
[0123] Semantic parsing is performed on a subset of the original business action logs to identify discrete event types such as license plate recognition, billing initiation, payment requests, result returns, and gate lifting commands. A mapping dictionary is established between discrete event types and standard state node definitions, converting unstructured log event identifiers into standardized state node codes. Based on the logical sequence of the contactless payment business process, the license plate recognition completion node is defined as the starting vertex, the gate lifting command issuance node as the ending vertex, and the billing initiation, payment request issuance, and payment result return nodes are arranged sequentially in between. The mapped state node sequence is verified to conform to the preset directed acyclic graph topology, and abnormal transaction records with logical loops or missing nodes are removed. An ordered set containing five standard state vertices is generated, establishing the node infrastructure of the state transition graph.
[0124] It should be noted that the key status nodes in the lifecycle of a contactless payment transaction include, in sequence, the license plate recognition completion node, the billing initiation node, the payment request issuance node, the payment result return node, and the barrier lifting instruction issuance node.
[0125] By using semantic mapping and topology verification, the historical transaction data from the previous step is transformed into a standardized set of state nodes, enabling a unified representation of key nodes in the transaction lifecycle and providing a consistent vertex index benchmark for subsequent calculations of time distribution between states.
[0126] For example, for a typical operating mode labeled "morning peak one-way vehicle entry surge," 50,000 historical transaction records generated in the past 7 days under this mode are extracted. The event codes in the logs are parsed, mapping Event_ID 101 to the "License Plate Recognition Completed" node, Event_ID 205 to the "Billing Initiated" node, Event_ID 309 to the "Payment Request Issued" node, Event_ID 402 to the "Payment Result Returned" node, and Event_ID 501 to the "Gate Lifting Command Issued" node. Each transaction record is checked to ensure it completely contains all five nodes and that the timestamps monotonically increase. 320 abnormal records lacking the "Payment Result Returned" node are filtered out. Finally, a standard state node set containing 49,680 valid samples is generated. Each sample consists of five state vertices arranged in chronological order, ensuring sample consistency and logical correctness in subsequent P90 quantile calculations.
[0127] S4.2: Using historical transaction records belonging to the current typical operating mode, clean and aggregate the actual dwell time data between any two adjacent state nodes in the standard state node set to generate an original time series sample set that reflects the time consumption of specific state transitions under this mode.
[0128] From the pre-built mapping association library of typical operating models and parking lot spatiotemporal fingerprint vectors, retrieve and extract all historical transaction records marked as the current target typical operating model, as the basic data source to be processed.
[0129] Perform integrity checks on the extracted historical transaction records, and remove abnormal dirty data that includes missing timestamps of key status nodes, reversed status sequence logic, or invalid payment channel identifiers to ensure the business logic consistency of the sample data.
[0130] For the cleaned and valid transaction records, the time difference between any two adjacent state nodes is calculated according to the order defined in the standard state node set, to obtain the raw data of the actual residence time of a single transaction in a specific state stage.
[0131] An outlier detection algorithm based on interquartile range is used to filter noise from the raw data of actual dwell time. Upper and lower boundary thresholds are set to remove non-representative extreme data caused by sensor failure or extreme network jitter.
[0132] The filtered dwell time data is grouped and aggregated according to the adjacent state node pairs to form multiple independent subsets of state transition time, and each subset corresponds to a directed edge in the graph.
[0133] Through the above data cleaning and aggregation methods, the discrete transaction records under the typical operating model determined in the previous step are transformed into a structured, high-confidence original time-series sample set, achieving the expected technical effect of providing a clean data foundation for subsequent P90 quantile statistics.
[0134] For example, targeting the typical operating mode of "one-way vehicle entry during morning rush hour," the system extracts 5,000 valid transaction records under this mode label from the historical database. First, 12 records with logical errors where the "payment result return" time is earlier than the "payment request issuance time" are removed. Next, the time difference between "license plate recognition completion" and "billing initiation" is calculated, yielding 5,000 raw time data points. Using the interquartile range method, the first quartile Q1 is calculated to be 200ms, and the third quartile Q3 to be 450ms. A lower limit is set at Q1 - 1.5 * (Q3 - Q1) = -175ms (set to 0), and an upper limit at Q3 + 1.5 * (Q3 - Q1) = 825ms. 35 extreme long-tail data points exceeding 825ms are removed. Finally, a subset of "recognition-billing" state transition times containing 4,953 data points is aggregated. This subset accurately reflects the normal time distribution characteristics of this stage during peak hours, significantly improving the robustness of subsequent threshold calculations.
[0135] S4.3: Perform percentile statistical distribution calculation based on the original time series sample set, and use the P90 quantile value algorithm to remove long-tail abnormal interference data to generate a baseline state dwell tolerance window value that represents the safe upper limit of the transition time between states under the current typical operation mode.
[0136] It receives the original time-series sample set of actual dwell time between adjacent state nodes in historical transaction records belonging to the current typical operating mode, and uses it as the input data source for percentile statistical distribution calculation.
[0137] Perform data cleaning on the original time series sample set to remove null values, negative values, and abnormal extreme values that exceed physical limits caused by sensor failure or network interruption, and generate a sample set of effective dwell time.
[0138] The values in the effective dwell time sample set are sorted in ascending order from smallest to largest to construct an ordered duration sequence, which provides the basic data structure for subsequent quantile localization.
[0139] Calculate the cumulative probability distribution of each sample point in the ordered time sequence, and determine the index position of the 90th percentile in the sequence. This position corresponds to the critical sample where the cumulative frequency reaches 90%.
[0140] Linear interpolation is used to handle non-integer index cases, and the P90 quantile value is accurately calculated. The baseline state dwell tolerance window value is determined by the following formula: in, This refers to the P90 quantile value, which is the baseline state dwell tolerance window value. This is the integer part index of the 90th percentile. For the decimal part, and These are the th elements in the ordered sequence. and the Each sample value.
[0141] The P90 quantile represents the maximum time consumed by 90% of normal transactions flowing between two adjacent state nodes under the current typical operating model, effectively eliminating the interference of long-tail abnormal data.
[0142] Through the above percentile statistical distribution calculation and P90 quantile value algorithm processing, the original time series sample set of the previous step is transformed into the benchmark state dwell tolerance window value that represents the safe upper limit of the transition time between states under the current typical operation mode. This realizes the quantitative definition of normal time fluctuations in the dynamic trading environment and provides accurate weight basis for constructing a highly robust state transition map.
[0143] For example, under the typical operation mode of "one-way vehicle entry during morning rush hour", 1000 historical valid dwell time data points between the "payment request sent" and "payment result returned" nodes are extracted. After ascending sorting, the 900th sample value is 3.2 seconds, and the 901st sample value is 3.3 seconds. According to the formula, k=900, d=0, then the P90 quantile T=3.2+(0)×(3.3-3.2)=3.2 seconds. This value serves as the baseline tolerance window for this state transition under this mode, significantly improving the targeting of anomaly identification and avoiding response lag caused by a lenient threshold during off-peak periods.
[0144] S4.4: Based on the logical order of the standard state node set and the baseline state dwell tolerance window value, perform a directed weighted graph topology construction operation, using state nodes as vertices and mapping the baseline state dwell tolerance window value as edge weights to generate a complete state transition graph that represents the evolution law of transaction states under this mode.
[0145] Obtain a set of standard state nodes belonging to the current typical operating mode and their corresponding baseline state dwell tolerance window values as the initial data source for constructing a directed weighted graph. Sort the elements in the standard state node set topologically according to the logical chronological order of the transaction lifecycle, establishing a unidirectional flow path from license plate recognition completion to the issuance of the barrier lifting command. Initialize an empty directed graph data structure, instantiating each sorted standard state node as a vertex object in the graph and assigning it a unique node identifier. Traverse the sorted node sequence, extracting the baseline state dwell tolerance window value calculated in the previous steps for each pair of adjacent predecessor and successor nodes. Map this tolerance window value to the weight attribute of the directed edge connecting the predecessor node to the successor node, forming an edge object representing time constraints. Check for the existence of branch or parallel processing nodes; if so, define multiple outgoing edges according to business logic and assign corresponding tolerance window weights to each. Assemble all generated vertex objects and weighted directed edge objects into a complete graph structure data model. Verify the connectivity of this graph structure to ensure that there is at least one reachable path from the starting node to the ending node and that there are no isolated nodes. Through the above-mentioned directed weighted graph topology construction operation, discrete state nodes and quantified time tolerance thresholds are transformed into a structured and traversable state transition graph, realizing digital modeling of the time sequence rules of the transaction process under a specific operating model, and providing a standardized data foundation for subsequent real-time matching and dynamic threshold extraction.
[0146] For example, in a one-way vehicle entry pattern during morning rush hour, the standard set of state nodes includes A (license plate recognition), B (billing initiation), C (payment request), D (result return), and E (gate opening). The system first creates 5 vertices V. A To V E Based on historical data, the time taken from A to B (P90) is 2 seconds, from B to C is 1 second, from C to D is 3 seconds, and from D to E is 0.5 seconds. The system constructs a directed edge E. AB The weight is set to 2; E BC The weight is set to 1; E CD The weight is set to 3; E DE The weight is set to 0.5. In the final generated state transition graph G=(V,E), the maximum allowed dwell time between any nodes is directly defined by the edge weight. When a real-time transaction is at node C, the system can directly query edge E. CD The weight is set at 3 seconds as the dynamic rollback criterion. The graph structure is clear, and the query complexity is O(1), which significantly improves the response speed of anomaly detection.
[0147] Step S5: Input the current parking lot spatiotemporal fingerprint vector generated by the real-time transaction into the mapping association for matching operations, determine the target typical operating mode to which the current transaction belongs, and extract the subsequent node tolerance window of the current state node from the state transition graph corresponding to the target typical operating mode. Specifically, this includes: S5.1: Obtain the spatiotemporal fingerprint vector of the current parking lot triggered by the real-time transaction and the mapping association between the typical operation mode constructed in the previous steps and the spatiotemporal fingerprint vector of the parking lot. Use the nearest neighbor search algorithm to calculate the similarity of the current parking lot spatiotemporal fingerprint vector in the mapping association to determine the target typical operation mode identifier with the smallest distance to the current parking lot spatiotemporal fingerprint vector.
[0148] Sub-step S5.1 aims to quickly locate the operational scenario to which the current transaction belongs in a pre-built typical operation mode mapping library based on the real-time generated parking lot spatiotemporal fingerprint vector, providing contextual basis for subsequent extraction of dynamic rollback thresholds. This step receives the real-time parking lot spatiotemporal fingerprint vector generated by S2 and the mapping association library between typical operation modes and fingerprint vectors constructed by S3 as input data.
[0149] Perform a dimension consistency check on the input real-time parking lot spatiotemporal fingerprint vector to ensure that its feature dimension is completely matched with the dimension of the historical cluster center vector stored in the mapping association library, and prevent calculation errors caused by data truncation or expansion.
[0150] Extract the prototype vector set of all identified typical operating modes from the mapping association library. This set contains standard feature representations of several modes such as morning peak, midday low density, and nighttime ETC dominance, which serve as the benchmark reference system for similarity calculation.
[0151] The Euclidean distance metric algorithm is used to calculate the geometric distance between the real-time spatiotemporal fingerprint vector and the prototype vector of each typical operation mode, and to quantify the degree of difference between the current real-time status and each historical typical mode in three dimensions: spatial accessibility, resource saturation and channel carrying capacity.
[0152] Iterate through all typical operating mode prototype vectors, repeat the above distance calculation, generate a candidate list containing distance values for each mode, and comprehensively evaluate the proximity of the current real-time state to all known modes.
[0153] Perform a minimum value search operation on the generated candidate distance list to identify the distance item with the smallest value. The typical operation mode corresponding to this item is the operation scenario most similar to the current real-time environment.
[0154] Extract the typical operating mode identifier associated with the minimum distance item. This identifier uniquely points to a specific state transition graph and serves as the routing index for subsequent threshold extraction.
[0155] By using nearest neighbor search and Euclidean distance minimization, the multidimensional real-time state data from the previous step is transformed into a definite target typical operation mode identifier, achieving a precise mapping from continuous state space to discrete operation scenario categories, and ensuring the scenario adaptability of subsequent threshold extraction.
[0156] For example, assume the spatial fingerprint vector of a parking lot has a dimension n of 3, representing the spatial accessibility index, resource saturation index, and channel carrying capacity index, respectively. The fingerprint vector collected in real time is [0.8, 0.6, 0.9]. The mapping library contains two typical pattern prototypes: Pattern A (morning peak) prototype vector is [0.7, 0.8, 0.7], and Pattern B (nighttime) prototype vector is [0.9, 0.2, 0.95]. Calculate the distance between the real-time vector and Pattern A: D A =sqrt((0.8-0.7) 2 +(0.6-0.8) 2 +(0.9-0.7) 2 = sqrt(0.01 + 0.04 + 0.04) = sqrt(0.09) = 0.3. Calculate the distance between the real-time vector and pattern B: D B =sqrt((0.8-0.9) 2 +(0.6-0.2) 2 +(0.9-0.95) 2 = sqrt(0.01 + 0.16 + 0.0025) = sqrt(0.1725) ≈ 0.415. Comparison reveals D A <D B Therefore, the current transaction is determined to belong to pattern A (morning peak), and the pattern identifier ID_A is output. This process takes less than 2 milliseconds at the edge gateway, significantly improving the real-time performance and accuracy of pattern matching.
[0157] S5.2: Based on the identified typical operating mode identifier of the target, retrieve and load the target state transition graph that uniquely corresponds to the typical operating mode identifier of the target from the pre-stored state transition graph library. The target state transition graph contains a directed weighted graph structure with key state nodes of the transaction life cycle as vertices and edge weights with P90 quantile values.
[0158] The system receives the target typical operation mode identifier output from the preceding step S5.1. This identifier uniquely points to a specific graph structure index in the pre-built state transition graph library. Based on the target typical operation mode identifier, a hash lookup operation is performed in the local memory database of the edge computing node to locate the physical address block storing the corresponding state transition graph data. The serialized directed weighted graph data stream in this address block is read. The data stream contains binary encoded information of the vertex set and edge weight matrix. The read binary encoded information is deserialized and parsed to reconstruct a memory object model containing five key vertices: license plate recognition completion, billing initiation, payment request issuance, payment result return, and gate lifting command issuance. The integrity of the connection relationships between vertices in the reconstructed graph structure is verified to ensure that the directed path from the current state node to the subsequent state node exists and is unbroken. The P90 quantile weight data carried on each directed edge in the graph is extracted. This data represents the historical safe upper limit of state transition time under the current operation mode. The reconstructed target state transition graph is loaded into the read-only cache of the real-time transaction monitoring context, establishing a reference association between the current transaction instance and the graph structure. Through the above retrieval and loading processes, the abstract pattern identifier is transformed into a specific, traversable state evolution logic structure, thereby achieving low-latency scenario-based threshold query benchmark preparation.
[0159] For example, the target typical operating mode is identified as Mode_Evening_Peak, and the system calculates the index value 0x3A2F using a hash algorithm. A key-value pair is matched in the local Redis cluster, and 4KB of Protobuf serialized data is retrieved. After deserialization, a directed graph object containing 5 vertices and 4 edges is generated. The edge weight from "payment request issued" to "payment result returned" is 2500ms, and the edge weight from "payment result returned" to "lever command issued" is 800ms. The system verifies that the in-degree and out-degree of all vertices conform to the preset topological constraints, confirming the graph's integrity. This graph object is loaded into the L1 cache for subsequent S5.3 steps for node location and weight extraction, with the response time controlled within 2ms, significantly improving real-time matching efficiency.
[0160] S5.3: Read the current transaction state node information of the real-time transaction, locate the current state node vertex that matches the transaction state node information in the loaded target state transition graph, and traverse the target state transition graph to identify the directed connection edges from the current state node vertex to the next key state node vertex.
[0161] It receives the semantic identifier of the current state node in the real-time transaction stream and the loaded target state transition graph data structure. The graph contains a directed weighted graph with key business nodes as vertices and P90 quantile time as edge weights.
[0162] Perform hash mapping or string exact match retrieval on the state identifier of the real-time transaction, locate the unique corresponding current state node object in the vertex set of the target state transition graph, and obtain the internal index address of the node in the graph structure.
[0163] Based on the index of the current state node, traverse the adjacency list or outgoing edge list of the graph and filter the set of all directed edges that start from the current node and point to subsequent potential state nodes.
[0164] Based on the business logic constraints of the transaction lifecycle, the selected directed connection edges are validated for legality. Redundant edges pointing to non-sequential nodes or invalid termination states are removed, and the only valid outgoing edge that conforms to the normal flow path is retained.
[0165] Extract the weight data carried on the effective outgoing edge. This data represents the historical P90 quantile time baseline value for the transition from the current state to the next critical state under the current typical operating mode.
[0166] By using graph topology traversal and edge weight extraction, the operation mode and real-time status determined in the previous step are transformed into specific tolerance window base values for subsequent nodes, thereby achieving accurate positioning and acquisition of dynamic threshold parameters.
[0167] S5.4: Extract the P90 quantile weight data carried on the directed connection edge as the basic time consumption benchmark, and perform linear expansion calculation on the basic time consumption benchmark in combination with the preset safety redundancy coefficient to generate the subsequent node tolerance window value representing the maximum allowed dwell time in the current scenario.
[0168] From the target state transition graph, the directed connection edges pointing from the current state node to the next critical state node are extracted. The P90 quantile weight data carried on these edges are read and parsed into a basic time-consuming benchmark value. This basic time-consuming benchmark represents the maximum time limit required for most normal transactions to complete state transitions under the current typical operating model, and serves as the initial reference point for dynamic threshold calculation.
[0169] Obtain a preset security redundancy coefficient, which is used to compensate for non-business delays caused by network fluctuations, instantaneous congestion of payment gateways, or sensor signal jitter, to ensure that the rollback triggering mechanism has sufficient fault tolerance and avoid misjudgment due to minor disturbances.
[0170] A linear expansion algorithm is used to weight the baseline latency and the safety redundancy coefficient to construct a calculation model for the dynamic rollback trigger threshold. The tolerance window value for subsequent nodes is calculated using the following formula: in, This is the tolerance window value for subsequent nodes, i.e., the dynamic rollback trigger threshold. The P90 quantile value is the basic time consumption benchmark extracted from the state transition graph. The preset safety redundancy coefficient typically ranges from 0.1 to 0.3, with the specific value dynamically configured based on the stability of the parking lot network environment.
[0171] The calculated tolerance window value for subsequent nodes is output to the anomaly detection module. This value serves as a benchmark for the maximum allowed duration of this real-time transaction to reside on the current state node. If the actual residency time exceeds this benchmark, the transaction is identified as an anomaly and a rollback process is triggered.
[0172] It should be noted that the subsequent node tolerance window value is the result of an expansion calculation after applying a safety redundancy coefficient to the base latency benchmark. The baseline state dwell tolerance window value represents the upper limit of normal latency in a historical statistical sense. The upper limit of the subsequent node tolerance window value generated after expansion with the safety redundancy coefficient serves as the dynamic rollback trigger threshold for this transaction.
[0173] By using a linear expansion calculation method, the static statistical benchmark extracted in the previous step is transformed into a dynamic time threshold with scenario adaptability, which realizes accurate matching of transaction time differences under different operating modes, significantly reduces the false alarm rate and false negative rate caused by fixed thresholds, and improves the robustness of the contactless payment system.
[0174] For example, under the typical operating mode of "one-way vehicle entry during morning rush hour", the system retrieves the P90 quantile value T from the state transition graph from the state transition graph of "payment request issued" to "payment result returned". P90 The default timeout is 2500 milliseconds. A preset safety redundancy coefficient α is configured to 0.2 to handle high load fluctuations in payment channels during peak periods. Substituting into the formula, T = 2500 × (1 + 0.2) = 3000 milliseconds. The system generates a 3000-millisecond tolerance window for subsequent nodes. If a real-time transaction remains in this state for more than 3000 milliseconds, a rollback is immediately triggered; if it is completed within 2800 milliseconds, it is considered normal. Compared to the traditional fixed global threshold of 3500 milliseconds, this method improves the anomaly detection sensitivity by approximately 14% during peak periods, effectively reducing user waiting anxiety and lane congestion risks.
[0175] Step S6: Set the upper limit of the tolerance window for subsequent nodes as the dynamic rollback trigger threshold for this transaction, and determine whether the residence time of the real-time transaction on the current state node exceeds the dynamic rollback trigger threshold. Specifically, this includes: S6.1: Perform a safety redundancy coefficient weighted calculation on the tolerance window values of subsequent nodes extracted in the previous steps to generate a dynamic rollback trigger threshold with anti-jitter capability, which serves as a benchmark time scale for determining whether a transaction is abnormal.
[0176] The dynamic rollback trigger threshold calculated in the preceding step S5.4 is received. This threshold is used as the benchmark time scale for judging this transaction. Precision alignment processing is performed on the threshold to eliminate the small errors caused by floating-point arithmetic. The processed dynamic rollback trigger threshold is written into the real-time transaction context memory area as the sole benchmark for comparing the residence time of this transaction.
[0177] By using a weighted calculation method based on safety redundancy coefficients, the static statistical benchmark from the previous step is transformed into a dynamic judgment index that adapts to real-time environmental fluctuations, thereby achieving the expected technical effect of balancing stability and sensitivity in the anomaly identification mechanism.
[0178] S6.2: Perform difference calculation processing based on the entry timestamp of the state node in the real-time transaction stream and the current system clock signal to generate real-time dwell time data that represents the actual time consumed by the transaction in the current state node.
[0179] S6.3: The real-time dwell time data is compared with the dynamic rollback trigger threshold using a comparison logic circuit to generate a Boolean exception trigger flag containing the timeout determination result.
[0180] The system receives real-time dwell time data and dynamic rollback trigger threshold generated in the preceding steps, which serve as the input signal source for the comparison logic circuit.
[0181] The real-time dwell time data is synchronized in the clock domain to eliminate timing deviations caused by sensor sampling jitter and ensure the consistency of the time base.
[0182] The synchronized real-time dwell time data is loaded into the first input of the comparator, and the dynamic rollback trigger threshold is loaded into the second input of the comparator.
[0183] Perform hardware-level numerical comparison calculations to determine whether the real-time dwell time is strictly greater than the dynamic rollback trigger threshold.
[0184] If the determination result is true, the exception trigger flag register is set, generating a high-level Boolean exception trigger flag.
[0185] If the determination result is false, the abnormal trigger flag register is reset, and a low-level Boolean normal status flag is generated.
[0186] By comparing the size of the logic circuits, the time lag is quantified into a Boolean-type exception trigger flag, enabling millisecond-level deterministic determination of transaction anomalies.
[0187] For example, in the morning peak one-way vehicle entry mode, the dynamic rollback trigger threshold is set to 3000 milliseconds. Real-time monitoring shows that a transaction's dwell time at the payment request sending node is 3250 milliseconds. The comparison circuit performs a logical judgment of 3250 > 3000, and the result is true. The system immediately sets the exception trigger flag to 1 (True). This flag directly triggers the branch route of S6.4, initiating the rollback instruction. Compared to traditional software polling detection, the hardware comparison logic reduces the judgment latency to the microsecond level, significantly improving the exception response speed in high-concurrency scenarios and effectively avoiding vehicle queues caused by payment channel congestion.
[0188] S6.4: Execute branch routing selection processing based on the status value of the Boolean exception trigger flag. If the flag indicates a timeout, generate an exception transaction rollback instruction start signal. If the flag indicates a normal status, generate a control hold signal to maintain the current transaction status and continue monitoring.
[0189] Receive the Boolean exception trigger flag generated in the preceding steps. This flag is used as a logical criterion for branch routing selection and input to the transaction status monitoring engine.
[0190] Perform a logic level parsing operation on the Boolean exception trigger flag to distinguish between the timeout exception state represented by a high level and the normal operation state represented by a low level.
[0191] If the parsing result is high, the system instantiates an abnormal transaction rollback instruction start signal object, encapsulating the current transaction's unique identifier and timeout timestamp.
[0192] Inject the abnormal transaction rollback instruction start signal into the payment gateway's reverse interface queue to trigger an atomic revocation process to freeze or return the funds occupied.
[0193] Simultaneously, a forced reset command is sent to the barrier control unit to release the physical lock of the lane and prevent vehicles from being stuck and causing congestion.
[0194] If the parsing result is low, the system generates a control hold signal to maintain the current transaction status and continue monitoring.
[0195] Write the control hold signal to the local status register, reset the watchdog timer count, and continue monitoring the dwell time of the next status node.
[0196] By using branch routing selection processing, Boolean flags are transformed into specific business execution instructions or monitoring and holding actions, enabling immediate blocking of abnormal transactions and seamless passage of normal transactions.
[0197] For example, when the Boolean exception trigger flag is 1, the system determines that the transaction has remained in the "Payment Result Return" node for more than the dynamic threshold of 5000ms. It immediately generates a rollback start signal containing the transaction ID "TXN_20231027_001", calls the Alipay reverse interface to revoke the pre-authorization, and simultaneously issues a barrier lifting command to release the lane. When the flag is 0, a hold signal is generated, and the system continues to monitor the "Barrier Lifting Command Issuance" node to ensure a smooth process. This mechanism significantly reduces the false positive rate and improves traffic efficiency during peak hours.
[0198] Step S7: If the judgment result indicates that the real-time transaction dwell time exceeds the dynamic rollback trigger threshold, then execute the abnormal transaction rollback instruction to cancel the current payment request and record the rollback log; otherwise, maintain the current transaction status and continue monitoring until the transaction is completed or times out. Specifically, this includes: S7.1: The judgment result of the real-time transaction dwell time exceeding the dynamic rollback trigger threshold is parsed and processed to generate an abnormal transaction trigger signal containing the current transaction's unique identifier, the typical operating mode of the target, and the timeout deviation, which serves as the initial input condition for starting the rollback process.
[0199] Receive the Boolean exception trigger flag and real-time transaction context data output by S6.4, including the transaction unique identifier, the current status node type, and the entry timestamp.
[0200] The logic level of the Boolean exception trigger flag is detected. When the flag is in a high-level active state, the exception parsing engine is activated and the current pending transaction session object is locked.
[0201] Extract a globally unique transaction serial number from the transaction session object. This serial number serves as the primary key index for subsequent rollback operations and log association, ensuring the atomicity and traceability of transaction processing.
[0202] Read the target typical operation mode identifier determined in the preceding step S5.1. This identifier represents the parking lot spatiotemporal fingerprint clustering category when an anomaly is triggered, such as the morning peak one-way vehicle entry mode or the nighttime ETC-dominated mode.
[0203] Obtain the real-time dwell time data calculated by S6.2 and the dynamic rollback trigger threshold data generated by S6.1, and perform a subtraction operation to calculate the timeout deviation.
[0204] The unique identifier of the transaction, the identifier of the target typical operating mode, and the calculated timeout deviation are encapsulated into a structured data object.
[0205] Add timestamp tags and source module identifiers to the structured data object to generate standardized abnormal transaction trigger signals.
[0206] Through the above parsing and encapsulation process, the Boolean judgment result of the previous step is transformed into an abnormal transaction trigger signal containing multi-dimensional context information, realizing a semantic upgrade from simple status marking to complex business instructions, and providing complete data support for the subsequent accurate execution of differentiated rollback strategies.
[0207] For example, the system detects that an ETC transaction has remained at the payment request initiation node for longer than a threshold. The transaction ID is extracted as "TXN_20231027_0098", identifying it as a holiday multi-entry concurrent transaction. The real-time dwell time is 4500ms, and the dynamic threshold is 3000ms. Substituting these values into the formula, the timeout deviation Δt = 4500 is calculated. 3000 = 1500ms. An abnormal transaction trigger signal containing "TXN_20231027_0098", a holiday multi-entry concurrent type identifier, and a 1500ms deviation is generated, which significantly improves the scenario adaptation accuracy of rollback instructions.
[0208] S7.2: Based on the abnormal transaction trigger signal, call the payment channel reverse interface to perform an atomic reversal operation to roll back the payment request in the pending state to the uninitiated state and generate a payment status rollback confirmation code to ensure the synchronous restoration of fund flow and control flow.
[0209] The abnormal transaction trigger signal is analyzed, and the unique identifier of the current transaction, the target typical operating mode identifier, and the payment channel type parameter are extracted to construct the basic context environment for the reverse revocation request.
[0210] Based on the payment channel type parameter, the corresponding payment gateway reverse API address and encryption signature key are retrieved from the pre-configured interface adaptation layer to establish a secure channel communication link with the third-party payment platform.
[0211] Assemble atomic revocation request messages, map the transaction's unique identifier to the original order number from the upstream channel, and attach the current system timestamp as an idempotency check key to prevent confusion in fund status caused by repeated revocations.
[0212] The HMAC-SHA256 algorithm is used to perform digital signature calculation on the request message to ensure the integrity and non-repudiation of data transmission, and the signature value is embedded in the Authorization field of the HTTP request header.
[0213] Send a POST request to the payment gateway and wait for the server response. If no ACK confirmation is received within the preset timeout period, initiate the exponential backoff retry mechanism and perform a maximum of three retransmission operations.
[0214] Receive the processing result message returned by the payment channel, parse the status code field, and if the status code indicates "reversal successful", extract the transaction rollback serial number as the payment status rollback confirmation code.
[0215] If the status code indicates "processing" or "unknown", the query interface is called to poll the final status of the transaction until a definite final status result is obtained, ensuring the consistency between the local status and the channel-side status.
[0216] The payment status rollback confirmation code is associated with the local transaction record, the transaction status field in the database is updated to "rollback", and the frozen funds are marked as releaseable.
[0217] Through the above chain processing, the abnormal judgment result of the previous step is transformed into a legally valid payment cancellation voucher and a standardized payment status rollback confirmation code, so as to achieve precise synchronization and restoration of fund flow and control flow, and eliminate the risk of accounting inconsistency caused by network jitter or channel delay.
[0218] For example, for abnormal transactions via WeChat Pay, the transaction ID is extracted as "TXN_20231027_001", and the channel type is "WECHAT_PAY". The system retrieves the WeChat reverse engineering interface address as "https: / / api.mch.weixin.qq.com / secapi / pay / reverse". A JSON message is assembled: {"out_trade_no":"TXN_20231027_001","nonce_str":"rand123","sign_type":"HMAC-SHA256"}. The message is sorted lexicographically using the merchant key K, and the concatenated string is then subjected to HMAC-SHA256 computation to generate the signature Sig_Hex. An HTTPS POST request is sent with a timeout of 3 seconds. A response is received: {"return_code":"SUCCESS","result_code":"SUCCESS","revise_id":"REV_998877"}. The payment status rollback confirmation code was parsed and found to be "REV_998877". The local database was updated, changing the transaction status from "PENDING" to "ROLLED_BACK", and the rollback confirmation code was recorded. This process ensures that the entire process from anomaly detection to fund unfreezing is completed within 300 milliseconds, significantly improving lane passage efficiency and accounting accuracy in unattended scenarios.
[0219] S7.3: Use the payment status rollback confirmation code to send a forced reset command to the parking lot gate control unit to release the lane access permission locked due to waiting for payment results and generate a lane resource release completion flag to prevent vehicle congestion caused by payment abnormalities.
[0220] Receive the payment status rollback confirmation code generated in the previous steps. This confirmation code serves as the unique identity credential and instruction verification key for triggering the gate control unit reset operation.
[0221] The payment status rollback confirmation code is encapsulated using a protocol to construct an IoT control message containing lane ID, device MAC address, and emergency reset command type, ensuring accurate routing and low-latency transmission of commands within the local area network.
[0222] The encapsulated control message is sent to the parking lot edge gateway via the TCP / IP communication protocol. The edge gateway performs CRC verification on the message integrity. Once the verification is successful, it is immediately forwarded to the PLC logic controller of the target lane.
[0223] The PLC logic controller parses the received reset command, identifies the emergency release signal, cuts off the holding current of the barrier gate motor, and activates the mechanical spring reset mechanism, forcibly driving the gate arm to quickly rise from the locked state to the vertical passage position.
[0224] The system monitors the level changes of the barrier gate limit sensor. When the barrier gate reaches its highest limit signal, a lane resource release completion flag is generated, indicating that the physical obstacle has been completely cleared.
[0225] Through the above chain processing, the abstract payment rollback confirmation code is transformed into a specific physical device action, realizing the immediate release of lane access permissions, effectively preventing vehicle congestion caused by payment anomalies, and ensuring the traffic efficiency of parking lot entrances and exits.
[0226] For example, during the morning rush hour, a transaction in an ETC lane timed out due to network fluctuations, triggering a rollback. The system generates a confirmation code "RB_20231027_0830_001", encapsulated in a JSON format message {"cmd":"RESET","lane":"A01","code":"RB_20231027_0830_001"}. The edge gateway completes the verification within 5ms and forwards it to the PLC. Upon receiving the instruction, the PLC immediately disconnects the barrier gate motor holding circuit, and the gate arm fully lifts within 1.2 seconds under the action of the spring. The limit sensor detects a high-level signal, and the system sets the "Lane_A01_Free" flag. The entire process takes less than 1.5 seconds, significantly better than the minute-level response of traditional manual intervention, ensuring that vehicles behind can pass without being notified and avoiding queue congestion.
[0227] S7.4: Construct a structured rollback event object based on the abnormal transaction trigger signal and the lane resource release completion flag, and generate standardized abnormal transaction rollback log entries by integrating the current parking lot spatiotemporal fingerprint vector, state transition graph path information and rollback execution timestamp.
[0228] The abnormal transaction trigger signal generated by S7.1 and the lane resource release completion flag output by S7.3 are received as the initial input data source for constructing the structured rollback event object.
[0229] Parse the payload field in the abnormal transaction trigger signal to extract the unique identifier (UUID) of the current transaction, the typical operating mode ID of the target, and the deviation value between the measured dwell time and the dynamic threshold.
[0230] Read the system's global clock counter to obtain the precise timestamp of the moment the rollback instruction was executed, with precision controlled at the millisecond level, to ensure absolute consistency of log timing.
[0231] Retrieve the parking lot spatiotemporal fingerprint vector bound to the current target typical operation mode ID from the memory cache. This vector represents the three-dimensional status of spatial accessibility, resource saturation, and channel carrying capacity when an anomaly is triggered.
[0232] Query the state transition graph database to extract the specific state transition path information that caused this timeout, including the starting state node, the ending state node, and the corresponding P90 quantile weight value.
[0233] The extracted unique transaction identifier, operating mode ID, spatiotemporal fingerprint vector, state transition path, timestamp, and deviation are serialized and assembled according to a predefined JSON Schema structure.
[0234] Perform integrity checks on the assembled data to ensure that all required fields are not empty and that the data types conform to the specifications, and generate standardized abnormal transaction rollback log entries.
[0235] Through the above-mentioned structured encapsulation processing method, the scattered anomaly triggering context information is transformed into standardized log data with full-link traceability, thereby achieving the expected technical effect of accurate reproduction of anomaly scenarios and auditing.
[0236] For example, the abnormal transaction trigger signal includes a transaction ID of TXN_20231027_0098, an operating mode ID of MODE_EVE_PEAK, and a timeout deviation of 1.2 seconds. The system reads the timestamp as 1698394500123. The retrieved spatiotemporal fingerprint vector is [0.85, 0.42, 0.91], corresponding to high spatial congestion, medium resource consumption, and high channel load, respectively. The status transition path shows that the time taken from "payment request issued" to "payment result returned" exceeds the threshold, with a P90 weight value of 3.5 seconds. The system assembles the above fields into a JSON object: {"txn_id":"TXN_20231027_0098","mode_id":"MODE_EVE_PEAK","fingerprint":[0.85,0.42,0.91],"path":{"from":"pay_req","to":"pay_res","p90_weight":3.5},"timestamp":1698394500123,"deviation":1.2}. After verification, standardized log entries are generated, significantly improving the efficiency and accuracy of subsequent troubleshooting.
[0237] S7.5: Perform a persistent storage write operation on the standardized abnormal transaction rollback log entries to archive them to the abnormal transaction partition of the distributed log database and generate a log write success receipt, thus completing the complete closed-loop record of this abnormal transaction processing.
[0238] For those skilled in the art, various other corresponding changes and modifications can be made based on the technical solutions and concepts described above, and all such changes and modifications should fall within the protection scope of the claims of this invention.
[0239] Unless otherwise defined, the technical or scientific terms used herein shall have the ordinary meaning as understood by one of ordinary skill in the art to which this application pertains. The terms “first,” “second,” “third,” and similar terms used in this patent application specification and claims do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Similarly, the terms “an” or “a” and similar terms do not indicate a quantity limitation, but rather indicate the presence of at least one. The terms “comprising” or “including” and similar terms mean that the element or object preceding “comprising” or “including” encompasses the element or object listed following “comprising” or “including” and its equivalents, and do not exclude other elements or objects. The “multiple” mentioned in the embodiments of this application refers to two or more. A and / or B indicate three possibilities: A; B; and A and B.
[0240] The above description is merely an exemplary embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and such modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for rolling back abnormal transactions in contactless payment for smart parking lots, characterized in that, include: Acquire static geographic topology data and dynamic runtime sequence data of the target parking lot; Based on the fusion encoding process of the static geographic topology data and the dynamic runtime sequence data, a spatiotemporal fingerprint vector of the parking lot is generated, which represents the comprehensive status of the parking lot in the current time period in three dimensions: spatial accessibility, resource saturation and channel carrying capacity. Unsupervised clustering operations are performed on multiple parking lot spatiotemporal fingerprint vectors generated within the historical period to automatically classify several typical operation modes with inherently consistent state evolution patterns. For each of the typical operating modes, a state transition graph is constructed with key state nodes in the transaction lifecycle as vertices and the P90 quantile of the measured time consumption distribution between states as edge weights. The parking lot spatiotemporal fingerprint vector generated by the real-time transaction is input into the mapping association for matching operation to determine the target typical operation mode to which the current transaction belongs, and the subsequent node tolerance window of the current state node is extracted from the state transition graph corresponding to the target typical operation mode. The upper limit of the tolerance window of the subsequent node is set as the dynamic rollback trigger threshold for this transaction, and it is determined whether the dwell time of the real-time transaction in the current state node exceeds the dynamic rollback trigger threshold. If the dwell time exceeds the dynamic rollback trigger threshold, an abnormal transaction rollback instruction is executed to cancel the current payment request and a rollback log is recorded; otherwise, the current transaction status is maintained and monitoring continues until the transaction is completed or timeout occurs.
2. The abnormal transaction rollback method in contactless payment for smart parking lots according to claim 1, characterized in that, The process of fusing and encoding the static geographic topology data and the dynamic runtime sequence data generates a parking lot spatiotemporal fingerprint vector that represents the comprehensive status of the parking lot in the current time period across three dimensions: spatial accessibility, resource saturation, and channel carrying capacity. This includes: The acquired static geographic topology data is subjected to graph structure mapping processing to construct a static topological adjacency matrix that represents the physical spatial constraints of the parking lot. Based on the spatial node index of the static topological adjacency matrix, the dynamic runtime sequence data is subjected to spatiotemporal alignment interpolation to generate a dynamic state temporal tensor with a unified timestamp and spatial node dimension. The values of each dimension in the dynamic state time series tensor are normalized to output a standard normalized state feature sequence that eliminates the difference in dimensions. A fusion operation is performed based on the standard normalized state feature sequence and the static topological adjacency matrix to generate an original high-dimensional fusion feature vector that contains the coupling relationship between spatial reachability, resource saturation and channel carrying capacity. The original high-dimensional fused feature vector is subjected to dimensionality reduction projection processing. Principal component components with a cumulative contribution rate exceeding a preset threshold are extracted and linearly recombined to generate the low-dimensional spatiotemporal fingerprint vector of the parking lot.
3. The abnormal transaction rollback method in contactless payment for smart parking lots according to claim 1, characterized in that, For each of the aforementioned typical operating models, a state transition graph is constructed using key state nodes in the transaction lifecycle as vertices and the P90 quantile of the measured time consumption distribution between states as edge weights, including: Semantic mapping is performed on discrete business actions within the transaction lifecycle to generate a standard set of state nodes containing multiple consecutive state nodes; By using historical transaction records belonging to the current typical operating mode, the dwell time between adjacent state nodes in the standard state node set is statistically calculated to generate the time consumption distribution between the states. Based on the P90 quantile of the dwell time distribution between adjacent state nodes, a baseline state dwell tolerance window value is generated for the safe upper limit of the flow time between each adjacent state node. A directed weighted graph is constructed based on the standard state node set and the baseline state dwell tolerance window value to generate the state transition map.
4. The abnormal transaction rollback method in contactless payment for smart parking lots according to claim 1, characterized in that, The acquisition of static geographic topology data and dynamic runtime sequence data of the target parking lot specifically includes: Acquire parking lot spatial structure parameters, dynamic traffic flow time series indicators, and multi-channel payment performance data. Perform fusion encoding and cleaning on the acquired data, and output the static geographic topology data and the dynamic runtime time series data.
5. A method for rolling back abnormal transactions in contactless payment for smart parking lots according to claim 1, characterized in that, The unsupervised clustering operation on the multiple parking lot spatiotemporal fingerprint vectors generated within the historical period specifically includes: The multiple parking lot spatiotemporal fingerprint vectors generated within the historical period are preprocessed; based on the unsupervised clustering operation, the typical operating modes to which each parking lot spatiotemporal fingerprint vector belongs are automatically classified; and a mapping relationship between the typical operating modes and the parking lot spatiotemporal fingerprint vectors is established based on the classification results.
6. A method for rolling back abnormal transactions in contactless payment for smart parking lots according to claim 5, characterized in that, The automatic classification of the typical operating modes to which each parking lot's spatiotemporal fingerprint vector belongs specifically includes: The clustering results are determined based on the distribution characteristics of the spatiotemporal fingerprint vectors of each parking lot in the data space, and the category classification of each parking lot spatiotemporal fingerprint vector is completed according to the nearest distance principle.
7. A method for rolling back abnormal transactions in contactless payment for smart parking lots according to claim 1, characterized in that, The step of inputting the parking lot spatiotemporal fingerprint vector generated by real-time transactions into the mapping association for matching specifically includes: The current parking lot spatiotemporal fingerprint vector is matched in the mapping association to determine the target typical operation mode; the current state node is located from the state transition graph corresponding to the target typical operation mode and the subsequent node tolerance window pointing to the next state node is read; the upper limit value of the subsequent node tolerance window is used as the dynamic rollback trigger threshold.
8. A method for rolling back abnormal transactions in contactless payment for smart parking lots according to claim 7, characterized in that, The step of using the upper limit of the tolerance window of the subsequent nodes as the dynamic rollback trigger threshold specifically includes: The upper limit of the tolerance window of the subsequent node is used as the basic time consumption benchmark, and the basic time consumption benchmark is extended by combining the preset safety redundancy coefficient. The result of the extended calculation is set as the dynamic rollback trigger threshold.
9. A method for rolling back abnormal transactions in contactless payment for smart parking lots according to claim 1, characterized in that, The determination of the dynamic rollback trigger threshold includes: The P90 quantile value of the directed connection edge from the current state node to the next state node in the state transition graph is used as the basic time consumption benchmark. The basic time consumption benchmark is expanded by combining the preset safety redundancy coefficient, and the calculation result is set as the dynamic rollback trigger threshold.
10. A method for rolling back abnormal transactions in contactless payment for smart parking lots according to claim 1, characterized in that, The execution of the abnormal transaction rollback instruction specifically includes: The payment channel reverse interface is invoked to perform a payment cancellation operation, and a reset command is sent to the gate control unit. After the reset is completed, a lane resource release flag is generated.