Data secure storage and query method, system and device and storage medium

By encrypting and decrypting data to be stored in the data security management system, the problem of computer data leakage is solved and data security and system stability are improved.

CN118689869APending Publication Date: 2024-09-24BEIJING HONGTENG INTELLIGENT TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202310288179.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-22
Publication Date
2024-09-24

AI Technical Summary

Technical Problem

Computer data security incidents occur frequently, resulting in serious data leakage problems, and it is difficult for existing technologies to effectively protect data security.

Method used

A data security storage and query method is designed, which uses the data access unit, meta-storage unit and data warehouse in the data security management system to query whether there are fields to be encrypted in the data to be stored, and the fields to be encrypted according to the data encryption key. Encrypt, generate columnar storage format files, and use the master encryption key to decrypt when querying to ensure data security.

Benefits of technology

Through encrypted storage and decryption of sensitive data, data security is significantly improved, the probability of security incidents is reduced, and the expansion and contraction of system modules are supported, improving system stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118689869A
    Figure CN118689869A
Patent Text Reader

Abstract

The invention belongs to the technical field of computers, and discloses a data security storage and query method, system and device and a storage medium. The data security storage method is applied to a data access unit of the data security management system, and the system at least comprises the data access unit, a meta storage unit and a data warehouse. The method comprises the steps of obtaining to-be-stored data; querying whether a to-be-encrypted field exists in the to-be-stored data from a meta storage unit; if the to-be-encrypted field exists in the to-be-stored data, encrypting data matched with the to-be-encrypted field in the to-be-stored data according to the data encryption key to generate a column storage format file; and transmitting the column type storage format file to a data warehouse for storage. By means of the mode, part of column data is encrypted, the column type storage format file is generated and stored, data of sensitive fields are prevented from being stolen and leaked, data safety is improved, and the occurrence probability of safety events is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a data security storage and query method, system, device and storage medium. Background Art

[0002] With the ever-accelerating digital transformation, everything is becoming connected, and computers are increasingly involved in and affecting our lives. Frequent security incidents and increasingly widespread data leaks are gradually becoming known to the public. Computer security, especially data security, is becoming increasingly important.

[0003] The above contents are only used to assist in understanding the technical solution of the present invention and do not constitute an admission that the above contents are prior art. Summary of the invention

[0004] The main purpose of the present invention is to provide a data security storage and query method, system, device and storage medium, aiming to improve data security, reduce the probability of security incidents, and avoid sensitive data leakage.

[0005] To achieve the above object, the present invention provides a data security storage method, which is applied to a data access unit of a data security management system, wherein the data security management system at least includes a data access unit, a meta storage unit and a data warehouse;

[0006] The data security storage method comprises:

[0007] Get the data to be stored;

[0008] Querying the meta storage unit whether there is a field to be encrypted in the data to be stored;

[0009] If there is a field to be encrypted in the data to be stored, encrypt the data matching the field to be encrypted in the data to be stored according to the data encryption key to generate a column storage format file;

[0010] The column storage format file is transmitted to the data warehouse for storage.

[0011] Optionally, the data security management system further includes a key management unit;

[0012] After encrypting the data matching the to-be-encrypted field in the to-be-stored data according to the data encryption key and generating a column storage format file, the method further includes:

[0013] Obtaining a master key identifier corresponding to the to-be-encrypted field from the meta storage unit;

[0014] Acquire a corresponding master encryption key from the key management unit according to the master key identifier;

[0015] Encrypting the data encryption key according to the master encryption key to obtain ciphertext data;

[0016] The ciphertext data is stored.

[0017] Optionally, storing the ciphertext data includes:

[0018] The ciphertext data is stored in an external file in a preset directory.

[0019] Optionally, storing the ciphertext data includes:

[0020] The ciphertext data is stored in a preset location in the column storage format file.

[0021] Optionally, after transferring the column storage format file to the data warehouse for storage, the method further includes:

[0022] The meta information of the column storage format file is transmitted to the meta storage unit for storage.

[0023] In addition, to achieve the above-mentioned purpose, the present invention also proposes a data security query method, which is applied to a data query unit of a data security management system, wherein the data security management system at least includes a data query unit, a meta storage unit, a data warehouse, and a key management unit;

[0024] The data security query method comprises:

[0025] Upon receiving a data query request, determining a file to be queried corresponding to the data query request;

[0026] Acquire target meta information corresponding to the file to be queried from the meta storage unit;

[0027] Acquire a corresponding target column storage format file from the data warehouse according to the target meta information;

[0028] Acquire a corresponding master encryption key from the key management unit according to the target meta information;

[0029] Decrypting the target column storage format file according to the master encryption key to obtain target data;

[0030] The target data is searched according to the data query request to obtain a data query result.

[0031] Optionally, decrypting the target column storage format file according to the master encryption key to obtain target data includes:

[0032] Obtain target ciphertext data corresponding to the target column storage format file;

[0033] Decrypting the target ciphertext data according to the master encryption key to obtain a target data encryption key;

[0034] The target column storage format file is decrypted according to the target data encryption key to obtain target data.

[0035] Optionally, the obtaining target ciphertext data corresponding to the target column storage format file includes:

[0036] The target ciphertext data corresponding to the target column storage format file is obtained from an external file in a preset directory.

[0037] Optionally, the obtaining target ciphertext data corresponding to the target column storage format file includes:

[0038] The target ciphertext data corresponding to the target column storage format file is obtained from a preset position in the target column storage format file.

[0039] Optionally, the acquiring a corresponding master encryption key from the key management unit according to the target meta information includes:

[0040] A key acquisition request is sent to the key management unit according to the target meta-information and the user token corresponding to the data query request, so that the key management unit queries the corresponding master encryption key according to the target meta-information, and when it is determined that the user token contains access rights to the master encryption key, the master encryption key is fed back.

