A data processing method and related equipment

By performing displacement encryption on the original string and replacing consecutive characters, the problem of length increase after DES encryption is solved, and the storage space saving effect of the encrypted length being consistent with the original length is achieved.

CN113810174BActive Publication Date: 2024-09-03KINGDEE SOFTWARE(CHINA) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111087387.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-16
Publication Date
2024-09-03
Estimated Expiration
2041-09-16

AI Technical Summary

Technical Problem

The existing DES encryption algorithm increases the length of the string during the encryption process, causing the encrypted length to exceed the original length and cannot effectively save storage space.

Method used

By obtaining the original string and the target displacement, encrypt the original characters, and replace consecutive identical characters in the encrypted string with one character and special characters to generate a compressed string, ensuring that the length of the encrypted string does not exceed the original length.

Benefits of technology

The length of the encrypted string is the same as the length of the original string, and the length of the compressed string is less than or equal to the original length, effectively saving storage space.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113810174B
    Figure CN113810174B
Patent Text Reader

Abstract

The embodiment of the present application discloses a data processing method and related equipment for saving storage space. The method of the embodiment of the present application includes: obtaining an original string and a target displacement, the original string including a plurality of original characters arranged in sequence; using the target displacement to encrypt each original character respectively to obtain an encrypted character corresponding to the original character; arranging the plurality of encrypted characters according to the arrangement order of the original characters in the original string to obtain an encrypted string; when there is a segment of characters consisting of a plurality of identical encrypted characters in succession in the encrypted string, replacing the plurality of identical encrypted characters in the same segment with an identical encrypted character and a special character to generate a compressed string, wherein the special character is used to indicate the number of consecutive occurrences of the encrypted character in the same segment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computers, and in particular, to a data processing method and related equipment. Background Art

[0002] Software encryption and decryption is a fascinating research field that can be closely integrated with almost any computer technology - cryptography, programming languages, operating systems, and data structures. The existing commonly used encryption technology is symmetric encryption, which uses symmetric cryptographic coding technology. Its characteristic is that the same key is used for file encryption and decryption, that is, the encryption key can also be used as the decryption key. This method is called a symmetric encryption algorithm in cryptography. Symmetric encryption algorithms are simple and fast to use, with short keys and difficult to decipher. The Data Encryption Standard (DES) is a symmetric encryption technology.

[0003] Now, the string is usually encrypted by DES encryption algorithm, and then compressed by GZip algorithm.

[0004] However, using the DES algorithm for encryption will increase the length of the string. Even if the encryption is followed by compression with the GZip algorithm, the length of the string will exceed the original length. In fact, after encryption and compression, the length of the string increases. Summary of the invention

[0005] An embodiment of the present application provides a data processing method for saving storage space.

[0006] A first aspect of an embodiment of the present application provides a data processing method, including:

[0007] Obtaining an original character string and a target displacement, wherein the original character string includes a plurality of original characters arranged in sequence;

[0008] Encrypt each of the original characters using the target displacement to obtain an encrypted character corresponding to the original character;

[0009] Arrange the plurality of encrypted characters according to the arrangement order of the original characters in the original character string to obtain an encrypted character string;

[0010] When the encrypted character string contains a segment of characters consisting of multiple identical encrypted characters in succession, the multiple identical encrypted characters in the same segment are replaced with one of the identical encrypted characters and a special character to generate a compressed character string, wherein the special character is used to indicate the number of consecutive occurrences of the encrypted character in the same segment.

[0011] Optionally, obtaining the target displacement includes:

[0012] Obtaining a preset displacement, where the preset displacement is an integer;

[0013] Determine whether the absolute value of the preset displacement is greater than 9;

[0014] If yes, determining the target displacement to be the preset displacement;

[0015] If not, the target displacement is determined to be the remainder of dividing the preset displacement by 10.

[0016] Optionally, the using the target displacement to encrypt each of the original characters respectively to obtain an encrypted character corresponding to the original character comprises:

[0017] respectively summing each of the original characters in the original character string consisting of numerical characters with the target displacement to obtain a first transition value;

[0018] Determine whether the absolute value of the first transition value is greater than 9;

[0019] If yes, taking the remainder of 10 for the first transition value whose absolute value is greater than 9 to obtain a second transition value, and determining the second transition value as the encrypted character;

[0020] If not, the first transition value is determined as the encrypted character.

[0021] A second aspect of an embodiment of the present application provides a data processing method, including:

[0022] Get the compressed string;

[0023] When there is a special character in the compressed character string, determining a compressed character corresponding to the special character, wherein the special character is used to represent the number of consecutive occurrences N of the compressed character corresponding to the special character;

[0024] The special characters are replaced with compressed characters corresponding to the special characters in a number N minus 1, to obtain an encrypted string in which a plurality of encrypted characters are arranged in sequence;

[0025] Get the target displacement;

[0026] Decrypt each of the encrypted characters using the target displacement to obtain the original characters corresponding to the encrypted characters;

[0027] Arrange the plurality of original characters according to the arrangement order of the encrypted characters in the encrypted character string to obtain an original character string.

[0028] Optionally, obtaining the target displacement includes:

[0029] Obtaining a preset displacement, where the preset displacement is an integer;

[0030] Determine whether the absolute value of the preset displacement is greater than 9;

[0031] If yes, determining the target displacement as the remainder of dividing the preset displacement by 10;

[0032] If not, the target displacement is determined to be the preset displacement.

[0033] Optionally, the step of using the target displacement to decrypt each of the encrypted characters to obtain an original character corresponding to the encrypted character comprises:

[0034] respectively summing each of the encrypted characters in the encrypted string consisting of numerical characters with the target displacement to obtain a third transition value;

[0035] Determining whether the absolute value of the third transition value is greater than 9;

[0036] If yes, taking the remainder of 10 for the third transition value whose absolute value is greater than 9 to obtain a fourth transition value, and determining the fourth transition value as the original character;

[0037] If not, the third transition value is determined as the original character.

[0038] A third aspect of an embodiment of the present application provides a data processing device, including:

[0039] An acquisition unit, used for acquiring an original character string and a target displacement, wherein the original character string includes a plurality of original characters arranged in sequence;

[0040] An encryption unit, used to encrypt each of the original characters using the target displacement to obtain an encrypted character corresponding to the original character;

[0041] An arranging unit, configured to arrange the plurality of encrypted characters according to the arrangement order of the original characters in the original character string to obtain an encrypted character string;

[0042] The compression unit is used to replace the multiple identical encrypted characters in the same segment with one of the identical encrypted characters and a special character when the encrypted character string contains a segment of characters consisting of multiple identical encrypted characters in succession, so as to generate a compressed character string, wherein the special character is used to indicate the number of consecutive occurrences of the encrypted character in the same segment.

[0043] Optionally, the acquiring unit is specifically used for:

[0044] Obtaining a preset displacement, where the preset displacement is an integer;

[0045] Determine whether the absolute value of the preset displacement is greater than 9;

[0046] If yes, determining the target displacement to be the preset displacement;

[0047] If not, the target displacement is determined to be the remainder of dividing the preset displacement by 10.

[0048] Optionally, the encryption unit is specifically used for:

[0049] respectively summing each of the original characters in the original character string consisting of numerical characters with the target displacement to obtain a first transition value;

[0050] Determine whether the absolute value of the first transition value is greater than 9;

[0051] If yes, taking the remainder of 10 for the first transition value whose absolute value is greater than 9 to obtain a second transition value, and determining the second transition value as the encrypted character;

[0052] If not, the first transition value is determined as the encrypted character.

[0053] A fourth aspect of an embodiment of the present application provides a data processing device, including:

[0054] An acquisition unit, used for acquiring a compressed character string;

[0055] a determination unit, configured to determine, when a special character exists in the compressed character string, a compressed character corresponding to the special character, wherein the special character is used to indicate a number of consecutive occurrences N of the compressed character corresponding to the special character;

[0056] A decompression unit, used for replacing the special characters with N minus 1 number of compressed characters corresponding to the special characters, to obtain an encrypted string in which a plurality of encrypted characters are arranged in sequence;

[0057] The acquisition unit is further used to acquire the target displacement;

[0058] A decryption unit, used to decrypt each of the encrypted characters using the target displacement to obtain an original character corresponding to the encrypted character;

[0059] The arrangement unit is used to arrange the plurality of original characters according to the arrangement order of the encrypted characters in the encrypted character string to obtain the original character string.

[0060] Optionally, the acquiring unit is specifically used for:

[0061] Obtaining a preset displacement, where the preset displacement is an integer;

[0062] Determine whether the absolute value of the preset displacement is greater than 9;

[0063] If yes, determining the target displacement as the remainder of dividing the preset displacement by 10;

[0064] If not, the target displacement is determined to be the preset displacement.

[0065] Optionally, the decryption unit is specifically used for:

[0066] respectively summing each of the encrypted characters in the encrypted string consisting of numerical characters with the target displacement to obtain a third transition value;

[0067] Determining whether the absolute value of the third transition value is greater than 9;

[0068] If yes, taking the remainder of 10 for the third transition value whose absolute value is greater than 9 to obtain a fourth transition value, and determining the fourth transition value as the original character;

[0069] If not, the third transition value is determined as the original character.

[0070] A fifth aspect of an embodiment of the present application provides a data processing device, including:

[0071] CPU, memory and input / output interface;

[0072] The memory is a short-term storage memory or a persistent storage memory;

[0073] The central processing unit is configured to communicate with the memory and execute instruction operations in the memory to perform the data processing methods provided in the first aspect to the second aspect of the embodiments of the present application.

[0074] The computer-readable storage medium provided in the embodiment of the present application includes instructions. When the instructions are executed on a computer, the computer executes the data processing method provided in the first aspect and the second aspect of the embodiment of the present application.

[0075] It can be seen from the above technical solution that the embodiment of the present application has the following advantages: the length of the encrypted string is consistent with the length of the original string, the length of the compressed string after compression is less than or equal to the length of the original string, and the length of the compressed string after encryption and compression is not greater than the length of the original string, which can better save storage space. BRIEF DESCRIPTION OF THE DRAWINGS

[0076] Figure 1 A flow chart of the data processing method of the present application embodiment is as follows:

[0077] Figure 2Another schematic diagram of the data processing method according to the embodiment of the present application;

[0078] Figure 3 A schematic diagram of the structure of a data processing device according to an embodiment of the present application;

[0079] Figure 4 Another structural diagram of the data processing device according to the embodiment of the present application;

[0080] Figure 5 Another structural schematic diagram of the data processing device according to an embodiment of the present application. DETAILED DESCRIPTION

[0081] An embodiment of the present application provides a data processing method for saving storage space.

[0082] See also Figure 1 , an embodiment of the data processing method of the embodiment of the present application includes:

[0083] 101. Obtain an original string and a target displacement, where the original string includes a plurality of original characters arranged in sequence.

[0084] When a string needs to be encrypted, an original string consisting of a plurality of original characters and a target displacement are first obtained, and then the original string is encrypted by the target displacement.

[0085] 102. Encrypt each original character using the target displacement to obtain an encrypted character corresponding to the original character.

[0086] Each original character in the original character string is encrypted using the target displacement to obtain a plurality of encrypted characters corresponding to the original characters one by one.

[0087] 103. Arrange multiple encrypted characters according to the arrangement order of the original characters in the original character string to obtain an encrypted character string.

[0088] Each encrypted character has a corresponding original character, and each original character is arranged in a certain order to form an original string, so that multiple encrypted characters are arranged in the order of arrangement of the corresponding original characters in the original string to form an encrypted string.

[0089] 104. When an encrypted string contains a segment of characters consisting of multiple identical encrypted characters in succession, replace the multiple identical encrypted characters in the segment with one identical encrypted character and a special character to generate a compressed string. The special character is used to indicate the number of consecutive occurrences of the encrypted character in the same segment.

[0090] When there is a segment of characters consisting of multiple identical encrypted characters in a string, the special character used to indicate the number of consecutive occurrences of the encrypted character in the segment can be used to replace the segment with a special character and an identical encrypted character to achieve a compression effect. Specifically, the order of the special character and the identical encrypted character is not limited. In addition, the special character can be any character that has not appeared in the encrypted string and is preset by the system or user in advance, and is not specifically limited here.

[0091] In actual applications, when replacing a certain continuous string of characters, a compression position marker is added to indicate the encrypted character replaced by the special character. Specifically, the compression position marker can be placed between, before or after the special character and the encrypted character, which is not limited here.

[0092] In the embodiment of the present application, the length of the encrypted string is consistent with the length of the original string, the length of the compressed string after compression is less than or equal to the length of the original string, and the length of the compressed string after encryption and compression will not be greater than the length of the original string. When encrypting and saving the same content, no more space will be used, which can better save storage space.

[0093] Another process of the data processing method of the embodiment of the present application includes the above-mentioned steps 101 to 104, wherein step 101 is specifically implemented in the following manner: obtaining a preset displacement, which is an integer; determining whether the absolute value of the preset displacement is greater than 9; if so, determining the target displacement to be the remainder of the preset displacement divided by 10; if not, determining the target displacement to be the preset displacement.

[0094] Specifically, before determining the target displacement, a preset displacement needs to be obtained, wherein the preset displacement can be any integer. In addition, the preset displacement can be preset by the system or by the user, which is not limited here.

[0095] Then determine whether the value range of the preset displacement is outside [-9,9]. When the value range of the preset displacement is outside [-9,9], divide the preset displacement by 10, and the remainder obtained is the target displacement; when the value range of the preset displacement is within [-9,9], it is determined that the preset displacement is the target displacement.

[0096] In addition, step 102 is specifically implemented in the following manner: summing each original character in the original character string composed of numerical characters with the target displacement to obtain a first transition value; determining whether the absolute value of the first transition value is greater than 9; if so, taking the remainder of 10 for the first transition value whose absolute value is greater than 9 to obtain a second transition value, and determining the second transition value as an encrypted character; if not, determining the first transition value as an encrypted character.

[0097] Specifically, the same encryption process is performed on each original character in the original character string, that is, each original character is summed with the target displacement to obtain a first transition value corresponding to the original character. When the target displacement is a positive integer or zero, the summation is addition; when the target displacement is a negative integer, the summation is subtraction, which is not limited here.

[0098] Then, determine whether the value range of each first transition value is outside [-9,9]. When the value range of a first transition value is outside [-9,9], divide the first transition value by 10, and the remainder obtained is the second transition value. The second transition value is determined to be the encrypted character corresponding to the corresponding original character; when the value range of a first transition value is within [-9,9], the first transition value is determined to be the encrypted character corresponding to the corresponding original character. In actual situations, each original character in the original string will be encrypted, and the above-mentioned determination steps will be executed.

[0099] In the embodiments of the present application, the method for confirming the target displacement and the specific implementation method for encryption processing are further limited, thereby improving the feasibility of the solution.

[0100] An embodiment of the present application provides a data processing method for reading a character string that has been encrypted and compressed.

[0101] See also Figure 2 , an embodiment of the data processing method of the embodiment of the present application includes:

[0102] 201. Get the compressed string.

[0103] When it is necessary to read the content processed by the aforementioned data processing method, firstly, the compressed character string processed by the aforementioned data processing method is obtained.

[0104] 202. When a special character exists in the compressed character string, determine a compressed character corresponding to the special character, where the special character is used to represent a number N of consecutive appearances of the compressed character corresponding to the special character.

[0105] If there is a special character in the obtained compressed string, the character to be replaced by the special character is determined according to the compression position identifier. The compression position identifier can be placed between, before or after the special character and the encrypted character corresponding to the special character, and is not limited here. The special character indicates the number of occurrences N of the compressed character corresponding to the special character that is replaced.

[0106] 203. Replace the special characters with compressed characters corresponding to the number of special characters equal to N minus 1, to obtain an encrypted string in which a plurality of encrypted characters are arranged in sequence.

[0107] According to the determined compressed character corresponding to the special character, the special character is replaced with the compressed characters corresponding to the number of special characters N minus 1. Specifically, if the number of occurrences of the corresponding compressed character represented by the special character is 3, the special character is replaced with 2 corresponding compressed characters. Specifically, the order of the special character and the same encrypted character is not limited.

[0108] 204. Obtain target displacement.

[0109] Get the target displacement and decrypt the encrypted string by the target displacement.

[0110] In practice, the target displacement obtained in this step is consistent with the target displacement used when encrypting the string.

[0111] 205. Decrypt each encrypted character using the target displacement to obtain the original character corresponding to the encrypted character.

[0112] Each encrypted character in the original character string is decrypted using the target displacement to obtain a plurality of original characters corresponding to the encrypted characters.

[0113] 206. Arrange the plurality of original characters according to the arrangement order of the encrypted characters in the encrypted character string to obtain the original character string.

[0114] Each original character has a corresponding encrypted character, and each encrypted character is arranged in a certain order to form an encrypted string, so that multiple original characters are arranged in the order of arrangement of the corresponding encrypted characters in the encrypted string to form the original string.

[0115] In the embodiment of the present application, the character string processed by the aforementioned data processing method can be decrypted and decompressed according to the corresponding target displacement and special characters, so as to facilitate reading of the encrypted and compressed character string.

[0116] Another process of the data processing method of the embodiment of the present application includes the above steps 201 to 206.

[0117] Step 204 is specifically implemented in the following manner: obtaining a preset displacement, which is an integer; determining whether the absolute value of the preset displacement is greater than 9; if so, determining the target displacement to be the remainder of the preset displacement divided by 10; if not, determining the target displacement to be the preset displacement.

[0118] The specific implementation method of step 204 of the present embodiment is similar to the specific implementation method of the aforementioned step 101, and will not be repeated here.

[0119] In addition, step 205 is specifically implemented in the following manner: summing each encrypted character in the encrypted string consisting of numerical characters with the target displacement to obtain a third transition value; determining whether the absolute value of the third transition value is greater than 9; if so, taking the remainder of 10 for the third transition value whose absolute value is greater than 9 to obtain a fourth transition value, and determining the fourth transition value as the original character; if not, determining the third transition value as the original character.

[0120] Specifically, the same encryption process is performed on each encrypted character in the encrypted string, that is, each encrypted character is summed with the target displacement to obtain a third transition value corresponding to the encrypted character. When the target displacement is a positive integer or zero, the sum is addition; when the target displacement is a negative integer, the sum is subtraction, which is not limited here.

[0121] Then, determine whether the value range of each third transition value is outside [-9, 9]. When the value range of a third transition value is outside [-9, 9], divide the third transition value by 10, and the remainder obtained is the fourth transition value. The fourth transition value is determined to be the original character corresponding to the corresponding encrypted character; when the value range of a third transition value is within [-9, 9], the third transition value is determined to be the original character corresponding to the corresponding encrypted character.

[0122] In actual situations, each encrypted character in the encrypted string will be decrypted and the aforementioned determination steps will be executed.

[0123] In the embodiments of the present application, the method for confirming the target displacement and the specific implementation method for the decryption process are further limited, thereby improving the feasibility of the solution.

