CN113810174A - Data processing method and related equipment - Google Patents

Data processing method and related equipment Download PDF

Info

Publication number
CN113810174A
CN113810174A CN202111087387.5A CN202111087387A CN113810174A CN 113810174 A CN113810174 A CN 113810174A CN 202111087387 A CN202111087387 A CN 202111087387A CN 113810174 A CN113810174 A CN 113810174A
Authority
CN
China
Prior art keywords
character
encrypted
characters
original
character string
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111087387.5A
Other languages
Chinese (zh)
Inventor
杨政
余鑫耸
肖彦婷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Kingdee Software China Co Ltd
Original Assignee
Kingdee Software China Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Kingdee Software China Co Ltd filed Critical Kingdee Software China Co Ltd
Priority to CN202111087387.5A priority Critical patent/CN113810174A/en
Publication of CN113810174A publication Critical patent/CN113810174A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0618Block ciphers, i.e. encrypting groups of characters of a plain text message using fixed encryption transformation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0618Block ciphers, i.e. encrypting groups of characters of a plain text message using fixed encryption transformation
    • H04L9/0625Block ciphers, i.e. encrypting groups of characters of a plain text message using fixed encryption transformation with splitting of the data block into left and right halves, e.g. Feistel based algorithms, DES, FEAL, IDEA or KASUMI

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • General Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • Storage Device Security (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

The embodiment of the application discloses a data processing method and related equipment, which are used for saving storage space. The method in the embodiment of the application comprises the following steps: acquiring an original character string and a target displacement, wherein the original character string comprises a plurality of original characters which are sequentially arranged; encrypting each original character by using the target displacement respectively to obtain an encrypted character corresponding to the original character; arranging a plurality of encrypted characters according to the arrangement sequence of the original characters in the original character string to obtain an encrypted character string; when a section of character consisting of a plurality of same encrypted characters is continuously existed in the encrypted character string, the same section of the plurality of same encrypted characters are replaced by a same encrypted character and a special character to generate a compressed character string, and the special character is used for indicating the continuous occurrence times of the encrypted character in the same section.

Description

Data processing method and related equipment
Technical Field
The embodiment of the application relates to the field of computers, in particular to a data processing method and related equipment.
Background
Encryption and decryption of software is an attractive field of research and can be closely combined with almost any computer technology, namely cryptography, programming languages, operating systems and data structures. The existing common encryption technology is symmetric encryption, symmetric encryption adopts a symmetric cipher coding technology, and the method is characterized in that the same key is used for file encryption and decryption, namely, an encryption key can also be used as a decryption key. The Data Encryption Standard (DES) is a symmetric encryption technology.
At present, the character string is usually encrypted by a DES encryption algorithm, and after the encryption is finished, the character string is compressed by a GZip algorithm.
However, the length of the character string is increased by using the DES algorithm for encryption, even if the character string is encrypted and then compressed by using the GZip algorithm, the length of the character string exceeds the original length, and the length of the character string is increased after the encryption and compression are actually finished.
Disclosure of Invention
The embodiment of the application provides a data processing method for saving storage space.
A first aspect of an embodiment of the present application provides a data processing method, including:
acquiring an original character string and a target displacement, wherein the original character string comprises a plurality of original characters which are sequentially arranged;
encrypting each original character by using the target displacement respectively to obtain an encrypted character corresponding to the original character;
arranging a plurality of encrypted characters according to the arrangement sequence of the original characters in the original character string to obtain an encrypted character string;
when a section of character consisting of a plurality of same encrypted characters continuously exists in the encrypted character string, replacing the same encrypted characters with the same encrypted character and a special character to generate a compressed character string, wherein the special character is used for representing the continuous occurrence times of the encrypted characters in the same section.
Optionally, the obtaining the target displacement amount includes:
acquiring a preset displacement, wherein the preset displacement is an integer;
judging whether the absolute value of the preset displacement is greater than 9;
if so, determining the target displacement amount as the preset displacement amount;
if not, determining that the target displacement is the remainder of dividing the preset displacement by 10.
Optionally, the encrypting each original character by using the target displacement respectively to obtain an encrypted character corresponding to the original character includes:
summing each original character in the original character string consisting of numeric characters and the target displacement quantity to obtain a first transition numeric value;
judging whether the absolute value of the first transition numerical value is greater than 9;
if yes, taking 10 remainder of the first transition numerical value with the absolute value larger than 9 to obtain a second transition numerical value, and determining the second transition numerical value as the encrypted character;
and if not, determining the first transition numerical value as the encrypted character.
A second aspect of the embodiments of the present application provides a data processing method, including:
acquiring a compressed character string;
when the compressed character string has special characters, determining the compressed characters corresponding to the special characters, wherein the special characters are used for representing the continuous occurrence times N of the compressed characters corresponding to the special characters;
replacing the special characters with compressed characters corresponding to the special characters with the number of N minus 1 to obtain an encrypted character string with a plurality of encrypted characters arranged in sequence;
acquiring a target displacement;
decrypting each encrypted character by using the target displacement respectively to obtain an original character corresponding to the encrypted character;
and arranging a plurality of original characters according to the arrangement sequence of the encrypted characters in the encrypted character string to obtain an original character string.
Optionally, the obtaining the target displacement amount includes:
acquiring a preset displacement, wherein the preset displacement is an integer;
judging whether the absolute value of the preset displacement is greater than 9;
if so, determining the target displacement as the remainder of dividing the preset displacement by 10;
if not, determining the target displacement as the preset displacement.
Optionally, the decrypting each encrypted character by using the target displacement respectively to obtain the original character corresponding to the encrypted character includes:
summing each encrypted character in the encrypted character string consisting of numeric characters and the target displacement respectively to obtain a third transition numeric value;
judging whether the absolute value of the third transition numerical value is greater than 9;
if yes, taking 10 remainder of the third transition numerical value with the absolute value larger than 9 to obtain a fourth transition numerical value, and determining the fourth transition numerical value as the original character;
and if not, determining the third transition numerical value as the original character.
A third aspect of the embodiments of the present application provides a data processing apparatus, including:
an acquisition unit configured to acquire an original character string and a target displacement amount, the original character string including a plurality of original characters arranged in sequence;
the encryption unit is used for encrypting each original character by using the target displacement respectively to obtain an encrypted character corresponding to the original character;
the arranging unit is used for arranging a plurality of encrypted characters according to the arrangement sequence of the original characters in the original character string to obtain an encrypted character string;
and the compression unit is used for replacing a same encrypted character with the same encrypted character and a special character to generate a compressed character string when the encrypted character string has a section of character consisting of a plurality of same encrypted characters in a continuous way, wherein the special character is used for representing the continuous occurrence times of the encrypted character in the same section.
Optionally, the obtaining unit is specifically configured to:
acquiring a preset displacement, wherein the preset displacement is an integer;
judging whether the absolute value of the preset displacement is greater than 9;
if so, determining the target displacement amount as the preset displacement amount;
if not, determining that the target displacement is the remainder of dividing the preset displacement by 10.
Optionally, the encryption unit is specifically configured to:
summing each original character in the original character string consisting of numeric characters and the target displacement quantity to obtain a first transition numeric value;
judging whether the absolute value of the first transition numerical value is greater than 9;
if yes, taking 10 remainder of the first transition numerical value with the absolute value larger than 9 to obtain a second transition numerical value, and determining the second transition numerical value as the encrypted character;
and if not, determining the first transition numerical value as the encrypted character.
A fourth aspect of the present embodiment provides a data processing apparatus, including:
an acquisition unit configured to acquire a compressed character string;
the determining unit is used for determining a compressed character corresponding to a special character when the compressed character string has the special character, wherein the special character is used for indicating the continuous occurrence frequency N of the compressed character corresponding to the special character;
the decompression unit is used for replacing the special characters with compressed characters corresponding to the special characters with the number of N minus 1 to obtain an encrypted character string with a plurality of encrypted characters arranged in sequence;
the acquisition unit is also used for acquiring a target displacement;
the decryption unit is used for decrypting each encrypted character by using the target displacement respectively to obtain an original character corresponding to the encrypted character;
and the arranging unit is used for arranging a plurality of original characters according to the arrangement sequence of the encrypted characters in the encrypted character string to obtain the original character string.
Optionally, the obtaining unit is specifically configured to:
acquiring a preset displacement, wherein the preset displacement is an integer;
judging whether the absolute value of the preset displacement is greater than 9;
if so, determining the target displacement as the remainder of dividing the preset displacement by 10;
if not, determining the target displacement as the preset displacement.
Optionally, the decryption unit is specifically configured to:
summing each encrypted character in the encrypted character string consisting of numeric characters and the target displacement respectively to obtain a third transition numeric value;
judging whether the absolute value of the third transition numerical value is greater than 9;
if yes, taking 10 remainder of the third transition numerical value with the absolute value larger than 9 to obtain a fourth transition numerical value, and determining the fourth transition numerical value as the original character;
and if not, determining the third transition numerical value as the original character.
A fifth aspect of the embodiments of the present application provides a data processing apparatus, including:
the system comprises a central processing unit, a memory and an input/output interface;
the memory is a transient memory or a persistent memory;
the central processing unit is configured to communicate with the memory and execute the instruction operations in the memory to execute the data processing method provided in the first aspect to the second aspect of the embodiments of the present application.
The computer-readable storage medium provided by the embodiment of the present application includes instructions, which when executed on a computer, cause the computer to execute the data processing method provided by the first aspect and the second aspect of the embodiment of the present application.
According to the technical scheme, the embodiment of the application has the following advantages: the length of the encrypted character string is consistent with that of the original character string, the length of the compressed character string is smaller than or equal to that of the original character string, the length of the compressed character string after encryption and compression is not larger than that of the original character string, and storage space can be better saved.
Drawings
Fig. 1 is a schematic flow chart of a data processing method according to an embodiment of the present application:
FIG. 2 is another schematic flow chart of a data processing method according to an embodiment of the present application;
FIG. 3 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present application;
FIG. 4 is a schematic diagram of another embodiment of a data processing apparatus;
fig. 5 is another schematic structural diagram of a data processing apparatus according to an embodiment of the present application.
Detailed Description
The embodiment of the application provides a data processing method for saving storage space.
Referring to fig. 1, an embodiment of a data processing method according to the embodiment of the present application includes:
101. and acquiring an original character string and a target displacement, wherein the original character string comprises a plurality of original characters which are sequentially arranged.
When a certain character string needs to be encrypted, an original character string formed by arranging a plurality of original characters and a target displacement are obtained first, and then the original character string is encrypted through the target displacement.
102. And respectively encrypting each original character by using the target displacement to obtain an encrypted character corresponding to the original character.
And encrypting each original character in the original character string by using the target displacement to obtain a plurality of encrypted characters corresponding to the original characters one by one.
103. And arranging a plurality of encrypted characters according to the arrangement sequence of the original characters in the original character string to obtain the encrypted character string.
Each encrypted character has a corresponding original character, and each original character is arranged according to a certain sequence to form an original character string, so that a plurality of encrypted characters are arranged according to the arrangement sequence of the corresponding original characters in the original character string to form the encrypted character string.
104. When a section of character consisting of a plurality of same encrypted characters is continuously existed in the encrypted character string, the same section of the plurality of same encrypted characters are replaced by a same encrypted character and a special character to generate a compressed character string, and the special character is used for indicating the continuous occurrence times of the encrypted character in the same section.
When a segment of characters consisting of a plurality of identical encrypted characters in succession exists in the encrypted character string, the segment of continuous characters can be replaced by one special character and one identical encrypted character through the special character used for indicating the continuous occurrence times of the encrypted characters in the same segment, so that the compression effect is realized. Specifically, the sequence of the special character and the same encrypted character is not limited. In addition, the special character may be any character that does not appear in the encrypted character string preset by the system or the user in advance, and is not limited herein.
In practical application, when replacing a certain continuous character, a compression position mark is also added for indicating the encrypted character replaced by the special character. Specifically, the compressed location identifier may be disposed between, before or after the special character and the encrypted character, and is not limited herein.
In the embodiment of the application, the length of the encrypted character string is consistent with that of the original character string, the length of the compressed character string is less than or equal to that of the original character string, the length of the compressed character string after encryption and compression is completed is not greater than that of the original character string, under the condition that the same content is stored in an encrypted mode, more space cannot be used, and storage space can be better saved.
Another flow of the data processing method in the embodiment of the present application includes the above steps 101 to 104, where the step 101 is specifically implemented by the following method: acquiring a preset displacement, wherein the preset displacement is an integer; judging whether the absolute value of the preset displacement is greater than 9; if so, determining the target displacement as the remainder of dividing the preset displacement by 10; if not, determining the target displacement as the preset displacement.
Specifically, before determining the target displacement, a preset displacement is required to be obtained, where the preset displacement may be any integer. In addition, the preset displacement may be preset by a system or preset by a user, and is not limited herein.
Then judging whether the acquired range of the preset displacement is beyond [ -9,9] or not, and dividing the preset displacement by 10 when the range of the preset displacement is beyond [ -9,9] to obtain a remainder which is the target displacement; when the value range of the preset displacement is within [ -9,9], the preset displacement is determined to be the target displacement.
In addition, step 102 is specifically implemented by: summing each original character in an original character string consisting of numerical characters and a target displacement quantity respectively to obtain a first transition numerical value; judging whether the absolute value of the first transition value is greater than 9; if yes, taking 10 remainder of the first transition numerical value with the absolute value larger than 9 to obtain a second transition numerical value, and determining the second transition numerical value as an encrypted character; if not, the first transition numerical value is determined as the encrypted character.
Specifically, each original character in the original character string is subjected to the same encryption processing, that is, each original character is summed with the target displacement amount, so as to obtain a first transition value corresponding to the original character one to one. When the target displacement is a positive integer or zero, summing the target displacement into addition; when the target displacement is a negative integer, the summation is a subtraction, and is not limited herein.
Then, judging whether the value range of each first transition numerical value is beyond the range of [ -9,9], dividing the first transition numerical value by 10 when the value range of a certain first transition numerical value is beyond the range of [ -9,9], obtaining a remainder as a second transition numerical value, and determining the second transition numerical value as an encrypted character corresponding to the corresponding original character; and when the value range of a certain first transition value is in [ -9,9], determining that the first transition value is the encrypted character corresponding to the corresponding original character. In practical situations, each original character in the original character string is encrypted, and the aforementioned determining step is performed.
In the embodiment of the application, the confirmation mode of the target displacement and the specific implementation mode of encryption processing are further limited, and the realizability of the scheme is improved.
The embodiment of the application provides a data processing method which is used for reading a character string after encryption and compression processing.
Referring to fig. 2, an embodiment of a data processing method according to the embodiment of the present application includes:
201. and acquiring the compressed character string.
When the content processed by the data processing method needs to be read, the compressed character string processed by the data processing method is acquired first.
202. And when the compressed character string has the special character, determining the compressed character corresponding to the special character, wherein the special character is used for indicating the continuous occurrence number N of the compressed character corresponding to the special character.
And if the obtained compressed character string has the special character, determining the character replaced by the special character according to the compression position identifier. The compression position identifier may be placed between, before or after the special character and the encrypted character corresponding to the special character, and is not limited herein. The special character indicates the number of occurrences N of the replaced compressed character corresponding to the special character.
203. And replacing the special characters with compressed characters corresponding to the special characters with the number of N minus 1 to obtain an encrypted character string with a plurality of encrypted characters arranged in sequence.
According to the determined compressed character corresponding to the special character, replacing the special character with the compressed character corresponding to the special character with the number of N minus 1, specifically, if the occurrence frequency of the corresponding compressed character represented by the special character is 3, replacing the special character with 2 corresponding compressed characters. Specifically, the sequence of the special character and the same encrypted character is not limited.
204. And acquiring the target displacement.
And acquiring the target displacement amount, and decrypting the encrypted character string through the target displacement amount.
In practice, the target displacement amount obtained in this step coincides with the target displacement amount used when encrypting the character string.
205. And decrypting each encrypted character by using the target displacement respectively to obtain an original character corresponding to the encrypted character.
And decrypting each encrypted character in the original character string by using the target displacement to obtain a plurality of original characters corresponding to the encrypted characters one by one.
206. And arranging a plurality of original characters according to the arrangement sequence of the encrypted characters in the encrypted character string to obtain the original character string.
Each original character has a corresponding encrypted character, and each encrypted character is arranged according to a certain sequence to form an encrypted character string, so that a plurality of original characters are arranged according to the arrangement sequence of the corresponding encrypted characters in the encrypted character string to form the original character string.
In the embodiment of the application, the character string processed by the data processing method can be decrypted and decompressed according to the corresponding target displacement and the special character, so that the encrypted and compressed character string can be read conveniently.
Another flow of the data processing method according to the embodiment of the present application includes the above steps 201 to 206,
wherein step 204 is specifically implemented by: acquiring a preset displacement, wherein the preset displacement is an integer; judging whether the absolute value of the preset displacement is greater than 9; if so, determining the target displacement as the remainder of dividing the preset displacement by 10; if not, determining the target displacement as the preset displacement.
The specific implementation manner of step 204 in this embodiment is similar to the specific implementation manner of step 101, and is not described herein again.
In addition, step 205 is specifically implemented by the following means: summing each encrypted character in an encrypted character string consisting of numerical characters and a target displacement quantity respectively to obtain a third transition numerical value; judging whether the absolute value of the third transition value is greater than 9; if yes, taking 10 remainder of a third transition numerical value with the absolute value larger than 9 to obtain a fourth transition numerical value, and determining the fourth transition numerical value as an original character; if not, determining the third transition numerical value as the original character.
Specifically, each encrypted character in the encrypted character string is subjected to the same encryption processing, that is, each encrypted character is summed with the target displacement amount, so as to obtain a third transition value corresponding to the encrypted character one to one. When the target displacement is a positive integer or zero, summing the target displacement into addition; when the target displacement is a negative integer, the summation is a subtraction, and is not limited herein.
Then, judging whether the value range of each third transition numerical value is beyond the range of [ -9,9], dividing the third transition numerical value by 10 when the value range of a certain third transition numerical value is beyond the range of [ -9,9], obtaining a remainder as a fourth transition numerical value, and determining the fourth transition numerical value as the original character corresponding to the corresponding encrypted character; and when the value range of a certain third transition value is in [ -9,9], determining that the third transition value is the original character corresponding to the corresponding encrypted character.
In practical situations, the foregoing determining step is performed to decrypt each encrypted character in the encrypted character string.
In the embodiment of the application, a confirmation mode of the target displacement and a specific implementation mode of decryption processing are further defined, and the realizability of the scheme is improved.
For convenience of understanding, the following description will be made of the processes of encrypting, compressing, decompressing and decrypting a character string, with reference to specific cases:
the existing character string "100000,100002,100008" needs to be encrypted and compressed.
First, setting the displacement amount to be 2, the result of adding the numeric characters in the character string "100000,100002,100008" to "2" respectively is "322222,322224,322220", wherein if the addition result is greater than or equal to 10, the remainder of division by 10, for example, "8 +2 ═ 10", the remainder of 10 is taken to be 0.
And then compressing the encrypted character, and setting that the times of the same character occurrence are replaced by letters, such as that "b" represents 2 times of occurrence, "c" represents 3 times of occurrence, "d" represents 4 times of occurrence, and the like, and the characters which are used for replacement are replaced by unused characters which occur only once, wherein the characters which are used for replacement cannot appear in the original characters. Based on the foregoing, the result of compressing the encrypted character string "322222,322224,322220" is "32 e,32d4,32d 0", based on which the encrypted compression of the character is completed.
When the encrypted and compressed character string needs to be read, the character string needs to be decrypted and decompressed to restore the original character string.
Decompression is first carried out, and according to the above, the "2 e" is reduced to "22222" and the "2 d" is reduced to "2222", and the result is "322222,322224,322220".
And then, decrypting the encrypted character string '322222,322224,322220', subtracting the displacement from the numeric characters to obtain '100000,100002,100008', wherein the subtraction result is less than 0, the positive integer is taken, the positive integer is greater than or equal to 10, the remainder is taken, which is obtained by dividing by 10, for example, the positive integer of-8 is taken as 8, and based on the result, the decompression and decryption of the characters are completed.
With reference to fig. 3, the data processing method according to the embodiment of the present application is described above, and a data processing apparatus according to the embodiment of the present application is described below, where an embodiment of the data processing apparatus according to the embodiment of the present application includes:
an obtaining unit 301, configured to obtain an original character string and a target displacement amount, where the original character string includes a plurality of original characters arranged in sequence;
an encrypting unit 302, configured to encrypt each original character using the target displacement amount, respectively, to obtain an encrypted character corresponding to the original character;
an arranging unit 303, configured to arrange a plurality of encrypted characters according to an arrangement order of the original characters in the original character string, so as to obtain an encrypted character string;
a compressing unit 304, configured to, when there is a segment of the encrypted character string that is composed of a plurality of identical encrypted characters in succession, replace the identical encrypted characters with an identical encrypted character and a special character to generate a compressed character string, where the special character is used to indicate the number of times the encrypted character appears in succession in the identical segment.
Optionally, the obtaining unit 301 is specifically configured to:
acquiring a preset displacement, wherein the preset displacement is an integer;
judging whether the absolute value of the preset displacement is greater than 9;
if so, determining the target displacement as a preset displacement;
if not, determining the target displacement as the remainder of dividing the preset displacement by 10.
Optionally, the encryption unit 302 is specifically configured to:
summing each original character in an original character string consisting of numerical characters and a target displacement quantity respectively to obtain a first transition numerical value;
judging whether the absolute value of the first transition value is greater than 9;
if yes, taking 10 remainder of the first transition numerical value with the absolute value larger than 9 to obtain a second transition numerical value, and determining the second transition numerical value as an encrypted character;
if not, the first transition numerical value is determined as the encrypted character.
In the embodiment of the present application, the length of the encrypted character string encrypted by the encryption unit 302 is consistent with the length of the original character string, the length of the compressed character string compressed by the compression unit 304 is less than or equal to the length of the original character string, the length of the compressed character string after completing encryption and compression is not greater than the length of the original character string, and under the condition of storing the same content by encryption, more space is not used, so that the storage space can be better saved.
Referring to fig. 4, another embodiment of a data processing apparatus according to the embodiment of the present application includes:
an obtaining unit 401 configured to obtain a compressed character string;
a determining unit 402, configured to determine, when a special character exists in the compressed character string, a compressed character corresponding to the special character, where the special character is used to indicate a consecutive occurrence number N of the compressed character corresponding to the special character;
a decompression unit 403, configured to replace the special character with a compressed character corresponding to the special character whose number is N minus 1, so as to obtain an encrypted character string in which a plurality of encrypted characters are sequentially arranged;
the acquiring unit 401 is further configured to acquire a target displacement;
a decryption unit 404, configured to decrypt each encrypted character using the target displacement amount, respectively, to obtain an original character corresponding to the encrypted character;
an arranging unit 405, configured to arrange a plurality of original characters according to an arrangement order of the encrypted characters in the encrypted character string, so as to obtain an original character string.
Optionally, the obtaining unit 401 is specifically configured to:
acquiring a preset displacement, wherein the preset displacement is an integer;
judging whether the absolute value of the preset displacement is greater than 9;
if so, determining the target displacement as the remainder of dividing the preset displacement by 10;
if not, determining the target displacement as the preset displacement.
Optionally, the decryption unit 404 is specifically configured to:
summing each encrypted character in an encrypted character string consisting of numerical characters and a target displacement quantity respectively to obtain a third transition numerical value;
judging whether the absolute value of the third transition value is greater than 9;
if yes, taking 10 remainder of a third transition numerical value with the absolute value larger than 9 to obtain a fourth transition numerical value, and determining the fourth transition numerical value as an original character;
if not, determining the third transition numerical value as the original character.
In this embodiment, the uncompressing unit 403 and the decrypting unit 404 may respectively decrypt and decompress the character string processed by the foregoing data processing method according to the corresponding target displacement and the special character, so as to facilitate reading the encrypted and compressed character string.
Fig. 5 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present disclosure, where the data processing apparatus 500 may include one or more Central Processing Units (CPUs) 501 and a memory 505, and the memory 505 stores one or more application programs or data therein.
Memory 505 may be volatile storage or persistent storage, among others. The program stored in memory 505 may include one or more modules, each of which may include a sequence of instructions operating on a data processing apparatus. Still further, the central processor 501 may be arranged to communicate with the memory 505 to execute a series of instruction operations in the memory 505 on the data processing apparatus 500.
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-output interfaces 504, and/or one or more operating systems, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
The central processing unit 501 may perform the operations performed by the data processing apparatus in the embodiments shown in fig. 1 to fig. 4, and details thereof are not repeated herein.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and the like.

Claims (10)

1. A data processing method, comprising:
acquiring an original character string and a target displacement, wherein the original character string comprises a plurality of original characters which are sequentially arranged;
encrypting each original character by using the target displacement respectively to obtain an encrypted character corresponding to the original character;
arranging a plurality of encrypted characters according to the arrangement sequence of the original characters in the original character string to obtain an encrypted character string;
when a section of character consisting of a plurality of same encrypted characters continuously exists in the encrypted character string, replacing the same encrypted characters with the same encrypted character and a special character to generate a compressed character string, wherein the special character is used for representing the continuous occurrence times of the encrypted characters in the same section.
2. The data processing method according to claim 1, wherein the obtaining a target displacement amount comprises:
acquiring a preset displacement, wherein the preset displacement is an integer;
judging whether the absolute value of the preset displacement is greater than 9;
if so, determining the target displacement amount as the preset displacement amount;
if not, determining that the target displacement is the remainder of dividing the preset displacement by 10.
3. The data processing method according to claim 1, wherein the encrypting each of the original characters using the target displacement amounts respectively to obtain encrypted characters corresponding to the original characters comprises:
summing each original character in the original character string consisting of numeric characters and the target displacement quantity to obtain a first transition numeric value;
judging whether the absolute value of the first transition numerical value is greater than 9;
if yes, taking 10 remainder of the first transition numerical value with the absolute value larger than 9 to obtain a second transition numerical value, and determining the second transition numerical value as the encrypted character;
and if not, determining the first transition numerical value as the encrypted character.
4. A data processing method, comprising:
acquiring a compressed character string;
when the compressed character string has special characters, determining the compressed characters corresponding to the special characters, wherein the special characters are used for representing the continuous occurrence times N of the compressed characters corresponding to the special characters;
replacing the special characters with compressed characters corresponding to the special characters with the number of N minus 1 to obtain an encrypted character string with a plurality of encrypted characters arranged in sequence;
acquiring a target displacement;
decrypting each encrypted character by using the target displacement respectively to obtain an original character corresponding to the encrypted character;
and arranging a plurality of original characters according to the arrangement sequence of the encrypted characters in the encrypted character string to obtain an original character string.
5. The data processing method according to claim 4, wherein the obtaining the target displacement amount comprises:
acquiring a preset displacement, wherein the preset displacement is an integer;
judging whether the absolute value of the preset displacement is greater than 9;
if so, determining the target displacement as the remainder of dividing the preset displacement by 10;
if not, determining the target displacement as the preset displacement.
6. The data processing method according to claim 4, wherein the decrypting each encrypted character using the target displacement amount to obtain an original character corresponding to the encrypted character comprises:
summing each encrypted character in the encrypted character string consisting of numeric characters and the target displacement respectively to obtain a third transition numeric value;
judging whether the absolute value of the third transition numerical value is greater than 9;
if yes, taking 10 remainder of the third transition numerical value with the absolute value larger than 9 to obtain a fourth transition numerical value, and determining the fourth transition numerical value as the original character;
and if not, determining the third transition numerical value as the original character.
7. A data processing apparatus for encrypting a compressed character string, comprising:
an acquisition unit configured to acquire an original character string and a target displacement amount, the original character string including a plurality of original characters arranged in sequence;
the encryption unit is used for encrypting each original character by using the target displacement respectively to obtain an encrypted character corresponding to the original character;
the arranging unit is used for arranging a plurality of encrypted characters according to the arrangement sequence of the original characters in the original character string to obtain an encrypted character string;
and the compression unit is used for replacing a same encrypted character with the same encrypted character and a special character to generate a compressed character string when the encrypted character string has a section of character consisting of a plurality of same encrypted characters in a continuous way, wherein the special character is used for representing the continuous occurrence times of the encrypted character in the same section.
8. A data processing apparatus for decrypting a decompressed string, the data processing apparatus comprising:
an acquisition unit configured to acquire a compressed character string;
the decompression unit is used for replacing the special character with at least one previous compressed character of the special character according to the occurrence frequency of the previous compressed character of the special character represented by the special character when the compressed character string has the special character, so that an encrypted character string with a plurality of encrypted characters sequentially arranged is obtained;
the acquisition unit is also used for acquiring a target displacement;
the decryption unit is used for decrypting each encrypted character by using the target displacement respectively to obtain an original character corresponding to the encrypted character;
and the arranging unit is used for arranging a plurality of original characters according to the arrangement sequence of the encrypted characters in the encrypted character string to obtain the original character string.
9. A data processing apparatus, comprising:
the system comprises a central processing unit, a memory and an input/output interface;
the memory is a transient memory or a persistent memory;
the central processor is configured to communicate with the memory and execute the instructions in the memory to perform the method of any of claims 1-6.
10. A computer-readable storage medium comprising instructions that, when executed on a computer, cause the computer to perform the method of any of claims 1 to 6.
CN202111087387.5A 2021-09-16 2021-09-16 Data processing method and related equipment Pending CN113810174A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111087387.5A CN113810174A (en) 2021-09-16 2021-09-16 Data processing method and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111087387.5A CN113810174A (en) 2021-09-16 2021-09-16 Data processing method and related equipment

Publications (1)

Publication Number Publication Date
CN113810174A true CN113810174A (en) 2021-12-17

Family

ID=78941324

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111087387.5A Pending CN113810174A (en) 2021-09-16 2021-09-16 Data processing method and related equipment

Country Status (1)

Country Link
CN (1) CN113810174A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116738492A (en) * 2023-08-15 2023-09-12 青岛精锐机械制造有限公司 Valve sales data safety management system

Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030016821A1 (en) * 2000-03-29 2003-01-23 Vadium Technology, Inc. One-time-pad encryption with keyable characters
CN101197071A (en) * 2007-12-13 2008-06-11 上海交通大学 Data lossless compression method for data transmission of remote monitoring system
US20080144809A1 (en) * 2006-12-19 2008-06-19 Fujitsu Broad Solution & Consulting Inc. Encryption process, encryption device, and computer-readable medium storing encryption program
CN103853985A (en) * 2012-12-05 2014-06-11 中国移动通信集团黑龙江有限公司 Data encryption method, decryption method and decryption device
CN104518865A (en) * 2014-12-12 2015-04-15 南京邮电大学 Data encryption method based on password book
CN105306065A (en) * 2015-11-10 2016-02-03 珠海多玩信息技术有限公司 Processing method and device for timestamps, extracting method and device for compressed character strings
CN105406960A (en) * 2015-12-20 2016-03-16 河南思维自动化设备股份有限公司 Information encrypting and decrypting method
CN107147616A (en) * 2017-03-31 2017-09-08 武汉斗鱼网络科技有限公司 Data ciphering method and device
CN107832623A (en) * 2017-10-13 2018-03-23 微梦创科网络科技(中国)有限公司 Grid Track is encrypted and the method and system of decryption
CN110299187A (en) * 2019-07-04 2019-10-01 南京邮电大学 A kind of parallelization gene data compression method based on Hadoop
CN110737908A (en) * 2019-10-12 2020-01-31 京东数字科技控股有限公司 Encryption method and apparatus, decryption method and apparatus, electronic device, and medium
CN110933063A (en) * 2019-11-25 2020-03-27 中国联合网络通信集团有限公司 Data encryption method, data decryption method and equipment
CN111384959A (en) * 2018-12-28 2020-07-07 上海寒武纪信息科技有限公司 Encoding method, processor, encoding module, and storage medium
CN112202729A (en) * 2020-09-11 2021-01-08 微梦创科网络科技(中国)有限公司 Dynamic obfuscated encryption and decryption method and device
CN113254889A (en) * 2020-02-11 2021-08-13 北京沃东天骏信息技术有限公司 Code encryption method and device

Patent Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030016821A1 (en) * 2000-03-29 2003-01-23 Vadium Technology, Inc. One-time-pad encryption with keyable characters
US20080144809A1 (en) * 2006-12-19 2008-06-19 Fujitsu Broad Solution & Consulting Inc. Encryption process, encryption device, and computer-readable medium storing encryption program
CN101197071A (en) * 2007-12-13 2008-06-11 上海交通大学 Data lossless compression method for data transmission of remote monitoring system
CN103853985A (en) * 2012-12-05 2014-06-11 中国移动通信集团黑龙江有限公司 Data encryption method, decryption method and decryption device
CN104518865A (en) * 2014-12-12 2015-04-15 南京邮电大学 Data encryption method based on password book
CN105306065A (en) * 2015-11-10 2016-02-03 珠海多玩信息技术有限公司 Processing method and device for timestamps, extracting method and device for compressed character strings
CN105406960A (en) * 2015-12-20 2016-03-16 河南思维自动化设备股份有限公司 Information encrypting and decrypting method
CN107147616A (en) * 2017-03-31 2017-09-08 武汉斗鱼网络科技有限公司 Data ciphering method and device
CN107832623A (en) * 2017-10-13 2018-03-23 微梦创科网络科技(中国)有限公司 Grid Track is encrypted and the method and system of decryption
CN111384959A (en) * 2018-12-28 2020-07-07 上海寒武纪信息科技有限公司 Encoding method, processor, encoding module, and storage medium
CN110299187A (en) * 2019-07-04 2019-10-01 南京邮电大学 A kind of parallelization gene data compression method based on Hadoop
CN110737908A (en) * 2019-10-12 2020-01-31 京东数字科技控股有限公司 Encryption method and apparatus, decryption method and apparatus, electronic device, and medium
CN110933063A (en) * 2019-11-25 2020-03-27 中国联合网络通信集团有限公司 Data encryption method, data decryption method and equipment
CN113254889A (en) * 2020-02-11 2021-08-13 北京沃东天骏信息技术有限公司 Code encryption method and device
CN112202729A (en) * 2020-09-11 2021-01-08 微梦创科网络科技(中国)有限公司 Dynamic obfuscated encryption and decryption method and device

Non-Patent Citations (6)

* Cited by examiner, † Cited by third party
Title
LAB601: "RLE压缩算法介绍", 博客园HTTPS://WWW.CNBLOGS.COM/LAB601/P/14588318.HTML, 28 March 2021 (2021-03-28), pages 1 *
RISHAV RAY等: "A New Challenge of Hiding any Encrypted Secret Message inside any Text/ASCII File or in MS Word File: RJDA Algorithm", 2012 INTERNATIONAL CONFERENCE ON COMMUNICATION SYSTEMS AND NETWORK TECHNOLOGIES *
刘作军: "字符串加密技术的理论研究和技术实现", 微型电脑应用, no. 07 *
刘波涛等: "面向数字型的轻量级保形加密算法研究", 计算机研究与发展, 15 July 2019 (2019-07-15), pages 5 - 6 *
张俊坤;: "数据压缩", 考试周刊, no. 17 *
王安: "基于LZW压缩算法的数字图像加密研究", 中国优秀硕士学位论文全文数据库 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116738492A (en) * 2023-08-15 2023-09-12 青岛精锐机械制造有限公司 Valve sales data safety management system
CN116738492B (en) * 2023-08-15 2023-10-31 青岛精锐机械制造有限公司 Valve sales data safety management system

Similar Documents

Publication Publication Date Title
CN111835700B (en) Data processing method and device, electronic equipment and storage medium
CN111683046A (en) Method, device, equipment and storage medium for compressing and acquiring file
CN116151740B (en) Inventory transaction data process safety management system and cloud platform
US20120246485A1 (en) Encrypting method, recording medium of encrypting program, decrypting method, and recording medium of decrypting program
CN109547201B (en) Encryption method of root key, computer readable storage medium and terminal equipment
JP2013500535A (en) Block unit data compression and decompression method and apparatus
CN102804800B (en) Section with encrypted section removes repetition system
US8402282B2 (en) Method and device for encrypting and decrypting digital data
CN113810174A (en) Data processing method and related equipment
EP4154406A1 (en) Compression/decompression using index correlating uncompressed/compressed content
US7533422B2 (en) Platform independent zero footprint decompression
CN111552938B (en) File encryption method and device
CN112559462A (en) Data compression method and device, computer equipment and storage medium
US20180131386A1 (en) Improved compression and/or encryption of a file
CN113987556B (en) Data processing method and device, electronic equipment and storage medium
JP2015114771A (en) Data encryption device, data restoration device, data encryption method, data restoration method, data encryption program, and data restoration program
Reddy et al. Efficient medical image security and transmission using modified LZW compression and ECDH-AES for telemedicine applications
US20190190709A1 (en) Searchable Symmetric Encryption System and Method of Processing Inverted Index
Jiancheng et al. Parallel algorithm for wireless data compression and encryption
CN115757535A (en) Data query method, data storage method and device and electronic equipment
CN115603758A (en) Client number compression and decompression method and device
CN108629157B (en) Method for compressing and encrypting nucleic acid sequencing data
CN116391185A (en) Method and system for differential deduplication in untrusted storage
CN111290781A (en) NPK mode packing script, and method and device for running NPK format script file
WO2016167719A1 (en) Improved compression and/or encryption of a file

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination