Data processing methods, apparatus, equipment and storage media

By using bitwise storage and obfuscation desensitization methods, the problem of large encrypted data volume was solved, and efficient transmission and storage of sensitive data were achieved.

CN114840861BActive Publication Date: 2026-03-06QINGDAO HAIER TECH +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210393480.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-15
Publication Date
2026-03-06
Estimated Expiration
2042-04-15

AI Technical Summary

Technical Problem

In existing technologies, the amount of encrypted data generated by symmetric encryption algorithms is relatively large, which is not conducive to transmission and storage.

Method used

The method employs bitwise storage and obfuscation desensitization, which involves storing the binary data of sensitive data bitwise into an initial bit array, performing obfuscation according to preset obfuscation rules, and then performing desensitization according to preset desensitization rules to generate an encrypted string.

Benefits of technology

While ensuring the protection of sensitive data, the amount of encrypted data has been reduced, and the efficiency of transmission and storage has been improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114840861B_ABST
    Figure CN114840861B_ABST
Patent Text Reader

Abstract

This application discloses a data processing method, apparatus, device, and storage medium, relating to the field of computer technology. The data processing method includes: in response to the presence of sensitive data of a numeric type in the data to be processed, obtaining binary data corresponding to the sensitive data; storing the binary data bit by bit in an initial bit array to obtain a first bit array; obfuscating the first bit array according to a preset obfuscation rule to obtain a second bit array; desensitizing the second bit array to obtain an encrypted string corresponding to the sensitive data; and replacing the sensitive data in the data to be processed with the encrypted string. This application, while ensuring the protection of sensitive data, can reduce the amount of encrypted data, making it more convenient for transmission and storage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and more specifically, to a data processing method, apparatus, device, and storage medium. Background Technology

[0002] Software systems typically generate sensitive data during operation. This sensitive data includes numeric data, such as phone numbers or identity documents (IDs). Due to privacy protection requirements for numeric sensitive data, data processing is necessary.

[0003] Currently, symmetric encryption algorithms are commonly used to de-identify sensitive numeric data. However, the encrypted data generated by symmetric encryption algorithms is large in size, which is not conducive to transmission and storage. Summary of the Invention

[0004] In order to solve the above-mentioned problems in the prior art, namely to reduce the amount of encrypted data after de-identification processing, this application provides a data processing method, apparatus, device and storage medium.

[0005] Firstly, this application provides a data processing method, including:

[0006] In response to the presence of sensitive data of numeric type in the data to be processed, obtain the binary data corresponding to the sensitive data;

[0007] The binary data is stored bit by bit into the initial bit array to obtain the first bit array. The length of the first bit array is the maximum bit length of the data type of the sensitive data.

[0008] The first array is obfuscated according to the preset obfuscation rules to obtain the second array;

[0009] The second array is desensitized according to the preset desensitization rules to obtain the encrypted string corresponding to the sensitive data;

[0010] Replace sensitive data in the data to be processed with encrypted strings.

[0011] In one possible implementation, the second array is desensitized according to a preset desensitization rule to obtain the encrypted string corresponding to the sensitive data. This includes: shifting the second array to obtain the corresponding target index; and obtaining the encrypted string corresponding to the sensitive data based on the target index and the correspondence between the index and the character.

[0012] In one possible implementation, the second bit array is shifted to obtain the corresponding target index, including: performing bitwise operations on a preset number of array elements starting from the beginning position of the second bit array to obtain the corresponding target index; shifting the second bit array by a first preset number of bits to obtain the shifted second bit array; using the shifted second bit array as the new second bit array, performing bitwise operations on a preset number of array elements starting from the beginning position of the second bit array to obtain the corresponding target index, until a preset number of shifts is reached, where the preset number of shifts is determined based on the data type of the sensitive data and the first preset number of bits.

[0013] In one possible implementation, the encrypted string corresponding to the sensitive data is obtained based on the target index and the correspondence between the index and the character. This includes: querying the correspondence based on the target index to obtain the corresponding target character; and concatenating each target character in the order they were obtained to obtain the encrypted string.

[0014] In one possible implementation, the data processing method further includes: if the starting position of the encrypted string contains at least one 0 character, then delete at least one 0 character to obtain the encrypted string after deletion.

[0015] Secondly, this application provides a data processing method, including:

[0016] In response to the presence of a string to be decrypted in the data to be processed, the target index corresponding to each character in the string to be decrypted is obtained based on the correspondence between the index and the character.

[0017] The target index is shifted to obtain the corresponding target binary data;

[0018] The target binary data is stored in the third-bit array, and the length of the third-bit array is the maximum bit length of the data type of the target value after the string to be decrypted is decrypted.

[0019] The third array is deobfuscated according to the preset deobfuscation rules to obtain the fourth array.

[0020] Perform bitwise operations on the fourth array to obtain the target value corresponding to the string to be decrypted;

[0021] Replace the string to be decrypted in the data to be processed with the target value.

[0022] In one possible implementation, the target index is shifted to obtain the corresponding target binary data, including: converting the target index into binary data of a second preset number of bits; shifting the binary data of the second preset number of bits according to a preset shifting rule to obtain the shifted binary data; and adding the shifted binary data to obtain the target binary data.

[0023] In one possible implementation, before obtaining the target index corresponding to each character in the string to be decrypted based on the correspondence between the index and the character, the data processing method further includes: if the length of the string to be decrypted is less than the preset length, then padding the high bits of the string to be decrypted with 0 to obtain the string to be decrypted of the preset length.

[0024] Thirdly, this application provides a data processing apparatus, comprising:

[0025] The acquisition module is used to acquire the binary data corresponding to the sensitive data when the data to be processed contains sensitive data of numeric type.

[0026] The storage module is used to store binary data bit by bit into an initial bit array to obtain the first bit array. The length of the first bit array is the maximum bit length of the data type of the sensitive data.

[0027] The first processing module is used to obfuscate the first array according to a preset obfuscation rule to obtain the second array;

[0028] The second processing module is used to desensitize the second array according to the preset desensitization rules to obtain the encrypted string corresponding to the sensitive data;

[0029] The replacement module is used to replace sensitive data in the data to be processed with encrypted strings.

[0030] In one possible implementation, the second processing module is specifically used to: perform shift processing on the second bit array to obtain the corresponding target index; and obtain the encrypted string corresponding to the sensitive data based on the target index and the correspondence between the index and the character.

[0031] In one possible implementation, when the second processing module performs bitwise operations on the second bit array to obtain the corresponding target index, it specifically performs the following: performs bitwise operations on a preset number of array elements starting from the beginning position of the second bit array to obtain the corresponding target index; shifts the second bit array by a first preset number of bits to obtain the shifted second bit array; uses the shifted second bit array as a new second bit array, and performs bitwise operations on a preset number of array elements starting from the beginning position of the second bit array to obtain the corresponding target index, until a preset number of shifts is reached. The preset number of shifts is determined based on the data type of the sensitive data and the first preset number of bits.

