Energy enterprise audit risk monitoring, early warning and prediction method and system
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 深能智慧能源科技有限公司
- Filing Date
- 2026-02-06
- Publication Date
- 2026-06-09
AI Technical Summary
Traditional audit risk monitoring methods cannot meet the intelligent, precise, and forward-looking management and control needs of energy companies. They face challenges such as multiple business segments, diverse data sources, hidden risk points, and high regulatory standards. They also suffer from weak data processing capabilities, unscientific modeling logic, unreasonable and irrelevant threshold construction, lack of closed-loop management throughout the entire process, and poor business adaptability.
By acquiring multi-source heterogeneous audit data, removing redundant coded fields, filling in missing unit names in a regularized manner, using the CART regression tree model for modeling, optimizing hyperparameters, constructing a threshold decision table, and forming a risk threshold standard suitable for energy enterprises, a complete closed loop of data preprocessing, model training, threshold extraction, and early warning prediction is achieved.
It improved the efficiency and completeness of data preprocessing, reduced the prediction error rate, improved the accuracy of risk level judgment, and enabled early identification, early warning, and early handling. It is compatible with risk supervision in multiple sectors and at multiple levels, reduced the waste of audit resources, and promoted the transformation of audit work from ex-post verification to ex-ante warning.
Smart Images

