A code resource encryption compression processing method and device

Through the compression method of multi-level sorting of code resource data and repeated data emptying, combined with ciphertext encryption technology, the problems of leakage, tampering and low efficiency in the transmission of code resource data are solved, and efficient and secure data transmission is achieved.

CN119109632BActive Publication Date: 2025-02-28CHINA ACADEMY OF INFORMATION & COMM
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411145650.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-20
Publication Date
2025-02-28
Estimated Expiration
2044-08-20

AI Technical Summary

Technical Problem

The prior art lacks effective compression and encryption methods in the transmission of code resource data, resulting in data being easily leaked and tampered with low transmission efficiency.

Method used

The data compression method of multi-level sorting and repeated data empty is adopted, and the first ciphertext and the second ciphertext are generated for encryption, and the decryption and decompression are used to restore the original code number resource data.

Benefits of technology

It effectively hides the real content of the data, reduces the risk of data being tampered with or abuse, and reduces the data scale and improves transmission efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000_ABST
    Figure 00000000_0000_ABST
Patent Text Reader

Abstract

The present application discloses a method for encrypting and compressing code number resources, comprising the following steps: compressing code number resource data; generating a first ciphertext, wherein the first ciphertext comprises a field in the compressed code number resource data and an identifier representing the probability of occurrence of the field; replacing the field in the compressed code number resource data with the identifier, and generating a second ciphertext after randomly sequencing each row and / or column; generating a secret key for decryption, wherein the secret key comprises the random sequencing rule. The method of the present application also comprises a reverse processing process. The present application also comprises a device for implementing the method. The method and device of the present application solve the problem that code number data is easily leaked and tampered with, and the transmission efficiency is low.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer and communication technology, and in particular to a method and device for encrypting and compressing code resources. Background Art

[0002] Number resources are user numbers and network numbers composed of numbers and symbols used to implement telecommunication functions. They are essential telecommunication resources for routing identification and network equipment identification in telecommunication networks. With the rapid development of Internet applications in recent years, number resources are increasingly carrying non-communication functions such as Internet registration, user identity determination, and Internet marking, and the demand for cross-industry sharing and collaboration of number resources is becoming increasingly strong. In order to broadcast, distribute, call, and query number resource data between different units, effective encryption and compression must be performed based on the data characteristics of number resources.

[0003] During the transmission of code number resource data, due to the large amount of data and certain regularities in the data content, the existing related technologies lack effective compression and encryption methods based on the characteristics of code number resource data, resulting in the code number data being easily leaked and tampered with, and low transmission efficiency. Summary of the invention

[0004] The present application proposes a method and device for encrypting and compressing code number resources to solve the problems in the prior art that code number data is easily leaked and tampered with and has low transmission efficiency.

[0005] In a first aspect, an embodiment of the present application proposes a method for encrypting and compressing code resources, comprising the following steps:

[0006] Compressing code number resource data;

[0007] Generate a first ciphertext, wherein the first ciphertext includes a field in the compressed code number resource data and an identifier indicating a probability of occurrence of the field;

[0008] After replacing the fields in the compressed code resource data with the identifier, randomly sequence each row and / or each column to generate a second ciphertext;

[0009] A secret key for decryption is generated, wherein the secret key includes the randomly sequenced rules.

[0010] In one embodiment, the compressed code number resource data is a compression group generated by sorting the code number resource data to be compressed by columns in multiple levels and eliminating adjacent duplicate data in each column.

[0011] In one embodiment, the compressed code number resource data is a compression group generated by sorting the code number resource data to be compressed in multiple levels by column according to a set column priority and eliminating adjacent duplicate data in each column.

[0012] In one embodiment, the compressed code number resource data is an optimal compression group generated by combining the code number resource data to be compressed according to multiple column priorities, sorting the columns in multiple levels, and eliminating adjacent duplicate data in each column.

[0013] In one embodiment, the identifier is a positive integer serial number, and the probabilities represented are sorted from large to small.

[0014] In one embodiment, when randomly numbering each row, a column containing row number identification is added to the code number resource data; when randomly numbering each column, a row containing column number identification is added to the code number resource data; the secret key includes the numbered row number identification sequence and / or column number identification sequence.

[0015] In one embodiment, the secret key includes data indicating the column priority relationship of the selected compression group or the optimal compression group.

