Data security management method, device and equipment for block chain

By using a combination of smart contracts and oracle contracts on the blockchain, decrypting and refining ciphertext data, the problem of difficult data confidentiality on the blockchain platform is solved, and efficient and secure data query and management are achieved.

CN119669283AActive Publication Date: 2025-03-21BEIJING HUANDING ENVIRONMENTAL BIG DATA RES INST
View PDF 10 Cites 0 Cited by

Patent Information

Application Number
CN202411577324.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-06
Publication Date
2025-03-21
Estimated Expiration
2044-11-06

AI Technical Summary

Technical Problem

The existing technology is difficult to effectively protect the confidentiality of data on the blockchain platform, resulting in the inability to popularize data encryption algorithms in the blockchain, affecting data analysis and computing services.

Method used

By responding to the query operation of the data user, a query trap is generated, and the ciphertext data is obtained from the oracle contract through the blockchain smart contract, the ciphertext data is decrypted using the decryption component of the data owner device, and finally the plaintext data is refined to obtain the query results.

Benefits of technology

It realizes the security management of data on the blockchain, improves the security and query efficiency of data during the query process, alleviates the problem of low data security, and significantly improves the security of on-chain data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119669283A_ABST
    Figure CN119669283A_ABST
Patent Text Reader

Abstract

The invention provides a data security management method, device and equipment for a block chain. The method comprises the steps of generating a query trap door in response to a data query operation of a data user, obtaining ciphertext data corresponding to the query trap door from an oracle contract through an intelligent contract of a block chain, and obtaining a decryption component of data owner equipment of the ciphertext data, and decrypting the restored ciphertext data by using a decryption component to obtain plaintext data, and refining the plaintext data to obtain a query result of the data query operation. According to the method, security management is performed on the data of the block chain based on the block chain and the oracle machine service, the oracle machine contract is modified to obtain the data based on the storage mode of the oracle machine service, a security calculation method is designed under the user contract, accurate query data is obtained, the oracle machine service of the block chain is adopted, the data access efficiency is improved, and the user experience is improved. According to the method, data online security calculation is carried out on the block chain, so that the security of the data in the query process is ensured, and the query efficiency of big data is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data security management, and in particular to a data security management method, device and equipment for blockchain. Background Art

[0002] In data application scenarios, the management of big data (such as spatial data, high-dimensional data, etc.) needs to ensure its integrity, consistency and confidentiality at the same time; the blockchain platform can well ensure the verifiable integrity and decentralized distributed consistency of on-chain data, but it is difficult to ensure the confidentiality of the data.

[0003] At present, the conventional method to ensure the confidentiality of on-chain data is to use encryption algorithms to encrypt data before it is uploaded to the chain, and the blockchain platform directly stores the ciphertext data; however, because the encryption algorithm destroys the searchability of the data, the blockchain platform cannot manage the ciphertext data generated by encrypting the data using such algorithms, which makes it impossible for the blockchain platform to provide effective data analysis and computing services based on these ciphertext data, resulting in the inability to popularize data encryption algorithms within the blockchain.

[0004] Therefore, the current data security management methods used for blockchain have technical problems such as low data security and need to be improved. Summary of the invention

[0005] The embodiments of the present application provide a data security management method, device and equipment for blockchain, which are used to alleviate the technical problem of low data security in the current data security management methods for blockchain.

[0006] In order to solve the above technical problems, the embodiments of the present application provide the following technical solutions:

[0007] The present application provides a data security management method for blockchain, which includes:

[0008] In response to a data query operation by a data user, generating a query trapdoor;

[0009] Obtain the ciphertext data corresponding to the query trapdoor from the oracle contract through the smart contract of the blockchain;

[0010] Obtain a decryption component of a device of a data owner of the ciphertext data;

[0011] Decrypt the restored ciphertext data using the decryption component to obtain plaintext data;

[0012] The plaintext data is refined to obtain a query result of the data query operation.

[0013] In one embodiment, the aforementioned method further includes:

[0014] In response to a data upload operation by a data owner, determining plaintext data;

[0015] Encrypt the plaintext data using an encryption component based on a security query algorithm to obtain ciphertext data and security index data;

[0016] The encrypted data and the security index data are stored in the database of the oracle contract.

