Power grid test data anonymization processing method and device

By classifying the power grid test dataset, and utilizing a multidimensional outlier detection mechanism, k-anonymization algorithm, and differential privacy algorithm, a target test dataset that balances privacy protection and data utility is generated, thus solving the problem of the imbalance between privacy protection and data utility in existing technologies.

CN121598283APending Publication Date: 2026-03-03NORTH CHINA ELECTRICAL POWER RES INST +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511541404.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-27
Publication Date
2026-03-03

AI Technical Summary

Technical Problem

Existing technologies employ a single anonymization method for power grid test data, resulting in an imbalance between privacy protection and data utility, making it difficult to meet the requirements of data accuracy and usability while protecting privacy.

Method used

A multidimensional outlier detection mechanism is used to divide the power grid test dataset into normal and outlier datasets. The k-anonymization algorithm and differential privacy algorithm are used to process them respectively to generate the first and second anonymous datasets, which are then combined to form the target test dataset.

Benefits of technology

By using differentiated processing methods, key features of normal datasets are preserved without revealing detailed features, while maintaining the usability of abnormal datasets while protecting their privacy. This avoids problems such as excessive data generalization and excessive noise, achieving a balance between privacy protection and data utility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121598283A_ABST
    Figure CN121598283A_ABST
Patent Text Reader

Abstract

The invention provides a power grid test data anonymization processing method and device, and relates to the technical field of data processing. The method aims at solving the problem that privacy protection and data utility are unbalanced due to the fact that single anonymization processing is directly adopted for power grid test data in the prior art. The power grid test data anonymization processing method comprises the steps that a power grid test data set is divided into a normal test data set and an abnormal test data set through a multi-dimensional abnormal value detection mechanism, and the multi-dimensional abnormal value detection mechanism is used for detecting the occurrence frequency of a unique value in quasi-identifier attributes of the power grid test data set based on the occurrence frequency of the unique value in the quasi-identifier attributes of the power grid test data set; dividing the power grid data set; calculating the normal test data set based on a k-anonymization algorithm to generate a first anonymous data set; calculating the abnormal test data set based on a differential privacy algorithm to generate a second anonymous data set; and combining the first anonymous data set and the second anonymous data set to form a target test data set.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a method and apparatus for anonymizing power grid test data. Background Technology

[0002] Anonymization is a technique that hides sensitive information in power grid test data through generalization, suppression, or the addition of noise, making the data uncorrelated with any specific entity while retaining its analytical value. In the power system field, encryption is not used because encrypted data requires decryption before use, which carries the risk of key leakage and increases computational overhead. Anonymous data, on the other hand, can be used directly and is better suited to the application needs of power grid test data. Currently, privacy protection is achieved by applying a single anonymization process to the entire power grid test dataset.

[0003] However, due to the high dimensionality and complex structure of power grid test data, this method of applying a single anonymization method to the whole has obvious drawbacks. It can easily lead to the overgeneralization of power grid test data, resulting in the loss of key details and features, or make it difficult to meet the requirements of data accuracy and usability while protecting privacy. This leads to an imbalance between privacy protection and data utility of power grid test data.

[0004] Therefore, there is an urgent need for a new method for anonymizing power grid test data that can balance privacy protection and data utility. Summary of the Invention

[0005] This application provides a method and apparatus for anonymizing power grid test data, which aims to solve the problem of imbalance between privacy protection and data utility caused by the existing technology of directly applying a single anonymization process to power grid test data.

[0006] To address the aforementioned technical problems, this application provides the following technical solutions: The first aspect of this application provides a method for anonymizing power grid test data, the method comprising: A multidimensional outlier detection mechanism is used to divide the power grid test dataset into a normal test dataset and an abnormal test dataset. The multidimensional outlier detection mechanism is used to filter a preset number of target power grid test data using a logarithmic function and the unique value set of the quasi-identifier of the power grid test data, and to classify the outlier of the power grid test data according to the frequency of the occurrence of the unique value of the quasi-identifier of the target power grid test data. The normal test dataset is calculated based on the k-anonymization algorithm to generate the first anonymous dataset; The anomalous test dataset is calculated based on the differential privacy algorithm to generate a second anonymous dataset; The first anonymous dataset and the second anonymous dataset are combined to form the target test dataset.

[0007] A second aspect of this application provides a power grid test data anonymization processing apparatus, the apparatus comprising: The unit is used to divide the power grid test dataset into normal dataset and abnormal dataset using a multidimensional outlier detection mechanism. The multidimensional outlier detection mechanism is used to filter a preset number of target power grid test data using a logarithmic function and the unique value set of the quasi-identifiers of the power grid test data, and to classify the outlierness of the power grid test data according to the frequency of occurrence of the unique value of the quasi-identifiers of the target power grid test data. A generation unit is used to perform generalized partitioning of the normal test dataset in the utilization unit using the k-anonymization algorithm to generate a first anonymous dataset. The generation unit is used to apply a differential privacy algorithm to the abnormal test dataset in the utilization unit to generate a second anonymous dataset. The combination unit is used to combine the first anonymous dataset and the second anonymous dataset in the generation unit to form the target test dataset.

[0008] A third aspect of this application provides a storage medium comprising a stored program, wherein, when the program is executed, it controls the device containing the storage medium to perform the aforementioned power grid test data anonymization processing method.

[0009] A fourth aspect of this application provides an electronic device, the electronic device including a storage medium; and one or more processors, the storage medium being coupled to the processors, the processors being configured to execute program instructions stored in the storage medium; the program instructions, when executed, perform the above-described power grid test data anonymization processing method.

[0010] Compared to existing technologies, this application provides a method for anonymizing power grid test data. First, it utilizes a multi-dimensional outlier detection mechanism to divide normal and outlier test datasets based on the frequency of unique values ​​of quasi-identifier attributes. Then, it employs different anonymization algorithms for targeted processing. For example, it uses k-anonymization to generalize the partitioning of the normal dataset and differential privacy algorithms to process the outlier dataset. Finally, the datasets are combined to form the target dataset. This differentiated processing approach ensures that the normal test dataset retains key features without revealing detailed features through k-anonymization, while maintaining the usability of the outlier test dataset by protecting its privacy through differential privacy algorithms. This effectively yields a target test dataset that balances privacy protection and data utility, thus avoiding the over-generalization problem caused by the "one-size-fits-all" approach of existing technologies. Attached Figure Description