[0041] Optionally, the method further comprises:

[0042] Obtain one or more ciphertext data to be processed from a preset directory, and determine a current column storage format file corresponding to each of the ciphertext data to be processed;

[0043] Acquire current metadata corresponding to the current column storage format file from the meta storage unit;

[0044] Acquire a corresponding initial master encryption key from the key management unit according to the current metadata;

[0045] Decrypting the ciphertext data to be processed according to the initial master encryption key to obtain plaintext data;

[0046] Obtaining a latest master encryption key having the same key identifier as the initial master encryption key;

[0047] Encrypting the plaintext data according to the latest master encryption key to obtain the latest ciphertext data;

[0048] Update the to-be-processed ciphertext data in the preset directory according to the latest ciphertext data;

[0049] The initial master encryption key stored in the key management unit is updated according to the latest master encryption key.

[0050] In addition, to achieve the above-mentioned purpose, the present invention also proposes a data security management system, which includes a data access unit, a meta storage unit and a data warehouse;

[0051] The data access unit is used to obtain the data to be stored, query the meta storage unit whether there is a field to be encrypted in the data to be stored, and if there is a field to be encrypted in the data to be stored, encrypt the data matching the field to be encrypted in the data to be stored according to the data encryption key, generate a column storage format file, and transmit the column storage format file to the data warehouse;

[0052] The data warehouse is used to store the column storage format file.

[0053] Optionally, the data security management system further includes a key management unit;

[0054] The data access unit is further used to obtain the master key identifier corresponding to the to-be-encrypted field from the meta storage unit, and interact with the key management unit according to the master key identifier;

[0055] The key management unit is configured to query a corresponding master encryption key according to the master key identifier, and feed back the master encryption key to the data access unit;

[0056] The data access unit is further used to encrypt the data encryption key according to the master encryption key to obtain ciphertext data, and store the ciphertext data.

[0057] Optionally, the data access unit is further used to transmit the meta information of the column storage format file to the meta storage unit;

[0058] The meta storage unit is also used to store the meta information of the column storage format file.

[0059] Optionally, the data security management system further includes a data query unit;

[0060] The data query unit is used to determine the to-be-queried file corresponding to the data query request upon receiving the data query request, and interact with the meta storage unit according to the to-be-queried file;

[0061] The meta storage unit is further used to query the target meta information corresponding to the file to be queried, and feed back the target meta information to the data query unit;

[0062] The data query unit is further used to interact with the data warehouse and the key management unit respectively according to the target meta information;

[0063] The data warehouse is further used to query the target column storage format file corresponding to the target meta information, and feed back the target column storage format file to the data query unit;

[0064] The key management unit is further used to query the master encryption key corresponding to the target meta-information and feed back the master encryption key to the data query unit;

[0065] The data query unit is further used to decrypt the target column storage format file according to the master encryption key to obtain target data, and search the target data according to the data query request to obtain a data query result.

[0066] Optionally, the data query unit is also used to obtain target ciphertext data corresponding to the target column storage format file, decrypt the target ciphertext data according to the master encryption key to obtain a target data encryption key, and decrypt the target column storage format file according to the target data encryption key to obtain the target data.

[0067] Optionally, the data query unit is further configured to send a key acquisition request to the key management unit according to the target meta information and a user token corresponding to the data query request;

[0068] The key management unit is further configured to query a corresponding master encryption key according to the target meta-information, and when it is determined that the user token contains access rights to the master encryption key, feedback the master encryption key.

[0069] Optionally, the data query unit is further used to obtain one or more ciphertext data to be processed from a preset directory, and determine a current column storage format file corresponding to each of the ciphertext data to be processed, and interact with the meta storage unit according to the current column storage format file;

[0070] The metadata storage unit is further used to query the current metadata corresponding to the current column storage format file, and feed back the current metadata to the data query unit;

[0071] The data query unit is further used to interact with the key management unit according to the current metadata;

[0072] The key management unit is further used to query the initial master encryption key corresponding to the current metadata, and feed back the initial master encryption key to the data query unit;

[0073] The data query unit is further configured to decrypt the ciphertext data to be processed according to the initial master encryption key to obtain plaintext data, obtain the latest master encryption key that is the same as the key identifier of the initial master encryption key, encrypt the plaintext data according to the latest master encryption key to obtain the latest ciphertext data, update the ciphertext data to be processed under the preset directory according to the latest ciphertext data, and transmit the latest master encryption key to the key management unit;

[0074] The key management unit is further configured to update the stored initial master encryption key according to the latest master encryption key.

[0075] In addition, to achieve the above-mentioned purpose, the present invention also proposes a computer device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the data security storage method described above and / or implement the data security query method described above.

[0076] In addition, to achieve the above objectives, the present invention also proposes a storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the data security storage method described above and / or the data security query method described above.

[0077] The data security storage method proposed in the present invention is applied to the data access unit of the data security management system, and the data security management system at least includes a data access unit, a meta storage unit and a data warehouse; the data security storage method includes: obtaining the data to be stored; querying from the meta storage unit whether there is a field to be encrypted in the data to be stored; if there is a field to be encrypted in the data to be stored, encrypting the data matching the field to be encrypted in the data to be stored according to the data encryption key, and generating a column storage format file; transmitting the column storage format file to the data warehouse for storage. Through the above method, part of the column data is encrypted, and a column storage format file is generated for storage, which prevents the data in sensitive fields from being stolen and leaked, improves data security, reduces the probability of security incidents, separates each functional module, supports the expansion and contraction of the corresponding module without affecting other functional modules, and improves the stability of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0078] Figure 1 It is a schematic diagram of the structure of a computer device in a hardware operating environment involved in an embodiment of the present invention;

[0079] Figure 2 This is a flow chart of a first embodiment of a method for secure data storage according to the present invention;

[0080] Figure 3 This is a flow chart of a second embodiment of the data security storage method of the present invention;

[0081] Figure 4 This is a flow chart of a first embodiment of a data security query method of the present invention;

[0082] Figure 5 This is a flow chart of a second embodiment of the data security query method of the present invention;

[0083] Figure 6 It is a structural diagram of an embodiment of a data security management system of the present invention.

[0084] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0085] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0086] Reference Figure 1 , Figure 1 The figure is a schematic diagram of the computer device structure of the hardware operating environment involved in the embodiment of the present invention.

[0087] like Figure 1 As shown, the computer device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (Wireless-Fidelity, Wi-Fi) interface). The memory 1005 may be a high-speed random access memory (Random Access Memory, RAM), or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk storage. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0088] Those skilled in the art will understand that Figure 1The structure shown in the figure does not constitute a limitation on the computer device, and may include more or less components than shown in the figure, or combine some components, or arrange the components differently.

[0089] like Figure 1 As shown, the memory 1005 as a storage medium may include an operating system, a network communication module, a user interface module and a computer program.

[0090] exist Figure 1 In the computer device shown, the network interface 1004 is mainly used for data communication with the network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the computer device of the present invention can be set in the computer device, and the computer device calls the computer program stored in the memory 1005 through the processor 1001, and executes the data security storage method and data security query method provided by the embodiments of the present invention.

[0091] The embodiment of the present invention provides a data security storage method, referring to Figure 2 , Figure 2 Schematic diagram of the flow of the first embodiment of the data security storage method of the present invention.

[0092] In this embodiment, the data security storage method is applied to a data access unit of a data security management system, and the data security management system at least includes a data access unit, a meta storage unit, and a data warehouse;

[0093] The data security storage method comprises the following steps:

[0094] Step S10: Acquire data to be stored.

[0095] It is understandable that the data access unit (Data Ingestion) converts the data to be stored into a columnar storage format file (parquet) and stores it in the data warehouse. In a specific implementation, in order to facilitate data conversion and processing, the data to be stored is json data. Optionally, interact with the client to obtain the data to be stored transmitted by the client.

[0096] Step S20: querying the meta storage unit whether there is a field to be encrypted in the data to be stored.

[0097] It should be noted that the meta storage unit stores one or more fields to be encrypted (optionally, distinguished by field name), the type of the field to be encrypted, and the master key identifier corresponding to the field to be encrypted. The data access unit interacts with the meta storage unit, matches the fields contained in the data to be stored with the fields to be encrypted stored in the meta storage unit, and determines whether there are fields to be encrypted in the data to be stored.

[0098] Step S30: If there is a field to be encrypted in the data to be stored, encrypt the data matching the field to be encrypted in the data to be stored according to the data encryption key to generate a column storage format file.

[0099] It should be understood that the Data Encryption Keys (DEK) are keys randomly generated based on a preset algorithm and are used to encrypt the parquet internal module. Specifically, the column data under the to-be-encrypted field in the stored data is encrypted according to the data encryption key and converted into a columnar storage format file (parquet file).

[0100] Step S40: transferring the column storage format file to the data warehouse for storage.

[0101] It should be noted that the data warehouse of this embodiment is used to store column storage format files converted from network data or internal data.

[0102] Furthermore, after step S40, the method further includes: transmitting the meta information of the column storage format file to the meta storage unit for storage.

[0103] In a specific implementation, the meta storage unit of this embodiment also stores meta information of each column storage format file. Optionally, the meta information of the column storage format file includes storage path, encryption information, summary, etc.

[0104] This embodiment supports the use of different keys to encrypt different column data and supports signing internal modules of the file to identify whether it has been modified or replaced. After the parquet file in this embodiment is encrypted, other characteristics of Parquet are still fully retained, and high-performance reading is supported with low performance loss.

[0105] The data security storage method proposed in this embodiment is applied to the data access unit of the data security management system, and the data security management system includes at least a data access unit, a meta storage unit and a data warehouse; the data security storage method includes: obtaining the data to be stored; querying from the meta storage unit whether there is a field to be encrypted in the data to be stored; if there is a field to be encrypted in the data to be stored, encrypting the data matching the field to be encrypted in the data to be stored according to the data encryption key, and generating a column storage format file; transferring the column storage format file to the data warehouse for storage. Through the above method, part of the column data is encrypted, and a column storage format file is generated for storage, which prevents the data in sensitive fields from being stolen and leaked, improves data security, reduces the probability of security incidents, separates each functional module, supports the expansion and contraction of the corresponding module without affecting other functional modules, and improves the stability of the system.

[0106] refer to Figure 3 , Figure 3 Schematic diagram of the flow of the second embodiment of the data security storage method of the present invention.

[0107] Based on the above first embodiment, the data security management system in this embodiment further includes a key management unit;

[0108] After step S30 of the data security storage method, the method further includes:

[0109] Step S301: Obtain the master key identifier corresponding to the to-be-encrypted field from the meta storage unit.

[0110] It can be understood that the metastore (ETL Metastore) stores one or more fields to be encrypted (optionally, distinguished by field name), the type of the field to be encrypted, and the master key identifier corresponding to the field to be encrypted. The field to be encrypted included in the data to be stored is determined, and the master key identifier corresponding to the field to be encrypted is queried from the metastore.

[0111] Step S302: Obtain a corresponding master encryption key from the key management unit according to the master key identifier.

[0112] It should be noted that the master encryption key can be explicitly specified in the code or configuration file, but it is not safe. This embodiment sets a key management unit (Key Management Service, KMS) to manage the master encryption key (MasterEncryption Key, MEK). After the data access unit and the key management unit are established, the corresponding master encryption key is obtained from the key management unit according to the master key identifier (MEK id).