[0017] In one embodiment, the step of storing the ciphertext data and the security index data in the database of the oracle contract in the aforementioned method includes:

[0018] Storing the ciphertext data and index value in a ciphertext table in the database;

[0019] The security index data and the index value are stored in a security index table in the database, and the index value of the ciphertext table is the same as that of the security index table.

[0020] In one embodiment, the aforementioned method further includes, before the step of storing the ciphertext data and the security index data in the database of the oracle contract:

[0021] Convert the encoding format of the ciphertext data to UTF-8;

[0022] Convert the content of the ciphertext data into Unicode code values.

[0023] In one embodiment, the step of generating a query trapdoor in response to a data query operation by a data user in the aforementioned method includes:

[0024] Determining query parameters according to the data query operation, wherein the query parameters include a query range or a query point;

[0025] According to the trapdoor generation component of the security query algorithm, the query trapdoor is generated based on the query parameters.

[0026] In one embodiment, the step of refining the plaintext data to obtain the query result of the data query operation in the aforementioned method includes:

[0027] The plaintext data is refined according to the query parameters.

[0028] In one embodiment, the step of using the decryption component to decrypt the restored ciphertext data to obtain plaintext data in the aforementioned method includes:

[0029] Extract the ciphertext data through regular expressions to obtain key ciphertext data;

[0030] The key ciphertext data is subjected to encoding format and data format restoration processing to obtain the ciphertext data after the restoration processing.

[0031] In one embodiment, the step of obtaining a decryption component of a data owner device of the ciphertext data in the aforementioned method includes:

[0032] The decryption component of the device of the data owner of the ciphertext data is obtained by means of data sharing.

[0033] At the same time, the present application also provides a data security management device for blockchain, which includes:

[0034] A response module, used to generate a query trap in response to a data query operation by a data user;

[0035] A calling module, used to obtain the ciphertext data corresponding to the query trapdoor from the oracle contract through the smart contract of the blockchain;

[0036] An acquisition module, used for acquiring a decryption component of a device of a data owner of the ciphertext data;

[0037] A decryption module, used to use the decryption component to decrypt the restored ciphertext data to obtain plaintext data;

[0038] The refining module is used to perform refining processing on the plaintext data to obtain the query result of the data query operation.

[0039] At the same time, the present application provides a computer device, which includes a processor and a memory, wherein the memory stores a plurality of instructions, and the instructions are suitable for the processor to load to execute the steps in the above method.

[0040] At the same time, the present application provides a computer-readable storage medium, which stores multiple instructions, and the instructions are suitable for a processor to load to execute the steps in the above method.

[0041] At the same time, the present application provides a computer program product or a computer program, which includes computer instructions, and the computer instructions are stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the steps in the above method.

[0042] Beneficial effects: The present application provides a data security management method, device and equipment for blockchain; the method includes: generating a query trap in response to a data user's data query operation, obtaining the ciphertext data corresponding to the query trap from the oracle contract through the smart contract of the blockchain, then obtaining the decryption component of the data owner's device of the ciphertext data, using the decryption component to decrypt the ciphertext data after the restoration process to obtain the plaintext data, and refining the plaintext data to obtain the query result of the data query operation. Compared with the current technology, the present application is innovatively based on blockchain and oracle service to manage the data of the blockchain securely, based on the storage method of the oracle service, modify the oracle contract to obtain data, design a secure calculation method under the user contract, obtain accurate query data, adopt the oracle service of the blockchain, improve the efficiency of accessing data, and at the same time, the data is securely calculated online on the blockchain, ensuring the security of the data during the query process, and improving the query efficiency of big data, alleviating the technical problem of low data security in the current data security management method, and greatly improving the security of the data on the chain. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] The technical solution and beneficial effects of the present application will be made apparent by describing in detail the specific implementation methods of the present application in conjunction with the accompanying drawings.

[0044] Figure 1 Schematic diagram of the network of the data security management system provided by the embodiment of the present application;

[0045] Figure 2 It is a flowchart of a data security management method for blockchain provided in an embodiment of the present application;

[0046] Figure 3 This is a schematic diagram of the data encryption upload process provided by an embodiment of the present application;

[0047] Figure 4 It is a schematic diagram of the data query process provided by the embodiment of the present application;

[0048] Figure 5 It is a structural diagram of a data security management device for blockchain provided in an embodiment of the present application;