[0011] The above and other objects, features, and advantages of exemplary embodiments of this application will become readily understood by reading the following detailed description with reference to the accompanying drawings. In the drawings, several embodiments of this application are illustrated by way of example and not limitation, with the same or corresponding reference numerals denoteing the same or corresponding parts, wherein: Figure 1 A flowchart illustrating a method for anonymizing power grid test data is shown schematically. Figure 2 A flowchart illustrating another method for anonymizing power grid test data is shown schematically. Figure 3 A schematic diagram of a power grid test data anonymization processing device is shown. Figure 4 A schematic diagram of a power grid test data anonymization processing device is shown. Detailed Implementation

[0012] Exemplary embodiments of this application will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of this application are shown in the drawings, it should be understood that this application may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of this application and to fully convey the scope of this application to those skilled in the art.

[0013] It should be noted that, unless otherwise stated, the technical or scientific terms used in this application shall have the ordinary meaning as understood by one of ordinary skill in the art to which this application pertains.

[0014] With the application of generative artificial intelligence (GenAI) technology in the vertical field of cybersecurity attack and defense tactics, while improving attack and defense efficiency, it also brings significant privacy leakage risks. Existing technologies typically address this issue by directly applying a single anonymization process to the entire power grid dataset. However, due to the high dimensionality and complex structure of power grid test data, this "one-size-fits-all" anonymization method has obvious drawbacks. It can easily lead to overgeneralization of the power grid test data, resulting in the loss of key detailed features, or the addition of excessive noise that masks important data patterns. This makes it difficult to meet the requirements of data accuracy and usability for generative AI model training while protecting privacy.

[0015] Based on this, the applicant conceived of first classifying the power grid test dataset and then matching appropriate anonymization algorithms to different data types to balance privacy protection and data utility. Specifically, considering the differences in distribution characteristics, privacy leakage risks, and usability requirements between normal and abnormal data in the power grid test data, a multi-dimensional outlier detection mechanism can be used to accurately divide the dataset into normal and abnormal test datasets based on the frequency of unique values ​​in the quasi-identifier attribute. For the normal test dataset, which has a higher proportion and more regular features, a k-anonymization algorithm is used for generalized partitioning, preserving the overall data pattern while hiding individual identifiers. For the smaller but more privacy-sensitive abnormal test dataset, a differential privacy algorithm is used to add controllable noise to avoid privacy leakage due to data scarcity. Specific steps are as follows: Figure 1 As shown: Step 101: Use a multidimensional outlier detection mechanism to divide the power grid test dataset into a normal test dataset and an outlier test dataset.

[0016] In this step, the multidimensional outlier detection mechanism uses a logarithmic function and the unique value set of quasi-identifiers in the power grid test data to filter a preset number of target power grid test data, and classifies the anomalies of the power grid test data according to the frequency of occurrence of the unique values ​​of the quasi-identifiers in the target power grid test data. The preset number is determined by combining a logarithmic function with the number of elements in the unique value set of the quasi-identifiers in the power grid test data. A quasi-identifier attribute (QID) is an attribute that cannot directly identify an individual on its own, but can re-identify the individual's identity when combined with other information, such as equipment type and voltage level in power grid data. The multidimensional outlier detection mechanism is based on the frequency of occurrence of unique values ​​in the quasi-identifier attributes of the power grid test dataset, and achieves the separation of abnormal data from normal data by traversing and checking the attributes of data records in multiple dimensions.

[0017] Specifically, firstly, all Quasi-Identifier Attributes (QIDs) are extracted from the power grid test dataset. The unique value set U for each QID and the number of elements within each set are determined. Then, the frequency of each unique value in the dataset is counted and sorted in ascending order. A preset number of unique values ​​are selected, starting from the first value in the sorted set, to form an anomaly identifier set. Finally, each data point in the power grid test dataset is traversed to determine if any QID attribute value belongs to the anomaly identifier set. If any QID attribute value belongs to the anomaly identifier set, the data is considered an anomaly in the test dataset; otherwise, it is considered normal in the test dataset. By leveraging the uneven distribution of unique QID attribute values ​​in the power grid test data, a logarithmic function is used to dynamically determine the anomaly screening threshold, avoiding the insufficient adaptability of fixed thresholds to high-dimensional and complex power grid data. This precise separation of normal and anomalous data prevents anomalous data (such as low-frequency, high-risk QID combinations) from interfering with subsequent anonymization, while also preventing normal data from being misjudged as anomalous. This provides a precise data foundation for subsequent differentiated privacy protection and ensures the overall anonymization scheme's adaptability to the characteristics of power grid data.

[0018] Step 102: Calculate the normal test dataset based on the k-anonymization algorithm to generate the first anonymous dataset.

[0019] Specifically, the k-value is first determined based on the characteristics of the power grid data (such as equipment correlation and data dimension) to ensure that the k-value is suitable for the data scale to balance privacy and utility. A K-dimensional tree data structure is constructed based on the normal test dataset, with QID attributes as the dimension basis, which fits the multi-attribute correlation characteristics of power grid data. Then, the QID attribute dimension is recursively selected (prioritizing the dimension with the lowest frequency of occurrence to reduce data segmentation bias), and the median of the data in this dimension is used as the split point to split the data space into Low and High parts, using median splitting to ensure balanced distribution of partitioned data. The splitting operation is repeated until the number of data records in each partition is between k and 2k-1, satisfying the core requirement of k-anonymization. Next, the QID attributes in each partition are generalized (e.g., the precise equipment location "32.12°N" is generalized to "Yangtze River Delta region") to preserve the overall data pattern. Finally, all generalized equivalence classes are integrated to form the first anonymized dataset. By employing the methods described above, K-dimensional tree median segmentation is used to efficiently partition data with a high proportion of normal power grid data and well-defined features, avoiding the low efficiency of traditional partitioning algorithms for high-dimensional power grid data. Generalization is used to hide individual identifiers while preserving the overall operational patterns of the data within each partition (such as the distribution of equipment voltage levels within the region). This satisfies the privacy requirements of k-anonymization while avoiding over-generalization that could lead to the loss of key features of the power grid data (such as equipment operating patterns), ensuring that the first anonymized dataset meets the accuracy requirements of generative AI models for normal data.

[0020] In this step, the k-anonymization algorithm generalizes the QID attribute by constructing partitions containing at least k similar data records, making it impossible for attackers to uniquely identify individuals using the QID, thus achieving privacy protection. A K-dimensional tree is a tree-like data structure that recursively partitions the data space according to the data attribute dimension. It can efficiently perform partitioning operations on high-dimensional data and adapt to the processing needs of multi-attribute data in power grids. An equivalence class is a set of data records whose quasi-identifier attribute values ​​have similar characteristics after generalization; data within the same equivalence class cannot be distinguished by QID.

[0021] Step 103: Calculate the abnormal test dataset based on the differential privacy algorithm to generate a second anonymous dataset.

