CN114465826A - Data encryption method, system and storage medium of coding technology - Google Patents

Data encryption method, system and storage medium of coding technology Download PDF

Info

Publication number
CN114465826A
CN114465826A CN202210375172.1A CN202210375172A CN114465826A CN 114465826 A CN114465826 A CN 114465826A CN 202210375172 A CN202210375172 A CN 202210375172A CN 114465826 A CN114465826 A CN 114465826A
Authority
CN
China
Prior art keywords
data
interval
preset
zero
average value
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.)
Granted
Application number
CN202210375172.1A
Other languages
Chinese (zh)
Other versions
CN114465826B (en
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.)
Shenzhen Tianxingcheng Technology Co ltd
Original Assignee
Shenzhen Tianxingcheng Technology 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 Shenzhen Tianxingcheng Technology Co ltd filed Critical Shenzhen Tianxingcheng Technology Co ltd
Priority to CN202210375172.1A priority Critical patent/CN114465826B/en
Publication of CN114465826A publication Critical patent/CN114465826A/en
Application granted granted Critical
Publication of CN114465826B publication Critical patent/CN114465826B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Storage Device Security (AREA)

Abstract

The application provides a data encryption method, a system and a storage medium of an encoding technology, wherein the method comprises the following steps: the method comprises the steps that a terminal obtains n data to be processed, the number of front zeros of the n data is counted to obtain n zero-valued numerical values of the n data, and the n zero-valued numerical values are arranged according to the storage sequence of the n data to obtain a first sequence; the terminal divides the first sequence into m equal parts; the terminal encrypts the m preset intervals, the preset interval data quantity y and the encoded data to obtain encrypted data, and stores the encrypted data to the cloud server; the terminal downloads the encrypted data from the cloud server, decrypts the encrypted data to obtain m preset intervals, the number y of the data in the preset intervals and the encoded data, and decodes the encoded data according to decoding modes corresponding to the m preset intervals to obtain the data to be processed. The technical scheme provided by the application has the advantage of saving the storage space.

Description