[0016] In a second aspect, an embodiment of the present application further proposes a method for encrypting and compressing code resources, using a first ciphertext, a second ciphertext and a secret key generated by the method of any one of the embodiments of the first aspect of the present application, comprising the following steps:

[0017] Performing restoration processing on the row data and / or column data of the second ciphertext according to the random sequence rule in the secret key;

[0018] According to the first ciphertext, replace the identifier in the restored second ciphertext with the corresponding field to obtain a restored compressed group;

[0019] The compressed group is decompressed to generate the original code resource data.

[0020] In a third aspect, an embodiment of the present application further proposes a code resource encryption compression processing device, which is used to implement the method described in the first aspect or the second aspect of the present application, including:

[0021] A compression module, used for compressing code number resource data;

[0022] A first ciphertext module, used to generate a first ciphertext, wherein the first ciphertext includes a field in the compressed code number resource data and an identifier indicating the probability of occurrence of the field;

[0023] A second ciphertext module, used to replace the fields in the compressed code resource data with the identifier, and then randomly sequence each row and / or each column to generate a second ciphertext;

[0024] The secret key module is used to generate a secret key for decryption, wherein the secret key includes the random sequence rule.

[0025] In a fourth aspect, the embodiment of the present application further proposes a code resource encryption compression processing device, which is used to implement the method described in the embodiment of the second aspect of the present application, including:

[0026] A second restoration module, used for restoring the row data and / or column data of the second ciphertext according to the random sequence rule in the secret key;

[0027] A first restoration module, used for replacing the identifier in the restored second ciphertext with a corresponding field according to the first ciphertext, to obtain a restored compressed group;

[0028] The decompression module is used to decompress the compressed group and generate original code number resource data.

[0029] In a fifth aspect, an embodiment of the present application further proposes a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the method described in any embodiment of the first aspect and the second aspect of the present application is implemented.

[0030] In the sixth aspect, an embodiment of the present application further proposes an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method described in any embodiment of the first aspect and the second aspect of the present application is implemented.

[0031] At least one of the above technical solutions adopted in the embodiments of the present application can achieve the following beneficial effects:

[0032] The scheme of the present application is to perform data compression and encryption through multi-level sorting, and to calculate the compression ratio to determine the best compression sorting; to encrypt by scrambling the order and replacing the text; in this way, the information is split into two parts, the first ciphertext and the second ciphertext, which need to be combined before use, and have a high degree of confidentiality.

[0033] The structural design of the secret key of the present application is easy to implement, and similarly, the meanings of rows and columns can be interchanged, and flexible combinations can be achieved to form a variety of confidentiality schemes, making the application more flexible.

[0034] Effective encryption and compression are performed based on the characteristics of code resource data. On the one hand, the real content of the data is hidden. Even if the data is obtained by attackers, their content cannot be directly interpreted, which will effectively reduce the risk of data tampering or abuse. On the other hand, the data size is reduced, which will effectively improve transmission efficiency and save transmission resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0036] Figure 1 This is a forward process embodiment of the code resource encryption and compression processing method of this application;

[0037] Figure 2 This is a reverse process embodiment of the code resource encryption and compression processing method of this application;

[0038] Figure 3 This is an embodiment of the forward processing of the device of the present application;

[0039] Figure 4 An embodiment of the reverse processing of the device of the present application;

[0040] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0041] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.

[0042] The code number resources described in this application refer to user numbers and network codes composed of numbers and symbols for realizing telecommunication functions. For example, mobile phone numbers, landline numbers, other numbers, etc. The code number resource data has certain structural and distribution characteristics. In view of these characteristics, this patent adopts an encryption and compression algorithm based on data arrangement order reduction. The code number resource data may include various fields depending on the application scenario. This method can encrypt and compress according to different fields. It is divided into two parts: encryption and compression method and decryption and decompression method. The input of the encryption and compression method is the original information of the code number resource data, and the output is the decryption key, the first ciphertext, and the second ciphertext. The input of the decryption and decompression method is the decryption key, the first ciphertext, and the second ciphertext, and the output is the original information of the code number resource data.

[0043] The technical solutions provided by various embodiments of the present application are described in detail below in conjunction with the accompanying drawings.