[0032] In one possible implementation, when the second processing module obtains the encrypted string corresponding to the sensitive data based on the target index and the correspondence between the index and the character, it specifically performs the following steps: querying the correspondence based on the target index to obtain the corresponding target character; and concatenating each target character in the order they were obtained to obtain the encrypted string.

[0033] In one possible implementation, the second processing module is further configured to: if the starting position of the encrypted string contains at least one 0 character, then delete at least one 0 character to obtain the encrypted string after deletion.

[0034] Fourthly, this application provides a data processing apparatus, comprising:

[0035] The first acquisition module is used to obtain the target index corresponding to each character in the string to be decrypted based on the correspondence between the index and the character when the data to be processed contains a string to be decrypted.

[0036] The second acquisition module is used to perform offset processing on the target index to obtain the corresponding target binary data;

[0037] The storage module is used to store the target binary data into a third-bit array. The length of the third-bit array is the maximum bit length of the data type of the target value corresponding to the decrypted string.

[0038] The first processing module is used to deobfuscate the third array according to the preset deobfuscation rules to obtain the fourth array;

[0039] The second processing module is used to perform bitwise operations on the fourth array to obtain the target value corresponding to the string to be decrypted.

[0040] The replacement module is used to replace the string to be decrypted in the data to be processed with the target value.

[0041] In one possible implementation, the second acquisition module is specifically used to: convert the target index into binary data of a second preset number of bits; perform displacement processing on the binary data of the second preset number of bits according to a preset displacement rule to obtain the displacement-processed binary data; and add the displacement-processed binary data together to obtain the target binary data.

[0042] In one possible implementation, before the first acquisition module obtains the target index corresponding to each character in the string to be decrypted based on the correspondence between the index and the character, it is also used to: if the length of the string to be decrypted is less than the preset length, pad the high bits of the string to be decrypted with 0 to obtain the string to be decrypted of the preset length.

[0043] Fifthly, this application provides a computer-readable storage medium including a stored program, wherein the program executes the data processing method as described in the first aspect of this application when it runs.

[0044] In a sixth aspect, this application provides a computer-readable storage medium comprising a stored program, wherein the program, when executed, performs the data processing method as described in the second aspect of this application.

[0045] In a seventh aspect, this application provides an electronic device including a memory and a processor, wherein the memory stores a computer program and the processor is configured to execute the data processing method as described in the first aspect of this application through the computer program.

[0046] Eighthly, this application provides an electronic device including a memory and a processor, wherein the memory stores a computer program and the processor is configured to execute the data processing method as described in the second aspect of this application through the computer program.

[0047] Ninthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the data processing method as described in the first aspect of this application.

[0048] In a tenth aspect, this application provides a computer program product, including a computer program that, when executed by a processor, implements the data processing method as described in the second aspect of this application.

[0049] The data processing method, apparatus, device, and storage medium provided in this application, in response to sensitive data of numeric type contained in the data to be processed, obtains the binary data corresponding to the sensitive data; stores the binary data bit by bit into an initial bit array to obtain a first bit array; obfuscates the first bit array according to a preset obfuscation rule to obtain a second bit array; desensitizes the second bit array to obtain an encrypted string corresponding to the sensitive data; and replaces the sensitive data in the data to be processed with the encrypted string. Because this application obfuscates the binary data corresponding to the sensitive data according to a preset obfuscation rule and desensitizes it according to a preset desensitization rule to obtain the encrypted string corresponding to the sensitive data, it can reduce the amount of encrypted data while ensuring the protection of sensitive data, thus facilitating transmission and storage. Attached Figure Description

[0050] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0051] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0052] Figure 1 This is a schematic diagram illustrating an application scenario provided in one embodiment of this application;

[0053] Figure 2 A flowchart illustrating a data processing method provided in an embodiment of this application;

[0054] Figure 3 A flowchart illustrating a data processing method provided in another embodiment of this application;

[0055] Figure 4 A flowchart illustrating a data processing method provided in yet another embodiment of this application;

[0056] Figure 5 A flowchart illustrating a data processing method provided in yet another embodiment of this application;

[0057] Figure 6 A flowchart for processing long integer data provided in an embodiment of this application;

[0058] Figure 7 A flowchart for processing long integer data is provided as another embodiment of this application;

[0059] Figure 8 This application provides a signaling interaction diagram for data processing based on a business scenario, as an embodiment of the present application.

[0060] Figure 9 A flowchart for processing integer data is provided as an embodiment of this application;

[0061] Figure 10 A flowchart for processing integer data is provided as another embodiment of this application;

[0062] Figure 11 A signaling interaction diagram for data processing based on a business scenario is provided as another embodiment of this application;

[0063] Figure 12 This is a schematic diagram of the structure of a data processing apparatus provided in an embodiment of this application;

[0064] Figure 13 This is a schematic diagram of the structure of a data processing apparatus provided in another embodiment of this application;

[0065] Figure 14This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0066] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0067] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0068] The collection, storage, use, processing, transmission, provision, and disclosure of financial data or user data involved in the technical solution of this application all comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0069] First, the technical terms used in this application will be explained:

[0070] Bitwise AND (&): This operation performs a bitwise AND operation on two operands. If both operands have a corresponding bit of 1, the result of the bitwise AND is 1. If at least one of the corresponding bits of the two operands is not 1, the result of the bitwise AND is 0. For example, if 00001001 is bitwise ANDed with 1, the operation and result are: 00001001&1=00001001&00000001=00000001, where 00000001 corresponds to the decimal value 1.

[0071] Bitwise right shift (>>): This operation shifts each bit of a number to the right by a specified number of bits, as specified by the right operand. The least significant bits shifted to the right are discarded, and the most significant bits are filled with 0. For example, shifting 00000101 to the right by 1 bit results in the following operation and result: 00000101>>1=00000010, where 00000010 corresponds to the decimal value 2.

[0072] Bitwise left shift (<<): This shifts each bit of a number to the left by a specified number of bits, as specified by the right operand (which must be non-negative). The higher bits shifted to the left are discarded, and the lower bits are filled with 0. For example, shifting 00000101 to the left by 1 bit results in the operation and result of: 00000101<<1=00001010, where 00001010 corresponds to the decimal value 10.

[0073] In addition, the basic rules of byte operations in the field of computer technology involved in this application are explained:

[0074] 1 byte = 8 bits; 1 integer = 4 bytes = 32 bits; 1 long integer = 8 bytes = 64 bits.

[0075] Currently, symmetric encryption algorithms are commonly used to de-identify sensitive numeric data. Specifically, the Base64 algorithm is used for symmetric encryption of sensitive numeric data to achieve this de-identification. Base64 is a method that uses 64 printable characters to represent binary data. It requires converting every three 8-bit bytes into four 6-bit bytes (3*8 = 4*6 = 24), then adding two high-order zeros to each 6-bit byte to form four 8-bit bytes. The length of the string obtained after symmetric encryption using Base64 increases by one-third. Therefore, the encrypted data generated by symmetric encryption algorithms is relatively large, which is inconvenient for transmission and storage.