[0113] Step S303: Encrypt the data encryption key according to the master encryption key to obtain ciphertext data.

[0114] It should be understood that the randomly generated DEK plaintext is encrypted according to the acquired MEK to obtain the encrypted DEK, i.e., the ciphertext data. Preferably, the following configuration is the connection setting between the data access unit and the key management unit, and the access token is a token for storing the user, which needs to have access rights to the encryption key of all fields.

[0115] "parquet.encryption.kms.instance.url":"https: / / <hostname>:8200"

[0116] "parquet.encryption.key.access.token":"<token string> "

[0117] The data access unit and the key management unit use a token to establish a connection, pass in the MEK ID and DEK plain text, and obtain the encrypted DEK. The client does not directly contact the MEK, which improves the security of the data.

[0118] Step S304: storing the ciphertext data.

[0119] It should be noted that the ciphertext data is stored for use in subsequent decryption of the parquet file.

[0120] Optionally, the step S304 includes: storing the ciphertext data in an external file in a preset directory.

[0121] It should be understood that the external file can be optionally stored in the data warehouse, and the preset directory can be the directory where the column storage format file is located, or the data file statistics directory where all the ciphertext data is located. Storing the ciphertext data in an external file supports the normal reading of the file after the dynamic update of MEK.

[0122] Optionally, the step S304 includes: storing the ciphertext data in a preset location in the column storage format file.

[0123] It should be noted that the encrypted DEK can be stored in a preset position in the parquet file and stored in the data warehouse together with the parquet file. The preset position is a fixed position agreed in advance, such as the file header, file tail, or file middle, etc.

[0124] This embodiment obtains the master key identifier corresponding to the field to be encrypted from the meta storage unit; obtains the corresponding master encryption key from the key management unit according to the master key identifier; encrypts the data encryption key according to the master encryption key to obtain ciphertext data; and stores the ciphertext data. In the above manner, the key management unit is set to manage the master encryption key, which improves data security, and encrypts the data encryption key used to encrypt column data according to the master encryption key, which increases the difficulty of data cracking and prevents the data in sensitive fields from being stolen and leaked.

[0125] The embodiment of the present invention provides a data security query method, referring to Figure 4 , Figure 4 It is a flowchart of the first embodiment of the data security query method of the present invention.

[0126] In this embodiment, the data security query method is applied to a data query unit of a data security management system, and the data security management system at least includes a data query unit, a meta storage unit, a data warehouse, and a key management unit;

[0127] The data security query method comprises:

[0128] Step S01: upon receiving a data query request, determining a file to be queried corresponding to the data query request.

[0129] It is understandable that the data query unit of this embodiment can optionally use Flink, a high-throughput, low-latency, high-performance data query engine. When Flink receives a data query request, it will parse the statement and analyze the parquet file to be queried. Optionally, it interacts with the client to obtain the data query request issued by the client.

[0130] Step S02: Acquire target meta information corresponding to the file to be queried from the meta storage unit.

[0131] It should be noted that the meta storage unit also stores meta information of each column storage format file, and the corresponding target meta information is obtained from the meta storage unit according to the identifier of the file to be queried.

[0132] Step S03: Acquire a corresponding target column storage format file from the data warehouse according to the target meta information.

[0133] Step S04: Obtain a corresponding master encryption key from the key management unit according to the target meta-information.

[0134] In the specific implementation, a data query task (flinkjob) is created according to the target metadata obtained in step S02, the corresponding parquet file is obtained from the data warehouse, and the required master encryption key is automatically obtained from the KMS.

[0135] The step S04 includes: sending a key acquisition request to the key management unit according to the target meta-information and the user token corresponding to the data query request, so that the key management unit queries the corresponding master encryption key according to the target meta-information, and when it is determined that the user token contains access rights to the master encryption key, the key management unit feeds back the master encryption key.

[0136] It should be understood that the following configuration is a connection setting between the data query unit and the key management unit, and the access token is a token of the query user, which may include access rights to some fields.

[0137] "parquet.encryption.kms.instance.url":"https: / / <hostname>:8200"

[0138] "parquet.encryption.key.access.token":"<token string> "

[0139] In the specific implementation, if the user executing the query has the decryption permission for the corresponding field (determine whether the user has the access permission for the corresponding MEK), the corresponding field is decrypted and the decrypted data is read; if there is no decryption permission for the corresponding field, the undecrypted sensitive field is returned empty or returned after being obfuscated.

[0140] Step S05: decrypt the target column storage format file according to the master encryption key to obtain target data.

[0141] Specifically, the step S05 includes: obtaining the target ciphertext data corresponding to the target column storage format file; decrypting the target ciphertext data according to the master encryption key to obtain the target data encryption key; decrypting the target column storage format file according to the target data encryption key to obtain the target data.

[0142] It should be noted that the target ciphertext data is the DEK ciphertext data stored for decrypting part of the column data in the target column storage format file. The target ciphertext data is decrypted according to the queried master encryption key to obtain the decrypted DEK plaintext data, and the column data in the target column storage format file is decrypted based on the DEK plaintext data. Preferably, the data query unit and the key management unit use a token to establish a connection, pass in the MEK id and DEK ciphertext, and obtain the decrypted DEK plaintext. The client does not directly contact the MEK, thereby improving the security of the data.

[0143] Optionally, the obtaining target ciphertext data corresponding to the target column storage format file includes: obtaining the target ciphertext data corresponding to the target column storage format file from an external file in a preset directory.

[0144] It should be understood that the preset directory is a directory where the external file for storing DEK ciphertext is located, which is agreed in advance. The ciphertext data is stored in the external file, and the file can still be read normally after supporting dynamic update of MEK.