[0022] In this step, all QID attributes are first extracted from the anomaly test dataset. For categorical attributes present in the power grid data (such as equipment protocol type), these are converted into numerical forms (e.g., "1" represents the IEC-104 protocol, "2" represents the Modbus / TCP protocol) to meet the numerical computation requirements of differential privacy. Then, the unique value and corresponding frequency of each QID attribute are statistically analyzed to form a frequency set. Based on the characteristics of the QID attributes in the anomaly test data, the noise scale parameter is calculated. Noise is generated using the Laplace mechanism. After ensuring that the noise distribution meets the differential privacy requirements, the generated noise is added to each QID attribute value to perturb the original anomaly data. Finally, all perturbed anomaly data is collected and integrated to form a second anonymized dataset. By combining the characteristics of a small number of anomaly power grid data and high privacy sensitivity, and through dynamic noise scale parameter calculation, insufficient privacy protection or data distortion caused by fixed noise intensity is avoided. The noise generated by the Laplace mechanism can both mask sensitive information in anomalous data (such as precise device location and high-risk passwords) and prevent individual identification due to data scarcity, while also controlling the noise scale, preserving key patterns in anomalous data (such as vulnerability triggering characteristics), and ensuring that the second anonymized dataset can be used for generative AI model training, thus balancing the privacy protection and utility of anomalous data.

[0023] Differential privacy algorithms, in particular, protect individual privacy while maintaining data availability by adding controlled noise to the data, ensuring that modifications to individual data records do not significantly affect the overall statistical results. The Laplace noise mechanism is a commonly used noise-adding mechanism in differential privacy, suitable for numerical data. It generates noise conforming to a Laplace distribution to perturb the data and ensure privacy protection. The privacy budget parameter controls the strength of differential privacy protection; a smaller privacy budget parameter results in stronger privacy protection but may reduce data availability, while a larger value reduces privacy protection and increases data availability.

[0024] Step 104: Combine the first anonymous dataset and the second anonymous dataset to form the target test dataset.

[0025] In this step, the target test dataset is a complete dataset that can be used for training generative AI models, formed by combining the normal test dataset (first anonymized dataset) processed by k-anonymization and the abnormal test dataset (second anonymized dataset) processed by differential privacy through format validation and dimension merging.

[0026] In this step, the first and second anonymized datasets are first validated to check their QID attribute generalization formats (e.g., whether the regional division standards are consistent and the equipment type classifications are consistent) and the value ranges of numerical attribute types match, adapting to the characteristics of the power grid data format specification. Then, based on the application scenario of the power grid test data (e.g., the data dimension requirements for model training), the data merging dimension is determined (e.g., by data acquisition time or the region to which the equipment belongs), ensuring that the merged data meets the usage requirements. According to the determined merging dimension, the records of the first and second anonymized datasets under the same dimension are concatenated one-to-one (e.g., integrating normal and abnormal anonymized data from the same time period) to avoid data confusion. Next, the integrity (ensuring no record loss, especially high-frequency normal data and rare abnormal data) and consistency (no attribute value conflicts, such as consistent voltage level generalization results for the same equipment) of the merged data are checked. Finally, after verification, a target test dataset with a unified structure containing both normal and abnormal anonymized data is generated. Based on the requirement that power grid test data fully cover the characteristics of normal and abnormal scenarios, format validation and dimension merging ensure the compatibility and integrity of the two types of anonymized datasets. The integrated target test dataset includes both k-anonymized normal data and differentially privacy-enhanced anomalous data, comprehensively covering the characteristics of power grid data and providing complete training data for generative AI models. Simultaneously, the unified data structure reduces the difficulty of model data preprocessing, ensures model training efficiency, and achieves a balance between power grid data privacy protection and model training needs.

[0027] In summary, the power grid test data anonymization method of this application first utilizes a multi-dimensional outlier detection mechanism to divide normal and outlier test datasets based on the frequency of occurrence of unique values ​​of quasi-identifier attributes. Then, it employs different anonymization algorithms for targeted processing—using k-anonymization to generalize the partitioning of the normal dataset and differential privacy algorithms for the outlier dataset. Finally, the datasets are combined to form the target dataset. This differentiated processing approach ensures that the normal test dataset retains key features and does not disclose individual identifiers through k-anonymization, while maintaining the usability of the outlier test dataset while protecting its privacy through differential privacy algorithms. This effectively yields a target test dataset that balances privacy protection and data utility, thus avoiding the problems of over-generalization or excessive noise caused by the "one-size-fits-all" approach of existing technologies.

[0028] Furthermore, based on the above Figure 1 The embodiments shown in this application provide a more detailed description of the method for anonymizing power grid test data, as detailed below. Figure 2 As shown: Step 201: Divide the power grid test dataset into normal test dataset and abnormal test dataset.

[0029] In this embodiment, the method for dividing the power grid test dataset into a normal test dataset and an abnormal test dataset can be as follows: First, obtain the unique value set of quasi-identifiers and the number of elements within the unique value set in the power grid test dataset. Then, determine the number of elements based on a logarithmic function to obtain a preset number. Next, based on the preset number, the unique value set, and the power grid test dataset, determine the frequency of unique values ​​appearing in the quasi-identifiers of the target power grid test data. Finally, based on the frequency, determine the abnormal identifier set and iterate through the power grid test data one by one based on the abnormal identifier set to determine the normal test dataset and the abnormal test dataset. This hierarchical process of "obtaining the QID unique value set and the number of elements—calculating the preset number using a logarithmic function—determining the unique value frequency—dividing the set" accurately adapts to the high-dimensional characteristics of power grid data. Using QID as the core anchor, it first clarifies the basic characteristics of the data, and then uses a logarithmic function to dynamically determine the scale of anomaly screening (e.g., dynamically calculating ocnt for 1000 unique values ​​of voltage levels instead of using a fixed value), avoiding the adaptation deviation of fixed thresholds for complex power grid data; at the same time, it combines frequency statistics to establish quantitative screening standards to ensure that the identification of anomalies has clear data support, providing accurate data partitioning for subsequent differentiated anonymization, solving the problem of privacy and utility imbalance caused by "one-size-fits-all" processing from the source, and ensuring the targeting and compliance of power grid data anonymization.

