A data security management method, apparatus and device for blockchain

By generating query trapdoors on the blockchain platform and using decryption components with oracle services, secure management of blockchain data is achieved, solving the problems of data confidentiality and searchability, and improving data security and query efficiency.

CN119669283BActive Publication Date: 2025-12-02BEIJING HUANDING ENVIRONMENTAL BIG DATA RES INST
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing technologies struggle to guarantee data confidentiality on blockchain platforms, resulting in low data security. Furthermore, encryption algorithms compromise data searchability, hindering the provision of effective data analysis and computation services.

Method used

By generating a query trapdoor, encrypted data is obtained from an oracle contract using a blockchain smart contract. The encrypted data is then decrypted using a decryption component to obtain plaintext data, which is then refined to obtain the query results. At the same time, a secure query algorithm is used for encryption and indexing during data upload.

Benefits of technology

It improves the security and query efficiency of data on the blockchain, ensures the security of data during the query process, improves the query efficiency of big data, and alleviates the problem of low data security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119669283B_ABST
    Figure CN119669283B_ABST
Patent Text Reader

Abstract

This application provides a data security management method, apparatus, and device 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 an oracle contract via a blockchain smart contract; obtaining a decryption component on the data owner's device; using the decryption component to decrypt the restored ciphertext data to obtain plaintext data; and refining the plaintext data to obtain the query result of the data query operation. This application manages blockchain data security based on blockchain and oracle services. It modifies the oracle contract to obtain data based on the storage method of the oracle service, designs a secure computation method under the user contract to obtain accurate query data, and improves the efficiency of data access by employing blockchain oracle services. Online secure computation of data on the blockchain ensures data security during the query process and improves the efficiency of querying large amounts of data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data security management, and in particular to a data security management method, apparatus and device for blockchain. Background Technology

