Data desensitization method, device, computer equipment and storage medium
By flexibly adjusting the data desensitization strategy according to the data length and configuration parameters, the problem of poor versatility in the existing technology is solved, data desensitization processing in a variety of scenarios is realized, the scope of application is expanded, and the efficiency is improved.
Patent Information
- Application Number
- CN202311243197.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-21
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2043-09-21
AI Technical Summary
In the existing technology, the data desensitization method uses a single rule, which results in poor versatility and difficulty in adapting to the data processing needs in multiple scenarios, limiting the scope of application.
By determining the data length of the data to be desensitized, and determining the data range of plain text and encrypted display according to the length parameters configured on different data terminals, the desensitization strategy can be flexibly adjusted to adapt to different data lengths and types to achieve adaptive desensitization of various data. sensitive treatment.
It improves the versatility and application scope of data desensitization, and can effectively process various data to be desensitized in different scenarios without requiring a lot of development work or access to third-party products, improving development efficiency.
Smart Images

Figure CN117332432B
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a data desensitization method, apparatus, computer equipment and storage medium. Background Art
[0002] At present, many systems will desensitize sensitive data for data security. After data desensitization, the displayed data is no longer displayed in full plain text, but at least part of each data is encrypted, thus protecting the security of users' sensitive data.
[0003] In traditional methods, a default single rule is generally used to desensitize data. However, the scenarios are diverse. Using a single rule to process data will make it difficult to achieve a good desensitization effect for data in many scenarios, resulting in a limited scope of application and poor versatility. Summary of the invention
[0004] Based on this, it is necessary to provide a data desensitization method, device, computer equipment, computer-readable storage medium and computer program product that can improve versatility in response to the above-mentioned technical problems.
[0005] In a first aspect, the present application provides a data desensitization method, comprising:
[0006] Determine the length of the data to be desensitized;
[0007] Obtaining a first length parameter configured for the first data end and a second length parameter configured for the second data end;
[0008] determining a length threshold according to the first length parameter and the second length parameter;
[0009] In the case where the data length is greater than the length threshold, determining first data that meets the first length parameter from the first data end of the data to be desensitized, and determining second data that meets the second length parameter from the second data end of the data to be desensitized; displaying the first data and the second data in plain text, and displaying the remaining data in the data to be desensitized except the first data and the second data in encrypted form;
[0010] When the data length is less than or equal to the length threshold, the target end is determined from the first data end and the second data end, and the third data that meets the target length is determined from the target end of the data to be desensitized; the third data is displayed in plain text, and the remaining data in the data to be desensitized except the third data is displayed in encrypted form.
[0011] In one of the embodiments, when the data length is less than or equal to the length threshold, determining the target end from the first data end and the second data end includes:
[0012] When the data length is less than or equal to the length threshold, obtaining a data end indication parameter for indicating a target end to be displayed in plain text;
[0013] A target end to be displayed in plain text is determined from the first data end and the second data end according to the data end indication parameter.
[0014] In one of the embodiments, before determining the third data that meets the target length from the target end of the data to be desensitized, the method further includes:
[0015] Compare the data length with the length parameter corresponding to the target end to obtain a comparison result; the length parameter is the first length parameter or the second length parameter;
[0016] According to the comparison result, the target length is determined.
[0017] In one embodiment, determining the target length according to the comparison result includes:
[0018] In a case where the data length is greater than a length parameter corresponding to the target end, the length parameter corresponding to the target end is determined as the target length.
[0019] In one embodiment, determining the target length according to the comparison result includes:
[0020] When the data length is less than or equal to the length parameter corresponding to the target end, the preset length is determined as the target length.
[0021] In one embodiment, obtaining a first length parameter configured for the first data end and a second length parameter configured for the second data end includes:
[0022] Identify the data type of the data to be desensitized;
[0023] According to the correspondence between the preset data types and parameter combinations, a target parameter combination corresponding to the data type is determined; the target parameter combination includes the first length parameter and the second length parameter.
[0024] In one embodiment, the method further comprises:
[0025] Displaying a desensitization parameter setting page; the desensitization parameter setting page includes a first length parameter setting entry for the first data end and a second length parameter setting entry for the second data end corresponding to each data type;
[0026] Obtaining the input first length parameter and second length parameter through the first length parameter setting entry and the second length parameter setting entry;
[0027] The correspondence between the first length parameter and the second length parameter and the corresponding data type is stored.
[0028] In a second aspect, the present application also provides a data desensitization device, comprising:
[0029] A data length determination module is used to determine the data length of the data to be desensitized;
[0030] A parameter acquisition module, used to acquire a first length parameter configured for the first data end and a second length parameter configured for the second data end;
[0031] a length threshold determination module, configured to determine a length threshold according to the first length parameter and the second length parameter;
[0032] A data desensitization module, used for, when the data length is greater than the length threshold, determining first data that meets the first length parameter from the first data end of the data to be desensitized, and determining second data that meets the second length parameter from the second data end of the data to be desensitized; displaying the first data and the second data in plain text, and displaying the remaining data in the data to be desensitized except the first data and the second data in encrypted form;
[0033] The data desensitizing module is also used to determine the target end from the first data end and the second data end when the data length is less than or equal to the length threshold, and determine the third data that meets the target length from the target end of the data to be desensitized; display the third data in plain text, and display the remaining data in the data to be desensitized except the third data in encrypted form.
[0034] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0035] Determine the length of the data to be desensitized;
[0036] Obtaining a first length parameter configured for the first data end and a second length parameter configured for the second data end;
[0037] determining a length threshold according to the first length parameter and the second length parameter;
[0038] In the case where the data length is greater than the length threshold, determining first data that meets the first length parameter from the first data end of the data to be desensitized, and determining second data that meets the second length parameter from the second data end of the data to be desensitized; displaying the first data and the second data in plain text, and displaying the remaining data in the data to be desensitized except the first data and the second data in encrypted form;
[0039] When the data length is less than or equal to the length threshold, the target end is determined from the first data end and the second data end, and the third data that meets the target length is determined from the target end of the data to be desensitized; the third data is displayed in plain text, and the remaining data in the data to be desensitized except the third data is displayed in encrypted form.
[0040] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0041] Determine the length of the data to be desensitized;
[0042] Obtaining a first length parameter configured for the first data end and a second length parameter configured for the second data end;
[0043] determining a length threshold according to the first length parameter and the second length parameter;
[0044] In the case where the data length is greater than the length threshold, determining first data that meets the first length parameter from the first data end of the data to be desensitized, and determining second data that meets the second length parameter from the second data end of the data to be desensitized; displaying the first data and the second data in plain text, and displaying the remaining data in the data to be desensitized except the first data and the second data in encrypted form;
[0045] When the data length is less than or equal to the length threshold, the target end is determined from the first data end and the second data end, and the third data that meets the target length is determined from the target end of the data to be desensitized; the third data is displayed in plain text, and the remaining data in the data to be desensitized except the third data is displayed in encrypted form.
[0046] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0047] Determine the length of the data to be desensitized;
[0048] Obtaining a first length parameter configured for the first data end and a second length parameter configured for the second data end;
[0049] determining a length threshold according to the first length parameter and the second length parameter;
[0050] In the case where the data length is greater than the length threshold, determining first data that meets the first length parameter from the first data end of the data to be desensitized, and determining second data that meets the second length parameter from the second data end of the data to be desensitized; displaying the first data and the second data in plain text, and displaying the remaining data in the data to be desensitized except the first data and the second data in encrypted form;
[0051] When the data length is less than or equal to the length threshold, the target end is determined from the first data end and the second data end, and the third data that meets the target length is determined from the target end of the data to be desensitized; the third data is displayed in plain text, and the remaining data in the data to be desensitized except the third data is displayed in encrypted form.
[0052] The above-mentioned data desensitization method, device, computer equipment, storage medium and computer program product determine the data length of the data to be desensitized, obtain the first length parameter configured for the first data end and the second length parameter configured for the second data end, determine the length threshold according to the first length parameter and the second length parameter, and when the data length is greater than the length threshold, determine the first data that meets the first length parameter from the first data end of the data to be desensitized for plain text display, and determine the second data that meets the second length parameter from the second data end of the data to be desensitized for plain text display, and encrypt and display the remaining data. When the data length is less than or equal to the length threshold, determine the third data that meets the target length from the target end of the data to be desensitized for plain text display, and encrypt and display the remaining data, so that the desensitization strategy can be flexibly adjusted for data to be desensitized of various data lengths, and various data to be desensitized can be appropriately desensitized. It can be applied to data desensitization in various scenarios, making the application scope wider and improving versatility. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0054] Figure 1 The following is a flow chart of a data desensitization method in one embodiment;
[0055] Figure 2 It is a schematic diagram of the overall process of a data desensitization method in one embodiment;
[0056] Figure 3 is a structural block diagram of a data desensitization device in one embodiment;
[0057] Figure 4 It is a structural block diagram of a data desensitization device in another embodiment;
[0058] Figure 5 is an internal structure diagram of a computer device in one embodiment;
[0059] Figure 6 FIG. 4 is a diagram showing the internal structure of a computer device in another embodiment. DETAILED DESCRIPTION
[0060] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0061] In some embodiments, Figure 1 As shown, a data desensitization method is provided. This embodiment takes the method applied to a computer device as an example. The computer device can be a terminal or a server, or a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. Among them, the terminal can be but is not limited to various personal computers, laptops, smart phones, tablets, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server can be implemented as an independent server or a server cluster composed of multiple servers. In this embodiment, the method includes the following steps:
[0062] Step 102, determine the data length of the data to be desensitized.
[0063] The data length refers to the number of bits of the data to be desensitized.
[0064] In some embodiments, the computer device may determine the data length of each piece of data to be desensitized separately.
[0065] Step 104: Obtain a first length parameter configured for the first data end and a second length parameter configured for the second data end.
[0066] The first data end is one end of the data to be desensitized, and the second data end is the other end of the data to be desensitized. For example, the first data end may be the left end of the data to be desensitized, and the second data end may be the right end of the data to be desensitized. Alternatively, the first data end may be the right end of the data to be desensitized, and the second data end may be the left end of the data to be desensitized.
[0067] The first length parameter is the preset length of the data to be displayed in plain text at the first data end. The second length parameter is the preset length of the data to be displayed in plain text at the second data end.
[0068] For example, if the first length parameter is 3 and the second length parameter is 4, it means that 3 bits of data need to be displayed at the first data end in the data to be desensitized, and 4 bits of data need to be displayed at the second data end in the data to be desensitized.
[0069] In some embodiments, the computer device may obtain in advance through a desensitizing parameter setting page a first length parameter configured for the first data end and a second length parameter configured for the second data end.
[0070] Step 106: Determine a length threshold according to the first length parameter and the second length parameter.
[0071] In some embodiments, the computer device may determine the sum of the length parameters of the first length parameter and the second length parameter as the length threshold. If the first length parameter is 3 and the second length parameter is 4, the sum of the length parameters is 7, and 7 may be used as the length threshold.
[0072] In other embodiments, the computer device may determine the sum of the length parameters of the first length parameter and the second length parameter, and then determine the sum of the length parameters plus the preset offset as the length threshold. For example, if the first length parameter is 3, the second length parameter is 4, and the preset offset is 2, the sum of the length parameters is 7, and the sum of the length parameters plus the preset offset is 9, and 9 can be used as the length threshold.
[0073] Step 108, when the data length is greater than the length threshold, determine the first data that meets the first length parameter from the first data end of the data to be desensitized, and determine the second data that meets the second length parameter from the second data end of the data to be desensitized; display the first data and the second data in plain text, and display the remaining data in the data to be desensitized except the first data and the second data in encrypted form.
[0074] The length of the first data conforms to the length represented by the first length parameter. The length of the second data conforms to the length represented by the second length parameter. Plain text display refers to displaying the data according to the real information. Encrypted display refers to hiding the real information of the data and using encryption symbols to replace the real information for display. For example, the encryption symbol can be an asterisk or other symbols.
[0075] For example: assuming that the data to be desensitized is a mobile phone number with a length of 11 digits, the first length parameter is 3, the second length parameter is 4, and the length threshold is 7, the data length of the data to be desensitized is greater than the length threshold, and the 3 digits on the left and the 4 digits on the right of the mobile phone number can be displayed in plain text, and the remaining digits can be displayed encrypted, for example, as: 188****5678.
[0076] Another example: assuming that the data to be desensitized is a mobile phone number with a length of 11 digits, the first length parameter is 2, the second length parameter is 3, and the length threshold is 5, then the data length of the data to be desensitized is greater than the length threshold. The 2 digits on the left and the 3 digits on the right of the mobile phone number can be displayed in plain text, and the remaining digits can be displayed encrypted, for example, as: 18******678.
[0077] Step 110, when the data length is less than or equal to the length threshold, determine the target end from the first data end and the second data end, and determine the third data that meets the target length from the target end of the data to be desensitized; display the third data in plain text, and encrypt and display the remaining data in the data to be desensitized except the third data.
[0078] The target end is one of the first data end and the second data end.
[0079] For example: assuming that the data to be desensitized is a mobile phone number with a length of 11 digits, the first length parameter is 13, the second length parameter is 4, and the length threshold is 17, then the data length of the data to be desensitized is less than the length threshold. The third data that meets the target length can be determined from the target end of the data to be desensitized for plain text display, and the remaining data in the data to be desensitized except the third data can be encrypted and displayed.
[0080] In some embodiments, the computer device may randomly select one of the first data end and the second data end as the target end. In other embodiments, the computer device may determine a preset target end.
[0081] In some embodiments, the target length may be a length parameter corresponding to the target end. The length parameter is a first length parameter or a second length parameter. For example: Assuming that the data to be desensitized is a mobile phone number with a length of 11 digits, the first length parameter is 3, and the second length parameter is 10. Assuming that the target end is the first data end (left end), the first length parameter corresponding to the first data end is 3, then the 3-digit number on the left end of the data to be desensitized can be displayed in plain text, such as: 188********. Another example: Assuming that the data to be desensitized is a mobile phone number with a length of 11 digits, the first length parameter is 10, and the second length parameter is 3. Assuming that the target end is the second data end (right end), the second length parameter corresponding to the second data end is 3, then the 3-digit number on the right end of the data to be desensitized can be displayed in plain text, such as: *******678.
[0082] In other embodiments, the target length may be a preset length. For example, the preset length may be 1 digit or 2 digits, etc. For example, assuming that the data to be desensitized is a mobile phone number with a length of 11 digits, the first length parameter is 13, the second length parameter is 4, and the preset length is 1. Assuming that the target end is the first data end (left end), the 1-digit number on the left end of the data to be desensitized can be displayed in plain text, such as: 1**********. Another example: Assuming that the data to be desensitized is a mobile phone number with a length of 11 digits, the first length parameter is 3, the second length parameter is 13, and the preset length is 1. Assuming that the target end is the second data end (right end), the 1-digit number on the right end of the data to be desensitized can be displayed in plain text, such as: **********8.
[0083] The above data desensitization method determines the data length of the data to be desensitized, obtains the first length parameter configured for the first data end and the second length parameter configured for the second data end, determines the length threshold according to the first length parameter and the second length parameter, and when the data length is greater than the length threshold, determines the first data that meets the first length parameter from the first data end of the data to be desensitized for plain text display, and determines the second data that meets the second length parameter from the second data end of the data to be desensitized for plain text display, and encrypts the remaining data for display, and when the data length is less than or equal to the length threshold, determines the third data that meets the target length from the target end of the data to be desensitized for plain text display, and encrypts the remaining data for display, so that the desensitization strategy can be flexibly adjusted for desensitized data of various data lengths, and realizes that all kinds of desensitized data can be desensitized appropriately, and can be applied to data desensitization in various scenarios, so that the application scope is wider and the versatility is improved. In addition, through flexible parameter configuration, data desensitization can be efficiently realized without a lot of development work and access to third-party desensitization products, which is convenient for access to existing systems and improves development efficiency.
[0084] In some embodiments, when the data length is less than or equal to a length threshold, determining the target end from the first data end and the second data end includes: when the data length is less than or equal to the length threshold, obtaining a data end indication parameter for indicating the target end that needs to be displayed in plain text; determining the target end that needs to be displayed in plain text from the first data end and the second data end according to the data end indication parameter.
[0085] Among them, the data end indication parameter is used to indicate the target end that needs to be displayed in plain text when the data length is less than or equal to the length threshold.
[0086] In some embodiments, the data end indication parameter may be a first identifier or a second identifier. The first identifier is used to indicate that the first data end is used as the target end. The second identifier is used to indicate that the second data end is used as the target end.
[0087] In some embodiments, the first identifier and the second identifier may be identifiers in any form without limitation. For example, the first identifier is 0 and the second identifier is 1.
[0088] In some embodiments, the computer device can obtain in advance through the desensitizing parameter setting page a first length parameter configured for the first data end and a second length parameter configured for the second data end, as well as a data end indication parameter for indicating the target end that needs to be displayed in plain text.
[0089] In the above embodiment, when the data length is less than or equal to the length threshold, a data end indication parameter for indicating the target end that needs to be displayed in plain text is obtained, and the target end that needs to be displayed in plain text is determined from the first data end and the second data end according to the data end indication parameter. Thus, the target end that needs to be displayed in plain text when the data length is less than or equal to the length threshold can be flexibly set through the data end indication parameter. Thus, the desensitization strategy can be flexibly adjusted for various types of data to be desensitized, thereby achieving appropriate desensitization processing for various data to be desensitized, and can be applied to data desensitization in various scenarios, making the application scope wider and improving the versatility.
[0090] In some embodiments, before determining the third data that meets the target length from the target end of the data to be desensitized, the method also includes: comparing the data length with the length parameter corresponding to the target end to obtain a comparison result; the length parameter is the first length parameter or the second length parameter; and determining the target length based on the comparison result.
[0091] For example: assuming that the data length of the data to be desensitized is 11 bits, the target end is the first data end, that is, the left end of the data to be desensitized, and the length parameter corresponding to the target end (that is, the first length parameter corresponding to the first data end) is 3, then the computer device can compare the data length 11 with the length parameter 3 corresponding to the target end.
[0092] In the above embodiment, the data length is compared with the length parameter corresponding to the target end to obtain a comparison result, and the target length is determined based on the comparison result, which can more flexibly perform appropriate desensitization processing on data of different lengths, thereby improving versatility.
[0093] In some embodiments, the target length is determined based on the comparison result, including: when the data length is greater than the length parameter corresponding to the target end, the length parameter corresponding to the target end is determined as the target length.
[0094] For example: assuming that the data length of the data to be desensitized is 11 bits, the target end is the first data end, that is, the left end of the data to be desensitized, and the length parameter corresponding to the target end (that is, the first length parameter corresponding to the first data end) is 3, then the data length 11 is greater than the length parameter 3 corresponding to the target end, and 3 can be used as the target length, that is, the 3-digit number on the left end of the data to be desensitized is displayed in plain text, and the rest of the data is displayed encrypted, for example, as 188********.
[0095] In the above embodiment, when the data length is less than or equal to the length threshold and greater than the length parameter corresponding to the target end, the length parameter corresponding to the target end is determined as the target length, so that the desensitization processing can be more flexibly performed on data of different lengths, thereby improving versatility.
[0096] In some embodiments, the target length is determined based on the comparison result, including: when the data length is less than or equal to the length parameter corresponding to the target end, a preset length is determined as the target length.
[0097] For example: assuming that the data length of the data to be desensitized is 11 bits, the preset length is 1, the target end is the first data end, that is, the left end of the data to be desensitized, and the length parameter corresponding to the target end (that is, the first length parameter corresponding to the first data end) is 13, then the data length 11 is less than the length parameter 13 corresponding to the target end, and the preset length 1 can be used as the target length, that is, the 1-digit number on the left end of the data to be desensitized is displayed in plain text, and the rest of the data is displayed encrypted, for example, as 1**********.
[0098] In the above embodiment, when the data length is less than or equal to the length threshold and less than or equal to the length parameter corresponding to the target end, the preset length is determined as the target length, so that the data of different lengths can be desensitized more flexibly and the versatility is improved.
[0099] In some embodiments, obtaining a first length parameter configured for a first data end and a second length parameter configured for a second data end includes: identifying the data type of the data to be desensitized; determining a target parameter combination corresponding to the data type based on a correspondence between a pre-set data type and a parameter combination; and the target parameter combination includes a first length parameter and a second length parameter.
[0100] In some embodiments, the data type may include at least one of an ID number, a mobile phone number, a card number, a customer number, an email address, or a customer address.
[0101] In some embodiments, the computer device may pre-store a correspondence between various data types and corresponding parameter combinations, wherein each parameter combination includes a length parameter configured for the first data end and the second data end respectively.
[0102] In some embodiments, the target parameter combination also includes a data end indication parameter. The computer device may pre-store a correspondence between each data type and a corresponding parameter combination. Each parameter combination includes a length parameter configured for the first data end and the second data end, respectively, and a data end indication parameter for indicating the target end to be displayed in plain text.
[0103] For example: assuming that the first length parameter corresponding to the data type of ID card number is 7, the second length parameter is 4, and the data end indication parameter is the first identifier, and the first length parameter corresponding to the data type of mobile phone number is 3, the second length parameter is 4, and the data end indication parameter is the second identifier, then if the computer device recognizes that the data type of the data to be desensitized is the ID card number, it can be determined that the target parameter combination corresponding to the ID card number includes the first length parameter of 7, the second length parameter of 4, and the data end indication parameter of the first identifier, and then the data to be desensitized is desensitized based on the various parameters in the target parameter combination.
[0104] In the above embodiment, the data type of the data to be desensitized is identified, and the target parameter combination corresponding to the data type is determined according to the correspondence between the pre-set data type and the parameter combination, so that different parameter combinations can be flexibly set for the data to be desensitized of different data types, thereby improving versatility. In addition, by simply changing the parameter combination and calling different parameter combinations, the data to be desensitized of different data types can be set without complex development, thereby improving development efficiency.
[0105] In some embodiments, the method also includes: displaying a desensitizing parameter setting page; the desensitizing parameter setting page includes a first length parameter setting entry for the first data end and a second length parameter setting entry for the second data end corresponding to each data type; obtaining the input first length parameter and second length parameter through the first length parameter setting entry and the second length parameter setting entry; storing the correspondence between the first length parameter and the second length parameter and the corresponding data type.
[0106] Among them, the desensitization parameter setting page is a page used to set the first length parameter, the second length parameter and the data end indication parameter.
[0107] In some embodiments, each data type in the desensitization parameter setting page has a corresponding first length parameter setting entry for the first data end and a second length parameter setting entry for the second data end. The computer device can obtain the first length parameter and the second length parameter corresponding to each data type through the first length parameter setting entry and the second length parameter setting entry corresponding to each data type, and then store the corresponding relationship between the first length parameter and the second length parameter and the corresponding data type.
[0108] In other embodiments, the desensitization parameter setting page may include a data type selection entry and a first length parameter setting entry for the first data terminal and a second length parameter setting entry for the second data terminal. The computer device may obtain the input data type through the data type selection entry, and obtain the input first length parameter and second length parameter through the first length parameter setting entry and the second length parameter setting entry, and then store the corresponding relationship between the input data type and the input first length parameter and second length parameter.
[0109] In some embodiments, the desensitizing parameter setting page also includes a data end indication parameter setting entry. The computer device can also obtain the input data end indication parameter through the data end indication parameter setting entry, and store the correspondence between the input data end indication parameter, the first length parameter, the second length parameter and the corresponding data type.
[0110] In the above embodiment, a desensitizing parameter setting page is displayed, and the input first length parameter and second length parameter are obtained through the first length parameter setting entry and the second length parameter setting entry in the page, and the correspondence between the first length parameter and the second length parameter and the corresponding data type is stored, so that parameters can be flexibly set for various data types, thereby improving versatility.
[0111] In some embodiments, the data desensitization methods in the various embodiments of the present application can be integrated into an objective function. When performing data desensitization, the computer device can call the objective function and pass the set first length parameter, second length parameter and data end indication parameter into the objective function, so that the objective function executes the data desensitization methods in the various embodiments of the present application.
[0112] like Figure 2 As shown, it is an overall flow diagram of the data desensitization method in each embodiment of the present application, including the following steps: first, obtain the data to be desensitized, and set the corresponding first length parameter, second length parameter and data end indication parameter for the data type of the data to be desensitized. The data length of the data to be desensitized is compared with the sum of the length parameters (i.e., the sum of the first length parameter and the second length parameter). If the data length is greater than the sum of the length parameters, the left and right ends of the data to be desensitized are displayed in plain text according to the first length parameter and the second length parameter, respectively, and the rest are displayed in encrypted form; if the data length is less than or equal to the sum of the length parameters, the target end indicated by the data end indication parameter is determined, and if the indicated target end is the first data end (left end), the data length is compared with the first length parameter. If the data length is less than or equal to the first length parameter, the data of the preset length of the left end of the data to be desensitized is displayed in plain text, and the rest are displayed in encrypted form; if the data length is greater than the first length parameter, the data of the left end of the data to be desensitized that meets the first length parameter is displayed in plain text, and the rest are displayed in encrypted form. If the indicated target end is the second data end (right end), the data length is compared with the second length parameter. If the data length is less than or equal to the second length parameter, the data of the preset length on the right end of the data to be desensitized is displayed in plain text, and the rest is displayed in encrypted form; if the data length is greater than the second length parameter, the data on the right end of the data to be desensitized that meets the second length parameter is displayed in plain text, and the rest is displayed in encrypted form.
[0113] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0114] Based on the same inventive concept, the embodiment of the present application also provides a data desensitization device for implementing the data desensitization method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more data desensitization device embodiments provided below can refer to the limitations on the data desensitization method above, and will not be repeated here.
[0115] In some embodiments, Figure 3 As shown, a data desensitization device 300 is provided, comprising: a data length determination module 302, a parameter acquisition module 304, a length threshold determination module 306 and a data desensitization module 308, wherein:
[0116] The data length determination module 302 is used to determine the data length of the data to be desensitized.
[0117] The parameter acquisition module 304 is used to acquire a first length parameter configured for the first data end and a second length parameter configured for the second data end.
[0118] The length threshold determination module 306 is configured to determine a length threshold according to the first length parameter and the second length parameter.
[0119] The data desensitization module 308 is used to determine the first data that meets the first length parameter from the first data end of the data to be desensitized, and determine the second data that meets the second length parameter from the second data end of the data to be desensitized when the data length is greater than the length threshold; the first data and the second data are displayed in plain text, and the remaining data in the data to be desensitized except the first data and the second data are displayed in encrypted form.
[0120] The data desensitizing module 308 is also used to determine the target end from the first data end and the second data end when the data length is less than or equal to the length threshold, and determine the third data that meets the target length from the target end of the data to be desensitized; display the third data in plain text, and display the remaining data in the data to be desensitized except the third data in encrypted form.
[0121] In some embodiments, the data desensitization module 308 is also used to obtain a data end indication parameter for indicating the target end that needs to be displayed in plain text when the data length is less than or equal to a length threshold; and determine the target end that needs to be displayed in plain text from the first data end and the second data end according to the data end indication parameter.
[0122] In some embodiments, the data desensitizing module 308 is also used to compare the data length with the length parameter corresponding to the target end to obtain a comparison result; the length parameter is the first length parameter or the second length parameter; and the target length is determined based on the comparison result.
[0123] In some embodiments, the data desensitization module 308 is also used to determine the length parameter corresponding to the target end as the target length when the data length is greater than the length parameter corresponding to the target end.
[0124] In some embodiments, the data desensitization module 308 is also used to determine the preset length as the target length when the data length is less than or equal to the length parameter corresponding to the target end.
[0125] In some embodiments, the parameter acquisition module 304 is also used to identify the data type of the data to be desensitized; determine the target parameter combination corresponding to the data type based on the correspondence between the pre-set data type and parameter combination; the target parameter combination includes a first length parameter and a second length parameter.
[0126] In some embodiments, Figure 4 As shown, the device 300 also includes:
[0127] The page output module 310 is used to display a desensitization parameter setting page; the desensitization parameter setting page includes a first length parameter setting entry for the first data end and a second length parameter setting entry for the second data end corresponding to each data type;
[0128] The parameter configuration module 312 is used to obtain the input first length parameter and second length parameter through the first length parameter setting entry and the second length parameter setting entry; and store the correspondence between the first length parameter and the second length parameter and the corresponding data type.
[0129] The above-mentioned data desensitization device determines the data length of the data to be desensitized, obtains the first length parameter configured for the first data end and the second length parameter configured for the second data end, determines the length threshold according to the first length parameter and the second length parameter, and when the data length is greater than the length threshold, determines from the first data end of the data to be desensitized the first data that meets the first length parameter for plain text display, and determines from the second data end of the data to be desensitized the second data that meets the second length parameter for plain text display, and encrypts and displays the remaining data; when the data length is less than or equal to the length threshold, determines from the target end of the data to be desensitized the third data that meets the target length for plain text display, and encrypts and displays the remaining data, thereby realizing that the desensitization strategy can be flexibly adjusted for data to be desensitized of various data lengths, and can perform corresponding desensitization processing on various data to be desensitized, and can be applied to data desensitization in various scenarios, so that the application range is wider and the versatility is improved.
[0130] Each module in the above-mentioned data desensitization device can be implemented in whole or in part by software, hardware and their combination. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0131] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 5 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data to be desensitized. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a data desensitization method is implemented.
[0132] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 6As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a data desensitization method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0133] Those skilled in the art will understand that Figure 5 or Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0134] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0135] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0136] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0137] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0138] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0139] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0140] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the present application. It should be noted that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A data desensitization method, characterized in that: The method comprises: Determine the length of the data to be desensitized; Identify the data type of the data to be desensitized; determine the target parameter combination corresponding to the data type according to the correspondence between the preset data type and parameter combination; the target parameter combination includes a first length parameter and a second length parameter; determining a length threshold according to the first length parameter and the second length parameter; In the case where the data length is greater than the length threshold, determining first data that meets the first length parameter from the first data end of the data to be desensitized, and determining second data that meets the second length parameter from the second data end of the data to be desensitized; displaying the first data and the second data in plain text, and displaying the remaining data in the data to be desensitized except the first data and the second data in encrypted form; When the data length is less than or equal to the length threshold, obtaining a data end indication parameter for indicating a target end to be displayed in plain text; and determining a target end to be displayed in plain text from the first data end and the second data end according to the data end indication parameter; Compare the data length with the length parameter corresponding to the target end to obtain a comparison result; the length parameter is the first length parameter or the second length parameter; In the case where the data length is greater than the length parameter corresponding to the target end, determining the length parameter corresponding to the target end as the target length; Determine third data that meets the target length from the target end of the data to be desensitized; display the third data in plain text, and encrypt and display the remaining data in the data to be desensitized except the third data.
2. The method according to claim 1, characterized in that The determining the length threshold according to the first length parameter and the second length parameter comprises: determining a sum of the length parameters of the first length parameter and the second length parameter; The sum of the length parameters is added to the preset offset to obtain the length threshold.
3. The method according to claim 1, characterized in that The data type includes at least one of an ID number, a mobile phone number, a card number, a customer number, an email address or a customer address.
4. The method according to claim 1, characterized in that: The method further comprises: When the data length is less than or equal to the length parameter corresponding to the target end, the preset length is determined as the target length.
5. The method according to claim 1, characterized in that The data end indication parameter is a first identifier or a second identifier, the first identifier is used to indicate the first data end as the target end, and the second identifier is used to indicate the second data end as the target end.
6. The method according to claim 1, characterized in that The method further comprises: Displaying a desensitization parameter setting page; the desensitization parameter setting page includes a first length parameter setting entry for the first data end and a second length parameter setting entry for the second data end corresponding to each data type; Obtaining the input first length parameter and second length parameter through the first length parameter setting entry and the second length parameter setting entry; The correspondence between the first length parameter and the second length parameter and the corresponding data type is stored.
7. A data desensitization device, characterized in that: The device comprises: A data length determination module is used to determine the data length of the data to be desensitized; A parameter acquisition module, used to identify the data type of the data to be desensitized; determine the target parameter combination corresponding to the data type according to the correspondence between the preset data type and the parameter combination; the target parameter combination includes a first length parameter and a second length parameter; a length threshold determination module, configured to determine a length threshold according to the first length parameter and the second length parameter; A data desensitization module, used for, when the data length is greater than the length threshold, determining first data that meets the first length parameter from the first data end of the data to be desensitized, and determining second data that meets the second length parameter from the second data end of the data to be desensitized; displaying the first data and the second data in plain text, and displaying the remaining data in the data to be desensitized except the first data and the second data in encrypted form; The data desensitizing module is also used to, when the data length is less than or equal to the length threshold, obtain a data end indication parameter for indicating the target end that needs to be displayed in plain text; determine the target end that needs to be displayed in plain text from the first data end and the second data end according to the data end indication parameter; compare the data length with the length parameter corresponding to the target end to obtain a comparison result; the length parameter is the first length parameter or the second length parameter; when the data length is greater than the length parameter corresponding to the target end, determine the length parameter corresponding to the target end as the target length; determine the third data that meets the target length from the target end of the data to be desensitized; display the third data in plain text, and encrypt and display the remaining data in the data to be desensitized except the third data.
8. The device according to claim 7, characterized in that The data desensitization module is also used to determine the preset length as the target length when the data length is less than or equal to the length parameter corresponding to the target end.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