[0030] It is worth noting that the step of determining the anomaly identifier set and traversing the power grid test data one by one based on the anomaly identifier set to determine the normal test dataset and the anomaly test dataset includes: sorting the frequencies in ascending order, selecting the first preset number of unique values ​​in the ascending order, and determining the anomaly identifier set based on the first preset number of unique values; based on the anomaly identifier set, traversing the data in the power grid test dataset, and if any quasi-identifier attribute value in the data belongs to the anomaly identifier set, then the data is assigned to the anomaly test dataset; otherwise, it is assigned to the normal test dataset. The specific steps of determining the anomaly identifier set based on the frequency and traversing the power grid test data one by one based on the anomaly identifier set to determine the normal test dataset and the anomaly test dataset are as follows: sorting the frequencies in ascending order, selecting the first preset number of unique values ​​in the ascending order, and determining the first preset number of unique values ​​as the anomaly identifier set; based on the anomaly identifier set, traversing the data in the power grid test dataset, and if any quasi-identifier attribute value in the data belongs to the anomaly identifier set, then it is assigned to the anomaly test dataset; otherwise, it is assigned to the normal test dataset. This approach focuses on the core privacy risks of power grid data by employing a practical logic of "determining the anomaly identifier set after ascending frequency sorting—traversing data to divide it into different data sets." The first ocnt values ​​(e.g., low-frequency 500kV equipment types) are selected as anomaly identifiers in ascending frequency order, accurately identifying high-privacy-risk data. During the traversal judgment, the rule is "any QID belonging to an anomaly identifier is classified as abnormal test data" (e.g., if a data point contains a low-frequency equipment type, it is classified into set O). This avoids missing high-risk data while ensuring that normal test data (e.g., high-frequency 110kV equipment data) is correctly classified. This design allows subsequent k-anonymization and differential privacy processing to accurately apply to the corresponding subsets, effectively preserving the utility of normal data and the privacy of abnormal data, adapting to the quality requirements of GenAI training for power grid data. Specifically, determining the number of elements based on a logarithmic function to obtain a preset number includes: the formula for calculating the preset number is: Where ocnt is the preset quantity, U is the unique value set of the quasi-identifier, and Len(U) is the number of elements (cnt).

[0031] Regarding step 201, this embodiment provides a specific method as follows: An existing power grid test dataset DS, DS={d1, d2, ..., dn}, an abnormal test dataset is O, and a normal test dataset is N, extracted from DS. The attributes A of all quasi-identifiers extracted from DS, A={a1, a2, ..., an}, are defined. For each quasi-identifier QID∈A, U={u1, u2, ..., u... cntLet} be the set of unique values ​​for QID, and cnt be the number of unique elements in QID. In this step, to reduce the amount of data in cnt, a preset number ocnt can be obtained using the log function, calculated as described in the formula above. After obtaining ocnt, determine if ocnt is greater than 0. If so, determine the frequency of unique values. The frequency of unique values ​​is calculated as the ratio of the number of times a unique value appears in the power grid test dataset to the total number of data records in the power grid test dataset. The frequency of each unique value u is ufreq. After obtaining the frequency of unique values, sort the frequencies in ascending order, select the top preset number of unique values ​​from the ascending order, and define the top preset number of unique values ​​as the anomaly identifier set. At this point, the unique value list U = {u1, u2, ..., u...} n}, each unique value u i The corresponding frequency is freq(u i To further determine the outlier identifiers, the specific steps are as follows: Take the first oct values ​​u as the outlier identifier set V, V={u1, u2, ..., u...} ocnt},in, Here, `sorted_uniqe_vals` represents a list of unique values ​​obtained by sorting all unique attribute values ​​of QID in ascending order of "occurrence frequency" (the lower the frequency, the higher the unique value appears). Based on the anomaly identifier set, the data in the power grid test dataset is traversed. If any quasi-identifier attribute value in the data belongs to the anomaly identifier set, the data is assigned to the anomaly test dataset; otherwise, it is assigned to the normal test dataset. That is, it determines whether each data record in the test dataset has been accessed. DS, if d[QID] belongs to V, then d belongs to O, specifically expressed as: If d[QID] does not belong to V, then d belongs to N, specifically as follows: As can be seen, by extracting the quasi-identifier attribute A and the unique value set U of each QID from the power grid test dataset DS, a preset number of ocnts is dynamically calculated using a logarithmic function to avoid the problem of insufficient adaptability of fixed thresholds. Simultaneously, the dataset is sorted in ascending order by the frequency of unique values ​​(the ratio of the number of unique values ​​to the total number of records in DS), and the top ocnt values ​​are selected to form an anomaly identifier set V. Then, the data is traversed to determine whether the QID attribute value belongs to V, thus classifying O and N. This method accurately locates low-frequency, high-risk data (such as rare equipment parameters) based on the frequency characteristics of QID unique values, preventing abnormal data from interfering with subsequent anonymization, while also ensuring that normal data is not misjudged. It provides a precise data foundation for subsequent k-anonymization generalization of normal data and differential privacy noise addition for abnormal data. From the source of data classification, it avoids the imbalance between privacy protection and data utility caused by single anonymization, aligning with the core requirements of power grid data anonymization schemes for generative artificial intelligence.

[0032] Step 202: Calculate the normal test dataset based on the k-anonymization algorithm to generate the first anonymous dataset.

[0033] In this step, the calculation of the normal test dataset based on the k-anonymization algorithm to generate the first anonymous dataset includes: constructing a K-dimensional tree data structure based on the normal test dataset; recursively selecting the quasi-identifier attribute dimension and dividing the data space according to the median until the number of data records in each partition is between k and 2k-1; performing generalization processing on the quasi-identifier attributes in each partition to generate anonymized equivalence classes; and all anonymized equivalence classes together constitute the first anonymous dataset.

