Electric power engineering budget data anomaly detection method and system based on big data
By applying big data analysis and deep learning technology in power engineering budget data, and using TCN-VAE model and Bayesian inference method for abnormal detection, the problem of high false alarm rate or missed alarm in the existing technology is solved, and more accurate abnormal risk identification and early warning is achieved.
Patent Information
- Application Number
- CN202510001735.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-02
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2045-01-02
AI Technical Summary
The abnormal detection method of the rule-based power engineering budget data in the prior art has a high false alarm rate or a missed rate, making it difficult to accurately identify abnormal risks in complex power engineering budget data.
A big data-based method is adopted to obtain cross-system budget data, extract cross-system budget timing characteristics, and use TCN-VAE model to perform abnormal detection. Combined with Bayesian inference, dynamically adjust the abnormal detection threshold and label the abnormal data.
It significantly improves the accuracy of abnormal detection, reduces the false alarm rate and missed alarm rate, and can efficiently identify abnormal risks in complex power engineering budget data, providing more accurate warning information.
Smart Images

Figure CN119918798A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of big data analysis, and in particular to a method and system for detecting anomalies in power engineering budget data based on big data. Background Art
[0002] As a major infrastructure project, power engineering projects involve a wide variety of budget data, including but not limited to equipment procurement costs, construction costs, labor costs, material costs, transportation costs, etc. These budget data often come from different departments and systems, and are dynamically adjusted during project implementation. For example, there may be a large difference between the initial budget and the later budget of a project. The reasons for the adjustment may be due to market changes, construction delays, labor cost fluctuations, and other factors. Since these budget data are closely related to project progress, any abnormal data fluctuations may reflect potential financial risks and even lead to project overruns or delays.
[0003] At present, anomaly detection of power engineering budget data mainly relies on traditional manual rule setting and rule-based detection methods. Rule-based detection methods rely on manual experience and historical data to set threshold rules, but the scope of application of these rules is usually limited, and it is difficult to cover all potential abnormal patterns in budget data. When the budget data is more complex or changes dynamically, the rules may not be able to accurately detect anomalies, resulting in high false positive or false negative rates.
[0004] In response to the above problems, the industry has not yet proposed a better technical solution. Summary of the invention
[0005] The present application provides a method, system, storage medium, computer program product and electronic device for detecting anomalies in power engineering budget data based on big data, which are used to at least solve the problem of high false alarm rate or missed alarm rate caused by the rule-based anomaly detection method in the current related technology, and can efficiently and accurately identify abnormal risks in complex power engineering budget data.
[0006] In a first aspect, an embodiment of the present application provides a method for detecting anomalies in power engineering budget data based on big data, comprising: obtaining cross-system budget data, wherein the cross-system budget data includes budget data of multiple department information systems; the department information system includes at least one of the following: a procurement information system, a construction information system, a financial information system, and a labor management information system; extracting cross-system budget time series features corresponding to the cross-system budget data; processing the cross-system budget time series features based on an anomaly detection model to calculate the reconstruction error of each time step; the anomaly detection model adopts a TCN-VAE model; modeling and analyzing the reconstruction error of each time step based on Bayesian inference to determine the reconstruction error distribution, and determining an anomaly detection threshold based on the reconstruction error distribution; when it is detected that the reconstruction error corresponding to the first time step exceeds the anomaly detection threshold, marking the data field corresponding to the first time step in the cross-system budget data as abnormal data.
[0007] In a second aspect, an embodiment of the present application provides a power engineering budget data anomaly detection system based on big data, comprising: a data acquisition unit, used to acquire cross-system budget data, the cross-system budget data including budget data of multiple department information systems; the department information system includes at least one of the following: a procurement information system, a construction information system, a financial information system and a labor management information system; a feature extraction unit, used to extract the cross-system budget time series features corresponding to the cross-system budget data; a reconstruction error calculation unit, used to process the cross-system budget time series features based on an anomaly detection model to calculate the reconstruction error of each time step; the anomaly detection model adopts a TCN-VAE model; a threshold determination unit, used to model and analyze the reconstruction error of each time step based on Bayesian inference to determine the reconstruction error distribution, and determine the anomaly detection threshold according to the reconstruction error distribution; an abnormal data marking unit, used to mark the data field corresponding to the first time step in the cross-system budget data as abnormal data when it is detected that the reconstruction error corresponding to the first time step exceeds the anomaly detection threshold.
[0008] According to a third aspect, an electronic device is provided, comprising: at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can perform the steps of the method for detecting anomalies in power engineering budget data based on big data according to any embodiment of the present application.
[0009] In a fourth aspect, an embodiment of the present application provides a storage medium on which a computer program is stored, characterized in that when the program is executed by a processor, the steps of the method for detecting anomalies in power engineering budget data based on big data of any embodiment of the present application are implemented.
[0010] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the method for detecting anomalies in power engineering budget data based on big data of any embodiment of the present application.
[0011] The present application provides a method and system for detecting anomalies in power engineering budget data based on big data, which can produce at least the following technical effects:
[0012] (1) By collecting budget data from various information systems of power engineering, and calling the TCN-VAE (Temporal Convolutional Network-Variational Auto Encoder) model to perform error reconstruction and anomaly detection on the corresponding time series features of cross-system budget data. Compared with traditional rule-based methods, the TCN-VAE model can automatically learn the time series rules and potential features of data. When budget data is complex, changeable and affected by multiple factors, it can effectively capture the dynamic fluctuations of budget data and identify abnormal patterns that may be missed or misdetected by traditional methods, significantly improving the accuracy of anomaly detection.
[0013] (2) Through cross-system data integration, it covers the information systems of multiple departments (such as procurement, construction, finance, labor management, etc.), providing richer background information for anomaly detection, and being able to comprehensively consider the mutual influence among departments, forming a multi-dimensional data perspective, which helps big data analysis to explore the potential abnormal relationship between the budgets of different departments, thereby improving the accuracy of budget anomaly detection results.
[0014] (3) The anomaly detection threshold determination method based on Bayesian inference can dynamically adjust the detection threshold according to the distribution characteristics of the actual data by modeling and analyzing the reconstruction error at each time step. It can effectively reduce the false alarm rate and missed alarm rate caused by the inability of fixed threshold settings to match the various stages of power engineering, thereby improving the effectiveness and reliability of the detection system.
[0015] Through this technical solution, by introducing a time series anomaly detection method based on big data and deep learning, with the help of the real-time processing capability of the TCN-VAE model and the modeling of error distribution by Bayesian inference, it is possible to issue an early warning based on the monitoring results when abnormal fluctuations occur in the budget data of the power engineering project. This can provide early warning information for project managers, so that measures can be taken in advance to reduce the risk of project overruns or delays. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0017] Figure 1 A flowchart showing an example of a method for detecting anomalies in power engineering budget data based on big data according to an embodiment of the present application is shown;
[0018] Figure 2 An operation flow chart showing an example of determining an abnormality detection threshold according to an embodiment of the present application;
[0019] Figure 3 A schematic diagram of a structural connection of an example of a TCN-VAE model according to an embodiment of the present application is shown;
[0020] Figure 4 A structural block diagram of an example of a power engineering budget data anomaly detection system based on big data according to an embodiment of the present application is shown;
[0021] Figure 5 It is a schematic structural diagram of an embodiment of an electronic device of the present application. DETAILED DESCRIPTION
[0022] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0023] In the technical solution of this application, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved shall comply with the provisions of relevant laws and regulations and shall not violate public order and good morals.
[0024] It should be noted that the data involved in power engineering projects come from many sources with different structures, such as data from the procurement system, data from the construction progress system, data from the financial system, etc. These data differ in format, granularity and content, and traditional methods are difficult to effectively integrate different types of data for joint analysis. In addition, power engineering projects usually take a long time to complete, and the time series changes of budget data during the project cycle are also very obvious. Existing methods have weak processing capabilities for time series data and cannot effectively capture potential anomalies in data changes.
[0025] The amount of data involved in power engineering project management is extremely large, and the data dimensions and time span are more complex. It not only comes from multiple internal business systems, but may also involve the influence of external market, environment, policy and other factors. In order to identify anomalies in massive data, traditional rule engines and static data analysis methods can no longer meet the needs.
[0026] In view of this, Figure 1 A flowchart of an example of a method for detecting anomalies in power engineering budget data based on big data according to an embodiment of the present application is shown.
[0027] Regarding the execution subject of the method of the embodiment of the present application, it can be any controller or processor with computing or processing capabilities. Specifically, it can be implemented by a power engineering budget management cloud platform. By statistically analyzing data from different information systems, building a multi-dimensional budget perspective of the overall project, and using big data analysis and deep learning technology, the accuracy, real-time and flexibility of anomaly detection are significantly improved, the cost of manual intervention is reduced, the ability of risk warning and project management is enhanced, and intelligent power engineering project budget management is realized.
[0028] In some examples, it may be integrated and configured in an electronic device or terminal by means of software, hardware, or a combination of software and hardware, and the type of the terminal or electronic device may be diverse, such as a mobile phone, a tablet computer, or a desktop computer, etc.
[0029] like Figure 1 As shown, in step S110, cross-system budget data is obtained, and the cross-system budget data includes budget data of multiple department information systems.
[0030] Here, the department information system includes at least one of the following: a procurement information system, a construction information system, a financial information system, and a labor management information system.
[0031] In some implementations, corresponding business data is collected from multiple department information systems (such as a procurement information system, a construction information system, a financial information system, and a labor management information system) through an interface or API.
[0032] For example, by collecting business data including material purchase lists, supplier information, purchase order records, purchase amounts, and arrival times from the procurement information system. By collecting budget data covering the construction process, such as construction hours, progress, and on-site management costs, from the construction information system. By collecting inflow and outflow information of funds from the financial information system, including payment fees, fund allocation, cash flow, etc. By collecting labor costs, worker salaries, social insurance, and other related expenses from the labor management information system.
[0033] Furthermore, all collected data are stored in a unified database to form a cross-departmental and cross-system data warehouse, which realizes the integration of budget data from multiple departments and multiple systems, and provides comprehensive and real-time data support for subsequent analysis. Then, data cleaning and standardization techniques are used to ensure the consistency of data formats in different systems, especially the unification of field names, units, timestamps, etc. Therefore, through standardized data processing, the problems caused by differences in data sources are eliminated, making subsequent anomaly detection more accurate and reliable.
[0034] In step S120, the cross-system budget time series features corresponding to the cross-system budget data are extracted.
[0035] In some implementations, time series modeling is performed based on the acquired historical budget data (including but not limited to the historical records of each budget item), for example, firstly performing time series processing on the cross-departmental budget data, and then extracting key features related to time.
[0036] Specifically, the cross-departmental budget data is organized by time dimension to construct a unified time series data. The data at each time point will include various expense information of multiple departmental budgets. For the data at each time step, its relevant time series features are extracted, including: the rate of change of the budget amount, the deviation between the budget and the actual expenses, the fluctuation of various expense items, etc., which will help the subsequent anomaly detection and capture the dynamic change pattern of the budget data.
[0037] Therefore, through time series feature extraction, complex cross-departmental budget data can be converted into a feature set with time series characteristics, which can reflect the changing trends of budget data among departments, and reveal the laws and fluctuation patterns of budget execution, thereby enhancing sensitivity to data fluctuations and potential anomalies.
[0038] In step S130, the cross-system budget time series features are processed based on the anomaly detection model to calculate the reconstruction error of each time step, and the anomaly detection model adopts the TCN-VAE model.
[0039] Here, the TCN-VAE (Temporal Convolutional Network-Variational Autoencoder) model is used for anomaly detection. The time series analysis and processing are performed through TCN (Temporal Convolutional Network), and VAE (Variational Autoencoder) is used for anomaly detection, which can improve the modeling ability of time series data and the accuracy of anomaly detection. TCN-VAE can be trained based on a data sample set constructed based on historical budget data, so that the TCN-VAE model can adaptively learn the normal mode or abnormal mode of budget data.
[0040] In one example of an embodiment of the present application, TCN is used to extract features from budget time series data, learn the spatiotemporal dependencies of time series, and gradually capture the long-term dependencies of time series data through convolutional layers to ensure that the changing trends of long time spans in the data can be identified. The extracted time series features are input into the VAE model, and the original data is reconstructed through the encoder-decoder structure of VAE. The reconstruction error is the difference between the input data and the reconstructed data, which reflects the part that the model cannot accurately reconstruct, that is, the potential anomaly. In another example of an embodiment of the present application, TCN is directly integrated into the encoder-decoder structure of VAE, for example, TCN is used to build the encoder of VAE to achieve tighter feature extraction and abnormal pattern analysis. More details will be expanded in conjunction with other examples below.
[0041] In step S140 , the reconstruction error of each time step is modeled and analyzed based on Bayesian inference to determine the reconstruction error distribution, and the anomaly detection threshold is determined according to the reconstruction error distribution.
[0042] It should be noted that through Bayesian inference, we can combine prior knowledge and actual observation data to obtain the distribution of reconstruction errors, that is, the reconstruction error at each time step. This dynamically updated distribution estimation is more accurate than methods based solely on experience or data fitting, and can adapt to data changes and uncertainties.
[0043] It should be noted that various non-restrictive probability distribution models can be used to model the distribution of reconstruction errors, such as Gaussian distribution model, gamma distribution, normal distribution, Student t distribution, etc., and the appropriate distribution can be selected according to the actual situation of the data. Furthermore, the anomaly detection threshold is dynamically adjusted according to the Bayesian inference results to adapt to budget fluctuations in different project stages, which enhances the flexibility and adaptability of the anomaly detection system.
[0044] In step S150, when it is detected that the reconstruction error corresponding to the first time step exceeds the abnormality detection threshold, the data field corresponding to the first time step in the cross-system budget data is marked as abnormal data.
[0045] In some embodiments, the reconstruction error of each time step is compared with the corresponding anomaly detection threshold, and the detected abnormal data field is marked according to the comparison result. For example, if the budget data of the first time step shows significant deviations in items such as procurement costs and construction costs, the corresponding fields will be marked as "abnormal". Then, the budget management platform can generate alarms or reports based on the marked abnormal data for further review and adjustment by project managers. Thus, by automatically marking abnormal data, the response speed and accuracy of anomaly detection are greatly improved, allowing project managers to quickly identify and deal with potential financial risks, and effectively avoid project overspending or delays caused by abnormal budget data.
[0046] Through the embodiments of the present application, by introducing the TCN-VAE model and the Bayesian inference method, data integrated across multiple departments and systems is processed, complex time series data and dynamic changes are learned, and efficient and accurate anomaly detection of power engineering project budget data is achieved. It has strong adaptability and can help project managers make more scientific decisions and adjustments.
[0047] Figure 2 An operational flowchart of an example for determining an abnormality detection threshold according to an embodiment of the present application is shown.
[0048] like Figure 2 As shown, in step S210, the mean and standard deviation corresponding to the reconstruction error of each time step are calculated to model the reconstruction error through a normal probability distribution model.
[0049]
[0050] In the formula, e t is the reconstruction error at time step t, which expresses the degree of fit of the anomaly detection model to the budget data at this time step; μ e represents the mean of the reconstruction error, which reflects the overall trend of the historical reconstruction error; σ e represents the standard deviation of the reconstruction error, which reflects the fluctuation range of the reconstruction error; B is the total number of historical time steps covered by the cross-system budget data.
[0051] In step S220, an initial anomaly detection threshold is calculated based on the mean and standard deviation of the reconstruction error.
[0052] Thr t =μ e +λ·σ e , Formula (3)
[0053] Where Thr t represents the initial anomaly detection threshold at time step t, λ represents the adjustment factor of the standard deviation, λ>1.
[0054] In the embodiment of the present application, the reconstruction error e is calculated t And assuming that it conforms to the normal distribution, further calculate the mean μ of the error e and standard deviation σ e , is the dynamic threshold Thr t Provide data support. The adjustment factor λ is used to control the impact of the standard deviation on the threshold, thereby achieving flexible adjustment of the sensitivity of anomaly detection.
[0055] Through the embodiment of the present application, the mean and standard deviation are dynamically calculated, and the detection threshold is adjusted in real time based on this, so that the threshold can adapt to the fluctuation characteristics of the budget data. When the budget data fluctuates greatly, the standard deviation σ e will increase, resulting in a corresponding expansion of the threshold range and reducing false alarms caused by fluctuations. When the budget data fluctuates slightly, the standard deviation σ e As the error is reduced, the threshold range is tightened, and the ability to detect small anomalies is enhanced. t Distribution modeling and automatic calculation of mean μ e and standard deviation σ e , and dynamically adjust the threshold Thr t , there is no need to manually set a fixed threshold, which realizes the automation of threshold calculation and reduces the subjectivity and workload of traditional manual threshold setting.
[0056] It should be noted that the adjustment factor λ is an important parameter of the dynamic threshold calculation formula, which can control the detection sensitivity and can be a pre-set or dynamically adjusted value. Preferably, by dynamically adjusting λ, the threshold sensitivity is increased and the probability of false alarms is reduced in stages with large budget fluctuations (such as the procurement stage); the threshold range is tightened in stages with high budget stability (such as the acceptance stage) to accurately capture abnormal points.
[0057] In some examples of the embodiments of the present application, the power project includes multiple project stages, each of which is pre-set with a corresponding standard deviation adjustment factor, and the multiple project stages include a project procurement stage, a project construction stage, and a project acceptance stage. 采购 >λ 施工 >λ 验收 , where λ 采购 , 施工 and λ 验收 They respectively represent the standard deviation adjustment factors corresponding to the project procurement stage, project construction stage and project acceptance stage.
[0058] In the embodiment of the present application, according to the multi-stage characteristics of the power engineering project, standard deviation adjustment factors corresponding to the stage characteristics are set for the procurement stage, construction stage and acceptance and settlement stage respectively. By changing the size of the adjustment factor, the sensitivity and fault tolerance of anomaly detection in each stage can be flexibly adjusted.
[0059] Specifically, in the procurement phase, due to the large budget fluctuations, a higher λ 采购 , expand the detection threshold range and reduce false positives caused by normal budget fluctuations. During the construction phase, the budget fluctuation is between the procurement and settlement phases, and the adjustment factor λ 施工 Moderate, so that the detection sensitivity adapts to the budget changes caused by the construction progress. In the acceptance and settlement stage, the budget volatility is the lowest, and a smaller λ is set验收 , tighten the detection threshold range, ensure that every abnormal point is captured, and improve the sensitivity of anomaly detection. Therefore, in view of the budget fluctuation characteristics in different stages such as procurement, construction, and acceptance settlement, the detection system can automatically adjust the threshold range and improve the adaptability to the fluctuation of abnormal patterns of budget data.
[0060] Through the embodiments of the present application, by setting different standard deviation adjustment factors for different engineering stages, combined with the calculation formula of the above-mentioned anomaly detection threshold, the detection threshold is dynamically adjusted, so that the anomaly detection model can adapt to the budget fluctuation characteristics of each stage. In stages with large budget volatility (such as the procurement stage), the model's tolerance for fluctuations is increased by increasing λ; in stages with small volatility (such as the acceptance and settlement stage), the detection sensitivity is increased by reducing λ, ensuring the adaptability of the budget management cloud platform to data at each stage.
[0061] Regarding the feature extraction details of the cross-system budget time series features, in some embodiments, based on the sliding time window, cross-system correlation features and local fluctuation statistical features are extracted from the cross-system budget data. The cross-system correlation features include the budget correlation coefficient and budget proportion features between systems, and the local fluctuation statistical features include the local mean, local standard deviation, and local kurtosis.
[0062] Here, the inter-system budget correlation coefficient can reflect the statistical correlation between budget data in different information systems (such as procurement and finance, construction and labor management, etc.). The budget proportion feature is used to calculate the proportion of different system budgets to the total budget, reflecting the budget distribution of each information system. The cross-system correlation feature reveals the potential collaborative relationship between information systems under the abnormal mode of budget data, providing more comprehensive contextual support for anomaly detection.
[0063] The local fluctuation statistical features are used to capture the volatility and change trend of budget data within a fixed time window, reflect the short-term dynamic characteristics of budget data, and provide key numerical features for anomaly detection. Specifically, the local mean is used to express the average value of budget data within a fixed time window. The local standard deviation is used to express the fluctuation amplitude of budget data within a fixed time window. The local kurtosis is used to describe the peak characteristics of the distribution of budget data within the time window. A higher kurtosis indicates that there are more extreme values in the distribution. In this way, the dynamic changes and distribution characteristics of budget data can be captured.
[0064] More specifically, the formula for extracting the budget correlation coefficient between systems is:
[0065]
[0066] In the formula, For System U 1 and U 2The correlation coefficient of the budget time series, Cov(U 1 ,U 2 ) is the system U 1 and U 2 The covariance of the budget time series, For System U 1 The standard deviation of the budget time series, For System U 2 The standard deviation of the budget time series.
[0067] Here, the budget correlation coefficient between systems It provides information on the budget linkage relationships between multiple systems, supports the detection of cross-system anomalies, and helps to discover possible budget imbalances between systems, such as inconsistencies between procurement plans and appropriation approvals.
[0068] The formula for extracting the budget ratio feature is:
[0069]
[0070] In the formula, Indicates the corresponding system U 1 The budget share characteristics of Indicates system U 1 The budget amount, E 总 Indicates the overall budget amount for the power project.
[0071] Here, the budget share characteristics It quantitatively describes the rationality of the budget distribution of each department, making it easier to quickly discover abnormal phenomena where the budget proportion of a single system is too high or too low.
[0072] The formula for extracting the local mean is:
[0073]
[0074] In the formula, μ window is the local mean of the budget within the sliding time window, which means the average value of the budget data within the sliding time window; W 窗 Indicates the window size of the sliding time window, x i Represents the budget data at the i-th time point.
[0075] The formula for extracting the local standard deviation is:
[0076]
[0077] In the formula, σ window Represents the local standard deviation of the budget within the sliding time window, which is used to measure the fluctuation range of the budget data within the sliding time window.
[0078] Local mean μwindow and the local standard deviation σ window It reflects the short-term trend and fluctuation of the budget and supplements the time dynamic characteristics. Local mean μ window It can reveal short-term trends in the budget, such as anomalies that are persistently above or below the historical mean. Local standard deviation σ window It can capture abnormal short-term fluctuations, such as unusually large budget fluctuations.
[0079] The extraction formula of local kurtosis is:
[0080]
[0081] In the formula, K urt Represents the kurtosis of the budget data distribution within the sliding time window.
[0082] Local kurtosis K urt It focuses on capturing abnormal extreme values and emphasizes extreme points in budget distribution, which enhances the sensitivity to sudden budget anomalies and can effectively detect occasional large budget expenditures.
[0083] It should be noted that the extraction of cross-system correlation features and local statistical features combined with the sliding time window mechanism enables the anomaly detection model to dynamically adapt to the real-time changes of budget data and improve the sensitivity to subtle anomalies and local fluctuations. In addition, by combining multiple feature types, it is possible to effectively capture a variety of abnormal phenomena in the power engineering budget data, and automatically extract them based on the above method without manual intervention, which improves the efficiency of the system in processing large-scale budget data.
[0084] Figure 3 A schematic diagram of the structural connection of an example of a TCN-VAE model according to an embodiment of the present application is shown.
[0085] like Figure 3 As shown, the TCN-VAE model 300 includes an input layer 310, an encoder 320, a re-parameterization layer 330, a decoder 340 and an output layer 350.
[0086] The input layer 310 is used to receive the cross-system budget timing characteristics and construct the input budget timing characteristics corresponding to the fixed window length. Among them, S is the fixed window length and F is the feature dimension of each time step.
[0087] Here, the cross-system budget time series features are divided into subsequences of fixed window length through the input layer. Each window contains a certain number of time step data. Through time window processing, structured data input is provided to ensure the comparability and consistency of cross-system budget data.
[0088] The encoder 320 uses a temporal convolutional network (TCN) to extract the time-dependent features of the input budget time series data and generate distribution parameters of latent variables.
[0089] Here, the encoder 320 uses a time convolutional network to perform temporal modeling on the input data through a convolutional layer. Compared with traditional recurrent neural networks (RNNs) and long short-term memories (LSTMs), TCNs have stronger parallel computing capabilities and can effectively capture long-term dependencies. In some embodiments, TCNs can use a multi-layer structure and can use causal convolutions to learn dependencies on different time scales layer by layer.
[0090] It should be understood that the appropriate convolution kernel size and number of filters can be selected according to the feature dimension and time step length of the input budget data in order to better capture various fluctuations and trends in the model. The multi-layer convolution design and extended receptive field of TCN enable the model to capture different abnormal characteristics from short-term local fluctuations to long-term trend changes.
[0091] By using TCN as the encoder of VAE, the model can efficiently extract long-term dependent features in time series data. Through convolution operations, TCN can discover potential time-dependent patterns in budget data, such as periodic fluctuations, sudden changes, etc., which helps to accurately predict and detect potential anomalies.
[0092] The reparameterization layer 330 is used to generate latent variables by performing a reparameterization operation on the distribution parameters of the latent variables.
[0093] It should be noted that the key idea of VAE is to optimize the probability distribution of the latent space so that the generative model can generate new data by sampling from the latent space. The reparameterization mechanism ensures that the sampling process of the latent distribution is stable and reliable, making the anomaly detection results more robust.
[0094] In some embodiments, latent variables are generated by sampling from a standard normal distribution through a reparameterization operation, thereby ensuring that the model can generate new data features through the latent space, so that the model can retain the diversity of the data during the inference process and reduce overfitting.
[0095] The decoder 340 is used to map the latent variables back to the original feature space to generate reconstruction budget features.
[0096] Here, the decoder restores the original budget features through a reverse neural network structure, and strives to make the reconstructed features as close to the actual budget data as possible.
[0097] In some embodiments, the decoder may be composed of multiple fully connected layers and ReLU activation functions, which gradually map the low-dimensional information in the latent space back to the high-dimensional feature space through a hierarchical structure to generate reconstructed data of the same dimension as the input feature space, and further generate reconstruction budget features for each time step.
[0098] In this way, the role of the decoder is to regenerate the original budget features through the compressed representation in the latent space, which not only contains the important information in the original data, but also retains the timing and dynamic characteristics, providing a basis for subsequent anomaly detection.
[0099] The output layer 350 is used to calculate the reconstruction error of each time step based on the input budget features and the reconstruction budget features of each time step.
[0100] In some embodiments, the output layer calculates the reconstruction error based on the input budget features and the reconstruction budget features generated by the decoder at each time step, which can reflect the deviation of the model when reconstructing the input data. Time steps with large reconstruction errors often represent abnormal fluctuations in budget data, which may be related to factors such as market changes and construction delays. By identifying these abnormal time steps, the platform can detect potential budget risks or overspending in real time.
[0101] Through the embodiments of the present application, TCN is integrated into the encoder of VAE, combining the advantages of temporal convolutional networks and variational autoencoders, using TCN to effectively capture the temporal dependencies of cross-system budget time series data, and capturing the global distribution characteristics of budget data through the latent space compression mechanism of VAE. The temporal dependency and latent distribution modeling results are combined, so that the calculated reconstruction error can directly reflect the degree of deviation of the abnormal points, and can more accurately identify the abnormal points in the budget data.
[0102] It should be noted that in power engineering budget anomaly detection, each budget item (such as procurement, construction, and finance) is not only related to the current time, but also affected by the budget distribution of the previous time step. For example, the anomaly of construction cost may be related to the overspending of previous procurement costs. In addition, there is a strong correlation between different time steps. For example, the budget overspending in a certain quarter may be related to the insufficient budget execution in the previous months. However, the traditional TCN structure can only capture local convolution characteristics.
[0103] As a preferred implementation of the embodiment of the present application, the encoder 310 can adopt TCN that combines local convolution and global attention, dynamically adjust the importance between time steps through a hybrid attention mechanism, and generate parameters of the potential distribution.
[0104] Here, by extracting time-dependent features from cross-system budget time series features, a hybrid attention mechanism is used to combine local convolution and global attention to dynamically adjust the importance between time steps and generate the parameters and of the potential distribution. The combination of local convolution (capturing short-term features) and global attention (modeling long-term correlation) makes the encoder more adaptable to multi-time scale dependencies in budget data.
[0105] Specifically, the formula for local convolution modeling is:
[0106]
[0107] In the formula, represents the output feature of the lth layer TCN at time step t, L represents the total number of layers of TCN, represents the output feature of the l-1th layer TCN at time step td·k, K is the convolution kernel size, k is the convolution kernel index; d is the expansion factor, which is used to control the size of the convolution receptive field; The weight of the kth convolution kernel in the lth layer TCN, b (l) Represents the bias term of the l-th layer TCN.
[0108] The formula for global attention modeling is:
[0109]
[0110] Where t′ is the historical anomaly time step, which indicates the historical time step that confirms the existence of budget anomaly; α t,t′ represents the attention weight of time step t, which is calculated by modeling the impact of the features of historical abnormal time step t′ on time step t; W Q ,W K Represents the linear transformation matrix of query vector and key vector respectively; T 异常 Represents the set of historical abnormal time steps, including all time steps that have been confirmed to have budget anomalies; is a normalization term to ensure that the attention weight α t,t′ The value range of is between [0,1]; and They represent the hidden feature vectors at t and t′ extracted by the Lth layer of the TCN encoder respectively; β represents the abnormal enhancement coefficient, which is used to amplify the attention weight of the historical abnormal time step.
[0111] It should be noted that in the denominator, the correlations of all abnormal time steps t″ are compared to ensure that the model only focuses on the abnormal time steps that have the greatest influence on the current time step t. In addition, by limiting the calculation range of attention t′∈T 异常 , the model only focuses on the historical abnormal time steps and filters out the interference of other time steps. Attention weight αt,t′ The level of α can reflect the potential influence of historical anomalies on the current budget time step. For example, if the procurement cost overrun in the previous quarter t′ directly affects the construction cost in the current quarter, then t,t′ Therefore, by focusing on the comparative analysis of the corresponding historical abnormal time steps, the model can more accurately capture the transmission rules and recurrence characteristics of the anomaly, thereby improving the accuracy of anomaly detection in the current time step.
[0112] In the embodiment of the present application, the feature weighting of the historical abnormal time step t′ is introduced into the current time step t through the global attention mechanism, which can focus on the impact of the abnormal time step on the current budget. For example, an abnormal procurement overspending may put pressure on the subsequent construction budget. The global attention mechanism captures this correlation through high weights. In addition, by using the abnormal enhancement coefficient β, the weight of the historical abnormal time step is further amplified, so that the model can more sensitively capture the laws of abnormal transmission and abnormal recurrence.
[0113] Fusion of local features and global features:
[0114]
[0115] In the formula, represents the fused hidden state at time step t, which combines global features and local features.
[0116] Here, the local convolutional features are added to the global attention features so that the hidden state can reflect both short-term fluctuations and long-term trends. For example, anomalies in the construction budget may be associated with both recent procurement costs and previous financial appropriation trends.
[0117] Generate distribution parameters for latent variables:
[0118]
[0119] In the formula, μ VAE and σ VAE denote the mean and standard deviation of the latent variable distribution, W μ and W σ denote the weights used to generate the mean and standard deviation of the latent distribution, respectively, and b μ and b σ denote the bias terms used to generate the mean and standard deviation of the latent distribution, respectively.
[0120] In this way, the enhanced hidden state is used to generate the potential distribution parameters, ensuring that the budget features are accurately represented in the latent space, providing higher quality input for subsequent reparameterization layers and decoders.
[0121] In some examples of the embodiments of the present application, the reparameterization layer 330 is used to generate latent variables through reparameterization techniques to represent compact features of budget data in the latent space while ensuring that the sampling process is differentiable:
[0122]
[0123] In the formula, is a latent variable, which represents the variable of the latent space; D is the dimension of the latent space, which represents the characteristic dimension of the latent variable; ∈ represents random noise sampled from a standard normal distribution, and ⊙ represents element-by-element multiplication.
[0124] Here, random noise ∈ is introduced in the latent variable generation process by the reparameterization layer 330, which enhances the generalization ability of the model, improves the adaptability of the model when the budget data distribution changes, and reduces the dependence on specific data patterns.
[0125] The decoder 340 is used to decode the latent variables into budget features by combining them with time embedding, so as to enhance the model's perception of the periodicity of budget data:
[0126]
[0127] z enhanced =z+t embed,t , Formula (15)
[0128]
[0129]
[0130] Where, t embed,t is the temporal embedding feature of time step t, M represents the hyperparameter of temporal embedding, represents the time embedding value of time step t in the kth dimension, which is used to express time step t as a periodic high-dimensional vector; z enhanced represents the enhanced latent variable, which contains the temporal embedding information; represents the decoded hidden feature representation at time step t, FC 1 and FC 2 They represent the first fully connected layer and the second fully connected layer for decoding latent variables, ReLU represents the RELU activation function, represents the reconstructed budget feature at time step t, W dec and b dec They represent the weight matrix and bias term of the decoding output layer respectively.
[0131] Here, the goal of the decoder is to reconstruct the budget features from the latent variables and introduce a time embedding t for each time step t by introducing a time embedding mechanism embed,t, the time embedding is a high-dimensional vector that contains the periodic and phase characteristics of time step t to model the periodic law of budget data. Specifically, the latent variable z is combined with the time embedding t embed After that, the decoder can generate the reconstruction budget features according to the periodic and phase characteristics of time step t It helps to improve the accuracy of the model in detecting budget periodic anomalies (such as abnormal fluctuations that do not conform to periodic laws).
[0132] The output layer 350 is used to compare the input budget features with the reconstruction budget features and calculate the reconstruction error at each time step:
[0133]
[0134] In the formula, X t represents the input budget feature of X at time step t, e t represents the reconstruction error at time step t.
[0135] Here, the mean square error (MSE) is used to quantify the difference between the budget data and its reconstructed value at each time step and is used as the core indicator for anomaly detection. If the reconstruction error is large, it may indicate that the budget data at that time step has experienced abnormal fluctuations. By identifying these abnormal time steps, the system can detect potential budget risks or overspending in real time, which helps to intelligently monitor the budget in power engineering projects and provide risk warnings.
[0136] In some examples of the embodiments of the present application, the loss function of the TCN-VAE model is:
[0137]
[0138] In the formula, represents the loss function of the TCN-VAE model, N is the total number of samples in the data sample set, and They represent the reconstruction loss, KL divergence loss, periodicity constraint loss and fluctuation consistency constraint loss of the nth sample respectively; They represent the loss term adjustment hyperparameters, The weight used to control the KL divergence to balance the constraints of the latent space distribution, γ is the weight for controlling the time-dependent regularization term, δ is the weight for controlling the periodicity constraint loss, and η is the weight for controlling the fluctuation consistency constraint loss.
[0139]
[0140] In the formula, is the input budget feature of the nth sample at time step t, representing the actual budget value in the power engineering budget data; is the reconstruction budget feature of the nth sample at time step t, which represents the budget value predicted by the model; is the square of the Euclidean distance between the input budget feature and the reconstruction budget feature, which quantifies the reconstruction error at time step t; T (n) is the number of time steps of the nth sample, which represents the length of the budget time series; is the dynamic weight at time step t. For example, It can be used to adjust the importance of the budget stage, for example, the weight corresponding to t in the procurement stage is lower, while the weight corresponding to t in the construction stage and acceptance stage is higher.
[0141] Here, the input budget feature is measured by reconstruction loss and model reconstruction budget features The difference between them ensures that the model can accurately reconstruct the budget features. The reconstruction loss is used to quantify the reconstruction ability of the model at time step t. The smaller the difference, the better the model fits the budget law.
[0142]
[0143] In the formula, and They represent the mean and standard deviation of the potential distribution corresponding to the nth sample respectively; D is the dimension of the latent space, which represents the characteristic dimension of the latent variable.
[0144] Here, through the KL loss term, the distribution of the latent variables generated by the encoder is constrained to be close to the standard normal distribution Ensure the smoothness and stability of the latent space. KL divergence ensures that the latent variable distribution has good normality and interpretability by measuring the difference between the latent distribution and the prior distribution. KL divergence loss can also improve the generalization ability of the model, enabling it to better adapt to new budget data.
[0145]
[0146] In the formula, represents the latent variable representation of the nth sample at time step t, and P represents the period length hyperparameter, which is used to model the periodicity of budget data; represents the latent variable representation of the nth sample at the periodic time step t+P; is the potential variable distance between periodic time steps, reflecting the periodic changes of budget data. Here, the length of P can be set or adjusted according to actual business needs, for example, it can be set to 3 months.
[0147] Here, the latent variables at periodic time steps t and t+P are constrained by the periodic constraint term and The distance between the two time steps captures the periodicity of the budget data. Periodicity is a common feature in power engineering budgets, such as fluctuations in procurement budgets every quarter or every year, peaks and troughs in construction budgets at each stage, etc. By restricting the consistency of latent variables between periodic time steps, the model is able to learn the periodic characteristics of the budget.
[0148]
[0149] In the formula, is the rate of change of the latent variable between adjacent time steps, indicating the dynamic change of the budget data in the latent space; It is the rate of change of the input budget characteristics between adjacent time steps, indicating the actual fluctuation of the budget data.
[0150] Here, the fluctuation consistency constraint term is used to ensure that the rate of change of the latent variable is consistent with the rate of change of the input budget characteristics, so as to capture the fluctuation pattern of the budget data. It should be noted that the fluctuation of the budget data reflects the dynamic changes of the project, such as the sudden increase or reduction of procurement costs in the short term, or the large fluctuation of labor costs in the construction phase. By restricting the change pattern of the latent variable to be consistent with the input characteristics, the sensitivity of the model to abnormal fluctuations in the budget data is improved.
[0151] Through the embodiments of the present application, the modeling capabilities of four aspects, namely reconstruction error, potential distribution consistency, periodicity and fluctuation, are comprehensively considered. Based on the reconstruction loss, the model is guaranteed to accurately reconstruct the budget features and capture regularity and abnormal features. Based on the KL divergence loss, the stability and generalization ability of the latent variable distribution are ensured. Based on the periodic constraint, the periodicity of the budget is captured and periodic anomalies are detected. Based on the fluctuation consistency constraint, the fluctuation characteristics of the budget are captured to improve the detection capability of short-term anomalies. Thus, the performance of the anomaly detection model is optimized from multiple objectives.
[0152] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of actions combined, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application. In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0153] Figure 4 A structural block diagram of an example of a power engineering budget data anomaly detection system based on big data according to an embodiment of the present application is shown.
[0154] like Figure 4 As shown, the power engineering budget data anomaly detection system 400 based on big data includes a data acquisition unit 410, a feature extraction unit 420, a reconstruction error calculation unit 430, a threshold determination unit 440 and an abnormal data marking unit 450.
[0155] The data acquisition unit 410 is used to acquire cross-system budget data, which includes budget data of multiple department information systems; the department information system includes at least one of the following: a procurement information system, a construction information system, a financial information system, and a labor management information system.
[0156] The feature extraction unit 420 is used to extract the cross-system budget time series features corresponding to the cross-system budget data.
[0157] The reconstruction error calculation unit 430 is used to process the cross-system budget time series characteristics based on the anomaly detection model to calculate the reconstruction error of each time step; the anomaly detection model adopts the TCN-VAE model.
[0158] The threshold determination unit 440 is used to perform modeling analysis on the reconstruction error of each time step based on Bayesian inference to determine the reconstruction error distribution, and determine the anomaly detection threshold according to the reconstruction error distribution.
[0159] The abnormal data marking unit 450 is used to mark the data field corresponding to the first time step in the cross-system budget data as abnormal data when it is detected that the reconstruction error corresponding to the first time step exceeds the abnormal detection threshold.
[0160] In some embodiments, an embodiment of the present application provides a non-volatile computer-readable storage medium, in which one or more programs including execution instructions are stored, and the execution instructions can be read and executed by an electronic device (including but not limited to a computer, a server, or a network device, etc.) to execute the steps of any of the above-mentioned methods for detecting anomalies in power engineering budget data based on big data in the present application.
[0161] In some embodiments, the embodiments of the present application also provide a computer program product, which includes a computer program stored on a non-volatile computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer performs any step of the above-mentioned big data-based power engineering budget data anomaly detection method.
[0162] In some embodiments, an embodiment of the present application also provides an electronic device, comprising: at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the steps of the power engineering budget data anomaly detection method based on big data.
[0163] Figure 5 is a schematic diagram of the hardware structure of an electronic device for executing a method for detecting anomalies in power engineering budget data based on big data provided by another embodiment of the present application, such as Figure 5 As shown, the device includes:
[0164] One or more processors 510 and memory 520, Figure 5 A processor 510 is taken as an example.
[0165] The device for executing the method for detecting anomalies in power engineering budget data based on big data may further include: an input device 530 and an output device 540 .
[0166] The processor 510, the memory 520, the input device 530 and the output device 540 may be connected via a bus or other means. Figure 5 The example of connecting through bus is taken in the following.
[0167] The memory 520, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions / modules corresponding to the power engineering budget data anomaly detection method based on big data in the embodiment of the present application. The processor 510 executes various functional applications and data processing of the server by running the non-volatile software programs, instructions and modules stored in the memory 520, that is, the power engineering budget data anomaly detection method based on big data in the above method embodiment is realized.
[0168] The memory 520 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 520 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 520 may optionally include a memory remotely arranged relative to the processor 510, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0169] The input device 530 may receive input digital or character information and generate signals related to user settings and function control of the electronic device. The output device 540 may include a display device such as a display screen.
[0170] The one or more modules are stored in the memory 520, and when executed by the one or more processors 510, the power engineering budget data anomaly detection method based on big data in any of the above method embodiments is executed.
[0171] The above-mentioned product can execute the method provided in the embodiment of the present application, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not fully described in this embodiment, please refer to the method provided in the embodiment of the present application.
[0172] The electronic devices of the embodiments of the present application exist in various forms, including but not limited to:
[0173] (1) Mobile communication equipment: This type of equipment is characterized by having mobile communication functions and its main purpose is to provide voice and data communications. This type of terminal includes: smart phones, multimedia phones, functional phones, and low-end phones.
[0174] (2) Ultra-mobile personal computer devices: These devices belong to the category of personal computers, have computing and processing functions, and generally also have mobile Internet access features. These terminals include: PDA, MID and UMPC devices, etc.
[0175] (3) Portable entertainment devices: These devices can display and play multimedia content. They include audio and video players, handheld game consoles, e-books, smart toys, and portable car navigation devices.
[0176] (4) Other onboard electronic devices with data interaction functions, such as on-board devices installed in vehicles.
[0177] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0178] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0179] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for detecting anomaly in power engineering budget data based on big data, comprising: Acquire cross-system budget data, wherein the cross-system budget data includes budget data of multiple department information systems; The department information system includes at least one of the following: a procurement information system, a construction information system, a financial information system, and a labor management information system; Extracting the cross-system budget time series features corresponding to the cross-system budget data; Processing the cross-system budget time series features based on an anomaly detection model to calculate the reconstruction error of each time step; the anomaly detection model adopts a TCN-VAE model; Based on Bayesian inference, the reconstruction error of each time step is modeled and analyzed to determine the reconstruction error distribution, and an anomaly detection threshold is determined according to the reconstruction error distribution; When it is detected that the reconstruction error corresponding to the first time step exceeds the abnormality detection threshold, the data field corresponding to the first time step in the cross-system budget data is marked as abnormal data.
2. The method according to claim 1, wherein: The method of performing modeling analysis on the reconstruction error of each time step based on Bayesian inference to determine the reconstruction error distribution, and determining the anomaly detection threshold according to the reconstruction error distribution, includes: Calculate the mean and standard deviation of the reconstruction error at each time step to model the reconstruction error using a normal probability distribution model: In the formula, e t is the reconstruction error at time step t, which expresses the degree of fit of the anomaly detection model to the budget data at this time step; μ e represents the mean of the reconstruction error, which reflects the overall trend of the historical reconstruction error; σ e represents the standard deviation of the reconstruction error, which reflects the fluctuation range of the reconstruction error; B is the total number of historical time steps covered by the cross-system budget data; Based on the mean and standard deviation of the reconstruction error, calculate the initial anomaly detection threshold: Thursday t =μ e +l·s e , Where Thr t represents the initial anomaly detection threshold at time step t, λ represents the adjustment factor of the standard deviation, λ>1.
3. The method according to claim 2, wherein: The power project includes multiple project stages, each of which is pre-set with a corresponding standard deviation adjustment factor; the multiple project stages include a project procurement stage, a project construction stage, and a project acceptance stage; Among them, λ 采购 >λ 施工 >λ 验收 , where λ 采购 , 施工 and λ 验收 They respectively represent the standard deviation adjustment factors corresponding to the project procurement stage, project construction stage and project acceptance stage.
4. The method according to claim 1, wherein: The extracting the cross-system budget time series feature corresponding to the cross-system budget data includes: Based on the sliding time window, extracting cross-system correlation features and local fluctuation statistical features from the cross-system budget data; wherein the cross-system correlation features include budget correlation coefficients and budget proportion features between systems; the local fluctuation statistical features include local mean, local standard deviation and local kurtosis; The formula for extracting the budget correlation coefficient between systems is: In the formula, is the correlation coefficient of the budget time series of systems U1 and U2, Cov(U1,U2) is the covariance of the budget time series of systems U1 and U2, is the standard deviation of the budget time series of system U1, is the standard deviation of the budget time series of system U2; The formula for extracting the budget ratio feature is: In the formula, Indicates the budget ratio characteristics of the corresponding system U1, represents the budget amount of system U1, E 总 Indicates the overall budget amount for the power project; The formula for extracting the local mean is: In the formula, μ window is the local mean of the budget within the sliding time window, which means the average value of the budget data within the sliding time window; W 窗 Indicates the window size of the sliding time window, x i represents the budget data at the i-th time point; The formula for extracting the local standard deviation is: In the formula, σ window Represents the local standard deviation of the budget within the sliding time window, which is used to measure the fluctuation range of the budget data within the sliding time window; The extraction formula of local kurtosis is: In the formula, K urt Represents the kurtosis of the budget data distribution within the sliding time window.
5. The method according to any one of claims 1 to 4, wherein: The TCN-VAE model includes an input layer, an encoder, a re-parameterization layer, a decoder and an output layer; The input layer is used to receive the cross-system budget timing characteristics and construct the input budget timing characteristics corresponding to the fixed window length Among them, S is the fixed window length, and F is the feature dimension of each time step; The encoder uses a time convolution network (TCN) to extract the time-dependent features of the input budget time series data and generate distribution parameters of latent variables; The reparameterization layer is used to generate latent variables by reparameterizing the distribution parameters of the latent variables; The decoder is used to map the latent variables back to the original feature space to generate reconstruction budget features; The output layer is used to calculate the reconstruction error of each time step according to the input budget feature and the reconstruction budget feature of each time step.
6. The method according to claim 5, wherein: The encoder uses TCN that combines local convolution and global attention, dynamically adjusts the importance between time steps through a hybrid attention mechanism, and generates parameters of the potential distribution; Among them, the formula for local convolution modeling is: In the formula, represents the output feature of the lth layer TCN at time step t, L represents the total number of layers of TCN, represents the output feature of the l-1th layer TCN at time step td·k, K is the convolution kernel size, k is the convolution kernel index; d is the expansion factor, which is used to control the size of the convolution receptive field; The weight of the kth convolution kernel in the lth layer TCN, b (l) Represents the bias term of the lth layer TCN; The formula for global attention modeling is: t′∈T 异常 , Where t′ is the historical anomaly time step, which indicates the historical time step that confirms the existence of budget anomaly; α t,t′ represents the attention weight of time step t, which is calculated by modeling the impact of the features of historical abnormal time step t′ on time step t; W Q ,W K Represents the linear transformation matrix of query vector and key vector respectively; T 异常 Represents the set of historical abnormal time steps, including all time steps that have been confirmed to have budget anomalies; is a normalization term to ensure that the attention weight α t,t′ The value range of is between [0,1]; and They represent the hidden feature vectors at t and t′ extracted by the Lth layer of the TCN encoder respectively; β represents the abnormal enhancement coefficient, which is used to amplify the attention weight of the historical abnormal time step; Fusion of local features and global features: In the formula, represents the fused hidden state at time step t, which combines global features and local features; Generate distribution parameters for latent variables: In the formula, μ VAE and σ VAE denote the mean and standard deviation of the latent variable distribution, W μ and W σ denote the weights used to generate the mean and standard deviation of the latent distribution, respectively, and b μ and b σ denote the bias terms used to generate the mean and standard deviation of the latent distribution, respectively.
7. The method according to claim 6, wherein: The reparameterization layer is used to generate latent variables through the reparameterization technique to represent the compact features of the budget data in the latent space while ensuring that the sampling process is differentiable: z=μ VAE +s VAE ⊙∈, In the formula, is a latent variable, which represents a variable in the latent space; D is the dimension of the latent space, which represents the characteristic dimension of the latent variable; ∈ represents random noise sampled from a standard normal distribution, and ⊙ represents element-by-element multiplication; The decoder is used to decode the latent variables into budget features by combining them with time embedding to enhance the model's perception of the periodicity of budget data: z enhanced =z+t embed,t , Where, t embed,t is the temporal embedding feature of time step t, M represents the hyperparameter of temporal embedding, represents the time embedding value of time step t in the kth dimension, which is used to express time step t as a periodic high-dimensional vector; z enhanced represents the enhanced latent variable, which contains the temporal embedding information; represents the decoded hidden feature representation at time step t, FC1 and FC2 represent the first fully connected layer and the second fully connected layer for decoding latent variables, respectively, ReLU represents the RELU activation function, represents the reconstructed budget feature at time step t, W dec and b dec Represent the weight matrix and bias term of the decoding output layer respectively; The output layer is used to compare the input budget features with the reconstruction budget features and calculate the reconstruction error at each time step: Where, X t represents the input budget feature of X at time step t, e t represents the reconstruction error at time step t.
8. The method according to claim 5, wherein: The loss function of the TCN-VAE model is: In the formula, represents the loss function of the TCN-VAE model, N is the total number of samples in the data sample set, and They represent the reconstruction loss, KL divergence loss, periodicity constraint loss and fluctuation consistency constraint loss of the nth sample respectively; γ, δ, η represent the loss term adjustment hyperparameters, The weight used to control the KL divergence to balance the constraints of the potential space distribution, γ is the weight for controlling the time-dependent regularization term, δ is the weight for controlling the periodic constraint loss, and η is the weight for controlling the fluctuation consistency constraint loss; In the formula, is the input budget feature of the nth sample at time step t, representing the actual budget value in the power engineering budget data; is the reconstruction budget feature of the nth sample at time step t, which represents the budget value predicted by the model; is the square of the Euclidean distance between the input budget feature and the reconstruction budget feature, which quantifies the reconstruction error at time step t; T (n) is the number of time steps of the nth sample, which represents the length of the budget time series; is the dynamic weight at time step t; In the formula, and They represent the mean and standard deviation of the potential distribution corresponding to the nth sample respectively; D is the dimension of the latent space, which represents the characteristic dimension of the latent variable; In the formula, represents the latent variable representation of the nth sample at time step t, and P represents the period length hyperparameter, which is used to model the periodicity of budget data; represents the latent variable representation of the nth sample at the periodic time step t+P; is the latent variable distance between periodic time steps, reflecting the periodic changes in budget data; In the formula, is the rate of change of the latent variable between adjacent time steps, indicating the dynamic change of the budget data in the latent space; It is the rate of change of the input budget characteristics between adjacent time steps, indicating the actual fluctuation of the budget data.
9. A power engineering budget data anomaly detection system based on big data, comprising: A data acquisition unit, used to acquire cross-system budget data, wherein the cross-system budget data includes budget data of multiple department information systems; the department information system includes at least one of the following: a procurement information system, a construction information system, a financial information system, and a labor management information system; A feature extraction unit, used to extract the cross-system budget time series features corresponding to the cross-system budget data; A reconstruction error calculation unit, used for processing the cross-system budget time series features based on an anomaly detection model to calculate the reconstruction error of each time step; the anomaly detection model adopts a TCN-VAE model; A threshold determination unit, configured to perform modeling analysis on the reconstruction error of each time step based on Bayesian inference to determine a reconstruction error distribution, and determine an anomaly detection threshold according to the reconstruction error distribution; The abnormal data marking unit is used to mark the data field corresponding to the first time step in the cross-system budget data as abnormal data when it is detected that the reconstruction error corresponding to the first time step exceeds the abnormal detection threshold.
Citation Information
Patent Citations
Lightweight unsupervised anomaly detection method based on multivariate time series data analysis
CN113159163A
Multivariable time sequence anomaly detection method and system, medium, equipment and terminal
CN115222141A
KPI anomaly detection method fusing Bi-TCN and resisting VAE
CN116522264A
Cable cover plate anomaly detection method and system based on variational auto-encoder
CN119089363A