[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. Blockchain platforms can effectively ensure the verifiable integrity and decentralized distributed consistency of on-chain data, but it is difficult to guarantee the confidentiality of the data.

[0003] Currently, the conventional method to ensure the confidentiality of on-chain data is to encrypt the data using encryption algorithms before it is uploaded to the blockchain, and the blockchain platform directly stores the encrypted data. However, because encryption algorithms destroy the searchability of data, blockchain platforms cannot manage the encrypted data generated by such algorithms. This makes it impossible for blockchain platforms to provide effective data analysis and computing services based on this encrypted data, resulting in the lack of widespread adoption of data encryption algorithms within the blockchain.

[0004] Therefore, current data security management methods used in blockchain have technical problems with low data security and need to be improved. Summary of the Invention

[0005] This application provides a data security management method, apparatus, and device for blockchain, which aims to alleviate the technical problem of low data security in current data security management methods for blockchain.

[0006] To address the aforementioned technical problems, the embodiments of this application provide the following technical solutions:

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

[0008] Generate query traps in response to data users' data query operations;

[0009] The encrypted data corresponding to the query trapdoor is obtained from the oracle contract through a smart contract on the blockchain.

[0010] The decryption component of the data owner's device is obtained from the encrypted data;

[0011] The decryption component is used to decrypt the restored ciphertext data to obtain plaintext data.

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

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

[0014] In response to the data owner's data upload operation, determine the plaintext data;

[0015] The plaintext data is encrypted using an encryption component based on a secure query algorithm to obtain ciphertext data and secure index data.

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

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

[0018] Store the encrypted data and index value in the encrypted table of the database;

[0019] The secure index data and index values ​​are stored in the secure index table of the database, and the index values ​​of the ciphertext table and the secure index table are the same.

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

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

[0022] The content of the encrypted data is converted into a Unicode code point.

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

[0024] Based on the data query operation, the query parameters are determined, including the query range or query point;

[0025] The query trapdoor is generated based on the query parameters according to the trapdoor generation component of the secure query algorithm.

[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 based on 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] The key ciphertext data is obtained by extracting the ciphertext data using regular expressions;

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

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

[0032] The decryption component of the data owner's device is obtained through data sharing.

[0033] This application also provides a data security management device for blockchain, comprising:

[0034] The response module is used to generate query trapdoors in response to data query operations by data users;

[0035] The calling module is used to obtain the ciphertext data corresponding to the query trapdoor from the oracle contract through the blockchain's smart contract;

[0036] The acquisition module is used to acquire the decryption component of the data owner's device of the encrypted data;

[0037] The decryption module is used to decrypt the restored ciphertext data using the decryption component to obtain plaintext data;

[0038] The refinement module is used to refine the plaintext data to obtain the query results of the data query operation.

[0039] Meanwhile, this application provides a computer device including a processor and a memory, the memory storing multiple instructions adapted for loading by the processor to execute the steps in the above method.

[0040] Meanwhile, this application provides a computer-readable storage medium storing multiple instructions adapted for loading by a processor to execute the steps in the above method.

[0041] Meanwhile, this application provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium; the processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the steps in the above method.

[0042] Beneficial Effects: This application provides a data security management method, apparatus, and device for blockchain. The method includes: generating a query trap in response to a data user's data query operation; obtaining ciphertext data corresponding to the query trap from an oracle contract via a blockchain smart contract; obtaining a decryption component from the data owner's device of the ciphertext data; using the decryption component to decrypt the restored ciphertext data to obtain plaintext data; and refining the plaintext data to obtain the query result of the data query operation. Compared with current technologies, this application uniquely manages blockchain data security based on blockchain and oracle services. It modifies the oracle contract to obtain data based on the storage method of oracle services, designs a secure computation method under the user contract to obtain accurate query data, and utilizes blockchain oracle services to improve data access efficiency. Simultaneously, online secure computation of data on the blockchain ensures data security during the query process and improves the query efficiency for large datasets. This alleviates the technical problem of low data security in current data security management methods and significantly improves the security of on-chain data. Attached Figure Description

[0043] The technical solution and its beneficial effects will become apparent from the following detailed description of specific embodiments of this application, in conjunction with the accompanying drawings.

[0044] Figure 1 This is a network diagram of the data security management system provided in the embodiments of this application;

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

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

[0047] Figure 4 This is a schematic diagram of the data query process provided in the embodiments of this application;

[0048] Figure 5 This is a schematic diagram of the structure of a data security management device for blockchain provided in an embodiment of this application;

[0049] Figure 6 This is a schematic diagram of the structure of the computer device provided in the embodiments of this application. Detailed Implementation

[0050] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.

[0051] In the description of the embodiments of this application, it should 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 such terms can be interchanged where appropriate so that the embodiments described herein can be implemented in an order other than that shown in the drawings or description. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion.

[0052] The methods involved in this application can be implemented through a blockchain platform, specifically through oracle contracts (oracle services) and smart contracts within the blockchain platform. This application enables online secure computation and management of data on the blockchain, ensuring data security during the query process and improving the efficiency of querying large datasets.

[0053] The method provided in this application embodiment can be executed through a blockchain platform. For details, please refer to [link to relevant documentation]. Figure 1 , Figure 1 This is a network diagram of the data security management system provided in the embodiments of this 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 through wired or wireless communication, and this application does not impose any restrictions on this.

[0055] The data owner terminal 101 and the data user terminal 103 can be portable terminals such as smartphones, tablets, and laptops, or fixed terminals such as desktop computers and query machines, but are not limited to these. Both the data owner terminal 101 and the data user terminal 103 are service ports that users can use and operate. The data owner terminal 101 can be used to encrypt the plaintext data owned by the user using blockchain-based smart contracts to generate ciphertext data, and then upload the ciphertext data to the oracle database. The data user terminal 103 is mainly used to provide users with data query operations, generate query traps, and also to display the data query results corresponding to the query operations through the data user terminal 103. There can be one or more data owner terminals 101, and there can be one or more data user terminals 103. 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] Blockchain 102 primarily relies on smart contracts and oracle contracts to achieve secure management of encrypted data within the blockchain. Specifically, it can be used to generate query traps in response to data users' data query operations; obtain the encrypted data corresponding to the query trap from the oracle contract through the blockchain's smart contract; obtain the decryption component from the data owner's device; use the decryption component to decrypt the restored encrypted 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 respond to data upload operations by data owners, determine plaintext data; encrypt the plaintext data using an encryption component based on a secure query algorithm to obtain ciphertext data and secure index data; and store the ciphertext data and secure index data in the database of the oracle contract.