[0145] Optionally, the acquiring target ciphertext data corresponding to the target column storage format file includes: acquiring the target ciphertext data corresponding to the target column storage format file from a preset position in the target column storage format file.

[0146] Step S06: Search the target data according to the data query request to obtain a data query result.

[0147] The data security query method proposed in this embodiment is applied to the data query unit of the data security management system, and the data security management system at least includes a data query unit, a meta storage unit, a data warehouse and a key management unit; the data security query method includes: upon receiving a data query request, determining the file to be queried corresponding to the data query request; obtaining the target meta information corresponding to the file to be queried from the meta storage unit; obtaining the corresponding target column storage format file from the data warehouse according to the target meta information; obtaining the corresponding master encryption key from the key management unit according to the target meta information; decrypting the target column storage format file according to the master encryption key to obtain the target data; searching the target data according to the data query request to obtain the data query result. In the above manner, the column storage format file, meta information, and encryption key are stored separately, which improves data security and system stability. The correct master encryption key must be obtained to obtain the correct data, which prevents the data in sensitive fields from being stolen and leaked, and reduces the probability of security incidents.

[0148] refer to Figure 5 , Figure 5 It is a flowchart diagram of the second embodiment of the data security query method of the present invention.

[0149] Based on the first embodiment above, the data security query method in this embodiment further includes:

[0150] Step S1: Obtain one or more ciphertext data to be processed from a preset directory, and determine the current column storage format file corresponding to each of the ciphertext data to be processed.

[0151] It can be understood that the preset directory is a directory where the external files for storing DEK ciphertexts are located, which is agreed in advance. The ciphertext data that needs to update the MEK is obtained from it, and the parquet files corresponding to each ciphertext data are determined.

[0152] Step S2: Obtain current metadata corresponding to the current column storage format file from the meta storage unit.

[0153] Step S3: Obtain a corresponding initial master encryption key from the key management unit according to the current metadata.

[0154] Step S4: decrypt the ciphertext data to be processed according to the initial master encryption key to obtain plaintext data.

[0155] Preferably, the data query unit and the key management unit use a token to establish a connection, input the MEK id and the DEK ciphertext, and obtain the decrypted DEK plaintext.

[0156] Step S5: Obtain the latest master encryption key having the same key identifier as the initial master encryption key.

[0157] It should be noted that this embodiment supports dynamic updating of the master encryption key (MEK), and the latest master encryption key is the updated master encryption key.

[0158] Step S6: Encrypt the plaintext data according to the latest master encryption key to obtain the latest ciphertext data.

[0159] Step S7: updating the to-be-processed ciphertext data in the preset directory according to the latest ciphertext data.

[0160] Step S8: Update the initial master encryption key stored in the key management unit according to the latest master encryption key.

[0161] Optionally, step S8 and step S6 can be executed in parallel. Preferably, step S8 is executed first to update the MEK stored in the key management unit, and then the data query unit connects to the key management unit through the token, passes in the MEKid and DEK plaintext, obtains the encrypted DEK ciphertext, that is, the latest ciphertext data, and stores it in the preset directory.

[0162] This embodiment provides a dynamic update method for the master encryption key, which facilitates the update management of the key, further increases the difficulty of decrypting files in the column storage format, prevents the data in sensitive fields from being stolen and leaked, and improves data security.

[0163] In addition, an embodiment of the present invention further proposes a storage medium, on which a computer program is stored. When the computer program is executed by a processor, the data security storage method and the data security query method described above are implemented.

[0164] Since the storage medium adopts all the technical solutions of all the above embodiments, it has at least all the beneficial effects brought by the technical solutions of the above embodiments, which will not be described one by one here.

[0165] Reference Figure 6 , Figure 6 It is a structural diagram of an embodiment of a data security management system of the present invention.

[0166] like Figure 6 As shown, the data security management system proposed in the embodiment of the present invention includes: a data access unit 10, a meta storage unit 20 and a data warehouse 30;

[0167] The data access unit 10 is used to obtain the data to be stored, query the meta storage unit 20 whether there is a field to be encrypted in the data to be stored, and if there is a field to be encrypted in the data to be stored, encrypt the data matching the field to be encrypted in the data to be stored according to the data encryption key, generate a column storage format file, and transmit the column storage format file to the data warehouse 30.

[0168] The data warehouse 30 is used to store the column storage format file.

[0169] In the specific implementation, Figure 6 As shown by the dotted lines, the data security management system is separated into three layers, and the corresponding modules can be expanded or reduced without affecting other layers. The separated three layers may include: metadata layer (Metadata), data encryption layer (Data & Encryption) and key management layer (Key & Policy).

[0170] It should be understood that the above is only an example and does not constitute any limitation on the technical solution of the present invention. In specific applications, technicians in this field can make settings as needed, and the present invention does not limit this.

[0171] In this embodiment, the data access unit obtains the data to be stored, queries the meta storage unit whether there is a field to be encrypted in the data to be stored, and if there is a field to be encrypted in the data to be stored, encrypts the data matching the field to be encrypted in the data to be stored according to the data encryption key, generates a column storage format file, and transmits the column storage format file to the data warehouse; the data warehouse stores the column storage format file. Through the above method, part of the column data is encrypted, and a column storage format file is generated for storage, which prevents the data in sensitive fields from being stolen and leaked, improves data security, reduces the probability of security incidents, separates each functional module, supports the expansion and contraction of the corresponding module without affecting other functional modules, and improves the stability of the system.

[0172] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of the present invention. In practical applications, technicians in this field can select part or all of them according to actual needs to achieve the purpose of the present embodiment, and no limitation is made here.

[0173] In addition, for technical details not fully described in this embodiment, reference can be made to the data security storage method and data security query method provided in any embodiment of the present invention, and will not be repeated here.

