An identity card number desensitization method, device, equipment and storage medium

By using a timestamp-based ID number desensitization method, and generating desensitized regional codes, birthdate codes, and check codes using the remainder of numbers and the meaning of the codes, the problem of information loss and verification difficulties in existing desensitization methods is solved, thereby improving security and practicality.

CN114329593BActive Publication Date: 2025-11-04AGRICULTURAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111633883.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-29
Publication Date
2025-11-04
Estimated Expiration
2041-12-29

AI Technical Summary

Technical Problem

Existing methods for anonymizing ID card numbers lose information when the ID card number needs to convey practical meaning, as the '*' character is used for processing and cannot be used as valid input for verification, resulting in insufficient data security and usability.

Method used

By obtaining the ID number to be anonymized and the current timestamp, and utilizing the characteristics of the timestamp's numerical changes, the remainder of each digit in the ID number is taken, and the anonymization is performed in combination with the meaning of the numerical code, generating an anonymized regional code, birth date code, and check code. This ensures that the anonymized data is similar to the real data, and irreversible remainder operations are used to ensure security.

Benefits of technology

It maintains the numerical composition characteristics of the ID card number before and after anonymization, ensuring data security and usability, effectively verifying the legality of the ID card number, and enhancing the variability and security of the anonymization rules.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114329593B_ABST
    Figure CN114329593B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a kind of identity card number desensitization method, device, equipment and storage medium, method includes: obtaining identity card number to be desensitized and current timestamp;Each digit in identity card number to be desensitized is taken modulo corresponding digit in current timestamp, and get the identity card number of remainder;According to the numerical coding meaning in identity card number, determine the desensitized area code of identity card number of remainder, desensitized birthday code and sequence code, desensitize desensitized area code to obtain desensitized area code, desensitize desensitized birthday code to obtain desensitized birthday code, determine check code based on desensitized area code, desensitized birthday code and sequence code;Desensitized area code, desensitized birthday code, sequence code and check code are sequentially spliced to obtain desensitized identity card number.Based on timestamp, identity card number is desensitized, so that the certificate number close to the digit before desensitization still maintains close after desensitization processing, the feature of digital composition is maintained, and practical significance increases.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present application relate to the technical field of data processing, and particularly relate to an identity card number desensitization method, device, equipment and storage medium. BACKGROUND

[0002] In recent years, information security incidents such as personal information leakage and information tampering are common. These personal information data have certain risks. Through a data desensitization device, the abuse of private data within an enterprise can be effectively prevented, and private data can be prevented from flowing out of the enterprise without desensitization, meeting the needs of both protecting private data and reasonably using the data.

[0003] The common desensitization method for identity card numbers and similar sensitive information at present is to replace the middle several digits of the identity card number with the character '*'. This desensitization method loses information when the identity card number needs to present actual meaning, and the '*' cannot be used as an effective input for checking the legality of the identity card number input. SUMMARY

[0004] Embodiments of the present application provide an identity card number desensitization method, device, equipment and storage medium to realize the variability of the desensitization rule, so that the desensitized data is similar to the real data, and the practical significance is increased.

[0005] In a first aspect, embodiments of the present application provide an identity card number desensitization method, comprising:

[0006] obtaining a to-be-desensitized identity card number and a current timestamp;

[0007] taking the remainder of each digit in the to-be-desensitized identity card number with respect to the corresponding digit in the current timestamp to obtain a remainder identity card number;

[0008] determining a to-be-desensitized region code, a to-be-desensitized birthday code and a sequence code in the remainder identity card number according to the coding meaning of the digits in the identity card number, desensitizing the to-be-desensitized region code to obtain a desensitized region code, desensitizing the to-be-desensitized birthday code to obtain a desensitized birthday code, and determining a check code based on the desensitized region code, the desensitized birthday code and the sequence code;

[0009] sequentially splicing the desensitized region code, the desensitized birthday code, the sequence code and the check code to obtain a desensitized identity card number.

[0010] Optionally, desensitizing the to-be-desensitized region code to obtain the desensitized region code comprises:

[0011] calculating the distance between the to-be-desensitized region code and each standard region code;

[0012] According to the distance between the to-be-desensitized area code and each standard area code, a standard area code is selected as the desensitized area code.

[0013] Optionally, according to the distance between the to-be-desensitized area code and each standard area code, a standard area code is selected as the desensitized area code, comprising:

[0014] The standard area code with the minimum distance from the to-be-desensitized area code is selected as the desensitized area code.

[0015] Optionally, the to-be-desensitized birthday code is desensitized to obtain a desensitized birthday code, comprising:

[0016] The year code in the to-be-desensitized birthday code, the to-be-desensitized month code and the to-be-desensitized day code are determined.

[0017] The to-be-desensitized month code is desensitized to obtain a desensitized month code, and the to-be-desensitized day code is desensitized to obtain a desensitized day code.

[0018] The year code, the desensitized month code and the desensitized day code are sequentially spliced to obtain the desensitized birthday code.

[0019] Optionally, the to-be-desensitized month code is desensitized to obtain a desensitized month code, comprising:

[0020] The to-be-desensitized year code is taken modulo the month to obtain the desensitized month code.

[0021] Optionally, the to-be-desensitized day code is desensitized to obtain a desensitized day code, comprising:

[0022] The number of days corresponding to the desensitized month code is determined.

[0023] The to-be-desensitized day code is taken modulo the number of days to obtain the desensitized day code.

[0024] Optionally, the desensitized area code, the desensitized birthday code and the sequence code are used to determine the check code, comprising:

[0025] The desensitized area code, the desensitized birthday code and the sequence code are sequentially spliced to obtain a partial ID number.

[0026] The digits of the partial ID number are weighted and summed to obtain an intermediate value.

[0027] The intermediate value is taken modulo a set value to determine the check code based on the modulo result.

[0028] In a second aspect, the embodiments of the present application further provide an ID number desensitization device, comprising:

[0029] A desensitization parameter acquisition module is configured to acquire a to-be-desensitized ID number and a current timestamp.

[0030] An identity card number remainder module is configured to take the remainder of each digit in the to-be-desensitized identity card number with respect to a corresponding digit in the current timestamp to obtain a remainder identity card number.

[0031] A number rationalization processing module is configured to determine a to-be-desensitized region code, a to-be-desensitized birthday code and a sequence code in the remainder identity card number according to the coding meaning of the digits in the identity card number, desensitize the to-be-desensitized region code to obtain a desensitized region code, desensitize the to-be-desensitized birthday code to obtain a desensitized birthday code, and determine a check code based on the desensitized region code, the desensitized birthday code and the sequence code.

[0032] A desensitized identity card number module is configured to sequentially splice the desensitized region code, the desensitized birthday code, the sequence code and the check code to obtain a desensitized identity card number.

[0033] In a third aspect, an embodiment of the present application further provides a computer device, which comprises:

[0034] One or more processors;

[0035] A storage device configured to store one or more programs;

[0036] When the one or more programs are executed by the one or more processors, the one or more processors implement the identity card number desensitization method provided by any embodiment of the present application.

[0037] In a fourth aspect, an embodiment of the present application further provides a computer readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the identity card number desensitization method provided by any embodiment of the present application.

[0038] The identity card number desensitization method provided by the embodiment of the present application comprises the following steps: obtaining a to-be-desensitized identity card number and a current timestamp; taking the remainder of each digit in the to-be-desensitized identity card number with respect to a corresponding digit in the current timestamp to obtain a remainder identity card number; determining a to-be-desensitized region code, a to-be-desensitized birthday code and a sequence code in the remainder identity card number according to the coding meaning of the digits in the identity card number, desensitizing the to-be-desensitized region code to obtain a desensitized region code, desensitizing the to-be-desensitized birthday code to obtain a desensitized birthday code, and determining a check code based on the desensitized region code, the desensitized birthday code and the sequence code; and sequentially splicing the desensitized region code, the desensitized birthday code, the sequence code and the check code to obtain a desensitized identity card number. By desensitizing the identity card number based on the timestamp, the feature that the earlier digits in the timestamp change less frequently and the later digits change more frequently is utilized, so that the identity card numbers with close digits in the identity card number before desensitization remain close after desensitization, thereby maintaining the feature of the digits in the data, and the use of the non-reversible remainder operation ensures the security of the original data. In addition, different desensitization methods are adopted according to the coding meaning of the digits, so that the desensitized data is close to the real data, and the practical significance is increased. BRIEF DESCRIPTION OF DRAWINGS

[0039] Figure 1 is a flowchart of an identity card number desensitization method provided by an embodiment of the present application;

[0040] Figure 2 is a flowchart of an identity card number desensitization method provided by an embodiment of the present application;

[0041] Figure 3 is a structural diagram of an identity card number desensitization device provided by an embodiment of the present application;

[0042] Figure 4 is a structural diagram of a computer device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0043] The present application will be further described below in conjunction with the drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the present application, but not to limit the present application. In addition, it should be noted that, for the convenience of description, only the parts related to the present application are shown in the drawings, but not all the structures.

[0044] Embodiment One

[0045] Figure 1 is a flowchart of an identity card number desensitization method provided by an embodiment of the present application. The present embodiment can be applied to the case of desensitizing an identity card number. The method can be executed by an identity card number desensitization device, which can be realized in the form of software and / or hardware, for example, the identity card number desensitization device can be configured in a computer device. As shown in the figure, the method comprises: Figure 1

[0046] S110, obtaining a to-be-desensitized identity card number and a current timestamp.

[0047] In the present embodiment, in order to maximize the rationality and statistical availability of the desensitized identity card number, a desensitization method based on timestamp is provided. By using the feature that the earlier digits of the timestamp change infrequently and the later digits change more frequently, the features of the digit composition in the to-be-desensitized identity card number data are maintained. And the timestamp is used as a processing medium, which is invisible to the user of the data, and since the precision of the timestamp is one hundred nanoseconds, the processing medium has a certain randomness. The above two properties guarantee the security of the data processing.