[0058] The process of 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; and storing the security index data and index value in a security index table in the database, wherein the index values ​​of the ciphertext table and the security index table are the same.

[0059] In this embodiment, when the blockchain receives a data query request from a data user's terminal, it responds to the user's data query operation by generating a query trapdoor. Through the blockchain's smart contract, it retrieves the ciphertext data corresponding to the query trapdoor from the oracle contract, obtains the decryption component from the data owner's device, and then uses the decryption component to decrypt the restored ciphertext data to obtain plaintext data. Finally, it refines the plaintext data to obtain the query result of the data query operation. Compared with current technologies, this application uniquely manages blockchain data security based on blockchain and oracle services. It modifies the oracle contract to obtain data based on the oracle service's storage method, designs a secure computation method under the user contract, and obtains accurate query data. By employing blockchain oracle services, it improves the efficiency of data storage and retrieval. Simultaneously, online secure computation on the blockchain ensures data security during the query process and improves the query efficiency for large datasets. This alleviates the technical problem of low data security in current data security management methods and significantly enhances the security of on-chain data.

[0060] It should be noted that, Figure 1 The network diagram of the data security management system shown is merely an example. The blockchain, terminal, and scenario described in this application embodiment are for the purpose of more clearly illustrating the technical solutions of this application embodiment and do not constitute a limitation on the technical solutions provided in this application embodiment. As those skilled in the art will know, with the evolution of the system and the emergence of new business scenarios, the technical solutions provided in this application embodiment are also applicable to similar technical problems.

[0061] Based on the network architecture of the aforementioned data security management system, the data security management method for blockchain described in this application will be introduced below. Please refer to [link / reference]. Figure 2 , Figure 2 A flowchart of a data security management method for blockchain provided in the embodiments of this application is shown below. Figure 2 As shown in the embodiments of this application, the data security management method for blockchain includes the following steps:

[0062] Step 201: In response to the data user's data query operation, generate a query trapdoor.

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

[0064] In this embodiment, the step of generating a query trapdoor in response to a data user's data query operation includes: determining query parameters based on the data query operation, the query parameters including a query range or query point; and generating the query trapdoor based on the query parameters using a trapdoor generation component of a secure query algorithm. Specifically, the data user inputs query parameters (including a query range or query point, etc.) through a data user terminal, invokes a smart contract on the blockchain platform, and obtains a corresponding trapdoor value (i.e., a query trapdoor) based on the query parameters using the trapdoor generation component of the secure query algorithm. This trapdoor value serves as the query parameter for querying on the blockchain platform. The blockchain platform receives the query request and related parameters from the data user terminal and invokes the blockchain platform's smart contract service to generate the query parameters (i.e., the query trapdoor) for querying on the blockchain platform. In another embodiment, the query parameters for querying on the blockchain platform can also be SQL query commands. Here, generating the query trapdoor is for invoking an oracle contract service on the blockchain platform to obtain query results.

[0065] To enable the proper implementation of this application, the method provided in this application further includes: in response to the data upload operation of the data owner, determining the plaintext data; encrypting the plaintext data using an encryption component based on a secure query algorithm to obtain ciphertext data and secure index data; and storing the ciphertext data and secure index data in the database of the oracle contract.

