Power control flow characteristic sampling method and system based on multi-source data reconstruction

By using an upsampling method combining K-means clustering and SMOTE, along with the Random Forest algorithm to fill in missing values, and combining lattice cryptography signature verification and the GBDT algorithm, the problems of imbalance and missing values ​​in the power control flow dataset were solved. This improved the completeness of the dataset and the recognition ability of the classifier, thereby enhancing the efficiency of blockchain signature verification and the predictive performance of the model.

CN120876152APending Publication Date: 2025-10-31NANJING NARI NETWORK SECURITY TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510706828.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-29
Publication Date
2025-10-31

AI Technical Summary

Technical Problem

The multi-source dataset of power control commands varies greatly in size across different regions and time periods, resulting in imbalanced datasets and missing values, which affects the classifier's recognition ability and the completeness of the dataset.

Method used

The dataset is balanced using an upsampling method combining K-means clustering and SMOTE, missing values ​​are filled using the Random Forest algorithm, blockchain signature verification efficiency is improved using a lattice cryptography signature verification algorithm, and model parameters are trained using the GBDT algorithm.

Benefits of technology

It achieves a balance in the size of datasets across regions, improves the classifier's ability to identify minority classes, ensures dataset integrity, and enhances blockchain signature verification efficiency and model prediction performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120876152A_ABST
    Figure CN120876152A_ABST
Patent Text Reader

Abstract

The invention discloses a power control flow characteristic sampling method and system based on multi-source data reconstruction. The method comprises the following steps: collecting basic control instruction flow, extracting instruction characteristics and constructing a basic database; generating signature verification parameters; each master station stores the provided data information and signature into a block chain; a statistical learning method is adopted to realize balance of data set scales among regions; reconstructing filling data for the data set with the missing value; verifying the signature of each master station system node after reconstructing the filling data; carrying out integrated learning by utilizing the reconstructed data set to obtain model parameters; verifying the prediction capability of the model parameters by using a cross validation mode; and evaluating by using an error measurement model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power network big data reconstruction computing technology, and in particular to a power control flow characteristic sampling method and system based on multi-source data reconstruction. Background Technology

[0002] With the progress of CPSSE (Cyber-Physical-Social System in Energy), a cross-disciplinary research framework has been established, encompassing changes in industrial control commands and energy elements such as power load and energy storage facilities, as well as social elements such as national geographical distribution. These changes have brought significant challenges to safe power production. For a long time, the relationship between the use of power control commands and safe production has been studied in isolation, urgently requiring new analytical methods. Therefore, integrating multi-source control command flow data for predictive analysis of power control operation status is crucial for promoting an intrinsic mechanism for industrial control operations that leverages the inherent internal factors such as the architecture, mechanisms, and patterns of power monitoring systems to achieve safety capabilities and enable adaptive network security protection, perception, and response, thereby improving the ability to defend against unknown threats. However, the control command flow data collected from various regions is becoming increasingly "multi-sourced." In the original data collection process, the dataset sizes generated by different regions and time periods often vary greatly, and some parameters may be lost when the power network system generates flow data. Therefore, these datasets cannot be directly used for big data calculations. Summary of the Invention

[0003] In view of the aforementioned existing problems, the present invention is proposed.

[0004] To address the aforementioned issues, this invention proposes a power control flow feature sampling method and system based on multi-source data reconstruction. This method can reduce the disparity in dataset size between different regions and fill in datasets with missing data. To address the problem of large differences in dataset size across regions and time periods, this invention employs upsampling methods in resampling to increase minority class samples, thus balancing the imbalanced data distribution and improving the classifier's ability to identify the minority class. The upsampling method used in this invention combines K-means clustering with SMOTE to increase the number of minority samples. To address the potential for missing values ​​in the dataset, this invention uses the Random Forest algorithm to train and predict missing values, then fills in the missing values ​​to ensure dataset integrity.

[0005] To solve the above-mentioned technical problems, the present invention provides the following technical solution:

[0006] In a first aspect, the present invention provides a power control flow characteristic sampling method based on multi-source data reconstruction, comprising:

[0007] Collect basic control command traffic, extract command features, and build a basic database;

[0008] Generate signature verification parameters;

[0009] Each main site will store the provided data and signatures into the blockchain;

[0010] Statistical learning methods are used to balance the dataset size among different regions;

[0011] Reconstruct and fill in missing data for datasets with missing values;

[0012] After reconstructing and filling in the data, the signatures of each main station system node are verified;

[0013] The model parameters are obtained by ensemble learning using the reconstructed dataset.

[0014] Cross-validation was used to verify the predictive power of the model parameters.

[0015] Evaluation was conducted using an error measurement model.