[0048] ​The to-be-desensitized ID number can be an ID number that needs to be desensitized, and the current timestamp is a timestamp when the desensitization operation is performed. Considering that the ID number is 18 digits, in order to enable the current timestamp and the digits in the ID number to be correspondingly processed, an 18-digit timestamp can be obtained for desensitization of the ID number.

[0049] In S120, each digit in the to-be-desensitized ID number is taken modulo a corresponding digit in the current timestamp to obtain a modulo ID number.

[0050] Optionally, the number of digits of the current timestamp can be consistent with the number of digits of the ID number, and each digit in the current timestamp can be corresponded to each digit in the ID number in a front-back order to determine a digit in the current timestamp corresponding to each digit in the to-be-desensitized ID number.

[0051] After the digit in the current timestamp corresponding to each digit in the to-be-desensitized ID number is determined, the digit in the to-be-desensitized ID number is taken modulo the digit in the current timestamp to obtain a modulo result of each digit in the to-be-desensitized ID number. The modulo results are sequentially concatenated according to the order of the corresponding digits in the ID number to obtain the modulo ID number. Assuming that a digit A in the to-be-desensitized ID number corresponds to a digit B in the current timestamp, A is taken modulo B to obtain a modulo result corresponding to the digit A.

[0052] In S130, the to-be-desensitized region code, the to-be-desensitized birthday code, and the sequence code in the modulo ID number are determined according to the coding meanings of the digits in the ID number. The to-be-desensitized region code is desensitized to obtain a desensitized region code, the to-be-desensitized birthday code is desensitized to obtain a desensitized birthday code, and a check code is determined based on the desensitized region code, the desensitized birthday code, and the sequence code.

[0053] It can be understood that the ID number is not a random number, and each digit has its corresponding meaning. The digits 1-6 are the province and city region code, the digits 7-14 are the birthday information, the digits 15-17 are the sequence code, and the last digit is the ID number check code, which can be used to check whether the ID number is legal. The last digit is generated according to a set of fixed rules based on the first seventeen meaningful digits. The first 1-6 digits in the to-be-desensitized ID number are the to-be-desensitized region code, the digits 7-14 are the to-be-desensitized birthday code, and the digits 15-17 are the sequence code.

[0054] In order to avoid the identity card number losing meaning completely after desensitization, in the embodiment, different desensitization operations are performed on numbers with different meanings. For any identity card number to be desensitized, it can be divided into four parts: region code, birth date, sequence code, and check code. When data statistics is needed to be performed using the desensitized identity card number, part of the identity card number can be selected based on the statistical requirement to perform desensitization. For example, if region information needs to be counted, the first six digits are not desensitized, and the rest of the digits are desensitized; if birth date information needs to be counted, the seventh to fourteenth digits are not desensitized, and the rest of the digits are desensitized. It should be noted that the 15th to 17th digits have relatively small effect in actual application, and are generally desensitized. The 18th digit is generated according to the first 17 digits in any case.

[0055] In one embodiment, the region code to be desensitized is desensitized to obtain a desensitized region code, including: calculating the distance between the region code to be desensitized and each standard region code; and selecting a standard region code as the desensitized region code according to the distance between the region code to be desensitized and each standard region code. In order to ensure that the part of the desensitized identity card number representing the region is a correct code and not a meaningless code, a standard region code is selected as the desensitized region code in the embodiment. Specifically, the distance between the region code to be desensitized and the pre-stored standard region code can be calculated, and a standard region code is selected as the desensitized region code based on the distance. The distance between the region code to be desensitized and the standard region code can be calculated by using the distance calculation method in the prior art, which is not limited herein. For example, the Euclidean distance calculation method can be used to calculate the distance between the region code to be desensitized and the standard region code. The standard region code can be selected as the desensitized region code based on the distance, which can be the standard region code with the largest distance from the region code to be desensitized, or the standard region code with the smallest distance from the region code to be desensitized, or the distance ranking number, and the standard region code corresponding to the distance ranking number is selected as the desensitized region code.

[0056] Based on the above, the standard region code is selected as the desensitized region code according to the distance between the region code to be desensitized and each standard region code, including: selecting the standard region code with the smallest distance from the region code to be desensitized as the desensitized region code. The standard region code with the smallest distance from the region code to be desensitized can be selected as the desensitized region code. Directly selecting the standard region code with the smallest distance from the region code to be desensitized as the desensitized region code can simplify the confirmation complexity of the desensitized region code.

[0057] In one embodiment, the desensitization of the to-be-desensitized birthday code to obtain the desensitized birthday code comprises: determining the year code in the to-be-desensitized birthday code, the to-be-desensitized month code and the to-be-desensitized day code; desensitizing the to-be-desensitized month code to obtain the desensitized month code, and desensitizing the to-be-desensitized day code to obtain the desensitized day code; and sequentially splicing the year code, the desensitized month code and the desensitized day code to obtain the desensitized birthday code. In order to ensure that the part representing the birthday in the desensitized ID number is a correct code rather than a meaningless code, the desensitization of the to-be-desensitized birthday code is performed by reasonably setting the remainder parameter in the embodiment. It can be understood that in a reasonable birthday code, the code representing the month is between 1 and 12, and the code representing the day is determined according to the month. When the month is 01, 03, 05, 07, 08, 10 or 12, the code representing the day is between 1 and 31. When the month is 04, 06, 09 or 11, the code representing the day is between 1 and 30. When the month is 02, the code representing the day needs to be determined in combination with the year, and the code range is between 0 and 28 or between 0 and 29. After the desensitized month code and the desensitized day code are determined, the year code, the desensitized day code and the desensitized month code are sequentially spliced to obtain the desensitized birthday code.

