Chinese address encryption method and device, equipment and storage medium
Through intelligent analysis of BERT model and national secret algorithm encryption, the problem of standardized operation difficulties in Chinese address encryption is solved, efficient and flexible address encryption is achieved, and privacy protection and data security are ensured.
Patent Information
- Application Number
- CN202411390819.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-08
- Publication Date
- 2024-11-08
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
During the encryption process, Chinese addresses are difficult to standardize operations due to format diversity and semantic complexity, which reduces the reliability of encryption.
The preset target BERT model is used to identify the encrypted address, determine the address entity and its category, and select the encryption category according to the sensitivity level, and use the national secret algorithm for encryption, avoiding standardized operations and achieving flexible encryption adaptation.
Through intelligent analysis and intelligent rule matching, accurate and efficient dynamic address encryption is achieved, data recognizable is preserved, and privacy information is not leaked, complying with legal and privacy protection standards.
Smart Images

Figure CN118916901A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a Chinese address encryption method, device, equipment and storage medium. Background Art
[0002] Chinese address encryption usually refers to encoding or converting Chinese address information to protect personal privacy or security needs.
[0003] At present, in the process of Chinese address encryption, Chinese addresses need to be standardized to unify the format and meaning of address fields, fix incorrect spelling and format, and handle semantic complexity in addresses. Through standardization, address data can reach a consistent structure and specification, providing an accurate basis for subsequent encryption operations. However, due to the characteristics of Chinese addresses such as address format diversity and address semantic complexity, address standardization operations are difficult. If address information is not standardized, the encrypted result cannot accurately reflect the actual location of the address, thereby reducing the reliability of encryption.
[0004] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention
[0005] The main purpose of this application is to provide a Chinese address encryption method, device, equipment and storage medium, aiming to solve the technical problem of how to improve the reliability of Chinese address encryption.
[0006] To achieve the above purpose, the present application proposes a Chinese address encryption method, the method comprising: Performing address recognition on the address to be encrypted based on a preset target BERT model to obtain an address entity corresponding to the address to be encrypted and an address entity category of the address entity; Determining a target category to be encrypted in the address entity category based on a preset sensitivity level; The address entity corresponding to the target category is encrypted based on the national encryption algorithm to obtain an encrypted address.
[0007] In one embodiment, before the step of performing address recognition on the address to be encrypted based on a preset target BERT model to obtain the address entity corresponding to the address to be encrypted and the address entity category of the address entity, the step further includes: Acquire address data, and cut each of the address data into individual characters; Annotate the characters with corresponding address entity labels based on the BIE rule, and construct an address annotation dataset based on the annotated characters; The pre-trained BERT model is trained based on the address annotation dataset to obtain the target BERT model.
[0008] In one embodiment, the step of performing address recognition on the address to be encrypted based on a preset target BERT model to obtain an address entity corresponding to the address to be encrypted and an address entity category of the address entity includes: Obtain the address to be encrypted, and perform word segmentation processing on the address to be encrypted, so as to divide the address to be encrypted into single characters; The address to be encrypted after word segmentation processing is input into the target BERT model for address recognition to obtain the address entity and address entity category.
[0009] In one embodiment, the step of inputting the to-be-encrypted address after word segmentation processing into the target BERT model for address recognition to obtain the address entity and the address entity category includes: Predicting the address entity labels of each of the characters based on the target BERT model to obtain a probability distribution of the address entity labels corresponding to the characters; Determine a target address entity tag of the character according to the probability distribution; The characters having the same target address entity tag are combined based on a BIE rule to obtain the address entity and the address entity category.
[0010] In one embodiment, the step of determining the target category to be encrypted in the address entity category based on the preset sensitivity level includes: Obtaining the sensitivity level corresponding to the address to be encrypted; Acquire a corresponding encryption list based on the sensitivity level, wherein the encryption list includes the target category to be encrypted; Each of the address entities is traversed, and if the address entity category corresponding to the address entity is in the encryption list, the address entity category is the target category.
[0011] In one embodiment, the step of encrypting the address entity corresponding to the target category based on the national encryption algorithm to obtain the encrypted address includes: The address entity corresponding to the target category is encrypted based on the SM4 algorithm, and the address entity to be encrypted is replaced with a preset special symbol to obtain an encrypted address.
[0012] In one embodiment, the method further comprises: When a decryption and reassembly request is obtained, verify whether the requester corresponding to the decryption request has the decryption and reassembly authority based on a preset authority control policy; If the requester has the decryption and reassembly authority, the encrypted address is decrypted and reassembled based on the decryption and reassembly request.
[0013] In addition, to achieve the above purpose, the present application also proposes a Chinese address encryption device, the Chinese address encryption device comprising: An address recognition module, used to perform address recognition on the address to be encrypted based on a preset target BERT model, and obtain an address entity corresponding to the address to be encrypted and an address entity category of the address entity; A target category determination module, used to determine the target category to be encrypted in the address entity category based on a preset sensitivity level; The address encryption module is used to encrypt the address entity corresponding to the target category based on the national encryption algorithm to obtain an encrypted address.
[0014] In addition, to achieve the above-mentioned purpose, the present application also proposes a Chinese address encryption device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the Chinese address encryption method described above.
[0015] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the Chinese address encryption method described above are implemented.
[0016] The present application provides a Chinese address encryption method, comprising the following steps: performing address recognition on an address to be encrypted based on a preset target BERT model, obtaining an address entity corresponding to the address to be encrypted and an address entity category of the address entity, wherein the preset BERT model can identify key information in the address through its context understanding and generalization capabilities, without relying on a fixed address format, and therefore, by identifying and parsing the address to be encrypted through the BERT model, each component in the address and its category can be directly obtained, without the need to perform standardized operations on the Chinese address to be encrypted, thereby avoiding the problem of reduced reliability of row encryption due to the difficulty in performing standardized operations on the Chinese address, and simplifying the address encryption process; determining a target category to be encrypted in the address entity category based on a preset sensitivity level, encrypting the address to be encrypted by selecting different sensitivity levels instead of encrypting by fixed encryption rules, thereby achieving sensitive adaptation to different encryption requirements, as well as a balance between privacy protection and business requirements, and ensuring that privacy information is not exposed to the greatest extent; encrypting the address entity corresponding to the target category based on a national secret algorithm to obtain an encrypted address, and encrypting the address using a national secret algorithm, thereby ensuring that the address encryption method complies with applicable laws and regulations and privacy protection standards, and meets data security management requirements.
[0017] In summary, this application uses the BERT model to perform intelligent analysis of Chinese addresses to avoid standardized operations on encrypted addresses. Different sensitivity levels are selected to encrypt Chinese addresses according to needs. Dynamic encryption of Chinese addresses is achieved through intelligent address analysis and intelligent rule matching. It flexibly adapts to the different encryption levels and requirements of various businesses in encryption scenarios, and realizes accurate and efficient dynamic address encryption. While retaining data identifiability to the greatest extent, it ensures that privacy information is not leaked. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0019] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0020] Figure 1 A flowchart of the first embodiment of the Chinese address encryption method of the present application is provided; Figure 2 A first detailed flow chart of the method for encrypting Chinese addresses provided in the first embodiment of the present application; Figure 3 A second detailed flow chart provided for the first embodiment of the Chinese address encryption method of this application; Figure 4 A third detailed flow chart provided for the first embodiment of the Chinese address encryption method of this application; Figure 5 A flowchart of the second embodiment of the Chinese address encryption method of this application is provided; Figure 6 A flowchart of the third embodiment of the Chinese address encryption method of this application is provided; Figure 7 A brief flowchart of the Chinese address encryption method provided for this application; Figure 8 This is a schematic diagram of the module structure of the Chinese address encryption device in the embodiment of the present application; Fig. 9 This is a schematic diagram of the device structure of the hardware operating environment involved in the Chinese address encryption method in the embodiment of the present application.
[0021] Description of Figure Numbers: 10. Address identification module; 20. Target category determination module; 30. Address encryption module; 1001. Processing device; 1002. Read-only memory; 1003. Storage device; 1004. Memory; 1005. Bus; 1006. I / O interface; 1007. Input device; 1008. Output device; 1009. Communication device.
[0022] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0023] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0024] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0025] The main solution of the embodiment of the present application is: based on a preset target BERT model, address recognition is performed on the address to be encrypted to obtain the address entity corresponding to the address to be encrypted and the address entity category of the address entity; based on a preset sensitivity level, the target category to be encrypted in the address entity category is determined; based on the national encryption algorithm, the address entity corresponding to the target category is encrypted to obtain an encrypted address.
[0026] At present, in the process of Chinese address encryption, Chinese addresses need to be standardized to unify the format and meaning of address fields, fix incorrect spelling and format, and handle semantic complexity in addresses. Through standardization, address data can reach a consistent structure and specification, providing an accurate basis for subsequent encryption operations. However, due to the characteristics of Chinese addresses such as address format diversity and address semantic complexity, address standardization operations are difficult. If address information is not standardized, the encrypted result cannot accurately reflect the actual location of the address, thereby reducing the reliability of encryption.
[0027] The present application provides a Chinese address encryption method, comprising the following steps: performing address recognition on an address to be encrypted based on a preset target BERT model, obtaining an address entity corresponding to the address to be encrypted and an address entity category of the address entity, wherein the preset BERT model can identify key information in the address through its context understanding and generalization capabilities, without relying on a fixed address format, and therefore, by identifying and parsing the address to be encrypted through the BERT model, each component in the address and its category can be directly obtained, without the need to perform standardized operations on the Chinese address to be encrypted, thereby avoiding the problem of reduced reliability of row encryption due to the difficulty in performing standardized operations on the Chinese address, and simplifying the address encryption process; determining a target category to be encrypted in the address entity category based on a preset sensitivity level, encrypting the address to be encrypted by selecting different sensitivity levels instead of encrypting by fixed encryption rules, thereby achieving sensitive adaptation to different encryption requirements, as well as a balance between privacy protection and business requirements, and ensuring that privacy information is not exposed to the greatest extent; encrypting the address entity corresponding to the target category based on a national secret algorithm to obtain an encrypted address, and encrypting the address using a national secret algorithm, thereby ensuring that the address encryption method complies with applicable laws and regulations and privacy protection standards, and meets data security management requirements.
[0028] In summary, this application uses the BERT model to perform intelligent analysis of Chinese addresses to avoid standardized operations on encrypted addresses. Different sensitivity levels are selected to encrypt Chinese addresses according to needs. Dynamic encryption of Chinese addresses is achieved through intelligent address analysis and intelligent rule matching. It flexibly adapts to the different encryption levels and requirements of various businesses in encryption scenarios, and realizes accurate and efficient dynamic address encryption. While retaining data identifiability to the greatest extent, it ensures that privacy information is not leaked.
[0029] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a program process abnormality monitoring device, etc. The following takes the Chinese address encryption device as an example to illustrate this embodiment and the following embodiments.
[0030] Based on this, the embodiment of the present application provides a Chinese address encryption method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the Chinese address encryption method of the present application.
[0031] In this embodiment, the Chinese address encryption method includes steps S10 to S30: Step S10, performing address recognition on the address to be encrypted based on a preset target BERT model to obtain an address entity corresponding to the address to be encrypted and an address entity category of the address entity; It should be noted that the BERT model (Bidirectional Encoder Representations from Transformers) is a pre-trained language model (PLM). BERT has excellent performance and wide application in the field of natural language processing (NLP), providing a powerful pre-trained model foundation for a variety of language understanding tasks. Address recognition usually refers to automatically identifying and parsing address information from text, including detailed address elements such as country, province, city, district, street, house number, etc.
[0032] In this implementation, the BERT model is used to identify and parse the encrypted address to obtain the various components of the address. Since the BERT model can identify the key information in the address through its context understanding and generalization capabilities, it does not need to rely on a fixed address format. This avoids the problem of reduced encryption effect and reliability due to the difficulty in standardizing Chinese addresses, reduces the difficulty of encrypting Chinese addresses, and simplifies the encryption process.
[0033] Please refer to Figure 2 In a feasible implementation manner, step S10 may include steps S11 to S12: Step S11, obtaining the address to be encrypted, and performing word segmentation processing on the address to be encrypted, dividing the address to be encrypted into single characters; It should be noted that word segmentation is an important task in natural language processing (NLP). The main purpose of address segmentation is to decompose a continuous address string into a series of meaningful components, such as province, city, district, street, house number, etc.
[0034] In this implementation, the address to be encrypted is tokenized by a tokenizer, and a continuous text sequence is converted into a discrete token sequence, providing a basic unit for subsequent text processing and analysis. The text of the address to be encrypted is segmented into single characters as tokens by word-level tokenization.
[0035] Exemplarily, for the address "AB Province CD City EF District XY Building", the word-level segmentation result is ["A", "B", "Province", "C", "D", "City", "E", "F", "District", "X", "Y", "Building"].
[0036] Step S12: input the to-be-encrypted address after word segmentation processing into the target BERT model for address recognition to obtain the address entity and address entity category.
[0037] Please refer to Figure 3 In a feasible implementation manner, step S12 may further include steps A10 to A30: Step A10, predicting the address entity label of each of the characters based on the target BERT model to obtain the probability distribution of the address entity label corresponding to the character; Step A20, determining a target address entity tag of the character according to the probability distribution; Step A30: combining the characters having the same target address entity tag based on BIE rules to obtain the address entity and the address entity category.
[0038] It should be noted that the BIE rule is a sequence annotation method obtained by simplifying the BIOSE rule (BIO Enhanced by Sequence End), in which B (Begin) represents the starting position of the entity segment; I (Intermediate) represents the middle of the entity segment; E (End) represents the end of the entity segment, for example, "B-prov" represents the beginning of the provincial level, and "E-prov" represents the end of the provincial level.
[0039] In addition, it should be noted that in this embodiment, address entities are classified according to the "Chinese Address Element Parsing and Annotation Specification", where prov: represents provincial-level administrative divisions, such as provinces, autonomous regions, and municipalities directly under the central government; city represents prefecture-level administrative divisions, such as prefecture-level cities, regions, autonomous prefectures, etc.; district: represents county-level administrative divisions, such as urban districts, county-level cities, counties, etc.; devzone: represents development zones in a broad sense. In addition to development zones with certain administrative functions at the national and provincial levels, general industrial parks, resorts, etc. should also be marked as development zones; town: represents township-level administrative divisions, such as towns, streets, townships, etc.; community: represents communities, administrative villages (production brigades, village committees), and natural villages; village_group: represents limited xx groups, xx teams, and xx communities (xx is a number) ;road: indicates a road with a formal name, including tunnels, elevated roads, streets, lanes, alleys, etc.;roadno: indicates a road number;poi: indicates a point of interest, which is any meaningful point on the map without a geographical meaning, such as a store, bar, gas station, hospital, bus station, etc.;subpoi: indicates a sub-point of interest, such as the east gate of a shopping mall;houseno: indicates a building number, a house number in a rural address;cellno: indicates a unit number;floorno: indicates a floor number;roomno: indicates a room number or a household number;detail: indicates the four-level relationship within poi (house, cell, floor, room), such as xx-xx-xx;assist: indicates a common auxiliary positioning word without a specific number, such as: nearby, northeast, etc.;distance: indicates a distance auxiliary positioning word with a specific number, such as 50 meters in "50 meters north of XX County Road";intersection: indicates a road intersection, a mouth, an intersection, a road (highway) entrance and exit, and road Appear at the same time; redundant: indicates non-address elements, such as delivery tips, delivery requirements, friendly reminders, etc.; others indicates situations not covered by the above tags, or address elements that cannot be determined (this tag must be an address element, such as a mountain, an island, etc.).
[0040] In this implementation, the target BERT model is used to predict the input address. The target BERT model outputs the probability distribution of each marked address entity label, and then determines the boundary and category of the address entity through a certain threshold or rule. Finally, it is combined according to the BIE rule to obtain the address entities of the address to be identified.
[0041] For example, according to the probability distribution, the address entity tag with the highest probability can be selected as the address entity tag of each tag; a threshold can also be set. When the probability of an address entity tag is greater than the preset threshold, the tag belongs to the address entity category corresponding to the address entity tag. The result of the combined output according to the BIE rule is: {"A":"B-prov","B":"I-prov","province":"E-prov"}, then "AB Province" will be identified as prov (provincial level).
[0042] In this implementation, the various address entities of the address to be encrypted are identified according to the BIE rule and the BERT model, and each part of the address can be accurately identified and accurately parsed, solving the problem of address format diversity and semantic complexity. At the same time, the cumbersome process of data processing is optimized, and operations such as address standardization are no longer required before encryption.
[0043] Step S20, determining a target category to be encrypted in the address entity category based on a preset sensitivity level; Please refer to Figure 4 In a feasible implementation manner, step S20 may include steps S21 to S23: S21, obtaining the sensitivity level corresponding to the address to be encrypted; S22, acquiring a corresponding encryption list based on the sensitivity level, wherein the encryption list includes the target category to be encrypted; S23, traversing each of the address entities, if the address entity category corresponding to the address entity is in the encryption list, the address entity category is the target category.
[0044] In this embodiment, the operator can create or select different sensitivity levels (also called encryption levels), and establish an encryption list for each level, which contains the address entity categories that need to be encrypted at the encryption level. During the encryption process, each address entity in the encrypted address is traversed, and if the category corresponding to the address entity is in the corresponding encryption list, the address entity of the maximum length portion corresponding to the category included in the encryption list in the encrypted address is encrypted.
[0045] For example, first, according to business needs, the operator needs to ensure that "town" to "subpoi" are all hidden information, and define the encryption level list as "town" to "subpoi" granularity, that is, ("town", "community", "village_group", "road", "poi", "subpoi"). Secondly, encrypt the maximum length of the list elements "town", "community", "poi" in the address to be encrypted, where the maximum length means that even if other elements are included in the middle, they are encrypted together. After encrypting "town" to "subpoi", even if the building number or room number is left, the specific address cannot be defined, thereby retaining the identifiability of the data and ensuring that the address encryption has a privacy protection effect.
[0046] In this embodiment, by encrypting the maximum length of the elements in the encryption list, when the address is not standardized, it can ensure that the required encryption range can be fully covered, and the data identifiability is retained to the greatest extent while hiding sensitive information. When irregular and unordered addresses such as "XX Province XX City XX Community XX Building XX Village XX Town" appear, through the method of this embodiment, the maximum length of the list elements in this address "XX Community XX Building XX Village XX Town" will be selected as the part that needs to be encrypted, ensuring that the required encryption range can be fully covered. In addition, by selecting different sensitivity levels or encryption levels, sensitive adaptation is achieved, and privacy information can be protected from exposure to the greatest extent.
[0047] Step S30: encrypt the address entity corresponding to the target category based on a national encryption algorithm to obtain an encrypted address.
[0048] Please refer to Figure 4 In a feasible implementation manner, step S30 may include step S31: Step S31, encrypting the address entity corresponding to the target category based on the SM4 algorithm, replacing the address entity to be encrypted with a preset special symbol to obtain an encrypted address.
[0049] It should be noted that the SM4 algorithm (SM4 block cipher algorithm, Simplified Message Block Cipher for 128-bit Data) is a block cipher algorithm released by the China National Cryptography Administration and is widely used in China's information security field. It is a symmetric encryption algorithm with a key length and a block length of 128 bits. The SM4 algorithm uses a 32-round Feistel structure (Feistel encryption structure) and a nonlinear S-box, combined with operations such as substitution, permutation, and XOR to ensure its security and anti-attack capabilities.
[0050] In this implementation, first, a 128-bit key is prepared, which will be used in the encryption and decryption process of the SM4 algorithm, and the key expansion mechanism of the SM4 algorithm is used to convert the 128-bit original key into a 32-round round key. Secondly, each address entity to be encrypted is divided into a 128-bit data block (if it is less than 128 bits, it needs to be padded), and the encryption round of the SM4 algorithm is applied to each data block, including S-box transformation, row shift, column confusion and round key addition. Finally, a set of special symbols is defined, and the characters or bits in the encrypted address entity are replaced with the corresponding special symbols. The replaced special symbols are recombined according to the structure of the original address entity to form an encrypted address.
[0051] In this implementation, the encrypted address is obtained by encrypting the address entity to be encrypted using a national encryption algorithm, thereby ensuring that the address encryption method complies with applicable laws and regulations and privacy protection standards and meets data security management requirements.
[0052] The present embodiment provides a Chinese address encryption method. The present application provides a Chinese address encryption method, comprising the following steps: performing address recognition on the address to be encrypted based on a preset target BERT model to obtain the address entity corresponding to the address to be encrypted and the address entity category of the address entity. The preset BERT model can recognize the key information in the address through its context understanding and generalization capabilities without relying on a fixed address format. Therefore, by using the BERT model to recognize and parse the address to be encrypted, the various components and their categories in the address can be directly obtained, without the need to perform standardization operations on the Chinese address to be encrypted, thereby avoiding the problem of standardization operations on the Chinese address. The problem of reduced reliability of row encryption caused by operational difficulties is simplified, and the address encryption process is simplified; the target category to be encrypted in the address entity category is determined based on a preset sensitivity level, and the address to be encrypted is encrypted by selecting different sensitivity levels instead of encrypting through fixed encryption rules, thereby achieving sensitive adaptation to different encryption requirements and a balance between privacy protection and business needs, and ensuring that privacy information is not exposed to the greatest extent; the address entity corresponding to the target category is encrypted based on the national secret algorithm to obtain an encrypted address, and the address is encrypted using the national secret algorithm, ensuring that the address encryption method complies with applicable laws and regulations and privacy protection standards, and meets data security management requirements.
[0053] In summary, this application uses the BERT model to perform intelligent analysis of Chinese addresses to avoid standardized operations on encrypted addresses. Different sensitivity levels are selected to encrypt Chinese addresses according to needs. Dynamic encryption of Chinese addresses is achieved through intelligent address analysis and intelligent rule matching. It flexibly adapts to the different encryption levels and requirements of various businesses in encryption scenarios, and realizes accurate and efficient dynamic address encryption. While retaining data identifiability to the greatest extent, it ensures that privacy information is not leaked.
[0054] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 5 Before step S10, the Chinese address encryption method further includes steps S01 to S03: Step S01, obtaining address data, and dividing each of the address data into individual characters; Step S02, annotating the characters with corresponding address entity labels based on BIE rules, and constructing an address annotation dataset according to the annotated characters; Step S03: training the pre-trained BERT model based on the address annotation dataset to obtain the target BERT model.
[0055] It should be noted that the address entity tag includes the category of the address entity segment and the position of the address entity segment.
[0056] In this implementation, first, address data is collected and prepared, and the address data is divided into individual characters according to the BIE rules and the open source "Chinese Address Element Parsing and Annotation Specification". Secondly, an address annotation dataset is constructed based on the annotated characters, and the address annotation dataset contains the original text and the corresponding address entity labels. Finally, the pre-trained BERT model is used as the basis, and fine-tuning is performed on the constructed training dataset. By adjusting and optimizing the parameters of the BERT model, it is adapted to the recognition task of address entities.
[0057] In this implementation, the address annotations are classified by adopting an open source Chinese address element parsing and annotation specification, thereby avoiding the difficulty of address segmentation based on specific rules to cover various special situations that may arise in actual applications, resulting in the final segmented address blocks losing accuracy.
[0058] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 6 After step S30, the Chinese address encryption method further includes steps S41-S42: Step S41, when a decryption and reassembly request is obtained, verifying whether the requester corresponding to the decryption request has decryption and reassembly authority based on a preset authority control policy; Step S42: If the requester has the decryption and reassembly authority, the encrypted address is decrypted and reassembled based on the decryption and reassembly request.
[0059] It should be noted that decryption refers to the process of converting the encrypted Chinese address back to its original form using the algorithm and key corresponding to the encryption. Decryption is the reverse process of encryption, aiming to restore the data before encryption. Reconstruction usually refers to further processing of the original data obtained after decryption to restore its original structure or format.
[0060] In this embodiment, before decryption, the identity and authority of the requester are verified to ensure that only authorized users can access the decryption key and reconstructed data. After verification, the encrypted address is decrypted using the same key and the reverse round key to restore the original address and replace the special symbols back to the original characters or bits.
[0061] For example, first, the requester is verified, and the encryptor defines the access policy according to business requirements, for example, the user must have two attributes: department manager and project A access rights. Secondly, when the requester tries to decrypt the data, it is first verified whether the requester's attribute set meets the access policy. If so, the decryption key is used for decryption; if not, the decryption fails and the user cannot access the data.
[0062] In this embodiment, the Chinese address before encryption can be restored by decryption and reorganization, so that the address can be read and understood by humans. The decrypted Chinese address can be used in various application scenarios that require address information, such as logistics distribution, map navigation, etc. Through the decryption process, the integrity and authenticity of the encrypted data can also be verified to ensure that the data has not been tampered with during transmission.
[0063] For example, to help understand the implementation process of the Chinese address encryption method obtained by combining this embodiment with the above-mentioned embodiment 1, please refer to Figure 7 , Figure 7 A brief flowchart of a Chinese address encryption method is provided, specifically: First, a dataset with labeled address entity labels is constructed, and the BERT model is fine-tuned based on the dataset to adapt it to the specific address entity recognition task. Secondly, after the address to be encrypted is segmented, the fine-tuned BERT model is used to identify and parse each part of the address to be encrypted to obtain the address entity and address entity type. Again, different sensitivity levels or encryption levels are created or selected, and an encryption list is established for each level, which contains the address entity categories that need to be encrypted at this encryption level. During the encryption process, each address entity in the address to be encrypted is traversed. If the address entity category corresponding to the address entity exists in the corresponding encryption list, the address entity is the address entity to be encrypted. Then, the national secret algorithm is used to encrypt the address entity to be encrypted. Finally, the encrypted address is decrypted and reorganized to obtain the original address to be encrypted.
[0064] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the Chinese address encryption method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0065] This application also provides a Chinese address encryption device, please refer to Figure 8 , the Chinese address encryption device comprises: An address recognition module 10 is used to perform address recognition on the address to be encrypted based on a preset target BERT model, and obtain an address entity corresponding to the address to be encrypted and an address entity category of the address entity; A target category determination module 20, configured to determine a target category to be encrypted in the address entity category based on a preset sensitivity level; The address encryption module 30 is used to encrypt the address entity corresponding to the target category based on the national encryption algorithm to obtain an encrypted address.
[0066] The Chinese address encryption device provided by the present application adopts the Chinese address encryption method in the above embodiment, which can solve the technical problem of Chinese address encryption. Compared with the prior art, the beneficial effects of the Chinese address encryption device provided by the present application are the same as the beneficial effects of the Chinese address encryption method provided by the above embodiment, and other technical features in the Chinese address encryption device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0067] The present application provides a Chinese address encryption device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the Chinese address encryption method in the above-mentioned embodiment one.
[0068] Reference below Fig. 9 , which shows a schematic diagram of the structure of a Chinese address encryption device suitable for implementing the embodiment of the present application. The Chinese address encryption device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Android Devices), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig. 9 The Chinese address encryption device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0069] like Fig. 9 As shown, the Chinese address encryption device may include a processing device 1001 (such as a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the Chinese address encryption device are also stored. The processing device 1001, ROM1002 and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the Chinese address encryption device to communicate wirelessly or wired with other devices to exchange data. Although the Chinese address encryption device with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or provided alternatively.
[0070] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0071] The Chinese address encryption device provided by the present application adopts the Chinese address encryption method in the above embodiment, which can solve the technical problem of how to improve the reliability of encrypting Chinese addresses. Compared with the prior art, the beneficial effects of the Chinese address encryption device provided by the present application are the same as the beneficial effects of the Chinese address encryption method provided by the above embodiment, and other technical features in the Chinese address encryption device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0072] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0073] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0074] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the Chinese address encryption method in the above-mentioned embodiment.
[0075] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.
[0076] The computer-readable storage medium may be included in the Chinese address encryption device; or it may exist independently without being assembled into the Chinese address encryption device.
[0077] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the Chinese address encryption device, the Chinese address encryption device: performs address recognition on the address to be encrypted based on a preset target BERT model, and obtains the address entity corresponding to the address to be encrypted and the address entity category of the address entity; determines the target category to be encrypted in the address entity category based on a preset sensitivity level; encrypts the address entity corresponding to the target category based on the national secret algorithm to obtain an encrypted address.
[0078] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0079] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0080] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0081] The readable storage medium provided in the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned Chinese address encryption method, and can solve the technical problem of how to improve the reliability of encrypting Chinese addresses. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in the present application are the same as the beneficial effects of the Chinese address encryption method provided in the above-mentioned embodiment, and will not be elaborated here.
[0082] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned Chinese address encryption method when executed by a processor.
[0083] The computer program product provided by the present application can solve the technical problem of how to improve the reliability of encrypting Chinese addresses. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the Chinese address encryption method provided by the above embodiment, which will not be repeated here.
[0084] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A Chinese address encryption method, characterized in that: The method includes: Performing address recognition on the address to be encrypted based on a preset target BERT model to obtain an address entity corresponding to the address to be encrypted and an address entity category of the address entity; Determining a target category to be encrypted in the address entity category based on a preset sensitivity level; The address entity corresponding to the target category is encrypted based on the national encryption algorithm to obtain an encrypted address.
2. The method according to claim 1, characterized in that Before the step of performing address recognition on the address to be encrypted based on the preset target BERT model to obtain the address entity corresponding to the address to be encrypted and the address entity category of the address entity, the following step is also included: Acquire address data, and cut each of the address data into individual characters; Annotate the characters with corresponding address entity labels based on the BIE rule, and construct an address annotation dataset based on the annotated characters; The pre-trained BERT model is trained based on the address annotation dataset to obtain the target BERT model.
3. The method according to claim 1, characterized in that The step of performing address recognition on the address to be encrypted based on the preset target BERT model to obtain the address entity corresponding to the address to be encrypted and the address entity category of the address entity includes: Obtain the address to be encrypted, and perform word segmentation processing on the address to be encrypted, so as to divide the address to be encrypted into single characters; The address to be encrypted after word segmentation processing is input into the target BERT model for address recognition to obtain the address entity and address entity category.
4. The method according to claim 3, characterized in that The step of inputting the to-be-encrypted address after word segmentation processing into the target BERT model for address recognition to obtain the address entity and address entity category comprises: Predicting the address entity labels of each of the characters based on the target BERT model to obtain a probability distribution of the address entity labels corresponding to the characters; Determine a target address entity tag of the character according to the probability distribution; The characters having the same target address entity tag are combined based on a BIE rule to obtain the address entity and the address entity category.
5. The method according to claim 1, characterized in that The step of determining the target category to be encrypted in the address entity category based on the preset sensitivity level includes: Obtaining the sensitivity level corresponding to the address to be encrypted; Acquire a corresponding encryption list based on the sensitivity level, wherein the encryption list includes the target category to be encrypted; Each of the address entities is traversed, and if the address entity category corresponding to the address entity is in the encryption list, the address entity category is the target category.
6. The method according to claim 1, characterized in that The step of encrypting the address entity corresponding to the target category based on the national encryption algorithm to obtain the encrypted address includes: The address entity corresponding to the target category is encrypted based on the SM4 algorithm, and the address entity to be encrypted is replaced with a preset special symbol to obtain an encrypted address.
7. The method according to any one of claims 1 to 6, characterized in that The method further comprises: When a decryption and reassembly request is obtained, verify whether the requester corresponding to the decryption request has the decryption and reassembly authority based on a preset authority control policy; If the requester has the decryption and reassembly authority, the encrypted address is decrypted and reassembled based on the decryption and reassembly request.
8. A Chinese address encryption device, characterized in that: The device comprises: An address recognition module, used to perform address recognition on the address to be encrypted based on a preset target BERT model, and obtain an address entity corresponding to the address to be encrypted and an address entity category of the address entity; A target category determination module, used to determine the target category to be encrypted in the address entity category based on a preset sensitivity level; The address encryption module is used to encrypt the address entity corresponding to the target category based on the national encryption algorithm to obtain an encrypted address.
9. A Chinese address encryption device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the Chinese address encryption method according to any one of claims 1 to 7.
10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the Chinese address encryption method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Intelligent data desensitization method and device, computer equipment and storage medium
CN110245470A
Address element extraction method and device, storage medium and computer equipment
CN116522943A
Text desensitization method and device, equipment and medium
CN116663056A
Chinese address word segmentation and analysis method
CN118485073A