Data encryption method, system and storage medium of coding technology
Technical Field
The invention relates to the field of data processing, in particular to a data encryption method, a data encryption system and a storage medium of an encoding technology.
Background
In computer science, data is a generic term for media of all symbols that can be input to a computer and processed by a computer program, and is a generic term for numbers, letters, symbols, analog quantities, and the like that have a certain meaning and are used to be input to an electronic computer for processing.
Most data have the requirement of confidentiality, the existing data storage mode is generally encrypted by a general encryption mode, and the encryption mode does not change the storage quantity of the data, so that the data storage cost is high.
Disclosure of Invention
The embodiment of the invention provides a data encryption method and system of an encoding technology, which can reduce the cost of data encryption storage and improve the experience of a user.
In a first aspect, an embodiment of the present invention provides a data encryption method for an encoding technique, where the method includes the following steps:
the terminal obtains data to be processed, counts the number of front zeros of n data to obtain the values of n zero values of n data, and determines the first 1 of 32 bits for one data of n data at intervals of 32 bits2Front 02Is determined to be 02The number of the data is the numerical value of the zero value of the number corresponding to the 32 bits, and the number of the front zeros of the n data is traversed to obtain the numerical values of the n zero values of the n data; wherein subscript 2 represents a 2-ary value; arranging the numerical values of n zero values according to the storage sequence of n data to obtain a first sequence;
the terminal divides the first sequence into m equal parts, extracts the minimum value of each equal part in the m equal parts to obtain m minimum values, determines preset intervals in which the m minimum values are respectively positioned to obtain m preset intervals, and performs pre-zero-removing coding on data in each preset interval according to coding modes corresponding to the m preset intervals to obtain coded data; m is 4, 8 or 16;
setting m =4, dividing the first sequence into 4 parts, determining 4 minimum values of each of the 4 equal parts, and calculating an average value of the 4 minimum values to obtain a first average value; setting m =8, dividing the first sequence into 8 parts, determining 8 minimum values of each of the 8 equal parts, and calculating an average value of the 8 minimum values to obtain a second average value; setting m =16, dividing the first sequence into 16 parts, determining 16 minimum values of each of the 16 equal parts, calculating an average value of the 16 minimum values to obtain a third average value, selecting a maximum average value from the first average value, the second average value and the third average value, and determining a value set as m corresponding to the maximum average value;
the terminal encrypts the m preset intervals, the preset interval data quantity y and the encoded data to obtain encrypted data, and stores the encrypted data to the cloud server; wherein y = n/m;
the terminal downloads the encrypted data from the cloud server, decrypts the encrypted data to obtain m preset intervals, the number y of the data in the preset intervals and the encoded data, and decodes the encoded data according to decoding modes corresponding to the m preset intervals to obtain the data to be processed.
Optionally, the pre-zeroing coding the data in each preset interval according to the coding modes corresponding to the m preset intervals to obtain the coded data specifically includes:
determining a preset interval i corresponding to a first preset interval in the m preset intervals, and acquiring a minimum interval value x of an interval range of the preset interval iiIf xiNon-zero, subtracting (x) from the leading zero of each data of the first preset intervali-1) obtaining the coded data of all the data of the first predetermined interval after zero, if xiIf the value is zero, directly storing each data in the first preset interval; and traversing the data in the residual preset interval to obtain the coded data.
Optionally, the leading zero of each data of the first preset interval is subtracted by (x)i-1) obtaining the encoded data of all the data of the first preset interval after zero specifically includes:
the first preset interval is removed every 32 bits (x)i-1) zeros to obtain encoded data of all data of the first preset interval.
Optionally, the encrypting, by the terminal, the m preset intervals, the preset interval data number y, and the encoded data to obtain the encrypted data specifically includes:
adding m marks corresponding to the m preset intervals and the number y into a data head interval, adding the coded data into a data rear interval, and combining the data head interval and the data rear interval together to obtain the encrypted data through encryption by adopting an encryption algorithm.
Optionally, the decoding the encoded data according to the decoding modes corresponding to the m preset intervals to obtain the data to be processed specifically includes:
extracting a preset interval i corresponding to a first preset interval of the m preset intervals to obtain preset intervalsSetting the minimum interval value x of the interval range of the interval iiExtracting y (32-x) after the head intervali+1) bits per interval (32-x)i+1) bits, adding (x)i-1) obtaining decoded data below a preset interval for zero, and traversing m preset intervals to obtain data to be processed.
In a second aspect, there is provided a data encryption system for encoding techniques, the system comprising:
an acquisition unit configured to acquire n pieces of data to be processed;
a processing unit for counting the number of front zeros of the n data to obtain the values of n zero values of the n data, and determining the first 1 of the 32 bits at intervals of 32 bits2Front 02Is determined to be 02The number of the data is the numerical value of the zero value of the number corresponding to the 32 bits, and the number of the front zeros of the n data is traversed to obtain the numerical values of the n zero values of the n data; wherein subscript 2 represents a 2-ary value; arranging the numerical values of n zero values according to the storage sequence of n data to obtain a first sequence; dividing the first sequence into m equal parts, extracting the minimum value of each equal part in the m equal parts to obtain m minimum values, and determining preset intervals in which the m minimum values are respectively positioned to obtain m preset intervals; m is 4, 8 or 16; setting m =4, dividing the first sequence into 4 parts, determining 4 minimum values of each of the 4 equal parts, and calculating an average value of the 4 minimum values to obtain a first average value; setting m =8, dividing the first sequence into 8 parts, determining 8 minimum values of each of the 8 equal parts, and calculating an average value of the 8 minimum values to obtain a second average value; setting m =16, dividing the first sequence into 16 parts, determining 16 minimum values of each of the 16 equal parts, calculating an average value of the 16 minimum values to obtain a third average value, selecting a maximum average value from the first average value, the second average value and the third average value, and determining a value set as m corresponding to the maximum average value;
the coding unit is used for carrying out pre-zero coding on the data in each preset interval according to the coding modes corresponding to the m preset intervals to obtain coded data;
the encryption unit is used for encrypting the m preset intervals, the preset interval data quantity y and the coded data to obtain encrypted data, wherein y = n/m;
the communication unit is used for storing the encrypted data to a cloud server; downloading the encrypted data from the cloud server;
the processing unit is also used for decrypting the encrypted data to obtain m preset intervals, the number y of preset interval data and the encoded data;
and the decoding unit is used for decoding the coded data according to the decoding modes corresponding to the m preset intervals to obtain the data to be processed.
Optionally, the encoding unit is specifically configured to determine a preset interval i corresponding to a first preset interval of the m preset intervals, and obtain a minimum interval value x of an interval range of the preset interval iiIf xiNon-zero, subtracting (x) from the leading zero of each data of the first preset intervali-1) obtaining the coded data of all the data of the first predetermined interval after zero, if xiIf the value is zero, directly storing each data in the first preset interval; traversing the data in the residual preset interval to obtain the coded data;
the encoding unit is specifically configured to remove (x) every 32 bits of the first preset intervali-1) zeros to obtain encoded data of all data of the first preset interval.
Optionally, the encryption unit is specifically configured to add m identifiers and the number y corresponding to m preset intervals to a data header interval, add the encoded data to a data back interval, and encrypt the data header interval and the data back interval by using an encryption algorithm after combining them together to obtain encrypted data.
Optionally, the decoding unit is specifically configured to extract a preset interval i corresponding to a first preset interval of the m preset intervals, and obtain a minimum interval value x of an interval range of the preset interval iiExtracting y (32-x) after the head intervali+1) bits per interval (32-x)i+1) bits, adding (x)i-1) obtaining decoded data below a preset interval for zero, and traversing m preset intervals to obtain data to be processed.
In a third aspect, a computer-readable storage medium is provided, which stores a program for electronic data exchange, wherein the program causes a terminal to execute the method provided in the first aspect.
The embodiment of the invention has the following beneficial effects:
according to the technical scheme, the terminal obtains the data to be processed, counts the number of front zeros of n data to obtain n zero-valued values of the n data, and arranges the n zero-valued values according to the storage sequence of the n data to obtain a first sequence; the terminal divides the first sequence into m equal parts, extracts the minimum value of each equal part in the m equal parts to obtain m minimum values, determines m preset intervals in which the m minimum values are respectively positioned, and recodes the data in each preset interval according to the coding modes corresponding to the m preset intervals to obtain coded data; the terminal encrypts the m preset intervals and the encoded data to obtain encrypted data, and stores the encrypted data to the cloud server. The terminal downloads the encrypted data from the cloud server, decrypts the encrypted data to obtain m preset intervals and coded data, and decodes the coded data according to decoding modes corresponding to the m preset intervals to obtain to-be-processed data. Therefore, useless zeros of the header can be removed through a specific coding technology, and then the number of the removed header interval representations is increased, so that the storage capacity of data can be reduced, the precision of the data cannot be influenced, the encrypted data can realize the encryption protection of the data, the safety of the data is improved, the storage capacity of the data is reduced, and the cost of data storage is reduced.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic diagram of a terminal
FIG. 2 is a flow diagram of a data encryption method of an encoding technique;
fig. 3 is a schematic diagram of a data encryption system of an encoding technique.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terms "first," "second," "third," and "fourth," etc. in the description and claims of the invention and in the accompanying drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, result, or characteristic described in connection with the embodiment can be included in at least one embodiment of the invention. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
Referring to fig. 1, fig. 1 provides a terminal, which may be a terminal of an IOS system, an android system, or the like, or may be a terminal of another system, such as a hong meng system, and the present application does not limit the above specific system, and as shown in fig. 1, the terminal device may specifically include: the processor, the memory, the display screen, the communication circuit and the audio component (optional), and the above components may be connected by a bus, and may also be connected by other ways, and the present application does not limit the specific way of the above connection.
The data of the present application generally refers to data of a digital type, such as financial data, and the like, but may be other types of data, such as input data of a neural network model, weight data, and other pure digital data. For the storage of data, no matter how large or how small a number is, 32-bit storage is adopted, for the number 0 and number 10000 for example, 32-bit data volume is adopted, in the field of neural networks, because the data buffer amount of a neural network chip is limited, some ways are adopted to reduce the storage of data, for example, sparse ways are adopted to reduce the storage of data, and common sparse ways may include: the same number is reserved one and the other number is deleted, which can reduce the storage amount of data, but cannot be used when the data change is large, that is, when the number of the same number is not large, and another method is to set a preset value of 1 in a certain range, for example, to set 5% of the range around 1 as 1, and then to execute the above-mentioned sparse processing method, which can also reduce the storage amount of data, but cannot reduce the storage amount of general data, and the range method has an influence on the precision of data.
For the above digital processing method, the technical solution of the present application is based on the idea that, for some numbers, the number of bits used before 32 bits is generally small, for example, the first 16 bits are used less, but may be used, so that by encoding the numbers, the number of bits before 32 bits is reduced, and then performing encoding encryption again, the digital storage amount is reduced, and at the same time, the data security can be improved.
Referring to fig. 2, fig. 2 provides a data encryption method of an encoding technique, where the method is shown in fig. 2, and the method may be implemented in a terminal shown in fig. 1, where the terminal may specifically be a computer device, a smart phone, a smart speaker, and the like, and the method includes the following steps:
step S201, a terminal acquires n data to be processed, counts the number of front zeros of the n data to obtain n zero-valued numerical values of the n data, and arranges the n zero-valued numerical values according to the storage sequence of the n data to obtain a first sequence;
the counting the number of first zeros of the n data to obtain n zero values of the n data may specifically include:
for one of the n data, a first 1 of the 32 bits is determined every 32 bits2Front 02Is determined to be the previous 02The number of the data is the numerical value of the zero value of the number corresponding to the 32 bits, and the number of the front zeros of the n data is traversed to obtain the numerical values of the n zero values of the n data; wherein the subscript 2 represents a 2-ary number.
In the following, taking n =2 as an example, assuming that the corresponding binary value is "0000000000000000100111111111100000000000000000011001111111111000", then the first 1 in each 32-bit interval2Front 02The number of (a) is respectively the first 1 in "000000000000000010011111111110002Front 02The number of (1) is 16, the first 1 in "000000000000000110011111111110002Front 02The number of the n zero values in the n data can be obtained by analogy with the number of the n zero values in the n data.
Step S202, the terminal divides the first sequence into m equal parts, extracts the minimum value of each equal part in the m equal parts to obtain m minimum values, determines preset intervals in which the m minimum values are respectively positioned to obtain m preset intervals, and carries out pre-zero-removal coding on data in each preset interval according to coding modes corresponding to the m preset intervals to obtain coded data;
illustratively, m in the m equal parts may be any one of 4, 8, and 16, and m may be a constant value or may be set by a user.
Illustratively, the implementation method of step S202 may specifically include:
setting m =4, dividing the first sequence into 4 parts, determining 4 minimum values of each of the 4 equal parts, and calculating an average value of the 4 minimum values to obtain a first average value; setting m =8, dividing the first sequence into 8 parts, determining 8 minimum values of each of the 8 equal parts, and calculating an average value of the 8 minimum values to obtain a second average value; setting m =16, dividing the first sequence into 16 parts, determining 16 minimum values of each of the 16 equal parts, calculating an average value of the 16 minimum values to obtain a third average value, selecting a maximum average value of the first average value, the second average value and the third average value, and determining a value set as m corresponding to the maximum average value (for example, if the second average value is minimum, selecting setting m = 8).
This approach enables the determination of a specific value of m, from these 3 values, the optimal value of m can be selected, since for the 3 division approaches the average of the minimum values is the largest, and then it may omit 02The more so the maximum average needs to be chosen. The preset intervals may be 4 preset intervals, and the specific value of each preset interval may be: the preset interval 1: [ 0, 8 ]; the preset interval 2: [ 9, 16 ]; the preset interval 3: [ 17, 24 ]; the preset interval 4: [ 25, 32 ].
Of course, the preset intervals may also be 8 preset intervals, and the specific value of each preset interval may be: the preset interval 1: [ 0, 4 ]; the preset interval 2: [ 5, 8 ]; the preset interval 3: [ 9, 12 ]; the preset interval 4: [ 13, 16 ]; the preset interval 5: [ 17, 20 ]; the preset interval 6: [ 21, 24 ]; the preset interval 7: [ 25, 28 ]; the preset interval 8: [ 29, 32 ].
It should be noted that m preset intervals are obtained from the preset intervals in which the m minimum values are respectively located, where the m preset intervals may have the same preset interval, for example, if m is 16, the m preset intervals indicate that 16 equal parts correspond to 16 preset intervals, but do not indicate that the 16 preset intervals are different, and in practical application, most of the 16 preset intervals may be the same.
For example, the pre-zeroing encoding the data in each preset interval according to the encoding mode corresponding to the m preset intervals to obtain the encoded data may specifically include:
determining a preset interval i corresponding to a first preset interval in the m preset intervals, and acquiring a minimum interval value x of an interval range of the preset interval iiIf xiNon-zero, subtracting (x) from the leading zero of each data of the first preset intervali-1) obtaining the coded data of all the data of the first predetermined interval after zero, if xiIf the value is zero, directly storing each data in the first preset interval; and traversing the data in the residual preset interval to obtain the coded data.
Illustratively, the above subtracts (x) from the leading zero of each data of the first preset intervaliThe encoded data obtained by obtaining all data of the first preset interval after 1) zero may specifically include:
the first preset interval is removed every 32 bits (x)i-1) zeros to obtain encoded data of all data of the first preset interval.
Step S203, the terminal encrypts the m preset intervals, the preset interval data number y, and the encoded data to obtain encrypted data, and stores the encrypted data in the cloud server.
Wherein y = n/m;
for example, the encrypting, by the terminal, the m preset intervals, the preset interval data number y, and the encoded data to obtain the encrypted data may specifically include:
adding m marks corresponding to the m preset intervals and the number y into a data head interval, adding the coded data into a data rear interval, and combining the data head interval and the data rear interval together to obtain the encrypted data through encryption by adopting an encryption algorithm.
The encryption algorithm may be a general encryption algorithm, and the encryption method is not limited in the present application.
For example, the header section may include two parts, a first part, m flags of m preset sections, and a value of the second part number y, specifically, the header section may be 64 bits, the first 32 bits may represent the m flags, and the second 32 bits represent the value of the number y, but in practical applications, it may also be 128 bits, the first 96 bits represent the m flags, and the second 32 bits represent the value of the number y.
Taking 8 equal parts as an example, assuming that the preset interval is 4, taking 4 bits as an example, in practical application, 8 bits can also represent a preset interval identifier. Then the corresponding identification may be 00012Indicates a predetermined interval 1, 00102Indicates a preset interval 2, 00112Indicates a predetermined interval of 3, 01002A preset interval 4 is represented, and x is assumed to have a value of 1000, which can be represented in a commonly used 2-ary manner. The subscript 2 here indicates that the number is 2-ary, and the insufficient bit is 0.
And S204, the terminal downloads the encrypted data from the cloud server, decrypts the encrypted data to obtain m preset intervals, the number y of the data in the preset intervals and the encoded data, and decodes the encoded data according to decoding modes corresponding to the m preset intervals to obtain the data to be processed.
For example, the decoding the encoded data in the decoding manner corresponding to the m preset intervals to obtain the to-be-processed data specifically may include:
extracting a preset interval i corresponding to a first preset interval of the m preset intervals, and acquiring a minimum interval value x of an interval range of the preset interval iiExtracting y (32-x) after the head intervali+1) bits per interval (32-x)i+1) bits, adding (x)i-1) obtaining decoded data below a preset interval for zero, and traversing m preset intervals to obtain data to be processed.
According to the technical scheme, a terminal acquires data to be processed, counts the number of front zeros of n data to obtain n zero-valued values of the n data, and arranges the n zero-valued values according to the storage sequence of the n data to obtain a first sequence; the terminal divides the first sequence into m equal parts, extracts the minimum value of each equal part in the m equal parts to obtain m minimum values, determines m preset intervals in which the m minimum values are respectively positioned, and recodes the data in each preset interval according to the coding modes corresponding to the m preset intervals to obtain coded data; the terminal encrypts the m preset intervals and the encoded data to obtain encrypted data, and stores the encrypted data to the cloud server. The terminal downloads the encrypted data from the cloud server, decrypts the encrypted data to obtain m preset intervals and coded data, and decodes the coded data according to decoding modes corresponding to the m preset intervals to obtain to-be-processed data. Therefore, useless zeros of the header can be removed through a specific coding technology, and then the number of the removed header interval representations is increased, so that the storage capacity of data can be reduced, the precision of the data cannot be influenced, the encrypted data can realize the encryption protection of the data, the safety of the data is improved, the storage capacity of the data is reduced, and the cost of data storage is reduced.
Referring to fig. 3, fig. 3 provides a schematic structural diagram of a data encryption system of an encoding technology, where the system includes:
an acquiring unit 301 configured to acquire n pieces of data to be processed;
the processing unit 302 is configured to count the number of first zeros of the n data to obtain n zero-valued values of the n data, and arrange the n zero-valued values according to a storage sequence of the n data to obtain a first sequence; dividing the first sequence into m equal parts, extracting the minimum value of each equal part in the m equal parts to obtain m minimum values, and determining preset intervals in which the m minimum values are respectively positioned to obtain m preset intervals;
the encoding unit 303 is configured to perform pre-zeroing encoding on the data in each preset interval according to the encoding modes corresponding to the m preset intervals to obtain encoded data;
the encryption unit 304 is configured to encrypt the m preset intervals, the preset interval data number y, and the encoded data to obtain encrypted data;
a communication unit 305 for storing the encrypted data to a cloud server; downloading the encrypted data from the cloud server;
the processing unit 302 is further configured to decrypt the encrypted data to obtain m preset intervals, a preset interval data number y, and encoded data;
the decoding unit 306 is configured to decode the encoded data according to decoding manners corresponding to the m preset intervals to obtain data to be processed;
and m is 4, 8 or 16.
As an example of this, it is possible to provide,
the encoding unit 303 is specifically configured to determine a preset interval i corresponding to a first preset interval in the m preset intervals, and obtain a minimum interval value x of an interval range of the preset interval iiIf xiNon-zero, subtracting (x) from the leading zero of each data of the first preset intervali-1) obtaining the coded data of all the data of the first predetermined interval after zero, if xiIf the value is zero, directly storing each data in the first preset interval; traversing the data in the residual preset interval to obtain the coded data;
an encoding unit 303, specifically configured to remove (x) every 32 bits of the first preset intervali-1) zeros to obtain encoded data of all data of the first preset interval.
As an example of this, it is possible to provide,
the encryption unit 304 is specifically configured to add m identifiers and the number y corresponding to m preset intervals to a data header interval, add the encoded data to a data back interval, combine the data header interval and the data back interval together, and encrypt the data by using an encryption algorithm to obtain encrypted data.
As an example of this, it is possible to provide,
the decoding unit 303 is specifically configured to extract a preset interval i corresponding to a first preset interval of the m preset intervals, and obtain a minimum interval value x of an interval range of the preset interval iiExtracting y (32-x) after the head intervali+1) bits per interval (32-x)i+1) bits, adding (x)i-1) obtaining decoded data below a preset interval for zero, and traversing m preset intervals to obtain data to be processed.
For example, the processing unit, the encoding unit, and the decoding unit in the embodiment of the present application may also be used to execute the refinement scheme, the alternative scheme, and the like in the embodiment shown in fig. 2, which are not described herein again.
An embodiment of the present invention further provides a computer storage medium, wherein the computer storage medium stores a computer program for electronic data exchange, and the computer program enables a computer to execute part or all of the steps of the data encryption method of any one of the encoding techniques as described in the above method embodiments.
Embodiments of the present invention also provide a computer program product comprising a non-transitory computer readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps of a data encryption method according to any one of the encoding techniques as set forth in the above method embodiments.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may be performed in other orders or concurrently according to the present invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are exemplary embodiments and that the acts and modules illustrated are not necessarily required to practice the invention.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus may be implemented in other manners. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implementing, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of some interfaces, devices or units, and may be an electric or other form.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by associated hardware instructed by a program, which may be stored in a computer-readable memory, which may include: flash Memory disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
The above embodiments of the present invention are described in detail, and the principle and the implementation of the present invention are explained by applying specific embodiments, and the above description of the embodiments is only used to help understanding the method of the present invention and the core idea thereof; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A method for encrypting data using an encoding technique, the method comprising the steps of:
the terminal obtains n data to be processed, counts the number of front zeros of the n data to obtain the values of n zero values of the n data, and determines the first 1 of 32 bits at intervals of 32 bits for one data of the n data2Front 02Is determined to be 02The number of the data is the numerical value of the zero value of the number corresponding to the 32 bits, and the number of the front zeros of the n data is traversed to obtain the numerical values of the n zero values of the n data; wherein subscript 2 represents a 2-ary value; arranging the numerical values of n zero values according to the storage sequence of n data to obtain a first sequence;
the terminal divides the first sequence into m equal parts, extracts the minimum value of each equal part in the m equal parts to obtain m minimum values, determines preset intervals in which the m minimum values are respectively positioned to obtain m preset intervals, and performs pre-zero-removing coding on data in each preset interval according to coding modes corresponding to the m preset intervals to obtain coded data; m is 4, 8 or 16;
setting m =4, dividing the first sequence into 4 parts, determining 4 minimum values of each of the 4 equal parts, and calculating an average value of the 4 minimum values to obtain a first average value; setting m =8, dividing the first sequence into 8 parts, determining 8 minimum values of each of the 8 equal parts, and calculating an average value of the 8 minimum values to obtain a second average value; setting m =16, dividing the first sequence into 16 parts, determining 16 minimum values of each of the 16 equal parts, calculating an average value of the 16 minimum values to obtain a third average value, selecting a maximum average value from the first average value, the second average value and the third average value, and determining a value set as m corresponding to the maximum average value;
the terminal encrypts the m preset intervals, the preset interval data quantity y and the encoded data to obtain encrypted data, and stores the encrypted data to the cloud server; wherein y = n/m;
the terminal downloads the encrypted data from the cloud server, decrypts the encrypted data to obtain m preset intervals, the number y of the data in the preset intervals and the encoded data, and decodes the encoded data according to decoding modes corresponding to the m preset intervals to obtain the data to be processed.
2. The data encryption method of coding technology according to claim 1, wherein the pre-zeroing coding the data in each preset interval according to the coding modes corresponding to the m preset intervals to obtain the coded data specifically includes:
determining a preset interval i corresponding to a first preset interval in the m preset intervals, and acquiring a minimum interval value x of an interval range of the preset interval iiIf xiNon-zero, subtracting (x) from the leading zero of each data of the first preset intervali-1) obtaining the coded data of all the data of the first predetermined interval after zero, if xiIf the value is zero, directly storing each data in the first preset interval; and traversing the data in the residual preset interval to obtain the coded data.
3. The method of claim 2, wherein the leading zero of each data of the first preset interval is subtracted by (x)i-1) obtaining the encoded data of all the data of the first preset interval after zero specifically includes:
the first preset interval is removed every 32 bits (x)i-1)And obtaining the coded data of all the data in the first preset interval by the zeros.
4. The method according to claim 1, wherein the terminal encrypting the m preset intervals, the preset interval data number y and the encoded data to obtain the encrypted data specifically comprises:
adding m marks corresponding to the m preset intervals and the number y into a data head interval, adding the coded data into a data rear interval, and combining the data head interval and the data rear interval together to obtain the encrypted data through encryption by adopting an encryption algorithm.
5. The method according to claim 1, wherein the decoding the encoded data in the decoding manner corresponding to the m preset intervals to obtain the data to be processed specifically comprises:
extracting a preset interval i corresponding to a first preset interval of the m preset intervals, and acquiring a minimum interval value x of an interval range of the preset interval iiExtracting y (32-x) after the head intervali+1) bits per interval (32-x)i+1) bits, adding (x)i-1) obtaining decoded data below a preset interval for zero, and traversing m preset intervals to obtain data to be processed.
6. A data encryption system for encoding technology, the system comprising:
an acquisition unit configured to acquire n pieces of data to be processed;
a processing unit for counting the number of front zeros of the n data to obtain the values of n zero values of the n data, and determining the first 1 of the 32 bits at intervals of 32 bits for one data of the n data2Front 02Is determined to be 02The number of the data is the numerical value of the zero value of the number corresponding to the 32 bits, and the number of the front zeros of the n data is traversed to obtain the numerical values of the n zero values of the n data; wherein subscript 2 represents a 2-ary value; arranging the values of n zero values according to the storage sequence of n data to obtain a firstSequencing; dividing the first sequence into m equal parts, extracting the minimum value of each equal part in the m equal parts to obtain m minimum values, and determining preset intervals in which the m minimum values are respectively positioned to obtain m preset intervals; m is 4, 8 or 16; setting m =4, dividing the first sequence into 4 parts, determining 4 minimum values of each of the 4 equal parts, and calculating an average value of the 4 minimum values to obtain a first average value; setting m =8, dividing the first sequence into 8 parts, determining 8 minimum values of each of the 8 equal parts, and calculating an average value of the 8 minimum values to obtain a second average value; setting m =16, dividing the first sequence into 16 parts, determining 16 minimum values of each of the 16 equal parts, calculating an average value of the 16 minimum values to obtain a third average value, selecting a maximum average value from the first average value, the second average value and the third average value, and determining a value set as m corresponding to the maximum average value;
the coding unit is used for carrying out pre-zero coding on the data in each preset interval according to the coding modes corresponding to the m preset intervals to obtain coded data;
the encryption unit is used for encrypting the m preset intervals, the preset interval data quantity y and the coded data to obtain encrypted data, wherein y = n/m;
the communication unit is used for storing the encrypted data to a cloud server; downloading the encrypted data from the cloud server;
the processing unit is also used for decrypting the encrypted data to obtain m preset intervals, the number y of preset interval data and the encoded data;
and the decoding unit is used for decoding the coded data according to the decoding modes corresponding to the m preset intervals to obtain the data to be processed.
7. The encoding-technology data encryption system of claim 6,
the encoding unit is specifically configured to determine a preset interval i corresponding to a first preset interval of the m preset intervals, and obtain a minimum interval value x of an interval range of the preset interval iiIf xiNon-zero, subtracting the leading zero of each data of the first preset interval(xi-1) obtaining the coded data of all the data of the first predetermined interval after zero, if xiIf the value is zero, directly storing each data in the first preset interval; traversing the data in the residual preset interval to obtain the coded data;
the encoding unit is specifically configured to remove (x) every 32 bits of the first preset intervali-1) zeros to obtain encoded data of all data of the first preset interval.
8. The encoding-technology data encryption system of claim 7,
the encryption unit is specifically configured to add m identifiers and the number y corresponding to m preset intervals to a data header interval, add the encoded data to a data back interval, and encrypt the data header interval and the data back interval by using an encryption algorithm to obtain encrypted data after combining the data header interval and the data back interval.
9. The encoding-technology data encryption system of claim 7,
the decoding unit is specifically configured to extract a preset interval i corresponding to a first preset interval of m preset intervals, and obtain a minimum interval value x of an interval range of the preset interval iiExtracting y (32-x) after the head intervali+1) bits per interval (32-x)i+1) bits, adding (x)i-1) obtaining decoded data below a preset interval for zero, and traversing m preset intervals to obtain data to be processed.
10. A computer-readable storage medium storing a program for electronic data exchange, wherein the program causes a terminal to execute the method according to any one of claims 1-5.
CN202210375172.1A 2022-04-11 2022-04-11 Data encryption method, system and storage medium of coding technology Active CN114465826B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210375172.1A CN114465826B (en) 2022-04-11 2022-04-11 Data encryption method, system and storage medium of coding technology

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210375172.1A CN114465826B (en) 2022-04-11 2022-04-11 Data encryption method, system and storage medium of coding technology