[0076] To address the aforementioned issues, this application provides a data processing method, apparatus, device, and storage medium. Based on computer byte principles and the number of bits in numerical data types, it performs obfuscation and desensitization processing on sensitive numerical data to obtain encrypted data corresponding to the sensitive data. The length of this encrypted data is shorter than the length of the sensitive data. Therefore, while ensuring the protection of sensitive data, the amount of encrypted data can be reduced, making it easier to transmit and store.

[0077] The following section provides examples illustrating the application scenarios of the solution provided in this application.

[0078] Figure 1This is a schematic diagram illustrating an application scenario provided by an embodiment of this application. For example... Figure 1 As shown, in this application scenario, server 102 receives data to be processed from client 101. This data contains sensitive numeric data. Server 102 performs obfuscation and desensitization processing on the sensitive data to obtain an encrypted string corresponding to the sensitive data. The server then replaces the sensitive data in the data to be processed with the encrypted string to obtain the replaced data. This replaced data is then sent to client 101 so that client 101 can use the replaced data. The specific implementation process of server 102 performing obfuscation and desensitization processing to obtain the encrypted string corresponding to the sensitive data can be found in the solutions of the following embodiments.

[0079] It should be noted that, Figure 1 This is merely a schematic diagram illustrating one application scenario provided by an embodiment of this application. This embodiment does not necessarily represent... Figure 1 The included equipment is not limited, nor is it restricted. Figure 1 The positional relationships between devices are defined. For example, in Figure 1 The application scenario shown may also include a data storage device, which may be an external storage device relative to the client 101 or the server 102, or an internal storage device integrated into the client 101 or the server 102.

[0080] Next, the data processing method will be described through specific embodiments.

[0081] Figure 2 This is a flowchart illustrating a data processing method provided in one embodiment of this application. The method described in this embodiment can be applied to an electronic device, which may be a server or a server cluster, etc. Figure 2 As shown, the method in this application embodiment includes:

[0082] S201. In response to the presence of sensitive data of numeric type in the data to be processed, obtain the binary data corresponding to the sensitive data.

[0083] In this embodiment, the data to be processed can be input by a user to an electronic device executing this method embodiment, or it can be sent by another device to the electronic device executing this method embodiment. Numeric sensitive data includes, for example, mobile phone numbers or IDs consisting of the 10 digits from 0 to 9. In this step, in response to the presence of numeric sensitive data in the data to be processed, the corresponding binary data can be obtained. For example, if the numeric sensitive data in the data to be processed is, for example, a mobile phone number, such as 13888888888, then its binary representation is 1100111011110101111010000000111000, thus obtaining the binary data corresponding to the sensitive data.

[0084] S202. Store the binary data bit by bit into the initial bit array to obtain the first bit array.

[0085] The length of the first array is the maximum bit length of the data type of the sensitive data.

[0086] In this step, the data type of the sensitive data can be, for example, int or long, and this application does not make specific restrictions on this. In one example, if the data type of the sensitive data is int, an initial bit array can be created based on the maximum bit length of the data type being 32. This initial bit array is represented by int X

[32] . After obtaining the binary data corresponding to the sensitive data through step S201, the high bits of the binary data can be padded with 0 to reach the maximum length of the initial bit array being 32. Then, the padded binary data is stored in the initial bit array in order from low bit to high bit to obtain the first bit array. In another example, if the data type of the sensitive data is long, an initial bit array can be created based on the maximum bit length of the data type being 64. This initial bit array is represented by int Y

[64] . After obtaining the binary data corresponding to the sensitive data through step S201, the high bits of the binary data can be padded with 0 to reach the maximum length of the initial bit array being 64. Then, the padded binary data is stored in the initial bit array in order from low bit to high bit to obtain the first bit array.

[0087] S203. Obfuscate the first array according to the preset obfuscation rules to obtain the second array.

[0088] In this step, the preset obfuscation rule may be to swap the low and high bits of the binary data stored in the first array. This application does not specify the exact obfuscation rule. After obtaining the first array, it can be obfuscated according to the preset obfuscation rule to obtain the second array.

[0089] S204. Desensitize the second array according to the preset desensitization rules to obtain the encrypted string corresponding to the sensitive data.

[0090] In this step, after obtaining the second bit array, it can be desensitized according to a preset desensitization rule to obtain the encrypted string corresponding to the sensitive data. For example, the preset desensitization rule could be to perform bitwise operations on the second bit array, generating a new number every 6 bits. Then, using the newly generated number as an index, the corresponding character is searched in a preset character code table. Each obtained character is concatenated to form a completely new string, thus obtaining the encrypted string corresponding to the sensitive data. It can be understood that the length of the string obtained through the preset desensitization rule is less than the length of the sensitive data. For details on how to desensitize the second bit array to obtain the encrypted string corresponding to the sensitive data, please refer to subsequent embodiments; they will not be elaborated here.

[0091] S205. Replace the sensitive data in the data to be processed with an encrypted string.

[0092] In this step, after obtaining the encrypted string corresponding to the network sensitive data, the sensitive data in the data to be processed can be replaced with the encrypted string. For example, an electronic device executing this method embodiment replaces the sensitive data in the data to be processed with the encrypted string, obtains the replaced data, and sends the replaced data to the client so that the client can use the replaced data.

[0093] The data processing method provided in this application embodiment obtains the binary data corresponding to the sensitive data in response to the presence of sensitive data of numeric type in the data to be processed; stores the binary data bit by bit in an initial bit array to obtain the first bit array; obfuscates the first bit array according to a preset obfuscation rule to obtain the second bit array; desensitizes the second bit array to obtain the encrypted string corresponding to the sensitive data; and replaces the sensitive data in the data to be processed with the encrypted string. Because this application embodiment obfuscates the binary data corresponding to the sensitive data according to a preset obfuscation rule and desensitizes it according to a preset desensitization rule to obtain the encrypted string corresponding to the sensitive data, it can reduce the amount of encrypted data while ensuring the protection of sensitive data, making it more convenient for transmission and storage.

[0094] Figure 3 A flowchart illustrating a data processing method provided in another embodiment of this application. Figure 2 Based on the embodiments shown, this application further explains how to perform data processing. For example... Figure 3 As shown, the method in this application embodiment may include:

[0095] S301. In response to the presence of sensitive data of numeric type in the data to be processed, obtain the binary data corresponding to the sensitive data.

[0096] For a detailed description of this step, please refer to [link / reference]. Figure 2 The relevant description of S201 in the illustrated embodiment will not be repeated here.

[0097] S302. Store the binary data bit by bit into the initial bit array to obtain the first bit array.

[0098] The length of the first array is the maximum bit length of the data type of the sensitive data.

[0099] For a detailed description of this step, please refer to [link / reference]. Figure 2 The relevant description of S202 in the illustrated embodiment will not be repeated here.

[0100] S303. Obfuscate the first array according to the preset obfuscation rules to obtain the second array.

[0101] For a detailed description of this step, please refer to [link / reference]. Figure 2 The relevant description of S203 in the illustrated embodiment will not be repeated here.

[0102] In the embodiments of this application, Figure 2 Step S204 can further include the following two steps, S304 and S305:

[0103] S304. Perform shifting operations on the second array to obtain the corresponding target index.

[0104] In summary, after obtaining the second array, this step involves shifting the second array to obtain the corresponding target index.

