A method and system for detecting anomalies in time-series data during highway construction
By constructing feature matrices and using convolutional encoder and decoder to process multi-dimensional time series data of highway construction process, the problem of not being able to share sequence similarity rules in the prior art is solved, and early identification and precise classification of exceptions are achieved.
Patent Information
- Application Number
- CN202311230662.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-22
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2043-09-22
AI Technical Summary
The prior art is difficult to effectively handle abnormal detection in multi-dimensional time series data, especially during highway construction, where similar patterns between different sequences cannot be shared, resulting in difficulty in troubleshooting.
By constructing a feature matrix, multi-dimensional features are extracted using convolutional encoder and decoder, differential values and exception scores are calculated, and exception patterns are identified.
Ability to detect potential hazards in advance, accurately identify short and long-lasting abnormalities, and provide construction safety guidance.
Smart Images

Figure CN117195131B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of time series data anomaly detection, and specifically to a method and system for detecting anomalies in time series data during a highway construction process. Background Art
[0002] Anomaly detection aims to identify unusual patterns in data, and time series anomaly detection has received widespread attention over the past decade. With the advent of low-cost sensors and advances in wireless communication and computing technologies, complex real-time monitoring systems have become ubiquitous in modern engineering construction, providing construction companies with a wealth of raw data. This data can be collected from multiple sensors and formed into multidimensional time series over time. For example, in highway construction, it is now possible to collect data on a variety of construction materials, such as rebar, cement, and lime, in real time. Specifically, rebar data includes tensile tests, cold bending tests, and repeated bending tests; cement data includes mortar strength, initial setting time, final setting time, and fineness; coarse aggregate data includes mortar strength, initial setting time, final setting time, and fineness; and lime data includes available calcium and magnesium content, moisture content, and fineness.
[0003] However, as data becomes longer and more dimensional, anomaly detection can become more challenging. The accumulation of multidimensional time series data presents opportunities for better monitoring of manufacturing systems, but it also increases the requirements for anomaly detection. Early models for time series forecasting were primarily single-sequence linear models, such as ARIMA. These models fit each series separately. Building on ARIMA, optimizations such as introducing nonlinearity and external features have been proposed. However, ARIMA-type models are less efficient when processing large-scale time series. Furthermore, because each series is fitted independently, they cannot share similar patterns across different series, cannot explore the inherent relationships between multiple variables, and cannot detect potential faults and hazards. Summary of the Invention
[0004] The purpose of the embodiments of the present application is to provide a method and system for detecting anomalies in time series data of a highway construction process, which constructs a feature matrix from multivariate time series data, constructs a feature matrix from the collected multidimensional time series data of the highway construction process according to different step lengths, extracts features of each dimension through convolution, and then reconstructs the matrix to compare difference values, thereby mining the potential information of the time series data of the highway construction process and providing guidance for construction safety, thereby solving at least one technical problem involved in the background technology.
[0005] In order to solve the above technical problems, the technical solutions of this application are as follows:
[0006] The present invention provides a method for detecting anomalies in time series data during a highway construction process, comprising the following steps:
[0007] Step S1: Collect the time-series data during the highway construction process;
[0008] Step S2: Set different step sizes according to the time-series data in different dimensions to form feature matrices with different numbers of channels;
[0009] Step S3: Encode the feature matrix using a convolutional encoder;
[0010] Step S4: Use a convolutional decoder to perform reverse reconstruction on the encoded feature matrix to obtain a reconstructed feature matrix;
[0011] Step S5: Calculate the difference value between the original feature matrix and the reconstructed feature matrix;
[0012] Step S6: Calculate the anomaly score at each time point according to the step size selected for the feature matrix and the anomaly difference value;
[0013] Step S7: Calculate whether an anomaly occurs according to the calculated anomaly score and the trained threshold.
[0014] As a preferred improvement of the present application, in step S1, sensors are used to collect the time-series data of the highway construction process.
[0015] As a preferred improvement of the present application, in step S1, the time-series data includes material data and mechanical data.
[0016] As a preferred improvement of the present application, in step S2, the step sizes include 5, 10, 20, and 60. Correspondingly, feature matrices with 4 channels are formed.
[0017] As a preferred improvement of the present application, the setting of different step sizes according to the time-series data in different dimensions to form feature matrices with different numbers of channels includes:
[0018] Slice all the collected time-series data. Each slice is a use case. Within each slice, the data forms feature matrices with different numbers of channels according to different step sizes.
[0019] As a preferred improvement of the present application, in step S4, during the reverse reconstruction process, an attention mechanism is added to extract features to better capture the long-term dependence relationship in the time-series data.
[0020] The present application also provides a time-series data anomaly detection system for highway construction processes for implementing the described method, including:
[0021] A time-series data collection module, which is used to collect the time-series data during the highway construction process;
[0022] A feature matrix formation module, which is used to set different step sizes according to time series data of different dimensions to form feature matrices with different numbers of channels;
[0023] An encoding module, which is used to encode the feature matrix by using a convolutional encoder;
[0024] A reverse reconstruction module, which is used to reversely reconstruct the encoded feature matrix by using a convolutional decoder to obtain a reconstructed feature matrix;
[0025] A difference value calculation module, which is used to calculate the difference value between the original feature matrix and the reconstructed feature matrix;
[0026] An anomaly score calculation module, which is used to calculate the anomaly score at each time point according to the step size selected for the feature matrix and the anomaly difference;
[0027] An anomaly determination module, which is used to calculate whether an anomaly occurs according to the calculated anomaly score and the trained threshold.
[0028] The beneficial effects of this application are as follows:
[0029] 1. Compared with single-dimensional numerical detection, the method of constructing a matrix for multi-dimensional time series data according to different step sizes in this application can explore the potential relationships of numerical values in multiple dimensions and discover more potential dangers earlier.
[0030] 2. By calculating the Mahalanobis distance of variables in different dimensions in this application, the influence of the dimension of different variables can be weakened, preventing the influence of some dimension variables on the final anomaly score from being too large due to too large numerical values, and being able to more accurately reflect the influence of different variables on the anomaly result.
[0031] 3. By calculating the anomaly score through a multi-channel feature matrix in this application, short-term anomalies and longer-duration anomalies can be identified, which is convenient for users to intuitively obtain the current anomaly type. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained according to these drawings without creative efforts.
[0033] Figure 1 It is a flowchart of a method for detecting anomalies in time series data during highway construction provided by an embodiment of this application;
[0034] Figure 2 It is a convolutional encoding and decoding model diagram provided by an embodiment of this application;
[0035] Figure 3 It is a framework diagram of an abnormal detection system for time-series data in the process of highway construction provided by an embodiment of the present application. Detailed implementation manners
[0036] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are some, rather than all, of the embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the protection scope of the present application.
[0037] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, rather than to describe a specific order or sequence. It should be understood that such data may be interchanged under appropriate circumstances so that the embodiments of the present application can be implemented in an order different from those illustrated or described herein, and the objects distinguished by "first", "second", etc. are usually of the same category, and the number of objects is not limited. For example, the first object may be one or more. In addition, "and / or" in the specification and claims means at least one of the connected objects, and the character " / " generally represents an "or" relationship between the related objects before and after.
[0038] Please refer to Figure 1 As shown, it is a method for detecting abnormal time-series data in the process of highway construction provided by an embodiment of the present application, including the following steps:
[0039] Step S1: Collect time-series data in the process of highway construction;
[0040] Step S2: Set different step sizes according to time-series data in different dimensions to form feature matrices with different numbers of channels;
[0041] Step S3: Encode the feature matrix using a convolutional encoder;
[0042] Step S4: Use a convolutional decoder to perform reverse reconstruction on the encoded feature matrix to obtain a reconstructed feature matrix M*;
[0043] Step S5: Calculate the difference value between the original feature matrix and the reconstructed feature matrix;
[0044] Step S6: Calculate the anomaly score at each time point according to the step size and anomaly difference value selected for the feature matrix:
[0045] Step S7: Calculate whether an anomaly occurs according to the calculated anomaly score and the trained threshold.
[0046] In step S1, a sensor is used to collect the time-series data of the highway construction process.
[0047] Specifically, the time-series data includes material data and mechanical data. The material data includes steel bars (data such as tensile test, cold bending test, repeated bending test, etc.), cement (data such as mortar strength, initial setting time, final setting time, fineness, etc.), coarse aggregates (data such as crushing value, mud content, clay lump content, sieve analysis, etc.), and lime (data such as effective calcium and magnesium content, water content, fineness, etc.). The mechanical data includes rollers (data such as construction speed, static rolling load, vibration frequency, etc.), water sprinklers (data such as water spraying volume, spraying width, spraying method, etc.), and bulldozers (data such as earth-pushing ability, blade angle, self-weight, etc.).
[0048] In step S2, the step sizes include 5, 10, 20, and 60. Correspondingly, a feature matrix with 4 channels is formed. Setting different step sizes according to the time-series data of different dimensions to form feature matrices with different numbers of channels includes:
[0049] All the collected time-series data is segmented. Each segment is a use case. Inside each segment, data forms feature matrices with different numbers of channels according to different step sizes to capture more comprehensive information (the step sizes range from 5 to 60, capturing short-term anomalies to long-term anomalies respectively).
[0050] In some embodiments, assuming the data dimension is 40 and a segment of data is X = (x1, x2,..., x 40 ), the constructed feature matrix is M. For x1 = (x 11 , x 12 ,...x 1p ), x2 = (x 21 , x 22 ,...y 2p ) for two-dimensional variables (p is the step size), the Mahalanobis distance (s is the covariance matrix of the segment matrix, s -1 is the inverse matrix of the covariance matrix). The feature matrix is M i,j = d(x i , x j ). Reconstruction matrices can be formed for step sizes 5, 10, 20, and 60 respectively, and a 4-channel matrix is formed in total.
[0051] In step S4, in the reverse reconstruction process, an attention mechanism is added to extract features to better capture the long-term dependence relationship in the time-series data.
[0052] The body encoding and decoding model provided by the embodiments of the present application is as Figure 2As shown. It consists of an encoder (downsampling path) and a decoder (upsampling path). The encoder is used to extract the feature representation of the input image and gradually reduce the spatial resolution of the feature matrix; while the decoder upsamples these feature maps through deconvolution operations and finally restores them to the size of the original matrix.
[0053] In step S5, the difference s is calculated separately for the feature matrix and the reconstruction matrix of each channel, s c = ∑ ij (M ij - M * ij ) 2 .
[0054] In step S6, the final score is obtained according to the four channels, S = s1 * 0.15 + s2 * 0.25 + s3 * 0.25 + s4 * 0.35 (s1 - s4 respectively represent the channel anomaly differences with step sizes of 5, 10, 20, and 60).
[0055] Combined with Figure 3 As shown, the present application also provides a highway construction process time series data anomaly detection system for implementing the above method, including a time series data collection module 1, a feature matrix formation module 2, an encoding module 3, a reverse reconstruction module 4, a difference value calculation module 5, an anomaly score calculation module 6, and an anomaly judgment module 7.
[0056] The time series data collection module 1 is used to collect the time series data during the highway construction process.
[0057] The feature matrix formation module 2 is used to set different step sizes according to the time series data of different dimensions and form feature matrices with different numbers of channels.
[0058] The encoding module 3 is used to encode the feature matrix using a convolutional encoder.
[0059] The reverse reconstruction module 4 is used to reversely reconstruct the encoded feature matrix using a convolutional decoder to obtain a reconstructed feature matrix.
[0060] The difference value calculation module 5 is used to calculate the difference value between the original feature matrix and the reconstructed feature matrix.
[0061] The anomaly score calculation module 6 is used to calculate the anomaly score at each time point according to the step size and anomaly difference selected for the feature matrix.
[0062] The anomaly judgment module 7 is used to calculate whether an anomaly occurs according to the calculated anomaly score and the trained threshold.
[0063] The beneficial effects of the present application are as follows:
[0064] 1. Compared with single - dimensional numerical detection, the method of constructing a matrix from multi - dimensional time - series data with different step lengths in this application can explore the potential relationships between numerical values in multiple dimensions and detect more potential dangers earlier.
[0065] 2. By calculating the Mahalanobis distance of variables in different dimensions, this application can weaken the influence of dimension on different variables, prevent some dimension variables from having too much impact on the final anomaly score due to large numerical values, and can more accurately reflect the influence of different variables on the anomaly result.
[0066] 3. This application calculates the anomaly score through a multi - channel feature matrix to identify short - term anomalies and longer - duration anomalies, which is convenient for users to intuitively obtain the current anomaly type.
[0067] The embodiments of this application have been described above in conjunction with the accompanying drawings. However, this application is not limited to the above - mentioned specific implementation manners. The above - mentioned specific implementation manners are only illustrative and not restrictive. Under the inspiration of this application, those of ordinary skill in the art can also make many forms without departing from the purpose of this application and the scope protected by the claims, and all of them belong to the protection scope of this application.
Claims
1. A method for detecting anomalies in time-series data during highway construction, characterized in that, It includes the following steps: Step S1: Collect the time-series data during the highway construction process. The time-series data includes material data and mechanical data. The material data includes the tensile test, cold bending test, and repeated bending test data of steel bars, the mortar strength, initial setting time, final setting time, and fineness data of cement, the crushing value, mud content, mud lump content, and sieve analysis data of coarse aggregates, and the effective calcium and magnesium content, water content, and fineness data of lime. The mechanical data includes the construction speed, rolling static load, and vibration frequency data of rollers, the water spraying volume, spraying width, and spraying method data of water sprinklers, and the earth-pushing ability, blade angle, and self-weight data of bulldozers. Step S2: Set different step lengths according to the time-series data of different dimensions to form feature matrices with different numbers of channels. Step S3: Use a convolutional encoder to encode the feature matrix. Step S4: Use a convolutional decoder to perform reverse reconstruction on the encoded feature matrix to obtain a reconstructed feature matrix , where d represents the Mahalanobis distance and , variable , variable , p is the step size; Step S5: Calculate the difference value between the original feature matrix and the reconstructed feature matrix ; Step S6: According to the step length and anomaly difference selected from the feature matrix, perform weighted fusion on the difference values of each step length channel, and calculate the anomaly score S at each time point by using: ; In the formula, to respectively represent the channel anomaly differences with step sizes of 5, 10, 20, and 60; Step S7: Calculate whether an anomaly occurs according to the calculated anomaly score and the trained threshold.
2. The method according to claim 1, wherein: In Step S1, sensors are used to collect the time-series data during the highway construction process.
3. The method according to claim 1, wherein: In Step S2, the step lengths include 5, 10, 20, and 60. Correspondingly, a feature matrix with 4 channels is formed.
4. The method according to claim 3, wherein: The setting of different step lengths according to the time-series data of different dimensions to form feature matrices with different numbers of channels includes: Slice all the collected time-series data. Each slice is a use case. Within each slice, the data forms feature matrices with different numbers of channels according to different step lengths.
5. The method according to claim 3, wherein: In Step S4, during the reverse reconstruction process, an attention mechanism is added to extract features to better capture the long-term dependencies in the time-series data.
6. A highway construction process time series data anomaly detection system for implementing the method described in any one of claims 1-5, characterized in that, It includes: A time-series data collection module, which is used to collect the time-series data during the highway construction process; A feature matrix formation module, which is used to set different step lengths according to the time-series data of different dimensions to form feature matrices with different numbers of channels; An encoding module, which is used to encode the feature matrix by using a convolutional encoder; A reverse reconstruction module, which is used to perform reverse reconstruction on the encoded feature matrix by using a convolutional decoder to obtain a reconstructed feature matrix; A difference value calculation module, which is used to calculate the difference value between the original feature matrix and the reconstructed feature matrix; An anomaly score calculation module, which is used to calculate the anomaly score at each time point according to the step length and anomaly difference selected from the feature matrix; An anomaly judgment module, which is used to calculate whether an anomaly occurs according to the calculated anomaly score and the trained threshold.