[0016] As a preferred embodiment of the power control flow characteristic sampling method based on multi-source data reconstruction described in this invention, the step of collecting basic control command flow, extracting command features, and constructing a basic database includes:

[0017] Collect basic instructions;

[0018] A cross-domain power database is built based on basic instructions.

[0019] As a preferred embodiment of the power control flow characteristic sampling method based on multi-source data reconstruction described in this invention, the generation of signature verification parameters includes:

[0020] Determine the security dimension and large prime modulus, randomly generate a uniformly distributed public matrix, and generate a sparse short vector private key for each user;

[0021] A global challenge is generated by binding the message and public key using mathematical functions. When aggregating signatures, the sum of response values ​​is calculated and then encapsulated.

[0022] As a preferred embodiment of the power control flow feature sampling method based on multi-source data reconstruction described in this invention, wherein: the data reconstruction and imputation of datasets with missing values ​​includes:

[0023] A power network flow load estimation model is constructed using ensemble learning algorithms;

[0024] Machine learning models are used to predict missing values ​​in a dataset and reconstruct diverse instruction samples.

[0025] As a preferred embodiment of the power control flow characteristic sampling method based on multi-source data reconstruction described in this invention, the following step involves verifying the signatures of each master station system node after the reconstructed and filled data:

[0026] Recalculate the same globally consistent c and check the product A·z of the public key matrix shared by all signers and the aggregated signature value. agg Is it equal to the sum of the aggregated public key vector in the blockchain multiplied by the challenge value plus the modulo of the temporary random vector accumulation value of the signers, T·c+∑y? i mod q;

[0027] If they are not equal, it means that c does not match, the verification fails, and the data reconstruction step information has been tampered with. If the signature verification is successful, the reconstructed dataset is used for machine learning calculations.

[0028] As a preferred embodiment of the power control flow feature sampling method based on multi-source data reconstruction described in this invention, the step of deriving model parameters through ensemble learning using the reconstructed dataset includes:

[0029] The data reconstructed using the GBDT algorithm is used again for training to obtain the model parameters.

[0030] Model parameters represent the relative importance of each variable in the power network flow characteristics.

[0031] As a preferred embodiment of the power control flow characteristic sampling method based on multi-source data reconstruction described in this invention, the step of verifying the predictive ability of the model parameters using cross-validation includes:

[0032] The predictive power of the model parameters was verified using 10-fold cross-validation.

[0033] The reconstructed dataset is divided into 10 parts. Each time, one part is used as the validation set and the remaining 9 parts are used as the training set. The validation and training are repeated 10 times. The predictive performance of the model is evaluated by calculating the average of the 10 validation accuracies.

[0034] Secondly, the present invention provides a power control flow characteristic sampling system based on multi-source data reconstruction, comprising: a data acquisition module for collecting basic control command flow, extracting command features and constructing a basic database;

[0035] The generation module generates signature verification parameters;

[0036] The storage module allows each master station to store the provided data and signatures into the blockchain.

[0037] The balancing module uses statistical learning methods to balance the dataset size across different regions.

[0038] The imputation module reconstructs and imputes data for datasets with missing values.

[0039] The reconstruction module verifies the signatures of each main station system node after reconstructing and filling in the data.

[0040] The computation module uses the reconstructed dataset to perform ensemble learning to derive model parameters.

[0041] The validation module uses cross-validation to verify the predictive ability of the model parameters.

[0042] The evaluation module uses an error measurement model for evaluation.

[0043] Thirdly, the present invention provides an electronic device, comprising:

[0044] Memory and processor;

[0045] The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, they implement the steps of the power control flow characteristic sampling method based on multi-source data reconstruction.

[0046] Fourthly, the present invention provides a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the steps of the power control flow characteristic sampling method based on multi-source data reconstruction.

[0047] Compared with existing technologies, the beneficial effects of this invention are as follows: This invention proposes a power control flow feature sampling method and system based on multi-source data reconstruction, which can reduce the gap in dataset size between different regions and fill in datasets with missing data. To address the problem of large differences in dataset size between different regions and time periods, this invention uses upsampling methods in resampling to increase minority class samples, making the imbalanced data distribution more balanced, thereby improving the classifier's ability to identify the minority class. The upsampling method used in this invention combines K-means clustering with SMOTE to increase the number of minority samples. To address the problem of missing values ​​in the dataset, this invention uses the RandomForest algorithm to train and predict missing values, filling in the missing values ​​into the dataset to ensure its integrity.