[0049] Figure 6 It is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0050] In order to make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of this application.

[0051] In the description of the embodiments of the present application, it is to be understood that the terms "first", "second", etc. in the specification, claims, and drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way are interchangeable where appropriate, so that the embodiments described herein can be implemented in an order other than that in the drawings or descriptions. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions.

[0052] The method involved in the embodiment of the present application can be implemented through a blockchain platform, specifically through an oracle contract (oracle service) and a smart contract in the blockchain platform; the application can perform online secure computing management on the data on the blockchain, ensuring the security of the data during the query process and improving the query efficiency of big data.

[0053] The method provided in the embodiment of the present application can be executed through the blockchain platform. For details, please refer to Figure 1 , Figure 1 A network diagram of a data security management system provided in an embodiment of the present application, the system may include a data owner terminal 101, a blockchain 102, and a data user terminal 103, wherein:

[0054] The terminal and the blockchain can be connected directly or indirectly via wired or wireless communication, and this application does not limit this.

[0055] The data owner terminal 101 and the data user terminal 103 can be portable terminals such as smart phones, tablet computers, and laptop computers, or fixed terminals such as desktop computers and query machines, but are not limited to these. The data owner terminal 101 and the data user terminal 103 are both service ports that users can use and operate. The data owner terminal 101 can be used to encrypt the owned plaintext data based on the smart contract of the blockchain to generate ciphertext data, and upload the ciphertext data to the oracle database; the data user terminal 103 is mainly used to provide data query operations for users, generate query traps, etc., and is also used to display the data query results corresponding to the query operation through the data user terminal 103. The data owner terminal 101 can be one or more, and the data user terminal 103 can be one or more. It should be noted that in one embodiment, the data owner terminal 101 can also be used as a data user terminal; in another embodiment, the data user terminal 103 can also be used as a data owner terminal.

[0056] The blockchain 102 is mainly based on smart contracts and oracle contracts to achieve security management of ciphertext data in the blockchain. Specifically, it can be used to generate a query trap in response to a data user's data query operation; obtain the ciphertext data corresponding to the query trap from the oracle contract through the smart contract of the blockchain; obtain the decryption component of the data owner's device of the ciphertext data; use the decryption component to decrypt the restored ciphertext data to obtain plaintext data; and refine the plaintext data to obtain the query result of the data query operation.

[0057] Blockchain 102 can also be used to determine plaintext data in response to a data upload operation by a data owner; encrypt the plaintext data using an encryption component based on a security query algorithm to obtain ciphertext data and security index data; and store the ciphertext data and security index data in the database of the oracle contract.

[0058] Among them, storing the ciphertext data and security index data in the database of the oracle contract includes: storing the ciphertext data and index value in a ciphertext table in the database; storing the security index data and index value in a security index table in the database, and the index values ​​of the ciphertext table and the security index table are the same.

[0059] In the embodiment of the present application, when the blockchain receives a data query request from a data user terminal, it responds to the data query operation of the data user, generates a query trapdoor, and obtains the ciphertext data corresponding to the query trapdoor from the oracle contract through the smart contract of the blockchain, obtains the decryption component of the data owner's device of the ciphertext data, and then uses the decryption component to decrypt the restored ciphertext data to obtain the plaintext data; finally, the plaintext data is refined to obtain the query result of the data query operation. Compared with the current technology, the present application is innovatively based on blockchain and oracle service to manage the data of the blockchain securely, based on the storage method of the oracle service, modify the oracle contract to obtain data, design a secure calculation method under the user contract, obtain accurate query data, adopt the oracle service of the blockchain, improve the efficiency of accessing data, and at the same time, the data is securely calculated online on the blockchain, ensuring the security of the data during the query process, and improving the query efficiency of big data, alleviating the technical problem of low data security in the current data security management method, and greatly improving the security of the data on the chain.

[0060] It should be noted that Figure 1 The networking diagram of the data security management system shown is only an example. The blockchain, terminal and scenario described in the embodiment of the present application are intended to more clearly illustrate the technical solution of the embodiment of the present application, and do not constitute a limitation on the technical solution provided in the embodiment of the present application. Ordinary technicians in this field can know that with the evolution of the system and the emergence of new business scenarios, the technical solution provided in the embodiment of the present application is also applicable to similar technical problems.

