A data encryption method and related device
By using the key service center and encryption algorithm to encrypt data in the distributed cloud storage system, the security problem of data storage in multiple servers is solved, and multi-layer protection and security improvement of data are achieved.
Patent Information
- Application Number
- CN201910007689.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-01-04
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2039-01-04
AI Technical Summary
In a distributed cloud storage system, how to ensure data security when data is distributed and stored on multiple servers and prevent data leakage caused by hackers.
By sending a key request to the key service center on the client, receiving the encryption key, and encrypting the original data based on the encryption key and multiple encryption algorithms to generate encrypted data, a multi-layer protection mechanism is provided to prevent data leakage.
It effectively improves the security performance of data, prevents data leakage, and enhances the security of data in distributed cloud storage systems.
Smart Images

Figure CN109815715B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a data encryption method and related devices. Background Art
[0002] With the rapid development of Internet companies, as more and more data is generated by enterprise business systems, enterprises have higher and higher requirements for data storage. Therefore, in order to ensure the stability of data and the speed of network processing, most networks have transitioned from traditional centralized network computing models to distributed and collaborative network computing models. Distributed and collaborative network computing models not only ensure that performance and capacity can be expanded at the same time, and the system scale has strong scalability, but also improve the reliability, availability and access efficiency of the system.
[0003] However, with the promotion and application of distributed cloud storage systems, how to ensure data security when distributing data to multiple servers has attracted more and more attention from users. In traditional technical solutions, data is usually read and written when the client opens the storage volume. However, as long as the storage volume can be opened, anyone can obtain the unencrypted data in the storage volume. Therefore, if the system is hacked, the storage volume may be opened, resulting in data leakage. Summary of the invention
[0004] The embodiment of the present invention discloses a data encryption method and a related device. The implementation of the embodiment of the present invention is conducive to preventing data leakage.
[0005] A first aspect of an embodiment of the present invention provides a data encryption method, comprising:
[0006] When receiving the encryption instruction, a key request is sent to the key service center;
[0007] receiving a key request response to the key request sent by the key service center, wherein the key request response includes an encryption key;
[0008] The original data is encrypted according to the encryption key and N encryption algorithms to obtain encrypted data, wherein the original data is obtained by the client from the storage volume of the client, and N is a positive integer.
[0009] A second aspect of an embodiment of the present invention provides a data encryption device, including:
[0010] A sending module, used to send a key request to a key service center when receiving an encryption instruction;
[0011] A receiving module, configured to receive a key request response to the key request sent by the key service center, wherein the key request response includes an encryption key;
[0012] The encryption module is used to encrypt the original data according to the encryption key and N encryption algorithms to obtain encrypted data, wherein the original data is obtained by the client from the storage volume of the client, and N is a positive integer.
[0013] A third aspect of an embodiment of the present invention provides a data encryption electronic device, comprising a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the processor to perform part or all of the steps of any one of the data encryption methods recorded in the above method embodiments.
[0014] A fourth aspect of an embodiment of the present invention provides a computer storage medium, wherein the computer-readable storage medium is used to store a computer program, and the stored computer program is executed by the processor to implement part or all of the steps of any data encryption method recorded in the above method embodiments.
[0015] It can be seen that in the above technical solution, when receiving an encryption instruction, the client sends a key request to the key service center, and when the key service center authenticates the client, it sends an encryption key to the client. Next, the importance level of the original data is determined, so as to generate a data identifier that matches the importance level of the original data, and then obtain the encryption level of the original data. Then, the client selects N encryption algorithms that match the encryption level from the encryption algorithm database, and then encrypts the original data according to the encryption key and the N encryption algorithms to obtain encrypted data. By selectively using N encryption algorithms to encrypt the original data according to the encryption level, the client provides a multi-layer protection mechanism for important data, prevents data leakage, and improves data security performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0017] in:
[0018] Figure 1-a A schematic diagram of a data encryption method provided by an embodiment of the present invention;
[0019] Figure 1-b A schematic diagram of the architecture of a communication system provided by an embodiment of the present invention;
[0020] Figure 2 A schematic diagram of a flow chart of another data encryption method provided by an embodiment of the present invention;
[0021] Figure 3 A schematic diagram of a flow chart of another data encryption method provided by an embodiment of the present invention;
[0022] Figure 4 A schematic diagram of a data encryption device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0023] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0024] The terms "including" and "having" and any variations thereof in the specification and claims of the present invention and the above drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products or devices.
[0025] An embodiment of a method for data encryption of the present invention. A method for data encryption includes: upon receiving an encryption instruction, sending a key request to a key service center;
[0026] receiving a key request response to the key request sent by the key service center, wherein the key request response includes an encryption key;
[0027] The original data is encrypted according to the encryption key and N encryption algorithms to obtain encrypted data, wherein the original data is obtained by the client from the storage volume of the client, and N is a positive integer.
[0028] First, see Figure 1-a and Figure 1-b , Figure 1-a A flowchart of a data encryption method provided for an embodiment of the present invention. Figure 1-a The scheme shown can be found in Figure 1-b The system of the architecture shown in the figure is a specific embodiment. Figure 1-aAs shown, a data encryption method provided by an embodiment of the present invention may include:
[0029] 101. When receiving an encryption instruction, the client sends a key request to the key service center.
[0030] 102. The client receives a key request response sent by the key service center in response to the key request.
[0031] The key request response includes an encryption key.
[0032] 103. The client encrypts the original data according to the encryption key and N encryption algorithms to obtain encrypted data.
[0033] The original data is obtained by the client from the storage volume of the client, and N is a positive integer.
[0034] Here, N may be equal to 1, 2, 3, 5, 6, 11, 13, 20 or other values, for example.
[0035] The storage volume may include, for example, a storage area divided from a hard disk.
[0036] The encryption algorithm may include, for example, a symmetric encryption algorithm and an asymmetric encryption algorithm.
[0037] See also Figure 2 , Figure 2 A flowchart of another data encryption method provided by another embodiment of the present invention is shown below. Figure 2 As shown, another data encryption method provided by another embodiment of the present invention may include:
[0038] 201. When receiving an encryption instruction, the client sends a key request to the key service center.
[0039] Optionally, in a possible implementation of the present invention, the key request carries the identity authentication information of the client, wherein the identity authentication information of the client is used by the key service center to authenticate the client, and when the identity authentication passes, the key service center establishes a communication channel to send the key request response to the client through the communication channel.
[0040] 202. The client receives a key request response sent by the key service center in response to the key request.
[0041] The key request response includes an encryption key.
[0042] 203. The client sets M preset rules.
[0043] Wherein, M is a positive integer.
[0044] Here, M may be equal to 1, 2, 3, 5, 6, 11, 13, 20 or other values, for example.
[0045] The preset rules may include, for example, regular expressions.
[0046] 204. The client uses the M preset rules to detect the original data to determine that the original data satisfies K preset rules among the M preset rules.
[0047] Wherein, K is a positive integer, M≥K.
[0048] Here, K may be equal to 1, 2, 3, 5, 6, 11, 13, 20 or other values, for example.
[0049] Optionally, in the first aspect, in a possible implementation manner of the present invention, the original data includes video data, and the using the M preset rules to detect the original data to determine that the original data satisfies K preset rules among the M preset rules includes:
[0050] Parsing the video data to obtain L image frames, where L is a positive integer;
[0051] Extracting data of each image frame in the L image frames to obtain Q data sets, wherein the i-th data set in the Q data sets corresponds to the i-th image frame in the L image frames, Q and i are both positive integers, and Q=L;
[0052] The M preset rules are used to detect each of the Q data sets to determine whether the Q data sets satisfy the K preset rules of the M preset rules in total.
[0053] Herein, L may be equal to 1, 2, 3, 5, 6, 11, 13, 20 or other values, for example.
[0054] Here, Q may be equal to 1, 2, 3, 5, 6, 11, 13, 20 or other values, for example.
[0055] Here, i may be equal to 1, 2, 3, 5, 6, 11, 13, 20 or other values, for example.
[0056] Optionally, based on the first aspect, in a possible implementation of the present invention, the using the M preset rules to detect each of the Q data sets to determine whether the Q data sets satisfy a total of the K preset rules of the M preset rules includes:
[0057] Detect each of the Q data sets using the M preset rules. If only one of the Q data sets satisfies the K preset rules among the M preset rules, then the Q data sets together satisfy the K preset rules.
[0058] Alternatively, detect each of the Q data sets using the M preset rules. If R of the Q data sets satisfy E of the M preset rules and S of the Q data sets satisfy F of the M preset rules, then the Q data sets together satisfy the K preset rules, where K = E + F, and R, S, E, and F are positive integers, and the E preset rules are different from any of the F preset rules.
[0059] Among them, R can be equal to 1, 2, 3, 5, 6, 11, 13, 20 or other values, for example.
[0060] Among them, S can be equal to 1, 2, 3, 5, 6, 11, 13, 20 or other values, for example.
[0061] Among them, E can be equal to 1, 2, 3, 5, 6, 11, 13, 20 or other values, for example.
[0062] Among them, F can be equal to 1, 2, 3, 5, 6, 11, 13, 20 or other values, for example.
[0063] 205. The client determines the importance level of the original data.
[0064] Among them, the importance level of the original data is proportional to the number of preset rules satisfied by the original data.
[0065] Optionally, in a possible implementation manner of the present invention, the determining the importance level of the original data, where the importance level of the original data is proportional to the number of preset rules satisfied by the original data, includes:
[0066] Determine the importance level of the Q data sets, where the importance level of the Q data sets is proportional to the number of preset rules satisfied by the Q data sets;
[0067] Process the importance level of the Q data sets according to a preset ratio to obtain the importance level of the video data. Among them, when Q > K, the preset ratio is equal to (Q - K) / K; when Q = K, the preset ratio is equal to 1; when Q < K, the preset ratio is equal to (K - Q) / K.
[0068] 206. The client generates a data identifier matching the importance level of the original data.
[0069] The data identifier is used to identify the original data.
[0070] 207. The client obtains the encryption level J matching the data identifier from the encryption level database.
[0071] Wherein, J is a positive integer.
[0072] Here, J may be equal to 1, 2, 3, 5, 6, 11, 13, 20 or other values, for example.
[0073] 208. The client selects the N encryption algorithms matching the encryption level J from the encryption algorithm database.
[0074] Among them, N=J.
[0075] 209. The client encrypts the original data according to the encryption key and N encryption algorithms to obtain encrypted data.
[0076] The original data is obtained by the client from the storage volume of the client, and N is a positive integer.
[0077] Here, N may be equal to 1, 2, 3, 5, 6, 11, 13, 20 or other values, for example.
[0078] The storage volume may include, for example, a storage area divided from a hard disk.
[0079] The encryption algorithm may include, for example, a symmetric encryption algorithm and an asymmetric encryption algorithm.
[0080] Optionally, in a possible implementation manner of the present invention, encrypting the original data according to the encryption key and N encryption algorithms to obtain encrypted data includes:
[0081] Encrypting the L image frames according to the encryption key and N encryption algorithms to obtain L encrypted image frames;
[0082] The L encrypted image frames are synthesized to form encrypted video data.
[0083] See also Figure 3 , Figure 3 A flowchart of another data encryption method provided by another embodiment of the present invention is shown below. Figure 3 As shown, another data encryption method provided by another embodiment of the present invention may include:
[0084] 301. When receiving the encryption instruction, the client sends a key request to the key service center.
[0085] Optionally, in a possible implementation of the present invention, the key request carries the identity authentication information of the client, wherein the identity authentication information of the client is used by the key service center to authenticate the client, and when the identity authentication passes, the key service center establishes a communication channel to send the key request response to the client through the communication channel.
[0086] 302. The client receives a key request response to the key request sent by the key service center.
[0087] The key request response includes an encryption key.
[0088] 303. The client sets M preset rules.
[0089] Wherein, M is a positive integer.
[0090] Here, M may be equal to 1, 2, 3, 5, 6, 11, 13, 20 or other values, for example.
[0091] The preset rules may include, for example, regular expressions.
[0092] 304. The client uses the M preset rules to detect the original data to determine that the original data satisfies K preset rules among the M preset rules.
[0093] Wherein, K is a positive integer, M≥K.
[0094] Here, K may be equal to 1, 2, 3, 5, 6, 11, 13, 20 or other values, for example.
[0095] Optionally, in the first aspect, in a possible implementation manner of the present invention, the original data includes video data, and the using the M preset rules to detect the original data to determine that the original data satisfies K preset rules among the M preset rules includes:
[0096] Parsing the video data to obtain L image frames, where L is a positive integer;
[0097] Extracting data of each image frame in the L image frames to obtain Q data sets, wherein the i-th data set in the Q data sets corresponds to the i-th image frame in the L image frames, Q and i are both positive integers, and Q=L;
[0098] The M preset rules are used to detect each of the Q data sets to determine whether the Q data sets satisfy the K preset rules of the M preset rules in total.
[0099] Herein, L may be equal to 1, 2, 3, 5, 6, 11, 13, 20 or other values, for example.
[0100] Here, Q may be equal to 1, 2, 3, 5, 6, 11, 13, 20 or other values, for example.
[0101] Here, i may be equal to 1, 2, 3, 5, 6, 11, 13, 20 or other values, for example.
[0102] Optionally, based on the first aspect, in a possible implementation of the present invention, the using the M preset rules to detect each of the Q data sets to determine whether the Q data sets satisfy a total of the K preset rules of the M preset rules includes:
[0103] Using the M preset rules to detect each of the Q data sets, if only one data set among the Q data sets satisfies the K preset rules among the M preset rules, then the Q data sets satisfy the K preset rules in total;
[0104] Alternatively, the M preset rules are used to detect each of the Q data sets. If R data sets among the Q data sets satisfy E preset rules among the M preset rules, and S data sets among the Q data sets satisfy F preset rules among the M preset rules, then the Q data sets satisfy the K preset rules in total, where K=E+F, R, S, E and F are positive integers, and the E preset rules are different from any one of the F preset rules.
[0105] Here, R may be equal to 1, 2, 3, 5, 6, 11, 13, 20 or other values, for example.
[0106] Here, S may be equal to 1, 2, 3, 5, 6, 11, 13, 20 or other values, for example.
[0107] Here, E may be equal to 1, 2, 3, 5, 6, 11, 13, 20 or other values, for example.
[0108] Here, F may be equal to 1, 2, 3, 5, 6, 11, 13, 20 or other values, for example.
[0109] Optionally, in the second aspect, in a possible implementation of the present invention, the original data includes document data, and the using the M preset rules to detect the original data to determine that the original data satisfies K preset rules among the M preset rules includes:
[0110] Parsing the document data to obtain T fields, where T is a positive integer;
[0111] Compare the T fields with H preset fields to obtain G keyword fields for which the comparison is successful, where H and G are positive integers, T < H, and G ≤ T;
[0112] Extract the data of each of the G keyword fields to obtain G data sets, where the i-th data set among the G data sets corresponds to the i-th keyword field among the G keyword fields;
[0113] Use the M preset rules to detect each of the G data sets to determine that the G data sets altogether satisfy K of the M preset rules.
[0114] 305. The client determines the importance level of the original data.
[0115] Wherein, the importance level of the original data is proportional to the number of preset rules satisfied by the original data.
[0116] Optionally, in a possible implementation manner of the present invention, the determining the importance level of the original data, wherein the importance level of the original data is proportional to the number of preset rules satisfied by the original data, includes:
[0117] Determine the importance level of the Q data sets, where the importance level of the Q data sets is proportional to the number of preset rules satisfied by the Q data sets;
[0118] Process the importance levels of the Q data sets according to a preset ratio to obtain the importance level of the video data, where when Q > K, the preset ratio is equal to (Q - K) / K, when Q = K, the preset ratio is equal to 1, and when Q < K, the preset ratio is equal to (K - Q) / K.
[0119] 306. The client generates a data identifier matching the importance level of the original data.
[0120] Wherein, the data identifier is used to identify the original data.
[0121] 307. The client obtains an encryption level J matching the data identifier from an encryption level database.
[0122] Where J is a positive integer.
[0123] Wherein, J can be equal to 1, 2, 3, 5, 6, 11, 13, 20 or other values, for example.
[0124] 308. The client selects the N encryption algorithms matching the encryption level J from an encryption algorithm database.
[0125] Where N = J.
[0126] 309. The client encrypts the L image frames according to the encryption key and N encryption algorithms to obtain L encrypted image frames.
[0127] The original data is obtained by the client from the storage volume of the client, and N is a positive integer.
[0128] Wherein, the original data includes video data.
[0129] Here, N may be equal to 1, 2, 3, 5, 6, 11, 13, 20 or other values, for example.
[0130] The storage volume may include, for example, a storage area divided from a hard disk.
[0131] The encryption algorithm may include, for example, a symmetric encryption algorithm and an asymmetric encryption algorithm.
[0132] 310. The client synthesizes the L encrypted image frames to form encrypted video data.
[0133] See also Figure 4 , Figure 4 A schematic diagram of a data encryption device provided by an embodiment of the present invention. Figure 4 As shown, a data encryption device 400 provided by one embodiment of the present invention may include:
[0134] The sending module 401 is used to send a key request to the key service center when receiving an encryption instruction.
[0135] The receiving module 402 is configured to receive a key request response sent by the key service center in response to the key request.
[0136] The key request response includes an encryption key.
[0137] The encryption module 403 is used to encrypt the original data according to the encryption key and N encryption algorithms to obtain encrypted data.
[0138] The original data is obtained by the client from the storage volume of the client, and N is a positive integer.
[0139] Here, N may be equal to 1, 2, 3, 5, 6, 11, 13, 20 or other values, for example.
[0140] The storage volume may include, for example, a storage area divided from a hard disk.
[0141] The encryption algorithm may include, for example, a symmetric encryption algorithm and an asymmetric encryption algorithm.
[0142] An embodiment of the present invention also provides a data encryption electronic device, characterized in that it includes a processor, a memory, a communication interface and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the processor to execute part or all of the steps of any one of the data encryption methods recorded in the above method embodiments.
[0143] An embodiment of the present invention further provides a computer storage medium, wherein the computer storage medium may store a program to implement part or all of the steps of any one of the data encryption methods recorded in the above method embodiments.
[0144] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
[0145] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0146] In the several embodiments provided in the present application, it should be understood that the disclosed device can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of the modules, which is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the device or module can be electrical or other forms.
[0147] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0148] In addition, each functional module in each embodiment of the present invention may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of software functional modules.
[0149] If the integrated module is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0150] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for data encryption, characterized in that, it includes: When receiving an encryption instruction, sending a key request to the key service center; Receiving a key request response for the key request sent by the key service center, wherein the key request response includes an encryption key; Encrypting the original data according to the encryption key and N encryption algorithms to obtain encrypted data, wherein the original data is obtained by the client from the storage volume of the client, and N is a positive integer; Before encrypting the original data according to the encryption key and N encryption algorithms to obtain encrypted data, it includes: Setting M preset rules, wherein M is a positive integer, and the preset rules include regular expressions; Detecting the original data using the M preset rules to determine that the original data satisfies K of the M preset rules, wherein K is a positive integer and M≥K; Determining the importance level of the original data, wherein the importance level of the original data is proportional to the number of preset rules satisfied by the original data; Generating a data identifier matching the importance level of the original data, wherein the data identifier is used to identify the original data; Obtaining an encryption level J matching the data identifier from the encryption level database, wherein J is a positive integer; Selecting the N encryption algorithms matching the encryption level J from the encryption algorithm database, wherein N = J; The original data includes video data, and the detecting the original data using the M preset rules to determine that the original data satisfies K of the M preset rules includes: Parsing the video data to obtain L image frames, wherein L is a positive integer; Extracting the data of each of the L image frames to obtain Q data sets, wherein the i-th data set in the Q data sets corresponds to the i-th image frame in the L image frames, and both Q and i are positive integers, Q = L; Detecting each of the Q data sets using the M preset rules to determine that the Q data sets altogether satisfy the K of the M preset rules; The determining the importance level of the original data, wherein the importance level of the original data is proportional to the number of preset rules satisfied by the original data, includes: Determining the importance level of the Q data sets, wherein the importance level of the Q data sets is proportional to the number of preset rules satisfied by the Q data sets; Processing the importance level of the Q data sets according to a preset ratio to obtain the importance level of the video data, wherein when Q>K, the preset ratio is equal to (Q - K) / K, when Q = K, the preset ratio is equal to 1, and when Q<K, the preset ratio is equal to (K - Q) / K; The encrypting the original data according to the encryption key and N encryption algorithms to obtain encrypted data includes: Encrypting the L image frames according to the encryption key and N encryption algorithms to obtain L encrypted image frames; The L encrypted image frames are synthesized to form encrypted video data.
2. The method according to claim 1, It is characterized in that The key request carries the identity authentication information of the client, wherein the identity authentication information of the client is used by the key service center to authenticate the client. When the identity authentication passes, the key service center builds a communication channel to send the key request response to the client through the communication channel.
3. The method according to claim 1, It is characterized in that The using the M preset rules to detect each of the Q data sets to determine whether the Q data sets satisfy the K preset rules of the M preset rules in total includes: Using the M preset rules to detect each of the Q data sets, if only one data set among the Q data sets satisfies the K preset rules among the M preset rules, then the Q data sets satisfy the K preset rules in total; Alternatively, the M preset rules are used to detect each of the Q data sets. If R of the Q data sets satisfy E of the M preset rules, and S of the Q data sets satisfy F of the M preset rules, then the Q data sets satisfy K preset rules in total, where K=E+F, R, S, E and F are positive integers, and the E preset rules are different from any one of the F preset rules.
4. A data encryption device, It is characterized in that The data encryption device is used to implement the method described in any one of claims 1-3.
5. An electronic device for data encryption, It is characterized in that The method comprises a processor, a memory, a communication interface and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor as the method according to any one of claims 1 to 3.
6. A computer-readable storage medium, It is characterized in that The computer-readable storage medium is used to store a computer program, and the computer program is executed by a processor to implement the method according to any one of claims 1 to 3.