[0124] For ease of understanding, the following describes the encryption, compression, decompression and decryption process of a string in combination with specific situations:

[0125] There is a string "100000,100002,100008" that needs to be encrypted and compressed.

[0126] First, set the displacement to 2. The numeric characters in the string "100000, 100002, 100008" are added to "2" respectively, and the results are "322222, 322224, 322220". If the addition result is greater than or equal to 10, take the remainder when divided by 10. For example, "8+2=10", the remainder of 10 is 0.

[0127] Then the encrypted characters are compressed, and the number of times the same character appears is replaced by a letter, such as "b" represents 2 times, "c" represents 3 times, "d" represents 4 times, etc. Characters that appear only once are not replaced by a character, and the characters used for replacement cannot appear in the original characters. Based on the above content, the encrypted string "322222, 322224, 322220" is compressed to "32e, 32d4, 32d0", and the encryption and compression of the characters is completed.

[0128] When the encrypted and compressed string needs to be read, the string needs to be decrypted and decompressed to restore the original string.

[0129] First decompress it. According to the above content, restore "2e" to "22222" and "2d" to "2222". The result is "322222,322224,322220".

[0130] Then decrypt the encrypted string "322222, 322224, 322220", subtract the numerical characters from the displacement respectively, and get "100000, 100002, 100008", where the subtraction results are less than 0 and take the positive integers, and the positive integers are greater than or equal to 10, and the remainders when divided by 10 are taken, such as "0-2=-8", and the positive integer of -8 is 8. Based on this, the decompression and decryption of the characters are completed.

[0131] The data processing method of the embodiment of the present application is described above. Next, the data processing device of the embodiment of the present application is described below. Figure 3 , an embodiment of the data processing device of the embodiment of the present application includes:

[0132] An acquisition unit 301 is used to acquire an original character string and a target displacement, wherein the original character string includes a plurality of original characters arranged in sequence;

[0133] The encryption unit 302 is used to encrypt each original character using the target displacement to obtain an encrypted character corresponding to the original character;

[0134] Arrangement unit 303, used to arrange multiple encrypted characters according to the arrangement order of the original characters in the original character string to obtain an encrypted character string;

[0135] The compression unit 304 is used to replace the same segment of multiple identical encrypted characters with one identical encrypted character and a special character to generate a compressed string when there is a segment of characters consisting of multiple identical encrypted characters in succession in the encrypted string. The special character is used to indicate the number of consecutive occurrences of the encrypted character in the same segment.

[0136] Optionally, the acquiring unit 301 is specifically configured to:

[0137] Get the preset displacement, which is an integer;

[0138] Determine whether the absolute value of the preset displacement is greater than 9;

[0139] If so, determining the target displacement to be the preset displacement;

[0140] If not, the target displacement is determined to be the remainder of dividing the preset displacement by 10.

[0141] Optionally, the encryption unit 302 is specifically used for:

[0142] Each original character in the original string consisting of numerical characters is summed with the target displacement to obtain a first transition value;

[0143] Determine whether the absolute value of the first transition value is greater than 9;

[0144] If yes, take the remainder of 10 for the first transition value whose absolute value is greater than 9 to obtain a second transition value, and determine the second transition value as the encrypted character;

[0145] If not, the first transition value is determined as the encrypted character.

[0146] In an embodiment of the present application, the length of the encrypted string encrypted by the encryption unit 302 is consistent with the length of the original string, the length of the compressed string compressed by the compression unit 304 is less than or equal to the length of the original string, and the length of the compressed string after encryption and compression is not greater than the length of the original string. When encrypting and saving the same content, no more space will be used, which can better save storage space.

[0147] See also Figure 4 Another embodiment of the data processing device of the embodiment of the present application includes:

[0148] An acquisition unit 401 is used to acquire a compressed character string;