[0061] Combined with the networking of the above data security management system, the data security management method used for blockchain in this application will be introduced below. Please refer to Figure 2 , Figure 2 A flowchart of a data security management method for a blockchain provided in an embodiment of the present application is shown in FIG. Figure 2 As shown, the data security management method for blockchain provided in the embodiment of the present application includes the following steps:

[0062] Step 201: Generate a query trapdoor in response to a data query operation by a data user.

[0063] In the embodiments of the present application, Figure 1 As shown, the user of the data user terminal 103 can perform data query operations through the data user terminal 103. At this time, the blockchain 102 responds to the data user's data query operation and generates a query trap based on the data query operation.

[0064] In an embodiment of the present application, the step of generating a query trap in response to a data query operation of a data user includes: determining query parameters according to the data query operation, wherein the query parameters include a query range or a query point; generating the query trap based on the query parameters according to a trap generation component of a secure query algorithm. Specifically, the data user inputs query parameters (including a query range or a query point, etc.) through a data user terminal, calls the smart contract of the blockchain platform, and obtains a corresponding trap value (i.e., a query trap) based on the query parameters according to the trap generation component of the secure query algorithm, and the trap value is used as a query parameter for querying in the blockchain platform. The blockchain platform receives the query request and related parameters from the data user terminal and calls the smart contract service of the blockchain platform to generate query parameters (i.e., query trap) for querying in the blockchain platform; in another embodiment, the query parameters for querying in the blockchain platform may also be SQL query commands. Here, the query trap is generated to call the oracle contract service in the blockchain platform to obtain the query result.

[0065] In order to enable the normal implementation of the present application, the method provided by the present application also includes: determining the plaintext data in response to the data upload operation of the data owner; encrypting the plaintext data using an encryption component based on a security query algorithm to obtain ciphertext data and security index data; and storing the ciphertext data and security index data in the database of the oracle contract.

[0066] In an embodiment of the present application, the storing of the ciphertext data and the security index data in the database of the oracle contract includes: storing the ciphertext data and the index value in a ciphertext table in the database; storing the security index data and the index value in a security index table in the database, the index values ​​of the ciphertext table and the security index table being the same.

[0067] In an embodiment of the present application, before storing the ciphertext data and security index data in the database of the oracle contract, it also includes: converting the encoding format of the ciphertext data into UTF-8; converting the content of the ciphertext data into Unicode code value.

[0068] Specifically, the data owner uploads the data through the data owner terminal. The blockchain platform responds to the data owner's data upload operation, determines the plaintext data uploaded by the data owner, and then uses the encryption component to encrypt the plaintext data based on the security query algorithm of the smart contract to generate ciphertext data and security index data; then the encoding format of the ciphertext data is converted to UTF-8, and the content of the ciphertext data is converted to Unicode code value; then the ciphertext data and security index data are stored in the database of the oracle contract, and the decryption component is shared with the data user terminal; when storing, a ciphertext table and a security index table are created in the oracle database, the ciphertext table is used to store ciphertext data and index values, and the data types are mediumtext type and char type respectively, and the security index table is used to store security index data and index values, and the data types are both char type; the index values ​​of the ciphertext table and the security index table are the same, which is convenient for merging the two tables during the query process, and obtaining the corresponding ciphertext data according to the security index data; both the ciphertext table and the security index table are stored in the chain_oracle database.

[0069] Step 202: Obtain the ciphertext data corresponding to the query trapdoor from the oracle contract through the smart contract of the blockchain.

[0070] In the embodiment of the present application, following the previous step 201, when the blockchain platform receives a data query operation request from the data user terminal, it responds to the data user's data query operation and generates a query trap. It is necessary to obtain the ciphertext data corresponding to the query trap from the oracle contract through the smart contract of the blockchain. Furthermore, the smart contract receives the query result called back from the oracle contract (that is, the ciphertext data corresponding to the query trap obtained from the oracle contract).

[0071] Step 203: Obtain a decryption component of the device of the data owner of the ciphertext data.

[0072] In the embodiment of the present application, this step includes: obtaining the decryption component of the data owner's device of the ciphertext data by means of data sharing. Specifically, when the data owner encrypts the data and uploads it to the oracle database on the data owner's terminal, the decryption component needs to be shared with the data user's terminal. Therefore, the decryption component of the data owner's device of the ciphertext data can be obtained by means of data sharing, so as to use the decryption component to decrypt the ciphertext data.