Publications (2)

Publication Number Publication Date
CN114465826A true CN114465826A (en) 2022-05-10
CN114465826B CN114465826B (en) 2022-07-15

Family

ID=81417467

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210375172.1A Active CN114465826B (en) 2022-04-11 2022-04-11 Data encryption method, system and storage medium of coding technology

Country Status (1)

Country Link
CN (1) CN114465826B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4672360A (en) * 1983-09-30 1987-06-09 Honeywell Information Systems Inc. Apparatus and method for converting a number in binary format to a decimal format
US20090003714A1 (en) * 2007-06-28 2009-01-01 Qualcomm Incorporated Efficient image compression scheme to minimize storage and bus bandwidth requirements
CN102857831A (en) * 2012-08-01 2013-01-02 合肥工业大学 H.264 video integrality authentication method
CN107087309A (en) * 2017-04-23 2017-08-22 西安电子科技大学 Many base station system proportional fair dispatching methods under user QoS fixed rate constraint
CN109859281A (en) * 2019-01-25 2019-06-07 杭州国芯科技股份有限公司 A kind of compaction coding method of sparse neural network
US20210049011A1 (en) * 2019-08-14 2021-02-18 Jerry D. Harthcock Universal floating-point instruction set architecture for computing directly with decimal character sequences and binary formats in any combination
CN112883982A (en) * 2021-01-08 2021-06-01 西北工业大学 Data zero-removing coding and packaging method for neural network sparse features
CN113625989A (en) * 2021-07-16 2021-11-09 深圳云天励飞技术股份有限公司 Data operation device, method, electronic device, and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4672360A (en) * 1983-09-30 1987-06-09 Honeywell Information Systems Inc. Apparatus and method for converting a number in binary format to a decimal format
US20090003714A1 (en) * 2007-06-28 2009-01-01 Qualcomm Incorporated Efficient image compression scheme to minimize storage and bus bandwidth requirements
CN102857831A (en) * 2012-08-01 2013-01-02 合肥工业大学 H.264 video integrality authentication method
CN107087309A (en) * 2017-04-23 2017-08-22 西安电子科技大学 Many base station system proportional fair dispatching methods under user QoS fixed rate constraint
CN109859281A (en) * 2019-01-25 2019-06-07 杭州国芯科技股份有限公司 A kind of compaction coding method of sparse neural network
US20210049011A1 (en) * 2019-08-14 2021-02-18 Jerry D. Harthcock Universal floating-point instruction set architecture for computing directly with decimal character sequences and binary formats in any combination
CN112883982A (en) * 2021-01-08 2021-06-01 西北工业大学 Data zero-removing coding and packaging method for neural network sparse features
CN113625989A (en) * 2021-07-16 2021-11-09 深圳云天励飞技术股份有限公司 Data operation device, method, electronic device, and storage medium