[0066] In this embodiment of the application, 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; and storing the security index data and index value in a security index table in the database, wherein the index values ​​of the ciphertext table and the security index table are the same.

[0067] In this embodiment of the application, before storing the ciphertext data and security index data to the database of the oracle contract, the method further includes: converting the encoding format of the ciphertext data to UTF-8; and converting the content of the ciphertext data to Unicode code values.

[0068] Specifically, the data owner uploads data through their terminal. The blockchain platform responds by identifying the plaintext data uploaded and then, based on the smart contract's secure query algorithm, encrypts the plaintext data using an encryption component to generate ciphertext data and secure index data. The ciphertext data is then converted to UTF-8 encoding and its content to Unicode values. The ciphertext data and secure index data are then stored in the oracle contract's database, while the decryption component is shared with the data user's terminal. During storage, a ciphertext table and a secure index table are created in the oracle database. The ciphertext table stores the ciphertext data and index values ​​(data types: mediumtext and char, respectively), while the secure index table stores the secure index data and index values ​​(data type: char). The ciphertext and secure index tables have the same index value, facilitating merging of the two tables during queries and retrieving the corresponding ciphertext data based on the secure index data. Both the ciphertext and secure index tables 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 blockchain's smart contract.

[0070] In this embodiment of the 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. Then, it needs to obtain the ciphertext data corresponding to the query trap from the oracle contract through the blockchain's smart contract. Furthermore, the smart contract receives the query result (i.e., the ciphertext data corresponding to the query trap obtained from the oracle contract) from the callback of the oracle contract.

[0071] Step 203: Obtain the decryption component of the data owner's device for the encrypted data.

[0072] In this embodiment of the application, this step includes: obtaining the decryption component of the data owner's device for the encrypted data through data sharing. Specifically, while the data owner encrypts the data and uploads it to the oracle database on their terminal, they need to share the decryption component with the data user's terminal. Therefore, the decryption component of the data owner's device for the encrypted data can be obtained through data sharing, so that the decryption component can be used to decrypt the encrypted data.

[0073] In this embodiment, the decryption components include 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 this embodiment of the application, the step of using the decryption component to decrypt the restored ciphertext data to obtain plaintext data includes: extracting the ciphertext data using regular expressions to obtain key ciphertext data; and restoring the encoding format and data format of the key ciphertext data to obtain the restored ciphertext data.

[0076] Specifically, in step 202, the ciphertext data corresponding to the query trapdoor obtained from the oracle contract is the initial ciphertext data. After receiving this initial ciphertext data, the smart contract needs to process its text content and data structure. Here, the query result obtained from the oracle contract service (i.e., the initial ciphertext data) is in JSON sequence format. Regular expressions need to be set to extract the key data required for the decryption stage, i.e., the key ciphertext data. Then, the content of the key ciphertext data is converted from Unicode code values ​​to corresponding characters, and the encoding format of the key ciphertext data is converted from UTF-8 to Latin1. Latin1 is the encoding format of the original ciphertext. That is, after the key ciphertext data is processed by restoring the encoding format and data format, the restored ciphertext data is obtained. Then, the restored ciphertext data is decrypted using the decryption component to obtain the plaintext data.

[0077] Step 205: Refine the plaintext data to obtain the query result of the data query operation.

[0078] In this embodiment of the 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 based on the query range or query point (i.e. query parameters) set by the data user.

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

[0081] In this embodiment, a novel approach is adopted to securely manage blockchain data based on blockchain and oracle services. The storage method of the oracle service is used to modify the oracle contract to obtain data. A secure computation method is designed under the user contract to obtain accurate query data. By employing blockchain oracle services, the efficiency of data access is improved. Simultaneously, online secure computation of data on the blockchain ensures data security during the query process and improves the query efficiency for large datasets. This approach alleviates the technical problem of low data security in current data security management methods and significantly enhances the security of on-chain data.

[0082] The present application will now be further described with reference to specific embodiments.