[0073] In the embodiment of the present application, the decryption component includes a key, a Gm function, etc.

[0074] Step 204: Use the decryption component to decrypt the restored ciphertext data to obtain plaintext data.

[0075] In an embodiment of the present application, the step of using the decryption component to decrypt the restored ciphertext data to obtain plaintext data includes: extracting the ciphertext data through a regular expression to obtain key ciphertext data; restoring the encoding format and data format of the key ciphertext data to obtain the restored ciphertext data.

[0076] Specifically, the ciphertext data corresponding to the query trap obtained from the oracle contract in step 202 is the initial ciphertext data. After receiving the initial ciphertext data, the smart contract needs to process its text content and data structure; here, the query result (i.e., the initial ciphertext data) obtained from the oracle contract service is in the format of a Json sequence, and it is necessary to extract the initial ciphertext data by setting a regular expression, extract the key data required for the decryption stage, i.e., the key ciphertext data, and then convert the content of the key ciphertext data from the Unicode code value to the corresponding character, and convert the encoding format of the key ciphertext data from UTF-8 to Latin1, which is the encoding format of the original ciphertext, that is, here the key ciphertext data is restored by restoring the encoding format and data format of the key ciphertext data to obtain the restored ciphertext data; then the restored ciphertext data is decrypted using the decryption component to obtain the plaintext data.

[0077] Step 205: Perform concise processing on the plaintext data to obtain the query result of the data query operation.

[0078] In an embodiment of the present application, the step of refining the plaintext data to obtain the query result of the data query operation includes: refining the plaintext data according to the query parameters.

[0079] Specifically, following step 204, after obtaining the plaintext data, the plaintext data is refined, and accurate plaintext query results are obtained according to the query interval or query point (ie, query parameters) set by the data user.

[0080] In this step, if Figure 1 As shown, the blockchain platform sends the query results corresponding to the data query operation to the data user terminal for presentation.

[0081] In the embodiments of the present application, the data of the blockchain is securely managed based on the blockchain and oracle service. Based on the storage method of the oracle service, the oracle contract is modified to obtain data, and a secure calculation method is designed under the user contract to obtain accurate query data. The oracle service of the blockchain is used to improve the efficiency of storing and accessing data. At the same time, the data is securely calculated online on the blockchain to ensure the security of the data during the query process and improve the query efficiency of big data, alleviate the technical problem of low data security in the current data security management method, and greatly improve the security of the data on the chain.

[0082] The present application will now be further described in conjunction with specific embodiments.

[0083] See also Figure 3 , Figure 3 The following is a schematic diagram of the data encryption upload process provided in the embodiment of the present application. Figure 3 As shown, the process of data owner encrypting and uploading data is as follows:

[0084] In an embodiment of the present application, the data owner uploads the plaintext data owned by the data owner through the data owner terminal. The blockchain platform responds to the data upload operation of the data owner, determines the plaintext data uploaded by the data owner, and uses the encryption component (i.e., according to the security query algorithm) to encrypt the plaintext data to generate original ciphertext data, security index data and shared data (i.e., decryption component); then, the encoding format of the original ciphertext data is converted to UTF-8 through the transcoding component, and the content of the ciphertext data is converted to Unicode code value; then, the transcoded ciphertext data and security index data are stored in the oracle database of the oracle contract, and the shared data (i.e., decryption component) is shared with the data user terminal.

[0085] Here, the method for storing the transcoded ciphertext data and security index data in the oracle database of the oracle contract includes: creating a ciphertext table and a security index table in the oracle database, the ciphertext table is used to store the ciphertext data and index values, and the data types are mediumtext type and char type respectively, and the security index table is used to store the security index data and index values, and the data types are both char type; the index values ​​of the ciphertext table and the security index table are the same, which is convenient for merging the two tables during the query operation, and obtaining the corresponding ciphertext data according to the security index data; the ciphertext table and the security index table are both stored in the chain_oracle database.

[0086] See also Figure 4 , Figure 4 A schematic diagram of a data query process provided in an embodiment of the present application; Figure 4 As shown, the process of data users querying data is as follows:

[0087] In an embodiment of the present application, a data user inputs a query range or query point (i.e., a query parameter) through a data user terminal, a blockchain platform receives the query request and related parameters of the data user terminal, and calls the smart contract of the blockchain platform, and obtains a corresponding trapdoor value (i.e., a query trapdoor) based on the input query range or query point according to the trapdoor generation component of the security query algorithm; then, the oracle contract is called through the trapdoor value, and the corresponding data is obtained from the oracle database according to the data retrieval configuration specified in the oracle contract (the data retrieval configuration may include MySQL data retrieval configuration, etc.), and the obtained data is returned to the smart contract; the smart contract receives the data callback of the oracle contract (corresponding to the initial ciphertext data in the above text), and the callback data is ciphertext data and security index data. After receiving the callback data, the smart contract needs to process the text content and data structure of the callback data; here, the data obtained from the oracle database is in the format of a Json sequence, and needs to be designed with regular expressions Expression, extract the required data content (corresponding to the key ciphertext data mentioned above); build a security index, compare the trapdoor value with the security index according to the basic logic of the security query algorithm, and when a certain set of security indexes matches the trapdoor value, obtain the corresponding ciphertext data, package the search results (ciphertext data) into a corresponding data structure as the return value, and replace the original return value; then transcode the ciphertext result obtained after the security query and calculation, convert the content of the ciphertext result from the Unicode code value to the corresponding character, and convert the encoding format of the ciphertext result from UTF-8 to Latin1, which is the encoding format of the original ciphertext, that is, the ciphertext result is restored here; then the restored ciphertext result is decrypted using the decryption component shared by the data owner to obtain the plaintext data, and then the plaintext data is refined to obtain the plaintext result corresponding to the data query operation; finally, the blockchain platform sends the plaintext result to the user terminal for presentation. At this point, the data query process is completed.

[0088] In this embodiment, the blockchain platform may include Changan Chain, etc.

[0089] In the embodiments of the present application, the data of the blockchain is securely managed based on the blockchain and oracle service. Based on the storage method of the oracle service, the oracle contract is modified to obtain data, and a secure calculation method is designed under the user contract to obtain accurate query data. The oracle service of the blockchain is used to improve the efficiency of storing and accessing data. At the same time, the data is securely calculated online on the blockchain to ensure the security of the data during the query process and improve the query efficiency of big data, alleviate the technical problem of low data security in the current data security management method, and greatly improve the security of the data on the chain.

[0090] Based on the content of the above embodiment, the embodiment of the present application provides a data security management device for blockchain, which can be set in any blockchain platform. The data security management device for blockchain is used to execute the data security management method for blockchain provided in the above method embodiment, please refer to Figure 5 , the device comprises:

[0091] A response module 501, for generating a query trapdoor in response to a data query operation of a data user;

[0092] A calling module 502 is used to obtain the ciphertext data corresponding to the query trapdoor from the oracle contract through the smart contract of the blockchain;

[0093] An acquisition module 503 is used to acquire a decryption component of a device of a data owner of the ciphertext data;

[0094] A decryption module 504, configured to use the decryption component to decrypt the restored ciphertext data to obtain plaintext data;

[0095] The refining module 505 is used to perform refining processing on the plaintext data to obtain the query result of the data query operation.

[0096] In one embodiment, the aforementioned data security management device also includes an encryption processing module, which is used to determine the plaintext data in response to the data upload operation of the data owner; encrypt the plaintext data using an encryption component based on a security query algorithm to obtain ciphertext data and a security index number; and store the ciphertext data and security index data in the database of the oracle contract.

[0097] In one embodiment, the encryption processing module is specifically used to: store the ciphertext data and index value in a ciphertext table in the database; store the security index data and index value in a security index table in the database, and the index values ​​of the ciphertext table and the security index table are the same.

[0098] In one embodiment, the encryption processing module is specifically used to: convert the encoding format of the ciphertext data into UTF-8; and convert the content of the ciphertext data into Unicode code values.

[0099] In one embodiment, the response module 501 is specifically used to: determine query parameters according to the data query operation, the query parameters including a query range or a query point; and generate the query trap based on the query parameters according to a trapdoor generation component of a security query algorithm.

[0100] In one embodiment, the refining module 505 is specifically used to: refine the plaintext data according to the query parameters.

[0101] In one embodiment, the decryption module 504 is specifically used to: extract the ciphertext data through a regular expression to obtain key ciphertext data; perform encoding format and data format restoration processing on the key ciphertext data to obtain the restored ciphertext data.

[0102] In one embodiment, the acquisition module 503 is specifically used to: acquire the decryption component of the data owner's device of the ciphertext data by means of data sharing.

[0103] Correspondingly, an embodiment of the present application also provides a computer device, which includes a server or a terminal, etc.

[0104] like Figure 6 As shown, the computer device may include a processor 1001 having one or more processing cores, a memory 1002 including one or more computer-readable storage media, an input unit 1003, a display unit 1004, a wireless fidelity (WiFi) module 1005, a power supply 1006, and a radio frequency (RF) circuit 1007. Those skilled in the art will appreciate that Figure 6 The computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. Among them:

[0105] Processor 1001 is the control center of the computer device, which uses various interfaces and lines to connect various parts of the entire mobile phone, and executes various functions of the computer device and processes data by running or executing software programs and / or modules stored in memory 1002, and calling data stored in memory 1002.

[0106] The memory 1002 may be used to store software programs and modules, and the processor 1001 executes various functional applications and data processing by running the software programs and modules stored in the memory 1002. The input unit 1003 may be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.

[0107] The display unit 1004 may be used to display information input by a user or information provided to a user and various graphical user interfaces of a computer device. These graphical user interfaces may be composed of graphics, texts, icons, videos, and any combination thereof.

[0108] WiFi is a short-range wireless transmission technology. Computer devices can help users send and receive emails, browse web pages, and access streaming media through WiFi module 1005. It provides users with wireless broadband Internet access. Figure 6 A WiFi module 1005 is shown, but it is understandable that it is not a necessary component of the computer device and can be omitted as needed without changing the essence of the application.

[0109] The computer device also includes a power supply 1006 (such as a battery) for supplying power to various components. Preferably, the power supply can be logically connected to the processor 1001 through a power management system, so that the power management system can manage charging, discharging, power consumption and other functions.

[0110] The radio frequency circuit 1007 may be used for receiving and sending signals during information transmission or communication. In particular, after receiving the downlink information from the base station, it is processed by one or more processors 1001. In addition, uplink data may be sent to the base station.

[0111] Although not shown, the computer device may also include a Bluetooth module, etc., which will not be described in detail herein. Specifically in this embodiment, the processor 1001 in the computer device will load the executable files corresponding to the processes of one or more application programs into the memory 1002 according to the following instructions, and the processor 1001 will run the application programs stored in the memory 1002.

[0112] For example, the computer device is set on the blockchain platform to achieve the following functions:

[0113] In response to a data query operation by a data user, generating a query trapdoor;

[0114] Obtain the ciphertext data corresponding to the query trapdoor from the oracle contract through the smart contract of the blockchain;

[0115] Obtain a decryption component of a device of a data owner of the ciphertext data;

[0116] Decrypt the restored ciphertext data using the decryption component to obtain plaintext data;

[0117] The plaintext data is refined to obtain a query result of the data query operation.

[0118] In the above embodiments, the description of each embodiment has its own emphasis. For the part that is not described in detail in a certain embodiment, please refer to the detailed description above and will not be repeated here.

[0119] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0120] To this end, an embodiment of the present application provides a computer-readable storage medium, in which a plurality of instructions are stored, and the instructions can be loaded by a processor and used to implement the following functions on a blockchain platform:

[0121] In response to a data query operation by a data user, generating a query trapdoor;

[0122] Obtain the ciphertext data corresponding to the query trapdoor from the oracle contract through the smart contract of the blockchain;

[0123] Obtain a decryption component of a device of a data owner of the ciphertext data;

[0124] Decrypt the restored ciphertext data using the decryption component to obtain plaintext data;

[0125] The plaintext data is refined to obtain a query result of the data query operation.

[0126] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0127] The storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0128] Since the instructions stored in the storage medium can execute the steps in any method provided in the embodiments of the present application, the beneficial effects that can be achieved by any method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0129] At the same time, the embodiment of the present application provides a computer program product or a computer program, which includes a computer instruction, and the computer instruction is stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device performs the method provided in the above various optional implementations. For example, the following functions can be implemented:

