A federated learning-based power big data privacy protection method and system
By employing a federated learning-based approach to power big data processing, the problem of balancing privacy protection and data availability in power big data is solved, enabling the effective utilization of unstructured session data and supporting user demand analysis and service optimization.
Patent Information
- Application Number
- CN202511332953.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-18
- Publication Date
- 2026-03-03
- Estimated Expiration
- 2045-09-18
AI Technical Summary
Existing technologies struggle to balance privacy protection and data availability in power big data, especially when processing unstructured user session records, which can lead to the leakage of sensitive information and the loss of key business features, thus failing to effectively support user demand analysis and service optimization.
By employing a federated learning-based approach, historical session records of electricity users are obtained, standardized preprocessing is performed, time series and interaction behavior features are extracted, and privacy protection processing is carried out using a federated learning framework to generate a privacy-enhanced feature set, ultimately producing privacy-protected results that can be used in the power service system.
It achieves a balance between privacy protection and data availability by enhancing the utilization value of unstructured session data while ensuring privacy and security, supporting user demand analysis and service optimization.
Smart Images

Figure CN120822242B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a method and system for protecting the privacy of big data in the power sector based on federated learning. Background Technology
[0002] With the popularization of digital power services, user interaction data with the power system has become an important big data resource, making privacy protection and value extraction crucial technical issues. Power big data privacy protection involves processing power-related data to support business analysis while ensuring the security of sensitive user information. Currently, this primarily targets structured data (such as numerical data like electricity consumption and prices), directly processing the raw data or its derived indicators through methods like anonymization and encryption. For unstructured user session records, existing technologies typically only perform simple format cleaning or keyword filtering, failing to fully consider their unstructured nature and implicit user behavior patterns. This approach has two drawbacks: firstly, directly processing raw session data easily leads to the leakage of sensitive user information, while simple filtering loses key business characteristics, making it difficult to balance "privacy protection" and "data usability"; secondly, the lack of deep feature extraction of the temporal correlation and interactive behavior of session data means the processed results cannot effectively support actual business operations such as user demand analysis and service optimization in the power service system, limiting the utilization value of unstructured session data. Therefore, how to design a processing method that balances privacy protection and data utilization, taking into account the unstructured, temporal, and privacy-sensitive characteristics of power user session records, has become a research hotspot in the field of power big data. Summary of the Invention
[0003] In view of the aforementioned existing problems, the present invention is proposed.
[0004] Therefore, this invention provides a method and system for protecting the privacy of power big data based on federated learning, which solves the problem that existing technologies struggle to balance privacy protection and data availability, while also limiting the utilization value of unstructured session data in supporting practical business operations such as user demand analysis and service optimization.
[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 method for protecting the privacy of power big data based on federated learning, comprising:
[0007] Obtain a set of historical session records for electricity users. The set of historical session records contains multiple time-series session windows. Each time-series session window consists of user electricity consumption query statements and corresponding system response statements within a continuous time period.
[0008] The historical session record set is preprocessed to obtain a standardized session data set, which includes user electricity query statements and system response statements with uniform format.
[0009] By processing standardized session data sets through time series analysis and interaction behavior analysis, we can identify and extract time series correlation features of user electricity consumption queries and user-system interaction behavior correlation features, and generate a time series feature set.
[0010] The pre-configured federated learning framework is invoked to perform privacy protection processing on the temporal feature set, generating a privacy-enhanced feature set;
[0011] The results of power data privacy protection are generated based on the privacy-enhancing feature set, and then fed back to the power service system.
[0012] As a preferred embodiment of the federated learning-based power big data privacy protection method described in this invention, the standardization preprocessing of the historical session record set includes:
[0013] Perform data cleaning on each time-series session window in the historical session record set to remove user electricity query statements and system response statements containing garbled characters from the time-series session windows;
[0014] The cleaned time-series session window is formatted uniformly by converting the text encoding format of the user's electricity consumption query statement into a preset uniform encoding format and adjusting the timestamp format of the system response statement to be consistent with the timestamp format of the user's electricity consumption query statement.
[0015] Perform missing value completion on the time-series session window after standardizing its format;
[0016] The completed time-series session window is semantically normalized, and different expressions of the same electricity demand in the user's electricity query statement are mapped to preset standard semantic labels, and different expressions of the same service feedback in the system response statement are mapped to preset standard response labels.
[0017] The processed time-series session windows are sorted and organized in chronological order to generate a standardized session data set containing an ordered sequence of time-series session windows.
[0018] The data cleaning process for each time-series session window in the historical session record set includes:
[0019] Perform character validity checks on user electricity consumption query statements in the time-series session window to identify garbled substrings containing non-standard printable characters in the user electricity consumption query statements;
[0020] Perform contextual semantic analysis on the garbled substring to determine whether the garbled substring is a key semantic part of the user's electricity query statement;
[0021] If the garbled substring is a key semantic part, then the user electricity query statement containing the garbled substring will be marked as an invalid statement;
[0022] If the garbled substring is a non-critical semantic part, then the garbled substring is replaced with a preset placeholder character.
[0023] As a preferred embodiment of the power big data privacy protection method based on federated learning described in this invention, the step of semantic normalization processing of the completed time-series session window includes:
[0024] Construct a semantic knowledge base for electricity demand, which includes a preset set of standard semantic tags and positive and ambiguous expression examples corresponding to each standard semantic tag;
[0025] The semantic vector transformation process is performed on the user's electricity consumption query statement to generate a semantic vector representation of the user's electricity consumption query statement;
[0026] Calculate the similarity value between the semantic vector representation and the semantic vector representation of each standard semantic tag in the electricity demand semantic knowledge base;
[0027] Extract standard semantic tags with similarity values exceeding a preset threshold as candidate tags. If there are multiple candidate tags and the difference in similarity values between the candidate tags is less than a preset difference threshold, then trigger the semantic conflict resolution process.
[0028] The semantic conflict resolution process includes:
[0029] Extract the contextual timing information of the user's electricity consumption query statement and analyze the continuity of the user's electricity consumption query intent before and after the current timing session window;
[0030] By combining the historical query patterns of the same users in the historical session record set, we can determine the main demand trends of users' electricity consumption query statements;
[0031] Based on the primary needs and preferences, the most matching standard semantic tag is selected from multiple candidate tags as the final mapping tag.
[0032] As a preferred embodiment of the power big data privacy protection method based on federated learning described in this invention, the step of processing a standardized session data set through time series analysis and interaction behavior analysis to identify and extract time series correlation features of user electricity consumption queries and user-system interaction behavior correlation features, generating a time series feature set, including:
[0033] The time-series session window is divided into multiple sub-time periods according to a preset time interval. The number of times user electricity consumption query statements appear in each sub-time period is counted to generate the frequency distribution characteristics of user electricity consumption query statements in continuous time periods.
[0034] Semantic similarity calculation is performed on user electricity consumption query statements within adjacent sub-time periods. The matching degree of standard semantic tags of user electricity consumption query statements within adjacent sub-time periods is compared to generate semantic similarity features of user electricity consumption query statements within adjacent time periods.
[0035] The occurrence frequency distribution characteristics are subjected to time-series smoothing to eliminate abnormal fluctuation values in the occurrence frequency distribution characteristics and generate smoothed occurrence frequency characteristics.
[0036] Temporal correlation analysis is performed on semantic similarity features to identify the changing trends of semantic similarity features in continuous sub-time units and generate trend-based semantic similarity features.
[0037] By combining the smoothed frequency features and trend semantic similarity features, time-series association features of user electricity consumption query statements are generated.
[0038] As a preferred embodiment of the power big data privacy protection method based on federated learning described in this invention, the step of invoking a pre-configured federated learning framework to perform privacy protection processing on the time-series feature set to generate a privacy-enhanced feature set includes:
[0039] The temporal feature set is distributed to multiple local computing nodes participating in federated learning. Each local computing node performs local feature transformation processing on the distributed temporal feature set to generate an intermediate feature representation containing local privacy constraints.
[0040] Each local computing node performs privacy masking on the intermediate feature representation, adding preset privacy protection mask information to the intermediate feature representation;
[0041] Each local computing node inputs the intermediate feature representation with the privacy mask added into the local training model for feature enhancement training, generating a local enhanced feature representation containing local enhancement information;
[0042] The federated learning coordination node collects the local augmented feature representations from each local computing node, performs feature parameter aggregation processing on the local augmented feature representations, and generates a global aggregated feature representation that contains common features of data from multiple parties.
[0043] Privacy verification processing is performed on the global aggregated feature representation to verify whether the degree of obfuscation of sensitive user identification information in the global aggregated feature representation meets the preset privacy protection requirements. If it meets the requirements, the global aggregated feature representation is output as a privacy-enhancing feature set.
[0044] The privacy verification process performed on the global aggregated feature representation verifies whether the obfuscation level of sensitive user identification information in the global aggregated feature representation meets the preset privacy protection requirements. If it does, the global aggregated feature representation is output as a privacy-enhancing feature set, including:
[0045] Construct a privacy verification sample set, which includes a subset of features randomly extracted from the global aggregated feature representation and the corresponding original local feature representation;
[0046] A pre-trained privacy attack model is invoked to perform user identity decryption attacks on a subset of features;
[0047] The accuracy of a statistical privacy attack model in successfully reconstructing user identification information is used as an indicator of privacy leakage risk.
[0048] If the privacy leakage risk index is lower than the preset risk threshold, the degree of confusion of the global aggregated feature representation is determined to meet the privacy protection requirements;
[0049] If the privacy breach risk indicator is not lower than the preset risk threshold, the feature reprocessing process will be triggered.
[0050] The feature reprocessing process includes:
[0051] Adjust the privacy mask generation parameters of each local computing node, and re-execute the local feature transformation, privacy mask addition, and local enhanced feature representation generation steps to generate a new local enhanced feature representation;
[0052] The new local enhanced feature representation is re-aggregated to generate an updated global aggregated feature representation, and the privacy verification process is repeated until the privacy leakage risk indicator is less than the preset risk threshold.
[0053] As a preferred embodiment of the federated learning-based power big data privacy protection method described in this invention, the step of generating power data privacy protection results based on a privacy-enhancing feature set and feeding back the power data privacy protection results to the power service system includes:
[0054] Perform feature decoding processing on the privacy-enhancing feature set;
[0055] The decoded privacy-enhanced feature set is annotated with privacy-sensitive information to identify residual sensitive user identification information in the privacy-enhanced feature set and add privacy access control labels to the residual sensitive user identification information.
[0056] Based on the privacy access control label, data access permission rules are set for the privacy enhancement feature set. The data access permission rules include restrictions on the access scope and operation types of users with different permission levels to the privacy enhancement feature set.
[0057] The privacy-enhancing feature set after setting access permission rules is associated and bound with the preset privacy protection metadata. The privacy protection metadata includes the source information, processing information and privacy protection level information of the privacy-enhancing feature set.
[0058] The set of privacy-enhanced features after association and binding is used as the result of power data privacy protection and fed back to the power service system through a secure data transmission channel.
[0059] The process of annotating the decoded privacy-enhanced feature set with privacy-sensitive information, identifying residual sensitive user identification information in the privacy-enhanced feature set, and adding privacy access control tags to the residual sensitive user identification information includes:
[0060] Sensitive information detection processing is performed on each feature item in the privacy enhancement feature set, and the feature item is matched with the feature pattern in the preset sensitive information feature library. The sensitive information feature library includes user name feature pattern, contact number feature pattern and electricity address feature pattern.
[0061] Contextual verification is performed on feature items that match sensitive information feature patterns to confirm whether the feature items truly represent user sensitive information in the contextual semantic environment of the privacy-enhancing feature set.
[0062] If it is confirmed that a feature represents sensitive user information, then the feature is marked as residual sensitive user identification information;
[0063] Conduct privacy risk assessment and processing on residual sensitive user identification information;
[0064] Based on the privacy risk assessment results, corresponding privacy access control labels are assigned to the remaining sensitive user identification information. The privacy access control labels include high-risk labels, medium-risk labels, and low-risk labels, which correspond to different access restriction levels.
[0065] As a preferred embodiment of the power big data privacy protection method based on federated learning described in this invention, the step of feeding back to the power service system through a secure data transmission channel includes:
[0066] The results of power data privacy protection are processed by data block segmentation, dividing the results of power data privacy protection into multiple data block units, each of which contains continuous data information of a preset size;
[0067] Each data block unit is encrypted using a preset symmetric encryption algorithm to generate an encrypted data block unit. The key for the symmetric encryption algorithm is determined in advance by the local computing node and the power service system.
[0068] For each encrypted data block unit, an integrity check code is generated. The hash value of the encrypted data block unit is calculated using a preset hash algorithm as the integrity check code.
[0069] The encrypted data block unit and the corresponding integrity check code are encapsulated to generate a transmission data packet containing the encrypted data block and the check code;
[0070] Data packets are sent sequentially to the power service system through a secure data transmission channel, which uses a transport layer security protocol to establish an encrypted communication connection.
[0071] After receiving the data packets, the power service system decrypts and verifies their integrity.
[0072] Secondly, the present invention provides a power big data privacy protection system based on federated learning, comprising:
[0073] The acquisition module is used to acquire a set of historical session records of power users. The set of historical session records contains multiple time-series session windows. Each time-series session window consists of user electricity consumption query statements and corresponding system response statements within a continuous time period.
[0074] The standardization preprocessing module is used to perform standardization preprocessing on the historical session record set to obtain a standardized session data set, which includes user electricity query statements and system response statements with uniform format.
[0075] The time-series feature extraction module is used to process standardized session data sets through time-series analysis and interactive behavior analysis, identify and extract time-series correlation features of user electricity consumption queries and user-system interaction behavior correlation features, and generate a time-series feature set.
[0076] The federated learning privacy protection module is used to call a pre-configured federated learning framework to perform privacy protection processing on the temporal feature set and generate a privacy-enhanced feature set;
[0077] The results feedback module is used to generate power data privacy protection results based on the privacy enhancement feature set and to feed the power data privacy protection results back to the power service system.
[0078] Thirdly, the present invention provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, characterized in that the processor executes the computer program to implement the steps of the described method for protecting the privacy of power big data based on federated learning.
[0079] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, characterized in that the computer program, when executed by a processor, implements the steps of the aforementioned method for protecting the privacy of power big data based on federated learning.
[0080] The beneficial effects of this invention are as follows: By acquiring a set of historical session records containing time-series session windows, this invention extends the traditional focus on privacy protection of structured power data to unstructured user session scenarios, effectively mining implicit information such as demand tendencies and behavioral habits hidden in user electricity query statements and system response statements. Through standardized preprocessing, unstructured session data characterized by garbled characters, chaotic formats, and ambiguous expressions is transformed into standardized objects with unified format and comparable semantics, solving the "incomparability" problem of discrete session data and providing a reliable foundation for subsequent feature extraction. Combined with time-series feature extraction technology, the invention further mines the time-series correlation features and interaction behavior correlation features of session data, transforming unstructured data into a feature set containing behavioral patterns, making session data, which was originally difficult to analyze directly, usable for privacy enhancement processing. The feature quality is improved; when the federated learning framework is used to perform privacy protection processing on the time-series feature set, a privacy-enhanced feature set that retains key business features is generated through multi-party joint training. This avoids the direct transmission of original sensitive information (such as the user's specific query content) and obfuscates implicit user identification information through privacy masks, achieving a balance between "data availability" and "privacy protection". When the final privacy-protected result is fed back to the power service system, by associating privacy metadata and setting access permission rules, the result can directly support actual business operations such as user demand analysis and service optimization in privacy-sensitive scenarios. This not only ensures privacy security during data use but also enhances the utilization value of power big data in unstructured session scenarios, effectively solving the adaptability problem of traditional power privacy protection technologies in unstructured session data processing. Attached Figure Description
[0081] 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.
[0082] Figure 1 This is a basic flowchart illustrating a method for protecting the privacy of power big data based on federated learning, as provided in one embodiment of the present invention. Detailed Implementation
[0083] 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.
[0084] Example 1, referring to Figure 1 As one embodiment of the present invention, a method for protecting the privacy of power big data based on federated learning is provided, such as... Figure 1 As shown, it includes the following steps:
[0085] S100: Obtain the historical session record set of the power user. The historical session record set contains multiple time-series session windows. Each time-series session window consists of the user's electricity consumption query statement and the corresponding system response statement within a continuous time period.
[0086] In this embodiment of the invention, the historical session record set is a summary of interactions between electricity users and the power system within a certain time frame. The time-series session window consists of consecutive time periods divided chronologically, grouping user-system interaction information by time. User electricity query statements are statements from users asking the power system questions related to electricity consumption, such as "Query this month's electricity consumption" or "Inquire about the current electricity price," reflecting the user's electricity needs. Corresponding system response statements are the power system's answers to user queries, such as "This month's electricity consumption is [X] kWh" or "The current electricity price is [X] yuan / kWh." The historical session record set can be obtained through the power system's log recording module, which records user-system interaction information in real time and stores it in a database chronologically. For example, in a large power company's system, numerous users interact with the system daily via mobile apps or web pages; this interaction information is accurately recorded, forming the historical session record set.
[0087] Step S200: Perform standardized preprocessing on the historical session record set to obtain a standardized session data set. The standardized session data set contains user electricity query statements and system response statements with uniform format.
[0088] Standardization preprocessing aims to make the data in the historical session record set more standardized and uniform, facilitating subsequent analysis and processing. Format standardization includes unifying text encoding formats, timestamp formats, and other aspects to ensure data consistency and readability. The standardized session data set obtained after standardization preprocessing of the historical session record set has standardized formats for user electricity query statements and system response statements, facilitating subsequent feature extraction and analysis.
[0089] In this embodiment of the invention, step S200 involves performing standardized preprocessing on the historical session record set to obtain a standardized session data set, which may specifically include the following steps S210~S250:
[0090] Step S210: Perform data cleaning processing on each time-series session window in the historical session record set to remove user electricity query statements and system response statements containing garbled characters from the time-series session windows.
[0091] Data cleaning is performed to ensure data quality by removing invalid data containing garbled characters. Garbled characters may arise from errors during data transmission, incompatible encoding formats, or other reasons, and these characters can affect subsequent analysis and processing. When performing data cleaning on each time-series session window in the historical session record set, it is necessary to identify and remove user electricity consumption query statements and system response statements containing garbled characters. For example, in some cases, due to network or system failures, user electricity consumption query statements may contain unrecognizable characters such as "???", which need to be identified and removed from the time-series session window.
[0092] In this embodiment of the invention, step S210 involves data cleaning of each time-series session window in the historical session record set, removing user electricity query statements and system response statements containing garbled characters from the time-series session windows. Specifically, this may include the following steps S211~S216:
[0093] Step S211: Perform character validity detection on the user's electricity consumption query statement in the time sequence session window, and identify garbled substrings containing non-standard printable characters in the user's electricity consumption query statement.
[0094] Character validity detection involves using specific algorithms to examine each character in a user's electricity consumption query statement to determine if any non-standard printable characters exist. Non-standard printable characters refer to those that cannot be displayed correctly or do not conform to standard encoding specifications, such as some control characters and special symbols. Regular expressions can be used to implement character validity detection. For example, a regular expression pattern can be defined to match all standard printable characters, and then the user's electricity consumption query statement can be checked to see if it conforms to the pattern. If any non-conforming characters are found, they are identified as garbled substrings. For instance, in a user's electricity consumption query statement "Query this month's electricity consumption ???", regular expression detection can identify "???" as a garbled substring.
[0095] Step S212: Perform contextual semantic analysis on the garbled substring to determine whether the garbled substring is a key semantic part of the user's electricity query statement.
[0096] Contextual semantic analysis involves analyzing the role and meaning of garbled characters within a user's electricity consumption query statement, taking into account the contextual information. Key semantic components are those crucial for understanding the user's query intent. For example, in a query like "Query this month's [garbled] electricity consumption," context analysis reveals that "[garbled]" is not a key semantic component, because even without it, the user's intent remains clear: to query this month's electricity consumption. Semantic analysis models from Natural Language Processing (NLP) can be used for contextual semantic analysis. These models learn the semantic structure and contextual information of the statement to determine whether garbled characters are key semantic components.
[0097] Step S213: If the garbled substring is a key semantic part, then mark the user electricity query statement containing the garbled substring as an invalid statement.
[0098] If the garbled string is a key semantic component, the user's electricity consumption query statement may not accurately express the user's query intent, and therefore it is marked as an invalid statement. For example, in a user's electricity consumption query statement "[garbled string] query this month's electricity consumption", because the garbled string is at the beginning of the statement, it may affect the understanding of the entire statement, so the statement is marked as invalid. Marking an invalid statement can be achieved by adding a specific flag field to the statement in the database, for example, setting the value of the flag field to "invalid".
[0099] Step S214: If the garbled substring is a non-critical semantic part, then perform character replacement processing on the garbled substring, replacing the garbled substring with a preset placeholder symbol.
[0100] When garbled substrings are not critical semantic parts, character substitution can be performed to ensure the readability and analyzability of the statement. The preset placeholder can be a specific character or string, such as "[placeholder]". For example, in a user's electricity consumption query statement "Query this month's [garbled] electricity consumption", replacing "[garbled]" with "[placeholder]" will result in "Query this month's [placeholder] electricity consumption". Character substitution can be implemented using string replacement functions; programming languages typically have built-in string replacement functions that can be used directly.
[0101] Step S215: Perform the same character validity detection, context semantic analysis, invalid statement marking, or garbled substring replacement on the system response statements in the timing session window.
[0102] The system response statements are processed in the same way as user electricity consumption query statements to ensure data quality. Similarly, character validity checks are performed to identify garbled substrings, followed by contextual semantic analysis to determine if they are key semantic components. Based on the result, invalid statements are marked or garbled substrings are replaced. For example, in a system response statement "This month's electricity consumption is [garbled] degrees," after processing, if "[garbled]" is not a key semantic component, it is replaced with a preset placeholder.
[0103] Step S216: Remove the user power consumption query statements and system response statements marked as invalid statements from the timing session window to generate a cleaned timing session window.
[0104] Removing user electricity consumption query statements and system response statements marked as invalid from the time-series session window ensures that the data in the cleaned time-series session window is valid. This process can be achieved through database deletion operations. Invalid statements are filtered out in the database based on the values of the marked fields, and then deleted from the corresponding time-series session window records. For example, in a time-series session window containing 10 user electricity consumption query statements and system response statements, after the above processing, 2 statements are marked as invalid. Removing these 2 statements generates a cleaned time-series session window containing 8 valid statements.
[0105] Step S220: Perform format unification processing on the cleaned time-series session window, convert the text encoding format of the user's electricity query statement into a preset unified encoding format, and adjust the timestamp mark format of the system response statement to be consistent with the timestamp mark format of the user's electricity query statement.
[0106] Format unification is performed to ensure greater consistency in the format of data within the cleaned time-series session window. Unifying the text encoding format avoids data display errors caused by inconsistent encoding. The default unified encoding format is UTF-8, a widely used encoding format that supports multiple languages and character sets. Converting the text encoding of user electricity query statements to the default unified encoding format can be achieved using encoding conversion functions in programming languages; for example, in Python, the `encode()` and `decode()` functions can be used for encoding conversion. Adjusting the timestamp format ensures consistency in time representation between user electricity query statements and system response statements, facilitating subsequent time-series analysis. For example, the timestamp format of the system response statement can be changed from "YYYY-MM-DD HH:MM:SS" to the same "YYYY / MM / DD HH:MM:SS" format as the user electricity query statement. This adjustment can be achieved using string manipulation functions, splitting and recombinating the original timestamp string according to specific rules.
[0107] Step S230: Perform missing value completion processing on the time-series session window after format unification. For the missing key field information in the user's electricity query statement or system response statement, use the field information of the same type of time-series session window in the historical session record set to fill the missing field information.
[0108] Missing value completion is performed to ensure data integrity and prevent subsequent analysis and processing from being affected by missing key field information. Key field information refers to fields that play an important role in understanding the user's electricity consumption query intent and the system response content, such as query time and electricity consumption value. In a standardized time-series session window, if a user's electricity consumption query statement or system response statement contains missing key field information, the field information of the same type of time-series session window can be searched from the historical session record set and filled in. For example, if a user's electricity consumption query statement is missing the query time field, but the historical session record set contains a query statement of the same type that contains this field information, then this field information can be filled into the current query statement. Missing value completion can be implemented through data matching and search algorithms. The database is searched for matching historical records based on the query statement type and other relevant information, and then the corresponding field information is extracted and filled in.
[0109] Step S240: Perform semantic normalization processing on the completed time-series session window, mapping different expressions of the same electricity demand in the user's electricity query statement to preset standard semantic labels, and mapping different expressions of the same service feedback in the system response statement to preset standard response labels.
[0110] Semantic normalization aims to eliminate discrepancies in the expression of user electricity consumption queries and system responses, representing identical electricity needs and service feedback using unified standard labels. Predefined standard semantic and response labels are used to standardize and unify different expression methods. For example, user electricity consumption queries such as "Query this month's electricity consumption" and "I want to know how much electricity I used this month" both represent the same electricity demand, and are mapped to the predefined standard semantic label "Query this month's electricity consumption." Similarly, system response statements such as "This month's electricity consumption is [X] kWh" and "You used [X] kWh of electricity this month" both represent the same service feedback, and are mapped to the predefined standard response label "Inform me of this month's electricity consumption." Semantic normalization improves data comparability and analytical efficiency.
[0111] In this embodiment of the invention, step S240 involves semantic normalization of the completed time-series session window, mapping different expressions of the same electricity demand in the user's electricity query statement to preset standard semantic tags. Specifically, this may include the following steps S241~S246:
[0112] Step S241: Construct an electricity demand semantic knowledge base, which includes a preset set of standard semantic tags and positive and ambiguous expression examples corresponding to each standard semantic tag.
[0113] The electricity demand semantic knowledge base is a knowledge base used to store and manage semantic information related to electricity demand. The preset set of standard semantic tags is a series of predefined tags used to represent different electricity demands, such as "query this month's electricity consumption" and "query electricity price." Positive expression examples are expressions that directly and clearly convey the electricity demand represented by the standard semantic tag. For example, for the standard semantic tag "query this month's electricity consumption," positive expression examples could be "query this month's electricity consumption" or "I want to check how much electricity I used this month." Ambiguous expression examples are expressions that may have multiple interpretations and require further analysis to determine their electricity demand. For example, for the standard semantic tag "query this month's electricity consumption," an ambiguous expression example could be "How was your electricity usage this month?" The electricity demand semantic knowledge base can be built by manually organizing and labeling a large number of electricity demand expressions and categorizing them under the corresponding standard semantic tags. Alternatively, machine learning algorithms can be used to automatically learn and extract standard semantic tags and corresponding expression examples from historical session records.
[0114] Step S242: Perform semantic vector transformation on the user's electricity consumption query statement to generate a semantic vector representation of the user's electricity consumption query statement.
[0115] Semantic vector transformation converts user electricity usage queries from text to vector form to facilitate subsequent similarity calculations and matching. Semantic vector representation is a way of representing the semantics of a statement using vectors, where each dimension of the vector represents a semantic feature. Pre-trained word vector models, such as Word2Vec and GloVe, can be used to convert each word in the user's electricity usage query into a corresponding word vector. Then, methods such as average pooling and max pooling are used to combine these word vectors into a semantic vector representation of the statement. For example, for the user's electricity usage query "Query this month's electricity usage," each word "query," "this month," and "electricity usage" is converted into a word vector, and then these word vectors are combined into a single vector using average pooling as the semantic vector representation of the statement.
[0116] Step S243: Calculate the similarity value between the semantic vector representation and the semantic vector representation of each standard semantic tag in the electricity demand semantic knowledge base.
[0117] Similarity score is an indicator that measures the semantic similarity between a user's electricity consumption query and standard semantic tags. By calculating the similarity score between semantic vector representations, the standard semantic tags that best match the user's electricity consumption query can be identified. The cosine similarity algorithm can be used to calculate the similarity score between semantic vector representations. Cosine similarity measures the similarity between two vectors by calculating the cosine of the angle between them; the smaller the angle, the closer the cosine value is to 1, indicating a higher similarity. For example, by calculating the cosine similarity score between the semantic vector representation of the user's electricity consumption query and the semantic vector representations of standard semantic tags such as "query this month's electricity consumption" and "query electricity price" in the electricity demand semantic knowledge base, the similarity score between each standard semantic tag and the query can be obtained.
[0118] Step S244: Extract standard semantic tags with similarity values exceeding a preset threshold as candidate tags. If there are multiple candidate tags and their similarity value differences are less than a preset difference threshold, then trigger the semantic conflict resolution process.
[0119] The preset threshold is a pre-defined similarity threshold used to filter out standard semantic tags with high similarity to the user's electricity consumption query. Candidate tags are standard semantic tags whose similarity values exceed the preset threshold. The preset difference threshold is a boundary used to determine whether the similarity difference between multiple candidate tags is sufficiently small. If multiple candidate tags exist and their similarity differences are less than the preset difference threshold, it indicates that these candidate tags have high semantic similarity to the user's electricity consumption query, making it difficult to directly determine the best-matching tag, thus triggering the semantic conflict resolution process. For example, with a preset threshold of 0.8 and a preset difference threshold of 0.05, the semantic vector representation of the user's electricity consumption query has similarity values of 0.85 and 0.83 with the standard semantic tags "query this month's electricity consumption" and "query the electricity consumption of the past three months," respectively. Since both similarity values exceed the preset threshold and the difference is less than the preset difference threshold, the semantic conflict resolution process is triggered.
[0120] Step S245: The semantic conflict resolution process may specifically include the following steps: extracting the contextual time sequence information of the user's electricity query statement, analyzing the continuity of the user's electricity query intent before and after the current time sequence session window; combining the historical query patterns of the same user in the historical session record set to determine the main demand tendency of the user's electricity query statement; and selecting the most matching standard semantic label from multiple candidate labels as the final mapping label based on the main demand tendency.
[0121] Contextual timing information refers to the position and related information of a user's electricity usage query within the timing session window. Analyzing this information reveals the continuity of the user's electricity usage query intent. For example, if a user's queries before the current query are all about this month's electricity usage, then the current query is more likely to also be about this month's electricity demand. Historical query patterns refer to the query habits and patterns of the same user in the historical session record set. Analyzing historical query patterns reveals the user's main demand tendencies. For example, if a user frequently queries this month's electricity usage, then when semantic conflicts occur, they are more likely to choose the standard semantic label related to querying this month's electricity usage as the final mapping label. Based on the main demand tendency, the most matching standard semantic label is selected from multiple candidate labels. As in the example above, based on the user's historical query pattern and contextual timing information, it is determined that the user's main demand tendency is to query this month's electricity usage, therefore "query this month's electricity usage" is selected as the final mapping label.
[0122] Step S246: Associate and store the semantic vector representation of the user's electricity consumption query statement with the final mapped label, and update the ambiguous expression example library of the electricity demand semantic knowledge base.
[0123] Associating and storing the semantic vector representation of a user's electricity consumption query with its final mapped label facilitates subsequent queries and analysis. Updating the ambiguous expression example library of the electricity demand semantic knowledge base involves adding user electricity consumption queries as new ambiguous expression examples under the corresponding standard semantic labels to continuously improve the knowledge base. For example, associating and storing the semantic vector representation of the user's electricity consumption query "I want to see how my electricity consumption is this month" with the final mapped label "Query this month's electricity consumption," and adding this query to the ambiguous expression example library of the standard semantic label "Query this month's electricity consumption." This association and knowledge base update can be achieved through database operations, storing the semantic vector representation and final mapped label in the corresponding tables of the database and updating the records in the ambiguous expression example library.
[0124] Step S250: Sort and organize the processed time-series session windows in chronological order to generate a standardized session data set containing an ordered sequence of time-series session windows.
[0125] Sort and organize the processed time-series session windows in chronological order to ensure the data in the standardized session dataset has a temporal sequence, facilitating subsequent time-series analysis and processing. An ordered time-series session window sequence is a collection of time-series session windows arranged chronologically. Sorting algorithms, such as quicksort, can be used to sort the processed time-series session windows according to their timestamps, generating a standardized session dataset containing the ordered time-series session window sequence. In a database, the time-series session windows can be sorted by the time field using the ORDER BY clause in an SQL statement, and the sorted result can then be stored as a standardized session dataset.
[0126] Step S300: Process the standardized session data set through time series analysis and interaction behavior analysis, identify and extract the time series correlation features of user electricity consumption queries and the correlation features of user interaction behavior with the system, and generate a time series feature set;
[0127] The time-series feature set includes time-series correlation features of user electricity consumption queries and behavioral correlation features of user-system interactions. Extracted from a standardized session dataset, the time-series feature set reflects the temporal and behavioral characteristics of user electricity consumption queries and system interactions. The time-series correlation features of user electricity consumption queries are related to the temporal order and frequency of these queries, such as the frequency of occurrence of queries within consecutive time periods and the semantic similarity between queries in adjacent time periods. The behavioral correlation features of user-system interactions are related to the interaction between the user and the system, such as the response delay between user queries and corresponding system responses, and the degree to which the system response satisfies the user's electricity consumption query needs. By extracting the time-series feature set, a deeper understanding of user electricity consumption behavior and demand patterns can be gained.
[0128] In this embodiment of the invention, step S300, extracting a time-series feature set from the standardized session data set, may specifically include the following steps S310~S350:
[0129] Step S310: Perform time series analysis on each time series session window in the standardized session dataset, extract the frequency characteristics of user electricity consumption query statements in continuous time periods and the semantic similarity characteristics of user electricity consumption query statements in adjacent time periods, and use them as the time series association features of user electricity consumption query statements.
[0130] Time series analysis involves analyzing time-series session windows within a standardized session dataset in chronological order to extract temporal features. The frequency of user electricity consumption queries within a continuous time period refers to the number or frequency of such queries occurring within a given timeframe. For example, counting the number of times a user queries their electricity consumption within a day yields the frequency of those queries for that day. The semantic similarity of user electricity consumption queries between adjacent time periods refers to the degree of semantic similarity between user queries in two adjacent time-series session windows. For example, comparing the semantic similarity of user queries in the morning and afternoon suggests a higher similarity, indicating a degree of continuity in user electricity consumption queries. Time series analysis models, such as the ARIMA (Autoregressive Integral Moving Average) model, can be used for time series analysis. This model can model and predict time series data, thereby extracting relevant time-series correlation features.
[0131] In this embodiment of the invention, step S310 involves performing time series analysis on each time-series session window in the standardized session data set, extracting the frequency characteristics of user electricity consumption query statements within consecutive time periods and the semantic similarity characteristics of user electricity consumption query statements in adjacent time periods, as the time series association features of user electricity consumption query statements. Specifically, this may include the following steps S311~S315:
[0132] Step S311: Divide the time-series session window into multiple sub-time periods according to a preset time interval, count the number of times user electricity consumption query statements appear in each sub-time period, and generate the frequency distribution characteristics of user electricity consumption query statements in continuous time periods.
[0133] The preset time interval is a pre-defined duration used to divide the time-series session window into smaller sub-segments. For example, a day's time-series session window can be divided into 24 sub-segments with 1-hour time intervals. The frequency of user electricity usage queries within each sub-segment is calculated. For instance, in the first sub-segment (0:00-1:00), the query appears 3 times; in the second sub-segment (1:00-2:00), it appears 5 times, and so on. The frequency of each sub-segment is then arranged chronologically to generate a distribution of the user electricity usage query frequency over a continuous period. This division of the time-series session window and the counting of occurrences can be implemented by writing program code. The queries can be grouped in the database according to the time field, and the number of records in each group can be counted.
[0134] Step S312: Perform semantic similarity calculation on user electricity consumption query statements within adjacent sub-time periods, compare the matching degree of standard semantic tags of user electricity consumption query statements within adjacent sub-time periods, and generate semantic similarity features of user electricity consumption query statements within adjacent time periods.
[0135] Semantic similarity calculation involves using specific algorithms to determine the semantic similarity of user electricity consumption queries within adjacent sub-time periods. A common method is to compare the matching degree of standard semantic labels for these queries. Standard semantic labels are unified labels obtained after semantic normalization. For example, if the standard semantic label for a user electricity consumption query in one adjacent sub-time period is "query this month's electricity consumption," and the standard semantic label for the query in the next sub-time period is also "query this month's electricity consumption," then the semantic similarity between these two adjacent sub-time periods is high. The cosine similarity algorithm mentioned earlier can be used to calculate the similarity value between the semantic vector representations of the standard semantic labels, serving as the semantic similarity feature of user electricity consumption queries within adjacent time periods.
[0136] Step S313: Perform time-series smoothing on the frequency distribution features to eliminate abnormal fluctuations in the frequency distribution features and generate smoothed frequency features.
[0137] Time-series smoothing aims to remove abnormal fluctuations in the frequency distribution characteristics, making the data smoother and more stable. Abnormal fluctuations may be caused by random factors or data noise, affecting the accurate analysis of user electricity consumption query behavior. Time-series smoothing algorithms such as moving averages and exponential smoothing can be used. Moving averages smooth data by calculating the average value of data within a certain time window. For example, using a moving average of three sub-time periods, the average frequency of each sub-time period and its two preceding and following sub-time periods is calculated as the smoothed frequency for that sub-time period. Exponential smoothing smooths data based on the weighting of historical data, with more weight given to recent data and less weight given to older data. Through time-series smoothing, a smoothed frequency characteristic is generated that better reflects the true trend of user electricity consumption query behavior.
[0138] Step S314: Perform temporal correlation analysis on the semantic similarity features, identify the changing trend of semantic similarity features in continuous sub-time units, and generate trend-based semantic similarity features.
[0139] Temporal correlation analysis analyzes semantic similarity features sequentially over time to uncover trends. These trends can be upward, downward, or stable. For example, analyzing the changes in semantic similarity features between adjacent sub-time periods reveals a gradual increase in semantic similarity features, indicating that users' electricity usage query needs are becoming increasingly continuous over consecutive time periods. Trend analysis methods in time series analysis, such as linear regression and multinomial regression, can be used to identify these trends. Linear regression analysis can fit a straight line to represent the trend of semantic similarity features; the slope of the line can then be used to determine whether the trend is upward or downward. The generated trend-based semantic similarity features can more clearly demonstrate the temporal correlation characteristics of users' electricity usage query needs.
[0140] Step S315: Combine the smoothed frequency features and trend semantic similarity features to generate time series association features of user electricity consumption query statements.
[0141] Combining smoothed frequency features and trend-based semantic similarity features aims to comprehensively consider the temporal changes in the frequency and semantic similarity of user electricity usage queries, resulting in more comprehensive time-series association features. These smoothed frequency features and trend-based semantic similarity features can be combined as different dimensions of a vector to form a new vector representing the time-series association features of user electricity usage queries. For example, using smoothed frequency features as the first dimension and trend-based semantic similarity features as the second dimension yields a two-dimensional vector representing the time-series association features of user electricity usage queries. This combined feature can more accurately reflect the temporal characteristics of user electricity usage query behavior.
[0142] Step S320: Perform interactive behavior analysis on each time-series session window in the standardized session data set, and extract the response delay features between the user's electricity query statement and the corresponding system response statement, as well as the degree to which the system response statement meets the user's electricity query statement's needs, as behavioral association features of user-system interaction.
[0143] Interactive behavior analysis involves analyzing time-series session windows within a standardized session dataset to uncover the characteristics of user-system interactions. The response delay between a user's electricity consumption query and the corresponding system response refers to the time elapsed from the user submitting the query to the system providing a response. For example, if a user submits the query "Query this month's electricity consumption" at 10:00 AM, and the system responds with "This month's electricity consumption is [X] kWh" at 10:05 AM, the response delay is 5 minutes. The system response's satisfaction level with the user's electricity consumption query refers to whether the system response accurately and completely answers the user's query. For example, if the system accurately provides the current month's electricity consumption figure, the satisfaction level is high; if the system provides irrelevant information instead of a figure, the satisfaction level is low. Response delay and satisfaction level characteristics can be extracted by analyzing the timestamp information and the content of the query and response statements within the time-series session windows, serving as behavioral correlation features between the user and system.
[0144] Step S330: Perform feature association analysis on time series association features and behavioral association features to identify co-occurrence patterns between time series association features and behavioral association features.
[0145] Feature association analysis (FAA) uses specific algorithms to analyze the relationships between time-series and behavioral features, identifying co-occurrence patterns. A co-occurrence pattern refers to the regularity and pattern of two or more features appearing simultaneously in data. For example, it might be found that when user electricity usage queries occur frequently, the system response also satisfies those requests more effectively; this is a co-occurrence pattern. Association rule mining algorithms, such as the Apriori algorithm and FP-growth algorithm, can be used for FAA. The Apriori algorithm mines frequent itemsets from the data through a layer-by-layer search, then generates association rules based on these itemsets, thereby identifying co-occurrence patterns between time-series and behavioral features.
[0146] Step S340: Based on the co-occurrence relationship pattern, perform feature filtering on time series association features and behavioral association features, and retain features that are strongly correlated with the co-occurrence relationship pattern as effective time series features.
[0147] Feature selection involves filtering features strongly correlated with co-occurrence patterns from time-series and behavioral features. Strongly correlated features are those that frequently appear in the co-occurrence patterns and significantly influence their formation. For example, in the co-occurrence patterns identified above, the frequency of user electricity usage queries and the degree to which system response statements meet demand are strongly correlated features, and these are retained as valid time-series features.
[0148] Regarding the setting of relevance thresholds, a dynamic threshold determination method based on a combination of statistical distribution and business objectives is adopted. Specifically, the relevance scores (such as Pearson correlation coefficients) of all candidate features and co-occurrence patterns are calculated, the statistical distribution of these scores is analyzed, and values above the upper tertiary (such as the 75th percentile) are selected as the initial threshold. The threshold is then validated using performance metrics from downstream tasks (such as classification or prediction models), and adjusted through cross-validation to ensure that model accuracy or F1 score is maximized while maintaining a sufficient number of features. Multiple threshold levels (such as high, medium, and low sensitivity modes) can also be set for flexible selection based on different application scenarios.
[0149] To assess the relevance of features, a combination of statistical and information theory methods is employed. Besides the Pearson correlation coefficient to measure linear correlation, the Spearman rank correlation coefficient can be introduced to capture nonlinear monotonic relationships, or mutual information can be used to evaluate the degree of nonlinear dependence between features and co-occurrence patterns. For categorical or discrete behavioral features, the chi-square test or information gain is used for evaluation. By fusing multiple indicators (such as weighted averages or voting mechanisms), the strength of the association between features and co-occurrence patterns can be more comprehensively determined, improving the robustness and interpretability of the screening results.
[0150] By setting a relevance threshold, the relevance of each feature to the co-occurrence pattern is calculated, and features with a relevance exceeding the threshold are retained. Relevance can be calculated using metrics such as the Pearson correlation coefficient, which assesses relevance by calculating the linear correlation between features.
[0151] Step S350: Arrange and combine the effective time-series features according to the time order of the time-series session window to generate a time-series feature set containing time-series correlation features and behavioral correlation features.
[0152] Arranging and combining valid time-series features according to the chronological order of the time-series session windows ensures that the generated time-series feature set has temporal sequence and coherence. Following the chronological order of the time-series session windows, the valid time-series features corresponding to each window are arranged sequentially, forming an ordered feature set. For example, the valid time-series features of the first time-series session window are placed first, followed by those of the second, and so on. This generated time-series feature set can more accurately reflect the temporal changes in user electricity consumption behavior and system interaction, providing more valuable data for subsequent analysis and processing. Program code can be written to sort and combine valid time-series features based on the timestamp information of the time-series session windows, storing the sorted features in a list or array as the time-series feature set.
[0153] Step S400: Call the pre-configured federated learning framework to perform privacy protection processing on the temporal feature set to generate a privacy-enhanced feature set; the privacy-enhanced feature set contains feature representations that retain key privacy information after being jointly trained with data from multiple parties.
[0154] A pre-configured federated learning framework is a pre-set architecture and algorithm system for federated learning. Federated learning is a technique that trains models through multi-party collaboration without sharing the original data, effectively protecting data privacy. Privacy-preserving processing of time-series feature sets is to prevent the leakage of users' critical privacy information during data processing and analysis. Critical privacy information refers to data involving user identity, sensitive electricity consumption information, etc. Through multi-party data joint training, different data owners can jointly participate in model training without sharing the original data, thereby improving the model's performance and generalization ability. During training, features are processed and transformed to generate feature representations that retain critical privacy information, forming a privacy-enhanced feature set. For example, multiple power companies can use a federated learning framework to jointly train an electricity consumption behavior prediction model without sharing their respective users' original electricity consumption data. The resulting privacy-enhanced feature set can be used to more accurately predict users' electricity consumption behavior while protecting user privacy.
[0155] In this embodiment of the invention, step S400 involves invoking a pre-configured federated learning framework to perform privacy protection processing on the temporal feature set, generating a privacy-enhanced feature set. Specifically, this may include the following steps S410-S450:
[0156] Step S410: Distribute the temporal feature set to multiple local computing nodes participating in federated learning. Each local computing node performs local feature transformation processing on the distributed temporal feature set to generate an intermediate feature representation containing local privacy constraints.
[0157] Multiple local computing nodes participating in federated learning refer to computing devices belonging to different data owners, such as servers of various power companies. Distributing the time-series feature set across multiple local computing nodes enables distributed data processing and improves computational efficiency. Local feature transformation processing is the process performed by each local computing node on its assigned time-series feature set, aiming to convert the original features into intermediate feature representations without revealing local data privacy. Local privacy constraints are rules set by each local computing node based on its own data security and privacy requirements, used to protect the privacy information of local users. For example, a power company's local computing node might require encryption of users' specific electricity consumption information; during local feature transformation, it will follow this privacy constraint when processing the relevant features. The generated intermediate feature representation is the feature after local feature transformation processing, containing local privacy constraint information. The time-series feature set can be distributed to various local computing nodes through network communication protocols, and each local computing node performs local feature transformation processing according to its own processing capabilities and privacy constraint rules.
[0158] In this embodiment of the invention, in step S410, each local computing node performs local feature transformation processing on the allocated time-series feature set to generate an intermediate feature representation containing local privacy constraints, which may specifically include the following steps S411~S415:
[0159] Step S411: Each local computing node obtains the preset local privacy constraint rules, which include the categories of sensitive user attributes that need to be protected and the corresponding feature transformation strategies.
[0160] Pre-defined local privacy constraints are rules pre-set by each local computing node to protect data privacy. Sensitive user attribute categories refer to attribute categories involving user privacy and sensitive information, such as a user's name, ID number, and specific electricity consumption. Corresponding feature transformation strategies are feature transformation methods set for different sensitive user attribute categories. For example, for the user's name attribute, the feature transformation strategy could be hash encryption, converting the name into a hash value to protect the user's identity information. For the specific electricity consumption attribute, the feature transformation strategy could be differential privacy processing, adding a certain amount of noise to protect the specific electricity consumption value. Each local computing node can store local privacy constraints in a configuration file and retrieve the rule from the configuration file during local feature transformation processing.
[0161] Step S412: Each local computing node identifies sensitive features in the time-series feature set that are associated with sensitive user attribute categories, based on local privacy constraint rules.
[0162] Identifying sensitive features involves finding features associated with sensitive user attribute categories from a time-series feature set based on local privacy constraints. For example, if local privacy constraints require the protection of a user's specific electricity consumption information, then features related to electricity consumption in the time-series feature set are sensitive features. Sensitive features can be identified through information such as feature name and feature type. For instance, features whose names contain "electricity consumption" are sensitive features associated with sensitive user attribute categories. In a database, sensitive features can be filtered based on feature name and type using query statements.
[0163] Step S413: Perform feature transformation processing on sensitive features. Use a preset feature transformation function to map the original value of the sensitive features to a transformed value that does not contain specific user identity information. The transformation function includes a hash mapping function and a category generalization function.
[0164] Feature transformation is used to protect the privacy of sensitive features by converting the original values of these features into transformed values that do not contain specific user identity information. A hash mapping function is a function that maps input values to fixed-length hash values. Through hash mapping, the original value of a sensitive feature can be converted into a hash value, making it impossible to deduce the original value from the hash value. For example, using hash algorithms such as MD5 and SHA-256 to convert a user's name into a hash value. A category generalization function classifies a specific feature value into a broader category to reduce feature privacy. For example, classifying a user's specific age value into an age range, such as "20-29 years old" or "30-39 years old". By using these pre-defined feature transformation functions, the privacy of sensitive features can be effectively protected. Feature transformation can be implemented using hash function libraries in programming languages and custom category generalization functions.
[0165] Step S414: Perform feature standardization on the non-sensitive features in the time series feature set, adjust the value range of the non-sensitive features to a preset uniform numerical range, and eliminate the dimensional differences between different non-sensitive features.
[0166] Feature standardization is performed to give non-sensitive features a uniform numerical range and dimension, facilitating subsequent model training and analysis. Different non-sensitive features may have different value ranges and dimensions; for example, one feature might have a value range of [0, 100], while another might have a range of [0, 1000]. This difference can affect the model's training performance. The preset uniform numerical interval could be [0, 1] or [-1, 1], etc. Minimum-maximum normalization (MMR) or Z-score standardization can be used for feature standardization. MMR linearly maps the feature's value range to a preset uniform numerical interval by calculating the feature's minimum and maximum values, transforming each feature value into its corresponding value within the uniform interval. Z-score standardization calculates the feature's mean and standard deviation, transforming the feature values into values under a standard normal distribution. Feature standardization eliminates the dimensional differences between different non-sensitive features, improving the model's training performance.
[0167] Step S415: Perform feature concatenation on the transformed sensitive features and the standardized non-sensitive features to generate an intermediate feature representation that includes local privacy constraints.
[0168] Feature concatenation combines transformed sensitive features with standardized insensitive features to form a new feature representation. The processed sensitive and insensitive features are arranged in a specific order to generate a vector containing multiple feature dimensions, serving as an intermediate feature representation that incorporates local privacy constraints. For example, the transformed sensitive features can be placed before the vector, followed by the standardized insensitive features, forming a complete intermediate feature representation. Feature concatenation can be implemented using array or list operations in programming languages, storing the processed features in an array or list as the intermediate feature representation.
[0169] Step S420: Each local computing node performs privacy masking on the intermediate feature representation, adding preset privacy protection mask information to the intermediate feature representation. The privacy protection mask information is used to obfuscate sensitive user identification information in the intermediate feature representation.
[0170] Privacy masking is used to further enhance the privacy of intermediate feature representations by adding pre-defined privacy-protecting mask information to obfuscate sensitive user identification information. This pre-defined privacy-protecting mask information is mask data pre-set to protect privacy; it can be randomly generated numerical values or strings. For example, adding a randomly generated noise vector to the intermediate feature representation mixes the sensitive user identification information with the noise, making it difficult to extract the sensitive user identification information directly from the intermediate feature representation. The privacy-protecting mask information can be generated using a random number generator and then added to or multiplied by the intermediate feature representation to incorporate the mask information.
[0171] Step S430: Each local computing node inputs the intermediate feature representation with the privacy mask added into the local training model for feature enhancement training processing, generating a local enhanced feature representation containing local enhancement information.
[0172] A locally trained model is a model pre-trained on each local computing node for feature enhancement training. Feature enhancement training involves further processing and learning the intermediate feature representation after adding a privacy mask using the locally trained model, extracting more valuable feature information, and generating a locally enhanced feature representation containing local enhancement information. Local enhancement information refers to information learned during local training that improves the quality and usefulness of the feature representation. For example, the locally trained model can be a neural network model that performs feature transformation and enhancement on the intermediate feature representation through multi-layered neuron computation and learning. The intermediate feature representation after adding the privacy mask is used as input, processed through the forward propagation of the locally trained model, and outputs a locally enhanced feature representation containing local enhancement information. During training, optimization algorithms such as stochastic gradient descent can be used to adjust the model's parameters to improve its performance.
[0173] Step S440: The federated learning coordination node collects the local augmented feature representations of each local computing node, performs feature parameter aggregation processing on the local augmented feature representations, and generates a global aggregated feature representation containing common features of data from multiple parties.
[0174] The federated learning coordinating node is the central node responsible for coordinating multiple local computing nodes in federated learning. Collecting local augmented feature representations from each local computing node involves transmitting these representations to the coordinating node via network communication protocols. Feature parameter aggregation involves integrating and processing the collected local augmented feature representations to identify common features and generate a global aggregated feature representation that incorporates these common features from multiple sources. Methods such as federated averaging algorithms can be used for feature parameter aggregation. The federated averaging algorithm calculates the average parameters of each local augmented feature representation to obtain the parameters of the global aggregated feature representation. For example, for the parameters of a neural network model from multiple local computing nodes, the parameters of the corresponding neural network model in the global aggregated feature representation are obtained by calculating the average. Through feature parameter aggregation, the information from multiple local computing nodes is fused to generate a more representative and universal global aggregated feature representation.
[0175] Step S450: Perform privacy verification processing on the global aggregated feature representation to verify whether the degree of obfuscation of sensitive user identification information in the global aggregated feature representation meets the preset privacy protection requirements. If it meets the requirements, output the global aggregated feature representation as a privacy-enhancing feature set.
[0176] Privacy verification is a crucial step in ensuring that the final generated feature set meets privacy protection requirements. Preset privacy protection requirements are set based on actual application scenarios and data security needs, and are used to measure whether the degree of obfuscation of sensitive user identification information reaches an acceptable level of privacy protection. For example, in a power big data scenario, it may be required that sensitive user identification information be sufficiently obfuscated in the globally aggregated feature representation, making it difficult for attackers to infer the specific user identity from the feature representation.
[0177] In this embodiment of the invention, step S450 involves performing privacy verification processing on the global aggregated feature representation to verify whether the obfuscation level of sensitive user identification information in the global aggregated feature representation meets preset privacy protection requirements. Specifically, this may include the following steps S451~S455:
[0178] Step S451: Construct a privacy verification sample set, which includes a subset of features randomly extracted from the global aggregated feature representation and the corresponding original local feature representation.
[0179] Constructing a privacy verification sample set provides the data foundation for privacy verification of the globally aggregated feature representation. Randomly selecting a subset of features from the globally aggregated feature representation ensures the randomness and representativeness of the samples, avoiding inaccurate verification results due to sample bias. The corresponding original local feature representation is used to compare with the selected feature subset to assess the degree of obfuscation of sensitive user identification information. For example, a subset of features can be randomly selected from the globally aggregated feature representation at a certain proportion, such as 10%, while the corresponding original local feature representations are obtained from the local computing node. In the database, a random sampling algorithm can be used to extract feature subsets from the data table of the globally aggregated feature representation, and the corresponding original local feature representations can be obtained through join queries.
[0180] Step S452: Call the pre-trained privacy attack model to perform user identity restoration attack processing on the feature subset. The privacy attack model is used to attempt to infer the user identification information corresponding to the original local features from the feature subset.
[0181] A pre-trained privacy attack model is a model pre-trained for performing privacy attacks. Its purpose is to simulate attacker behavior and attempt to reconstruct user identification information from a subset of features. This model can be trained using machine learning or deep learning algorithms, such as support vector machines and neural networks. During training, it uses a large amount of feature data and corresponding user identification information, enabling the model to learn the potential relationship between features and user identifiers. The privacy attack model is then invoked to perform user identification reconstruction attacks on a subset of features. By inputting the feature subset into the privacy attack model, it outputs the inferred user identification information. In this way, the degree of obfuscation of sensitive user identification information in the globally aggregated feature representation can be evaluated.
[0182] Step S453: Calculate the accuracy of the privacy attack model in successfully restoring user identification information as an indicator of privacy leakage risk.
[0183] The privacy leakage risk metric measures the degree of privacy leakage risk in the globally aggregated feature representation. It is calculated by statistically analyzing the accuracy rate at which a privacy attack model successfully reconstructs user identification information. Accuracy refers to the proportion of samples in which the privacy attack model correctly infers user identification information out of the total number of samples. For example, if there are 100 samples in the privacy verification sample set, and the privacy attack model correctly infers user identification information in 10 samples, then the privacy leakage risk metric is 10%. By calculating the privacy leakage risk metric, one can intuitively understand the degree of protection for sensitive user identification information in the globally aggregated feature representation.
[0184] Step S454: If the privacy leakage risk index is lower than the preset risk threshold, then the degree of confusion of the global aggregated feature representation is determined to meet the privacy protection requirements.
[0185] The preset risk threshold is a pre-defined privacy leakage risk limit used to determine whether the obfuscation level of the globally aggregated feature representation meets privacy protection requirements. If the privacy leakage risk index is less than the preset risk threshold, it indicates that the obfuscation level of sensitive user identification information in the globally aggregated feature representation is high, making it difficult for attackers to recover the user identification information from the feature representation. Therefore, the obfuscation level of the globally aggregated feature representation is determined to meet privacy protection requirements. For example, if the preset risk threshold is 5%, and the privacy leakage risk index is 3%, the globally aggregated feature representation is determined to meet privacy protection requirements. The preset risk threshold can be stored in a configuration file and read for comparison during the verification process.
[0186] Step S455: If the privacy leakage risk index is not lower than the preset risk threshold, the feature reprocessing process is triggered. The feature reprocessing process may include the following steps: adjusting the privacy mask generation parameters of each local computing node, re-executing the local feature transformation, privacy mask addition and local enhanced feature representation generation steps to generate a new local enhanced feature representation; re-aggregating the new local enhanced feature representation to generate an updated global aggregated feature representation, and repeating the privacy verification process until the privacy leakage risk index is lower than the preset risk threshold.
[0187] When the privacy leakage risk index is not lower than the preset risk threshold, it indicates that the privacy protection level of the globally aggregated feature representation is insufficient, requiring the triggering of a feature reprocessing process to improve privacy. Adjusting the privacy mask generation parameters of each local computing node changes the generation method of the privacy-protected mask information, increasing the randomness and obfuscation of the mask. For example, adjusting the seed value of the random number generator makes the generated privacy-protected mask information different from before. Re-executing the local feature transformation, privacy mask addition, and local enhanced feature representation generation steps is to reprocess and enhance the intermediate feature representation, generating a new local enhanced feature representation. The new local enhanced feature representation is then re-aggregated to generate an updated globally aggregated feature representation, and then privacy verification is performed again until the privacy leakage risk index is lower than the preset risk threshold. Through continuous adjustment and processing, the privacy protection level of the globally aggregated feature representation can be gradually improved.
[0188] Step S500: Generate power data privacy protection results based on the privacy-enhancing feature set, and feed the power data privacy protection results back to the power service system.
[0189] Generating privacy-preserving power data results based on privacy-enhanced feature sets involves further processing and transformation of the privacy-preserving feature sets to create results that meet the needs of the power service system. "Meeting the needs of the power service system" means that the results simultaneously meet the dual standards of data usability and privacy security. In terms of usability, the results must be converted into standard data formats (such as JSON and XML) compatible with the power service system interface after feature decoding, while retaining aggregated time-series and interactive features usable for user electricity behavior analysis, electricity bill prediction, and other business applications. In terms of security, the results must pass privacy verification to ensure that the privacy leakage risk index of the globally aggregated features is below a preset threshold. Furthermore, any remaining sensitive user identification information after decoding has been annotated with privacy-sensitive information, and privacy access control labels with high, medium, and low risk levels have been added, along with corresponding data access permission rules. This ensures that the data can be correctly parsed and utilized by the system while keeping the privacy leakage risk within an acceptable range. The results may include privacy-preserved power data features and analysis reports. Feeding back the privacy-preserving power data results to the power service system allows the system to utilize these results for subsequent analysis and decision-making. For example, the power service system can analyze user electricity consumption behavior and predict electricity costs based on the privacy protection results. The privacy protection results of the power data can be transmitted to a designated interface of the power service system via network communication protocols, ensuring the secure and accurate transmission of the data.
[0190] In this embodiment of the invention, step S500, generating a power data privacy protection result based on the privacy enhancement feature set and feeding the power data privacy protection result back to the power service system, may specifically include the following steps S510~S550:
[0191] Step S510: Perform feature decoding processing on the privacy-enhancing feature set, converting the feature representations in the privacy-enhancing feature set into a standard data format compatible with the power service system data interface.
[0192] Feature decoding converts the feature representations in a privacy-enhancing feature set from a privacy-protected format to a standard data format compatible with the power service system's data interface. The standard data format can be a specific data format predefined by the power service system, such as JSON or XML. For example, the feature representations in the privacy-enhancing feature set might be encrypted and encoded binary data; feature decoding converts this data into JSON format so that the power service system can correctly parse and process it. Appropriate decoding algorithms and libraries can be used to implement feature decoding, performing the conversion according to the specific format of the privacy-enhancing feature set and the requirements of the standard data format.
[0193] Step S520: Perform privacy-sensitive information annotation processing on the decoded privacy-enhancing feature set, identify residual sensitive user identification information that may be contained in the privacy-enhancing feature set, and add privacy access control labels to the residual sensitive user identification information.
[0194] Privacy-sensitive information labeling is designed to further protect the privacy of electricity data. It involves identifying and decoding residual sensitive user identification information that may remain in the privacy-enhanced feature set, and then adding privacy access control tags to these residual sensitive user identification information. Residual sensitive user identification information refers to information that may still contain sensitive user identifiers after a series of privacy protection processes. For example, during feature decoding, some encrypted sensitive information may be partially restored, but still requires protection. Privacy access control tags are used to restrict access to residual sensitive user identification information; different tags correspond to different access permission levels. By adding privacy access control tags to residual sensitive user identification information, it can be ensured that only users with the corresponding permissions can access this information.
[0195] In this embodiment of the invention, step S520 involves annotating the decoded privacy-enhancing feature set with privacy-sensitive information, which may specifically include the following steps S521-S525:
[0196] Step S521: Perform sensitive information detection processing on each feature item in the privacy enhancement feature set, and match the feature item with the feature patterns in the preset sensitive information feature library. The sensitive information feature library includes user name feature patterns, contact number feature patterns, and electricity address feature patterns.
[0197] Sensitive information detection and processing identifies potentially sensitive information contained in a privacy-enhancing feature set by matching feature items with feature patterns in a pre-built sensitive information feature library. The pre-built sensitive information feature library is a pre-constructed database containing various sensitive information feature patterns. User name feature patterns can be regular expression patterns of names, such as the regular expression "^[\u4e00-\u9fa5]{2,4}$" for matching Chinese names. Contact phone number feature patterns can be regular expression patterns of mobile phone numbers, such as "^1[3-9]\d{9}$". Address feature patterns can be patterns containing address keywords, such as "city", "district", and "street". Each feature item in the privacy-enhancing feature set is matched; if a feature item matches a feature pattern in the sensitive information feature library, it is considered that the feature item may contain sensitive information. Sensitive information detection and processing can be implemented using regular expression matching algorithms, and feature items that may contain sensitive information can be filtered out from the database based on feature patterns using query statements.
[0198] Step S522: Perform context verification processing on the feature items that match the sensitive information feature pattern to confirm whether the feature items truly represent user sensitive information in the contextual semantic environment of the privacy-enhancing feature set.
[0199] Contextual verification is used to avoid false positives and confirm whether feature items matching sensitive information feature patterns truly represent sensitive user information within the contextual semantic environment of the privacy-enhancing feature set. Some feature items may match sensitive information feature patterns but not represent sensitive information in a specific context. For example, the feature item "Zhang San" might be a common name in a certain context, not the user's real name. Contextual verification can be performed by analyzing the context of the feature item and the association with related features. For instance, if the context of the feature item "Zhang San" does not contain other information related to the user's identity, and the feature item is only used as a common name in the entire privacy-enhancing feature set, then it can be determined that the feature item does not represent sensitive user information.
[0200] Step S523: If it is confirmed that the feature item represents sensitive user information, then mark the feature item as residual sensitive user identification information.
[0201] If, after contextual verification, a feature is confirmed to represent sensitive user information, then that feature is marked as residual sensitive user identification information. This marking can be achieved by adding a specific tag field to the database for that feature; for example, setting the value of the tag field to "residual sensitive information." This facilitates subsequent management and protection of residual sensitive user identification information.
[0202] Step S524: Perform a privacy risk assessment on the residual sensitive user identification information to assess the possibility that the residual sensitive user identification information can be used to reverse-engineer the identity of a specific user.
[0203] Privacy risk assessment involves evaluating residual sensitive user identification information to determine the likelihood that it can be used to infer the specific user's identity. Factors considered include the sensitivity of the feature, its correlation with other information, and its importance within the privacy-enhancing feature set. For example, a user's ID number is highly sensitive information, and the likelihood of it being used to infer the specific user's identity is relatively high; while some of a user's electricity address information, if not associated with other key information, has a relatively low likelihood of being used to infer the specific user's identity. A risk assessment model can be used to assess privacy risks. This model can quantify residual sensitive user identification information based on preset assessment indicators and weights, and output a privacy risk score. The model is built based on the privacy leakage risk characteristics in the context of power big data, and determines the assessment indicator system, including three core indicators: "sensitivity of feature items," "correlation degree of feature items with other information," and "importance of feature items in the privacy-enhancing feature set." Quantitative standards and weight coefficients are set for each indicator. For example, "sensitivity" is graded and assigned values according to ID card number, phone number, detailed address, partial address, etc.; "correlation degree" is scored based on the frequency of co-occurrence of the feature with other sensitive fields in the dataset; and "importance" is referenced to its feature weight or information gain in the federated learning model. The weight coefficients are determined through expert scoring or historical risk event analysis. The model uses a weighted summation algorithm (e.g., Risk Score = Sensitivity Score × Weight 1 + Correlation Score × Weight 2). +Importance score × weight 3) Quantitatively assess residual sensitive information and output a comprehensive privacy risk score. This model can be pre-configured in the system as a rule engine or a lightweight scoring algorithm to achieve automated risk assessment.
[0204] Step S525: Assign corresponding privacy access control labels to the remaining sensitive user identification information based on the privacy risk assessment results. The privacy access control labels include high-risk labels, medium-risk labels, and low-risk labels, which correspond to different access restriction levels.
[0205] Assigning corresponding privacy access control labels to residual sensitive user identification information based on privacy risk assessment results is to implement different levels of access control according to different levels of privacy risk. High-risk labels correspond to the highest level of access restriction, allowing only users with advanced privileges to access the information; medium-risk labels correspond to a moderate level of access restriction, allowing users with intermediate privileges to access the information; and low-risk labels correspond to the lowest level of access restriction, allowing users with basic privileges to access the information. For example, if the privacy risk assessment results show that a piece of residual sensitive user identification information has a high privacy risk score, it will be assigned a high-risk label, restricting access to this information to only senior administrators. Different thresholds can be set based on the privacy risk score to classify residual sensitive user identification information into high, medium, and low risk levels and assign corresponding privacy access control labels to them.
[0206] Step S530: Set data access permission rules for the privacy enhancement feature set according to the privacy access control label. The data access permission rules include restrictions on the access scope and operation types of users with different permission levels to the privacy enhancement feature set.
[0207] Setting data access permission rules for privacy-enhancing feature sets based on privacy access control tags ensures that only users with the appropriate permissions can access and manipulate the data within these sets. Different permission levels include senior administrators, intermediate users, and junior users. Access scope refers to the specific range of data within the privacy-enhancing feature set that a user can access. For example, a senior administrator can access all data, while a junior user can only access some non-sensitive data. Operation type restrictions refer to the types of operations a user can perform on the data, such as read-only or read-write. For example, a senior administrator can perform read-write operations on all data in the privacy-enhancing feature set, while an intermediate user can only perform read-only operations on some data. Data access permission rules can be set in the permission management module of the power service system to control user access and manipulation of the privacy-enhancing feature set based on the user's permission level and privacy access control tags.
[0208] Step S540: Associate and bind the privacy enhancement feature set after setting access permission rules with the preset privacy protection metadata. The privacy protection metadata includes the source information, processing information and privacy protection level information of the privacy enhancement feature set.
[0209] Association binding is a process that links the privacy-enhancing feature set, after setting access permission rules, with pre-defined privacy-protecting metadata to better manage and protect the privacy of electricity data. The pre-defined privacy-protecting metadata consists of pre-defined information describing the privacy-enhancing feature set. Source information may include the data collection location and time; processing information may include the privacy-protecting processing steps and algorithms the data underwent; and privacy protection level information can be categorized according to the privacy protection level of the privacy-enhancing feature set, such as high, medium, and low. Association binding stores the privacy-enhancing feature set and privacy-protecting metadata in the same data structure or database table, facilitating subsequent queries and management. For example, a database join table can be used to implement association binding, storing the privacy-enhancing feature set and privacy-protecting metadata in different tables and linking them through a join field.
[0210] Step S550: The set of privacy-enhancing features after association and binding is used as the result of power data privacy protection and fed back to the power service system through a secure data transmission channel. The secure data transmission channel is used to ensure the integrity and confidentiality of the power data privacy protection result during the transmission process.
[0211] The final step in the entire privacy protection method is to use the associated and bound set of privacy-enhancing features as the result of power data privacy protection and feed it back to the power service system through a secure data transmission channel. The secure data transmission channel is used to protect the integrity and confidentiality of the power data privacy protection result during transmission. Integrity means that the data is not tampered with during transmission, and confidentiality means that the data is not leaked during transmission. For example, a Transport Layer Security (TLS) protocol can be used to establish an encrypted communication connection to encrypt the transmission of the power data privacy protection result. During transmission, data verification mechanisms can also be used to ensure data integrity, such as using a hash algorithm to calculate the hash value of the data, recalculating the hash value at the receiving end, and comparing it to verify whether the data has been tampered with.
[0212] In this embodiment of the invention, step S550 involves feeding back to the power service system through a secure data transmission channel, which may specifically include the following steps S551~S556:
[0213] Step S551: Perform data block processing on the power data privacy protection results, dividing the power data privacy protection results into multiple data block units, each data block unit containing continuous data information of a preset size.
[0214] Data chunking is used to facilitate data transmission and management by dividing the power data privacy protection results into multiple data block units. The preset size is the pre-defined size of each data block unit, which can be adjusted based on factors such as network bandwidth and transmission efficiency. For example, the power data privacy protection results can be divided into 1MB blocks, with each block containing 1MB of continuous data. File segmentation algorithms can be used to implement data chunking, dividing the power data privacy protection result file into multiple smaller files according to the preset size, with each smaller file serving as a data block unit.
[0215] Step S552: Encrypt each data block unit by using a preset symmetric encryption algorithm to generate encrypted data block units. The key for the symmetric encryption algorithm is determined in advance by the local computing node and the power service system.
[0216] Encryption is used to protect the confidentiality of data block units by employing a pre-defined symmetric encryption algorithm. This algorithm can be AES (Advanced Encryption Standard), among others. The key for the symmetric encryption algorithm is pre-negotiated and determined by the local computing node and the power service system, and both parties use the same key for encryption and decryption. For example, the local computing node and the power service system can negotiate a symmetric encryption key using the Diffie-Hellman key exchange algorithm, and then use this key to perform AES encryption on each data block unit, generating encrypted data block units. During the encryption process, functions and interfaces provided by the encryption library can be used to implement the encryption operations.
[0217] Step S553: Perform integrity check code generation processing on each encrypted data block unit, and use a preset hash algorithm to calculate the hash value of the encrypted data block unit as the integrity check code.
[0218] Integrity checksum generation is a process to ensure the integrity of encrypted data block units during transmission. A preset hash algorithm is used to calculate the hash value of the encrypted data block unit as the integrity checksum. The preset hash algorithm can be SHA-256 or similar. The hash value is a fixed-length string obtained by hashing the encrypted data block unit. For example, using the SHA-256 algorithm to hash the encrypted data block unit yields a 256-bit hash value as the integrity checksum. During transmission, the receiving end can recalculate the hash value of the encrypted data block unit and compare it with the integrity checksum sent by the sending end to verify whether the data has been tampered with.
[0219] Step S554: Encapsulate the encrypted data block unit and the corresponding integrity check code to generate a transmission data packet containing the encrypted data block and the check code.
[0220] Encapsulation is the process of combining encrypted data block units and their corresponding integrity check codes to generate a transmission data packet. The transmission data packet can be a file or data structure of a specific format, containing information about the encrypted data block and the check code. For example, combining encrypted data block units and integrity check codes according to a certain format generates a JSON-formatted transmission data packet, which includes the content of the encrypted data block and the integrity check code field. Encapsulation can be implemented using data structures and serialization libraries in programming languages, storing the encrypted data block units and integrity check codes in a data structure and serializing it into a JSON or other formatted transmission data packet.
[0221] Step S555: Send the data packets to the power service system in sequence through the secure data transmission channel. The secure data transmission channel uses the transport layer security protocol to establish an encrypted communication connection to ensure that the data packets are not illegally intercepted or tampered with during transmission.
[0222] Sending data packets sequentially to the power service system via a secure data transmission channel is a crucial step in ensuring the secure transmission of power data privacy protection results. The secure data transmission channel establishes an encrypted communication connection using Transport Layer Security (TLS) to encrypt the transmitted data packets. TLS encrypts and authenticates the transmitted data, preventing unauthorized interception or tampering during transmission. For example, a local computing node and the power service system establish an encrypted communication connection via TLS, sending data packets sequentially to the power service system. During transmission, network programming libraries and protocols can be used to implement data transmission, ensuring reliability and security.
[0223] Step S556: After receiving the transmitted data packet, the power service system decrypts and verifies the integrity of the data packet to ensure the integrity and confidentiality of the power data privacy protection results.
[0224] After receiving transmitted data packets, the power service system needs to perform decryption and integrity verification to ensure the integrity and confidentiality of the power data privacy protection results. Decryption involves using a pre-negotiated symmetric encryption key to decrypt the encrypted data block units, restoring them to their original form. Integrity verification involves recalculating the hash value of the decrypted data block unit and comparing it with the integrity checksum included in the transmitted data packet. If they match, the data has not been tampered with during transmission. For example, the power service system might use the AES algorithm and a pre-negotiated key to decrypt the encrypted data block unit, then recalculate its hash value using the SHA-256 algorithm and compare it with the integrity checksum in the transmitted data packet. If the verification passes, the power data privacy protection results have maintained their integrity and confidentiality during transmission, allowing for further analysis and processing.
[0225] In this embodiment of the invention, the power big data privacy protection method based on federated learning, through a series of steps, begins by obtaining a set of historical session records of power users, and proceeds through standardized preprocessing, temporal feature extraction, and federated learning privacy protection processing, ultimately generating a power data privacy protection result and feeding it back to the power service system. Throughout the process, data privacy and security are fully considered, and various technical means are used to ensure that power data is not leaked or tampered with during processing and transmission, providing an effective solution for power data privacy protection. Furthermore, this method also possesses a certain degree of versatility and scalability, and can be applied to data privacy protection scenarios in other fields.
[0226] Example 2: This example provides a power big data privacy protection system based on federated learning, including:
[0227] The acquisition module is used to acquire a set of historical session records of power users. The set of historical session records contains multiple time-series session windows. Each time-series session window consists of user electricity consumption query statements and corresponding system response statements within a continuous time period.
[0228] The standardization preprocessing module is used to perform standardization preprocessing on the historical session record set to obtain a standardized session data set, which includes user electricity query statements and system response statements with uniform format.
[0229] The time-series feature extraction module is used to process standardized session data sets through time-series analysis and interactive behavior analysis, identify and extract time-series correlation features of user electricity consumption queries and user-system interaction behavior correlation features, and generate a time-series feature set.
[0230] The federated learning privacy protection module is used to call a pre-configured federated learning framework to perform privacy protection processing on the temporal feature set and generate a privacy-enhanced feature set;
[0231] The results feedback module is used to generate power data privacy protection results based on the privacy enhancement feature set and to feed the power data privacy protection results back to the power service system.
[0232] This embodiment also provides an electronic device applicable to a federated learning-based method for protecting the privacy of power big data, including:
[0233] The system includes a memory and a processor. The memory stores computer-executable instructions, and the processor executes these instructions to implement a power big data privacy protection method based on federated learning, as proposed in the above embodiments.
[0234] This embodiment also provides a storage medium storing a computer program that, when executed by a processor, implements a power big data privacy protection method based on federated learning as proposed in the above embodiments.
[0235] The storage medium proposed in this embodiment and the method for implementing a power big data privacy protection method based on federated learning 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.
[0236] Based on the above description of the implementation methods, those skilled in the art can 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, but in many cases the former is a better implementation method. 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.
[0237] 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 federated learning based power big data privacy protection method, characterized in that, The method comprises the following steps: acquiring a historical session record set of a power user, the historical session record set comprising a plurality of time sequence session windows, each time sequence session window being composed of user power query statements and corresponding system response statements within a continuous time period; standardizing and preprocessing the historical session record set to obtain a standardized session data set, the standardized session data set comprising user power query statements and system response statements in a unified format; processing the standardized session data set through time sequence analysis and interactive behavior analysis to identify and extract time sequence correlation features of user power queries and interactive behavior correlation features of the user and the system, and generate a time sequence feature set; calling a preconfigured federated learning framework to perform privacy protection processing on the time sequence feature set to generate a privacy-enhanced feature set; generating a power data privacy protection result based on the privacy-enhanced feature set and feeding back the power data privacy protection result to a power service system; the processing of the standardized session data set through time sequence analysis and interactive behavior analysis to identify and extract time sequence correlation features of user power queries and interactive behavior correlation features of the user and the system, and generate a time sequence feature set, comprising: dividing the time sequence session window into a plurality of sub-period units according to a preset time interval, counting the number of occurrences of user power query statements in each sub-period unit, and generating an occurrence frequency distribution feature of user power query statements within the continuous time period; performing semantic similarity calculation processing on user power query statements in adjacent sub-period units, comparing the matching degree of standard semantic labels of user power query statements in adjacent sub-period units, and generating a semantic similarity feature of user power query statements in adjacent time periods; performing time sequence smoothing processing on the occurrence frequency distribution feature to eliminate abnormal fluctuation values in the occurrence frequency distribution feature, and generating a smoothed occurrence frequency feature; performing time sequence correlation analysis processing on the semantic similarity feature to identify the trend of the semantic similarity feature in the continuous sub-period unit, and generating a trend semantic similarity feature; combining the smoothed occurrence frequency feature and the trend semantic similarity feature to generate a time sequence correlation feature of user power query statements.
2. The power big data privacy protection method based on federated learning according to claim 1, characterized in that: The standardization preprocessing of the historical session record set comprises: performing data cleaning processing on each time sequence session window in the historical session record set to remove user power query statements and system response statements containing garbled characters in the time sequence session window; performing format unification processing on the cleaned time sequence session window, converting the text encoding format of the user power query statement into a preset unified encoding format, and adjusting the timestamp marker format of the system response statement to be consistent with the timestamp marker format of the user power query statement; performing missing value completion processing on the format-unified time sequence session window; performing semantic normalization processing on the completed time sequence session window, mapping different expression ways in the user power query statement representing the same power demand to a preset standard semantic label, and mapping different expression ways in the system response statement representing the same service feedback to a preset standard response label; The processed time sequence conversation window is sorted in chronological order to generate a standardized conversation data set containing an ordered time sequence conversation window sequence; The data cleaning process for each time sequence conversation window in the historical conversation record set includes: The character legality detection process is performed on the user electricity query statement in the time sequence conversation window to identify the non-standard printable character-containing garbled code substring in the user electricity query statement; The context semantic analysis process is performed on the garbled code substring to determine whether the garbled code substring is a key semantic part of the user electricity query statement; If the garbled code substring is a key semantic part, the user electricity query statement containing the garbled code substring is marked as an invalid statement; If the garbled code substring is a non-key semantic part, the character replacement process is performed on the garbled code substring to replace the garbled code substring with a preset placeholder.
3. The power big data privacy protection method based on federated learning according to claim 2, characterized in that: The semantic normalization process for the completed time sequence conversation window includes: The electricity demand semantic knowledge base is constructed, and the electricity demand semantic knowledge base contains a set of preset standard semantic tags and corresponding positive expression examples and ambiguous expression examples of each standard semantic tag; The semantic vector conversion process is performed on the user electricity query statement to generate a semantic vector representation of the user electricity query statement; The similarity value between the semantic vector representation and the semantic vector representation of each standard semantic tag in the electricity demand semantic knowledge base is calculated; The standard semantic tags with similarity values exceeding a preset threshold are extracted as candidate tags, and if there are multiple candidate tags and the similarity value difference between the candidate tags is less than a preset difference threshold, a semantic conflict resolution process is triggered; The semantic conflict resolution process includes: The context time sequence information of the user electricity query statement is extracted to analyze the continuity of the user's electricity query intention before and after the current time sequence conversation window; The historical query mode of the same user in the historical conversation record set is combined to determine the main demand tendency of the user electricity query statement; The most matching standard semantic tag is selected as the final mapping tag from the multiple candidate tags according to the main demand tendency.
4. The power big data privacy protection method based on federated learning according to claim 3, characterized in that: The preconfigured federated learning framework is called to perform privacy protection processing on the time sequence feature set to generate a privacy-enhanced feature set, including: The time sequence feature set is distributed to multiple local computing nodes participating in federated learning, and each local computing node performs local feature conversion processing on the distributed time sequence feature set to generate an intermediate feature representation containing local privacy constraints; Each local computing node performs privacy mask processing on the intermediate feature representation and adds preset privacy protection mask information to the intermediate feature representation; Each local computing node inputs the intermediate feature representation with added privacy mask into the local training model for feature enhancement training processing to generate a local enhanced feature representation containing local enhancement information; The federated learning coordination node collects the local enhanced feature representations of each local computing node, performs feature parameter aggregation processing on the local enhanced feature representations, and generates a global aggregated feature representation containing common features of multiple parties' data; The global aggregated feature representation is subjected to a privacy verification process to verify whether the degree of confusion of sensitive user identification information in the global aggregated feature representation meets the preset privacy protection requirement, and if so, the global aggregated feature representation is output as a privacy-enhanced feature set; The global aggregated feature representation is subjected to a privacy verification process to verify whether the degree of confusion of sensitive user identification information in the global aggregated feature representation meets the preset privacy protection requirement, and if so, the global aggregated feature representation is output as a privacy-enhanced feature set, which comprises: A privacy verification sample set is constructed, which contains a feature subset randomly extracted from the global aggregated feature representation and corresponding original local feature representations; A pre-trained privacy attack model is called to perform user identity restoration attack processing on the feature subset; The accuracy rate of the privacy attack model successfully restoring user identification information is counted as a privacy leakage risk indicator; If the privacy leakage risk indicator is lower than a preset risk threshold, it is determined that the degree of confusion of the global aggregated feature representation meets the privacy protection requirement; If the privacy leakage risk indicator is not lower than the preset risk threshold, a feature reprocessing procedure is triggered; The feature reprocessing procedure comprises: Adjusting the privacy mask generation parameters of each local computing node, re-executing the local feature conversion, privacy mask addition and local enhanced feature representation generation steps to generate new local enhanced feature representations; Re-aggregating the new local enhanced feature representations to generate an updated global aggregated feature representation, and repeating the privacy verification process until the privacy leakage risk indicator is less than the preset risk threshold.
5. The power big data privacy protection method based on federated learning according to claim 4, characterized in that: The privacy-enhanced feature set is subjected to feature decoding processing; The decoded privacy-enhanced feature set is subjected to privacy-sensitive information labeling processing to identify residual sensitive user identification information in the privacy-enhanced feature set and add a privacy access control label to the residual sensitive user identification information; According to the privacy access control label, data access permission rules are set for the privacy-enhanced feature set, which include the access range and operation type restrictions of users with different permission levels on the privacy-enhanced feature set; The privacy-enhanced feature set with the set access permission rules is associated and bound with the preset privacy protection metadata, which includes the source information, processing process information and privacy protection level information of the privacy-enhanced feature set; The associated and bound privacy-enhanced feature set is fed back to the power service system as the power data privacy protection result through a secure data transmission channel; The decoded privacy-enhanced feature set is subjected to privacy-sensitive information labeling processing to identify residual sensitive user identification information in the privacy-enhanced feature set and add a privacy access control label to the residual sensitive user identification information, which comprises: Sensitive information detection processing is performed on each feature item in the privacy-enhanced feature set, and the feature item is matched with a feature pattern in a preset sensitive information feature library, the sensitive information feature library including a user name feature pattern, a contact number feature pattern, and a power consumption address feature pattern; Context verification processing is performed on the feature item matched with the sensitive information feature pattern, and it is confirmed whether the feature item indeed represents user sensitive information in the context semantic environment in the privacy-enhanced feature set; If it is confirmed that the feature item represents user sensitive information, the feature item is marked as residual sensitive user identification information; Privacy risk assessment processing is performed on the residual sensitive user identification information; According to the privacy risk assessment result, a corresponding privacy access control label is assigned to the residual sensitive user identification information, the privacy access control label including a high-risk label, a medium-risk label, and a low-risk label, corresponding to different access permission levels, respectively.
6. The federated learning based power big data privacy protection method of claim 5, wherein: The feedback to the power service system through the secure data transmission channel includes: Data block processing is performed on the power data privacy protection result, and the power data privacy protection result is segmented into multiple data block units, each data block unit including continuous data information of a preset size; Each data block unit is encrypted by using a preset symmetric encryption algorithm to generate an encrypted data block unit, and the key of the symmetric encryption algorithm is determined by the local computing node and the power service system in advance; Each encrypted data block unit is processed to generate an integrity check code, and a preset hash algorithm is used to calculate the hash value of the encrypted data block unit as the integrity check code; The encrypted data block unit and the corresponding integrity check code are encapsulated to generate a transmission data packet containing the encrypted data block and the check code; The transmission data packet is sent in order to the power service system through a secure data transmission channel, and the secure data transmission channel uses a transmission layer security protocol to establish an encrypted communication connection; The power service system receives the transmission data packet and performs decryption processing and integrity check processing on the transmission data packet.
7. A power big data privacy protection system based on federated learning, applying a power big data privacy protection method based on federated learning according to any one of claims 1-6, characterized in that, The method includes: The acquisition module is configured to acquire a historical session record set of a power user, the historical session record set including multiple time sequence session windows, each time sequence session window being composed of a user power consumption query statement and a corresponding system response statement in a continuous time period; The standardization preprocessing module is configured to perform standardization preprocessing on the historical session record set to obtain a standardized session data set, the standardized session data set including format-unified user power consumption query statements and system response statements; The time sequence feature extraction module is configured to process the standardized session data set by time sequence analysis and interactive behavior analysis, identify and extract time sequence association features of user power consumption queries and interactive behavior association features of the user and the system, and generate a time sequence feature set; The federated learning privacy protection module is configured to call a preconfigured federated learning framework to perform privacy protection processing on the time sequence feature set to generate a privacy-enhanced feature set; The result feedback module is configured to generate a power data privacy protection result based on the privacy-enhanced feature set and feed back the power data privacy protection result to a power service system. 8.An electronic device comprising a memory and a processor, the memory storing a computer program, wherein, The computer program is executed by the processor to implement the steps of the power big data privacy protection method based on federated learning in any one of claims 1 to 6.
9. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the power big data privacy protection method based on federated learning in any one of claims 1 to 6.
Citation Information
Patent Citations
Multi-modal large model federation training platform and heterogeneous data alignment algorithm
CN120105464A
Longitudinal federated learning privacy protection method and system considering inter-federated data leakage
CN120296798A