[0048] In addition, this solution uses blockchain technology to record the data reconstruction process. Since traditional blockchain signature verification is often performed one by one, which is very time-consuming, this solution uses a lattice-based signature verification algorithm. This lattice-based signature algorithm verifies the signatures by verifying the response values ​​(z) of multiple signers. i Linear superposition results in a single short vector z. agg And it is bound to the global challenge value c to generate the final signature σ. agg =(z agg c), during verification, only A·z needs to be checked. agg Is it related to T·c+∑y? i The modq values ​​are equal. Compared to traditional signature verification algorithms, which require decrypting each signer's ciphertext using their public keys and then comparing the hashes, involving numerous decryption steps, the core advantage of this verification algorithm lies in:

[0049] 1) Post-quantum security (based on the LWE / SIS hard problem, resistant to quantum computing attacks);

[0050] 2) Aggregation efficiency (verification complexity is reduced from O(N) to O(1), suitable for high-concurrency scenarios such as blockchain);

[0051] 3) Bandwidth optimization (signature size is fixed as an n-dimensional vector, independent of the number of signers). Attached Figure Description

[0052] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0053] Figure 1 This is a summary diagram of the overall claims for a power control flow feature sampling method based on multi-source data reconstruction according to an embodiment of the present invention.

[0054] Figure 2 This is a schematic diagram of the overall process of a power control flow feature sampling method based on multi-source data reconstruction according to an embodiment of the present invention.

[0055] Figure 3 This is a flowchart illustrating the Random Forest algorithm steps of a power control flow feature sampling method based on multi-source data reconstruction, as described in an embodiment of the present invention.

[0056] Figure 4 This is a diagram illustrating the ten-fold cross-validation model of the power control flow feature sampling method based on multi-source data reconstruction, as described in one embodiment of the present invention. Detailed Implementation

[0057] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of the present invention.

[0058] Example 1, referring to Figure 1 As one embodiment of the present invention, a power control flow characteristic sampling method based on multi-source data reconstruction is provided, comprising:

[0059] S1: Collect basic control command traffic from the open command systems of power companies in various regions, extract command features from the traffic, and build a basic database;

[0060] S2: Generate signature verification parameters;

[0061] S3: Each main station will store the provided data and signatures into the blockchain, providing a reliable and traceable record;

[0062] S4: Employ statistical learning methods to balance the dataset size across different regions;

[0063] S5: Reconstruct and fill in data for datasets with missing values;

[0064] S6: After reconstructing and filling in the data, verify the signatures of each main station system node;

[0065] S7: Use the reconstructed dataset to perform ensemble learning to derive model parameters;

[0066] S8: Use cross-validation to verify the predictive power of the model parameters;

[0067] S9: Use an error measurement model for evaluation;

[0068] S10: Record the entire data reconstruction process on the blockchain.

[0069] It should be noted that this invention discloses a method and system for sampling power control flow characteristics based on multi-source data reconstruction, solving the problems of uneven distribution of multi-source datasets, missing values ​​in the datasets, and the lack of a suitable traceability carrier for sensitive data calculation processes. The technical solution is as follows: First, basic data, including power control command flow characteristic data and related environmental factor data, is collected and organized, and then gridded to establish a basic database. During gridding, each master station system data provider converts data information into hash values ​​and stores them in the blockchain. This solution uses a lattice cryptographic signature method to improve blockchain signature verification efficiency. Second, upsampling (combining K-means clustering and SMOTE) is used to compensate for areas with sparse data distribution, reducing the gap in dataset distribution between regions. Then, Random Forest technology is used to train the dataset to build a model, and the missing values ​​in the dataset are calculated using the model parameters, making the reconstructed dataset more complete. Finally, the reconstructed dataset is used again to calculate the model parameters using GBDT technology, which can be used to analyze whether the control command characteristics indicate the possibility of abnormal power grid control or group dispatching and control.

[0070] Example 2, refer to Figure 1-4 As an embodiment of the present invention, based on the above embodiment, a power control flow feature sampling method based on multi-source data reconstruction is provided.

[0071] In this embodiment, step S1 involves collecting basic control command traffic from the scheduling automation master station control systems (hereinafter referred to as master station systems) of various manufacturers. Tools such as Wireshark and FATT scripts are used to capture the traffic and extract command feature data. Taking basic control commands in the open instruction architecture of industrial control as an example, these include no-operation instructions (NOP), zero-jump instructions (BZ), negative-jump instructions (BN), carry-jump instructions (BC), and overflow-jump instructions (BV). The specific collection steps are as follows: A1-A2.

[0072] A1: Collects the basic instruction code 0X and its corresponding instruction name, instruction traffic data length, heartbeat interval, traffic data packet size, instruction transmission rate, data packet TTL, instruction format (instruction bit length, number of parameters, etc.), instruction flag value, etc.