[0174] In one embodiment, the data security management system further includes a key management unit 40;

[0175] The data access unit 10 is further used to obtain the master key identifier corresponding to the to-be-encrypted field from the meta storage unit 20, and interact with the key management unit 40 according to the master key identifier;

[0176] The key management unit 40 is used to query the corresponding master encryption key according to the master key identifier and feedback the master encryption key to the data access unit 10;

[0177] The data access unit 10 is further used to encrypt the data encryption key according to the master encryption key to obtain ciphertext data, and store the ciphertext data.

[0178] In one embodiment, the data access unit 10 is further used to store the ciphertext data in an external file in a preset directory.

[0179] In one embodiment, the data access unit 10 is further used to store the ciphertext data in a preset position in the column storage format file.

[0180] In one embodiment, the data access unit 10 is further used to transmit the meta information of the column storage format file to the meta storage unit 20;

[0181] The meta storage unit 20 is also used to store the meta information of the column storage format file.

[0182] In one embodiment, the data security management system further includes a data query unit 50;

[0183] The data query unit 50 is used to determine the to-be-queried file corresponding to the data query request upon receiving the data query request, and interact with the meta storage unit 20 according to the to-be-queried file;

[0184] The meta storage unit 20 is further used to query the target meta information corresponding to the file to be queried, and feed back the target meta information to the data query unit 50;

[0185] The data query unit 50 is further used to interact with the data warehouse 30 and the key management unit 40 respectively according to the target meta information;

[0186] The data warehouse 30 is further used to query the target column storage format file corresponding to the target meta information, and feed back the target column storage format file to the data query unit 50;

[0187] The key management unit 40 is further used to query the master encryption key corresponding to the target meta-information and feedback the master encryption key to the data query unit 50;

[0188] The data query unit 50 is further configured to decrypt the target column storage format file according to the master encryption key to obtain target data, and search the target data according to the data query request to obtain a data query result.

[0189] In one embodiment, the data query unit 50 is also used to obtain the target ciphertext data corresponding to the target column storage format file, decrypt the target ciphertext data according to the master encryption key to obtain the target data encryption key, and decrypt the target column storage format file according to the target data encryption key to obtain the target data.

[0190] In one embodiment, the data query unit 50 is further configured to obtain target ciphertext data corresponding to the target column storage format file from an external file in a preset directory.

[0191] In one embodiment, the data query unit 50 is further configured to obtain target ciphertext data corresponding to the target column storage format file from a preset position in the target column storage format file.

[0192] In one embodiment, the data query unit 50 is further configured to send a key acquisition request to the key management unit 40 according to the target meta information and a user token corresponding to the data query request;

[0193] The key management unit 40 is further configured to query a corresponding master encryption key according to the target meta-information, and feedback the master encryption key when it is determined that the user token contains access rights to the master encryption key.

[0194] In one embodiment, the data query unit 50 is further used to obtain one or more ciphertext data to be processed from a preset directory, and determine the current column storage format file corresponding to each of the ciphertext data to be processed, and interact with the meta storage unit 20 according to the current column storage format file;

[0195] The metadata storage unit 20 is further used to query the current metadata corresponding to the current column storage format file and feed back the current metadata to the data query unit 50;

[0196] The data query unit 50 is further configured to interact with the key management unit 40 according to the current metadata;

[0197] The key management unit 40 is further used to query the initial master encryption key corresponding to the current metadata, and feed back the initial master encryption key to the data query unit 50;

[0198] The data query unit 50 is further configured to decrypt the ciphertext data to be processed according to the initial master encryption key to obtain plaintext data, obtain the latest master encryption key having the same key identifier as the initial master encryption key, encrypt the plaintext data according to the latest master encryption key to obtain the latest ciphertext data, update the ciphertext data to be processed under the preset directory according to the latest ciphertext data, and transmit the latest master encryption key to the key management unit 40;

[0199] The key management unit 40 is further configured to update the stored initial master encryption key according to the latest master encryption key.

[0200] In addition, it should be noted that, in this article, the term "includes", "comprising" or any other variation thereof is intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.

[0201] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0202] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory (ROM) / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0203] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

[0204] The present invention discloses: A1. A data security storage method, applied to a data access unit of a data security management system, wherein the data security management system at least comprises a data access unit, a meta storage unit and a data warehouse;

[0205] The data security storage method comprises:

[0206] Get the data to be stored;

[0207] Querying the meta storage unit whether there is a field to be encrypted in the data to be stored;

[0208] If there is a field to be encrypted in the data to be stored, encrypt the data matching the field to be encrypted in the data to be stored according to the data encryption key to generate a column storage format file;

[0209] The column storage format file is transmitted to the data warehouse for storage.

[0210] A2. The data security storage method as described in A1, wherein the data security management system further comprises a key management unit;

[0211] After encrypting the data matching the to-be-encrypted field in the to-be-stored data according to the data encryption key and generating a column storage format file, the method further includes:

[0212] Obtaining a master key identifier corresponding to the to-be-encrypted field from the meta storage unit;

[0213] Acquire a corresponding master encryption key from the key management unit according to the master key identifier;

[0214] Encrypting the data encryption key according to the master encryption key to obtain ciphertext data;

[0215] The ciphertext data is stored.

[0216] A3. The data security storage method as described in A2, wherein the storing of the ciphertext data comprises:

[0217] The ciphertext data is stored in an external file in a preset directory.

[0218] A4. The data security storage method as described in A2, wherein the storing of the ciphertext data comprises:

[0219] The ciphertext data is stored in a preset location in the column storage format file.

[0220] A5. The data security storage method as described in A1, after transferring the column storage format file to the data warehouse for storage, the method further includes:

[0221] The meta information of the column storage format file is transmitted to the meta storage unit for storage.

[0222] The present invention also discloses: B6, a data security query method, applied to a data query unit of a data security management system, the data security management system at least comprising a data query unit, a meta storage unit, a data warehouse and a key management unit;

[0223] The data security query method comprises:

[0224] Upon receiving a data query request, determining a file to be queried corresponding to the data query request;

[0225] Acquire target meta information corresponding to the file to be queried from the meta storage unit;

[0226] Acquire a corresponding target column storage format file from the data warehouse according to the target meta information;

[0227] Acquire a corresponding master encryption key from the key management unit according to the target meta information;

[0228] Decrypting the target column storage format file according to the master encryption key to obtain target data;

[0229] The target data is searched according to the data query request to obtain a data query result.

[0230] B7. The data security query method as described in B6, wherein the target column storage format file is decrypted according to the master encryption key to obtain the target data, including:

[0231] Obtain target ciphertext data corresponding to the target column storage format file;

[0232] Decrypting the target ciphertext data according to the master encryption key to obtain a target data encryption key;

[0233] The target column storage format file is decrypted according to the target data encryption key to obtain target data.

[0234] B8. The data security query method as described in B7, wherein obtaining the target ciphertext data corresponding to the target column storage format file comprises:

[0235] The target ciphertext data corresponding to the target column storage format file is obtained from an external file in a preset directory.

[0236] B9. The data security query method as described in B7, wherein obtaining the target ciphertext data corresponding to the target column storage format file comprises:

[0237] The target ciphertext data corresponding to the target column storage format file is obtained from a preset position in the target column storage format file.

[0238] B10. The data security query method as described in B7, wherein the step of obtaining the corresponding master encryption key from the key management unit according to the target meta-information comprises:

[0239] A key acquisition request is sent to the key management unit according to the target meta-information and the user token corresponding to the data query request, so that the key management unit queries the corresponding master encryption key according to the target meta-information, and when it is determined that the user token contains access rights to the master encryption key, the master encryption key is fed back.

[0240] B11. The data security query method as described in B8, further comprising:

[0241] Obtain one or more ciphertext data to be processed from a preset directory, and determine a current column storage format file corresponding to each of the ciphertext data to be processed;

[0242] Acquire current metadata corresponding to the current column storage format file from the meta storage unit;

[0243] Acquire a corresponding initial master encryption key from the key management unit according to the current metadata;

[0244] Decrypting the ciphertext data to be processed according to the initial master encryption key to obtain plaintext data;

[0245] Obtaining a latest master encryption key having the same key identifier as the initial master encryption key;

[0246] Encrypting the plaintext data according to the latest master encryption key to obtain the latest ciphertext data;

[0247] Update the to-be-processed ciphertext data in the preset directory according to the latest ciphertext data;

[0248] The initial master encryption key stored in the key management unit is updated according to the latest master encryption key.

[0249] The present invention also discloses: C12, a data security management system, the data security management system comprises a data access unit, a meta storage unit and a data warehouse;

[0250] The data access unit is used to obtain the data to be stored, query the meta storage unit whether there is a field to be encrypted in the data to be stored, and if there is a field to be encrypted in the data to be stored, encrypt the data matching the field to be encrypted in the data to be stored according to the data encryption key, generate a column storage format file, and transmit the column storage format file to the data warehouse;

[0251] The data warehouse is used to store the column storage format file.

[0252] C13. The data security management system as described in C12, further comprising a key management unit;

[0253] The data access unit is further used to obtain the master key identifier corresponding to the to-be-encrypted field from the meta storage unit, and interact with the key management unit according to the master key identifier;

[0254] The key management unit is configured to query a corresponding master encryption key according to the master key identifier, and feed back the master encryption key to the data access unit;

[0255] The data access unit is further used to encrypt the data encryption key according to the master encryption key to obtain ciphertext data, and store the ciphertext data.

[0256] C14. The data security management system as described in C12, wherein the data access unit is further used to transmit the meta information of the column storage format file to the meta storage unit;

[0257] The meta storage unit is also used to store the meta information of the column storage format file.

[0258] C15. The data security management system as described in C12, further comprising a data query unit;

[0259] The data query unit is used to determine the to-be-queried file corresponding to the data query request upon receiving the data query request, and interact with the meta storage unit according to the to-be-queried file;

[0260] The meta storage unit is further used to query the target meta information corresponding to the file to be queried, and feed back the target meta information to the data query unit;

[0261] The data query unit is further used to interact with the data warehouse and the key management unit respectively according to the target meta information;

[0262] The data warehouse is further used to query the target column storage format file corresponding to the target meta information, and feed back the target column storage format file to the data query unit;

[0263] The key management unit is further used to query the master encryption key corresponding to the target meta-information and feed back the master encryption key to the data query unit;

[0264] The data query unit is further used to decrypt the target column storage format file according to the master encryption key to obtain target data, and search the target data according to the data query request to obtain a data query result.

[0265] C16. In the data security management system as described in C15, the data query unit is also used to obtain the target ciphertext data corresponding to the target column storage format file, decrypt the target ciphertext data according to the master encryption key to obtain the target data encryption key, and decrypt the target column storage format file according to the target data encryption key to obtain the target data.

[0266] C17. The data security management system as described in C15, wherein the data query unit is further configured to send a key acquisition request to the key management unit according to the target meta information and a user token corresponding to the data query request;

[0267] The key management unit is further configured to query a corresponding master encryption key according to the target meta-information, and when it is determined that the user token contains access rights to the master encryption key, feedback the master encryption key.

[0268] C18. The data security management system as described in C15, wherein the data query unit is further used to obtain one or more ciphertext data to be processed from a preset directory, and determine the current column storage format file corresponding to each of the ciphertext data to be processed, and interact with the meta storage unit according to the current column storage format file;