[0130] In response to a data query operation by a data user, generating a query trapdoor;

[0131] Obtain the ciphertext data corresponding to the query trapdoor from the oracle contract through the smart contract of the blockchain;

[0132] Obtain a decryption component of a device of a data owner of the ciphertext data;

[0133] Decrypt the restored ciphertext data using the decryption component to obtain plaintext data;

[0134] The plaintext data is refined to obtain a query result of the data query operation.

[0135] The above is a detailed introduction to a data security management method, device and equipment for blockchain provided by the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the technical solution and its core idea of ​​the present application, rather than to limit it. Although the present invention is described in detail with reference to the aforementioned embodiments, ordinary technicians in this field should understand that it is still possible to modify the technical solutions recorded in the aforementioned embodiments, or to replace some of the technical features therein by equivalents. These modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A data security management method for blockchain, characterized in that: include: In response to a data query operation by a data user, generating a query trapdoor; Obtain the ciphertext data corresponding to the query trapdoor from the oracle contract through the smart contract of the blockchain; Obtain a decryption component of a device of a data owner of the ciphertext data; Decrypt the restored ciphertext data using the decryption component to obtain plaintext data; The plaintext data is refined to obtain a query result of the data query operation.

2. The data security management method according to claim 1, characterized in that: Also includes: In response to a data upload operation by a data owner, determining plaintext data; Encrypt the plaintext data using an encryption component based on a security query algorithm to obtain ciphertext data and security index data; The encrypted data and the security index data are stored in the database of the oracle contract.

3. The data security management method according to claim 2, characterized in that: The step of storing the ciphertext data and the security index data in the database of the oracle contract comprises: Storing the ciphertext data and index value in a ciphertext table in the database; The security index data and the index value are stored in a security index table in the database, and the index value of the ciphertext table is the same as that of the security index table.

4. The data security management method according to claim 2, characterized in that: Before the step of storing the ciphertext data and the security index data in the database of the oracle contract, it also includes: Convert the encoding format of the ciphertext data to UTF-8; Convert the content of the ciphertext data into Unicode code values.

5. The data security management method according to claim 1, characterized in that: The step of generating a query trapdoor in response to a data query operation by a data user comprises: Determining query parameters according to the data query operation, wherein the query parameters include a query range or a query point; According to the trapdoor generation component of the security query algorithm, the query trapdoor is generated based on the query parameters.

6. The data security management method according to claim 5, characterized in that: The step of refining the plaintext data to obtain the query result of the data query operation includes: The plaintext data is refined according to the query parameters.

7. The data security management method according to claim 1, characterized in that: The step of using the decryption component to decrypt the restored ciphertext data to obtain plaintext data includes: Extract the ciphertext data through regular expressions to obtain key ciphertext data; The key ciphertext data is subjected to encoding format and data format restoration processing to obtain the ciphertext data after the restoration processing.

8. The data security management method according to any one of claims 1 to 7, characterized in that: The step of obtaining the decryption component of the data owner device of the ciphertext data comprises: The decryption component of the device of the data owner of the ciphertext data is obtained by means of data sharing.

9. A data security management device for blockchain, characterized in that: include: A response module, used to generate a query trap in response to a data query operation by a data user; A calling module, used to obtain the ciphertext data corresponding to the query trapdoor from the oracle contract through the smart contract of the blockchain; An acquisition module, used for acquiring a decryption component of a device of a data owner of the ciphertext data; A decryption module, used to use the decryption component to decrypt the restored ciphertext data to obtain plaintext data; The refining module is used to perform refining processing on the plaintext data to obtain the query result of the data query operation.

10. A computer device, characterized in that: The computer device comprises a processor and a memory, wherein the memory stores a plurality of instructions, and the instructions are suitable for being loaded by the processor to execute the steps in the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Searchable encrypted file data method realized based on blockchain intelligent contract

    CN110135986A

  • Searchable encrypted data cloud storage method based on block chain and homomorphic encryption

    CN111414435A

  • On-chain and off-chain data sharing scheme based on distributed oracle machine and homomorphic encryption

    CN112016105A

  • Data processing method and device based on block chain

    CN112948465A

  • Dynamic searchable encryption method and device based on block chain

    CN114048448A