[0044] Figure 1 This is a forward process embodiment of the code resource encryption and compression processing method of the present application. In a first aspect, the present application embodiment proposes a code resource encryption and compression processing method, including the following steps 110 to 140:

[0045] Step 110: compress the code number resource data to generate compressed code number resource data.

[0046] It should be noted that there are many existing compression technologies, for example, commonly used compression algorithms include Snappy, Gzip and LZO. By using compression technology, storage space can be reduced, query performance can be improved, and better results can be obtained when processing large-scale data. Each compression technology can be reversed by a corresponding decompression technology. Step 110 is not limited to a single compression technology.

[0047] As the best embodiment of the present application, a method for compressing a data table by multi-level sorting of columns is proposed to compress code resource data.

[0048] In one embodiment, the compressed code number resource data is a compression group generated after the code number resource data to be compressed is sorted by columns in multiple levels and adjacent duplicate data in each column is eliminated. That is to say, after sorting the xth column, the field data of the first row is retained. Starting from the second row, each item is compared with the data of the previous row. If the same field data in the next row is the same as the same field data in the previous row, the content of the field data is deleted and set to empty; if it is not the same, the field data is retained. Furthermore, in the x+1th column, after sorting the column data that meets the same sequence segment of the xth column, the above processing is also performed. The original code number resource data is used as a decompression processing group, such as shown in Table 1. After the above-mentioned multi-level sorting by columns, the compression group generated after eliminating adjacent duplicate data in each column is such as compression group 1 shown in Table 3.

[0049] Preferably, in one embodiment, the compressed code resource data is a compression group generated by sorting the code resource data to be compressed according to the set column priority, and eliminating adjacent duplicate data in each column, such as compression group 2 shown in Table 4. The specific steps are as follows:

[0050] Firstly, a multi-level sorting is performed according to the data fields of the original information of the code number resource, and a plurality of different compression processing groups are generated according to different column orders.

[0051] For example, the code number column is fixed as the first column, and the other fields are distributed from the second to the Xth columns according to the rehearsal combination order, resulting in (X-1)! distributions. Each field distribution is sorted in multiple levels in descending priority from the second column to the Xth column, resulting in (X-1)! different compression processing groups. The correspondence between the columns of the compression processing group and the data field sequence of the original code number resource original information is obtained, that is, the data representing the column priority relationship. For example, [(1,2), (2,1)], the first number in the brackets () represents the column processing priority of the compression processing group, and the second number represents the column number of the original code number resource data. (1,2) means that column 1 of the compression processing group is column 2 of the original code number resource original information, and (2,1) means that column 2 of the compression processing group is column 1 of the original code number resource original information. Preferably, the column order of the compression processing group is the same as the priority order. That is, column 1 of the compression processing group has the highest priority, that is, the priority of column 2 of the original code number resource data is recorded as 1; column 2 of the compression processing group has the second highest priority, that is, the priority of column 1 of the original code number resource data is recorded as 2. In this way, data on the column priority relationship between the compression processing group and the original code number resource data is formed.

[0052] Specific examples are as follows: the column priority of compression processing group 1 is arranged according to the column order of the original code number resources, and the corresponding relationship of compression processing group 1 is [(1,1)(2,2)(3,3)(4,4)…(X,X)], see Table 1; the column priority of compression processing group 2 is different from the column order of the original code number resources, and the corresponding relationship is [(1,1)(2,5)(3,6)(4,2)(5,3)(6,4)…], which represents the set column priority, see Table 2.

[0053] Table 1, Pressure reduction treatment group 1

[0054]

[0055] Table 2, Pressure Reduction Treatment Group 2

[0056]

[0057] Secondly, the information arranged in the compression processing group is compressed, and each compression processing group obtains a corresponding compression group.

[0058] Perform operations on each compression processing group, retain the data of each field in the first row. Compare the data of the second row with the data of the previous row one by one. If the data of the same field in the next row is the same as that in the previous row, delete the data content of the field and make it empty; if they are not the same, retain the data of the field. Obtain the compression group corresponding to each compression processing group, as shown in Tables 3 and 4.

[0059] Table 3. Compression group 1 obtained from pressure reduction treatment group 1

[0060]

[0061]

[0062] Table 4. Compression group 2 obtained from pressure reduction treatment group 2

[0063]