[0105] Further, optionally, the second bit array is shifted to obtain the corresponding target index, which may include: performing bitwise operations on a preset number of array elements starting from the beginning position of the second bit array to obtain the corresponding target index; shifting the second bit array by a first preset number of bits to obtain the shifted second bit array; using the shifted second bit array as the new second bit array, performing bitwise operations on a preset number of array elements starting from the beginning position of the second bit array to obtain the corresponding target index, until a preset number of shifts is reached, the preset number of shifts being determined based on the data type of the sensitive data and the first preset number of bits.

[0106] For example, the preset quantity is 6; the first preset number of bits is 6 bits. Since 2 to the power of 6 is 64, by shifting the second bit array by 6 bits each time, the decimal value between 0 and 63 corresponding to the shifted 6 bits can be obtained. The preset number of shifts is determined based on the data type of the sensitive data and the first preset number of bits. For example, if the data type of the sensitive data is int, the maximum bit length of int is 32, and the first preset number of bits is 6, then the preset number of shifts is 5; if the data type of the sensitive data is long, the maximum bit length of long is 64, and the first preset number of bits is 6, then the preset number of shifts is 10. Taking the sensitive data data type as int as an example, the maximum length of the second array is 32. All elements stored in the second array are represented as [00000000000100101101011010000111], totaling 32 elements. Starting from the beginning of the second array, for example, the first element is 0, the second element is 0, and so on, with the 30th element being 1, the 31st element being 1, and the 32nd element (the last element) being 1. Since the second array stores elements in order from least significant bit to most significant bit, the corresponding binary data can be obtained as: 11100001011010110100100000000000, meaning the binary data is represented from most significant bit to least significant bit from left to right. The corresponding decimal value of this binary data is 3781904384. Perform a bitwise AND operation between 3781904384 and 63 to obtain the lower 6 bits of the binary data 11100001011010110100100000000000, which is equivalent to obtaining the first 6 elements of the second bit array. The specific bitwise operation process is as follows:

[0107] 3781904384&63=1110000101101011010010000000000&0000000000000000000000000111111=0000000000000000000000000000000000000000000

[0108] The corresponding result is the decimal value 0, which means the target index is 0.

[0109] Shift the binary data corresponding to the second bit array to the right by 6 bits to obtain the shifted binary data, which is the second bit array after the shift. The specific bitwise operation process is as follows:

[0110] 3781904384>>6

[0111] =11100001011010110100100000000000>>6

[0112] =00000011100001011010110100100000

[0113] The result obtained is the decimal value 59092256.

[0114] The second bit array after shifting is used as the new second bit array. Bitwise operations are performed on a preset number of array elements starting from the beginning position in the second bit array to obtain the corresponding target index, until the preset number of shifts is reached. For example, referring to the processing steps of 3781904384, 59092256 is bitwise ANDed with 63, and the corresponding result is the decimal value 32, which is the target index 32. This process is repeated, generating a number between 0 and 63 every 6 bits, until the preset number of shifts of 5 is reached. The target indices obtained are 0, 32, 52, 26, 33, and 3, respectively.

[0115] S305. Based on the target index and the correspondence between the index and the character, obtain the encrypted string corresponding to the sensitive data.

[0116] For example, Table 1 is a character code table storing the correspondence between indexes and characters, such as... Figure 1 As shown, index 0 corresponds to the character 0, and index 32 corresponds to the character w.

[0117] Table 1 Character Code Table

[0118]

[0119]

[0120] In this step, after obtaining the target index, the encrypted string corresponding to the sensitive data can be obtained based on the target index and the correspondence between the index and the characters.

[0121] Further, optionally, obtaining the encrypted string corresponding to the sensitive data based on the target index and the correspondence between the index and the character may include: querying the correspondence between the index and the character based on the target index to obtain the corresponding target character; concatenating each target character in the order they were obtained to obtain the encrypted string.

[0122] For example, referring to Table 1, based on the target indices 0, 32, 52, 26, 33, and 3 obtained in step S304, querying Table 1 yields the corresponding target characters: 0, w, Q, q, x, and 3. Concatenating each target character in the order they were obtained yields the encrypted string.

[0123] Optionally, if the starting position of the encrypted string contains at least one 0 character, then at least one 0 character is deleted to obtain the encrypted string after deletion.

[0124] For example, based on the target characters obtained as 0, w, Q, q, x and 3, the resulting encrypted string is 0wQqx3. The starting position (also known as the high bit) of this encrypted string contains a character 0. Therefore, by deleting the character 0, the encrypted string after deletion is obtained as wQqx3.

[0125] S306. Replace sensitive data in the data to be processed with encrypted strings.

[0126] For a detailed description of this step, please refer to [link / reference]. Figure 2 The relevant description of S205 in the illustrated embodiment will not be repeated here.

[0127] The data processing method provided in this application involves obtaining binary data corresponding to the sensitive data in response to the presence of numeric sensitive data in the data to be processed; storing the binary data bit by bit in an initial bit array to obtain a first bit array; obfuscating the first bit array according to a preset obfuscation rule to obtain a second bit array; shifting the second bit array to obtain a corresponding target index; obtaining an encrypted string corresponding to the sensitive data based on the target index and the correspondence between the index and characters; and replacing the sensitive data in the data to be processed with the encrypted string. Because this application obfuscates the binary data corresponding to the sensitive data according to a preset obfuscation rule and shifts the obtained second bit array to obtain a corresponding target index, and then queries the correspondence between the index and characters based on the target index to obtain the encrypted string corresponding to the sensitive data, it can reduce the amount of encrypted data while ensuring the protection of sensitive data, making it easier to transmit and store.

[0128] Based on the above embodiments, and considering the decryption processing of encrypted strings corresponding to sensitive data, Figure 4 This is a flowchart illustrating a data processing method provided in another embodiment of this application. The method described in this embodiment can be applied to an electronic device, which may be a server or a server cluster, etc. Figure 4 As shown, the method in this application embodiment includes:

[0129] S401. In response to the fact that the data to be processed contains a string to be decrypted, obtain the target index corresponding to each character in the string to be decrypted based on the correspondence between the index and the character.

[0130] In this embodiment of the application, for example, the string to be decrypted contained in the data to be processed is, for example, Figure 3In the example shown, the encrypted string is wQqx3, which is also the string to be decrypted. In this step, the index corresponding to each character in the string to be decrypted can be looked up to obtain the target index for each character.

[0131] Optionally, before obtaining the target index corresponding to each character in the string to be decrypted based on the correspondence between the index and the character, the data processing method may further include: if the length of the string to be decrypted is less than the preset length, then pad the high bits of the string to be decrypted with 0 to obtain the string to be decrypted of the preset length.