[0149] A determination unit 402 is configured to determine, when a special character exists in the compressed character string, a compressed character corresponding to the special character, wherein the special character is used to indicate a number of consecutive occurrences N of the compressed character corresponding to the special character;

[0150] A decompression unit 403 is used to replace the special characters with compressed characters corresponding to the special characters in the number N minus 1, to obtain an encrypted character string in which a plurality of encrypted characters are arranged in sequence;

[0151] The acquisition unit 401 is also used to acquire the target displacement;

[0152] A decryption unit 404, configured to use the target displacement to decrypt each of the encrypted characters to obtain an original character corresponding to the encrypted character;

[0153] The arrangement unit 405 is used to arrange the plurality of original characters according to the arrangement order of the encrypted characters in the encrypted character string to obtain the original character string.

[0154] Optionally, the acquiring unit 401 is specifically configured to:

[0155] Get the preset displacement, which is an integer;

[0156] Determine whether the absolute value of the preset displacement is greater than 9;

[0157] If yes, the target displacement is determined to be the remainder of the preset displacement divided by 10;

[0158] If not, the target displacement is determined to be the preset displacement.

[0159] Optionally, the decryption unit 404 is specifically used for:

[0160] respectively summing each encrypted character in the encrypted string consisting of numerical characters with the target displacement to obtain a third transition value;

[0161] Determine whether the absolute value of the third transition value is greater than 9;

[0162] If yes, taking the remainder of 10 for the third transition value whose absolute value is greater than 9 to obtain a fourth transition value, and determining the fourth transition value as the original character;

[0163] If not, the third transition value is determined as the original character.

[0164] In the embodiment of the present application, the decompression unit 403 and the decryption unit 404 can respectively decrypt and decompress the character string processed by the aforementioned data processing method according to the corresponding target displacement and special characters, so as to facilitate reading the encrypted and compressed character string.

[0165] Figure 5 It is a schematic diagram of the structure of a data processing device provided in an embodiment of the present application. The data processing device 500 may include one or more central processing units (CPU) 501 and a memory 505. The memory 505 stores one or more application programs or data.

[0166] The memory 505 may be a volatile storage or a persistent storage. The program stored in the memory 505 may include one or more modules, each of which may include a series of instruction operations in the data processing device. Furthermore, the central processing unit 501 may be configured to communicate with the memory 505 and execute a series of instruction operations in the memory 505 on the data processing device 500.

[0167] The data processing device 500 may also include one or more power supplies 502, one or more wired or wireless network interfaces 503, one or more input and output interfaces 504, and / or one or more operating systems, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.

[0168] The CPU 501 can execute the aforementioned Figures 1 to 4 The operations performed by the data processing device in the illustrated embodiment will not be described in detail herein.

[0169] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0170] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0171] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0172] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0173] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, read-only memory), random access memory (RAM, random access memory), disk or optical disk and other media that can store program code.

Claims

1. A data processing method, characterized in that: include: Obtaining an original character string and a target displacement, wherein the original character string includes a plurality of original characters arranged in sequence; respectively summing each of the original characters in the original character string consisting of numerical characters with the target displacement to obtain a first transition value; Determine whether the absolute value of the first transition value is greater than 9; If yes, taking the remainder of 10 for the first transition value whose absolute value is greater than 9 to obtain a second transition value, and determining the second transition value as the encrypted character; If not, determining the first transition value as the encrypted character; Arrange the plurality of encrypted characters according to the arrangement order of the original characters in the original character string to obtain an encrypted character string; When the encrypted character string contains a segment of characters consisting of multiple identical encrypted characters in succession, the multiple identical encrypted characters in the same segment are replaced with one of the identical encrypted characters and a special character to generate a compressed character string, wherein the special character is used to indicate the number of consecutive occurrences of the encrypted character in the same segment.