[0083] Please see Figure 3 , Figure 3 This is a schematic diagram of the data encryption and upload process provided in an embodiment of this application. Figure 3 As shown, the process by which the data owner encrypts and uploads the data is as follows:

[0084] In this embodiment, the data owner uploads plaintext data through the data owner's terminal. The blockchain platform responds to the data owner's upload operation, determines the plaintext data uploaded by the data owner, and encrypts the plaintext data using an encryption component (i.e., according to a secure query algorithm) to generate original ciphertext data, secure index data, and shared data (i.e., decryption component). Then, the encoding format of the original ciphertext data is converted to UTF-8 using a transcoding component, and the content of the ciphertext data is converted to Unicode code values. Next, the transcoded ciphertext data and secure index data are stored in the oracle database of the oracle contract, while the shared data (i.e., decryption component) is shared with the data user terminal.

[0085] Here, the method for storing the encoded ciphertext data and secure index data into the oracle database of the oracle contract includes: creating a ciphertext table and a secure index table in the oracle database. The ciphertext table is used to store ciphertext data and index values, with data types of mediumtext and char respectively. The secure index table is used to store secure index data and index values, both with data type of char. The index values ​​of the ciphertext table and the secure index table are the same, which facilitates merging the two tables during query operations and retrieving the corresponding ciphertext data based on the secure index data. Both the ciphertext table and the secure index table are stored in the chain_oracle database.

[0086] Please see Figure 4 , Figure 4 This is a schematic diagram of the data query process provided in the embodiments of this application; such as Figure 4 As shown, the process of a data user querying data is as follows:

[0087] In this embodiment, the data user inputs a query range or query point (i.e., query parameters) through a data user terminal. The blockchain platform receives the query request and related parameters from the data user terminal and calls the blockchain platform's smart contract. Based on the input query range or query point, the platform generates a corresponding trapdoor value (i.e., query trapdoor) using the trapdoor generation component of the secure query algorithm. Then, using this trapdoor value, the platform calls the oracle contract to retrieve the corresponding data from the oracle database according to the data retrieval configuration specified in the oracle contract (which may include MySQL data retrieval configuration, etc.), and returns the retrieved data to the smart contract. The smart contract receives data from the oracle contract callback (corresponding to the initial ciphertext data mentioned above). This callback data consists of ciphertext data and secure 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 retrieved from the oracle database is in JSON sequence format, requiring the design of regular expressions. The expression extracts the required data content (corresponding to the key ciphertext data mentioned above); a secure index is constructed, and based on the basic logic of the secure query algorithm, the trapdoor value is compared with the secure index. When a set of secure indexes matches the trapdoor value, the corresponding ciphertext data is obtained. The search results (ciphertext data) are packaged into a corresponding data structure as the return value, replacing the original return value; then, the ciphertext result obtained from the secure query and calculation is converted and encoded, converting the content of the ciphertext result from Unicode code values ​​to the corresponding characters, and converting the encoding format of the ciphertext result from UTF-8 to Latin1. Latin1 is the encoding format of the original ciphertext, meaning that the ciphertext result has been restored here; next, the restored ciphertext result is decrypted using a decryption component shared by the data owner to obtain plaintext data. The plaintext data is then 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. This completes the data query process.

[0088] In this embodiment, the blockchain platform may include Chang'an Chain, etc.

[0089] In this embodiment, a novel approach is adopted to securely manage blockchain data based on blockchain and oracle services. The storage method of the oracle service is used to modify the oracle contract to obtain data. A secure computation method is designed under the user contract to obtain accurate query data. By employing blockchain oracle services, the efficiency of data access is improved. Simultaneously, online secure computation of data on the blockchain ensures data security during the query process and improves the query efficiency for large datasets. This approach alleviates the technical problem of low data security in current data security management methods and significantly enhances the security of on-chain data.