[0132] For example, the preset length is determined based on the maximum bit length of the data type of the target value corresponding to the decrypted string. For instance, if the data type of the target value corresponding to the decrypted string is int, and the maximum bit length of int is 32, then based on the first preset bit length of 6 bits, the length of the decrypted string can be determined to be 6. Similarly, if the data type of the target value corresponding to the decrypted string is long, and the maximum bit length of long is 64, then based on the first preset bit length of 6 bits, the length of the decrypted string can be determined to be 11. Assuming the decrypted string is, for example, wQqx3, based on the above embodiment, the data type of the target value corresponding to wQqx3 after decryption is int, so the length of the decrypted string can be determined to be 6. Therefore, the high bits of wQqx3 are padded with 0s to obtain a decrypted string of length 6, 0wQqx3. Based on the correspondence between the index and the character in Table 1, each character in the decrypted string 0wQqx3 can be looked up in Table 1 to obtain the target index corresponding to each character in the decrypted string, namely 0, 32, 52, 26, 33, and 3.

[0133] S402. Perform offset processing on the target index to obtain the corresponding target binary data.

[0134] In this step, after obtaining the target index, the target index can be shifted to obtain the corresponding target binary data. For details on how to perform the shifting operation on the target index to obtain the corresponding target binary number, please refer to subsequent embodiments; these will not be elaborated upon here.

[0135] S403. Store the target binary data in the third-bit array.

[0136] The length of the third array is the maximum bit length of the data type of the target value corresponding to the decrypted string.

[0137] In this step, after obtaining the target binary data, it can be arrayed from the least significant bit to the third bit. Specifically, if the data type of the target value corresponding to the decrypted string is int, the length of the third array is 32; if the data type of the target value corresponding to the decrypted string is long, the length of the third array is 64.

[0138] S404. Deobfuscate the third array according to the preset deobfuscation rules to obtain the fourth array.

[0139] For example, the preset deobfuscation rule is the rule corresponding to the preset obfuscation rule mentioned above. Therefore, after obtaining the third array, the third array can be deobfuscated according to the preset deobfuscation rule to obtain the fourth array.

[0140] S405. Perform bitwise operations on the fourth array to obtain the target value corresponding to the string to be decrypted.

[0141] In this step, after obtaining the fourth-bit array, the corresponding binary data can be obtained based on all the elements stored in the fourth-bit array. The elements in the fourth-bit array are stored in order from the least significant bit to the most significant bit. Then, the binary data is converted into a decimal value, which is the target value corresponding to the string to be decrypted.

[0142] S406. Replace the string to be decrypted in the data to be processed with the target value.

[0143] After obtaining the target value, the string to be decrypted in the data to be processed can be replaced with the target value. For example, an electronic device executing this method embodiment replaces the string to be decrypted in the data to be processed with the target value, obtains the replaced data, and sends the replaced data to the client so that the client can use the replaced data.

[0144] The data processing method provided in this application embodiment, based on the above-described data processing method for obtaining encrypted strings corresponding to sensitive data, performs corresponding decryption processing on the encrypted strings, thus enabling accurate decryption of the encrypted strings.

[0145] Figure 5 A flowchart illustrating a data processing method provided in yet another embodiment of this application. Figure 4 Based on the embodiments shown, this application further explains how to perform data processing. For example... Figure 5 As shown, the method in this application embodiment may include:

[0146] S501. In response to the fact that the data to be processed contains a string to be decrypted, obtain the target index corresponding to each character in the string to be decrypted based on the correspondence between the index and the character.

[0147] For a detailed description of this step, please refer to [link / reference]. Figure 4 The relevant description of S401 in the illustrated embodiment will not be repeated here.

[0148] In the embodiments of this application, Figure 4 Step S402 can further include the following three steps: S502 to S504:

[0149] S502, Convert the target index into binary data of the second preset bit length.

[0150] S503. The binary data of the second preset number of bits is shifted according to the preset shifting rules to obtain the shifted binary data.

[0151] S504. Add the binary data after displacement processing to obtain the target binary data.

[0152] For example, the second preset number of bits is 6 bits, the same as the first preset number of bits mentioned above. Assuming that the target indices corresponding to each character in the string to be decrypted are 0, 32, 52, 26, 33, and 3 respectively, converting the target indices into the corresponding binary data of the second preset number of bits yields 000000, 100000, 110100, 011010, 1000001, and 000011 respectively. The binary data of the second preset number of bits is then shifted according to a preset shifting rule. The specific bitwise operation process is as follows:

[0153] (1) 000000<<0, the result is 000000;

[0154] (2) 100000<<6, the result is 100000000000;

[0155] (3) 110100<<12, the result is 110100000000000000;

[0156] (4) 011010<<18, the result is 011010000000000000000000;

[0157] (5) 100001<<24, the result is 1000010000000000000000000000000;

[0158] (6) 000011<<30, the result is 000011000000 000000000000000000000000. Since the data type of the target value corresponding to the decrypted string is int, and the maximum bit length of int is 32, the lower 32 bits of the result are obtained, namely 11000000 00000000000000000000000000.

[0159] Adding the results obtained from (1) to (6) together, we can obtain the target binary data as 11100001011010110100100000000000, which corresponds to the decimal value 3781904384.

[0160] S505. Store the target binary data in the third-bit array.

[0161] The length of the third array is the maximum bit length of the data type of the target value corresponding to the decrypted string.

[0162] For a detailed description of this step, please refer to [link / reference]. Figure 4 The relevant description of S403 in the illustrated embodiment will not be repeated here.

[0163] S506. Deobfuscate the third array according to the preset deobfuscation rules to obtain the fourth array.

[0164] For a detailed description of this step, please refer to [link / reference]. Figure 4 The relevant description of S404 in the illustrated embodiment will not be repeated here.

[0165] S507. Perform bitwise operations on the fourth array to obtain the target value corresponding to the string to be decrypted.

[0166] For a detailed description of this step, please refer to [link / reference]. Figure 4 The relevant description of S405 in the illustrated embodiment will not be repeated here.

[0167] S508. Replace the string to be decrypted in the data to be processed with the target value.

[0168] For a detailed description of this step, please refer to [link / reference]. Figure 4 The relevant description of S406 in the illustrated embodiment will not be repeated here.

[0169] The data processing method provided in this application embodiment, based on the above-described data processing method for obtaining encrypted strings corresponding to sensitive data, performs corresponding decryption processing on the encrypted strings, thus enabling accurate decryption of the encrypted strings.

[0170] Based on the above embodiments, Figure 6 A flowchart for processing long integer data provided in one embodiment of this application is shown below. Figure 6 As shown, taking the sensitive data as a long integer such as the mobile phone number 13888888888 as an example, based on the above... Figure 2 and Figure 3 The data processing method shown here is for processing long integer data and may include the following steps:

[0171] S601. Obtain the binary data corresponding to the mobile phone number 13888888888, and pad the high bits with 0 to obtain binary data of length 64.

[0172] S602. Store the binary data sequentially from the least significant bit to the most significant bit into an initial bit array of length 64 to obtain the first bit array.

[0173] S603. Obfuscate the first array according to the preset obfuscation rules to obtain the second array. Based on all the elements stored in the second array, the corresponding binary data can be obtained, and then the decimal value corresponding to the binary data is obtained as 2019279341292093440.

[0174] S604. Perform a preset number of displacement operations on 2019279341292093440 to obtain the corresponding target index; based on the target index and the correspondence between the index and the character, obtain the encrypted string corresponding to the sensitive data as 00000PZW5M1.