[0034] Specifically, step 202, for the k-anonymized generalized partitioning of the normal power grid test dataset, focuses on "adapting to the characteristics of power grid data and balancing privacy and utility," and constructs a K-dimensional tree segmentation and generalization system that integrates power grid business logic. The above steps are implemented as follows: First, in the K-dimensional tree data structure construction stage, the limitations of traditional random dimension selection are overcome, and the priority order of QID attributes is determined by combining the business relevance of power grid data: priority is given to dimensions that are strongly related to equipment operation characteristics (such as voltage level, because the operating modes of equipment at different voltage levels are significantly different), followed by region (the geographical partitioning characteristics of the power grid affect data relevance), and finally equipment type (data similarity of similar equipment is high), ensuring that the root node and branch nodes of the K-dimensional tree can be segmented based on key business dimensions first, reducing the damage to core features caused by subsequent generalization. Meanwhile, to address potential missing values ​​in normal test datasets (such as missing QID attributes in the historical operating data of some older equipment), a strategy of "filling with default values ​​for power grid business + correcting with neighborhood mean" is adopted (e.g., if a 110kV transformer is missing a region attribute, the corresponding region is filled based on its associated substation address and the deviation of similar equipment data in the neighborhood is corrected) to ensure the integrity of the K-dimensional tree construction. Next, in the recursive data space partitioning stage, an innovative "dynamic median adjustment + partition density verification" mechanism is adopted: For each dimension to be partitioned, the statistical median of the data under that dimension is first calculated (e.g., the median of the load rate data of 220kV transformers in East China), and then the median is finely adjusted in combination with the power grid equipment operation threshold (e.g., the load rate safety threshold of 80%). If the statistical median is lower than the safety threshold, it is corrected upward to near the threshold to avoid the data in the partition deviating from the actual operating scenario due to pure mathematical median partitioning. After partitioning, the partition density (i.e., the matching degree between the number of data records in the partition and the actual number of power grid equipment in the region) is immediately verified. If the density deviation exceeds 15% (e.g., the theoretical number of records in a partition is 50, but the actual number of equipment in the corresponding region is only 30), the secondary priority dimension is reselected for partitioning again to ensure that the data scale of each partition is consistent with the actual power grid business scenario. Finally, the number of records in each partition is stably between k and 2k-1 (e.g., when k=10, the number of records in the partition is maintained at 10-19).Finally, in the quasi-identifier attribute generalization processing stage, a "hierarchical generalization rule base" is designed to adapt to the characteristics of different QID attributes in power grid data: For the voltage level dimension, a three-level generalization of "precise value → voltage level range → voltage category" is adopted (e.g., 220kV → 200-250kV → high voltage) to retain the core logic of power grid voltage classification; for the regional dimension, generalization is based on the administrative division level of the power grid (e.g., Gulou District of Nanjing City → Nanjing City → Yangtze River Delta Region) to match the geographical scope of power grid dispatch management; for the equipment type dimension, generalization is based on "specific model → equipment subcategory → equipment category" (e.g., SFZ11-25000 / 220 → 220kV transformer → power transformer) to ensure that the generalized data can still support generative artificial intelligence in learning equipment operation modes. After generalization, the anonymized equivalence classes generated for each partition (such as the 15 data entries under the "Yangtze River Delta Region - High Voltage - Power Transformer" partition) are integrated to form the first anonymized dataset that combines privacy protection and business utility. This satisfies the privacy requirement of k-anonymization that "individuals cannot be uniquely identified by QID" and preserves the core features of normal power grid operation data for subsequent generative artificial intelligence training.

[0035] It is worth noting that in the anonymization of power grid data for generative artificial intelligence, the k-anonymization algorithm constructs a privacy protection barrier through the parameter k—ensuring that within the generalized partition where each power grid device data point is located, there are at least k-1 other devices with similar operating characteristics. The core value of this mechanism lies in preventing attackers from precisely locating specific transformers or user power consumption units through QID combinations (such as "voltage level + region + device type"), thereby protecting against two key risks: 1) Device fingerprint leakage: preventing hackers from deducing the physical location of substations through device operating data (such as abnormal current fluctuation frequency). 2) User behavior tracing: avoiding the association of power consumption patterns (such as peak-hour power values) with the production schedules of specific industrial users.

[0036] Furthermore, considering the spatial characteristics of power grid data, this invention adopts a KD-Tree optimized splitting strategy: the splitting dimensions are sorted according to the equipment correlation (voltage level > region > equipment type); the 220kV transformer cluster in East China is divided into anonymous partitions containing ≥k equipment based on the median of the power load; splitting stops when the variance of the operating characteristics of the equipment in the partition is lower than the threshold (e.g., temperature fluctuation <±2℃), ensuring that generative artificial intelligence can still learn the key patterns of fault warning.

[0037] Step 203: Calculate the abnormal test dataset based on the differential privacy algorithm to generate a second anonymous dataset.

[0038] In this step, the calculation of the anomalous test dataset based on the differential privacy algorithm to generate the second anonymized dataset includes: obtaining all quasi-identifier attributes in the anomalous test dataset and converting the quasi-identifier attributes into numerical form; calculating the unique value corresponding to the quasi-identifier attribute and the occurrence frequency corresponding to the unique value; determining the scale parameter of the noise based on the occurrence frequency corresponding to the unique value; and determining the second anonymized dataset based on the noise calculation formula and the noise scale parameter. The formula for determining the noise scale parameter is: The noise calculation formula is: Where scale is the noise scaling parameter, F is the set of frequencies corresponding to unique values, len(a) is the number of elements in the quasi-identifier attribute a, ε is an input parameter used to control the scale, max(F) is the maximum frequency value, noise is the noise level, and a i This represents any one of the quasi-identifier attributes in quasi-identifier attribute a.

[0039] Specifically, the above steps can be implemented by first initializing an empty anonymized outlier set (AOD), extracting quasi-identifier attributes (such as precise equipment coordinates and special fault codes) from the anomaly test dataset (OD), and converting categorical attributes (such as "fault type = lightning strike / short circuit") into numerical values ​​("lightning strike = 3, short circuit = 5") based on the power grid fault coding standard to avoid losing power grid business characteristics in general coding. Next, iterate through each attribute, extracting a set of unique values ​​(such as different latitude and longitude values ​​for coordinate attributes), counting the occurrences of each unique value, and calculating the frequency set F based on the total number of attribute elements, then selecting max(F); finally, substitute these values ​​into the scaling parameter formula, dynamically setting ε according to the power grid data sensitivity level (such as ε = 0.2 for equipment coordinates and ε = 0.4 for fault codes) to ensure that the noise intensity of highly sensitive attributes matches privacy requirements. Finally, Laplacian noise is generated based on scale, and the attribute values ​​are denoised and then normalized using the round function (e.g., the original coordinates 32.12°N become 32.16°N after denoising). At the same time, abnormal disturbance values ​​are corrected by referring to the threshold of power grid equipment parameters (e.g., the voltage value must be within 0-500kV). The processed attribute values ​​are then assigned to AOD, ultimately forming a second anonymous dataset that combines privacy protection and business effectiveness.

[0040] In this embodiment, a more specific implementation of the above steps is given as follows: First, an empty Anonymized Outlier Set (AOD) is initialized. Then, attributes A, A = {a1, a2, ..., ai}, are extracted from the Outlier Set (OD). Next, the categorical values ​​are converted into digital form for processing. Multiple unique values ​​U, U = {u1, u2, ..., ui}, are extracted from the Outlier Set. n The process involves determining the frequency F of each unique value, where F = {f1, f2, ..., fj}. The proportion of the frequency of the most frequent unique value in the current QID to the entire length of attribute A is calculated and multiplied by the input parameters to obtain the noise scale parameter. This noise scale parameter determines the intensity of noise added in subsequent steps, thus balancing data privacy and data quality during anonymization. Then, noise is added to the attribute ai of each attribute a in the AOD. This is achieved by adding noise and limiting the range of each attribute value in the AOD to perturb the original data ai. The updated attribute value is then added to the AOD, where ai = round(ai + noise), resulting in the second anonymized dataset. Therefore, the differential privacy implementation process, consisting of "attribute numerical transformation—frequency statistics—dynamic noise scale calculation—precise noise addition," balances the privacy protection and utility of abnormal power grid data. First, the categorical attributes are converted into numerical form to meet the computational needs of the algorithm. Then, the noise scale parameter is dynamically determined based on the frequency of unique values ​​to avoid privacy deficiencies or data distortion caused by fixed noise. Finally, the noisy data is normalized using a round function to ensure it conforms to the characteristics of power grid data format. This process both masks sensitive information in abnormal data (such as precise equipment coordinates and high-risk parameters) with noise to prevent privacy leaks due to data rarity, and preserves the core patterns of abnormal data (such as fault characteristics), providing compliant and effective data support for generative artificial intelligence training. This aligns with the goal of power grid data anonymization schemes to balance privacy and utility.