[0064]

[0065] Further preferably, in one embodiment, the compressed code number resource data is an optimal compression group generated by combining the code number resource data to be compressed according to multiple column priorities, sorting them in multiple levels by column, and eliminating adjacent duplicate data in each column.

[0066] The compression effect ratio of each compression group is obtained by dividing the total number of bytes occupied by each compression processing group information by the total number of bytes occupied by the corresponding compression group information. For example, the compression effect of compression group 2 is better than that of compression group 1. The compression group with the best compression effect ratio is selected as the target compression group. When there are multiple compression groups with the same compression effect ratio, one of these compression groups is randomly selected as the target compression group.

[0067] Step 120: Generate a first ciphertext, wherein the first ciphertext includes a field in the compressed code number resource data and an identifier indicating the probability of occurrence of the field.

[0068] In one embodiment, the identifier is a positive integer serial number, and the probabilities represented are sorted from large to small.

[0069] For example, the compressed code resource data is called the target compression group. In each column of the target compression group, the probability of each non-empty data is calculated. The non-empty data are sorted from large to small according to probability (non-empty data with the same probability can be randomly arranged) and replaced with positive integers starting from 1. The corresponding relationship is recorded to generate the first ciphertext.

[0070] Table 5. Example of target compression group after probability replacement

[0071]

[0072]

[0073] The corresponding first ciphertext is:

[0074] {

[0075] [(13501230000, 1), (13501230001, 2), (13501230005, 3)…]

[0076] [(China Telecom, 1), (China Unicom, 2), (China Mobile, 3)]

[0077] [(express delivery, 1), (harassment, 2), (online ride-hailing, 3)]

[0078] [(Hebei Province, 1), (Shanxi Province, 2)];

[0079] …}

[0080] Step 130: After replacing the fields in the compressed code resource data with the identifier, randomly sequence each row and / or each column to generate a second ciphertext.

[0081] The data set generated after replacing the identifiers is shown in Table 5, and is referred to as "Group M" in this application.

[0082] In one embodiment, when randomly numbering each row, a column containing row number identification is added to the code resource data; when randomly numbering each column, a row containing column number identification is added to the code resource data; the secret key contains the numbered row number identification sequence and / or column number identification sequence. The specific steps are as follows:

[0083] Determine the serialization format. The row / column serialization number can be in decimal or other bases with a fixed bit length. The bit length is the minimum bit length required for the row / column serialization number according to the total number of rows / columns in the target compression group. Taking the decimal base as an example, the selected serialization number bit length should just meet the following relationship: 行 / 列编序序号位长-1 <Total number of rows / columns in target compression group < 10 行 / 列编序序号位长 The same applies to other number systems. Taking the decimal format with a bit length of 3 as an example, the serial number of the 5th line is 005.

[0084] Generate a serialization group. Add a column / row before the first column / row of group M. This column / row is used to serialize the row / column. The numbers are the same for the row / column numbers. Randomly shuffle the order of the rows / columns of group M to which the serialization number column is added to obtain a serialization group.

[0085] Table 6. Example of sequence group

[0086]

[0087]

[0088] The sequence group is represented by the second ciphertext as follows:

[0089] {[,2,3,,2,2,…];

[0090] [2,,6,,,,…];

[0091] [,,9,,,,…];

[0092] [1,1,1,1,1,1,…];

[0093] [, 1, 5, 2, 3, 3, …];

[0094] [1, 2, 8, , 4, 4, …];

[0095] [, , 4, ,, ,, …];

[0096] [, , 7, 3, 1, 1, …];

[0097] [3, , 2, ,, ,, …];

[0098] …

[0099] }

[0100] Step 140, generate a secret key for decryption, and the secret key includes the randomly sequenced rule.

[0101] In one embodiment, the secret key includes data representing the column priority relationship of the selected compression group or the optimal compression group.

[0102] For example: the format of the decryption secret key is:

[0103] {[Sequencing format base], [Row sequencing serial number length], [Column sequencing serial number length], [All row sequencing serial numbers connected in sequence], [All column sequencing serial numbers connected in sequence], [Selected compression group column priority relationship]}

[0104] For the sequencing group shown in Table 6, the corresponding decryption secret key is:

[0105] {[Ten], [3], [2], [003006009001005008004007002…], [030401020506…], [(1, 1)(2, 2)(3, 3)(4, 4)…(X, X)]}

[0106] Figure 2 This is an embodiment of the reverse process of the method for encrypting and compressing code number resources in this application. Second, the embodiments of this application also propose a method for encrypting and compressing code number resources, using the first ciphertext, the second ciphertext, and the secret key generated by the method of any one of the embodiments in the first aspect of this application, including the following steps:

[0107] Step 210, according to the randomly sequenced rule in the secret key, perform a reduction process (sequence reduction) on the row data and / or column data of the second ciphertext.

[0108] Row sequencing reduction, read the sequencing format base and the row sequencing bit length in the secret key, identify the row sequencing sequence information in all row sequencing serial numbers connected in sequence, and restore the row order in the second ciphertext.

[0109] Column serialization restoration: read the serialization format and column serialization bit length in the secret key, identify the column serialization sequence information in the sequential connection of all column serialization numbers, and restore the order of the columns in the second ciphertext.

[0110] Step 220: According to the first ciphertext, replace the identifier in the restored second ciphertext with the corresponding field to obtain a restored compressed group (decrypted).

[0111] Restoration text replacement: Use the information of the first ciphertext to replace the positive integer in the second ciphertext restored in step 210 to obtain the restored target compression group.

[0112] Step 230: decompress the compressed group to generate original code resource data (decompression and restoration).

[0113] Restore to empty information: Starting from the second row, if a field is empty, the empty information will be changed to the information of the previous row.

[0114] Restore the original order: Use the [Selected compression group column priority relationship] in the key to change the order of each column to the original order and remember the original file.

[0115] It should be noted that the execution subject of each step of the method provided in the embodiment of the present application can be the same device, or the method can be executed by different devices. For example, the execution subject of step 110 and step 120 can be device 1, and the execution subject of step 130 can be device 2; for another example, the execution subject of step 110 can be device 1, and the execution subject of steps 120 and 130 can be device 2; and so on.

[0116] Figure 3 In a third aspect, the embodiment of the present application further proposes a code resource encryption compression processing device, which is used to implement the method described in the first aspect or the second aspect of the present application, including:

[0117] The compression module 310 is used to compress the code resource data. The original code resource data is input into the compression module, and the function described in step 110 of the embodiment is executed to generate a target compression group.

[0118] The first ciphertext module 320 is used to generate a first ciphertext, which includes a field in the compressed code resource data and an identifier indicating the probability of occurrence of the field. The target compressed group obtained after compression is input into the first ciphertext module, and the function described in step 120 of the embodiment is executed to generate the first ciphertext.

[0119] The second ciphertext module 330 is used to replace the fields in the compressed code resource data with the identifier, and then randomly sequence each row and / or column to generate the second ciphertext. The target compression group is input into the second ciphertext module, and the function described in step 130 of the embodiment is executed to generate M groups first, and then sequence to generate the second ciphertext.

[0120] The key module 340 is used to generate a decryption key, the key including the random sequence rule. According to the target compression group obtained by the compression module and the random sequence rule of the second ciphertext module, the function described in step 140 of the embodiment is executed to generate a decryption key.

[0121] Figure 4 In a fourth aspect, the embodiment of the present application further proposes a code resource encryption compression processing device, which is used to implement the method described in the embodiment of the second aspect of the present application, including:

[0122] The second restoration module 410 is used to restore the row data and / or column data of the second ciphertext according to the random sequence rule in the secret key. For example, the function of step 210 of the embodiment is executed to generate M groups.

[0123] The first restoration module 420 is used to replace the identifier in the restored second ciphertext with the corresponding field according to the first ciphertext to obtain the restored compression group. For example, the function of step 220 of the embodiment is executed to generate the target compression group.

[0124] The decompression module 430 is used to decompress the compressed group to generate the original code resource data, for example, to perform the function of step 230 of the embodiment.

[0125] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0126] Therefore, the present application also proposes a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the method described in any embodiment of the present application is implemented.

[0127] Furthermore, the present application also proposes an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described in any embodiment of the present application when executing the computer program.

[0128] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0129] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0130] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0131] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory. The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.