[0175] S605. Delete the 0 character from the high-order part of the encrypted string to obtain the encrypted string PZW5M1 after deletion.

[0176] for Figure 6 For example, the data processing process can be represented by the following function expression:

[0177] data=F(x)=F(13888888888)="PZW5M1"

[0178] The function takes the sensitive data 13888888888 as input and outputs the encrypted string PZW5M1 as output.

[0179] based on Figure 6 For example, data processing can also be performed on a portion of the sensitive data 13888888888, such as extracting four digits 8888 for processing. The corresponding function expression would be:

[0180] data = F(x) = F(8888) = "4R1"

[0181] based on Figure 6 The obtained encrypted string is PZW5M1. Figure 7 A flowchart for processing long integer data is provided as another embodiment of this application, such as... Figure 7 As shown, based on the above Figure 4 and Figure 5 The data processing method shown here processes the encrypted string PZW5M1 and may include the following steps:

[0182] S701. Pad the high bits of the encrypted string PZW5M1 with 0 to obtain the decryptable string 00000PZW5M1 with a length of 11.

[0183] S702. Based on the correspondence between index and character, obtain the target index corresponding to each character in the string to be decrypted; perform shift processing on the target index to obtain the corresponding target binary data, which corresponds to the decimal value 2019279341292093440.

[0184] S703. Store the target binary data into the third-bit array;

[0185] S704. Deobfuscate the third array according to the preset deobfuscation rules to obtain the fourth array;

[0186] S705. Perform bitwise operations on the fourth array to obtain the target value corresponding to the string to be decrypted, which is 13888888888.

[0187] for Figure 7 For example, the data processing process can be represented by the following function expression:

[0188] uid=F(x)=F("PZW5M1")=13888888888

[0189] The function takes the encrypted string PZW5M1 as input and outputs the sensitive data 13888888888 as output.

[0190] Based on the above embodiments, if the encrypted string is 4R1, then the corresponding function expression is:

[0191] uid = F(x) = F("4R1") = 8888

[0192] In one business scenario example, a learning platform system may have functions for reading and exporting user mobile phone numbers. To prevent user information leakage, sensitive information such as mobile phone numbers needs to be anonymized. Figure 8 A signaling interaction diagram for data processing based on a business scenario, as provided in one embodiment of this application, is shown below. Figure 8As shown, based on Figure 6 For example, processing mobile phone numbers may include the following steps:

[0193] S801. The administrator sends a request message to the server to view user information through the client; accordingly, the server receives the request message.

[0194] S802. The server reads user information, which includes the user's mobile phone number 13888888888. The server processes the user's mobile phone number 13888888888 to obtain the corresponding encrypted string PZW5M1. Alternatively, the server processes a portion of the data in the user's mobile phone number 13888888888 to obtain the corresponding encrypted string 4R1, thus obtaining the encrypted user's mobile phone number as 1384R18888. The server replaces the user's mobile phone number in the user information with the encrypted string PZW5M1 or with 1384R18888.

[0195] S803: The server sends the processed user information to the client; correspondingly, the client receives the processed user information.

[0196] S804: The client displays the processed user information; the administrator reads the processed user information through the client.

[0197] Because user information has undergone data processing, it can protect user privacy.

[0198] Figure 9 A flowchart for processing integer data is provided as an embodiment of this application, such as... Figure 9 As shown, taking the sensitive data 12345678 as an example, based on the above... Figure 2 and Figure 3 The data processing method shown here processes integer data and may include the following steps:

[0199] S901. Obtain the binary data corresponding to the sensitive data 12345678, and perform high-bit padding with 0 to obtain binary data of length 32.

[0200] S902. Store the binary data sequentially from the least significant bit to the most significant bit into an initial bit array of length 32 to obtain the first bit array.

[0201] S903. Obfuscate the first array according to the preset obfuscation rules to obtain the second array. Based on all the elements stored in the second array, the corresponding binary data can be obtained, and then the decimal value corresponding to the binary data is obtained as 3781904384.

[0202] S904. Perform a preset number of displacement operations on 3781904384 to obtain the corresponding target index; based on the target index and the correspondence between the index and the character, obtain the encrypted string corresponding to the sensitive data as 0wQqx3.

[0203] S905. Delete the 0 character from the high-order part of the encrypted string to obtain the encrypted string wQqx3 after deletion.

[0204] based on Figure 9 The obtained encrypted string is wQqx3. Figure 10 A flowchart for data processing of integer data is provided as another embodiment of this application, such as... Figure 10 As shown, based on the above Figure 4 and Figure 5 The data processing method shown here processes the encrypted string wQqx3 and may include the following steps:

[0205] S1001. Pad the high bits of the encrypted string wQqx3 with 0 to obtain the decryptable string 0wQqx3 with a length of 6.

[0206] S1002. Based on the correspondence between index and character, obtain the target index corresponding to each character in the string to be decrypted; perform shift processing on the target index to obtain the corresponding target binary data, which corresponds to the decimal value 3781904384.

[0207] S1003. Store the target binary data in the third-bit array.

[0208] S1004. Deobfuscate the third array according to the preset deobfuscation rules to obtain the fourth array.

[0209] S1005. Perform bitwise operations on the fourth array to obtain the target value corresponding to the string to be decrypted, which is 1234567.

[0210] In another business scenario example, such as a learning platform system where user IDs use an auto-incrementing primary key pattern, and in some other scenarios, such as retrieving or querying information about a user's associated courses or learning map, it is necessary to use the user ID for retrieval or querying. Therefore, data processing of user IDs is required. Figure 11 A signaling interaction diagram for data processing based on a business scenario, as provided in another embodiment of this application, is shown below. Figure 11 As shown, based on the above embodiments, data processing of user IDs may include the following steps:

[0211] S1101, The administrator sends a request message to the server to view the user list information through the client; accordingly, the server receives the request message.

[0212] S1102. The server reads the user list information, which includes user ID 12345678; the server processes user ID 12345678 to obtain the corresponding encrypted string wQqx3; the server replaces the user ID in the user list information with the encrypted string wQqx3.

[0213] S1103. The server sends the processed user list information to the client; correspondingly, the client receives the processed user list information.

[0214] S1104. The client displays the user list information after data processing; the administrator reads the user list information after data processing through the client.

[0215] S1105. The administrator sends a request message to the server to view the user's course list information through the client. The request message to view the user's course list information carries the encrypted user ID wQqx3; accordingly, the server receives the request message.

[0216] S1106. The server obtains the encrypted user ID, wQqx3, carried in the request message, processes wQqx3 to obtain the decrypted user ID, 12345678; the server performs data retrieval based on user ID 12345678 to obtain the corresponding user course list information.

[0217] S1107. The server sends the user's course list information to the client; correspondingly, the client receives the user's course list information.

[0218] S1108: The client displays the user's course list information; the administrator can view the user's course list information through the client.