[0041] It is worth noting that in the above steps, for each attribute 'a', the minimum and maximum values ​​of that attribute are calculated to determine the range of anonymized data points (minimum and maximum values). This ensures data availability and serves the subsequent noise generation and data range control, preventing unreasonable or extreme values ​​from appearing in the anonymized data after noise is added. For each numerical attribute 'a', all its attribute values ​​are traversed, and the minimum value min(a) and maximum value max(a) of that attribute are calculated and stored (e.g., for the coordinate attribute "latitude", min=30.05°N, max=32.98°N; for the fault current value, min=500A, max=1200A). If the attribute is a numerical type after classification conversion (e.g., equipment fault type "short circuit = 1, overload = 2"), then min(a) and max(a) are determined based on the numerical range of the classification mapping (i.e., min=1, max=2).

[0042] After calculating the noise scale parameter, when generating Laplace noise, the reasonableness of the noise is judged by combining min(a) and max(a). If the probability that the original attribute value ai plus noise (ai+noise) exceeds the range of [min(a), max(a)] is greater than 10%, the scale is dynamically adjusted (e.g., the scale is reduced to 0.8 times the original value) to avoid generating extreme noise that would cause data distortion and to ensure that the noise intensity matches the actual value range of the attribute. After performing the `ai=round(ai+noise)` operation on the attribute value, immediately check whether the result is within [min(a), max(a)]: if ai' < min(a), then correct ai' to min(a); if ai' > max(a), then correct it to max(a) (e.g., the original current value of 600A becomes 1300A after adding noise, exceeding max=1200A, so it is corrected to 1200A); if it is a classification conversion value (e.g., fault type), then ai' exceeding [min(a), max(a)] is mapped to the nearest valid classification value (e.g., when ai'=3, it is corrected to max=2).

[0043] Step 204: Combine the first anonymous dataset and the second anonymous dataset to form the target test dataset.

[0044] In this step, the first and second anonymized datasets are combined to form the target test dataset. Specifically, the following steps are implemented: First, format validation is performed on both datasets to unify data structure and attribute standards. This involves verifying the generalization format of quasi-identifier attributes in the first anonymized dataset (k-anonymized normal data) and the second anonymized dataset (differential privacy-processed anomalous data). For example, regional divisions must be standardized to "North China / East China," and equipment types must match unified classifications such as "Power Transformer / Circuit Breaker." The range of numerical attribute values ​​is also verified (e.g., voltage values ​​must be within the 0-500kV range, and temperature values ​​must conform to the normal operating range of power grid equipment), ensuring no format conflicts. Next, the data merging dimension is determined. Considering the power grid data application scenario (e.g., the time series requirements for training generative artificial intelligence models), "data acquisition time + equipment region" is selected as the core merging dimension, grouping normal and anomalous anonymized data from the same time period and region into the same data group. Then, data splicing is performed, matching records from both datasets one by one according to the merging dimension (e.g., matching "2025-01-01"). The normal transformer data and abnormal short-circuit data under the "East China Region" are integrated, and the integrity (ensuring that there are no missing high-frequency normal data and rare abnormal data) and consistency (such as the voltage level generalization results of the same equipment need to be consistent) are checked. Finally, a target test dataset with a unified structure is generated, and the data source type (normal / abnormal) is labeled to facilitate the generative artificial intelligence model to distinguish and learn. This not only fully covers the normal and abnormal operation scenarios of the power grid, but also reduces the difficulty of model preprocessing through a unified format, ensuring the efficiency of subsequent training and the utility of data.

[0045] The following is an example illustrating the method used in this application: For data involving power grid scenarios, special attention must be paid to protecting sensitive information. Power grid equipment parameters and topology information are considered sensitive data and require anonymization to prevent the risks of information leakage. This invention identifies the power grid scenario QID as: QID=["device_type", "voltage_level", "region"], representing the equipment type, voltage level, and region; simultaneously, it defines the sensitive attribute as Sensitive=["location", "password"], including location and password. For each record in the original dataset, such as: The input is a raw DS in JSON format: [ { "device_id": "Substation #5", / / QID attribute "location": "32.12°N, 118.78°E", / / QID + sensitive location "protocol": "IEC-104", "password": "p@ssw0rd!", / / High-risk outlier "access_ip": "192.168.5.100" / / Threat indicators }, { "device_id": "Relay Group #7", "location": "31.23°N, 120.45°E", "protocol": "Modbus / TCP", "password": "secure123", / / Normal value "access_ip": "58.xxx.xxx.xx" / / Malicious IP }] Sensitive information must be processed to ensure data security during use. Attack indicators, such as malicious IP addresses, need to be preserved with high precision for effective threat analysis and detection later.

[0046] The entire process is as follows: A multidimensional outlier detection mechanism is applied to the original dataset. When the password is weak (e.g., length < 8 characters) and associated with highly sensitive attributes (e.g., precise coordinates, device ID), it is marked as an anomaly. Simultaneously, low-frequency, high-risk combinations are detected; for example, a password + coordinate combination appearing only once in the dataset is also marked as an anomaly. These data points are "outliers" in the overall distribution and are not representative, but the model will forcibly memorize them, leading to overfitting to these extreme samples and failing to generalize to more common normal samples. In this way, potentially outlier data points in the dataset can be effectively identified, preventing them from interfering with subsequent analysis and model training.

[0047] After traversing all QIDs, the power grid dataset will split into two new subsets: the normal test dataset (N) and the abnormal test dataset (O). Output: The abnormal test dataset O contains the first record (including precise coordinates and a weak password); the normal test dataset N contains the second record.

[0048] For the anomalous test dataset O, ε-differential privacy protection measures are employed. Specifically, for numerical data, a Laplacian mechanism is used to add noise; while for categorical data, a hierarchical mapping table is set to convert fine-grained devices into general categories, making generalized text more suitable for training the embedding model. Because anomalous data needs to be learned by a large model, more of its original information needs to be preserved. Adding noise to the data prevents the leakage of sensitive information such as passwords, ensuring its secure use for model training.

[0049] { / / Anomaly test dataset O (differential privacy protection) "device_id": "Transformer Equipment_500kV#, / / Retain the original ID (k-anonymous, not overwritten)" "location": "32.18°N, 118.83°E", / / Noise blur "protocol": "IEC-104", "password": "******", / / Complete desensitization "access_ip": "192.168.5.100" / / Retain threat indicators } For the normal test dataset N, the KD-Tree algorithm is applied to partition the data space. This partitioning process is repeated until the sample size of each partition is between k and 2k-1. The resulting partitions are then combined through a generalization operation. Common combinations of normal values ​​appear frequently in the data and form the core semantic structure for large-scale model learning; therefore, excessive perturbation is undesirable, and preserving the original semantics is crucial.

[0050] { / / Normal test dataset N (k-anonymous generalization) "device_id": "Secondary device_relay", / / Generalized category "location": "Yangtze River Delta region", / / Geographic generalization "protocol": "Modbus / TCP", "password": "******", / / Complete desensitization "access_ip": "58.xxx.xxx.xx" / / Retain threat indicators } The N set can be used for machine learning, rule discovery, and generative model training, while the O set retains threat indicators (such as attacking IPs) for security detection and attribution modeling. This approach utilizes all data while effectively reducing noise, improving model generalization and attack resistance. Finally, the anonymized abnormal test dataset O and the normal test dataset N are combined to obtain the overall anonymized dataset AOD. This process protects data privacy while preserving data usability as much as possible, providing a reliable guarantee for subsequent data analysis and applications.

[0051] AOD data directly supports generative AI, such as: A user asked: "Abnormal protocol access events in the Yangtze River Delta region." AI-generated message: "[Protected Device #7] detected to be under Modbus / TCP scan by malicious IP (58.xxx.xxx.xx)". Because the data has been anonymized in AOD, the AI ​​will not output the original coordinates or password.

[0052] This demonstrates that because sensitive information has been anonymized in the AOD (Aspect-Oriented Device), the AI ​​does not output sensitive information such as original coordinates or passwords, thus providing users with valuable security analysis results while ensuring data privacy. This process showcases the application potential of generative artificial intelligence technology in the field of cybersecurity within the power grid sector. Through learning and analyzing large amounts of processed security data, generative AI can quickly and accurately answer user queries about cybersecurity incidents, providing strong support for cybersecurity protection.

[0053] Furthermore, as a response to the above Figure 1-2 The implementation of the method embodiment shown in this invention provides a power grid test data anonymization processing device. This device embodiment corresponds to the foregoing method embodiments. For ease of reading, this embodiment will not repeat the details of the foregoing method embodiments one by one, but it should be understood that the device in this embodiment can correspondingly implement all the contents of the foregoing method embodiments. For example... Figure 3 As shown, it includes: Unit 31 is used to divide the power grid test dataset into normal dataset and abnormal dataset using a multidimensional outlier detection mechanism. The multidimensional outlier detection mechanism is used to filter a preset number of target power grid test data using a logarithmic function and the unique value set of the quasi-identifier of the power grid test data, and to classify the outlier of the power grid test data according to the frequency of occurrence of the unique value of the quasi-identifier of the target power grid test data. The generation unit 32 is used to perform generalized partitioning on the normal test dataset in the utilization unit 31 using the k-anonymization algorithm to generate the first anonymous dataset. The generation unit 32 is used to apply a differential privacy algorithm to the abnormal test dataset in the utilization unit to generate a second anonymous dataset. Combination unit 33 is used to combine the first anonymous dataset and the second anonymous dataset in generation unit 32 to form a target test dataset.

[0054] Furthermore, such as Figure 4 As shown, the utilization unit 31 includes: The acquisition module 311 is used to acquire the unique value set of quasi-identifiers and the number of elements in the unique value set in the power grid test dataset; The quantity module 312 is used to determine the number of elements in the acquisition module 311 based on a logarithmic function to obtain a preset quantity; The determination module 313 is used to determine the frequency of occurrence of the unique value of the quasi-identifier of the target power grid test data based on the preset quantity, unique value set and power grid test dataset in the quantity acquisition module 312; The determining module 313 is used to determine an anomaly identifier set based on the frequency and to traverse the power grid test data one by one based on the anomaly identifier set in order to determine the normal test dataset and the anomaly test dataset.

[0055] Furthermore, such as Figure 4 As shown, the determining module 313 includes: The determination submodule 3131 is used to sort the frequencies in ascending order, select the first preset number of unique values ​​in the ascending order, and determine the abnormal identifier set based on the first preset number of unique values. The partitioning submodule 3132 is used to traverse the data in the power grid test dataset based on the abnormal identifier set in the determination submodule 3131. If any quasi-identifier attribute value in the data belongs to the abnormal identifier set, it is partitioned into the abnormal test dataset; otherwise, it is partitioned into the normal test dataset.

[0056] Furthermore, such as Figure 4 As shown, the quantity obtaining module 312 includes: The calculation submodule 3121 is used to calculate the preset quantity formula: Where ocnt is the preset quantity, U is the unique value set of the quasi-identifier, and Len(U) is the number of elements.

[0057] Furthermore, such as Figure 4 As shown, the generation unit 32 includes: The segmentation module 321 is used to construct a K-dimensional tree data structure based on the normal test dataset, recursively select the quasi-identifier attribute dimension and perform data space segmentation according to the median until the number of data records in each partition is between k and 2k-1. The dataset generation module 322 is used to generalize the quasi-identifier attributes in each partition of the segmentation module 321 to generate anonymized equivalence classes. All anonymized equivalence classes together constitute the first anonymous dataset. Furthermore, such as Figure 4 As shown, the generation unit 32 includes: The attribute acquisition module 323 is used to acquire all quasi-identifier attributes in the abnormal test dataset and convert the quasi-identifier attributes into numerical form. The frequency calculation module 324 is used to calculate the unique value corresponding to the quasi-identifier attribute in the attribute acquisition module 323 and the occurrence frequency of the unique value; The data determination module 325 is used to determine the scale parameter of the noise based on the occurrence frequency corresponding to the unique value in the frequency calculation module 324; The data determination module 325 is used to determine the second anonymous dataset based on the noise calculation formula and the noise scale parameter.

[0058] Furthermore, such as Figure 4 As shown, the device further includes: The formula for determining the scale parameter of noise is: The noise calculation formula is: Where scale is the noise scaling parameter, F is the set of frequencies corresponding to unique values, len(a) is the number of elements in the quasi-identifier attribute a, ε is an input parameter used to control the scale, max(F) is the maximum frequency value, noise is the noise level, and a i This represents any one of the quasi-identifier attributes in quasi-identifier attribute a.

[0059] Furthermore, embodiments of the present invention also provide a readable storage medium for storing a computer program, wherein the computer program, when running, controls the device where the storage medium is located to perform the above-described actions. Figure 1-2 The method for anonymizing power grid test data as described in any one of the following.

[0060] Furthermore, embodiments of the present invention also provide an electronic device, the electronic device including a storage medium; and one or more processors, the storage medium being coupled to the processors, the processors being configured to execute program instructions stored in the storage medium; the program instructions, when executed, perform as described above. Figure 1-2 The method for anonymizing power grid test data as described in any one of the following.

[0061] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0062] It is understood that the relevant features in the above methods and apparatus can be referenced interchangeably. Furthermore, the terms "first," "second," etc., in the above embodiments are used to distinguish between embodiments and do not represent the superiority or inferiority of any particular embodiment.