[0090] Based on the above embodiments, this application provides a data security management device for blockchain, which can be installed in any blockchain platform. This data security management device for blockchain is used to execute the data security management method for blockchain provided in the above method embodiments. Please refer to [link to relevant documentation]. Figure 5 The device includes:

[0091] The response module 501 is used to generate a query trapdoor in response to data query operations by data users;

[0092] Module 502 is invoked to obtain the ciphertext data corresponding to the query trapdoor from the oracle contract through the blockchain's smart contract;

[0093] Acquisition module 503 is used to acquire the decryption component of the data owner device of the encrypted data;

[0094] The decryption module 504 is used to decrypt the restored ciphertext data using the decryption component to obtain plaintext data;

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

[0096] In one embodiment, the aforementioned data security management device further includes an encryption processing module, used to determine plaintext data in response to a data owner's data upload operation; encrypt the plaintext data using an encryption component based on a security query algorithm to obtain ciphertext data and a security index; and store the ciphertext data and the 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; and store the secure index data and index value in a secure index table in the database, wherein the index values ​​of the ciphertext table and the secure 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 to UTF-8; and convert the content of the ciphertext data to 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 query range or query point; and generate the query trapdoor based on the query parameters according to the trapdoor generation component of the 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 ciphertext data using regular expressions to obtain key ciphertext data; and 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 encrypted data through data sharing.

[0103] Accordingly, embodiments of this application also provide 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 with 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 radio frequency (RF) circuitry 1007, among other components. Those skilled in the art will understand that... Figure 6 The computer device structure shown does not constitute a limitation on the computer device and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein:

[0105] The processor 1001 is the control center of the computer device. It connects various parts of the mobile phone through various interfaces and lines. It performs various functions of the computer device and processes data by running or executing software programs and / or modules stored in the memory 1002 and calling data stored in the memory 1002.

[0106] The memory 1002 can be used to store software programs and modules. 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 can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.

[0107] The display unit 1004 can be used to display information input by the user or information provided to the user, as well as various graphical user interfaces of computer devices, which can be composed of graphics, text, icons, videos, and any combination thereof.

[0108] WiFi is a short-range wireless transmission technology. Computer devices using the WiFi module 1005 can help users send and receive emails, browse web pages, and access streaming media, providing users with wireless broadband internet access. Although Figure 6 WiFi module 1005 is shown, but it is understood that it is not a necessary component of computer equipment and can be omitted as needed without changing the nature of the application.

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

[0110] The radio frequency circuit 1007 can be used to receive and transmit signals during information transmission or calls. In particular, it receives downlink information from the base station and hands it over to one or more processors 1001 for processing; in addition, it transmits uplink data 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 here. Specifically, in this embodiment, the processor 1001 in the computer device loads the executable files corresponding to the processes of one or more applications into the memory 1002 according to the following instructions, and the processor 1001 runs the applications stored in the memory 1002.

[0112] For example, by setting up the computer device on a blockchain platform, the following functions can be achieved:

[0113] Generate query traps in response to data users' data query operations;

[0114] The encrypted data corresponding to the query trapdoor is obtained from the oracle contract through a smart contract on the blockchain.

[0115] The decryption component of the data owner's device is obtained from the encrypted data;

[0116] The decryption component is used to decrypt the restored ciphertext data to obtain plaintext data.

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

[0118] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the detailed description above, and they will not be repeated here.

[0119] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.

[0120] Therefore, embodiments of this application provide a computer-readable storage medium storing multiple instructions that can be loaded by a processor to implement the following functions on a blockchain platform:

[0121] Generate query traps in response to data users' data query operations;

[0122] The encrypted data corresponding to the query trapdoor is obtained from the oracle contract through a smart contract on the blockchain.

[0123] The decryption component of the data owner's device is obtained from the encrypted data;

[0124] The decryption component is used to decrypt the restored ciphertext data to obtain plaintext data.

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

[0126] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

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