[0132] Figure 5 600 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device 600 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiment of the present application. It includes: one or more processors 620; a storage device 610, which is used to store one or more programs. When the one or more programs are run by the one or more processors 620, the one or more processors 620 implement the method described in the first aspect and / or the second aspect of the present application.

[0133] The electronic device 600 further includes an input device 630 and an output device 640; the processor 620, storage device 610, input device 630 and output device 640 in the electronic device can be connected via a bus or other means, and the figure takes the connection via a bus 650 as an example.

[0134] The storage device 610, as a computer-readable storage medium, can be used to store software programs, computer executable programs, and module units, such as program instructions corresponding to the method in the embodiment of the present application. The storage device 610 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application required for at least one function; the storage data area may store data created according to the use of the terminal, etc. In addition, the storage device 610 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the storage device 610 may further include a memory remotely arranged relative to the processor 620, and these remote memories may be connected via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0135] The input device 630 may be used to receive input numbers, character information or voice information, and generate key signal input related to user settings and function control of the electronic device. The output device 640 may include electronic devices such as a display screen and a speaker.

[0136] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0137] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims

1. A code resource encryption and compression processing method, characterized in that: include: Compressing the code resource data, the compressed code resource data is a compression group generated by sorting the code resource data to be compressed by columns in multiple levels and eliminating adjacent duplicate data in each column; Generate a first ciphertext, wherein the first ciphertext includes a field in the compressed code number resource data and an identifier indicating a probability of occurrence of the field; After replacing the fields in the compressed code resource data with the identifier, randomly sequence each row and / or each column to generate a second ciphertext; A secret key for decryption is generated, wherein the secret key includes the randomly sequenced rules.

2. The method for encrypting and compressing code resources according to claim 1, wherein: The code resource data to be compressed is sorted in multiple levels by column according to the set column priority.

3. The method for encrypting and compressing code resources according to claim 1, wherein: The code resource data to be compressed is combined according to multiple column priorities, sorted by columns in multiple levels, and the optimal compression group is generated after adjacent duplicate data in each column is eliminated.

4. The method for encrypting and compressing code resources according to claim 1, wherein: include: The identifier is a positive integer serial number, and the probabilities represented are sorted from large to small.

5. The method for encrypting and compressing code resources according to claim 1, wherein: include: When randomly numbering each row, a column containing row number identification is added to the code resource data; When randomly serializing each column, add a row containing the column serial number identifier in the code resource data; The secret key includes a serialized row number identification sequence and / or a column number identification sequence.

6. The method for encrypting and compressing code resources according to any one of claims 2 to 4, characterized in that: include: The secret key includes data indicating the column priority relationship of the selected compression group or the optimal compression group.

7. A method for encrypting and compressing code resources, using the first ciphertext, the second ciphertext and the secret key generated by the method of any one of claims 1 to 6, characterized in that: include: Performing restoration processing on the row data and / or column data of the second ciphertext according to the random sequence rule in the secret key; According to the first ciphertext, replace the identifier in the restored second ciphertext with the corresponding field to obtain a restored compressed group; The compressed group is decompressed to generate the original code resource data.

8. A code resource encryption compression processing device, used to implement the method according to any one of claims 1 to 7, characterized in that: include: A compression module, used for compressing the code resource data, wherein the compressed code resource data is a compression group generated by sorting the code resource data to be compressed by columns in multiple levels and eliminating adjacent duplicate data in each column; A first ciphertext module, used to generate a first ciphertext, wherein the first ciphertext includes a field in the compressed code number resource data and an identifier indicating the probability of occurrence of the field; A second ciphertext module, used to replace the fields in the compressed code resource data with the identifier, and then randomly sequence each row and / or each column to generate a second ciphertext; The secret key module is used to generate a secret key for decryption, wherein the secret key includes the random sequence rule.

9. A code resource encryption compression processing device, used to implement the method of claim 7, characterized in that: include: A second restoration module, used for restoring the row data and / or column data of the second ciphertext according to the random sequence rule in the secret key; A first restoration module, used for replacing the identifier in the restored second ciphertext with a corresponding field according to the first ciphertext, to obtain a restored compressed group; The decompression module is used to decompress the compressed group and generate original code number resource data.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

11. An electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Serial number encoding method and device, serial number decoding method and device and electronic equipment

    CN112118017A

  • Log file processing method, electronic equipment and storage medium

    CN112749139A