[0058] In one embodiment, the desensitization of the to-be-desensitized month code to obtain the desensitized month code comprises: taking the to-be-desensitized month code modulo the number of months to obtain the desensitized month code. The total number of months in a year is 12 months. In order to ensure that the desensitized month code is between 1 and 12, the to-be-desensitized month code is taken modulo 12, and the remainder is taken as the desensitized month code.

[0059] In one embodiment, the desensitization of the to-be-desensitized day code to obtain the desensitized day code comprises: determining the number of days corresponding to the desensitized month code; and taking the to-be-desensitized day code modulo the number of days to obtain the desensitized day code. The total number of days in each month varies with the month. In order to ensure the reasonableness of the desensitized day code, the number of days in the month needs to be determined based on the desensitized month code, and then the to-be-desensitized day code is taken modulo the number of days in the month, and the remainder is taken as the desensitized day code.

[0060] After the desensitized area code and the desensitized birthday code are determined, the first 17 digits of the desensitized ID number are obtained. The 18th digit of the ID number is a check digit, which needs to be calculated according to the first 17 digits of the ID number. Based on this, the check code is determined based on the desensitized area code, the desensitized birthday code and the sequence code, including: splicing the desensitized area code, the desensitized birthday code and the sequence code in order to obtain a partial ID number; summing the digits of the partial ID number to obtain an intermediate value; taking the intermediate value modulo a set value to determine the check code. It can be understood that splicing the desensitized area code, the desensitized birthday code and the sequence code in order can obtain a 17-digit number as a partial ID number, summing the digits of the 17-digit ID number, and then taking the remainder, the value corresponding to the remainder is the check code. Specifically, the 17 digits of the partial ID number are multiplied by the following numbers 7-9-10-5-8-4-2-1-6-3-7-9-10-5-8-4-2 in order and summed, and the sum is taken modulo 11. The remainder result will be in 0-1-2-3-4-5-6-7-8-9-10, according to the remainder result 0 to 10, corresponding to 1-0-X-9-8-7-6-5-4-3-2 in order as the check code, that is, the last character of the desensitized ID number. The check digit obtained in the above manner makes the desensitized ID number meet the check requirement, so that the activities such as data analysis or validity check can be normally carried out.

[0061] S140, splicing the desensitized area code, the desensitized birthday code, the sequence code and the check code in order to obtain the desensitized ID number.

[0062] After determining the desensitized area code, the desensitized birthday code, the sequence code and the check code, splicing the desensitized area code, the desensitized birthday code, the sequence code and the check code in order can obtain the desensitized ID number.

[0063] The identity card number desensitization method provided by the embodiment of the present application obtains a to-be-desensitized identity card number and a current timestamp, takes the remainder of each digit in the to-be-desensitized identity card number with respect to a corresponding digit in the current timestamp to obtain a remainder identity card number, determines a to-be-desensitized region code, a to-be-desensitized birthday code and a sequence code in the remainder identity card number according to the coding meaning of the digits in the identity card number, desensitizes the to-be-desensitized region code to obtain a desensitized region code, desensitizes the to-be-desensitized birthday code to obtain a desensitized birthday code, and determines a check code based on the desensitized region code, the desensitized birthday code and the sequence code, and splices the desensitized region code, the desensitized birthday code, the sequence code and the check code in sequence to obtain a desensitized identity card number. The identity card number is desensitized based on the timestamp, the feature that the digits in the front of the timestamp change infrequently and the digits in the back change frequently is utilized, the identity card numbers close to each other in the identity card number before desensitization remain close to each other after desensitization, the feature of the digits in the data is thus maintained, the safety of the original data is ensured by the non-reversibility of the remainder operation, the desensitized data is close to the real data by using different desensitization manners according to the coding meaning of the digits, and the practical significance is increased.

[0064] Embodiment two

[0065] Figure 2 is a flowchart of an identity card number desensitization method provided by an embodiment two of the present application. The embodiment two provides a preferred embodiment on the basis of the above-mentioned scheme.

[0066] As shown in Figure 2 , the to-be-desensitized identity card number is obtained after the province and city code rationalization device, the birthday rationalization device and the identity card number legality verification supplement device. In combination with Figure 2 , the identity card number desensitization method provided by the embodiment two is cooperatively worked by the following components:

[0067] (1) Eighteen-bit timestamp obtainer. The function is to obtain a timestamp digit string and reserve 18 bits for standby.

[0068] (2) Bit-wise remainder device. It is an operation unit. The 18-bit timestamp obtained by the timestamp obtainer is one-to-one corresponding to the 18-bit identity card number, and then the remainder operation is performed on each digit of the first 17 digits of the identity card number with respect to the corresponding digit of the timestamp, and the eighteenth digit of the identity card number remains unchanged.