[0073] A2: Construct a cross-domain power database based on this, taking into account both time and space dimensions. In terms of time dimension: establish a seasonal indicator variable DVA (Date Variable) to represent which quarter of the year, and add it to the basic database. In terms of space dimension: construct a gridded map based on regional dispatching, establish a spatial indicator variable SIV (SpatialIndex Variable), and add it to their respective basic databases.

[0074] In this embodiment of the application, step S2 involves the generation of signature verification parameters. Since blockchain signature verification is involved, the parameters in the signature verification algorithm need to be initialized in the signature scheme. The specific implementation steps are as follows: B1-B2:

[0075] B1: Determine the security dimension and large prime modulus, randomly generate a uniformly distributed public matrix, and generate a sparse short vector private key for each user;

[0076] B2: Generate a global challenge by binding the message and public key through mathematical functions, calculate the sum of response values ​​when aggregating signatures, and then encapsulate them.

[0077] In this embodiment of the application, the mathematical function used is a hash function.

[0078] In an alternative embodiment, the mathematical function may be a deterministic pseudo-random function.

[0079] In another alternative embodiment, the mathematical function may employ other secure hash functions, such as SHA-3, BLAKE2, or BLAKE3.

[0080] B1: First, determine the security dimension n (usually 256 or 512) and the large prime modulus q (e.g., 2^32-1), randomly generate a uniformly distributed public matrix A, and generate a sparse short vector private key s for each user. i (The coefficient is ±1 or 0).