[0128] Since the instructions stored in the storage medium can execute the steps of any of the methods provided in the embodiments of this application, the beneficial effects that any of the methods provided in the embodiments of this application can achieve can be realized, as detailed in the preceding embodiments, and will not be repeated here.

[0129] Meanwhile, embodiments of this application provide a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in the various optional implementations described above. For example, the following functions can be implemented:

[0130] Generate query traps in response to data users' data query operations;

[0131] The encrypted data corresponding to the query trapdoor is obtained from the oracle contract through a smart contract on the blockchain.

[0132] The decryption component of the data owner's device is obtained from the encrypted data;

[0133] The decryption component is used to decrypt the restored ciphertext data to obtain plaintext data.

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

[0135] The foregoing has provided a detailed description of a data security management method, apparatus, and device for blockchain provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the technical solutions and core ideas of this application, and are not intended to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. These modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

Claims

1. A data security management method for blockchain, characterized in that, include: In response to the data owner's data upload operation, determine the plaintext data; The plaintext data is encrypted using an encryption component based on a secure query algorithm to obtain ciphertext data and secure index data; the ciphertext data and secure index data are then stored in the oracle contract's database. Generate query traps in response to data users' data query operations; The encrypted data corresponding to the query trapdoor is obtained from the database of the oracle contract through the blockchain's smart contract; The decryption component of the data owner's device is obtained from the encrypted data; The ciphertext data is extracted using regular expressions to obtain key ciphertext data. The key ciphertext data is then processed to restore its encoding and data formats to obtain restored ciphertext data. Finally, the decryption component is used to decrypt the restored ciphertext data to obtain plaintext data. The plaintext data is refined to obtain the query result of the data query operation.

2. The data security management method according to claim 1, characterized in that, The step of storing the encrypted data and security index data to the oracle contract's database includes: Store the encrypted data and index value in the encrypted table of the database; The secure index data and index values ​​are stored in the secure index table of the database, and the index values ​​of the ciphertext table and the secure index table are the same.

3. The data security management method according to claim 1, characterized in that, Before the step of storing the encrypted data and security index data to the oracle contract's database, the method further includes: Convert the encrypted data to UTF-8 encoding format; The content of the encrypted data is converted into a Unicode code point.

4. The data security management method according to claim 1, characterized in that, The step of generating a query trapdoor in response to a data user's data query operation includes: Based on the data query operation, the query parameters are determined, including the query range or query point; The query trapdoor is generated based on the query parameters according to the trapdoor generation component of the secure query algorithm.

5. The data security management method according to claim 4, 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 based on the query parameters.

6. The data security management method according to any one of claims 1 to 5, characterized in that, The step of obtaining the decryption component of the data owner's device from the encrypted data includes: The decryption component of the data owner's device is obtained through data sharing.

7. A data security management device for blockchain, characterized in that, include: The encryption processing module is used to determine the plaintext data in response to the data owner's data upload operation; The plaintext data is encrypted using an encryption component based on a secure query algorithm to obtain ciphertext data and a security index; the ciphertext data and the security index data are then stored in the oracle contract's database. The response module is used to respond to data query operations by data users and generate query trapdoors; The calling module is used to retrieve the ciphertext data corresponding to the query trapdoor from the database of the oracle contract through the blockchain's smart contract; The acquisition module is used to acquire the decryption component of the data owner's device of the encrypted data; The decryption module is used to extract the ciphertext data using regular expressions to obtain key ciphertext data, perform encoding and data format restoration processing on the key ciphertext data to obtain restored ciphertext data, and use the decryption component to decrypt the restored ciphertext data to obtain plaintext data. The refinement module is used to refine the plaintext data to obtain the query results of the data query operation.

8. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing a plurality of instructions adapted for loading by the processor to perform the steps of the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Data processing method and device based on block chain

    CN112948465A

  • Electricity consumption data encryption search method and device, computer equipment and storage medium

    CN115622700A