[0219] The data processing method provided in this application obtains an encrypted string corresponding to sensitive data that is shorter than the length of the sensitive data. For example, a 64-bit value is converted into an encrypted string with a maximum length of 11 bits. Therefore, it is more conducive to transmission and storage, as well as user operation. At the same time, based on preset obfuscation rules and the correspondence between indexes and characters, the encrypted string corresponding to the sensitive data is obtained, which can effectively ensure the security of the sensitive data.

[0220] Figure 12 This is a schematic diagram of the structure of a data processing apparatus provided in one embodiment of this application. Figure 12As shown, the data processing apparatus 1200 of this application embodiment includes: an acquisition module 1201, a storage module 1202, a first processing module 1203, a second processing module 1204, and a replacement module 1205. Wherein:

[0221] The acquisition module 1201 is used to acquire the binary data corresponding to the sensitive data in response to the data to be processed containing sensitive data of numeric type.

[0222] Storage module 1202 is used to store binary data bit by bit into an initial bit array to obtain the first bit array. The length of the first bit array is the maximum bit length of the data type of the sensitive data.

[0223] The first processing module 1203 is used to obfuscate the first array according to a preset obfuscation rule to obtain the second array.

[0224] The second processing module 1204 is used to perform desensitization processing on the second array according to the preset desensitization rules to obtain the encrypted string corresponding to the sensitive data.

[0225] Replacement module 1205 is used to replace sensitive data in the data to be processed with encrypted strings.

[0226] In some embodiments, the second processing module 1204 may be specifically used to: perform shift processing on the second bit array to obtain the corresponding target index; and obtain the encrypted string corresponding to the sensitive data based on the target index and the correspondence between the index and the character.

[0227] In some embodiments, when the second processing module 1204 performs bitwise operations on the second bit array to obtain the corresponding target index, it may specifically perform the following: perform bitwise operations on a preset number of array elements starting from the beginning position of the second bit array to obtain the corresponding target index; shift the second bit array by a first preset number of bits to obtain the shifted second bit array; use the shifted second bit array as a new second bit array, and perform bitwise operations on a preset number of array elements starting from the beginning position of the second bit array to obtain the corresponding target index, until a preset number of shifts is reached, wherein the preset number of shifts is determined based on the data type of the sensitive data and the first preset number of bits.

[0228] In some embodiments, when the second processing module 1204 obtains the encrypted string corresponding to the sensitive data based on the target index and the correspondence between the index and the character, it may specifically be used to: query the correspondence based on the target index to obtain the corresponding target character; and concatenate each target character in the order in which they are obtained to obtain the encrypted string.

[0229] In some embodiments, the second processing module 1204 can also be used to: if the starting position of the encrypted string contains at least one character 0, then delete at least one character 0 to obtain the encrypted string after deletion.

[0230] The apparatus in this embodiment can be used to execute the technical solution of obtaining the encrypted string corresponding to sensitive data in any of the above-described method embodiments. Its implementation principle and technical effect are similar, and will not be described again here.

[0231] Figure 13 This is a schematic diagram of the structure of a data processing apparatus provided in another embodiment of this application. (See attached diagram.) Figure 13 As shown, the data processing apparatus 1300 of this application embodiment includes: a first acquisition module 1301, a second acquisition module 1302, a storage module 1303, a first processing module 1304, a second processing module 1305, and a replacement module 1306. Wherein:

[0232] The first acquisition module 1301 is used to obtain the target index corresponding to each character in the string to be decrypted based on the correspondence between the index and the character in response to the data to be processed containing a string to be decrypted.

[0233] The second acquisition module 1302 is used to perform displacement processing on the target index to obtain the corresponding target binary data.

[0234] Storage module 1303 is used to store the target binary data into a third-bit array. The length of the third-bit array is the maximum bit length of the data type of the target value corresponding to the decrypted string.

[0235] The first processing module 1304 is used to deobfuscate the third array according to the preset deobfuscation rules to obtain the fourth array.

[0236] The second processing module 1305 is used to perform bitwise operations on the fourth array to obtain the target value corresponding to the string to be decrypted.

[0237] Replacement module 1306 is used to replace the string to be decrypted in the data to be processed with the target value.

[0238] In some embodiments, the second acquisition module 1302 may be specifically used to: convert the target index into binary data of a second preset number of bits; perform displacement processing on the binary data of the second preset number of bits according to a preset displacement rule to obtain the displacement-processed binary data; and add the displacement-processed binary data to obtain the target binary data.

[0239] In some embodiments, before obtaining the target index corresponding to each character in the string to be decrypted based on the correspondence between the index and the character, the first acquisition module 1301 may also be used to: if the length of the string to be decrypted is less than a preset length, pad the high bits of the string to be decrypted with 0 to obtain a string to be decrypted of a preset length.

[0240] The apparatus of this embodiment can be used to execute the technical solution of decrypting encrypted strings in any of the above-described method embodiments. Its implementation principle and technical effect are similar, and will not be described again here.

[0241] Figure 14 This is a schematic diagram of the structure of an electronic device provided according to an embodiment of this application. Exemplarily, the electronic device may be provided as a server or a computer. (Refer to...) Figure 14 The electronic device 1400 includes a processing component 1401, which further includes one or more processors, and memory resources represented by memory 1402 for storing instructions, such as application programs, that can be executed by the processing component 1401. The application programs stored in memory 1402 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 1401 is configured to execute instructions to perform any of the method embodiments described above.

[0242] Electronic device 1400 may also include a power supply component 1403 configured to perform power management of electronic device 1400, a wired or wireless network interface 1404 configured to connect electronic device 1400 to a network, and an input / output (I / O) interface 1405. Electronic device 1400 may operate on an operating system stored in memory 1402, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, or similar.

[0243] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above-described data processing method.

[0244] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described data processing method.

[0245] The aforementioned computer-readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.

[0246] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an application-specific integrated circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in a data processing device.

[0247] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0248] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A data processing method, characterized by, The method comprises the following steps: In response to the sensitive data of a digital type contained in the to-be-processed data, binary data corresponding to the sensitive data is obtained; The binary data is stored in the initial bit array by bit to obtain a first bit array, and the length of the first bit array is the maximum bit length of the data type of the sensitive data; the data type is int or long, the int corresponds to the maximum bit length of 32 bits, and the long corresponds to the maximum bit length of 64 bits; The first bit array is subjected to an obfuscation process according to a preset obfuscation rule to obtain a second bit array; wherein the preset obfuscation rule is to perform an interchanging process on the low bits and the high bits of the binary data stored in the first bit array; The second bit array is subjected to a desensitization process according to a preset desensitization rule to obtain an encrypted string corresponding to the sensitive data; The sensitive data in the to-be-processed data is replaced with the encrypted string; The method according to the preset desensitization rule to the second bit array for desensitization processing to obtain the encrypted string corresponding to the sensitive data, comprising: The second bit array is subjected to a bit shift process to obtain a corresponding target index; According to the target index and the corresponding relationship between the index and the character, the encrypted string corresponding to the sensitive data is obtained.

2. The data processing method according to claim 1, characterized in that, The method according to the preset desensitization rule to the second bit array for desensitization processing to obtain the encrypted string corresponding to the sensitive data, comprising: The second bit array is subjected to a bit shift process to obtain a corresponding target index; According to the target index and the corresponding relationship between the index and the character, the encrypted string corresponding to the sensitive data is obtained. The method according to the preset desensitization rule to the second bit array for desensitization processing to obtain the encrypted string corresponding to the sensitive data, comprising:

3. The data processing method of claim 1, wherein, According to the target index, the corresponding relationship is queried to obtain a corresponding target character; The encrypted string is obtained by splicing each target character in the order obtained. Further comprising:

4. The data processing method according to claim 3, characterized in that, If the starting position of the encrypted string contains at least one character 0, the at least one character 0 is deleted to obtain an encrypted string after deletion processing. The method comprises the following steps:

5. A data processing method, characterized by, In response to the sensitive data of a digital type contained in the to-be-processed data, binary data corresponding to the sensitive data is obtained; The binary data is stored in the initial bit array by bit to obtain a first bit array, and the length of the first bit array is the maximum bit length of the data type of the sensitive data; the data type is int or long, the int corresponds to the maximum bit length of 32 bits, and the long corresponds to the maximum bit length of 64 bits; The first bit array is subjected to an obfuscation process according to a preset obfuscation rule to obtain a second bit array; wherein the preset obfuscation rule is to perform an interchanging process on the low bits and the high bits of the binary data stored in the first bit array; The second bit array is subjected to a desensitization process according to a preset desensitization rule to obtain an encrypted string corresponding to the sensitive data; The sensitive data in the to-be-processed data is replaced with the encrypted string; The method according to the preset desensitization rule to the second bit array for desensitization processing to obtain the encrypted string corresponding to the sensitive data, comprising: The second bit array is subjected to a bit shift process to obtain a corresponding target index; According to the target index and the corresponding relationship between the index and the character, the encrypted string corresponding to the sensitive data is obtained. The method according to the preset desensitization rule to the second bit array for desensitization processing to obtain the encrypted string corresponding to the sensitive data, comprising: The second bit array is subjected to a bit shift process to obtain a corresponding target index; According to the target index and the corresponding relationship between the index and the character, the encrypted string corresponding to the sensitive data is obtained. The method according to the preset desensitization rule to the second bit array for desensitization processing to obtain the encrypted string corresponding to the sensitive data, comprising: According to the target index, the corresponding relationship is queried to obtain a corresponding target character; The encrypted string is obtained by splicing each target character in the order obtained. Further comprising: If the starting position of the encrypted string contains at least one character 0, the at least one character 0 is deleted to obtain an encrypted string after deletion processing. The method comprises the following steps: In response to the sensitive data of a digital type contained in the to-be-processed data, binary data corresponding to the sensitive data is obtained; The binary data is stored in the initial bit array by bit to obtain a first bit array, and the length of the first bit array is the maximum bit length of the data type of the sensitive data; the data type is int or long, the int corresponds to the maximum bit length of 32 bits, and the long corresponds to the maximum bit length of 64 bits; The first bit array is subjected to an obfuscation process according to a preset obfuscation rule to obtain a second bit array; wherein the preset obfuscation rule is to perform an interchanging process on the low bits and the high bits of the binary data stored in the first bit array; The second bit array is subjected to a desensitization process according to a preset desensitization rule to obtain an encrypted string corresponding to the sensitive data; The sensitive data in the to-be-processed data is replaced with the encrypted string; According to a preset anti-obfuscation rule, the third bit array is subjected to anti-obfuscation processing, and a fourth bit array is obtained; wherein the preset anti-obfuscation rule is a rule corresponding to a preset obfuscation rule, and the preset anti-obfuscation rule is a rule of transposing the low bits and the high bits of the binary data stored in the third bit array; The fourth bit array is subjected to bit operation, and a target value corresponding to the to-be-decrypted string is obtained; The to-be-decrypted string in the to-be-processed data is replaced by the target value.

6. The data processing method according to claim 5, characterized in that, The target index is subjected to bit shift processing to obtain corresponding target binary data, including: The target index is converted into binary data of a second preset bit number; The binary data of the second preset bit number is subjected to bit shift processing according to a preset bit shift rule, and binary data subjected to bit shift processing is obtained; The binary data subjected to bit shift processing is added to obtain the target binary data.

7. The data processing method according to claim 5 or 6, characterized in that, Before the target index corresponding to each character in the to-be-decrypted string is obtained based on the correspondence between the index and the character, the following further includes: If the length of the to-be-decrypted string is less than a preset length, the high bits of the to-be-decrypted string are subjected to 0 padding processing to obtain a to-be-decrypted string of the preset length.

8. A data processing apparatus, characterized by, Including: The acquisition module is configured to, in response to the to-be-processed data containing sensitive data of a number type, acquire binary data corresponding to the sensitive data; The storage module is configured to store the binary data in the initial bit array bit by bit to obtain a first bit array, wherein the length of the first bit array is the maximum bit length of the data type of the sensitive data; the data type is an int type or a long type, the int type corresponds to a maximum bit length of 32 bits, and the long type corresponds to a maximum bit length of 64 bits; The first processing module is configured to perform obfuscation processing on the first bit array according to a preset obfuscation rule to obtain a second bit array; wherein the preset obfuscation rule is a rule of transposing the low bits and the high bits of the binary data stored in the first bit array; The second processing module is configured to perform desensitization processing on the second bit array according to a preset desensitization rule to obtain an encrypted string corresponding to the sensitive data; The replacement module is configured to replace the sensitive data in the to-be-processed data with the encrypted string; The second processing module is specifically configured to perform bit shift processing on the second bit array to obtain a target index; and obtain the encrypted string corresponding to the sensitive data according to the target index and the correspondence between the index and the character.

9. A data processing apparatus, characterized by, Including: The first acquisition module is configured to, in response to the to-be-processed data containing a to-be-decrypted string, obtain a target index corresponding to each character in the to-be-decrypted string based on the correspondence between the index and the character; The second acquisition module is configured to perform bit shift processing on the target index to obtain corresponding target binary data; The storage module is configured to store the target binary data into a third bit array, the length of the third bit array being a maximum bit length of a data type of a target value corresponding to the to-be-decrypted string after decryption; the data type is an int type or a long type, the int type corresponding to a maximum bit length of 32 bits, and the long type corresponding to a maximum bit length of 64 bits; The first processing module is configured to perform anti-obfuscation processing on the third bit array according to a preset anti-obfuscation rule to obtain a fourth bit array; the preset anti-obfuscation rule is a rule corresponding to a preset obfuscation rule, and the preset anti-obfuscation rule is a rule of performing a low-to-high bit switching on the binary data stored in the third bit array; The second processing module is configured to perform a bit operation on the fourth bit array to obtain the target value corresponding to the to-be-decrypted string. The replacement module is configured to replace the to-be-decrypted string in the to-be-processed data with the target value.

10. A computer readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, and the program performs the data processing method in any one of claims 1 to 7 when running.

11. An electronic device, comprising: The computer program is executed by the processor to implement the data processing method in any one of claims 1 to 7.

12. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the data processing method in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Encoding method, decoding method, related devices and computer equipment

    CN110768785A

  • Data protection method, device, equipment, and medium

    WO2022042103A1