[0063] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0064] The algorithms and displays provided herein are not inherently related to any particular computer, virtual system, or other device. Various general-purpose systems can also be used in conjunction with the teachings herein. The required structure for constructing such systems is apparent from the above description. Furthermore, this invention is not directed to any particular programming language. It should be understood that the contents of the invention described herein can be implemented using various programming languages, and the above description of specific languages ​​is for the purpose of disclosing the best mode of implementation of the invention. Additionally, the memory may include non-persistent memory in computer-readable media, random access memory (RAM), and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory may include at least one memory chip.

[0065] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0066] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0067] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0068] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0069] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0070] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0071] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0072] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for anonymizing power grid test data, characterized in that, include: A multidimensional outlier detection mechanism is used to divide the power grid test dataset into a normal test dataset and an abnormal test dataset. The multidimensional outlier detection mechanism is used to filter a preset number of target power grid test data using a logarithmic function and the unique value set of the quasi-identifier of the power grid test data, and to classify the outlier of the power grid test data according to the frequency of the occurrence of the unique value of the quasi-identifier of the target power grid test data. The normal test dataset is calculated based on the k-anonymization algorithm to generate the first anonymous dataset; The anomalous test dataset is calculated based on the differential privacy algorithm to generate a second anonymous dataset; The first anonymous dataset and the second anonymous dataset are combined to form the target test dataset.