[0069] (3) Province and city code rationalization device. A pre-stored 6-digit province and city code collection is compared with the first 6 digits of the 18-digit number output by the bit-wise remainder device, and the value is taken from the 6-digit province and city code collection according to the principle of minimum distance.

[0070] (4) Birth date rationalization device. The eleventh to fourteenth digits output by the remainder taking device are rationalized. The remainder of the number pair 12 formed by the eleventh and twelfth digits is taken and one is added. The thirteenth and fourteenth digits are rationalized according to the result of the processing of the eleventh and twelfth digits. The specific rules are that if the number pair formed by the eleventh and twelfth digits is in 01, 03, 05, 07, 08, 10, 12, the remainder of the number pair 31 formed by the thirteenth and fourteenth digits is taken and one is added, and if the number pair formed by the eleventh and twelfth digits is in 04, 06, 09, 11, the remainder of the number pair 30 formed by the thirteenth and fourteenth digits is taken and one is added.

[0071] (5) Identity card number legality verification supplement device. Its function is to supplement the eighteenth digit of the identity card number. The specific rules are that the first seventeen digits are multiplied by the following numbers in order: 7-9-10-5-8-4-2-1-6-3-7-9-10-5-8-4-2, and the sum is taken, the remainder of which is taken by 11. The remainder result will be in 0-1-2-3-4-5-6-7-8-9-10, and according to the remainder result from 0 to 10, 1-0-X-9-8-7-6-5-4-3-2 are respectively corresponding as the last character of the desensitized identity card number.

[0072] In this embodiment, the desensitization of the identity card number includes the following steps:

[0073] (1) Before processing the data, first obtain an eighteen-bit timestamp (one hundred nanoseconds), and each digit of the eighteen-bit timestamp corresponds to a digit of the eighteen-digit identity card number. The use of timestamp as a processing medium is because the timestamp is invisible to the user of the data, and because the precision of the timestamp is one hundred nanoseconds, the processing medium has a certain randomness. These two properties ensure the security of the data after processing.

[0074] (2) For the first to seventeenth digits, each digit is taken by the remainder of the identity card number digit and the corresponding timestamp digit. The purpose is to change the original value of each digit to achieve the purpose of desensitization, and the remainder operation has the property of irreversibility, that is, even if the timestamp value is obtained, the original data cannot be reversed, ensuring data security. At the same time, the timestamp has the feature that the later the digit, the more frequently it changes. Therefore, when performing the operation with the identity card number bit by bit, the distribution of the data of the province and city code and the birth date information can be retained to the greatest extent.

[0075] (3) For the first six digits, compare with the pre-recorded system of province and city code set, and perform numerical value near value operation. This step also uses the feature that the later the timestamp bit is, the more frequent the change is. After processing the same batch of data, the identity card numbers of the same province can still maintain a relatively close regional code, ensuring the value of the data for analysis.

[0076] (4) For the eleventh to twelfth digits, take the remainder of 12 and add one. This step ensures that the eleventh and twelfth digits can take values between 1 and 12, ensuring the reasonableness of the birth month information.

[0077] (5) For the thirteenth to fourteenth digits, take the remainder of a specific number and add one according to the situation of the eleventh to twelfth digits. Specifically:

[0078] The remainder object of the eleventh to twelfth digits:

[0079] 01,03,05,07,08,10,12's remainder object is 31

[0080] 04,06,09,11's remainder object is 30

[0081] 02's remainder object is 28 (if the seventh to tenth year is a leap year, take the remainder of 29)

[0082] This step ensures the reasonableness of the birth date digits in the corresponding month.

[0083] (6) After the first seventeen digits are desensitized, the last digit of the identity card number is generated according to the following rules: multiply the first seventeen digits in order by the following numbers 7-9-10-5-8-4-2-1-6-3-7-9-10-5-8-4-2 and sum them up, take the remainder of 11, the remainder result will be in 0-1-2-3-4-5-6-7-8-9-10, according to the remainder result 0 to 10, correspond to 1-0-X-9-8-7-6-5-4-3-2 in order as the last digit of the desensitized identity card number. The purpose of this step is to check the legality of the identity card number data input if the data user needs to check the legality of the identity card number data input.

[0084] In the above desensitization process, if the identity card number is used for data analysis and needs accurate data, such as the need to retain provincial information, the first six digits are not desensitized, and the rest of the program remains the same; if the birth date information needs to be retained, the seventh to fourteenth digits are not desensitized. The fifteenth to seventeenth digits are desensitized in any case. The fifteenth to seventeenth digits are birth order codes, which have relatively small effect in actual use, and simple bit operations can meet the desensitization requirements. The eighteenth digit is generated according to the first seventeen digits in any case.