Figure CN122175718A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of audit risk monitoring and data processing technology, and in particular to a method and system for audit risk monitoring, early warning and prediction for energy companies. Background Technology
[0002] With the continuous improvement of audit work development plans and enterprise risk management requirements, the audit business of energy enterprises (especially large group energy enterprises) faces multiple challenges, including multiple business segments, diverse data sources, hidden risk points, and high regulatory standards. Traditional audit risk monitoring methods can no longer meet the needs of intelligent, precise, and forward-looking management and control. Summary of the Invention
[0003] This application provides a method and system for monitoring, warning and predicting audit risks for energy companies. It aims to address the multiple challenges faced by energy companies (especially large group energy companies) in their audit business due to the continuous improvement of audit work development plans and enterprise risk management requirements. These challenges include multiple business segments, complex data sources, hidden risk points and high regulatory standards. Traditional audit risk monitoring methods can no longer meet the needs of intelligent, precise and forward-looking management and control.
[0004] In a first aspect, embodiments of this application provide a method for monitoring, warning, and predicting audit risks for energy companies, the method comprising: Obtain relevant data from multi-source heterogeneous audits of energy enterprises, perform field filtering on the relevant data, remove redundant coded fields that are repeated with preset key fields, and perform rule-based filling on the missing unit name samples in the filtered relevant data to obtain preprocessed relevant data. The preprocessed data is used to screen modeling samples and construct feature vectors. The combination of warning units and audit risk indicators corresponding to the relevant data is traversed to screen and obtain the effective samples. The effective samples are processed using the sliding window method to generate modeling data. The pre-set CART regression tree prediction model is trained based on the generated modeling data. The model hyperparameters are optimized through multi-fold cross-validation to determine the optimal minimum number of leaf nodes. The model is trained using the minimum number of leaf nodes to obtain the audit risk indicator prediction model. Based on the tree structure information output by the audit risk indicator prediction model, feature splitting thresholds of each node are extracted, a threshold decision table is constructed, the extracted splitting thresholds are verified, and thresholds that fail verification are corrected to form a risk threshold standard that is adapted to the actual audit business of energy enterprises. The system acquires audit data from energy companies to be monitored, obtains corresponding feature vectors to be predicted, inputs these feature vectors into a trained audit risk indicator prediction model, and outputs individual and combined predicted values for the corresponding indicators for the month to be monitored. The output individual and combined predicted values are compared with the corrected risk threshold standards to determine the risk level of the corresponding audit risk indicators, generate early warning signals, and, in conjunction with the feature importance analysis results, identify the main influencing factors of risk, thus forming audit risk early warning prediction results.
[0005] In some embodiments, after forming the audit risk warning prediction result, the method further includes: performing application verification, data verification, rationality verification and standard verification on the audit risk warning prediction result, and iteratively optimizing the audit risk indicator prediction model and risk threshold standard based on the verification results and business feedback information.
[0006] In some embodiments, the field filtering process for the relevant data, which removes redundant coded fields that overlap with preset key fields, includes: reading relevant data from the multi-source heterogeneous audit of the energy enterprise and extracting the field information contained in the relevant data; pre-setting a key field list, which includes primary key, business date, indicator name, warning unit name, compiling unit name, individual value, and combined value; comparing the extracted field information with the preset key field list one by one, and filtering out the data content corresponding to the fields that are consistent with the fields in the key field list; identifying and filtering out redundant coded fields that overlap with the preset key fields, specifically the warning unit code and the compiling unit code, which overlap with the data information corresponding to the warning unit name and the compiling unit name in the key field list, respectively; removing the filtered redundant coded fields, retaining all data content corresponding to the key fields, and completing the field filtering process for the relevant data.
[0007] In some embodiments, the step of performing rule-based imputation on missing unit name samples in the filtered relevant data to obtain preprocessed relevant data includes: traversing the relevant data after field filtering, checking each sample for missing unit name fields, where the unit name fields include warning unit name fields and compiling unit name fields; for samples where the warning unit name field is empty, filling the warning unit name field of the sample with a preset string of "no warning unit" according to a preset imputation rule; for samples where the compiling unit name field is empty, filling the compiling unit name field of the sample with a preset string of "no compiling unit" according to a preset imputation rule; after completing the rule-based imputation of all missing unit name samples, performing integrity verification on the imputed data to confirm that there are no missing unit name samples, and outputting the data as preprocessed relevant data after the verification passes.
[0008] In some embodiments, the process of screening modeling samples and constructing feature vectors for the preprocessed relevant data includes: performing text feature standardization encoding on the preprocessed relevant data to convert the textual features into numerical features that the model can recognize; constructing a composite identifier for the warning unit and the compiling unit, concatenating the name of the warning unit and the name of the compiling unit for each sample as a unique identifier for the corresponding unit to resolve the ambiguity of different names for the same unit; performing serial number encoding on the constructed composite identifier and indicator name to generate corresponding unit codes and indicator codes, and saving the encoding dictionary for subsequent business mapping and interpretation; traversing the combinations of warning units and audit risk indicators corresponding to the preprocessed relevant data for screening to obtain the screened valid samples; using the sliding window method to process the valid samples, extracting relevant feature information from the valid samples and assembling them into feature vectors, and combining them with the corresponding target values to generate modeling data; wherein, the dimensions of the feature vector include unit code, indicator code, value type identifier, and historical indicator values for a preset time period, and the value type identifier is used to distinguish between individual values and combined values.
[0009] In some embodiments, the step of traversing relevant data to filter combinations of early warning units and audit risk indicators to obtain filtered valid samples includes: extracting all early warning unit information and all audit risk indicator information from preprocessed relevant data to construct possible combinations of early warning units and audit risk indicators; for each combination of early warning units and audit risk indicators, counting the number of business date records contained in the relevant data corresponding to each combination of early warning units and audit risk indicators; setting a preset sample filtering threshold, which is the minimum historical record duration required to ensure sufficient time-series data to support prediction; comparing the historical data record duration of each combination of early warning units and audit risk indicators with the preset sample filtering threshold, and filtering out combinations with historical data record duration not less than the preset sample filtering threshold as valid combinations; extracting all sample data corresponding to all valid combinations, deduplicating the extracted sample data, removing duplicate samples, and obtaining filtered valid samples and outputting them.
[0010] In some embodiments, the process of using the sliding window method to process valid samples and generate modeling data includes: classifying and organizing the filtered valid samples, grouping them according to the combination of warning units, audit risk indicators, and value types, with value types divided into individual values and combined values; setting sliding window parameters for each group, with the sliding method being to slide sequentially according to the business date, each window containing historical indicator value data for the previous 12 months and target indicator value data for the 13th month; performing sliding processing on the valid samples within each group according to the set sliding window parameters, generating sliding windows one by one; performing missing value detection on each generated sliding window to determine whether there are missing historical indicator value data for the previous 12 months and target indicator value data for the 13th month within the window; retaining sliding windows without missing values, extracting the unit code, indicator code, value type identifier, and historical indicator values for the previous 12 months within the window, and assembling them into a 15-dimensional input feature vector; extracting the target indicator value for the 13th month within the sliding window as the output target value; associating and matching the input feature vector corresponding to each sliding window without missing values with the output target value to form a modeling data; summarizing the modeling data generated by all groups, removing abnormal data, and obtaining the final modeling data.
[0011] In some embodiments, optimizing model hyperparameters through multi-fold cross-validation to determine the optimal minimum leaf node number parameter, and training the model on the modeling data using the minimum leaf node number parameter to obtain an audit risk indicator prediction model, includes: setting the number of folds in multi-fold cross-validation to 5; randomly dividing the generated modeling data into 5 equal parts to ensure that the distribution characteristics of each part of the data are consistent, forming 5 sets of training and validation data pairs, with 4 parts in each data pair used as the training set and 1 part as the validation set; determining a candidate parameter set for the minimum leaf node number, the candidate parameter set including four candidate parameters: 1, 3, 5, and 10; for each candidate parameter, sequentially using 5 sets of training and validation data pairs to train and validate the model; and calling a preset CART regression tree training function, inputting the current training set data. The model training process is executed to obtain a temporary training model, with candidate parameters. The corresponding validation set data is input into this temporary training model, and the prediction results of the validation set are output. The mean squared error (MSE) of the prediction results is calculated. The average MSE of each candidate parameter in five validations is calculated, and the candidate parameter with the smallest average MSE is determined as the optimal minimum leaf node parameter. The CART regression tree training function is called, with the full modeling data and the determined optimal minimum leaf node parameter input, and the complete model training process is executed. During training, the model's fitting effect is monitored in real time to avoid overfitting or underfitting. After training, the model's performance is initially verified. If the verification passes, the trained model is determined as the audit risk indicator prediction model, and the model parameters and training logs are saved for subsequent use and optimization.
[0012] In some embodiments, the step of extracting feature splitting thresholds for each node based on the tree structure information output by the audit risk indicator prediction model and constructing a threshold decision table includes: calling the tree structure extraction interface of the trained audit risk indicator prediction model to obtain the complete tree structure information of the audit risk indicator prediction model, wherein the complete tree structure information includes all non-leaf nodes and related information of leaf nodes; traversing all non-leaf nodes in the tree structure and extracting feature splitting information for each non-leaf node one by one, wherein the feature splitting information includes feature type, feature splitting rule and corresponding feature splitting threshold, wherein the feature splitting rule is a judgment rule that the feature is greater than the threshold or the feature is less than or equal to the threshold; classifying and organizing the extracted feature splitting thresholds according to audit risk indicator categories. Grouping by type, warning unit, and feature type, and recording the non-leaf node number, splitting rule, and prediction error information corresponding to each feature splitting threshold; constructing the header of the threshold decision table, which includes node number, warning unit code, audit risk indicator code, feature type, feature splitting threshold, feature splitting rule, and prediction error; filling each categorized feature splitting threshold and its corresponding associated information into the corresponding position in the threshold decision table, ensuring the information is accurate; performing a completeness check on the constructed threshold decision table to confirm that the feature splitting thresholds of all non-leaf nodes have been extracted and filled in, without omissions or errors; after passing the check, saving the threshold decision table for subsequent verification, correction, and risk level judgment of risk thresholds.
[0013] Secondly, this application provides an audit risk monitoring, early warning, and prediction system for energy enterprises, the system comprising: The data acquisition unit is used to acquire relevant data from multi-source heterogeneous audits of energy enterprises, perform field filtering on the relevant data, remove redundant coded fields that are repeated with preset key fields, and perform rule-based filling on missing unit name samples in the filtered relevant data to obtain preprocessed relevant data. The vector construction unit is used to screen modeling samples and construct feature vectors from the preprocessed relevant data. It traverses the relevant data to screen the combinations of warning units and audit risk indicators to obtain the effective samples. The sliding window method is used to process the effective samples to generate modeling data. Based on the generated modeling data, a pre-set CART regression tree prediction model is trained. The model hyperparameters are optimized through multi-fold cross-validation to determine the optimal minimum number of leaf nodes. The model is then trained using the minimum number of leaf nodes to obtain the audit risk indicator prediction model. The threshold extraction unit is used to extract the feature splitting threshold of each node based on the tree structure information output by the audit risk indicator prediction model, construct a threshold decision table, verify the extracted splitting thresholds, correct the thresholds that fail the verification, and form a risk threshold standard that is adapted to the actual audit business of energy enterprises. The result generation unit is used to acquire audit data to be monitored from energy companies, obtain the corresponding feature vectors to be predicted, input the feature vectors to be predicted into the trained audit risk indicator prediction model, and output the individual and combined predicted values of the corresponding indicators for the month to be monitored. The output individual and combined predicted values are compared with the corrected risk threshold standard to determine the risk level of the corresponding audit risk indicator, generate early warning signals, and at the same time, combine the feature importance analysis results to identify the main influencing factors of risk and form audit risk early warning prediction results.
[0014] This application removes redundant coded fields through clear field filtering rules and fills in missing unit name samples using a unified rule-based scheme, effectively improving the quality of preprocessed data. At the same time, by combining the strong adaptability of the CART regression tree model to missing values and imbalanced data, it solves the pain points of the difficulty in integrating multi-source heterogeneous data and the inconsistent data quality of energy enterprises, laying a solid data foundation for subsequent modeling and training. Compared with existing technologies, the data preprocessing efficiency and data integrity are improved.
[0015] By employing a scientific sample selection method, valid samples with high data integrity are retained. A sliding window method is used to construct feature vectors, fully capturing the temporal continuity of energy enterprise audit indicators. Combined with the CART regression tree model, hyperparameters are optimized and the optimal minimum number of leaf nodes is determined through multi-fold cross-validation, effectively avoiding the underfitting and overfitting problems in existing technologies. At the same time, it supports multiple feature inputs, balancing prediction accuracy and business interpretability. Compared with existing algorithms, the prediction error rate is reduced.
[0016] Based on the tree structure information output by the audit risk indicator prediction model, feature splitting thresholds are automatically extracted, and a threshold decision table is constructed. This achieves the same source linkage between the threshold and the prediction model, avoiding the subjectivity and blindness of manually setting thresholds. At the same time, through the threshold verification and correction mechanism, the thresholds are made more in line with the actual audit business of energy companies. Compared with the existing method of manually setting thresholds, the accuracy of risk level judgment is improved, effectively reducing the situation of high-risk omissions and low-risk misjudgments, and reducing the waste of audit resources.
[0017] By constructing a complete closed loop of "data preprocessing - modeling training - threshold extraction - early warning prediction - risk analysis", it can not only output the individual forecast value, the combined forecast value and the early warning signal for the month to be monitored, but also identify the main influencing factors of risk by combining the results of feature importance analysis. This helps auditors quickly locate the root cause of risk and formulate disposal measures, so as to achieve "early identification, early warning and early disposal" of audit risks. It promotes the transformation of audit work from ex-post verification to ex-ante early warning and from single-point inspection to full-domain collaboration, and adapts to the requirements of dynamic asset risk control.
[0018] The methodology is designed to align with the multi-segment and multi-level business characteristics of energy companies, connecting the risk chain from the group level to individual units. This provides technical support for penetrating audit supervision and addresses the pain points of traditional supervision, such as "layer-by-layer attenuation" and "ambiguous responsibility." Furthermore, the modular design of the entire methodology ensures reproducibility and iterability, enabling rapid integration with various business systems of energy companies. It supports dynamic updates of risk indicators and is adaptable to multiple energy sub-sectors, including electricity, gas, and environmental protection. Compared to existing technologies, this method significantly improves audit supervision efficiency and substantially reduces the workload of auditors.
[0019] By deeply integrating machine learning technology with the auditing business of energy companies, the problem of the disconnect between business and auditing has been solved. The auditing function is embedded in the entire business cycle, providing energy companies with value-added services such as risk prediction and trend analysis. This helps asset supervision transform from compliance supervision to value creation, serving the goal of high-quality development and value preservation and appreciation of enterprises.
[0020] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description
[0021] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 This is a schematic flowchart illustrating the steps of an audit risk monitoring, early warning, and prediction method for energy enterprises, provided in one embodiment of this application. Figure 2 This is a schematic diagram of the architecture corresponding to the audit risk monitoring, early warning and prediction method for energy enterprises provided in the embodiments of this application; Figure 3 This is a line graph showing the deviation of the single-unit value index prediction and evaluation provided in the embodiments of this application; Figure 4 This is a line graph showing the deviation of the merged value index prediction and evaluation provided in the embodiments of this application; Figure 5 This is a bar chart showing the accuracy of the early warning indicators provided in the embodiments of this application; Figure 6 This is a panoramic view of the monitoring indicators risk provided in the embodiments of this application; Figure 7 This is a risk overview diagram of the monitoring dimensions provided in the embodiments of this application; Figure 8 This is a risk overview diagram in the monitoring field provided in the embodiments of this application; Figure 9 This is a schematic block diagram of the structure of an audit risk monitoring, early warning and prediction system for energy enterprises provided in one embodiment of this application; Figure 10 This is a schematic block diagram of the structure of a computer device provided in an embodiment of this application.
[0023] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Detailed Implementation
[0024] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0025] The flowchart shown in the attached diagram is for illustrative purposes only and does not necessarily include all content and operations / steps, nor does it necessarily have to be performed in the order described. For example, some operations / steps can be broken down, combined, or partially merged, so the actual execution order may change depending on the actual situation.
[0026] It should be understood that, in order to clearly describe the technical solutions of the embodiments of the present invention, the terms "first" and "second" are used in the embodiments of the present invention to distinguish identical or similar items with essentially the same function and effect. Those skilled in the art will understand that the terms "first" and "second" do not limit the quantity or execution order, and the terms "first" and "second" are not necessarily different.
[0027] It should be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of the application. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0028] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0029] With the continuous improvement of audit work development plans and enterprise risk management requirements, the audit business of energy enterprises (especially large group energy enterprises) faces multiple challenges, including multiple business segments, diverse data sources, hidden risk points, and high regulatory standards. Traditional audit risk monitoring methods can no longer meet the needs of intelligent, precise, and forward-looking management and control.
[0030] Currently, existing energy enterprise audit risk monitoring technologies have the following prominent shortcomings, including: 1. Weak data processing capabilities: Existing technologies rely heavily on data from single business systems, failing to effectively integrate heterogeneous audit data from multiple sources such as procurement, engineering, finance, and OA. The handling of redundant coded fields in the data is cumbersome and inconsistent. For samples lacking key information such as unit names, there is a lack of unified and feasible rule-based solutions for filling in the missing information, resulting in inconsistent data quality after preprocessing and failing to provide reliable support for subsequent modeling. Furthermore, existing technologies have extremely poor adaptability to missing data and unbalanced data distribution, making it difficult to address the inconsistent data quality issues caused by the complexity of energy enterprise operations.
[0031] 2. Unscientific Modeling Logic: Existing audit risk prediction methods mostly employ simple statistical analysis or traditional algorithms (such as ARIMA and LSTM). ARIMA models rely solely on the temporal characteristics of the data itself, failing to incorporate external features like unit coding and indicator types, which is incompatible with the actual needs of energy companies where risk indicator fluctuations are strongly correlated with business attributes and indicator types. Deep learning models like LSTM require a large amount of complete data, making them unsuitable for the current situation of limited data for some units and time periods in energy companies, leading to overfitting and difficulty in guaranteeing prediction accuracy. Furthermore, existing technologies lack systematic solutions for sample selection and feature vector construction, fail to consider the temporal continuity of audit indicators for energy companies, and lack scientific verification methods for hyperparameter optimization, making it impossible to determine optimal model parameters, further impacting prediction performance.
[0032] 3. Lack of rationality and relevance in threshold construction: Existing audit risk thresholds are mostly set manually, relying on auditors' experience, which is highly subjective, disconnected from actual business patterns, and unable to form an effective linkage with the prediction model. This results in a "disconnect between predicted values and threshold logic," making it impossible to accurately determine the risk level. Some existing technologies attempt to extract thresholds, but they do not combine the tree structure information of the prediction model, nor have they established a sound threshold verification and correction mechanism. The thresholds have poor business adaptability and cannot meet the risk supervision needs of energy companies across multiple sectors and levels.
[0033] 4. Lack of a closed-loop control system: Existing technologies often remain at a single stage (such as risk identification or simple prediction) and have not formed a complete closed loop of "data preprocessing - modeling training - threshold extraction - early warning prediction - risk analysis". As a result, while outputting early warning signals, it is impossible to identify the main influencing factors of risks, making it difficult for auditors to quickly locate the root causes of risks and formulate targeted disposal measures, thus failing to achieve proactive risk control.
[0034] 5. Poor business adaptability: Existing audit risk monitoring technologies are mostly general-purpose and have not been designed specifically for the business characteristics of energy companies (such as differences in indicators of core businesses such as electricity, gas, and environmental protection, and multi-level management structures). They cannot achieve penetrating risk control from the group to individual units, and cannot solve the pain points of "layer-by-layer attenuation" and "ambiguity of responsibility" in traditional supervision, and cannot meet the high standards of dynamic risk control of state-owned assets.
[0035] In summary, existing audit risk monitoring technologies have insurmountable shortcomings in data processing, modeling and prediction, threshold construction, and full-process control. They cannot effectively solve the core problems of low accuracy in audit risk identification, poor timeliness of early warning, weak predictive capabilities, and inaccurate risk positioning in energy companies. There is an urgent need for an audit risk monitoring, early warning, and prediction method that can adapt to the actual business of energy companies, has efficient data processing, accurate prediction, reasonable thresholds, and a closed-loop full-process system.
[0036] To solve the above problem, please refer to Figure 1 This application provides a method for monitoring, warning, and predicting audit risks for energy companies, applied to computer equipment. The computer equipment can be deployed on a single server or server cluster. It can also be deployed on handheld terminals, laptops, wearable devices, or robots, etc. It should be noted that all information involved in the method provided in this application is extracted with the authorization of the relevant users and in accordance with relevant regulations, and will not infringe on user privacy.
[0037] The provided method for monitoring, warning, and predicting audit risks for energy companies includes steps S101 to S104. Details are as follows: Step S101. Obtain relevant data from the multi-source heterogeneous audit of energy enterprises, perform field filtering on the relevant data, remove redundant coded fields that are repeated with preset key fields, and perform rule-based filling on the missing unit name samples in the filtered relevant data to obtain preprocessed relevant data.
[0038] Specifically, in order to solve the problem of integrating and improving the quality of multi-source heterogeneous data from energy companies, high-quality preprocessed data is generated by acquiring multi-source data, removing redundant coded fields, and filling in missing unit names in a regularized manner, thus providing reliable support for subsequent modeling.
[0039] Multi-source heterogeneous data acquisition includes: Data sources covering core business systems such as procurement (supplier information, procurement amount), engineering (project progress, cost), finance (accounts, reports), and OA (approval process).
[0040] Data is acquired through ETL tools (such as Apache Airflow) or API interfaces, and is incrementally extracted to the data warehouse in real time or periodically to ensure data integrity (such as historical data for the past 3 years) and timeliness (such as daily synchronization of the latest data).
[0041] For example, extract "supplier name", "purchase amount" and "company code" from the procurement system, and extract "company name", "financial expenses" and "report date" from the financial system.
[0042] Pre-defined key fields are core fields defined based on audit requirements (such as "company name", "audit indicator value", "time stamp" and "business type").
[0043] Redundancy identification and removal: Identify duplicate coded fields through the field mapping table (e.g., if "Unit Code_Purchase" in the procurement system and "Unit Code_Finance" in the financial system both correspond to "Unit Name" and have the same coding rules, then "Unit Code_Finance" is a redundant field), and use SQL statements (e.g., ALTER TABLE Procurement Data DROP COLUMN Unit Code_Finance;) to delete the redundancy.
[0044] Missing unit name regularization imputation includes: Missing identification: Scanning samples with empty "Unit Name" using data quality tools (such as GreatExpectations).
[0045] The completion rules include: Related field derivation: If the sample has a "unit code", it is filled by querying the enterprise organizational structure table (e.g., a unit code-unit name mapping table) (e.g., "unit code=001" corresponds to "XX Power Group Headquarters"). Business scenario derivation: If the sample has fields such as "project number" and "approver", it is derived through business logic (e.g., "project number=GC-2025-001" corresponds to "XX Gas Branch"). Default value completion: If derivation is not possible, "Pending confirmation - XX system" is filled and marked for manual verification.
[0046] If the "Company Name" field in an OA approval record is empty, but the "Approver = Zhang San", the "Company Name = XX Environmental Protection Subsidiary" field can be filled in using the employee-company mapping table.
[0047] Step S102. Perform modeling sample screening and feature vector construction on the preprocessed relevant data. Iterate through the combinations of warning units and audit risk indicators corresponding to the relevant data to screen and obtain the effective samples after screening. Use the sliding window method to process the effective samples and generate modeling data. Train the preset CART regression tree prediction model based on the generated modeling data. Optimize the model hyperparameters through multi-fold cross-validation to determine the optimal minimum number of leaf nodes parameter. Use the minimum number of leaf nodes parameter to train the model on the modeling data to obtain the audit risk indicator prediction model.
[0048] Specifically, to address the problem of unscientific existing modeling logic, we traverse and filter effective samples by combining early warning units and indicators, generate modeling data using the sliding window method, and optimize hyperparameters through CART regression tree training and multi-fold cross-validation to obtain an accurate prediction model.
[0049] By iterating through the combination of “early warning unit (group / provincial / municipal subsidiary) - audit risk indicators (such as power line loss rate, gas supply and sales difference rate, environmental emission compliance rate)” (such as “XX provincial branch - gas supply and sales difference rate”).
[0050] Valid conditions: Data integrity (no missing core fields); Time continuity (at least 6 months of continuous data to meet the sliding window requirement); Business rationality (indicator values are within a reasonable range, such as "line loss rate" 3%-10%).
[0051] For example, the "Gas Supply and Sales Difference Rate of XX Municipal Subsidiary" has continuous data from 2023 to 2025, with monthly values ranging from 4% to 8%, which meets the conditions for a valid sample.
[0052] The window size is determined based on the periodicity of the indicator (such as a monthly cycle). The window size is set to k=6 (using the first 6 months to predict the 7th month).
[0053] Data transformation converts time-series data into supervised learning samples (input: indicator values for the first k months + features; output: indicator value for the (k+1)th month). For example, the input for predicting July 2025 is the "gas supply and sales difference rate" + "unit code" from January to June 2025, and the output is the value for July 2025. For example, 36 months of data (2023-2025) for "XX subsidiary - gas supply and sales difference rate" will generate 30 samples (36-6=30).
[0054] CART regression tree model training and hyperparameter optimization include: Model selection: CART supports mixed features (numerical + categorical), and the output tree structure facilitates subsequent threshold extraction, making it suitable for the characteristics of energy enterprise data. Hyperparameter optimization includes: Parameter range: The minimum number of leaf nodes (min_samples_leaf) is set to 1-20 (to avoid overfitting / underfitting). The average MSE is calculated through 5-fold cross-validation, and the min_samples_leaf with the smallest MSE is selected (e.g., when min_samples_leaf=5, MSE=0.008). Model training: The CART model is trained on the modeling data using the optimal parameters to obtain the audit risk indicator prediction model (e.g., the tree structure has 10 internal nodes, and the splitting rule is such as "gas supply and sales difference rate ≤ 5%").
[0055] Step S103. Based on the tree structure information output by the audit risk indicator prediction model, extract the feature splitting threshold of each node, construct a threshold decision table, verify the extracted splitting thresholds, correct the thresholds that fail the verification, and form a risk threshold standard that is adapted to the actual audit business of energy enterprises.
[0056] Specifically, to address the issues of subjective thresholds and disconnect from models in existing threshold implementations, a threshold standard adapted to the business of energy companies is formed through CART tree structure splitting for threshold extraction, threshold decision table construction, business verification and correction.
[0057] Extracting split thresholds from a tree structure includes: Tree structure acquisition: Obtaining internal node information (split features, thresholds) through the model's `tree_` attribute (e.g., the `sklearn` library). Threshold extraction: Traversing nodes, mapping feature indices to names (e.g., index 1 corresponds to "gas supply and sales difference rate"), and extracting thresholds (e.g., `threshold=5.0` corresponds to 5.0%). For example, extracting thresholds such as "gas supply and sales difference rate ≤ 5%" and "unit code = 002" from the "XX subsidiary - gas supply and sales difference rate" tree.
[0058] Constructing the threshold decision table includes: Field design: including "Feature Name", "Warning Unit", "Audit Risk Indicator", "Splitting Threshold", "Node Level", "Sample Quantity", etc. Data population: Filling the extracted thresholds into the table.
[0059] Verification methods include: Business rule verification: comparing with company regulations (e.g., the "Gas Supply and Sales Difference Rate Management Measures" stipulates that "an early warning is required if the difference exceeds 5%", so the 5.0% threshold complies with the business rule). Data distribution verification: analyzing the sample distribution corresponding to the threshold (e.g., "≤5%" samples account for 60%, which conforms to historical data distribution). Prediction effect verification: testing with a validation set (e.g., the "≤5%" group has an MSE of 0.005, indicating a small error and thus the threshold is effective).
[0060] Correction methods: Business experts adjust (e.g., if the threshold conflicts with regulations, correct it to the regulated value); retrain the model (e.g., if the sample distribution is abnormal, adjust min_samples_leaf to re-extract the threshold). Example: The 5.0% threshold conforms to business rules and data distribution, and the verification is successful; the threshold "unit code=001" needs to be corrected to the stricter "line loss rate ≤3%".
[0061] Step S104. Obtain the audit data to be monitored from energy companies, obtain the corresponding feature vectors to be predicted, input the feature vectors to be predicted into the trained audit risk indicator prediction model, output the individual and combined predicted values of the corresponding indicators for the month to be monitored, compare the output individual and combined predicted values with the corrected risk threshold standard, determine the risk level of the corresponding audit risk indicator, generate an early warning signal, and at the same time, combine the feature importance analysis results to identify the main influencing factors of risk and form an audit risk early warning prediction result.
[0062] Specifically, in order to address the lack of a closed-loop process, a complete "prediction-early warning-analysis" closed loop is formed through data processing, predicted value output, risk level assessment, and influencing factor analysis, thereby achieving proactive risk management.
[0063] The data processing and feature vector construction to be monitored includes: Data acquisition: Obtaining the latest data (procurement, engineering, etc.) for the month to be monitored (e.g., January 2026). Preprocessing: Processing according to step S101 (removing redundancy and filling missing data), and constructing the feature vector to be predicted using the sliding window method (e.g., "gas supply and sales difference rate" + "unit code" for July-December 2025).
[0064] Forecast Output (Individual and Consolidated): Individual Forecast: Input the feature vector into the model and output the indicator value for each unit in the month to be monitored (e.g., the predicted value of "gas supply and sales difference rate" for subsidiary XX is 5.2%). Consolidated Forecast: The weighted average of the predicted values of subordinate units by the parent unit according to business scale (e.g., the consolidated value of XX provincial branch = (5.2% × 10 million + 4.8% × 20 million) / 30 million = 5.0%).
[0065] Risk Level Assessment and Early Warning Signal Generation: Level Classification: Based on revised threshold standards (e.g., "≤5% low risk, 5%-10% medium risk, >10% high risk"). Comparison Assessment: Both individual and consolidated values must be compared (e.g., subsidiary XX's 5.2% is medium risk, consolidated value 5.0% is low risk, but a penetrating early warning for individual medium risk is required). Early Warning Signals: Generate signals of different colors (green / yellow / red), including unit, indicator, month, predicted value, and level (e.g., "Subsidiary XX - Gas Supply and Sales Difference Rate - January 2026: 5.2%, Medium Risk").
[0066] The analysis of key risk influencing factors includes: Feature importance assessment: The impact of features on prediction is obtained using `model.feature_importances_` (e.g., "Previous Period Supply-Sales Difference Rate" has the highest importance of 0.5). Influencing factor identification: Based on importance ranking, the root causes of risk are determined (e.g., the main reason for risk in subsidiary XX is "Previous Period Supply-Sales Difference Rate = 5.1%").
[0067] The audit risk early warning prediction results include: Results content: a list of early warning signals (sorted by risk level, with high risk at the top); analysis of risk influencing factors (e.g., "Subsidiary XX is at medium risk, mainly due to a high supply-demand difference ratio in the previous period"); and recommended remedial measures (e.g., "Review the purchase contracts for December 2025 and strengthen leakage detection"). Results presentation: Visualized using a dashboard (e.g., marking high-risk units on a map, displaying early warning signals in tables, and showing the importance of features in charts), facilitating auditors' rapid identification and handling of risks.
[0068] In some embodiments, such as Figure 2 As shown, the audit risk identification, early warning, and prediction model is based on the energy company's big data platform, integrating heterogeneous data from multiple sources such as finance, safety production, supply chain management, and engineering management to construct a risk monitoring system covering core businesses such as electricity, gas, and environmental protection. Around 22 key indicators, the CART regression tree algorithm is used to achieve intelligent risk identification and prediction, outputting risk early warning signals. This helps the audit work shift from post-event verification to pre-event early warning, and from single-point inspection to comprehensive collaboration, promoting the group's risk prevention and control work to "know, enable, warn, and plan." The model consists of a data model and an algorithm model. The data model is built on a data warehouse and provides training data for the algorithm model. After training, the algorithm model provides predicted values for specific times. Then, the data model combines historical and current data with predicted data to calculate and output red, yellow, and green light warning results.
[0069] In some embodiments, such as Figure 3 As shown, a deviation graph (spider plot) is designed to evaluate individual and combined value predictions. The "actual value - predicted value" deviation graph visually displays the degree of deviation between the predicted and actual values. The horizontal axis represents the actual value of the indicator, and the vertical axis represents the model's predicted value. The auxiliary line y=x represents "completely unbiased". The closer the scatter points are to the auxiliary line, the better the prediction effect. The greater the deviation, the lower the accuracy. The graph allows for quick identification of samples where "the predicted value differs significantly from the actual value," providing direction for model optimization.
[0070] The preset accuracy target for this application is "error rate less than 5%" (based on the accuracy requirements of auditing work). In actual results, over 90% of the indicators have an error rate below 2%, far exceeding the preset target, and the deviations are mainly concentrated in the low-risk value range (with even smaller prediction deviations for high-risk values), effectively supporting the core requirement of "early warning for high-risk situations." The scatter points of all indicators are densely distributed near the y=x auxiliary line, with no obvious offset trend, indicating a high consistency between the predicted and actual values. The average proportion of the 11 individual value indicators (calculated as "MAE / half of the coordinate range" (i.e., the proportion of average absolute error to the data fluctuation range) to eliminate the influence of differences in the dimensions of different indicators) is 0.00079 (i.e., 0.079%), less than 0.1%, indicating extremely high prediction accuracy for individual values. Figure 4 As shown, the average proportion of the 18 combined value indicators (to eliminate the impact of differences in the dimensions of different indicators, the "MAE / half of the coordinate range" (i.e., the proportion of the average absolute error to the data fluctuation range) is 0.01463. Except for a few indicators (such as the smoke and dust emission performance indicator) whose proportion is slightly higher due to the high complexity of the data, the error of most indicators is less than 2%, which meets the accuracy requirements for audit risk prediction.
[0071] like Figure 5 As shown, a classification and evaluation of early warning indicators (accuracy bar chart) is provided. The accuracy bar chart of the early warning indicators is used to evaluate the predictive performance of risk levels (red / yellow / green lights), including precision (the mean proportion of samples that predict a warning light of that color that is also a warning light of that color), recall (the mean proportion of samples that correctly predict a warning light of that color), accuracy (the proportion of all correctly predicted samples out of all samples), and F1 score (the harmonic mean of precision and recall). The chart uses a 0.85 auxiliary line to mark the preset target, visually demonstrating whether the model meets the business requirements.
[0072] like Figure 6 , Figure 7 and Figure 8 As shown, by providing an audit risk monitoring and early warning management dashboard as a platform to present the effects of audit risk identification, early warning, and prediction models, a real-time visual monitoring and management center for company risks can be achieved. The dashboard integrates three dimensions—core competitiveness, operational risk, and compliance security—and aggregates eight major areas—operating efficiency, management efficiency, financial security, safety accidents, and pollution emissions—to provide integrated management of risk early warning and trend prediction for 22 key indicators. Through a transparent management view design, the dashboard supports multi-level risk monitoring from the group level to individual units, enabling full-chain traceability of indicators from revenue growth rate to gross profit margin.
[0073] Results Analysis and Explanation of Excellence: The core requirement of audit risk early warning is to "not miss high-risk events." In this project, the recall rates of 13 out of 14 early warning indicators were close to or exceeded 0.75, with 7 of them close to or exceeded 0.85, and the highest reaching 1.00, which can avoid "missed high-risk assessments" to a certain extent. At the same time, the distribution of precision rate is similar to that of recall rate, thus effectively reducing the waste of audit resources caused by "false positives" and balancing risk control and efficiency requirements. Seven of the 14 early warning indicators were close to or exceeded the 0.85 support line, and the average F1 score of the 14 early warning indicators was 0.83, indicating that the model has high accuracy in judging risk levels. Considering the severely uneven distribution of the three early warning light colors in the data, a weighted calculation (assigning weights according to sample distribution) was used to calculate the precision and recall rates. Half of the indicators still achieved an F1 score of 0.85 or higher, proving the stability of the model under imbalanced data.
[0074] In some embodiments, after forming the audit risk warning prediction result, the method further includes: performing application verification, data verification, rationality verification and standard verification on the audit risk warning prediction result, and iteratively optimizing the audit risk indicator prediction model and risk threshold standard based on the verification results and business feedback information.
[0075] The core technology of this embodiment is to construct a closed-loop optimization mechanism for audit risk early warning and prediction results. After generating audit risk early warning and prediction results, the effectiveness and adaptability of the results are ensured through multi-dimensional verification. In combination with the verification results and business feedback information, the audit risk indicator prediction model and risk threshold standards are continuously iterated and optimized to improve the accuracy and business adaptability of the model and thresholds, and to ensure the long-term effectiveness and reliability of audit risk monitoring, early warning and prediction work.
[0076] The verification of early warning prediction results involves initiating a multi-dimensional verification process after the audit risk early warning prediction results are generated. This process includes application verification, data verification, rationality verification, and compliance verification. Application verification focuses on verifying whether the early warning prediction results can meet the data retrieval requirements of the business application layer and support data calls on various risk display pages. Data verification focuses on confirming whether the data upon which the early warning prediction results are based covers key operational indicators, ensuring adequate data coverage. Rationality verification focuses on checking the model construction logic, hierarchical relationships, and the correspondence between the application layer and the display pages to avoid model redundancy. Compliance verification focuses on verifying whether the model complies with established naming, consistency, storage lifecycle, and other relevant compliance requirements.
[0077] The model and threshold iterative optimization process involves collecting the results of the multi-dimensional verification mentioned above, while also summarizing feedback from the business level. This process identifies shortcomings in the audit risk indicator prediction model and risk threshold standards, such as insufficient prediction accuracy and inadequate alignment of thresholds with actual business needs. To address these issues, the audit risk indicator prediction model is optimized through parameter adjustments and retraining, and the risk threshold standards are revised and improved. After optimization, multi-dimensional verification is conducted again until the model and thresholds meet actual business requirements, forming a closed-loop iterative mechanism of "verification-feedback-optimization-re-verification".
[0078] In some embodiments, the field filtering process for the relevant data, which removes redundant coded fields that overlap with preset key fields, includes: reading relevant data from the multi-source heterogeneous audit of the energy enterprise and extracting the field information contained in the relevant data; pre-setting a key field list, which includes primary key, business date, indicator name, warning unit name, compiling unit name, individual value, and combined value; comparing the extracted field information with the preset key field list one by one, and filtering out the data content corresponding to the fields that are consistent with the fields in the key field list; identifying and filtering out redundant coded fields that overlap with the preset key fields, specifically the warning unit code and the compiling unit code, which overlap with the data information corresponding to the warning unit name and the compiling unit name in the key field list, respectively; removing the filtered redundant coded fields, retaining all data content corresponding to the key fields, and completing the field filtering process for the relevant data.
[0079] The core technology of this embodiment is to perform field filtering on multi-source heterogeneous audit-related data. By pre-setting a list of key fields, valid data fields are filtered, and redundant coded fields that are repeated with the key fields are identified and eliminated. This achieves preliminary data simplification, lays the foundation for subsequent data preprocessing and modeling, and improves data processing efficiency and data quality.
[0080] Data reading and field extraction: By reading relevant data from multi-source heterogeneous audits, all field information contained in the data is fully extracted, clarifying the field composition of the data and providing a foundation for subsequent screening work.
[0081] Key field presets are achieved by pre-setting a list of key fields, which includes the core fields required to support subsequent modeling and business analysis. Specifically, these fields include primary key, business date, indicator name, alert subject name, compiling subject name, individual value, and merged value. This ensures that the selected fields can meet the core requirements of subsequent data processing and model training.
[0082] Field comparison and filtering involves comparing all extracted data field information with a preset list of key fields one by one, filtering out the data content corresponding to fields that match the fields in the list of key fields, and eliminating redundant fields that are unrelated to the key fields, thus achieving preliminary simplification of data fields.
[0083] Redundant coding field identification and removal involves further identifying redundant coding fields that overlap with preset key fields. These redundant coding fields specifically include the warning subject code and the compiling subject code, whose corresponding data information is identical to the warning subject name and compiling subject name in the key field list, respectively, and has no additional business value. All identified redundant coding fields are removed, retaining only the data content corresponding to the key fields, thus completing the field filtering process for the relevant data.
[0084] In some embodiments, the step of performing rule-based imputation on missing unit name samples in the filtered relevant data to obtain preprocessed relevant data includes: traversing the relevant data after field filtering, checking each sample for missing unit name fields, where the unit name fields include warning unit name fields and compiling unit name fields; for samples where the warning unit name field is empty, filling the warning unit name field of the sample with a preset string of "no warning unit" according to a preset imputation rule; for samples where the compiling unit name field is empty, filling the compiling unit name field of the sample with a preset string of "no compiling unit" according to a preset imputation rule; after completing the rule-based imputation of all missing unit name samples, performing integrity verification on the imputed data to confirm that there are no missing unit name samples, and outputting the data as preprocessed relevant data after the verification passes.
[0085] The core technology of this embodiment is to perform rule-based imputation of missing subject name samples in the relevant data after field filtering. By setting unified imputation rules, the problem of missing subject names in the data is solved, ensuring the integrity of the data and providing high-quality and complete data support for subsequent data preprocessing, feature engineering and model training.
[0086] Missing sample detection involves iterating through the relevant data after field filtering and checking each sample for missing entries in the subject name field. The subject name field specifically includes the warning subject name field and the compilation subject name field, ensuring that no missing sample is missed.
[0087] Missing sample imputation is performed by filling in the missing samples according to a preset unified imputation rule. For samples where the warning subject name field is empty, the warning subject name field of the sample is uniformly filled with the preset string "No warning subject"; for samples where the compilation subject name field is empty, the compilation subject name field of the sample is uniformly filled with the preset string "No compilation subject", ensuring the uniformity and standardization of the imputation rule.
[0088] After completing the rule-based imputation of all missing subject name samples, the data integrity is verified by checking each sample to ensure that no missing subject name samples are missed. Once the verification is successful, this data is output as preprocessed data for subsequent feature engineering and model training.
[0089] In some embodiments, the process of screening modeling samples and constructing feature vectors for the preprocessed relevant data includes: performing text feature standardization encoding on the preprocessed relevant data to convert the textual features into numerical features that the model can recognize; constructing a composite identifier for the warning unit and the compiling unit, concatenating the name of the warning unit and the name of the compiling unit for each sample as a unique identifier for the corresponding unit to resolve the ambiguity of different names for the same unit; performing serial number encoding on the constructed composite identifier and indicator name to generate corresponding unit codes and indicator codes, and saving the encoding dictionary for subsequent business mapping and interpretation; traversing the combinations of warning units and audit risk indicators corresponding to the preprocessed relevant data for screening to obtain the screened valid samples; using the sliding window method to process the valid samples, extracting relevant feature information from the valid samples and assembling them into feature vectors, and combining them with the corresponding target values to generate modeling data; wherein, the dimensions of the feature vector include unit code, indicator code, value type identifier, and historical indicator values for a preset time period, and the value type identifier is used to distinguish between individual values and combined values.
[0090] The core technology of this embodiment is to perform modeling sample selection and feature vector construction on the preprocessed relevant data. It solves the problem that text features cannot be recognized by the model by standardizing and encoding text features, obtains effective samples by combination selection, and generates modeling data by processing effective samples through the sliding window method, so as to provide suitable input data for subsequent model training.
[0091] Text feature standardization coding transforms preprocessed data into numerical features that the model cannot directly recognize (such as the name of the warning entity, the name of the compiling entity, and the name of the indicator). Specifically, it constructs a composite identifier for the warning entity and the compiling entity, concatenating the names of these entities to create a unique identifier for each sample, thus resolving ambiguity regarding different names for the same entity. Subsequently, the constructed composite identifier and the indicator name are sequentially encoded to generate corresponding entity and indicator codes, and this coding dictionary is saved for subsequent business mapping and data interpretation.
[0092] The effective sample screening process involves iterating through the combinations of warning subjects and audit risk indicators corresponding to the preprocessed relevant data, screening each combination, and obtaining the effective samples after screening to ensure that the samples have sufficient time series data to support subsequent prediction work.
[0093] The modeling data generation employs a sliding window method to process the selected valid samples, extracting relevant feature information from the valid samples and assembling it into feature vectors. These feature vectors are then combined with corresponding target values to generate modeling data. The dimensions of the feature vectors include subject encoding, indicator encoding, value type identifier, and historical indicator values for a preset time period. The value type identifier distinguishes between individual values and merged values, ensuring that the generated modeling data meets the input requirements for model training.
[0094] In some embodiments, the step of traversing relevant data to filter combinations of early warning units and audit risk indicators to obtain filtered valid samples includes: extracting all early warning unit information and all audit risk indicator information from preprocessed relevant data to construct possible combinations of early warning units and audit risk indicators; for each combination of early warning units and audit risk indicators, counting the number of business date records contained in the relevant data corresponding to each combination of early warning units and audit risk indicators; setting a preset sample filtering threshold, which is the minimum historical record duration required to ensure sufficient time-series data to support prediction; comparing the historical data record duration of each combination of early warning units and audit risk indicators with the preset sample filtering threshold, and filtering out combinations with historical data record duration not less than the preset sample filtering threshold as valid combinations; extracting all sample data corresponding to all valid combinations, deduplicating the extracted sample data, removing duplicate samples, and obtaining filtered valid samples and outputting them.
[0095] The core technology of this embodiment is to specifically implement the modeling sample screening process. By traversing the combination of early warning subjects and audit risk indicators, statistically analyzing historical records, and setting screening thresholds, effective samples with sufficient time-series data support are selected, and samples with insufficient data are eliminated, thus ensuring the accuracy and reliability of subsequent model training.
[0096] The combined construction extracts all early warning subject information and all audit risk indicator information from the preprocessed relevant data, and constructs all possible combinations of early warning subjects and audit risk indicators based on the extracted information, ensuring coverage of all potential subject-indicator correspondences.
[0097] Historical record statistics determine the number of business date records contained in the relevant data corresponding to each warning subject and audit risk indicator combination. This helps to determine the historical data accumulation period for each combination and whether it has the time-series data foundation to support model prediction.
[0098] The screening threshold is set by pre-setting a sample screening threshold. This threshold is the minimum historical record duration required to ensure that there is enough time series data to support the prediction. Combined with the model training requirements for time series data, a reasonable threshold standard is set to ensure that the selected samples can meet the time series requirements of model training.
[0099] Effective combination screening compares the historical data recording duration of each warning subject and audit risk indicator combination with a preset sample screening threshold, selecting combinations with a historical data recording duration not less than the preset sample screening threshold as effective combinations, and eliminating combinations with insufficient historical data recording duration.
[0100] Effective sample extraction and deduplication involves extracting all sample data corresponding to all effective combinations, deduplicating the extracted sample data to remove duplicate samples, and avoiding interference from duplicate data in model training. Finally, the filtered effective samples are output for subsequent sliding window processing and modeling data generation.
[0101] In some embodiments, the process of using the sliding window method to process valid samples and generate modeling data includes: classifying and organizing the filtered valid samples, grouping them according to the combination of warning units, audit risk indicators, and value types, with value types divided into individual values and combined values; setting sliding window parameters for each group, with the sliding method being to slide sequentially according to the business date, each window containing historical indicator value data for the previous 12 months and target indicator value data for the 13th month; performing sliding processing on the valid samples within each group according to the set sliding window parameters, generating sliding windows one by one; performing missing value detection on each generated sliding window to determine whether there are missing historical indicator value data for the previous 12 months and target indicator value data for the 13th month within the window; retaining sliding windows without missing values, extracting the unit code, indicator code, value type identifier, and historical indicator values for the previous 12 months within the window, and assembling them into a 15-dimensional input feature vector; extracting the target indicator value for the 13th month within the sliding window as the output target value; associating and matching the input feature vector corresponding to each sliding window without missing values with the output target value to form a modeling data; summarizing the modeling data generated by all groups, removing abnormal data, and obtaining the final modeling data.
[0102] The core technology of this embodiment is to process effective samples using the sliding window method. Through steps such as grouping, window setting, missing value detection, and feature vector assembly, modeling data that meets the requirements of model training is generated, and the time series data is transformed into an input format that the model can recognize, supporting subsequent model training.
[0103] Sample grouping involves classifying and organizing the selected valid samples according to the combination of warning subject, audit risk indicator, and value type. The value type is divided into individual values and combined values to ensure that the subject, indicator, and value type of each group of samples are consistent, which facilitates subsequent sliding window processing.
[0104] The sliding window parameter setting allows for setting sliding window parameters for each group. The sliding method is to slide sequentially according to the business date. Each window contains historical indicator data for the previous 12 months and target indicator data for the 13th month, ensuring that the window can cover sufficient historical time series data to support the prediction of indicator values for the next month.
[0105] Sliding window processing and missing value detection are performed by sliding the valid samples in each group according to the set sliding window parameters to generate sliding windows one by one. Missing value detection is performed on each generated sliding window to determine whether there are missing historical indicator values for the first 12 months and target indicator values for the 13th month, so as to ensure the integrity of the data in the window.
[0106] The feature vector and target value assembly is achieved by extracting the subject code, index code, value type identifier, and historical index values of the previous 12 months from a sliding window that retains no missing values, and assembling them into a 15-dimensional input feature vector; at the same time, the target index value of the 13th month in the sliding window is extracted as the output target value, realizing the correspondence between input features and output targets.
[0107] The modeling data aggregation and optimization process involves associating and matching the input feature vector corresponding to each sliding window without missing values with the output target value to form a modeling data set. All modeling data generated in groups are aggregated, and outliers are removed to avoid them affecting the model training effect, ultimately resulting in modeling data that meets the requirements.
[0108] In some embodiments, optimizing model hyperparameters through multi-fold cross-validation to determine the optimal minimum leaf node number parameter, and training the model on the modeling data using the minimum leaf node number parameter to obtain an audit risk indicator prediction model, includes: setting the number of folds in multi-fold cross-validation to 5; randomly dividing the generated modeling data into 5 equal parts to ensure that the distribution characteristics of each part of the data are consistent, forming 5 sets of training and validation data pairs, with 4 parts in each data pair used as the training set and 1 part as the validation set; determining a candidate parameter set for the minimum leaf node number, the candidate parameter set including four candidate parameters: 1, 3, 5, and 10; for each candidate parameter, sequentially using 5 sets of training and validation data pairs to train and validate the model; and calling a preset CART regression tree training function, inputting the current training set data. The model training process is executed to obtain a temporary training model, with candidate parameters. The corresponding validation set data is input into this temporary training model, and the prediction results of the validation set are output. The mean squared error (MSE) of the prediction results is calculated. The average MSE of each candidate parameter in five validations is calculated, and the candidate parameter with the smallest average MSE is determined as the optimal minimum leaf node parameter. The CART regression tree training function is called, with the full modeling data and the determined optimal minimum leaf node parameter input, and the complete model training process is executed. During training, the model's fitting effect is monitored in real time to avoid overfitting or underfitting. After training, the model's performance is initially verified. If the verification passes, the trained model is determined as the audit risk indicator prediction model, and the model parameters and training logs are saved for subsequent use and optimization.
[0109] The core technology of this embodiment is to optimize the hyperparameters (minimum number of leaf nodes) of the CART regression tree model through multi-fold cross-validation. After determining the optimal hyperparameters, the model is trained using the full set of modeling data to obtain the audit risk indicator prediction model, ensuring the prediction accuracy and stability of the model and avoiding overfitting or underfitting problems.
[0110] Cross-validation parameters are set to 5 folds for multi-fold cross-validation, randomly dividing the generated modeling data into 5 equal parts to ensure that the distribution characteristics of each part of the data are consistent, forming 5 sets of training and validation data pairs. In each set of data pairs, 4 parts are used as the training set and 1 part is used as the validation set, ensuring the objectivity and reliability of the validation results.
[0111] Candidate parameters are determined by identifying the set of candidate parameters with the minimum number of leaf nodes. This set includes four candidate parameters: 1, 3, 5, and 10, covering tree structures from simple to complex, which facilitates the selection of the optimal model complexity.
[0112] Candidate parameter validation and evaluation involves training and validating the model sequentially using five sets of training and validation data for each candidate parameter. A pre-defined CART regression tree training function is invoked, inputting the current training set data and candidate parameters to execute the model training process, resulting in a temporary training model. The corresponding validation set data is then input into this temporary training model, and the prediction results for the validation set are output. The mean squared error (MSE) of the prediction results is calculated as an indicator to evaluate the performance of the candidate parameter.
[0113] The optimal hyperparameters are determined by statistically analyzing the mean squared error of each candidate parameter in 5 validations. The candidate parameter with the smallest mean squared error is determined as the optimal parameter with the minimum number of leaf nodes. The model corresponding to this parameter is neither too simple (avoiding underfitting) nor too complex (avoiding overfitting), ensuring the prediction accuracy and stability of the model.
[0114] Model training and validation are performed by calling the CART regression tree training function, inputting the full set of modeling data and the determined optimal minimum number of leaf nodes, and executing the complete model training process. During training, the model's fitting performance is monitored in real time to avoid overfitting or underfitting. After training, the model's performance is initially validated. If the validation passes, the trained model is designated as the audit risk indicator prediction model, and the model parameters and training logs are saved for subsequent model calls, optimization, and traceability.
[0115] In some embodiments, the step of extracting feature splitting thresholds for each node based on the tree structure information output by the audit risk indicator prediction model and constructing a threshold decision table includes: calling the tree structure extraction interface of the trained audit risk indicator prediction model to obtain the complete tree structure information of the audit risk indicator prediction model, wherein the complete tree structure information includes all non-leaf nodes and related information of leaf nodes; traversing all non-leaf nodes in the tree structure and extracting feature splitting information for each non-leaf node one by one, wherein the feature splitting information includes feature type, feature splitting rule and corresponding feature splitting threshold, wherein the feature splitting rule is a judgment rule that the feature is greater than the threshold or the feature is less than or equal to the threshold; classifying and organizing the extracted feature splitting thresholds according to audit risk indicator categories. Grouping by type, warning unit, and feature type, and recording the non-leaf node number, splitting rule, and prediction error information corresponding to each feature splitting threshold; constructing the header of the threshold decision table, which includes node number, warning unit code, audit risk indicator code, feature type, feature splitting threshold, feature splitting rule, and prediction error; filling each categorized feature splitting threshold and its corresponding associated information into the corresponding position in the threshold decision table, ensuring the information is accurate; performing a completeness check on the constructed threshold decision table to confirm that the feature splitting thresholds of all non-leaf nodes have been extracted and filled in, without omissions or errors; after passing the check, saving the threshold decision table for subsequent verification, correction, and risk level judgment of risk thresholds.
[0116] The core technology of this embodiment is to extract the feature splitting threshold of the tree structure from the trained audit risk indicator prediction model, classify and organize the thresholds, and construct a standardized threshold decision table to provide a unified and standardized basis for subsequent verification, correction and risk level judgment of risk thresholds, and realize the linkage between the prediction model and the threshold judgment.
[0117] Tree structure information is obtained by calling the tree structure extraction interface of the trained audit risk indicator prediction model. The complete tree structure information of the model is obtained, which includes the relevant information of all non-leaf nodes and leaf nodes, providing a basis for the extraction of feature splitting thresholds.
[0118] Feature splitting threshold extraction involves traversing all non-leaf nodes in the tree structure and extracting the feature splitting information for each non-leaf node one by one. This feature splitting information includes the feature type, feature splitting rule, and corresponding feature splitting threshold. The feature splitting rule is a judgment rule that determines whether the feature is greater than or less than or equal to the threshold, ensuring that the extracted threshold information is complete and accurate.
[0119] Threshold classification and organization involves classifying and organizing the extracted feature splitting thresholds, grouping them according to audit risk indicator type, early warning subject, and feature type. The non-leaf node number, splitting rule, and prediction error information corresponding to each feature splitting threshold are recorded to facilitate subsequent threshold management and application.
[0120] The threshold decision table is constructed by creating a header that includes node number, warning subject code, audit risk indicator code, feature type, feature splitting threshold, feature splitting rule, and prediction error, ensuring the completeness and standardization of the information in the decision table. Each feature splitting threshold and its corresponding associated information, after being categorized and organized, is then filled into the corresponding position in the threshold decision table to ensure that the information is filled in accurately, without omissions or errors.
[0121] The decision table is validated and saved by performing a completeness check on the constructed threshold decision table to confirm that all feature splitting thresholds of non-leaf nodes have been extracted and filled in without omissions or errors. After the validation is passed, the threshold decision table is saved for subsequent verification, correction and risk level judgment of risk thresholds, so as to realize the effective linkage between the prediction model and the threshold judgment.
[0122] Please see Figure 9 As shown, Figure 9 This is a schematic diagram of the structure of the audit risk monitoring, early warning, and prediction system 200 for energy enterprises provided in this application embodiment. The audit risk monitoring, early warning, and prediction system 200 for energy enterprises is used to execute the steps of the audit risk monitoring, early warning, and prediction methods for energy enterprises shown in the above embodiments. The audit risk monitoring, early warning, and prediction system 200 for energy enterprises can be a single server or a server cluster, or it can be a terminal, such as a handheld terminal, a laptop computer, a wearable device, or a robot.
[0123] like Figure 9 As shown, the energy company's audit risk monitoring, early warning, and prediction system 200 includes: The data acquisition unit 201 is used to acquire relevant data from the multi-source heterogeneous audit of energy enterprises, perform field filtering on the relevant data, remove redundant coded fields that are repeated with preset key fields, and perform rule-based filling on the missing unit name samples in the filtered relevant data to obtain preprocessed relevant data. Vector construction unit 202 is used to screen modeling samples and construct feature vectors from preprocessed relevant data. It traverses the combination of warning units and audit risk indicators corresponding to relevant data to screen and obtain effective samples. The effective samples are processed using the sliding window method to generate modeling data. Based on the generated modeling data, a pre-set CART regression tree prediction model is trained. The model hyperparameters are optimized through multi-fold cross-validation to determine the optimal minimum number of leaf nodes. The model is trained using the minimum number of leaf nodes to obtain the audit risk indicator prediction model. The threshold extraction unit 203 is used to extract the feature splitting threshold of each node based on the tree structure information output by the audit risk indicator prediction model, construct a threshold decision table, verify the extracted splitting threshold, correct the thresholds that fail the verification, and form a risk threshold standard that is adapted to the actual audit business of energy enterprises. The result generation unit 204 is used to acquire the audit data to be monitored from energy companies, obtain the corresponding feature vector to be predicted, input the feature vector to be predicted into the trained audit risk indicator prediction model, output the individual and combined predicted values of the corresponding indicators for the month to be monitored, compare the output individual and combined predicted values with the corrected risk threshold standard, determine the risk level of the corresponding audit risk indicator, generate an early warning signal, and at the same time, combine the feature importance analysis results to identify the main influencing factors of risk and form an audit risk early warning prediction result.
[0124] In some embodiments, after forming the audit risk warning prediction result, the method further includes: performing application verification, data verification, rationality verification and standard verification on the audit risk warning prediction result, and iteratively optimizing the audit risk indicator prediction model and risk threshold standard based on the verification results and business feedback information.
[0125] In some embodiments, the field filtering process for the relevant data, which removes redundant coded fields that overlap with preset key fields, includes: reading relevant data from the multi-source heterogeneous audit of the energy enterprise and extracting the field information contained in the relevant data; pre-setting a key field list, which includes primary key, business date, indicator name, warning unit name, compiling unit name, individual value, and combined value; comparing the extracted field information with the preset key field list one by one, and filtering out the data content corresponding to the fields that are consistent with the fields in the key field list; identifying and filtering out redundant coded fields that overlap with the preset key fields, specifically the warning unit code and the compiling unit code, which overlap with the data information corresponding to the warning unit name and the compiling unit name in the key field list, respectively; removing the filtered redundant coded fields, retaining all data content corresponding to the key fields, and completing the field filtering process for the relevant data.
[0126] In some embodiments, the step of performing rule-based imputation on missing unit name samples in the filtered relevant data to obtain preprocessed relevant data includes: traversing the relevant data after field filtering, checking each sample for missing unit name fields, where the unit name fields include warning unit name fields and compiling unit name fields; for samples where the warning unit name field is empty, filling the warning unit name field of the sample with a preset string of "no warning unit" according to a preset imputation rule; for samples where the compiling unit name field is empty, filling the compiling unit name field of the sample with a preset string of "no compiling unit" according to a preset imputation rule; after completing the rule-based imputation of all missing unit name samples, performing integrity verification on the imputed data to confirm that there are no missing unit name samples, and outputting the data as preprocessed relevant data after the verification passes.
[0127] In some embodiments, the process of screening modeling samples and constructing feature vectors for the preprocessed relevant data includes: performing text feature standardization encoding on the preprocessed relevant data to convert the textual features into numerical features that the model can recognize; constructing a composite identifier for the warning unit and the compiling unit, concatenating the name of the warning unit and the name of the compiling unit for each sample as a unique identifier for the corresponding unit to resolve the ambiguity of different names for the same unit; performing serial number encoding on the constructed composite identifier and indicator name to generate corresponding unit codes and indicator codes, and saving the encoding dictionary for subsequent business mapping and interpretation; traversing the combinations of warning units and audit risk indicators corresponding to the preprocessed relevant data for screening to obtain the screened valid samples; using the sliding window method to process the valid samples, extracting relevant feature information from the valid samples and assembling them into feature vectors, and combining them with the corresponding target values to generate modeling data; wherein, the dimensions of the feature vector include unit code, indicator code, value type identifier, and historical indicator values for a preset time period, and the value type identifier is used to distinguish between individual values and combined values.
[0128] In some embodiments, the step of traversing relevant data to filter combinations of early warning units and audit risk indicators to obtain filtered valid samples includes: extracting all early warning unit information and all audit risk indicator information from preprocessed relevant data to construct possible combinations of early warning units and audit risk indicators; for each combination of early warning units and audit risk indicators, counting the number of business date records contained in the relevant data corresponding to each combination of early warning units and audit risk indicators; setting a preset sample filtering threshold, which is the minimum historical record duration required to ensure sufficient time-series data to support prediction; comparing the historical data record duration of each combination of early warning units and audit risk indicators with the preset sample filtering threshold, and filtering out combinations with historical data record duration not less than the preset sample filtering threshold as valid combinations; extracting all sample data corresponding to all valid combinations, deduplicating the extracted sample data, removing duplicate samples, and obtaining filtered valid samples and outputting them.
[0129] In some embodiments, the process of using the sliding window method to process valid samples and generate modeling data includes: classifying and organizing the filtered valid samples, grouping them according to the combination of warning units, audit risk indicators, and value types, with value types divided into individual values and combined values; setting sliding window parameters for each group, with the sliding method being to slide sequentially according to the business date, each window containing historical indicator value data for the previous 12 months and target indicator value data for the 13th month; performing sliding processing on the valid samples within each group according to the set sliding window parameters, generating sliding windows one by one; performing missing value detection on each generated sliding window to determine whether there are missing historical indicator value data for the previous 12 months and target indicator value data for the 13th month within the window; retaining sliding windows without missing values, extracting the unit code, indicator code, value type identifier, and historical indicator values for the previous 12 months within the window, and assembling them into a 15-dimensional input feature vector; extracting the target indicator value for the 13th month within the sliding window as the output target value; associating and matching the input feature vector corresponding to each sliding window without missing values with the output target value to form a modeling data; summarizing the modeling data generated by all groups, removing abnormal data, and obtaining the final modeling data.
[0130] In some embodiments, optimizing model hyperparameters through multi-fold cross-validation to determine the optimal minimum leaf node number parameter, and training the model on the modeling data using the minimum leaf node number parameter to obtain an audit risk indicator prediction model, includes: setting the number of folds in multi-fold cross-validation to 5; randomly dividing the generated modeling data into 5 equal parts to ensure that the distribution characteristics of each part of the data are consistent, forming 5 sets of training and validation data pairs, with 4 parts in each data pair used as the training set and 1 part as the validation set; determining a candidate parameter set for the minimum leaf node number, the candidate parameter set including four candidate parameters: 1, 3, 5, and 10; for each candidate parameter, sequentially using 5 sets of training and validation data pairs to train and validate the model; and calling a preset CART regression tree training function, inputting the current training set data. The model training process is executed to obtain a temporary training model, with candidate parameters. The corresponding validation set data is input into this temporary training model, and the prediction results of the validation set are output. The mean squared error (MSE) of the prediction results is calculated. The average MSE of each candidate parameter in five validations is calculated, and the candidate parameter with the smallest average MSE is determined as the optimal minimum leaf node parameter. The CART regression tree training function is called, with the full modeling data and the determined optimal minimum leaf node parameter input, and the complete model training process is executed. During training, the model's fitting effect is monitored in real time to avoid overfitting or underfitting. After training, the model's performance is initially verified. If the verification passes, the trained model is determined as the audit risk indicator prediction model, and the model parameters and training logs are saved for subsequent use and optimization.
[0131] In some embodiments, the step of extracting feature splitting thresholds for each node based on the tree structure information output by the audit risk indicator prediction model and constructing a threshold decision table includes: calling the tree structure extraction interface of the trained audit risk indicator prediction model to obtain the complete tree structure information of the audit risk indicator prediction model, wherein the complete tree structure information includes all non-leaf nodes and related information of leaf nodes; traversing all non-leaf nodes in the tree structure and extracting feature splitting information for each non-leaf node one by one, wherein the feature splitting information includes feature type, feature splitting rule and corresponding feature splitting threshold, wherein the feature splitting rule is a judgment rule that the feature is greater than the threshold or the feature is less than or equal to the threshold; classifying and organizing the extracted feature splitting thresholds according to audit risk indicator categories. Grouping by type, warning unit, and feature type, and recording the non-leaf node number, splitting rule, and prediction error information corresponding to each feature splitting threshold; constructing the header of the threshold decision table, which includes node number, warning unit code, audit risk indicator code, feature type, feature splitting threshold, feature splitting rule, and prediction error; filling each categorized feature splitting threshold and its corresponding associated information into the corresponding position in the threshold decision table, ensuring the information is accurate; performing a completeness check on the constructed threshold decision table to confirm that the feature splitting thresholds of all non-leaf nodes have been extracted and filled in, without omissions or errors; after passing the check, saving the threshold decision table for subsequent verification, correction, and risk level judgment of risk thresholds.
[0132] It should be noted that, for the sake of convenience and brevity, the specific working process of the energy enterprise audit risk monitoring, early warning and prediction system and each module described above can be referred to the corresponding content in the various embodiments of the energy enterprise audit risk monitoring, early warning and prediction method, and will not be repeated here.
[0133] The aforementioned method for monitoring, warning, and predicting audit risks for energy companies can be implemented as a computer program, which can be used in various ways, such as... Figure 9 It runs on the device shown.
[0134] Please see Figure 10 , Figure 10 This is a schematic block diagram of the structure of a computer device provided in an embodiment of this application. The computer device includes a processor, a memory, and a network interface connected via a device bus, wherein the memory may include a storage medium and internal memory.
[0135] The storage medium can store operating devices and computer programs. The computer program includes program instructions that, when executed, cause the processor to perform any energy company's audit risk monitoring, early warning, and prediction methods.
[0136] The processor provides computing and control capabilities, supporting the operation of the entire computer device.
[0137] Internal memory provides an environment for the execution of computer programs in non-volatile storage media. When these computer programs are executed by a processor, the processor can perform any audit risk monitoring, early warning, and prediction method for an energy company.
[0138] This network interface is used for network communication, such as sending assigned tasks. Those skilled in the art will understand that... Figure 10 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the terminal to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0139] It should be understood that the processor can be a Central Processing Unit (CPU), but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among these, a general-purpose processor can be a microprocessor or any conventional processor.
[0140] In one embodiment, the processor is configured to run a computer program stored in memory to perform the following steps: Obtain relevant data from multi-source heterogeneous audits of energy enterprises, perform field filtering on the relevant data, remove redundant coded fields that are repeated with preset key fields, and perform rule-based filling on the missing unit name samples in the filtered relevant data to obtain preprocessed relevant data. The preprocessed data is used to screen modeling samples and construct feature vectors. The combination of warning units and audit risk indicators corresponding to the relevant data is traversed to screen and obtain the effective samples. The effective samples are processed using the sliding window method to generate modeling data. The pre-set CART regression tree prediction model is trained based on the generated modeling data. The model hyperparameters are optimized through multi-fold cross-validation to determine the optimal minimum number of leaf nodes. The model is trained using the minimum number of leaf nodes to obtain the audit risk indicator prediction model. Based on the tree structure information output by the audit risk indicator prediction model, feature splitting thresholds of each node are extracted, a threshold decision table is constructed, the extracted splitting thresholds are verified, and thresholds that fail verification are corrected to form a risk threshold standard that is adapted to the actual audit business of energy enterprises. The system acquires audit data from energy companies to be monitored, obtains corresponding feature vectors to be predicted, inputs these feature vectors into a trained audit risk indicator prediction model, and outputs individual and combined predicted values for the corresponding indicators for the month to be monitored. The output individual and combined predicted values are compared with the corrected risk threshold standards to determine the risk level of the corresponding audit risk indicators, generate early warning signals, and, in conjunction with the feature importance analysis results, identify the main influencing factors of risk, thus forming audit risk early warning prediction results.
[0141] In some embodiments, after forming the audit risk warning prediction result, the method further includes: performing application verification, data verification, rationality verification and standard verification on the audit risk warning prediction result, and iteratively optimizing the audit risk indicator prediction model and risk threshold standard based on the verification results and business feedback information.
[0142] In some embodiments, the field filtering process for the relevant data, which removes redundant coded fields that overlap with preset key fields, includes: reading relevant data from the multi-source heterogeneous audit of the energy enterprise and extracting the field information contained in the relevant data; pre-setting a key field list, which includes primary key, business date, indicator name, warning unit name, compiling unit name, individual value, and combined value; comparing the extracted field information with the preset key field list one by one, and filtering out the data content corresponding to the fields that are consistent with the fields in the key field list; identifying and filtering out redundant coded fields that overlap with the preset key fields, specifically the warning unit code and the compiling unit code, which overlap with the data information corresponding to the warning unit name and the compiling unit name in the key field list, respectively; removing the filtered redundant coded fields, retaining all data content corresponding to the key fields, and completing the field filtering process for the relevant data.
[0143] In some embodiments, the step of performing rule-based imputation on missing unit name samples in the filtered relevant data to obtain preprocessed relevant data includes: traversing the relevant data after field filtering, checking each sample for missing unit name fields, where the unit name fields include warning unit name fields and compiling unit name fields; for samples where the warning unit name field is empty, filling the warning unit name field of the sample with a preset string of "no warning unit" according to a preset imputation rule; for samples where the compiling unit name field is empty, filling the compiling unit name field of the sample with a preset string of "no compiling unit" according to a preset imputation rule; after completing the rule-based imputation of all missing unit name samples, performing integrity verification on the imputed data to confirm that there are no missing unit name samples, and outputting the data as preprocessed relevant data after the verification passes.
[0144] In some embodiments, the process of screening modeling samples and constructing feature vectors for the preprocessed relevant data includes: performing text feature standardization encoding on the preprocessed relevant data to convert the textual features into numerical features that the model can recognize; constructing a composite identifier for the warning unit and the compiling unit, concatenating the name of the warning unit and the name of the compiling unit for each sample as a unique identifier for the corresponding unit to resolve the ambiguity of different names for the same unit; performing serial number encoding on the constructed composite identifier and indicator name to generate corresponding unit codes and indicator codes, and saving the encoding dictionary for subsequent business mapping and interpretation; traversing the combinations of warning units and audit risk indicators corresponding to the preprocessed relevant data for screening to obtain the screened valid samples; using the sliding window method to process the valid samples, extracting relevant feature information from the valid samples and assembling them into feature vectors, and combining them with the corresponding target values to generate modeling data; wherein, the dimensions of the feature vector include unit code, indicator code, value type identifier, and historical indicator values for a preset time period, and the value type identifier is used to distinguish between individual values and combined values.
[0145] In some embodiments, the step of traversing relevant data to filter combinations of early warning units and audit risk indicators to obtain filtered valid samples includes: extracting all early warning unit information and all audit risk indicator information from preprocessed relevant data to construct possible combinations of early warning units and audit risk indicators; for each combination of early warning units and audit risk indicators, counting the number of business date records contained in the relevant data corresponding to each combination of early warning units and audit risk indicators; setting a preset sample filtering threshold, which is the minimum historical record duration required to ensure sufficient time-series data to support prediction; comparing the historical data record duration of each combination of early warning units and audit risk indicators with the preset sample filtering threshold, and filtering out combinations with historical data record duration not less than the preset sample filtering threshold as valid combinations; extracting all sample data corresponding to all valid combinations, deduplicating the extracted sample data, removing duplicate samples, and obtaining filtered valid samples and outputting them.
[0146] In some embodiments, the process of using the sliding window method to process valid samples and generate modeling data includes: classifying and organizing the filtered valid samples, grouping them according to the combination of warning units, audit risk indicators, and value types, with value types divided into individual values and combined values; setting sliding window parameters for each group, with the sliding method being to slide sequentially according to the business date, each window containing historical indicator value data for the previous 12 months and target indicator value data for the 13th month; performing sliding processing on the valid samples within each group according to the set sliding window parameters, generating sliding windows one by one; performing missing value detection on each generated sliding window to determine whether there are missing historical indicator value data for the previous 12 months and target indicator value data for the 13th month within the window; retaining sliding windows without missing values, extracting the unit code, indicator code, value type identifier, and historical indicator values for the previous 12 months within the window, and assembling them into a 15-dimensional input feature vector; extracting the target indicator value for the 13th month within the sliding window as the output target value; associating and matching the input feature vector corresponding to each sliding window without missing values with the output target value to form a modeling data; summarizing the modeling data generated by all groups, removing abnormal data, and obtaining the final modeling data.
[0147] In some embodiments, optimizing model hyperparameters through multi-fold cross-validation to determine the optimal minimum leaf node number parameter, and training the model on the modeling data using the minimum leaf node number parameter to obtain an audit risk indicator prediction model, includes: setting the number of folds in multi-fold cross-validation to 5; randomly dividing the generated modeling data into 5 equal parts to ensure that the distribution characteristics of each part of the data are consistent, forming 5 sets of training and validation data pairs, with 4 parts in each data pair used as the training set and 1 part as the validation set; determining a candidate parameter set for the minimum leaf node number, the candidate parameter set including four candidate parameters: 1, 3, 5, and 10; for each candidate parameter, sequentially using 5 sets of training and validation data pairs to train and validate the model; and calling a preset CART regression tree training function, inputting the current training set data. The model training process is executed to obtain a temporary training model, with candidate parameters. The corresponding validation set data is input into this temporary training model, and the prediction results of the validation set are output. The mean squared error (MSE) of the prediction results is calculated. The average MSE of each candidate parameter in five validations is calculated, and the candidate parameter with the smallest average MSE is determined as the optimal minimum leaf node parameter. The CART regression tree training function is called, with the full modeling data and the determined optimal minimum leaf node parameter input, and the complete model training process is executed. During training, the model's fitting effect is monitored in real time to avoid overfitting or underfitting. After training, the model's performance is initially verified. If the verification passes, the trained model is determined as the audit risk indicator prediction model, and the model parameters and training logs are saved for subsequent use and optimization.
[0148] In some embodiments, the step of extracting feature splitting thresholds for each node based on the tree structure information output by the audit risk indicator prediction model and constructing a threshold decision table includes: calling the tree structure extraction interface of the trained audit risk indicator prediction model to obtain the complete tree structure information of the audit risk indicator prediction model, wherein the complete tree structure information includes all non-leaf nodes and related information of leaf nodes; traversing all non-leaf nodes in the tree structure and extracting feature splitting information for each non-leaf node one by one, wherein the feature splitting information includes feature type, feature splitting rule and corresponding feature splitting threshold, wherein the feature splitting rule is a judgment rule that the feature is greater than the threshold or the feature is less than or equal to the threshold; classifying and organizing the extracted feature splitting thresholds according to audit risk indicator categories. Grouping by type, warning unit, and feature type, and recording the non-leaf node number, splitting rule, and prediction error information corresponding to each feature splitting threshold; constructing the header of the threshold decision table, which includes node number, warning unit code, audit risk indicator code, feature type, feature splitting threshold, feature splitting rule, and prediction error; filling each categorized feature splitting threshold and its corresponding associated information into the corresponding position in the threshold decision table, ensuring the information is accurate; performing a completeness check on the constructed threshold decision table to confirm that the feature splitting thresholds of all non-leaf nodes have been extracted and filled in, without omissions or errors; after passing the check, saving the threshold decision table for subsequent verification, correction, and risk level judgment of risk thresholds.
[0149] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to implement the steps of the energy enterprise audit risk monitoring, early warning, and prediction method provided in any embodiment of this application.
[0150] The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiments, such as the hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, SmartMedia Card (SMC), Secure Digital (SD) card, or Flash Card equipped on the computer device.
[0151] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for monitoring, warning, and predicting audit risks in energy enterprises, characterized in that, include: Obtain relevant data from multi-source heterogeneous audits of energy enterprises, perform field filtering on the relevant data, remove redundant coded fields that are repeated with preset key fields, and perform rule-based filling on the missing unit name samples in the filtered relevant data to obtain preprocessed relevant data. The preprocessed data is used to screen modeling samples and construct feature vectors. The combination of warning units and audit risk indicators corresponding to the relevant data is traversed to screen and obtain the effective samples. The effective samples are processed using the sliding window method to generate modeling data. The pre-set CART regression tree prediction model is trained based on the generated modeling data. The model hyperparameters are optimized through multi-fold cross-validation to determine the optimal minimum number of leaf nodes. The model is trained using the minimum number of leaf nodes to obtain the audit risk indicator prediction model. Based on the tree structure information output by the audit risk indicator prediction model, feature splitting thresholds of each node are extracted, a threshold decision table is constructed, the extracted splitting thresholds are verified, and thresholds that fail verification are corrected to form a risk threshold standard that is adapted to the actual audit business of energy enterprises. The system acquires audit data from energy companies to be monitored, obtains corresponding feature vectors to be predicted, inputs these feature vectors into a trained audit risk indicator prediction model, and outputs individual and combined predicted values for the corresponding indicators for the month to be monitored. The output individual and combined predicted values are compared with the corrected risk threshold standards to determine the risk level of the corresponding audit risk indicators, generate early warning signals, and, in conjunction with the feature importance analysis results, identify the main influencing factors of risk, thus forming audit risk early warning prediction results.
2. The method according to claim 1, characterized in that, Following the formation of the audit risk warning and prediction results, the following is also included: The audit risk warning and prediction results are applied, verified by data, validated for reasonableness, and validated for compliance. Based on the verification results and business feedback, the audit risk indicator prediction model and risk threshold standards are iteratively optimized.
3. The method according to claim 1, characterized in that, The process of filtering the relevant data to remove redundant coded fields that overlap with preset key fields includes: Read the relevant data from the multi-source heterogeneous audit of the energy company and extract the field information contained in the relevant data; A list of key fields is pre-defined, which includes primary key, business date, indicator name, warning unit name, compiling unit name, individual value, and combined value. The extracted field information is compared one by one with the preset key field list, and the data content corresponding to the fields that are consistent with the fields in the key field list is filtered out. Identify and filter out redundant coding fields that are duplicated with preset key fields. Specifically, the redundant coding fields are the warning unit code and the compilation unit code. The warning unit code and the compilation unit code are duplicated with the data information corresponding to the warning unit name and the compilation unit name in the key field list, respectively. Remove redundant coded fields from the filter, retain all data content corresponding to the key fields, and complete the field filtering process for the relevant data.
4. The method according to claim 1, characterized in that, The step of performing rule-based imputation on missing unit name samples in the filtered relevant data to obtain preprocessed relevant data includes: Traverse the relevant data after field filtering and check each sample for missing unit name fields. The unit name fields include the warning unit name field and the compiling unit name field. For samples where the warning unit name field is empty, the warning unit name field of the sample is uniformly filled with the preset string "no warning unit" according to the preset filling rules. For samples where the organization name field is empty, fill the organization name field with the preset string "no organization" according to the preset filling rules. After completing the rule-based imputation of all missing unit name samples, the imputed data is checked for completeness to confirm that no missing unit name samples are missing. If the check passes, the data is used as the preprocessed relevant data and output.
5. The method according to claim 1, characterized in that, The process of modeling, selecting samples, and constructing feature vectors from the preprocessed data includes: The preprocessed data is subjected to text feature standardization encoding to transform the text features into numerical features that the model can recognize. By constructing a composite identifier for the warning unit and the compiling unit, the name of the warning unit and the name of the compiling unit of each sample are concatenated to serve as the unique identifier of the corresponding unit of the sample, so as to solve the ambiguity problem of different names for the same unit. The constructed composite identifier and indicator name are respectively processed by serial number encoding to generate corresponding unit codes and indicator codes, and the encoding dictionary is saved for subsequent business mapping and interpretation. The relevant data after preprocessing is traversed and the combination of warning units and audit risk indicators is filtered to obtain the effective samples after filtering. The sliding window method is used to process the effective samples, extract relevant feature information from the effective samples and assemble them into feature vectors, and combine them with the corresponding target values to generate modeling data; The feature vector includes unit code, index code, value type identifier, and historical index values for a preset time period. The value type identifier is used to distinguish between individual values and merged values.
6. The method according to claim 1, characterized in that, The process of traversing relevant data and filtering the combination of early warning units and audit risk indicators yields a filtered, valid sample, including: From the preprocessed relevant data, extract information on all early warning units and all audit risk indicators, and construct possible combinations of early warning units and audit risk indicators; For each warning unit and audit risk indicator combination, count the number of business date records contained in the relevant data corresponding to each warning unit and audit risk indicator combination; A preset sample selection threshold is set, which is the minimum historical record duration required to ensure that there is enough time series data to support the prediction. The historical data recording duration of each early warning unit and audit risk indicator combination is compared with the preset sample screening threshold, and combinations with a historical data recording duration not less than the preset sample screening threshold are selected as valid combinations. Extract all sample data corresponding to all valid combinations, perform deduplication on the extracted sample data, remove duplicate samples, and then output the filtered valid samples.
7. The method according to claim 1, characterized in that, The process of using the sliding window method to process valid samples and generate modeling data includes: The selected valid samples were classified and organized, and grouped according to the combination of warning units, audit risk indicators and value types. The value types were divided into individual values and combined values. Set sliding window parameters for each group. The sliding method is to slide sequentially according to the business date. Each window contains historical indicator data for the previous 12 months and target indicator data for the 13th month. According to the set sliding window parameters, the effective samples in each group are processed by sliding, and a sliding window is generated one by one; For each generated sliding window, a missing value detection is performed to determine whether there are missing historical indicator values for the previous 12 months and target indicator values for the 13th month within the window; A sliding window with no missing values is retained. The unit code, index code, value type identifier, and historical index values of the previous 12 months within the window are extracted and assembled into a 15-dimensional input feature vector. Extract the target indicator value for the 13th month within the sliding window as the output target value; The input feature vector corresponding to each sliding window without missing values is associated and matched with the output target value to form a modeling data; after summarizing all the modeling data generated by the groups and removing outliers, the final modeling data is obtained.
8. The method according to claim 1, characterized in that, The process of optimizing model hyperparameters through multi-fold cross-validation to determine the optimal minimum number of leaf nodes, and then using this minimum number of leaf nodes to train the model on the modeling data, yields an audit risk indicator prediction model, including: The number of folds in the multi-fold cross-validation is set to 5. The generated modeling data is randomly divided into 5 equal parts to ensure that the distribution characteristics of each part of the data are consistent, forming 5 sets of training and validation data pairs. In each set of data pairs, 4 parts are used as the training set and 1 part is used as the validation set. Determine the candidate parameter set for the minimum number of leaf nodes, the candidate parameter set including four candidate parameters: 1, 3, 5, and 10; For each candidate parameter, the model was trained and validated using 5 sets of training and validation data in sequence. Call the preset CART regression tree training function, input the current training set data and candidate parameters, execute the model training process, and obtain a temporary training model; Input the corresponding validation set data into the temporary training model, output the prediction results of the validation set, and calculate the mean square error of the prediction results; The mean squared error of each candidate parameter in 5 validations is calculated, and the candidate parameter with the smallest mean squared error is determined as the optimal parameter with the minimum number of leaf nodes. Call the CART regression tree training function, input the full set of modeling data and the determined optimal minimum number of leaf nodes, and execute the complete model training process. During the training process, monitor the model's fitting effect in real time to avoid overfitting or underfitting. After training, perform preliminary performance verification on the model. If the verification is successful, the trained model is identified as the audit risk indicator prediction model, and the model parameters and training logs are saved for subsequent use and optimization.
9. The method according to claim 1, characterized in that, The tree structure information output by the audit risk indicator prediction model is used to extract the feature splitting threshold of each node and construct a threshold decision table, including: Call the tree structure extraction interface of the trained audit risk indicator prediction model to obtain the complete tree structure information of the audit risk indicator prediction model. The complete tree structure information includes the relevant information of all non-leaf nodes and leaf nodes. Traverse all non-leaf nodes in the tree structure and extract the feature splitting information of each non-leaf node one by one. The feature splitting information includes feature type, feature splitting rule and corresponding feature splitting threshold, wherein the feature splitting rule is the judgment rule of feature greater than threshold or feature less than or equal to threshold. The extracted feature splitting thresholds are classified and organized, and grouped according to audit risk indicator type, early warning unit, and feature type. The non-leaf node number, splitting rule, and prediction error information corresponding to each feature splitting threshold are recorded. Construct the header of the threshold decision table, which includes node number, early warning unit code, audit risk indicator code, feature type, feature splitting threshold, feature splitting rule, and prediction error; Each feature splitting threshold and its corresponding association information, after being categorized and organized, are entered into the corresponding position in the threshold decision table to ensure that the information is filled in accurately. The completed threshold decision table is validated for completeness to ensure that all feature splitting thresholds for non-leaf nodes have been extracted and filled in without omissions or errors. After validation, the threshold decision table is saved for subsequent validation, correction and risk level determination of risk thresholds.
10. An audit risk monitoring, early warning, and prediction system for energy enterprises, characterized in that, The method applied to any one of claims 1-9 includes: The data acquisition unit is used to acquire relevant data from multi-source heterogeneous audits of energy enterprises, perform field filtering on the relevant data, remove redundant coded fields that are repeated with preset key fields, and perform rule-based filling on missing unit name samples in the filtered relevant data to obtain preprocessed relevant data. The vector construction unit is used to screen modeling samples and construct feature vectors from the preprocessed relevant data. It traverses the relevant data to screen the combinations of warning units and audit risk indicators to obtain the effective samples. The sliding window method is used to process the effective samples to generate modeling data. Based on the generated modeling data, a pre-set CART regression tree prediction model is trained. The model hyperparameters are optimized through multi-fold cross-validation to determine the optimal minimum number of leaf nodes. The model is then trained using the minimum number of leaf nodes to obtain the audit risk indicator prediction model. The threshold extraction unit is used to extract the feature splitting threshold of each node based on the tree structure information output by the audit risk indicator prediction model, construct a threshold decision table, verify the extracted splitting thresholds, correct the thresholds that fail the verification, and form a risk threshold standard that is adapted to the actual audit business of energy enterprises. The result generation unit is used to acquire audit data to be monitored from energy companies, obtain the corresponding feature vectors to be predicted, input the feature vectors to be predicted into the trained audit risk indicator prediction model, and output the individual and combined predicted values of the corresponding indicators for the month to be monitored. The output individual and combined predicted values are compared with the corrected risk threshold standard to determine the risk level of the corresponding audit risk indicator, generate early warning signals, and at the same time, combine the feature importance analysis results to identify the main influencing factors of risk and form audit risk early warning prediction results.