[0081] B2: Generate a global challenge c by binding the message and public key through a hash function, and finally calculate the sum of response values ​​zagg = ∑z when aggregating signatures. i mod q and encapsulate it as σ agg =(z agg (c) The parameters must satisfy q>2n·B (B is the noise limit) to ensure safety. Parameter descriptions will be given in S3.

[0082] In this embodiment of the application, in step S3, each master station stores the provided data information and signature into the blockchain to provide a reliable and traceable record. The specific implementation method is as follows:

[0083] Each main site system administrator, the department responsible for reconstruction computation, and the department responsible for signature aggregation act as consortium blockchain member nodes to generate a consortium blockchain. They perform hash calculations on the power-sensitive data characteristics and dataset size they provide to obtain hash values. Then, each main site system node participating in the data reconstruction computation coordinates the data size, data type, and timestamp they provide to perform hash calculations and generate a single signature σ. i =(z i(where c is globally consistent), then the signature, master station member number, data size, data type, and timestamp are stored in the blockchain. The power grid traffic characteristic dataset is then sent to the department responsible for computation via a secure channel. The department responsible for signature aggregation retrieves the signature σ from the blockchain. i =(z i c), and z i Aggregation yields z agg =∑iz i mod q, z agg Send to the verifier. Because the solution involves many main site system nodes, signature verification can be inefficient. To improve the efficiency of digital signature verification, the solution uses lattice cryptography, which compresses multiple signatures into a single fixed-size signature, significantly improving blockchain verification efficiency. The specific signing method is as follows:

[0084] Single signature: σ i =(z i c)

[0085] Aggregate signature: σ agg =(∑z i mod q,c)(Let z agg =∑iz i mod q)

[0086] Among them, z i This represents the response value of a single signature; the signature response value generated by the i-th signer is usually a short integer vector (with a small range of coefficients, such as {-1,0,1}, but if there are n signers and n is large, the range of coefficients is expanded from {-1,0,1} to {-n,…,n} to increase diversity and prevent private key duplication).

[0087] Generation method:

[0088] z i =y i +c·s i modq

[0089] Among them, y i s is represented as a temporary random vector (commitment value) of the signer; i Let c be the signer's private key vector and s be the global challenge value. This proves that the signer knows the private key s. i And the signature was not forged.

[0090] A large prime number (usually q≈2) 32 ), used to define the finite field Zq in lattice ciphers.

[0091] Large enough to ensure safety (usually q > 230); must satisfy q ≡ 1 mod 2n (Some solutions require this, such as Ring-LWE);

[0092] Limiting the range of values ​​ensures that calculations are performed within a finite domain, preventing overflow and maintaining the complexity of difficult problems.

[0093] A public challenge value generated by a hash function is used to bind all messages to be signed. Calculation formula:

[0094] c = H(A||T||m1||m2||…||mN)

[0095] Where A is the public key matrix shared by all signers (a common parameter in lattice cipher); T is the aggregated public key vector T = ∑A i ·s i modq;

[0096] Where, m i The i-th message to be signed (in this scenario, m) i For each master system providing data, specify the data type, data size, and timestamp information; H() is the cryptographic hash function. Ensuring signatures are bound to specific messages prevents replay attacks. During signature aggregation, all signers share the same c, which is crucial for achieving aggregation.

[0097] Suppose there are two signers and a message:

[0098] Public key matrix A∈Zq n×n ;

[0099] Aggregate public key vector T = [t1, t2, ..., t n (Here, n is a security factor. If n is very large, such as 2^30, even if an attacker obtains part of the signer's private key s...) i It is also impossible to crack the private keys of other signers or the system's global private key.

[0100] Message m1 = "tx1", m2 = "tx2"

[0101] Intermediate calculations:

[0102] data=A.tobytes()+T.tobytes()+b"tx1"+b"tx2"

[0103] Re-hash calculation: c = int.from_bytes(sha256(data).digest(), 'big') % q

[0104] Finally, c is an integer in the range [0, q-1].

[0105] Signature generation: Each signer (main site system node) calculates z.i =y i +c·s i mod q, where c must be globally consistent.

[0106] In this embodiment, after collecting the main station system traffic characteristic data in step S4, due to the significant differences in dataset size among the main station systems in different regions, the data of the smaller datasets is reconstructed to become a larger dataset. A resampling method is used to balance the dataset size. Resampling methods include upsampling and downsampling, which balance the imbalanced data distribution by increasing minority class samples or decreasing majority class samples, thereby improving the classifier's ability to identify the minority class. This scheme uses an upsampling method to balance the dataset: combining K-means clustering with SMOTE to increase the number of minority samples. The specific flow of the K-means clustering and SMOTE combined minority sample oversampling algorithm is as follows:

[0107] Table 1. Algorithm Input and Output

[0108]

[0109]

[0110] Features are normalized using the StandardScaler tool to avoid the influence of unit dimensions on clustering. Minority class samples are divided into k subgroups using K-means to identify data distribution patterns. The total number of samples to be generated is calculated based on the target_ratio and evenly distributed across the clusters. If a cluster has too few samples, at least m+1 samples are forced to be generated. SMOTE is applied independently to each cluster, and k_neighbors automatically adapts to the cluster size (avoiding errors due to insufficient neighbors). Oversampling is only performed when there are enough samples within a cluster (len(X_cluster)>1).

[0111] In this embodiment, step S5 involves reconstructing and filling in missing values ​​in the dataset. This includes steps C1-C2:

[0112] C1: Constructing a power network flow load estimation model using ensemble learning algorithms;

[0113] C2: Use machine learning models to predict missing values ​​in the dataset and reconstruct diverse instruction samples.

[0114] Although the resampling method balanced the differences in the number of data sets in power control networks across different regions, datasets with missing values ​​still appeared during the detection process. Traditional methods mainly involve directly removing these datasets, but this would lead to a waste of a lot of collected data. Therefore, the Random Forest algorithm was used to construct a power network flow load estimation model, and then a regression model was used to predict the missing values ​​in the dataset, thereby reconstructing a dataset that comprehensively covers diverse command samples.

[0115] In the embodiments of this application, the ensemble learning algorithm used is the Random Forest algorithm.

[0116] In an optional embodiment, the ensemble learning algorithm employs the gradient boosting decision tree algorithm.

[0117] In another alternative embodiment, the ensemble learning algorithm used is the Bagging algorithm.

[0118] It should be noted that, as Figure 3 As shown, the working principle of Random Forest can be divided into the following steps:

[0119] A subset is randomly selected from the training dataset, and some feature attributes within that subset are also randomly selected.

[0120] Build a decision tree model and use the subset and feature attributes to train the model.

[0121] Repeat the above two steps until the specified number of decision trees are built.

[0122] When inputting unknown data, a prediction is made for each decision tree, and then the final prediction result is obtained by voting or averaging based on the prediction results of the decision trees.

[0123] In this embodiment of the application, after the data is reconstructed and filled in in step S6, the signatures of each main station system node are verified. In order to verify whether the process information of the reconstructed data has been tampered with, it is necessary to verify the signature on the blockchain. The verification method is as follows: the verifier recalculates the same c and checks whether A·zagg is equal to T·c+∑yi mod q. If they are not equal, it means that c does not match, the verification fails, and it means that the data reconstruction step information may have been tampered with. If the signature verification is successful, the reconstructed dataset is used for machine learning calculation.

[0124] In this embodiment of the application, step S7, which uses the reconstructed dataset to perform ensemble learning to obtain model parameters, includes the following steps D1-D2:

[0125] D1: The data reconstructed using the GBDT algorithm is used to train the model again to obtain the model parameters;

[0126] D2: Model parameters represent the relative importance of each variable in the power network flow characteristics.

[0127] It should be noted that the GBDT (Gradient Boosting Decision Tree) algorithm is used to retrain the data reconstructed from S2 and S3 to obtain model parameters. These model parameters represent the relative importance of each variable in the system, expressed as a percentage, and the sum of the relative importance of all variables is 100%. The working mechanism of GBDT can be represented as follows:

[0128] At the start of training, GBDT uses an initial prediction to represent the average of the overall data. This initial prediction can be the mean of the target variable or any other suitable initial value. The initial prediction represents the model's initial estimate of the overall data.

[0129] GBDT is an iterative algorithm, typically involving multiple iterations. In each iteration, the model trains a new decision tree whose goal is to reduce the residuals of the previous iteration. The specific steps are as follows:

[0130] At the beginning of each iteration, the residual between the current model's predictions of the training data and the actual observed values ​​is calculated. This residual represents the portion that the model failed to predict correctly in the previous iteration.

[0131] Using the calculated residuals as the new target variable, a new decision tree is trained. This tree will attempt to correct the errors of the previous model to reduce the residuals.

[0132] The newly trained decision tree is combined with the previous model. Specifically, the predictions of the new tree are added to the predictions of the previous model to obtain the updated model.

[0133] The specific algorithm flow is expressed as follows:

[0134] Input training set T = {(x1,y1),(x2,y2),...,(x n ,y n Number of regression trees M; Output gradient boosting decision tree;

[0135] Step 1: Initialization, represented as:

[0136]

[0137] Here, argmin represents the value of the independent variable when the expression reaches its minimum value; c is the mean of the input class; L(x) is the loss function. The initialization here is different from the traditional forward step-by-step algorithm, which sets f0(x) = 0. This is done to ensure that the subsequent partial derivative calculation is not at the zero point.

[0138] Step 2: For the m-th base regression tree, find its residual approximation r mi , expressed as:

[0139]

[0140] Step 3: Use the residual r mi to learn the m-th base regression tree and determine the region partition of the m-th base regression tree

[0141] R mj , j = 1, 2…, J

[0142] Step 4: Obtain the final value cmj of Rmj, expressed as:

[0143]

[0144] Step 5: Update the regression tree, expressed as:

[0145]

[0146] Step 6: If m < M, recursively execute Steps 2 - 5. Obtain the final regression tree

[0147]

[0148] Step 7: Calculate the weights, expressed as:

[0149]

[0150] Therefore, in the corresponding Step 5, the updated regression model becomes:

[0151]

[0152] Thus, the model parameters are obtained, and the weight γ of the model parameters can represent the relative importance of each variable in the network system.

[0153] In the embodiment of the present application, in Step S8, the prediction ability of the model parameters is verified by using the method of cross-validation. The specific implementation method is:

[0154] In the embodiment of the present application, the cross-validation adopted is ten-fold cross-validation.

[0155] In an optional embodiment, the cross-validation can adopt stratified K-fold cross-validation.

[0156] In another optional embodiment, the cross-validation can adopt time series cross-validation.

[0157] Such as Figure 4As shown, the predictive ability of the model parameters is validated using 10-fold cross-validation. The reconstructed dataset is divided into 10 parts, with one part used as the validation set and the remaining 9 parts used as the training set each time. The validation and training are repeated 10 times, and the predictive performance of the model is evaluated by calculating the average of the 10 validation accuracies.

[0158] In this embodiment of the application, step S9 uses an error measurement model for evaluation, and the specific implementation is as follows:

[0159] The predictive ability of the model parameters is then measured using indicators such as root mean square error (RMSE), mean relative bias (MFB), F1-score, and AUC-ROC. If the performance of each indicator is good, the relative importance (%) of each variable in the model is used to provide a basis and suggestions for power dispatch and management in the region. The calculation formulas for each indicator are shown below:

[0160]

[0161] Among them, y i Estimated value; y0: Observed value; n: Number of records in the modeling dataset.

[0162] S10. The signature verifier converts the model parameters into hash values, and then stores the hash values, timestamps, and main station system numbers involved in the data reconstruction calculations into the blockchain for traceability of the subsequent calculation process.

[0163] Example 3 illustrates a schematic scheme for a power control flow characteristic sampling method based on multi-source data reconstruction. It should be noted that the technical solution of this power control flow characteristic sampling system based on multi-source data reconstruction belongs to the same concept as the technical solution of the power control flow characteristic sampling method based on multi-source data reconstruction described above. Details not described in detail in the technical solution of the power control flow characteristic sampling system based on multi-source data reconstruction in this embodiment can be found in the description of the technical solution of the power control flow characteristic sampling method based on multi-source data reconstruction described above.

[0164] This embodiment also provides a power control flow characteristic sampling system based on multi-source data reconstruction, including:

[0165] The acquisition module collects basic control command traffic, extracts command features, and builds a basic database.

[0166] The generation module generates signature verification parameters;

[0167] The storage module allows each master station to store the provided data and signatures into the blockchain.

[0168] The balancing module uses statistical learning methods to balance the dataset size across different regions.

[0169] The imputation module reconstructs and imputes data for datasets with missing values.

[0170] The reconstruction module verifies the signatures of each main station system node after reconstructing and filling in the data.

[0171] The computation module uses the reconstructed dataset to perform ensemble learning to derive model parameters.

[0172] The validation module uses cross-validation to verify the predictive ability of the model parameters.

[0173] The evaluation module uses an error measurement model for evaluation.

[0174] This embodiment also provides an electronic device suitable for power control flow feature sampling based on multi-source data reconstruction, comprising: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the power control flow feature sampling method based on multi-source data reconstruction as proposed in the above embodiment.

[0175] This embodiment also provides a storage medium on which a computer program is stored. When the program is executed by a processor, it implements the power control flow characteristic sampling method based on multi-source data reconstruction as proposed in the above embodiments.

[0176] The storage medium proposed in this embodiment and the power control flow characteristic sampling method based on multi-source data reconstruction proposed in the above embodiments belong to the same inventive concept. Technical details not described in detail in this embodiment can be found in the above embodiments, and this embodiment has the same beneficial effects as the above embodiments.

[0177] Based on the above description of the implementation methods, those skilled in the art will clearly understand that the present invention can be implemented using software and necessary general-purpose hardware, and of course, it can also be implemented using hardware. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk, or optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of the various embodiments of the present invention.

[0178] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

[0179] Example 4: The present invention is verified through simulation experiments.

[0180] I. Performance Analysis of the Signature Verification Algorithm in This Scheme:

[0181] The comparison with traditional signatures is shown in Table 2.

[0182] Table 2

[0183] characteristic Lattice-based signature algorithms Traditional signature algorithm Quantum resistance yes no Signature merging method Linear superposition none Signature size (n signatures) O(1) O(1) Verification complexity (n signatures) O(1) O(n)

[0184] Table 3 shows the performance improvements achieved by incorporating blockchain technology.

[0185] Table 3

[0186]

[0187]

[0188]

[0189] The performance benchmarks of the signature algorithm are shown in Table 4.

[0190] Table 4

[0191] parameter Numerical values ​​(n = 512, q = 2^32-1) Single signature time 1.2ms Aggregate 1000 signatures 38ms Verification time 2.1ms Signature size 1.3KB (fixed)

[0192] The signature verification algorithm in this scheme has the quantum attack-resistant security unique to lattice cryptography, and the verification only needs to be done once, reducing the complexity of the verification algorithm to O(1). Compared with traditional signature verification schemes, the signature verification algorithm in this scheme is more secure and more suitable for highly decentralized scenarios such as blockchain, which can greatly improve the process efficiency in multi-source data reconstruction.

[0193] II. Performance advantages of K-means+SMOTE compared to other data reconstruction techniques in this scheme

[0194] K-means first identifies the data cluster structure, and SMOTE then generates synthetic samples within the clusters, avoiding the cluster boundary ambiguity problem caused by traditional oversampling (such as random oversampling).

[0195] By removing outliers through clustering and then oversampling, noise interference can be reduced.

[0196] It performs better than simple interpolation methods for non-uniformly distributed, multimodal data.

[0197] A comparison with other technologies is shown in Table 5.

[0198] Table 5

[0199]

[0200]

[0201] The performance comparison metrics are shown in Table 6.

[0202] Table 6

[0203] index K-means+SMOTE SMOTE Random oversampling Overfitting risk Low middle high computational efficiency middle high high Boundary preservation excellent good Difference Noise robustness excellent middle Difference Category overlap control excellent middle Difference

[0204] Performance comparison of K-means + SMOTE vs other data reconstruction techniques (based on real-world dataset testing)

[0205] The following experiments use a network traffic feature data detection dataset from a power substation system (highly imbalanced, with a fraud sample rate of 0.17%) to compare the performance improvement effects of different data reconstruction techniques on the classifier. Evaluation metrics include F1-Score and AUC-ROC.

[0206] Dataset: Power Station System Command Network Traffic Characteristics Dataset (284,07 records, 20-dimensional features)

[0207] Unreconstructed data: F1-Score: 0.62, AUC-ROC: 0.87

[0208] Testing method: 10-fold cross-validation

[0209] Comparison techniques: K-means+SMOTE (K=10, SMOTE k_neighbors=3), traditional SMOTE, random oversampling.

[0210] The performance improvement comparison table is shown in Table 7.

[0211] Table 7

[0212] index F1-Score promote(%) AUC-ROC promote(%) Raw data (baseline) 0.62 - 0.87 - K-means+SMOTE 0.78 +25.8% 0.94 +8.0% Traditional SMOTE 0.71 +14.5% 0.91 +4.6% Random oversampling 0.65 +4.8% 0.88 +1.1%

[0213] In summary, K-means+SMOTE outperforms traditional SMOTE by 11.3% and random oversampling by 21.0%, demonstrating its superior ability to preserve the decision boundary of the minority class. The 8% improvement in AUC from K-means+SMOTE indicates stronger overall ranking capability.

[0214] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A power control flow characteristic sampling method based on multi-source data reconstruction, characterized in that, include: Collect basic control command traffic, extract command features, and build a basic database; Generate signature verification parameters; Each main site will store the provided data and signatures into the blockchain; Statistical learning methods are used to balance the dataset size across different regions; Reconstruct and fill in missing data for datasets with missing values; After reconstructing and filling in the data, the signatures of each main station system node are verified; The model parameters are obtained by ensemble learning using the reconstructed dataset. Cross-validation was used to verify the predictive power of the model parameters. Evaluation was conducted using an error measurement model.

2. The power control flow characteristic sampling method based on multi-source data reconstruction as described in claim 1, characterized in that, The process of collecting basic control command traffic, extracting command features, and constructing a basic database includes: Collect basic instructions; A cross-domain power database is built based on basic instructions.

3. The power control flow characteristic sampling method based on multi-source data reconstruction as described in claim 2, characterized in that, The generated signature verification parameters include: Determine the security dimension and the large prime modulus, randomly generate a uniformly distributed public matrix, and generate a sparse short vector private key for each user; A global challenge is generated by binding the message and public key using mathematical functions. When aggregating signatures, the sum of response values ​​is calculated and then encapsulated.

4. The power control flow characteristic sampling method based on multi-source data reconstruction as described in claim 3, characterized in that, The process of reconstructing and filling in missing values ​​in a dataset includes: A power network flow load estimation model is constructed using ensemble learning algorithms; Machine learning models are used to predict missing values ​​in a dataset and reconstruct diverse instruction samples.

5. The power control flow characteristic sampling method based on multi-source data reconstruction as described in claim 4, characterized in that, The process of reconstructing and filling in the data, and then verifying the signatures of each main station system node, includes: Recalculate the same global consistency and check if the product of the public key matrix shared by all signers and the aggregated signature value is equal to the sum of the aggregated public key vector in the blockchain multiplied by the challenge value plus the modulo of the signers' temporary random vector accumulation value; If they are not equal, it means that the global consistency does not match, the verification fails, and the data reconstruction step information has been tampered with. If the signature verification is successful, the reconstructed dataset is used for machine learning calculations.

6. The power control flow characteristic sampling method based on multi-source data reconstruction as described in claim 5, characterized in that, The process of deriving model parameters through ensemble learning using the reconstructed dataset includes: The data reconstructed using the GBDT algorithm is used again for training to obtain the model parameters. Model parameters represent the relative importance of each variable in the power network flow characteristics.

7. The power control flow characteristic sampling method based on multi-source data reconstruction as described in claim 6, characterized in that, The method of using cross-validation to verify the predictive ability of the model parameters includes: The predictive power of the model parameters was verified using 10-fold cross-validation. The reconstructed dataset is divided into 10 parts. Each time, one part is used as the validation set and the remaining 9 parts are used as the training set. The validation and training are repeated 10 times. The predictive performance of the model is evaluated by calculating the average of the 10 validation accuracies.

8. A power control flow characteristic sampling system based on multi-source data reconstruction, using the method described in any one of claims 1-7, characterized in that, include: The acquisition module collects basic control command traffic, extracts command features, and builds a basic database. The generation module generates signature verification parameters; The storage module allows each master station to store the provided data and signatures into the blockchain. The balancing module uses statistical learning methods to balance the dataset size across different regions. The imputation module reconstructs and imputes data for datasets with missing values. The reconstruction module verifies the signatures of each main station system node after reconstructing and filling in the data. The computation module uses the reconstructed dataset to perform ensemble learning to derive model parameters. The validation module uses cross-validation to verify the predictive ability of the model parameters. The evaluation module uses an error measurement model for evaluation.

9. An electronic device, comprising: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, they implement the steps of the power control flow characteristic sampling method based on multi-source data reconstruction as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the steps of the power control flow characteristic sampling method based on multi-source data reconstruction as described in any one of claims 1 to 7.