Power data desensitization method, device, equipment, readable medium and program product
By using automated methods to de-identify power data, the problem of low efficiency in manual review was solved, and standardized processing of massive amounts of power data was achieved, improving data flow efficiency and ensuring data security.
Patent Information
- Application Number
- CN202511617437.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-06
- Publication Date
- 2026-02-03
AI Technical Summary
In existing technologies, power data anonymization mainly relies on manual review, which leads to low efficiency and inconsistent standards. This fails to meet the power system's need for real-time processing of massive and multi-dimensional data, and poses a risk of missing or accidentally anonymizing sensitive information.
The program automatically acquires power data files, extracts text content, matches it against a preset sensitive word database, identifies sensitive information, and employs reversible desensitization processing, including character replacement, deletion, or pixel masking. The desensitization operation log is recorded to support information restoration.
It enables batch and standardized processing of massive amounts of power data, significantly improving the efficiency of data flow and use in non-production environments such as power system development and testing, and ensuring data security and integrity.
Smart Images

Figure CN121456911A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of power grid control, and in particular to a method, apparatus, equipment, readable medium, and program product for desensitizing power data. Background Technology
[0002] With the development of technologies such as smart grids, power big data analytics, and the Internet of Things for power, the amount of data collected, stored, and processed by power systems is growing exponentially. While this data contains enormous value, it also faces serious security risks.
[0003] To ensure the safe use of power data, it is necessary to anonymize the data beforehand. However, power data anonymization currently relies mainly on manual review for sensitive information identification and processing. When faced with the massive and diverse data generated by the smart grid, manual review is not only slow and unable to meet the real-time data needs of scenarios such as power system development and testing, and big data analysis, but also suffers from problems such as limited coverage, inconsistent standards, and difficulty in guaranteeing accuracy. Summary of the Invention
[0004] This application provides a method, apparatus, device, readable medium, and program product for desensitizing power data, in order to solve the problem of poor desensitization effect of power data.
[0005] In a first aspect, embodiments of this application provide a method for desensitizing power data, including:
[0006] Obtain the power data file to be processed;
[0007] Extract the text content from the power data file;
[0008] The extracted text content is matched with a preset sensitive word database to identify sensitive information in the text content. The sensitive information includes at least one of the following: user identity information, user load curve, and payment record.
[0009] Reversible desensitization processing is performed on sensitive information in power data files.
[0010] In some possible implementations, reversible desensitization processing of sensitive information includes:
[0011] Perform desensitization operations on sensitive information in power data files and generate operation logs for the desensitization operations performed;
[0012] The operation log records at least the location information of sensitive information in the power data file and the rules for restoring sensitive information. The restoration rules are used to restore the de-identified information to the sensitive information before de-identification.
[0013] In some possible implementations, sensitive information in power data files is de-identified, including:
[0014] Determine whether the power data file supports text editing based on its file type;
[0015] If the power data file supports text editing, then perform character replacement or deletion operations on sensitive information;
[0016] If the power data file does not support text editing, then pixel masking will be performed on the areas containing sensitive information.
[0017] In some possible implementations, the extracted text content is matched against a pre-defined sensitive word database to identify sensitive information within the text content, including:
[0018] The extracted text content is matched based on a pre-defined sensitive word database;
[0019] For successfully matched text segments, the text segments are validated in conjunction with the contextual information within the text content to confirm whether the text segments contain sensitive information.
[0020] In some possible implementations, the extracted text content is matched based on a pre-defined sensitive word database, including:
[0021] According to the preset priority order, the text content is matched using matching rules for various sensitive word types in sequence;
[0022] In this process, higher-priority sensitive word types are matched before lower-priority sensitive word types; once a field in the text content is matched as a sensitive word type of any priority, the matching rules for other priority sensitive word types will not be used to match that field again.
[0023] In some possible implementations, the text content of the power data file is extracted, including:
[0024] Identify the file type of power data files;
[0025] If the power data file is an image file, then the text content is extracted from the power data file using optical character recognition.
[0026] If the power data file is not an image file, the corresponding parsing engine is called to extract the text content from the power data file.
[0027] Secondly, embodiments of this application provide a power data desensitization device, comprising:
[0028] The acquisition module is used to acquire the power data file to be processed;
[0029] The extraction module is used to extract the text content of power data files;
[0030] The identification module is used to match the extracted text content with a preset sensitive word library to identify sensitive information in the text content. The sensitive information includes at least one of the following: user identity information, user load curve, and payment record.
[0031] The desensitization module is used to perform reversible desensitization processing on sensitive information in power data files.
[0032] Thirdly, embodiments of this application provide an electronic device, including: a memory and a processor;
[0033] The memory stores instructions that the computer executes;
[0034] The processor executes computer execution instructions stored in memory, causing the processor to perform the first aspect and / or various possible implementations of the first aspect as described above.
[0035] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the first aspect and / or various possible implementations of the first aspect.
[0036] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the first aspect and / or various possible implementations of the first aspect.
[0037] The power data desensitization method, apparatus, device, readable medium, and program product provided in this application acquire power data files and extract text content. The program automatically matches the extracted text content with a preset sensitive word library to identify sensitive information, and then performs reversible desensitization processing on the sensitive information in the power data files. This method effectively solves the problems of low efficiency and inconsistent standards in traditional manual review methods, enabling batch and standardized processing of massive amounts of power data. While ensuring data security, it significantly improves the efficiency of data flow and use in non-production environments such as power system development and testing. Attached Figure Description
[0038] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0039] Figure 1 A flowchart illustrating a power data anonymization method provided in an embodiment of this application;
[0040] Figure 2 A flowchart illustrating a process for extracting text content is provided for an embodiment of this application;
[0041] Figure 3 This application provides a schematic diagram of a process for identifying sensitive information.
[0042] Figure 4 This is a schematic diagram of a desensitization process provided in an embodiment of this application;
[0043] Figure 5 This is a schematic diagram of the structure of a power data desensitization device provided in an embodiment of this application;
[0044] Figure 6 This is a schematic diagram of the structure of an electronic device provided in this application.
[0045] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0046] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0047] Currently, the power industry faces severe challenges in data anonymization practices, primarily relying on traditional manual review methods for identifying and processing sensitive information. This method is extremely inefficient when dealing with the massive and diverse data generated by the smart grid, becoming a key bottleneck in business data flow and analysis. Manual review is not only slow, failing to meet the immediate data needs of development testing, big data analysis, and other scenarios, but also suffers from limited coverage, inconsistent standards, and difficulty in guaranteeing accuracy. This easily leads to the omission or incorrect removal of sensitive information, posing significant risks to power system information security and user privacy protection.
[0048] Based on this, this application proposes a technical concept that automatically acquires power data files from data sources such as power grid systems and extracts text content through a program. Sensitive information is intelligently identified based on power data anonymization rules, and finally, a reversible anonymization operation is used to securely process the sensitive content. This method effectively solves the problems of low efficiency and inconsistent standards in traditional manual review methods, enabling batch and standardized processing of massive amounts of power data. While ensuring data security, it significantly improves the efficiency of data flow and use in non-production environments such as power system development and testing.
[0049] Based on the above technical concept, this application provides a method for desensitizing power data, which can be applied to the following scenarios:
[0050] 1) Power system development and testing: During the development and testing phases of electricity billing, customer service systems, and equipment fault diagnosis models, the data structure consistent with the production environment must be used, but sensitive information (such as user identity and payment records) must be anonymized.
[0051] 2) Power Big Data Analysis: In the training of AI models for load forecasting, power grid optimization, etc., massive amounts of power data need to be de-identified before being used for model training.
[0052] 3) Cross-departmental data sharing: When power companies cooperate with third parties (such as equipment suppliers and research institutions), the shared data must be standardized and de-identified to ensure data privacy and compliance.
[0053] 4) Non-production environment data management: In non-production environments such as development, testing, and demonstration, power data needs to be automatically anonymized to avoid leakage of sensitive information.
[0054] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0055] Figure 1 This is a flowchart illustrating a power data anonymization method provided in an embodiment of this application, as shown below. Figure 1 As shown, the method includes:
[0056] Step S101: Obtain the power data file to be processed.
[0057] The power data files may include power grid node equipment ledgers, user electricity consumption information within the region, and power dispatch logs.
[0058] In this embodiment of the invention, the power data files that need to be de-identified can be obtained from the power grid's business system or the power sector's local database. Alternatively, real-time data streams or files can be received by deploying smart sensors on equipment such as transformers and cables. The file type of the obtained power data files is not limited; they can be document files or image files, such as Word, Excel, TXT, PDF (Portable Document Format), and PNG (Portable Network Graphics) files.
[0059] Step S102: Extract the text content of the power data file.
[0060] For example, for the acquired power data file, a corresponding tool can be selected from a variety of pre-prepared document parsing tools to extract the text content from the file. For instance, for a Word format power data file, the python-docx library can be used to parse the Word document and extract paragraph text; for a PDF format power data file, the pdfplumber library can be used to read the content of the PDF file and extract text page by page.
[0061] Step S103: Match the extracted text content with a preset sensitive word database to identify sensitive information in the text content.
[0062] The sensitive information includes at least one of the following: user identity information, user load curve, and payment records.
[0063] In this embodiment of the application, a sensitive word library can be set in advance according to the data desensitization requirements. This sensitive word library can be used to identify various types of sensitive words such as mobile phone numbers, ID card numbers, IP addresses, passwords, and load keywords. After extracting text content based on power data files, the extracted text content can be matched with the sensitive word library using regular expressions to identify whether there is sensitive information in the text content.
[0064] Step S104: Perform reversible desensitization processing on the sensitive information in the power data file.
[0065] For example, after identifying sensitive information, the location information of the sensitive information in the power data file (e.g., which page, row, and column) and the original text of the sensitive information can be recorded. Then, the sensitive information can be de-identified through operations such as character replacement or deletion, making it impossible to know or analyze the original text of the sensitive information from the de-identified content. The de-identification in this example is reversible; the original text of the sensitive information before de-identification can be obtained based on the recorded location information.
[0066] For example, after identifying sensitive information and recording its location in the power data file, the original sensitive information can be omitted. Instead, an encryption algorithm can be used to convert the sensitive information into meaningless ciphertext. This ciphertext retains the format and length characteristics of the original sensitive information, allowing it to be used securely in non-production environments. If it is necessary to recover the sensitive information, a decryption algorithm corresponding to the encryption algorithm can be used to decrypt the ciphertext and obtain the original sensitive information.
[0067] In this embodiment of the application, when desensitizing sensitive information, not only can the location of the sensitive information in the power data file be recorded, but also the execution method of the desensitization operation can be recorded. This mechanism enables the desensitized data to be restored to the original data when needed through the recorded information, which meets the power system's needs for data auditing and business traceability. At the same time, the accurate recording of location information avoids damage to the file structure caused by the desensitization operation.
[0068] In the above embodiments, by acquiring power data files and extracting text content, the program can automatically match the extracted text content with a preset sensitive word library to identify sensitive information, and then perform reversible desensitization processing on the sensitive information in the power data files. This method effectively solves the problems of low efficiency and inconsistent standards in traditional manual review methods, enabling batch and standardized processing of massive amounts of power data. While ensuring data security, it significantly improves the efficiency of data flow and use in non-production environments such as power system development and testing.
[0069] The following describes the power data anonymization method of this application embodiment with specific scenarios and examples. In one embodiment, this application can provide a power data anonymization system that can be deployed on a server or terminal device. This system can include functional modules such as an input module, a file scanning module, a sensitive word detection module, an anonymization processing module, and an output module. The input module can be used to input files uploaded by the user to be scanned, including text files, Word documents, PDF documents, and image files. The file scanning module can be used to read and parse different types of files, extracting their text content. The file scanning module can also extract text information from image files using an OCR (Optical Character Recognition) engine, supporting multiple languages and model architectures. The sensitive word detection module can identify sensitive information in files based on a preset sensitive word library combined with a regular expression matching algorithm. The anonymization processing module can anonymize the detected sensitive information, supporting various methods such as asterisk replacement and mosaic masking. The output module can return the anonymized power data file and detailed anonymization information to the user. The anonymization information can include the location of the sensitive information in the power data file and the anonymization method, etc.
[0070] In one embodiment, extracting the text content of an electricity data file may include:
[0071] Identify the file type of the power data file; if the power data file is an image file, extract the text content from the power data file using optical character recognition; if the power data file is not an image file, call the parsing engine corresponding to the file type to extract the text content from the power data file.
[0072] In this embodiment of the application, the file type of the power data file can be identified, and different methods can be used to extract the text according to the file type. For image type files (such as PNG files), OCR recognition can be used to extract the text content, and for non-image type files (such as Word files), the corresponding parsing engine can be called to extract the text content.
[0073] Figure 2 This is a schematic diagram illustrating a process for extracting text content, provided as an embodiment of this application. For example... Figure 2 As shown, the process may include the following steps.
[0074] Start: Initiate the file scanning process.
[0075] Determine file type: Determine file type based on file extension.
[0076] Determine if the file is a text file based on its type: if it is, read its contents directly; otherwise, call the appropriate parser.
[0077] Calling the Word document parser: Use the python-docx library to parse Word documents and extract paragraph text.
[0078] Calling the PDF document parser: Use the pdfplumber library to read the contents of the PDF file and extract the text page by page.
[0079] Call the image file parser: Call the OCR engine to extract text from the image.
[0080] After extracting the text content, it can be passed to the sensitive word detection module.
[0081] For example, calling an OCR engine to extract text may include: receiving an image file to be processed, using a deep learning model (such as CNN+LSTM) to locate the positions of all text regions in the image, converting the detected text regions into string format, generating editable text content, and returning the recognized text content to the document scanning module. The deep learning model can be trained using neural network architectures such as CNN (Convolutional Neural Network) and LSTM (Long Short-Term Memory) and a pre-set training corpus.
[0082] In some possible implementations, PaddleOCR can be integrated as the OCR engine, supporting multiple languages and model architectures. The specific implementation is as follows: Model selection: Use the PP-OCRv5 series models, including the mobile detection model (PP-OCRv5_mobile_det) and the mobile recognition model (PP-OCRv5_mobile_rec), to balance performance and accuracy requirements. Parameter configuration: Configure the OCR engine parameters, such as language, version, and model path, to ensure correct operation. Error handling: Incorporate an exception handling mechanism during OCR processing to prevent the entire system from crashing due to the failure of processing a single file.
[0083] In some possible implementations, after extracting the text content from the power data file by calling the corresponding parser based on the file type, the process may further include: standardizing the extracted text content to generate text data in a uniform format. This step involves standardizing the text content after parsing.
[0084] S1, OCR engine output: Converts text in image files (such as "Electricity fee: ¥123.45") into strings.
[0085] S2, Document Parsing Library Output: Converts paragraph text (such as "User Name: Zhang San") from Word or PDF files into strings.
[0086] S3. Standardized Format Generation: All parsing results are standardized into text data (e.g., strings). For example, "Electricity Fee: ¥123.45" and "User Name: Zhang San" are both converted to string format. This standardized format processing ensures consistency of input data for subsequent sensitive information identification and de-identification operations.
[0087] In the above embodiments, dedicated parsers (OCR engine, document parsing library) can optimize the processing logic for different file types, enabling the system to automatically extract text information from different types of files such as images, achieving efficient recognition and text extraction of multimodal files. For example, the OCR engine uses a deep learning model to accurately locate text regions in an image and convert them into strings, while the document parsing library extracts text page by page based on the structured characteristics of Word and PDF files. This differentiated processing significantly improves the efficiency and accuracy of text extraction from unstructured data (such as images and PDF tables), solves the problem of insufficient processing capabilities for non-text files in existing technologies, and lays the foundation for subsequent sensitive information identification and de-identification operations through standardized text data.
[0088] In one embodiment, the extracted text content is matched against a preset sensitive word database to identify sensitive information in the text content, including:
[0089] Based on a pre-defined sensitive word database, the extracted text content is matched; for successfully matched text segments, the context information of the text segment within the text content is used for verification to confirm whether the text segment is sensitive information.
[0090] In some possible implementations, the extracted text content is matched based on a preset sensitive word library, including: matching the text content using matching rules for multiple sensitive word types in a preset priority order.
[0091] In this process, higher-priority sensitive word types are matched before lower-priority sensitive word types; once a field in the text content is matched as a sensitive word type of any priority, the matching rules for other priority sensitive word types will not be used to match that field again.
[0092] The sensitive word database can include common sensitive word types, such as phone numbers, ID card numbers, IP addresses, passwords, and keywords. Sensitive word types are prioritized to avoid mismatches between low-priority and high-priority rules. Priority can be assigned based on importance. For example, ID card numbers have the highest priority, followed by phone numbers. This not only prevents more important sensitive information from being overwritten by other content but also reduces the number of matches for different sensitive word types, improving efficiency.
[0093] In this embodiment, natural language processing technology can also be used to analyze the contextual information of the text segment to verify the rationality of the sensitive word matching results. For example, context analysis can be used to verify whether "1380XXXX000" is a mobile phone number (e.g., "Mobile Phone Number: 1380XXXX000") and not a regular number (e.g., "ID: 1380XXXX000"), significantly reducing the false positive rate of sensitive information. This dual verification mechanism solves the problem of false positives caused by rule conflicts or missing context in existing technologies, ensuring the accuracy of the de-identification operation.
[0094] Figure 3 This is a schematic diagram illustrating a process for identifying sensitive information, provided as an embodiment of this application. Figure 3 As shown, the process may include:
[0095] Start: Initiate the sensitive word detection process.
[0096] Get Sensitive Word Database: Loads a preset sensitive word database, including mobile phone numbers, ID card numbers, IP addresses, passwords, and keywords.
[0097] Traverse the text content: Scan the text content character by character or word by word to find patterns that match the sensitive word database.
[0098] Found a match: If a match is found, record the matching information; otherwise, continue iterating.
[0099] Record matching information: Save the matched sensitive words and their position information in the text.
[0100] Check for overlap: Avoid matching the same text multiple times and ensure that each sensitive word is recorded only once.
[0101] Add to results list: Adds valid matches to the final results list.
[0102] End: The process of identifying sensitive information is complete.
[0103] In some possible implementations, sensitive information can also be identified using methods such as trie structures, machine learning models, or rule engines. Examples are provided below:
[0104] Using a trie structure: By constructing a trie containing all sensitive words, matching can be completed in O(m) time, where m is the length of the string to be matched. This method has a significant advantage when dealing with a large number of sensitive words.
[0105] Using machine learning models: A classifier can be trained to determine whether a word is a sensitive word based on contextual information. For example, using pre-trained models like BERT, combined with an attention mechanism, can more accurately identify sensitive information in complex contexts. Although this method is computationally expensive, it effectively reduces false positives and false negatives.
[0106] Using a rule engine: A rule engine based on business rules can also be used for sensitive word detection. By defining a series of rules, such as "three consecutive digits" or "containing specific keywords," the detection strategy can be flexibly adjusted. This method is easy to maintain and extend, and is suitable for dynamically changing sensitive word databases.
[0107] In the above embodiments, by employing a multi-level matching strategy and context analysis, the accuracy and efficiency of sensitive information identification can be improved. The system first performs preliminary matching using a preset sensitive word database, and then performs secondary verification by combining context information to ensure the accuracy of the matching results.
[0108] In one embodiment, reversible desensitization processing of sensitive information includes:
[0109] Perform desensitization operations on sensitive information in power data files and generate operation logs for the desensitization operations performed.
[0110] The operation log records at least the location information of sensitive information in the power data file and the rules for restoring sensitive information. The restoration rules are used to restore the de-identified information to the sensitive information before de-identification.
[0111] For the location information of sensitive information in power data files, not only can the page number, line number, and column number of the sensitive information in the file be recorded, but also its pixel coordinates. For image files, pixel coordinates can represent the exact location of sensitive information in the image, ensuring the accuracy and effectiveness of the de-identification operation. This precise location information recording mechanism allows users to view and manage sensitive information more intuitively.
[0112] In this embodiment of the application, the restoration rule may include the original text of the sensitive information before desensitization, or the desensitization method of the sensitive information (such as encryption and decryption algorithms for the sensitive information, etc.). For details, please refer to the relevant examples of step S104.
[0113] This application provides a reversible data anonymization mechanism by recording the location information and restoration rules of sensitive information, which can preserve the integrity and recoverability of the original data while anonymizing it. The system supports subsequent recovery operations by recording detailed anonymization information (such as the text content before and after anonymization, location information, etc.). This means that even after anonymization is performed, users can still restore the original data when needed, ensuring data security and integrity.
[0114] In some possible implementations, sensitive information in power data files is de-identified, including:
[0115] Determine whether the power data file supports text editing based on its file type; if it does, perform character replacement or deletion operations on sensitive information; if it does not support text editing, perform pixel masking operations on the area containing sensitive information.
[0116] For example, for files of the types of Word, Excel, or TXT, the text content can be edited directly. Sensitive information can be replaced with characters such as "*", or some or all of the sensitive information can be deleted. However, for files of the types of PNG, the text content embedded in the pixel matrix cannot be edited directly. Sensitive information can be masked by pixel processing techniques such as mosaic.
[0117] Figure 4 This is a schematic diagram illustrating a desensitization process provided in an embodiment of this application. Figure 4 As shown, desensitization processing may include:
[0118] Start: Initiate the desensitization process.
[0119] Get desensitization rules: Load the desensitization rules set by the user, including parameters such as desensitization method (asterisk replacement, mosaic masking, etc.) and retention length.
[0120] Traverse the list of sensitive words: process each detected sensitive word one by one.
[0121] Choose a desensitization method: Select an appropriate desensitization method based on the rules set by the user.
[0122] Asterisk replacement: For text files and Word documents, use "*" (asterisk) to replace the middle part of sensitive words, while keeping the first and last characters. For example, "Zhang Moumou" becomes "Zhang*mou".
[0123] Mosaic masking: For image files, apply a mosaic filter to mask areas containing sensitive information.
[0124] Other methods: Supports user-defined de-identification methods, such as complete deletion, encryption, etc.
[0125] Update file content: Write the de-identified file content into a new file or the original file.
[0126] Record desensitization information: Record detailed information of each desensitization operation (such as text content before and after desensitization, location information, etc.) in the operation log.
[0127] End: The desensitization process is complete.
[0128] In the above embodiments, differentiated desensitization methods (character replacement, pixel masking) can adapt to the desensitization requirements of different file types. For example, text files use asterisk replacement to preserve data structure, while image files use pixel masking to prevent text information leakage. This flexibility solves the problem of the single desensitization method in existing technologies, while meeting the security requirements of different business scenarios through differentiated processing.
[0129] Figure 5 This is a schematic diagram of the structure of a power data desensitization device provided in this application, as shown below. Figure 5 As shown, the power data desensitization device 500 provided in this embodiment includes:
[0130] The acquisition module 501 is used to acquire the power data file to be processed;
[0131] Extraction module 502 is used to extract the text content of power data files;
[0132] The identification module 503 is used to match the extracted text content with a preset sensitive word library to identify sensitive information in the text content. The sensitive information includes at least one of user identity information, user load curve and payment record.
[0133] The desensitization module 504 is used to perform reversible desensitization processing on sensitive information in power data files.
[0134] In some possible implementations, the desensitization module 504 can also be used to: perform desensitization operations on sensitive information in the power data file and generate an operation log of the performed desensitization operations; wherein, the operation log records at least the location information of the sensitive information in the power data file and the restoration rules of the sensitive information, and the restoration rules are used to restore the desensitized information to the sensitive information before desensitization.
[0135] In some possible implementations, the desensitization module 504 can also be used to: determine whether the power data file supports text editing based on the file type of the power data file; if the power data file supports text editing, perform character replacement or deletion operations on the sensitive information; if the power data file does not support text editing, perform pixel masking operations on the area where the sensitive information is located.
[0136] In some possible implementations, the identification module 503 can also be used to: match the extracted text content based on a preset sensitive word library; and verify the successfully matched text segments by combining the context information of the text segments in the text content to confirm whether the text segments are sensitive information.
[0137] In some possible implementations, the recognition module 503 can also be used to: match the text content using matching rules for multiple sensitive word types in a preset priority order; wherein, higher priority sensitive word types are matched before lower priority sensitive word types; when a field in the text content is matched as a sensitive word type of any priority, the matching rules for other priority sensitive word types are no longer used to match that field repeatedly.
[0138] In some possible implementations, the extraction module 502 can also be used to: identify the file type of the power data file; if the file type of the power data file is an image file, then extract the text content from the power data file through optical character recognition; if the file type of the power data file is not an image file, then call the parsing engine corresponding to the file type to extract the text content from the power data file.
[0139] Figure 6 This is a schematic diagram of the structure of an electronic device provided in this application. Figure 6 As shown, the electronic device 60 provided in this embodiment includes at least one processor 601 and a memory 602. Optionally, the device 60 further includes a communication component 603. The processor 601, memory 602, and communication component 603 are connected via a bus 604.
[0140] In a specific implementation, at least one processor 601 executes computer execution instructions stored in memory 602, causing at least one processor 601 to perform the above-described method.
[0141] The specific implementation process of processor 601 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.
[0142] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.
[0143] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.
[0144] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0145] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.
[0146] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above-described method.
[0147] The aforementioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.
[0148] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.
[0149] The division of units is merely a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.
[0150] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0151] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0152] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0153] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0154] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.
Claims
1. A method for desensitizing power data, characterized in that, include: Obtain the power data file to be processed; Extract the text content of the power data file; The extracted text content is matched with a preset sensitive word database to identify sensitive information in the text content. The sensitive information includes at least one of user identity information, user load curve, and payment record. The sensitive information in the power data file is reversibly desensitized.
2. The method according to claim 1, characterized in that, The reversible desensitization process for the sensitive information includes: Perform a desensitization operation on the sensitive information in the power data file and generate an operation log of the desensitization operation. The operation log records at least the location information of the sensitive information in the power data file and the restoration rules of the sensitive information. The restoration rules are used to restore the de-identified information to the sensitive information before de-identification.
3. The method according to claim 2, characterized in that, The process of desensitizing the sensitive information in the power data file includes: Determine whether the power data file supports text editing based on its file type; If the power data file supports text editing, then perform character replacement or deletion operations on the sensitive information; If the power data file does not support text editing, then a pixel masking operation is performed on the area where the sensitive information is located.
4. The method according to any one of claims 1 to 3, characterized in that, The step of matching the extracted text content with a preset sensitive word database to identify sensitive information in the text content includes: The extracted text content is matched based on a pre-defined sensitive word database; For a successfully matched text segment, the text segment is verified in conjunction with the context information of the text content to confirm whether the text segment is sensitive information.
5. The method according to claim 4, characterized in that, The process of matching the extracted text content based on a preset sensitive word database includes: The text content is matched sequentially using matching rules for various sensitive word types according to a preset priority order; In this process, higher-priority sensitive word types are matched before lower-priority sensitive word types; once a field in the text content is matched as a sensitive word type of any priority, the matching rules for other priority sensitive word types will not be used to match that field again.
6. The method according to any one of claims 1 to 3, characterized in that, The extraction of text content from the power data file includes: Identify the file type of the power data file; If the power data file is an image file, then the text content is extracted from the power data file using optical character recognition. If the power data file is a non-image file, then the parsing engine corresponding to the file type is called to extract the text content from the power data file.
7. A power data desensitization device, characterized in that, include: The acquisition module is used to acquire the power data file to be processed; The extraction module is used to extract the text content of the power data file; The identification module is used to match the extracted text content with a preset sensitive word library to identify sensitive information in the text content. The sensitive information includes at least one of user identity information, user load curve, and payment record. The desensitization module is used to perform reversible desensitization processing on the sensitive information in the power data file.
8. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed, it implements the method as described in any one of claims 1 to 6.