2. The method according to claim 1, characterized in that, The method of dividing the power grid test dataset into normal test datasets and abnormal test datasets using a multidimensional outlier detection mechanism includes: Obtain the set of unique values ​​for quasi-identifiers in the power grid test dataset and the number of elements in the set of unique values; The number of elements is determined based on a logarithmic function to obtain a preset number; Based on a preset quantity, a unique value set, and a power grid test dataset, determine the frequency of occurrence of unique values ​​of the quasi-identifiers of the target power grid test data; Based on the frequency, an anomaly identifier set is determined, and the power grid test data is traversed one by one based on the anomaly identifier set to determine the normal test dataset and the anomaly test dataset.

3. The method according to claim 2, characterized in that, The step of determining an anomaly identifier set based on the frequency and then traversing the power grid test data one by one based on the anomaly identifier set to determine the normal test dataset and the anomaly test dataset includes: After sorting the frequencies in ascending order, a first preset number of unique values ​​are selected from the ascending sort, and an abnormality identifier set is determined based on the first preset number of unique values. Based on the set of anomaly identifiers, the data in the power grid test dataset is traversed. If any quasi-identifier attribute value in the data belongs to the set of anomaly identifiers, the data is assigned to the anomaly test dataset; otherwise, it is assigned to the normal test dataset.

4. The method according to claim 2, characterized in that, The determination of the number of elements based on a logarithmic function to obtain a preset number includes: The formula for calculating the preset quantity is: Where ocnt is the preset quantity, U is the unique value set of the quasi-identifier, and Len(U) is the number of elements.

5. The method according to claim 1, characterized in that, The process of calculating the normal test dataset based on the k-anonymization algorithm to generate the first anonymous dataset includes: A K-dimensional tree data structure is constructed based on the normal test dataset. The quasi-identifier attribute dimension is recursively selected and the data space is partitioned according to the median until the number of data records in each partition is between k and 2k-1. The quasi-identifier attributes within each partition are generalized to generate anonymized equivalence classes. All anonymized equivalence classes together constitute the first anonymized dataset.

6. The method according to claim 1, characterized in that, The process of calculating the anomalous test dataset based on the differential privacy algorithm to generate the second anonymous dataset includes: Obtain all quasi-identifier attributes from the abnormal test dataset and convert the quasi-identifier attributes into numerical form; Calculate the unique value corresponding to the quasi-identifier attribute and the frequency of occurrence of the unique value; The scale parameter of the noise is determined based on the occurrence frequency corresponding to the unique value; Based on the noise calculation formula and the noise scale parameter, a second anonymized dataset is determined.

7. The method according to claim 6, characterized in that, The method further includes: The formula for determining the scale parameter of noise is: The noise calculation formula is: Where scale is the noise scaling parameter, F is the set of frequencies corresponding to unique values, len(a) is the number of elements in the quasi-identifier attribute a, ε is an input parameter used to control the scale, max(F) is the maximum frequency value, noise is the noise level, and a i This represents any one of the quasi-identifier attributes in quasi-identifier attribute a.

8. A device for anonymizing power grid test data, characterized in that, include: The unit is used to divide the power grid test dataset into normal dataset and abnormal dataset using a multidimensional outlier detection mechanism. The multidimensional outlier detection mechanism is used to filter a preset number of target power grid test data using a logarithmic function and the unique value set of the quasi-identifiers of the power grid test data, and to classify the outlierness of the power grid test data according to the frequency of occurrence of the unique value of the quasi-identifiers of the target power grid test data. A generation unit is used to perform generalized partitioning of the normal test dataset in the utilization unit using the k-anonymization algorithm to generate a first anonymous dataset. The generation unit is used to apply a differential privacy algorithm to the abnormal test dataset in the utilization unit to generate a second anonymous dataset. The combination unit is used to combine the first anonymous dataset and the second anonymous dataset in the generation unit to form the target test dataset.

9. A storage medium, characterized in that, The storage medium includes a stored program, wherein, when the program is executed, it controls the device containing the storage medium to perform the power grid test data anonymization processing method according to any one of claims 1 to 7.

10. An electronic device, characterized in that, The electronic device includes a storage medium; and one or more processors, the storage medium being coupled to the processors, the processors being configured to execute program instructions stored in the storage medium; the program instructions, when executed, perform the power grid test data anonymization processing method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Heterogeneous power utilization data publishing method based on clustering anonymization and differential privacy protection

    CN114092729A