2. The data processing method according to claim 1, characterized in that: Obtaining the target displacement includes: Obtaining a preset displacement, where the preset displacement is an integer; Determine whether the absolute value of the preset displacement is greater than 9; If yes, determining the target displacement to be the preset displacement; If not, the target displacement is determined to be the remainder of dividing the preset displacement by 10.

3. A data processing method, characterized in that: include: Get the compressed string; When there is a special character in the compressed character string, determining a compressed character corresponding to the special character, wherein the special character is used to represent the number of consecutive occurrences N of the compressed character corresponding to the special character; The special characters are replaced with compressed characters corresponding to the special characters in a number N minus 1, to obtain an encrypted string in which a plurality of encrypted characters are arranged in sequence; Get the target displacement; respectively summing each of the encrypted characters in the encrypted string consisting of numerical characters with the target displacement to obtain a corresponding third transition value; Determining whether the absolute value of the third transition value is greater than 9; If yes, taking the remainder of 10 for the third transition value whose absolute value is greater than 9 to obtain a fourth transition value, and determining the fourth transition value as the original character; If not, determining the third transition value as the original character; Arrange the plurality of original characters according to the arrangement order of the encrypted characters in the encrypted character string to obtain an original character string.

4. The data processing method according to claim 3, characterized in that: The obtaining of the target displacement comprises: Obtaining a preset displacement, where the preset displacement is an integer; Determine whether the absolute value of the preset displacement is greater than 9; If yes, determining the target displacement as the remainder of dividing the preset displacement by 10; If not, the target displacement is determined to be the preset displacement.

5. A data processing device, characterized in that: For encrypting and compressing a character string, the data processing device comprises: An acquisition unit, used for acquiring an original character string and a target displacement, wherein the original character string includes a plurality of original characters arranged in sequence; an encryption unit, configured to sum each of the original characters in the original character string composed of numerical characters with the target displacement to obtain a corresponding first transition value, and determine whether the absolute value of the first transition value is greater than 9; if so, take the remainder of 10 for the first transition value whose absolute value is greater than 9 to obtain a second transition value, and determine the second transition value as the encrypted character; if not, determine the first transition value as the encrypted character; An arranging unit, configured to arrange the plurality of encrypted characters according to the arrangement order of the original characters in the original character string to obtain an encrypted character string; The compression unit is used to replace the multiple identical encrypted characters in the same segment with one of the identical encrypted characters and a special character when the encrypted character string contains a segment of characters consisting of multiple identical encrypted characters in succession, so as to generate a compressed character string, wherein the special character is used to indicate the number of consecutive occurrences of the encrypted character in the same segment.

6. A data processing device, characterized in that: For decrypting and decompressing a character string, the data processing device comprises: An acquisition unit, used for acquiring a compressed character string; a decompression unit, configured to, when a special character exists in the compressed character string, replace the special character with at least one compressed character preceding the special character according to the number of occurrences of the compressed character preceding the special character represented by the special character, so as to obtain an encrypted character string in which a plurality of encrypted characters are arranged in sequence; The acquisition unit is further used to acquire the target displacement; a decryption unit, configured to sum each encrypted character in the encrypted string consisting of numerical characters with the target displacement to obtain a corresponding third transition value, and determine whether the absolute value of the third transition value is greater than 9; if so, take the remainder of 10 for the third transition value whose absolute value is greater than 9 to obtain a fourth transition value, and determine the fourth transition value as the original character; if not, determine the third transition value as the original character; The arrangement unit is used to arrange the plurality of original characters according to the arrangement order of the encrypted characters in the encrypted character string to obtain the original character string.

7. A data processing device, characterized in that: include: CPU, memory and input / output interface; The memory is a short-term storage memory or a persistent storage memory; The central processing unit is configured to communicate with the memory and execute instructions in the memory to perform the method according to any one of claims 1 to 4.

8. A computer-readable storage medium, characterized in that: The method comprises instructions, which, when executed on a computer, cause the computer to execute the method according to any one of claims 1 to 4.