Also Published As

Publication number Publication date
CN114465826B (en) 2022-07-15

Similar Documents

Publication Publication Date Title
CN107707347B (en) User key backup method and device and user key importing method and device
US10341305B2 (en) Encrypted communications method and communications terminal, and computer storage medium
CN108259171B (en) Shader file protection method and device
CN114285562B (en) Data encryption method and device
CN106817358B (en) Encryption and decryption method and device for user resources
CN109257332B (en) Method and device for creating secure channel for updating digital currency hardware wallet application
CN104581472A (en) Headset with identity authentication function
CN110602140A (en) Encryption and decryption method and system for chip authorization
CN111404953A (en) Message encryption method, message decryption method, related devices and related systems
CN115242514B (en) Privacy set intersection method and system based on state secret, electronic equipment and storage medium
CN115603907A (en) Method, device, equipment and storage medium for encrypting storage data
CN111404892A (en) Data supervision method and device and server
CN114465826B (en) Data encryption method, system and storage medium of coding technology
CN104092680A (en) Coding and decoding method, device and system for audio signal
CN111949996A (en) Generation method, encryption method, system, device and medium of security private key
CN114329555A (en) Video file encryption processing method and device, storage medium and equipment
CN115757535A (en) Data query method, data storage method and device and electronic equipment
CN111414341B (en) Data normalization description method in Internet of things environment
CN108985109A (en) A kind of date storage method and device
CN101325494B (en) Method and device for protecting private information
CN115935299A (en) Authorization control method, device, computer equipment and storage medium
CN107566123A (en) PPTP VPN passwords methods of calibration and computer-readable recording medium
CN103902921A (en) File encryption method and system
CN103905192A (en) Encryption authentication method, device and system
CN113645025A (en) Data encryption storage method, storage device, user equipment and storage medium

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
GR01 Patent grant
GR01 Patent grant