[0085] In the process of identity card number and timestamp bit remainder and subsequent operation, the embodiment of the application utilizes the characteristics that the front digits of the timestamp change infrequently and the more rear digits change more frequently, so that the identity card numbers close to each other before desensitization remain close after desensitization, thereby maintaining the characteristics of the digits in the data, and the security of the original data is ensured by the non-reversible remainder operation, and the effectiveness and legality of the identity card number data are ensured by the identity card number check. The use of the timestamp ensures the variability of the desensitization rule, which is invisible to data users, is more secure than fixed desensitization rules, and subsequent processing steps also make the desensitized data close to the real data, increasing the practical significance. The desensitized data has the following characteristics: the region information before desensitization is close, so the data after desensitization is still close; if the birth information before desensitization is close, the birth information after desensitization is still close, especially the birth year distribution characteristics, which is convenient for data analysis and use.

[0086] Embodiment three

[0087] Figure 3 is a structural schematic diagram of an identity card number desensitization device provided by the third embodiment of the application. The identity card number desensitization device can be realized in the form of software and / or hardware, for example, the identity card number desensitization device can be configured in a computer device. As shown in Figure 3 , the device includes a desensitization parameter acquisition module 310, an identity card number remainder module 320, a number rationalization processing module 330, and a desensitized identity card number module 340, wherein:

[0088] The desensitization parameter acquisition module 310 is configured to acquire a desensitized identity card number and a current timestamp.

[0089] The identity card number remainder module 320 is configured to take the remainder of each digit in the desensitized identity card number with respect to the corresponding digit in the current timestamp to obtain a remainder identity card number.

[0090] The number rationalization processing module 330 is configured to determine the desensitized region code, the desensitized birthday code, and the sequence code in the remainder identity card number according to the digit coding meaning in the identity card number, desensitize the desensitized region code to obtain a desensitized region code, desensitize the desensitized birthday code to obtain a desensitized birthday code, and determine a check code based on the desensitized region code, the desensitized birthday code, and the sequence code.

[0091] The desensitized identity card number module 340 is configured to sequentially splice the desensitized region code, the desensitized birthday code, the sequence code, and the check code to obtain a desensitized identity card number.

[0092] The embodiment of the application obtains a to-be-desensitized ID number and a current timestamp; obtains a remainder ID number by taking the remainder of each digit in the to-be-desensitized ID number with respect to a corresponding digit in the current timestamp; determines a to-be-desensitized region code, a to-be-desensitized birthday code and a sequence code in the remainder ID number according to the coding meaning of the digits in the ID number, desensitizes the to-be-desensitized region code to obtain a desensitized region code, desensitizes the to-be-desensitized birthday code to obtain a desensitized birthday code, and determines a check code based on the desensitized region code, the desensitized birthday code and the sequence code; and sequentially splices the desensitized region code, the desensitized birthday code, the sequence code and the check code to obtain a desensitized ID number. By desensitizing the ID number based on the timestamp, the feature that the digits in the timestamp change infrequently in the front and change more frequently in the back is utilized, so that the ID numbers close to each other in the ID number before desensitization remain close to each other after desensitization, and the feature of the digits in the data is maintained. In addition, the security of the original data is ensured by using the non-reversible remainder operation, and the desensitized data is close to the real data by using different desensitization manners according to the coding meaning of the digits, so that the practical significance is increased.

[0093] Optionally, on the basis of the above scheme, the number rationalization processing module 330 is specifically configured to:

[0094] calculate the distance between the to-be-desensitized region code and each standard region code;

[0095] select a standard region code as the desensitized region code according to the distance between the to-be-desensitized region code and each standard region code.

[0096] Optionally, on the basis of the above scheme, the number rationalization processing module 330 is specifically configured to:

[0097] select the standard region code with the smallest distance from the to-be-desensitized region code as the desensitized region code.

[0098] Optionally, on the basis of the above scheme, the number rationalization processing module 330 is specifically configured to:

[0099] determine the year code in the to-be-desensitized birthday code, the to-be-desensitized month code and the to-be-desensitized day code;

[0100] desensitize the to-be-desensitized month code to obtain a desensitized month code, and desensitize the to-be-desensitized day code to obtain a desensitized day code;

[0101] sequentially splice the year code, the desensitized month code and the desensitized day code to obtain the desensitized birthday code.

[0102] Optionally, on the basis of the above scheme, the number rationalization processing module 330 is specifically configured to:

[0103] obtain the desensitized month code by taking the remainder of the to-be-desensitized year code with respect to the month number.

[0104] Optionally, based on the above scheme, the number rationalization processing module 330 is specifically used for:

[0105] Determine the number of days corresponding to the de-identified monthly code;

[0106] The desensitized date code is obtained by taking the remainder of the date code to be desensitized with respect to the number of days.

[0107] Optionally, based on the above scheme, the number rationalization processing module 330 is specifically used for:

[0108] A partial ID number is obtained by sequentially concatenating the desensitized region code, desensitized birth date code, and sequence code.

[0109] The median value is obtained by summing the weighted digits of a portion of the ID card numbers.

[0110] The intermediate value is modulo the set value, and the check code is determined based on the modulo result.

[0111] The ID card number desensitization device provided in this embodiment of the invention can execute the ID card number desensitization method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the method.

[0112] Example 4