[0269] The metadata storage unit is further used to query the current metadata corresponding to the current column storage format file, and feed back the current metadata to the data query unit;

[0270] The data query unit is further used to interact with the key management unit according to the current metadata;

[0271] The key management unit is further used to query the initial master encryption key corresponding to the current metadata, and feed back the initial master encryption key to the data query unit;

[0272] The data query unit is further configured to decrypt the ciphertext data to be processed according to the initial master encryption key to obtain plaintext data, obtain the latest master encryption key that is the same as the key identifier of the initial master encryption key, encrypt the plaintext data according to the latest master encryption key to obtain the latest ciphertext data, update the ciphertext data to be processed under the preset directory according to the latest ciphertext data, and transmit the latest master encryption key to the key management unit;

[0273] The key management unit is further configured to update the stored initial master encryption key according to the latest master encryption key.

[0274] The present invention also discloses: D19, a computer device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement a data security storage method as described in any one of A1 to A5 and / or to implement a data security query method as described in any one of B6 to B11.

[0275] The present invention also discloses: E20, a storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the data security storage method as described in any one of A1 to A5 and / or implements the data security query method as described in any one of B6 to B11.< / hostname> < / hostname>

Claims

1. A data security storage method, applied to a data access unit of a data security management system, characterized in that: The data security management system at least includes a data access unit, a meta storage unit and a data warehouse; The data security storage method comprises: Get the data to be stored; Querying the meta storage unit whether there is a field to be encrypted in the data to be stored; If there is a field to be encrypted in the data to be stored, encrypt the data matching the field to be encrypted in the data to be stored according to the data encryption key to generate a column storage format file; The column storage format file is transmitted to the data warehouse for storage.

2. The data security storage method according to claim 1, characterized in that: The data security management system also includes a key management unit; After encrypting the data matching the to-be-encrypted field in the to-be-stored data according to the data encryption key and generating a column storage format file, the method further includes: Obtaining a master key identifier corresponding to the to-be-encrypted field from the meta storage unit; Acquire a corresponding master encryption key from the key management unit according to the master key identifier; Encrypting the data encryption key according to the master encryption key to obtain ciphertext data; The ciphertext data is stored.

3. The data security storage method according to claim 1, characterized in that: After transferring the column storage format file to the data warehouse for storage, the method further includes: The meta information of the column storage format file is transmitted to the meta storage unit for storage.

4. A data security query method, applied to a data query unit of a data security management system, characterized in that: The data security management system at least includes a data query unit, a meta storage unit, a data warehouse and a key management unit; The data security query method comprises: Upon receiving a data query request, determining a file to be queried corresponding to the data query request; Acquire target meta information corresponding to the file to be queried from the meta storage unit; Acquire a corresponding target column storage format file from the data warehouse according to the target meta information; Acquire a corresponding master encryption key from the key management unit according to the target meta information; Decrypting the target column storage format file according to the master encryption key to obtain target data; The target data is searched according to the data query request to obtain a data query result.

5. The data security query method according to claim 4, characterized in that: The decrypting the target column storage format file according to the master encryption key to obtain target data includes: Obtain target ciphertext data corresponding to the target column storage format file; Decrypting the target ciphertext data according to the master encryption key to obtain a target data encryption key; The target column storage format file is decrypted according to the target data encryption key to obtain target data.

6. The data security query method according to claim 5, characterized in that: The obtaining a corresponding master encryption key from the key management unit according to the target meta information includes: A key acquisition request is sent to the key management unit according to the target meta-information and the user token corresponding to the data query request, so that the key management unit queries the corresponding master encryption key according to the target meta-information, and when it is determined that the user token contains access rights to the master encryption key, the master encryption key is fed back.

7. The data security query method according to claim 4, characterized in that: The method further comprises: Obtain one or more ciphertext data to be processed from a preset directory, and determine a current column storage format file corresponding to each of the ciphertext data to be processed; Acquire current metadata corresponding to the current column storage format file from the meta storage unit; Acquire a corresponding initial master encryption key from the key management unit according to the current metadata; Decrypting the ciphertext data to be processed according to the initial master encryption key to obtain plaintext data; Obtaining a latest master encryption key having the same key identifier as the initial master encryption key; Encrypting the plaintext data according to the latest master encryption key to obtain the latest ciphertext data; Update the to-be-processed ciphertext data in the preset directory according to the latest ciphertext data; The initial master encryption key stored in the key management unit is updated according to the latest master encryption key.

8. A data security management system, characterized in that: The data security management system includes a data access unit, a meta storage unit and a data warehouse; The data access unit is used to obtain the data to be stored, query the meta storage unit whether there is a field to be encrypted in the data to be stored, and if there is a field to be encrypted in the data to be stored, encrypt the data matching the field to be encrypted in the data to be stored according to the data encryption key, generate a column storage format file, and transmit the column storage format file to the data warehouse; The data warehouse is used to store the column storage format file.

9. A computer device, characterized in that: The computer device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the data security storage method as described in any one of claims 1 to 3 and / or to implement the data security query method as described in any one of claims 4 to 7.

10. A storage medium, characterized in that: The storage medium stores a computer program, which, when executed by a processor, implements the data security storage method according to any one of claims 1 to 3 and / or implements the data security query method according to any one of claims 4 to 7.

Citation Information

Patent Citations

  • Sensitive data encryption and decryption method and device, computer equipment and storage medium

    CN114218592A

  • Data file storage method and data security agent

    CN114327261A

  • System and method for selective dynamic encryption

    US20190005248A1

  • Anisotropic compression as applied to columnar storage formats

    US20200125751A1

  • Method and apparatus for data encryption and decryption, device, and storage medium

    WO2021208690A1