[0113] Figure 4 This is a schematic diagram of the structure of a computer device provided in Embodiment 4 of the present invention. Figure 4 A block diagram of an exemplary computer device 412 suitable for implementing embodiments of the present invention is shown. Figure 4 The computer device 412 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of the present invention.

[0114] like Figure 4 As shown, the computer device 412 is presented in the form of a general-purpose computing device. The components of the computer device 412 may include, but are not limited to: one or more processors 416, system memory 428, and bus 418 connecting different system components (including system memory 428 and processor 416).

[0115] Bus 418 represents one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor 416, or a local bus using any of the various bus architectures. For example, these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.

[0116] Computer device 412 typically includes a variety of computer system readable media. Such media can be any available media that is located either internally or externally to computer device 412, including both volatile and nonvolatile media, removable and non-removable media.

[0117] System memory 428 can include computer system readable media in the form of volatile memory, such as random access memory (RAM) 430 and / or cache memory 432. Computer device 412 can further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage device 434 can be provided for reading from and writing to a non-removable, non-volatile magnetic media (e.g., a "hard drive"). Figure 4 Not shown, a computer device 412 typically will also include a Figure 4 removable, non-volatile magnetic disk drive ("a floppy disk drive" being a typical form of media) and a removable, non-volatile optical disk drive ("a CD-ROM drive" being a typical form of media). In these cases, each drive will also be connected to bus 418 by one or more data media interfaces. The drives and their associated computer-readable media provide non-volatile storage of computer-readable instructions, data structures, program modules, and other data for computer device 412. Although the exemplary environment described herein employs a storage device 434, a memory 428, and a computer device 412, these elements can be located at one or both of locations 412 and 434, or distributed across both. In one embodiment, the functionality of these elements can be combined in a single device, such as a storage device 434.

[0118] Program / utility 440, having a set of programs / modules 442, can be stored in, for example, memory 428 by way of example, such programs includes an operating system, one or more application programs, other program modules, and program data, each of or some combination of which can include implementation of a network environment. Programs 442 generally carry out the functions and / or methodologies of embodiments of the application as described herein.

[0119] Computer device 412 can also communicate with one or more external devices 414 such as a keyboard, a pointing device, a display 424, etc.; one or more devices that enable a user to interact with computer device 412; and / or any devices (e.g., network card, modem, etc.) that enable computer device 412 to communicate with one or more other computing devices. Such communication can occur via Input / Output (I / O) interface(s) 422. Still yet, computer device 412 can communicate with one or more networks, such as a local area network (LAN), a general wide area network (WAN), and / or a public network such as the Internet, via network adapter 420. As depicted, network adapter 420 communicates with the other components of computer device 412 via bus 418. It should be appreciated that although not shown, other hardware and / or software modules could be used in connection with computer device 412. Examples, include, but are not limited to, microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data archival storage systems, etc.

[0120] Processor 416 performs various function applications and data processing by running programs stored in system memory 428, such as implementing the identity card number desensitization method provided by the embodiments of the present application, which includes:

[0121] Obtaining a to-be-desensitized identity card number and a current timestamp;

[0122] Taking the remainder of each digit in the to-be-desensitized identity card number with respect to the corresponding digit in the current timestamp to obtain a remainder identity card number;

[0123] According to the digit coding meaning in the identity card number, determining the to-be-desensitized region code, to-be-desensitized birthday code and sequence code in the remainder identity card number, desensitizing the to-be-desensitized region code to obtain a desensitized region code, desensitizing the to-be-desensitized birthday code to obtain a desensitized birthday code, and determining a check code based on the desensitized region code, the desensitized birthday code and the sequence code;

[0124] Concatenating the desensitized region code, the desensitized birthday code, the sequence code and the check code in sequence to obtain a desensitized identity card number.

[0125] Of course, those skilled in the art can understand that the processor can also implement the technical solutions of the identity card number desensitization method provided by any of the embodiments of the present application.

[0126] Embodiment five

[0127] The embodiment five of the present application also provides a computer readable storage medium, which stores a computer program, and the program is executed by a processor to implement the identity card number desensitization method provided by the embodiments of the present application, which includes:

[0128] Obtain a to-be-desensitized ID number and a current timestamp;

[0129] Obtain a to-be-desensitized ID number and a current timestamp;

[0130] According to the digital coding meaning in the ID number, determine the to-be-desensitized region code, to-be-desensitized birthday code and sequence code in the to-be-desensitized ID number, desensitize the to-be-desensitized region code to obtain a desensitized region code, desensitize the to-be-desensitized birthday code to obtain a desensitized birthday code, and determine a check code based on the desensitized region code, the desensitized birthday code and the sequence code;

[0131] Obtain a to-be-desensitized ID number and a current timestamp;

[0132] Of course, the computer readable storage medium provided by the embodiment of the application, the computer program stored thereon is not limited to the method operation as above, and can also perform the related operation of the ID number desensitization method provided by any embodiment of the application.

[0133] The computer storage medium of the embodiment of the application can adopt any combination of one or more computer readable media. The computer readable medium can be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium may, for example, be but is not limited to an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination of the above. More specific examples (non-exhaustive list) of the computer readable storage medium include an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, the computer readable storage medium can be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, device or component.

[0134] The computer readable signal medium can include a data signal propagated in a baseband or as a part of a carrier wave, in which computer readable program codes are carried. Such a propagated data signal can take various forms, including but not limited to an electromagnetic signal, an optical signal or any suitable combination of the above. The computer readable signal medium can also be any computer readable medium other than the computer readable storage medium, which can send, propagate or transmit a program for use by or in connection with an instruction execution system, device or component.

[0135] The program code embodied on the computer readable media can be transmitted using any appropriate medium, including but not limited to wireless, wire line, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0136] Computer program code for carrying out operations of the present application can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can 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 the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).

[0137] Note that the foregoing are merely preferred embodiments of the present application and the principles of the technology applied. Those skilled in the art will understand that the present application is not limited to the specific embodiments described herein, and that various obvious changes, reconfigurations and substitutions can be made by those skilled in the art without departing from the scope of the present application. Therefore, although the present application has been described in detail through the above embodiments, the present application is not limited to the above embodiments, and can include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the appended claims.

Claims

1. A method for desensitizing ID card numbers, characterized in that, include: Obtain the ID number to be anonymized and the current timestamp; Take the remainder of each digit in the ID number to be de-identified with the corresponding digit in the current timestamp to obtain the remainder ID number; Based on the meaning of the numerical codes in the ID card number, determine the region code, birthdate code, and sequence code in the ID card number to be anonymized; anonymize the region code to be anonymized to obtain the anonymized region code; anonymize the birthdate code to be anonymized to obtain the anonymized birthdate code; and determine the check code based on the anonymized region code, the anonymized birthdate code, and the sequence code. The de-identified region code, the de-identified birthdate code, the sequence code, and the check code are concatenated sequentially to obtain the de-identified ID number; The step of desensitizing the region code to obtain the desensitized region code includes: Calculate the distance between the region code to be desensitized and each standard region code; A standard region code is selected as the de-identified region code based on the distance between the region code to be de-identified and each standard region code; The process of desensitizing the birthday code to be desensitized to obtain the desensitized birthday code includes: Determine the year code, month code, and day code in the birthday code to be de-identified; The desensitized month code is obtained by taking the remainder of the year code to be desensitized with respect to the number of months. Determine the number of days corresponding to the de-identified monthly code; The desensitized date code is obtained by taking the remainder of the number of days. The desensitized birthday code is obtained by concatenating the year code, the desensitized month code, and the desensitized day code in sequence.

2. The method according to claim 1, characterized in that, The step of selecting a standard region code as the de-identified region code based on the distance between the region code to be de-identified and each standard region code includes: The standard region code with the smallest distance from the region code to be desensitized is used as the desensitized region code.

3. The method according to claim 1, characterized in that, The process of determining the checksum based on the desensitized region code, the desensitized birthdate code, and the sequence code includes: A partial ID number is obtained by sequentially concatenating the desensitized region code, the desensitized birthdate code, and the sequence code. The median value is obtained by weighted summing of the digits of the aforementioned partial ID numbers; The intermediate value is modulo a set value, and the check code is determined based on the modulo result.

4. A device for desensitizing ID card numbers, characterized in that, include: The de-identification parameter acquisition module is used to obtain the ID number to be de-identified and the current timestamp; The ID number remainder module is used to take the remainder of each digit in the ID number to be de-identified with the corresponding digit in the current timestamp to obtain the remainder ID number. The number rationalization processing module is used to determine the region code to be desensitized, the birthdate code to be desensitized, and the sequence code in the remainder ID number according to the meaning of the numerical code in the ID number; to desensitize the region code to be desensitized to obtain the desensitized region code; to desensitize the birthdate code to be desensitized to obtain the desensitized birthdate code; and to determine the check code based on the desensitized region code, the desensitized birthdate code, and the sequence code. The de-identified ID number module is used to sequentially concatenate the de-identified region code, the de-identified birthdate code, the sequence code, and the check code to obtain the de-identified ID number. The number rationalization processing module is specifically used to calculate the distance between the region code to be desensitized and each standard region code; A standard region code is selected as the de-identified region code based on the distance between the region code to be de-identified and each standard region code; The number rationalization processing module is specifically used to determine the year code, month code, and day code in the birthday code to be desensitized. The desensitized month code is obtained by taking the remainder of the year code to be desensitized with respect to the number of months. Determine the number of days corresponding to the de-identified monthly code; take the remainder of the day code to be de-identified divided by the number of days to obtain the de-identified day code; The desensitized birthday code is obtained by concatenating the year code, the desensitized month code, and the desensitized day code in sequence.

5. A computer device, characterized in that, The device includes: One or more processors; Storage device for storing one or more programs; When one or more programs are executed by one or more processors, the one or more processors implement the ID number desensitization method as described in any one of claims 1-3.

6. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the ID number desensitization method as described in any one of claims 1-3.

Citation Information

Patent Citations

  • An integrated data desensitization system and method for an identity card number

    CN109726585A

  • Identity card number desensitization method capable of reserving statistical-level characteristic attributes

    CN112182654A