WO2024001028A1 - Method and apparatus for maintaining blockchain data, and electronic device and storage medium - Google Patents

Method and apparatus for maintaining blockchain data, and electronic device and storage medium Download PDF

Info

Publication number
WO2024001028A1
WO2024001028A1 PCT/CN2022/135413 CN2022135413W WO2024001028A1 WO 2024001028 A1 WO2024001028 A1 WO 2024001028A1 CN 2022135413 W CN2022135413 W CN 2022135413W WO 2024001028 A1 WO2024001028 A1 WO 2024001028A1
Authority
WO
WIPO (PCT)
Prior art keywords
blockchain
data
ciphertext
relational database
execution environment
Prior art date
Application number
PCT/CN2022/135413
Other languages
French (fr)
Chinese (zh)
Inventor
闫莺
魏长征
Original Assignee
蚂蚁区块链科技(上海)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 蚂蚁区块链科技(上海)有限公司 filed Critical 蚂蚁区块链科技(上海)有限公司
Publication of WO2024001028A1 publication Critical patent/WO2024001028A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures

Definitions

  • the embodiments of this specification belong to the field of blockchain technology, and particularly relate to a method, device, electronic device and storage medium for maintaining blockchain data.
  • Blockchain is a new application model of computer technology such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm.
  • data blocks are combined into a chained data structure in a chronological manner and are cryptographically guaranteed to be an untamperable and unforgeable distributed ledger.
  • non-relational databases In traditional blockchain technology, in order to meet the storage needs of blockchain nodes for large amounts of data when running blockchain services, blockchain nodes usually use non-relational databases with efficient access efficiency for data storage.
  • non-relational databases lack transaction relationships, lack connections between data and are not standardized, which is not conducive to data analysis. Relational databases have complete transaction relationships, connections between data and a strict standardized structure. If the non-relational database in traditional blockchain technology is replaced by a relational database, although it is beneficial to data analysis, it will not be used in the block chain.
  • the direct use of relational databases in the chain's underlying system will bring huge challenges to the online read and write performance of blockchain nodes when running blockchain services. Therefore, how to implement convenient data analysis services while ensuring that the blockchain service execution process has high access efficiency is an urgent problem in this field that needs to be solved.
  • the purpose of the present invention is to provide a method, device, electronic device and storage medium for maintaining blockchain data.
  • a method for maintaining blockchain data is proposed, which is applied to a node device deployed with a blockchain node and a first trusted execution environment, and the node device maintains There are blockchain non-relational databases and blockchain relational databases.
  • the blockchain non-relational database is used to maintain ciphertext data.
  • the ciphertext data is stored in the second trusted database by the blockchain node.
  • the blockchain data generated when running the blockchain service in the execution environment is encrypted by the first key corresponding to the second trusted execution environment; the method includes:
  • the ciphertext data is decrypted into the blockchain data through the first key, and the blockchain data is converted into a database corresponding to the blockchain relational database.
  • the ciphertext standard data is maintained in the blockchain relational database, and the blockchain relational database is used to provide data analysis services running in the first trusted execution environment to the analysis requester.
  • a device for maintaining blockchain data which is applied to a node device deployed with a blockchain node and a first trusted execution environment, and the node device maintains There are blockchain non-relational databases and blockchain relational databases.
  • the blockchain non-relational database is used to maintain ciphertext data.
  • the ciphertext data is stored in the second trusted database by the blockchain node.
  • the blockchain data generated when running the blockchain service in the execution environment is encrypted by the first key corresponding to the second trusted execution environment; the device includes:
  • a blockchain data acquisition unit configured to acquire the ciphertext maintained in the blockchain non-relational database when the blockchain node passes the remote certification verification corresponding to the first trusted execution environment. data
  • a blockchain data acquisition unit configured to decrypt the ciphertext data into the blockchain data through the first key in the first trusted execution environment, and convert the blockchain data into the blockchain data.
  • Standard data defined by the database schema information corresponding to the blockchain relational database, and encrypting the standard data into ciphertext standard data through the second key corresponding to the first trusted execution environment;
  • a standard data maintenance unit used to maintain the ciphertext standard data in the blockchain relational database, and the blockchain relational database is used to provide the analysis requester with information running in the first trusted execution environment. data analysis services.
  • an electronic device including:
  • Memory used to store instructions executable by the processor
  • the processor implements the method described in the first aspect by running the executable instructions.
  • a computer-readable storage medium on which computer instructions are stored, and when the instructions are executed by a processor, the steps of the method described in the first aspect are implemented.
  • the embodiment of this specification separately deploys a blockchain non-relational database and a blockchain relational database on node devices.
  • the blockchain non-relational database is used to maintain and run blockchain services on blockchain nodes.
  • the ciphertext data obtained by encrypting the blockchain data generated at the time enables the blockchain node to efficiently store the encrypted blockchain data and efficiently read the ciphertext data when running the blockchain service; on the other hand, , by decrypting, converting and encrypting the ciphertext data maintained in the blockchain non-relational database into ciphertext standard data to be simultaneously maintained in the blockchain relational database, thereby using the blockchain relational database to achieve convenient Data analysis services.
  • the blockchain node is providing the ciphertext.
  • the remote certificate corresponding to the first trusted execution environment needs to be verified in advance before data is sent, thereby ensuring system-level data security in data processing, data transmission and data storage.
  • the method for maintaining blockchain data involved in the embodiments of this specification realizes the backup of one data in two places, objectively improves the disaster recovery capability, and realizes convenient data access while ensuring efficient access efficiency during the execution of the blockchain service.
  • Analysis services at the same time, due to the combination of trusted execution environment technology, it realizes the entire process of trusted data transfer and trusted data processing from on-chain blockchain services to off-chain data conversion and data analysis services. The risk of data leakage is reduced as much as possible.
  • Figure 1 is a flow chart of a method for maintaining blockchain data provided by an exemplary embodiment.
  • Figure 2 is a system architecture diagram for maintaining blockchain data provided by an exemplary embodiment.
  • Figure 3 is a schematic structural diagram of a device provided by an exemplary embodiment.
  • Figure 4 is a block diagram of a device for maintaining blockchain data provided in an exemplary embodiment.
  • Figure 1 is a flow chart of a method for maintaining blockchain data provided by an exemplary embodiment. This method is applied to a node device deployed with a blockchain node and a first trusted execution environment.
  • the node device maintains a blockchain non-relational database and a blockchain relational database.
  • the blockchain non-relational database The database is used to maintain ciphertext data.
  • the ciphertext data is generated by the blockchain node when running the blockchain service in the second trusted execution environment through the corresponding second trusted execution environment.
  • the first key is obtained through encryption; the method includes:
  • FIG. 2 is a system architecture diagram for maintaining blockchain data provided by an exemplary embodiment.
  • each blockchain node in the blockchain network is deployed on the corresponding node device.
  • Each node device maintains both a blockchain non-relational database and a blockchain relational database.
  • the node device is also deployed with a first trusted execution environment (Trusted execution environment, TEE) and a second trusted execution environment.
  • TEE trusted execution environment
  • the blockchain non-relational database is a non-relational database
  • the blockchain relational database is a relational database.
  • the second trusted execution environment is used to undertake the blockchain node to run the block. chain service
  • the first trusted execution environment is used to undertake the data analysis service of the node device.
  • the first trusted execution environment is also used to undertake the process of decrypting, converting and re-encrypting the ciphertext data by the node device.
  • a data conversion engine and a data analysis engine running in the first trusted execution environment are deployed under the node device chain.
  • the data conversion engine is used to perform the process of decrypting, converting and re-encrypting ciphertext data
  • the data analysis engine The engine is used to run data analysis services.
  • the data inside the trusted execution environment needs to be in the clear text state.
  • the trusted execution environment maintains a corresponding key to encrypt internal data and output it to the outside, or to read ciphertext from the outside and decrypt it into plaintext internally.
  • the key corresponding to the trusted execution environment belongs to Symmetric key.
  • the first trusted execution environment maintains a second key for encryption and decryption in the process of accessing data from the blockchain non-relational database
  • the second trusted execution environment maintains a second key.
  • the first key is used for encryption and decryption during the process of accessing data from the blockchain relational database.
  • the blockchain non-relational database serves as the native database for blockchain nodes to run blockchain services, that is, as part of the infrastructure of the underlying system of the blockchain, it is used to run blockchain services on blockchain nodes.
  • the blockchain data generated during the process is efficiently accessed.
  • the blockchain node uses it as a substitute for directly storing the blockchain data when it needs to store the blockchain data in the blockchain non-relational database.
  • the blockchain node can first encrypt the blockchain data in the second trusted execution environment to obtain the ciphertext data (through the first key corresponding to the second trusted execution environment), and then store the ciphertext data in the zone
  • the blockchain non-relational database avoids the risk of data leakage caused by directly storing plain text data.
  • Blockchain non-relational databases can specifically use Key-Value databases (key-value databases, a typical non-relational database, referred to as K-V database). Unlike relational databases, K-V databases do not know the value of the stored data. And there is no concept of schema (database schema information) like in MySQL (relational database management system) and PostgreSQL (a free software object-relational database management system with very complete features).
  • the blockchain underlying system including blockchain nodes and corresponding blockchain databases
  • a non-relational database with efficient access speed i.e., blockchain non-relational type database
  • the blockchain node can efficiently access data from the blockchain non-relational database when running the blockchain service, thereby ensuring the efficient operation of the blockchain service.
  • the stored Blockchain data is encrypted to obtain ciphertext data, so it can also avoid security risks caused by data leakage.
  • the node devices involved in the embodiments of this specification also maintain an additional blockchain relational database as a native database for providing data analysis services to users, that is, as part of the infrastructure of the data analysis system, used to provide analysis services to users.
  • the demander provides data analysis services.
  • blockchain non-relational databases can specifically use relational databases such as Oracle database and MySQL.
  • a relational database refers to a database that uses a relational model to organize data. It stores data in the form of rows and columns to facilitate user understanding. The series of rows and columns in a relational database are called tables, and a set of tables consists of database. Users retrieve data from a database through queries, which are executable codes that limit certain areas of the database.
  • the relational model can be simply understood as a two-dimensional table model, and a relational database is a data organization composed of two-dimensional tables and the relationships between them.
  • a relational database needs to define the table structure, table relationships, and standardized Database schema information such as data structure is then stored in data based on the database schema information. It supports SQL and has strong data analysis capabilities.
  • relational databases place great emphasis on data consistency, they pay a huge price for reducing read and write performance.
  • the reliability of relational database for storing and processing data is very good, the efficiency will become very poor once faced with the processing of massive data, especially when encountering high concurrent reading and writing, the performance will drop very much. sharp.
  • relational databases have powerful data analysis capabilities but poor access speed and read and write performance, and are not suitable for large-scale concurrent read and write application scenarios.
  • the data analysis system deployed under the node device chain (including the data analysis engine and corresponding database not shown in Figure 2) adopts a non-relational database (i.e., block database) with efficient access speed, chain relational database), thus enabling node devices to utilize the powerful data analysis capabilities of blockchain non-relational databases when running data analysis services by calling the data analysis engine, thereby ensuring that convenient data analysis is provided to analysis demand parties.
  • a non-relational database i.e., block database
  • the data maintained in the blockchain relational database involved in the embodiments of this specification is obtained through data conversion and migration in the blockchain non-relational database.
  • the process of data conversion and migration will be introduced in detail below.
  • the node device can obtain all the information maintained in the blockchain non-relational database. Describe the ciphertext data. For the blockchain node, it needs to verify the access rights to any data requester requesting data from the non-relational database in the blockchain, so that the data requester is allowed to request the data only if the data requester has access rights. The party provides data.
  • the node device (specifically, the data conversion engine deployed by the node device) belongs to the data demander. Therefore, the blockchain node needs to verify whether the node device has access to the blockchain non-relational database.
  • the embodiment of this specification determines whether the node device has access permissions to the blockchain non-relational database by verifying whether the remote certificate corresponding to the first trusted execution environment deployed by the node device is valid.
  • the remote certificate corresponding to the first trusted execution environment includes the first trusted execution environment using the CPU private key corresponding to the first trusted execution environment to all the programs running in its environment (the hash values corresponding to these programs)
  • the blockchain node can verify the digital signature contained in the remote certificate through the CPU public key corresponding to the locally maintained first trusted execution environment.
  • the blockchain node may not have the CPU public key corresponding to the first trusted execution environment, so it can also send the remote certificate to the holder of the first trusted execution environment.
  • the authentication third party of the corresponding CPU public key will return the corresponding remote authentication report to the blockchain node after verifying that the remote certificate is passed.
  • the blockchain node will verify the corresponding public key through the authentication third party.
  • the remote authentication report is valid and the remote authentication report is used to indicate that the remote certification is valid, it can be confirmed that the node device indeed runs the first trusted execution environment and that the program running in the first trusted execution environment is legal and trustworthy. It has not been tampered with, so it can be judged that the node device has access rights to the blockchain non-relational database.
  • obtaining the ciphertext data maintained in the blockchain non-relational database includes: receiving the ciphertext data actively pushed by the blockchain node; and/or, Send a blockchain data request to the blockchain node, and receive the ciphertext data returned by the blockchain node in response to the blockchain data request.
  • the method for maintaining blockchain data involved in the embodiments of this specification is applied to node devices, specifically to the data conversion engine deployed under the node device chain.
  • the node device can obtain the ciphertext data maintained in the non-relational database of the blockchain through at least one of two methods.
  • the two methods include: first, by receiving the ciphertext data actively pushed by the blockchain node, For example, every time a blockchain node adds or modifies ciphertext data to the blockchain non-relational database while running the blockchain service in the second trusted execution environment, the blockchain node will send a message to the chain.
  • the data conversion engine under the system actively pushes data update messages carrying the latest newly added or modified ciphertext data.
  • This method can timely convert and synchronize the data in the blockchain non-relational database to the blockchain relational database. Thereby ensuring the symmetry and timeliness of data in the blockchain relational database; secondly, sending a blockchain data request to the blockchain node through the node device to obtain the response of the blockchain node to the blockchain data Request the returned ciphertext data.
  • This method obtains the ciphertext data through the request-response mode, which can effectively control the range of the requested ciphertext data and thus shield some data that does not need to be maintained in the blockchain relational database.
  • the remote certificate is included in the blockchain data request; or, the remote certificate is maintained in the blockchain node in advance.
  • remote certification is included in the blockchain data request, it is equivalent to the blockchain node verifying the latest remote certification corresponding to the first trusted execution environment, thereby ensuring the timeliness of the remote certification.
  • the remote certification is pre-maintained on the blockchain node, it is equivalent to the blockchain node being able to determine whether the node device has access rights to the blockchain non-relational database through the remote certification maintained on the blockchain node in advance. Therefore, the intermediate links in the process of node devices obtaining ciphertext data can be reduced, and the efficiency of obtaining ciphertext data can be increased.
  • sending a blockchain data request to the blockchain node includes: initiating to the smart contract deployed by the blockchain node a non-relational database maintained in the blockchain for the smart contract.
  • the blockchain data involved in the embodiments of this specification includes block data, status data and event data.
  • block data refers to the blockchain ledger maintained by each blockchain node in the blockchain network.
  • the blockchain ledger and/or the ciphertext data corresponding to the blockchain ledger are essentially maintained in the non-blockchain database.
  • the blockchain ledger is a special data structure, it is composed of multiple blocks connected end to end through hash anchoring and cannot be tampered with.
  • Each block consists of a block header and a block
  • the block header of any block contains information such as the status tree root, transaction number root, receipt tree root, block height and the hash value of the corresponding parent block of the block, while the block body Contains the transaction data (transaction hash) contained in the block.
  • the block data involved in the embodiments of this specification refers to the data contained in the blockchain ledger.
  • the status data and event data involved in the embodiments of this specification are maintained by various smart contracts deployed by the blockchain nodes.
  • the status data, event data and/or the ciphertext data corresponding to the status data and event data are maintained in The contract storage space corresponding to each smart contract in the blockchain non-relational database.
  • the blockchain node is deployed with several smart contracts, and each smart contract maintains corresponding status data. These status data are encrypted with the first key in the second trusted execution environment as The form of ciphertext data is maintained in the contract storage space corresponding to any of the smart contracts in the blockchain non-relational database.
  • the node device can initiate a blockchain data request to the smart contract deployed by the blockchain node (in fact, any smart contract is deployed on each blockchain node in the blockchain network).
  • the blockchain data request is Formally it is a blockchain transaction. After the blockchain transaction is received by the blockchain node, the blockchain node will further call the smart contract instructed by the blockchain transaction to execute the blockchain transaction.
  • the smart contract When the smart contract executes the blockchain transaction, it searches for and obtains the ciphertext data indicated by the blockchain transaction from the contract storage space corresponding to the smart contract in the blockchain non-relational database, and uses the ciphertext data as The response message corresponding to the blockchain data request (such as in the form of a blockchain event) is called back to the node device, thereby achieving the method of calling a smart contract to obtain the ciphertext data maintained in the blockchain non-relational database.
  • the node device can directly initiate a blockchain data request to the blockchain node, for example, initiate a blockchain data request through the data query interface of the blockchain node.
  • the blockchain data request is used to make the district
  • the blockchain node retrieves the ciphertext data indicated by the blockchain data request from the blockchain non-relational database (obtained from the block data encrypted by the first key in the second trusted execution environment) and calls back to Node device.
  • the node device can directly initiate a blockchain data request to the blockchain non-relational database, for example, through the database interface of the blockchain non-relational database, which is equivalent to the node.
  • the blockchain non-relational database directly responds to the received blockchain data request and returns the ciphertext data indicated by the blockchain data request.
  • a blockchain data request is in the same form as a blockchain transaction, it does not necessarily have all the properties of a blockchain transaction.
  • a blockchain node may not necessarily Instead of consensus in the blockchain network, it is processed as a local call request.
  • This kind of blockchain transaction that will only be executed within the local blockchain node without consensus is called a local transaction; of course, the blockchain Data requests can also have all the properties of a blockchain transaction, that is, after completing consensus in the blockchain network as a consensus transaction, they are executed separately by each blockchain node in the blockchain network.
  • S104 In the first trusted execution environment, decrypt the ciphertext data into the blockchain data using the first key, and convert the blockchain data into the blockchain relational database corresponding The standard data defined by the database schema information, and the standard data is encrypted into ciphertext standard data through the second key corresponding to the first trusted execution environment.
  • the node device After the node device obtains the ciphertext data, it will read it into the first trusted execution environment, and at the same time call the data conversion engine running in the first trusted execution environment to execute the relevant ciphertext in the first trusted execution environment. Data decryption, transformation and encryption tasks. Specifically, the node device first decrypts the ciphertext data into plaintext data, that is, the aforementioned blockchain data, through the first key, and then converts the blockchain data into the blockchain relationship. The standard data defined by the database schema information corresponding to the database is finally encrypted into ciphertext standard data through the second key corresponding to the first trusted execution environment. Since the above processes are all implemented in the first trusted execution environment, data leakage issues can be effectively avoided and system security improved.
  • the first key is provided to the first trusted execution environment deployed by the node device when the blockchain node passes the verification of the remote certificate; or, the first key is pre- Maintained in the first trusted execution environment.
  • the first key can be provided by the blockchain node to the third node in the node device in a timely manner under the condition of verifying the remote attestation (that is, the blockchain node confirms that the node device has access rights to the blockchain non-relational database).
  • Schema is an abstract collection of metadata, including a set of schema components: mainly the declaration of elements and attributes, and the definition of complex and simple data types. , specifically including: defining the elements that can appear in the document; defining the attributes that can appear in the document; defining which element is a sub-element; defining the order of sub-elements; defining the number of sub-elements; defining whether the element is empty or whether it can Contains text; defines data types for elements and attributes; defines default and fixed values for elements and attributes.
  • schema is the organization and structure of the database.
  • Database schema information contains schema objects, which can be tables, columns, data types, views, stored procedures, relationships, and primary keys. , foreign key, etc.
  • Database schema information can be represented by a visual diagram that shows database objects and their relationships to each other. Since the database schema information is used to describe the structure of the database and can be used as a blueprint for creating a database, by specifying the database schema information corresponding to a database, it can guide how the data in the database is stored.
  • the node device After the node device decrypts the blockchain data, it will convert the blockchain data into standard data defined by the database schema information based on the database schema information corresponding to the blockchain relational database in the first trusted execution environment.
  • the conversion process of blockchain data to standard data includes but is not limited to the conversion of data tables, rows, and columns.
  • the block is implemented through the ETL (Extract-Transform-Load, data warehouse technology based on data extraction, conversion, and loading) mechanism.
  • ETL Extract-Transform-Load, data warehouse technology based on data extraction, conversion, and loading
  • the ciphertext standard data is obtained by encrypting the standard data, it is only numerically desensitized, but it still retains the structure of the standard data state and the relationship between the standard data state and other data, that is,
  • the ciphertext standard data like the standard data before encryption, can be maintained in the blockchain relational database according to certain rules.
  • the method further includes:
  • the database schema information corresponding to the blockchain relational database can be maintained at the node device in advance (for example, set by the administrator user of the node device), or can be obtained by requesting a smart contract.
  • each smart contract deployed by the blockchain node has a corresponding contract storage space in the blockchain non-relational database, and each smart contract has different characteristics when processing data, organizing data, and storing data. characteristics, so the corresponding contract storage spaces of different smart contracts in the non-relational blockchain have different data organization forms, and this data organization form includes the format, relationship and connotation of the data organization, etc. It is also based on database schema information The form is maintained in the smart contract.
  • the embodiment of this specification obtains the ciphertext data maintained in the smart contract corresponding to the smart contract by requesting the corresponding smart contract.
  • the first database schema information of the ciphertext data maintained in the non-relational database is used to decrypt, convert and encrypt the ciphertext data involved in maintaining the smart contract in the blockchain relational database (decryption can also be used in this specification) , the process of conversion and encryption is referred to as conversion), so that the ciphertext standard data involved in the smart contract can be correctly maintained in the blockchain relational database.
  • the database schema information corresponding to each smart contract can be obtained through the embodiments of this specification, and the database schema information corresponding to the smart contract can be obtained according to the corresponding smart contract.
  • the database schema information is used as the database schema information corresponding to the blockchain relational database to realize the conversion of the ciphertext data involved in the corresponding smart contract into the ciphertext standard data, and finally according to the respective database schema information of different smart contracts, Realize the correct maintenance of ciphertext standard data involved in multiple smart contracts in the blockchain relational database.
  • the database schema information corresponding to any smart contract only supports the maintenance of the ciphertext standard data involved in any smart contract (that is, from any The ciphertext standard data obtained by decrypting, converting and encrypting the ciphertext data in the smart contract), thereby supporting multiple smart contracts using different data organization forms to correctly convert the ciphertext data maintained in the blockchain non-relational database into ciphertext data. After documenting the standard data, it is finally migrated to the blockchain relational database for maintenance in the form of ciphertext standard data.
  • S106 Maintain the ciphertext standard data in the blockchain relational database.
  • the blockchain relational database is used to provide data analysis services running in the first trusted execution environment to the analysis requester.
  • the node device After the node device encrypts the ciphertext standard data in the first trusted environment, it can store the ciphertext standard data in the blockchain relational database according to the blockchain mode information corresponding to the blockchain relational database to achieve Conversion and migration of ciphertext data in the blockchain non-relational database to ciphertext standard data in the blockchain relational database. Since the blockchain relational database supports a variety of SQL and has powerful data analysis capabilities (such as data query capabilities based on various conditions, indexes, and relationships), the blockchain relational database can easily provide analysis needs to parties. Data analysis service, and because the data analysis service runs in the first trusted execution environment, it actually decrypts the ciphertext standard data in the first trusted execution environment and then analyzes it to obtain the analysis results.
  • Analyzing data can ensure the efficiency of analysis, and running data analysis services in TEE can also ensure data security.
  • the data analysis engine running in the first trusted execution environment deployed on and off the chain of the node device provides a data analysis interface to the outside world, so as to provide analysis requesters that call the analysis interface externally for the blockchain relational database. Data analysis services.
  • the embodiment of this specification separately deploys a blockchain non-relational database and a blockchain relational database on node devices.
  • the blockchain non-relational database is used to maintain and run blockchain services on blockchain nodes.
  • the ciphertext data obtained by encrypting the blockchain data generated at the time enables the blockchain node to efficiently store the encrypted blockchain data and efficiently read the ciphertext data when running the blockchain service; on the other hand, , by decrypting, converting and encrypting the ciphertext data maintained in the blockchain non-relational database into ciphertext standard data to be simultaneously maintained in the blockchain relational database, thereby using the blockchain relational database to achieve convenient Data analysis services.
  • the blockchain node is providing the ciphertext.
  • the remote certificate corresponding to the first trusted execution environment needs to be verified in advance before data is sent, thereby ensuring system-level data security in data processing, data transmission and data storage.
  • the method for maintaining blockchain data involved in the embodiments of this specification realizes the backup of one data in two places, objectively improves the disaster recovery capability, and realizes convenient data access while ensuring efficient access efficiency during the execution of the blockchain service.
  • Analysis services at the same time, due to the combination of trusted execution environment technology, it realizes the entire process of trusted data transfer and trusted data processing from on-chain blockchain services to off-chain data conversion and data analysis services. The risk of data leakage is reduced as much as possible.
  • Optional also includes:
  • the analysis result obtained by analyzing the at least one standard data based on the data analysis request is returned to the analysis requester.
  • the data analysis engine deployed on and off-chain on the node device can also be used to receive data analysis requests sent by the analysis requester, and then retrieve the blockchain relational database based on the data analysis engine.
  • At least one ciphertext standard data corresponding to the data analysis request maintained in the first trusted execution environment is read into the first trusted execution environment, and the at least one ciphertext standard data is decrypted into at least one standard data using the second key, and in the first Build a memory database based on at least one standard data (plain text state) in a trusted execution environment, analyze the memory database based on the data analysis request, and return the analysis results obtained by the analysis to the analysis requester, and the analysis results It can be encrypted by the second key and then returned to the analysis requester, or it can be directly returned to the analysis requester in plain text.
  • This instruction does not impose any restrictions on this, and a complete data analysis service can be achieved at this point.
  • the data analysis request is a data query request that satisfies both condition A and condition B
  • the data analysis engine will query the ciphertext standard data that satisfies both condition A and condition B in the blockchain relational database, and convert these ciphertext standard data into the blockchain relational database.
  • the text standard data is read into the first trusted execution environment and decrypted into standard data through the second key, and then returned to the analysis requester as an analysis result.
  • reading at least one ciphertext standard data corresponding to the data analysis request maintained in the blockchain relational database into the first trusted execution environment includes:
  • the at least one ciphertext standard data corresponding to the data analysis request maintained in the blockchain relational database is read into the third A trusted execution environment.
  • the node device needs to first verify the analysis permission of the analysis requester, and only after confirming that the analysis requester has the analysis permission will it respond to the data analysis request sent by the analysis requester and perform subsequent steps.
  • the node device maintains a legal user list corresponding to the data analysis service in the first trusted execution environment.
  • the node device specifically the data analysis engine, can verify the identity of the analysis requester (for example, through the first analysis requester corresponding to the first
  • the public key is used to verify the digital signature contained in the data analysis request.
  • the signature verification passes, it is confirmed that the data analysis request does come from the first analysis requester corresponding to the first public key), by checking that the digital signature included in the legal user list If the identification information of the analysis requester is included, it is determined that the analysis requester has the analysis authority. If the legal user list does not contain the identification information of the analysis requester, it is determined that the analysis requester does not have the analysis authority.
  • the first user list ciphertext corresponding to the legal user is maintained in the blockchain relational database, and the first user list ciphertext is passed by the node device in the first trusted execution environment through the second
  • the first user list is obtained by encrypting the first user list with the key.
  • the first user list is decrypted by the node device in the first trusted execution environment using the first key to decrypt the second user list ciphertext and based on the database schema information. Obtained after conversion, wherein the second user list ciphertext is maintained in the blockchain non-relational database by the user authorization contract deployed by the blockchain node.
  • the legal user list corresponding to the legal user is obtained by the node device reading the first user list ciphertext from the blockchain relational database and using the second key in the first trusted execution environment. Decryption is obtained, and the ciphertext of the first user list maintained in the blockchain relational database is also obtained from the second user list in the blockchain non-relational database through the method of maintaining blockchain data involved in the embodiment of this specification.
  • the ciphertext is migrated. Specifically, the legal user list corresponding to the legal user is actually maintained in the user authorization contract deployed by the blockchain node, which can be modified, updated, added, etc. through blockchain transactions, as mentioned above.
  • the legal user list maintained by the user authorization contract is actually encrypted by the blockchain node through the second key into the second user list ciphertext, and then maintained in the blockchain non-relational database corresponding to the user authorization.
  • the second user list ciphertext can be used as the ciphertext data involved in the embodiments of this specification, and is deployed on the node device through the method of maintaining blockchain data involved in the embodiments of this specification.
  • the legal user list obtained by the data conversion engine is decrypted by the second key in the first trusted execution environment into a clear text state, and the legal user list is further converted into a database schema information definition corresponding to the blockchain relational database.
  • the standard legal user list (the data connotation contained in it is consistent with the legal user list), so that the standard legal user list is finally encrypted by the first key to the second user list ciphertext backup and maintained in the blockchain relational database.
  • the data analysis engine running in the first trusted execution environment needs to obtain the legal user list, it can read the first user list ciphertext from the blockchain relational database and use the second key to decrypt it to obtain the standard legal user list.
  • the legal user list corresponding to the legal user is essentially maintained by the user authorization contract deployed on the blockchain node, and the node device can use the method of maintaining blockchain data involved in the embodiment of this specification to maintain the area.
  • the legal user list stored in the blockchain non-relational database in the form of the second user list ciphertext is synchronously maintained in the blockchain relational database in the form of the first user list ciphertext, so that the node device does not need to call the user authorization on the chain.
  • the contract can obtain the list of legal users through off-chain methods.
  • Figure 3 is a schematic structural diagram of a device provided by an exemplary embodiment.
  • the device includes a processor 302, an internal bus 303, a network interface 306, a memory 308 and a non-volatile memory 310.
  • the processor 302 reads the corresponding computer program from the non-volatile memory 310 into the memory 308 and then runs it.
  • the execution subject of the following processing flow is not limited to each A logic unit can also be a hardware or logic device.
  • FIG 4 is a block diagram of a device for maintaining blockchain data provided in this specification according to an exemplary embodiment.
  • This device can be applied to the equipment shown in Figure 3 to implement the instructions of this specification.
  • Technical solution: This device is applied to node equipment deployed with blockchain nodes and a first trusted execution environment.
  • the node equipment maintains a blockchain non-relational database and a blockchain relational database.
  • the blockchain The non-relational database is used to maintain ciphertext data.
  • the ciphertext data is generated by the blockchain node when running the blockchain service in the second trusted execution environment through the second trusted execution environment.
  • the first key corresponding to the environment is encrypted and obtained; the device includes:
  • the ciphertext data acquisition unit 401 is configured to acquire the ciphertext maintained in the blockchain non-relational database when the blockchain node passes the remote certification verification corresponding to the first trusted execution environment. data;
  • Data conversion unit 402 configured to decrypt the ciphertext data into the blockchain data through the first key in the first trusted execution environment, and convert the blockchain data into the block Link the standard data defined by the database schema information corresponding to the relational database, and encrypt the standard data into ciphertext standard data through the second key corresponding to the first trusted execution environment;
  • the ciphertext standard data maintenance unit 403 is used to maintain the ciphertext standard data in the blockchain relational database, and the blockchain relational database is used to provide analysis demanders with information running on the first trusted Data analysis services in the execution environment.
  • the ciphertext data acquisition unit 401 is specifically used to:
  • the ciphertext data acquisition unit 401 is further used to:
  • the device further includes:
  • the mode information query request sending unit 404 is configured to initiate a mode information query request to the smart contract, and determine the first database mode information recorded in the smart contract returned by the smart contract in response to the mode information query request. It is the database schema information corresponding to the blockchain relational database.
  • the remote certificate is included in the blockchain data request; or,
  • the remote certificate is maintained in the blockchain node in advance.
  • the blockchain data includes block data, status data and event data.
  • the first key is provided to the first trusted execution environment deployed by the node device when the blockchain node passes the verification of the remote certificate; or, the first key is maintained in advance in the first trusted execution environment.
  • a trusted execution environment is provided to the first trusted execution environment deployed by the node device when the blockchain node passes the verification of the remote certificate; or, the first key is maintained in advance in the first trusted execution environment.
  • Optional also includes:
  • the data analysis request receiving unit 405 is used to receive the data analysis request sent by the analysis requester;
  • the analysis result return unit 406 is configured to read at least one ciphertext standard data corresponding to the data analysis request maintained in the blockchain relational database into the first trusted execution environment, and use the second key to return the ciphertext standard data to the first trusted execution environment. At least one ciphertext standard data is respectively decrypted into at least one standard data, and the analysis result obtained by analyzing the at least one standard data based on the data analysis request is returned to the analysis requester.
  • analysis result return unit 406 is further used to:
  • the at least one ciphertext standard data corresponding to the data analysis request maintained in the blockchain relational database is read into the third A trusted execution environment.
  • the first user list ciphertext corresponding to the legal user is maintained in the blockchain relational database, and the first user list ciphertext is passed by the node device in the first trusted execution environment through the second
  • the first user list is obtained by encrypting the first user list with the key.
  • the first user list is decrypted by the node device in the first trusted execution environment using the first key to decrypt the second user list ciphertext and based on the database schema information. Obtained after conversion, wherein the second user list ciphertext is maintained in the blockchain non-relational database by the user authorization contract deployed by the blockchain node.
  • PLD Programmable Logic Device
  • FPGA Field Programmable Gate Array
  • HDL Hardware Description Language
  • the controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer readable medium storing computer readable program code (eg, software or firmware) executable by the (micro)processor. , logic gates, switches, Application Specific Integrated Circuit (ASIC), programmable logic controllers and embedded microcontrollers.
  • controllers include but are not limited to the following microcontrollers: ARC 625D, Atmel AT91SAM, For Microchip PIC18F26K20 and Silicone Labs C8051F320, the memory controller can also be implemented as part of the memory's control logic.
  • the controller in addition to implementing the controller in the form of pure computer-readable program code, the controller can be completely programmed with logic gates, switches, application-specific integrated circuits, programmable logic controllers and embedded logic by logically programming the method steps. Microcontroller, etc. to achieve the same function. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be considered as structures within the hardware component. Or even, the means for implementing various functions can be considered as structures within hardware components as well as software modules implementing the methods.
  • the systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions.
  • a typical implementation device is a server system.
  • the computer that implements the functions of the above embodiments may be, for example, a personal computer, a laptop computer, a vehicle-mounted human-computer interaction device, a cellular phone, a camera phone, a smart phone, or a personal digital assistant. , media player, navigation device, email device, game console, tablet, wearable device, or a combination of any of these devices.
  • the functions are divided into various modules and described separately.
  • the functions of each module can be implemented in the same or multiple software and/or hardware, or the modules that implement the same function can be implemented by a combination of multiple sub-modules or sub-units, etc. .
  • the device embodiments described above are only illustrative.
  • the division of the units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components may be combined or integrated. to another system, or some features can be ignored, or not implemented.
  • the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, and the indirect coupling or communication connection of the devices or units may be in electrical, mechanical or other forms.
  • These computer program instructions may also be stored in a computer-readable memory that causes a computer or other programmable data processing apparatus to operate in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction means, the instructions
  • the device implements the functions specified in a process or processes of the flowchart and/or a block or blocks of the block diagram.
  • These computer program instructions may also be loaded onto a computer or other programmable data processing device, causing a series of operating steps to be performed on the computer or other programmable device to produce computer-implemented processing, thereby executing on the computer or other programmable device.
  • Instructions provide steps for implementing the functions specified in a process or processes of a flowchart diagram and/or a block or blocks of a block diagram.
  • a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
  • processors CPUs
  • input/output interfaces network interfaces
  • memory volatile and non-volatile memory
  • Memory may include non-permanent storage in computer-readable media, random access memory (RAM) and/or non-volatile memory in the form of read-only memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
  • RAM random access memory
  • ROM read-only memory
  • flash RAM flash random access memory
  • Computer-readable media includes both persistent and non-volatile, removable and non-removable media that can be implemented by any method or technology for storage of information.
  • Information may be computer-readable instructions, data structures, modules of programs, or other data.
  • Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), and read-only memory.
  • PRAM phase change memory
  • SRAM static random access memory
  • DRAM dynamic random access memory
  • RAM random access memory
  • read-only memory read-only memory
  • ROM read-only memory
  • EEPROM electrically erasable programmable read-only memory
  • flash memory or other memory technology
  • compact disc read-only memory CD-ROM
  • DVD digital versatile disc
  • Magnetic tape magnetic tape storage, graphene storage or other magnetic storage devices or any other non-transmission medium can be used to store information that can be accessed by a computing device.
  • computer-readable media does not include transitory media, such as modulated data signals and carrier waves.
  • one or more embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, one or more embodiments of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment that combines software and hardware aspects. Furthermore, one or more embodiments of the present description may employ a computer program implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein. Product form.
  • computer-usable storage media including, but not limited to, disk storage, CD-ROM, optical storage, etc.
  • program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types.
  • program modules may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communications network.
  • program modules may be located in both local and remote computer storage media including storage devices.

Abstract

Provided in the present description are a method and apparatus for maintaining blockchain data, and an electronic device and a storage medium. The method is applied to a node device, which is deployed with a blockchain node and a first trusted execution environment, wherein the node device maintains a blockchain non-relational database and a blockchain relational database, the blockchain non-relational database is used for maintaining ciphertext data, and the ciphertext data is obtained by the blockchain node encrypting, by means of a first key corresponding to a second trusted execution environment, blockchain data which is generated when a blockchain service is run in the second trusted execution environment. The method comprises: when remote attestation corresponding to a first trusted execution environment passes verification of a blockchain node, acquiring ciphertext data, which is maintained in a blockchain non-relational database; in the first trusted execution environment, decrypting, converting and encrypting the ciphertext data into ciphertext standard data; and maintaining the ciphertext standard data in a blockchain relational database, wherein the blockchain relational database is used for providing a data analysis service for an analysis demander.

Description

一种维护区块链数据的方法、装置、电子设备和存储介质A method, device, electronic device and storage medium for maintaining blockchain data
本申请要求于2022年06月29日提交中国专利局、申请号为202210761451.1、发明名称为“一种维护区块链数据的方法、装置、电子设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application requests the priority of the Chinese patent application submitted to the China Patent Office on June 29, 2022, with the application number 202210761451.1 and the invention title "A method, device, electronic device and storage medium for maintaining blockchain data", The entire contents of which are incorporated herein by reference.
技术领域Technical field
本说明书实施例属于区块链技术领域,尤其涉及一种维护区块链数据的方法、装置、电子设备和存储介质。The embodiments of this specification belong to the field of blockchain technology, and particularly relate to a method, device, electronic device and storage medium for maintaining blockchain data.
背景技术Background technique
区块链(Blockchain)是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链系统中按照时间顺序将数据区块以顺序相连的方式组合成链式数据结构,并以密码学方式保证的不可篡改和不可伪造的分布式账本。Blockchain is a new application model of computer technology such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm. In the blockchain system, data blocks are combined into a chained data structure in a chronological manner and are cryptographically guaranteed to be an untamperable and unforgeable distributed ledger.
在传统区块链技术中,为了契合区块链节点在运行区块链服务过程中对大量数据的存储需求,区块链节点通常使用具有高效的存取效率的非关系型数据库进行数据存储,然而,非关系型数据库由于缺乏事务关系,数据之间缺乏联系且未标准化,不利于进行数据分析。关系型数据库具有完整的事务关系,数据之间具有联系且具有严格的标准化结构,如果将传统区块链技术中的非关系型数据库替换为关系型数据库,虽然利于进行数据分析,但在区块链底层系统直接使用关系型数据库又会对区块链节点运行区块链服务过程中的在线读写性能带来巨大挑战。因此,如何在确保区块链服务执行过程具有高效存取效率的情况下实现便捷的数据分析服务是本领域亟待解决的问题。In traditional blockchain technology, in order to meet the storage needs of blockchain nodes for large amounts of data when running blockchain services, blockchain nodes usually use non-relational databases with efficient access efficiency for data storage. However, non-relational databases lack transaction relationships, lack connections between data and are not standardized, which is not conducive to data analysis. Relational databases have complete transaction relationships, connections between data and a strict standardized structure. If the non-relational database in traditional blockchain technology is replaced by a relational database, although it is beneficial to data analysis, it will not be used in the block chain. The direct use of relational databases in the chain's underlying system will bring huge challenges to the online read and write performance of blockchain nodes when running blockchain services. Therefore, how to implement convenient data analysis services while ensuring that the blockchain service execution process has high access efficiency is an urgent problem in this field that needs to be solved.
发明内容Contents of the invention
本发明的目的在于提供一种维护区块链数据的方法、装置、电子设备和存储介质。The purpose of the present invention is to provide a method, device, electronic device and storage medium for maintaining blockchain data.
根据本说明书一个或多个实施例的第一方面,提出了一种维护区块链数据的方法,应用于部署有区块链节点和第一可信执行环境的节点设备,所述节点设备维护有区块链非关系型数据库和区块链关系型数据库,所述区块链非关系型数据库用于维护密文数据,所述密文数据由所述区块链节点将在第二可信执行环境中运行区块链服务时生成的区块链数据通过第二可信执行环境对应的第一密钥加密得到;所述方法包括:According to a first aspect of one or more embodiments of this specification, a method for maintaining blockchain data is proposed, which is applied to a node device deployed with a blockchain node and a first trusted execution environment, and the node device maintains There are blockchain non-relational databases and blockchain relational databases. The blockchain non-relational database is used to maintain ciphertext data. The ciphertext data is stored in the second trusted database by the blockchain node. The blockchain data generated when running the blockchain service in the execution environment is encrypted by the first key corresponding to the second trusted execution environment; the method includes:
在所述区块链节点对第一可信执行环境对应的远程证明验证通过的情况下,获取所述区块链非关系型数据库中维护的所述密文数据;If the blockchain node passes the remote certification verification corresponding to the first trusted execution environment, obtain the ciphertext data maintained in the blockchain non-relational database;
在第一可信执行环境中,通过第一密钥将所述密文数据解密为所述区块链数据,并将所述区块链数据转换为所述区块链关系型数据库对应的数据库模式信息定义的标准数据,以及,通过第一可信执行环境对应的第二密钥将所述标准数据加密为密文标准数据;In the first trusted execution environment, the ciphertext data is decrypted into the blockchain data through the first key, and the blockchain data is converted into a database corresponding to the blockchain relational database. The standard data defined by the mode information, and encrypting the standard data into ciphertext standard data through the second key corresponding to the first trusted execution environment;
将所述密文标准数据维护在所述区块链关系型数据库中,所述区块链关系型数据库用于向分析需求方提供运行在第一可信执行环境中的数据分析服务。The ciphertext standard data is maintained in the blockchain relational database, and the blockchain relational database is used to provide data analysis services running in the first trusted execution environment to the analysis requester.
根据本说明书一个或多个实施例的第二方面,提出了一种维护区块链数据的装置,应用于部署有区块链节点和第一可信执行环境的节点设备,所述节点设备维护有区块链非关系型数据库和区块链关系型数据库,所述区块链非关系型数据库用于维护密文数据,所述密文数据由所述区块链节点将在第二可信 执行环境中运行区块链服务时生成的区块链数据通过第二可信执行环境对应的第一密钥加密得到;所述装置包括:According to a second aspect of one or more embodiments of this specification, a device for maintaining blockchain data is proposed, which is applied to a node device deployed with a blockchain node and a first trusted execution environment, and the node device maintains There are blockchain non-relational databases and blockchain relational databases. The blockchain non-relational database is used to maintain ciphertext data. The ciphertext data is stored in the second trusted database by the blockchain node. The blockchain data generated when running the blockchain service in the execution environment is encrypted by the first key corresponding to the second trusted execution environment; the device includes:
区块链数据获取单元,用于在所述区块链节点对第一可信执行环境对应的远程证明验证通过的情况下,获取所述区块链非关系型数据库中维护的所述密文数据;A blockchain data acquisition unit configured to acquire the ciphertext maintained in the blockchain non-relational database when the blockchain node passes the remote certification verification corresponding to the first trusted execution environment. data;
区块链数据获取单元,用于在第一可信执行环境中,通过第一密钥将所述密文数据解密为所述区块链数据,并将所述区块链数据转换为所述区块链关系型数据库对应的数据库模式信息定义的标准数据,以及,通过第一可信执行环境对应的第二密钥将所述标准数据加密为密文标准数据;A blockchain data acquisition unit, configured to decrypt the ciphertext data into the blockchain data through the first key in the first trusted execution environment, and convert the blockchain data into the blockchain data. Standard data defined by the database schema information corresponding to the blockchain relational database, and encrypting the standard data into ciphertext standard data through the second key corresponding to the first trusted execution environment;
标准数据维护单元,用于将所述密文标准数据维护在所述区块链关系型数据库中,所述区块链关系型数据库用于向分析需求方提供运行在第一可信执行环境中的数据分析服务。A standard data maintenance unit, used to maintain the ciphertext standard data in the blockchain relational database, and the blockchain relational database is used to provide the analysis requester with information running in the first trusted execution environment. data analysis services.
根据本说明书一个或多个实施例的第三方面,提出了一种电子设备,包括:According to a third aspect of one or more embodiments of this specification, an electronic device is proposed, including:
处理器;processor;
用于存储处理器可执行指令的存储器;Memory used to store instructions executable by the processor;
其中,所述处理器通过运行所述可执行指令以实现如第一方面所述的方法。Wherein, the processor implements the method described in the first aspect by running the executable instructions.
根据本说明书一个或多个实施例的第四方面,提出了一种计算机可读存储介质,其上存储有计算机指令,该指令被处理器执行时实现如第一方面所述方法的步骤。According to a fourth aspect of one or more embodiments of this specification, a computer-readable storage medium is proposed, on which computer instructions are stored, and when the instructions are executed by a processor, the steps of the method described in the first aspect are implemented.
本说明书实施例通过在节点设备上分别部署区块链非关系型数据库和区块链关系型数据库,一方面,由于区块链非关系型数据库用于维护将区块链节点运行区块链服务时生成的区块链数据加密得到的密文数据,这使得区块链节点运行区块链服务时能够对区块链数据加密后进行高效存储以及对密文数据进行高效读取;另一方面,通过将从区块链非关系型数据库中维护的密文数据解密、转换并加密为密文标准数据以同步维护于区块链关系型数据库中,从而利用区块链关系型数据库实现便捷的数据分析服务。另外,无论是区块链节点运行的区块链服务,或是节点设备对密文数据解密、转换并加密的过程均在相应的可信执行环境中进行,同时区块链节点在提供密文数据前需要提前对第一可信执行环境对应的远程证明进行验证,从而确保了数据处理、数据传输和数据存储的系统级别的数据安全。本说明书实施例涉及的维护区块链数据的方法实现了一份数据两处备份,客观上提高了容灾能力,在确保区块链服务执行过程具有高效存取效率的情况下实现便捷的数据分析服务;同时由于结合了可信执行环境技术,因此实现了从链上的区块链服务到链下的数据转换和数据分析服务的全流程的可信数据流转与可信数据处理的过程,尽可能地减少了数据泄露风险。The embodiment of this specification separately deploys a blockchain non-relational database and a blockchain relational database on node devices. On the one hand, the blockchain non-relational database is used to maintain and run blockchain services on blockchain nodes. The ciphertext data obtained by encrypting the blockchain data generated at the time enables the blockchain node to efficiently store the encrypted blockchain data and efficiently read the ciphertext data when running the blockchain service; on the other hand, , by decrypting, converting and encrypting the ciphertext data maintained in the blockchain non-relational database into ciphertext standard data to be simultaneously maintained in the blockchain relational database, thereby using the blockchain relational database to achieve convenient Data analysis services. In addition, whether it is the blockchain service run by the blockchain node, or the process of decrypting, converting and encrypting the ciphertext data by the node device, it is carried out in the corresponding trusted execution environment. At the same time, the blockchain node is providing the ciphertext. The remote certificate corresponding to the first trusted execution environment needs to be verified in advance before data is sent, thereby ensuring system-level data security in data processing, data transmission and data storage. The method for maintaining blockchain data involved in the embodiments of this specification realizes the backup of one data in two places, objectively improves the disaster recovery capability, and realizes convenient data access while ensuring efficient access efficiency during the execution of the blockchain service. Analysis services; at the same time, due to the combination of trusted execution environment technology, it realizes the entire process of trusted data transfer and trusted data processing from on-chain blockchain services to off-chain data conversion and data analysis services. The risk of data leakage is reduced as much as possible.
附图说明Description of drawings
为了更清楚地说明本说明书实施例的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本说明书中记载的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to explain the technical solutions of the embodiments of this specification more clearly, the drawings needed to be used in the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some of the embodiments recorded in this specification. , for those of ordinary skill in the art, other drawings can also be obtained based on these drawings without exerting creative labor.
图1是一示例性实施例提供的一种维护区块链数据的方法的流程图。Figure 1 is a flow chart of a method for maintaining blockchain data provided by an exemplary embodiment.
图2是一示例性实施例提供的一种维护区块链数据的系统架构图。Figure 2 is a system architecture diagram for maintaining blockchain data provided by an exemplary embodiment.
图3是一示例性实施例提供的一种设备的结构示意图。Figure 3 is a schematic structural diagram of a device provided by an exemplary embodiment.
图4是一示例性实施例提供的一种维护区块链数据的装置的框图。Figure 4 is a block diagram of a device for maintaining blockchain data provided in an exemplary embodiment.
具体实施方式Detailed ways
为了使本技术领域的人员更好地理解本说明书中的技术方案,下面将结合本说明书实施例中的附图,对本说明书实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本说明书一部分实施例,而不是全部的实施例。基于本说明书中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都应当属于本说明书保护的范围。In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of this specification. Obviously, the described The embodiments are only some of the embodiments of this specification, but not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by those of ordinary skill in the art without creative efforts should fall within the scope of protection of this specification.
图1是一示例性实施例提供的一种维护区块链数据的方法的流程图。该方法应用于部署有区块链节点和第一可信执行环境的节点设备,所述节点设备维护有区块链非关系型数据库和区块链关系型数据库,所述区块链非关系型数据库用于维护密文数据,所述密文数据由所述区块链节点将在第二可信执行环境中运行区块链服务时生成的区块链数据通过第二可信执行环境对应的第一密钥加密得到;所述方法包括:Figure 1 is a flow chart of a method for maintaining blockchain data provided by an exemplary embodiment. This method is applied to a node device deployed with a blockchain node and a first trusted execution environment. The node device maintains a blockchain non-relational database and a blockchain relational database. The blockchain non-relational database The database is used to maintain ciphertext data. The ciphertext data is generated by the blockchain node when running the blockchain service in the second trusted execution environment through the corresponding second trusted execution environment. The first key is obtained through encryption; the method includes:
S102:在所述区块链节点对第一可信执行环境对应的远程证明验证通过的情况下,获取所述区块链非关系型数据库中维护的所述密文数据。S102: If the blockchain node passes the remote certification verification corresponding to the first trusted execution environment, obtain the ciphertext data maintained in the blockchain non-relational database.
图2是一示例性实施例提供的一种维护区块链数据的系统架构图。如图2所示,区块链网络中的每个区块链节点都部署于对应的节点设备上,每个节点设备都会同时维护有区块链非关系型数据库和区块链关系型数据库,同时,节点设备也部署有第一可信执行环境(Trusted execution environment,TEE)和第二可信执行环境。在本说明书实施例中,区块链非关系型数据库属于非关系型数据库,而区块链关系型数据库属于关系型数据库,另外,第二可信执行环境用于承担区块链节点运行区块链服务,而第一可信执行环境用于承担节点设备运行数据分析服务,同时第一可信执行环境也用于承担节点设备对密文数据进行解密、转换和再加密的过程,具体而言,节点设备链下部署有运行在第一可信执行环境中的数据转换引擎与数据分析引擎,其中,数据转换引擎用于执行对密文数据进行解密、转换和再加密的过程,而数据分析引擎则用于运行数据分析服务。Figure 2 is a system architecture diagram for maintaining blockchain data provided by an exemplary embodiment. As shown in Figure 2, each blockchain node in the blockchain network is deployed on the corresponding node device. Each node device maintains both a blockchain non-relational database and a blockchain relational database. At the same time, the node device is also deployed with a first trusted execution environment (Trusted execution environment, TEE) and a second trusted execution environment. In the embodiment of this specification, the blockchain non-relational database is a non-relational database, and the blockchain relational database is a relational database. In addition, the second trusted execution environment is used to undertake the blockchain node to run the block. chain service, and the first trusted execution environment is used to undertake the data analysis service of the node device. At the same time, the first trusted execution environment is also used to undertake the process of decrypting, converting and re-encrypting the ciphertext data by the node device. Specifically, , a data conversion engine and a data analysis engine running in the first trusted execution environment are deployed under the node device chain. The data conversion engine is used to perform the process of decrypting, converting and re-encrypting ciphertext data, and the data analysis engine The engine is used to run data analysis services.
本说明书实施例中,对于可信执行环境内部的数据需要处于明文状态的,而当数据出域时,即数据需要被输出至可信执行环境外部时则需要确保数据被加密并处于密文状态,因此,可信执行环境维护有对应的密钥以用于将内部数据加密后输出外部,或者从外部读入密文以在内部解密为明文,通常情况下可信执行环境对应的密钥属于对称密钥。例如在本说明书实施例中,第一可信执行环境维护有第二密钥,以用于从区块链非关系型数据库存取数据的过程进行加解密,而第二可信执行环境维护有第一密钥,以用于从区块链关系数据库存取数据的过程中进行加解密。In the embodiment of this specification, the data inside the trusted execution environment needs to be in the clear text state. When the data goes out of the domain, that is, when the data needs to be output to the outside of the trusted execution environment, it is necessary to ensure that the data is encrypted and in the cipher text state. , therefore, the trusted execution environment maintains a corresponding key to encrypt internal data and output it to the outside, or to read ciphertext from the outside and decrypt it into plaintext internally. Normally, the key corresponding to the trusted execution environment belongs to Symmetric key. For example, in the embodiment of this specification, the first trusted execution environment maintains a second key for encryption and decryption in the process of accessing data from the blockchain non-relational database, and the second trusted execution environment maintains a second key. The first key is used for encryption and decryption during the process of accessing data from the blockchain relational database.
一方面,区块链非关系型数据库作为区块链节点运行区块链服务的原生数据库,即作为区块链底层系统的基础架构的一部分,用于对区块链节点运行区块链服务的过程中生成的区块链数据进行高效存取,而为了确保数据安全,区块链节点在需要向区块链非关系型数据库中存储区块链数据时,作为直接存储区块链数据的代替,区块链节点可以先在第二可信执行环境中对区块链数据进行加密得到密文数据(通过第二可信执行环境对应的第一密钥),然后将密文数据存储在区块链非关系型数据库,从而避免直接存储明文数据而诱发数据泄露的风险,当然,所述区块链非关系型数据库除了可以维护密文数据外,还用于维护所述区块链节点将运行区块链服务时生成的区块链数据,也就是说对于一些隐私需求较低的区块链数据,可以直接在区块链非关系型数据库中以明文状态存取。区块链非关系型数据库可以具体采用Key-Value数据库(键值对数据库,一种典型的非关系型数据库,简称K-V数据库),不同于关系型数据库,K-V数据库并不清楚存储数据的值,而且也没有像MySQL(关系型数据库管理系统)和PostgreSQL(一种特性非常齐全的自由软件的对象-关系型数据库管理系统)中schema(数据库模式信息)的概念。这也就意味着它不能像关系型数据库一样通过使用带where的SQL(Structured Query Language,结构化查询语句)来过滤并查询所存数据的部分内容。如果你不知道该从哪查询,你需要遍历所有的key值,找到对应的value,对其进行过滤,最终只保留你想要的那部分数据。这样一来计算量会非常大,同时也意味着只有在key已知的情况下,K-V数据库才能保证高性能,否则其性能明显不足。因此,虽然在绝对访问速度方面K-V数据库优于关系型数据库,但需要已知key值的要求限制了其应用场景。上述描述虽然仅涉及对K-V数据库的介绍,但实质上适用于大多数非关系型数据库,总的来说,就是非关系型 数据库具有高效的访问速度但缺乏数据分析能力,例如缺乏基于索引、数据间关系的查询能力。On the one hand, the blockchain non-relational database serves as the native database for blockchain nodes to run blockchain services, that is, as part of the infrastructure of the underlying system of the blockchain, it is used to run blockchain services on blockchain nodes. The blockchain data generated during the process is efficiently accessed. In order to ensure data security, the blockchain node uses it as a substitute for directly storing the blockchain data when it needs to store the blockchain data in the blockchain non-relational database. , the blockchain node can first encrypt the blockchain data in the second trusted execution environment to obtain the ciphertext data (through the first key corresponding to the second trusted execution environment), and then store the ciphertext data in the zone The blockchain non-relational database avoids the risk of data leakage caused by directly storing plain text data. Of course, in addition to maintaining ciphertext data, the blockchain non-relational database is also used to maintain the blockchain nodes. The blockchain data generated when running the blockchain service, that is to say, some blockchain data with low privacy requirements can be directly accessed in plaintext in the blockchain non-relational database. Blockchain non-relational databases can specifically use Key-Value databases (key-value databases, a typical non-relational database, referred to as K-V database). Unlike relational databases, K-V databases do not know the value of the stored data. And there is no concept of schema (database schema information) like in MySQL (relational database management system) and PostgreSQL (a free software object-relational database management system with very complete features). This means that it cannot filter and query part of the stored data by using SQL (Structured Query Language) with where like a relational database. If you don't know where to query, you need to traverse all key values, find the corresponding value, filter it, and finally retain only the part of the data you want. This will result in a very large amount of calculation, and it also means that the K-V database can ensure high performance only when the key is known, otherwise its performance is obviously insufficient. Therefore, although the K-V database is superior to the relational database in terms of absolute access speed, the requirement of knowing the key value limits its application scenarios. Although the above description only involves the introduction of K-V database, it is essentially applicable to most non-relational databases. Generally speaking, non-relational databases have efficient access speed but lack data analysis capabilities, such as the lack of index-based and data-based databases. The ability to query relationships between
在本说明书实施例中,由于节点设备部署的区块链底层系统(包含区块链节点与对应的区块链数据库)沿用了具有高效的访问速度的非关系型数据库(即区块链非关系型数据库),因此可以使区块链节点在运行区块链服务时,能够高效地从区块链非关系型数据库中存取数据,从而确保区块链服务的高效运行,同时由于存储的是区块链数据加密后的得到密文数据,因此还可以避免数据泄露带来的安全风险。In the embodiment of this specification, since the blockchain underlying system (including blockchain nodes and corresponding blockchain databases) deployed by the node equipment continues to use a non-relational database with efficient access speed (i.e., blockchain non-relational type database), so the blockchain node can efficiently access data from the blockchain non-relational database when running the blockchain service, thereby ensuring the efficient operation of the blockchain service. At the same time, because the stored Blockchain data is encrypted to obtain ciphertext data, so it can also avoid security risks caused by data leakage.
另一方面,本说明书实施例涉及的节点设备还额外维护有区块链关系型数据库,以作为对用户提供数据分析服务的原生数据库,即作为数据分析系统的基础架构的一部分,用于向分析需求方提供数据分析服务。例如,区块链非关系型数据库可以具体采用oracle数据库、MySQL等关系型数据库。关系型数据库,是指采用了关系模型来组织数据的数据库,其以行和列的形式存储数据,以便于用户理解,关系型数据库这一系列的行和列被称为表,一组表组成了数据库。用户通过查询来检索数据库中的数据,而查询是一个用于限定数据库中某些区域的执行代码。关系模型可以简单理解为二维表格模型,而一个关系型数据库就是由二维表及其之间的关系组成的一个数据组织,关系型数据库需要提前定义好表的结构、表的关系、规范化的数据结构等数据库模式信息,再根据数据库模式信息存入数据,支持SQL,具有强大的数据分析能力,但由于关系型数据库十分强调数据的一致性,并为此降低读写性能付出了巨大的代价,虽然关系型数据库存储数据和处理数据的可靠性很不错,但一旦面对海量数据的处理的时候效率就会变得很差,特别是遇到高并发读写的时候性能就会下降的非常厉害。总的来说,就是关系型数据库具有强大的数据分析能力但访问速度、读写性能较差,不适用于大规模并发读写的应用场景。On the other hand, the node devices involved in the embodiments of this specification also maintain an additional blockchain relational database as a native database for providing data analysis services to users, that is, as part of the infrastructure of the data analysis system, used to provide analysis services to users. The demander provides data analysis services. For example, blockchain non-relational databases can specifically use relational databases such as Oracle database and MySQL. A relational database refers to a database that uses a relational model to organize data. It stores data in the form of rows and columns to facilitate user understanding. The series of rows and columns in a relational database are called tables, and a set of tables consists of database. Users retrieve data from a database through queries, which are executable codes that limit certain areas of the database. The relational model can be simply understood as a two-dimensional table model, and a relational database is a data organization composed of two-dimensional tables and the relationships between them. A relational database needs to define the table structure, table relationships, and standardized Database schema information such as data structure is then stored in data based on the database schema information. It supports SQL and has strong data analysis capabilities. However, because relational databases place great emphasis on data consistency, they pay a huge price for reducing read and write performance. , although the reliability of relational database for storing and processing data is very good, the efficiency will become very poor once faced with the processing of massive data, especially when encountering high concurrent reading and writing, the performance will drop very much. sharp. In general, relational databases have powerful data analysis capabilities but poor access speed and read and write performance, and are not suitable for large-scale concurrent read and write application scenarios.
在本说明书实施例中,由于节点设备链下部署的数据分析系统(包括图2中未示出的数据分析引擎与对应的数据库)采用了具有高效的访问速度的非关系型数据库(即区块链关系型数据库),因此可以使节点设备在通过调用数据分析引擎而运行数据分析服务时,能够利用区块链非关系型数据库强大的数据分析能力,从而确保向分析需求方提供便捷的数据分析服务。In the embodiment of this description, since the data analysis system deployed under the node device chain (including the data analysis engine and corresponding database not shown in Figure 2) adopts a non-relational database (i.e., block database) with efficient access speed, chain relational database), thus enabling node devices to utilize the powerful data analysis capabilities of blockchain non-relational databases when running data analysis services by calling the data analysis engine, thereby ensuring that convenient data analysis is provided to analysis demand parties. Serve.
本说明书实施例涉及的区块链关系型数据库中维护的数据是通过区块链非关系型数据库中的数据转换、迁移得到的。下面将具体介绍这个数据转换、迁移的过程。The data maintained in the blockchain relational database involved in the embodiments of this specification is obtained through data conversion and migration in the blockchain non-relational database. The process of data conversion and migration will be introduced in detail below.
在本说明书实施例中,只有在所述区块链节点对第一可信执行环境对应的远程证明验证通过的情况下,节点设备才能获取到所述区块链非关系型数据库中维护的所述密文数据。对于区块链节点而言,其需要对任何向其请求获取区块链非关系型数据库中数据的数据需求方验证访问权限,以在数据需求方具有访问权限的情况下才允许向该数据需求方提供数据,在本实施例中,节点设备(具体为节点设备部署的数据转换引擎)就属于数据需求方,因此,区块链节点需要验证节点设备是否具备区块链非关系型数据库的访问权限,本说明书实施例通过验证节点设备部署的第一可信执行环境对应的远程证明是否有效,来判断节点设备是否具备区块链非关系型数据库的访问权限。具体而言,第一可信执行环境对应的远程证明包含第一可信执行环境使用第一可信执行环境对应的CPU私钥对其环境中运行的全部程序(这些程序对应的哈希值)进行签名得到的数字签名,区块链节点在获取到该远程证明后,可以通过本地维护的第一可信执行环境对应的CPU公钥对该远程证明中包含的数字签名进行验签,在验签通过的情况下可以确认节点设备的确运行有第一可信执行环境且第一可信执行环境中运行的程序合法可信、未被篡改,从而判断节点设备具备区块链非关系型数据库的访问权限;或者,区块链节点在获取到该远程证明后,可能由于不具备第一可信执行环境对应的CPU公钥,因此也可以将该远程证明发送至持有第一可信执行环境对应的CPU公钥的鉴权第三方,由鉴权第三方在验证远程证明通过后向区块链节点返回对应的远程认证报告,区块链节点在通过鉴权第三方对应的公钥验证该远程认证报告有效、且该远程认证报告用于表明所述远程证明有效的情况下,可以确认节点设备的确运行有第一可信执行环境且第一可信执行环境中运行的程序合法可信、未被篡改,从而判断节点设备具备区块链非关系型数据库的访问权限。In the embodiment of this specification, only when the blockchain node passes the remote certification verification corresponding to the first trusted execution environment, the node device can obtain all the information maintained in the blockchain non-relational database. Describe the ciphertext data. For the blockchain node, it needs to verify the access rights to any data requester requesting data from the non-relational database in the blockchain, so that the data requester is allowed to request the data only if the data requester has access rights. The party provides data. In this embodiment, the node device (specifically, the data conversion engine deployed by the node device) belongs to the data demander. Therefore, the blockchain node needs to verify whether the node device has access to the blockchain non-relational database. Permissions, the embodiment of this specification determines whether the node device has access permissions to the blockchain non-relational database by verifying whether the remote certificate corresponding to the first trusted execution environment deployed by the node device is valid. Specifically, the remote certificate corresponding to the first trusted execution environment includes the first trusted execution environment using the CPU private key corresponding to the first trusted execution environment to all the programs running in its environment (the hash values corresponding to these programs) After obtaining the digital signature obtained by signing the remote certificate, the blockchain node can verify the digital signature contained in the remote certificate through the CPU public key corresponding to the locally maintained first trusted execution environment. After verification, If the signature is passed, it can be confirmed that the node device is indeed running the first trusted execution environment and that the program running in the first trusted execution environment is legal and trustworthy and has not been tampered with, thereby determining that the node device has the qualifications of a blockchain non-relational database. Access rights; or, after obtaining the remote certificate, the blockchain node may not have the CPU public key corresponding to the first trusted execution environment, so it can also send the remote certificate to the holder of the first trusted execution environment. The authentication third party of the corresponding CPU public key will return the corresponding remote authentication report to the blockchain node after verifying that the remote certificate is passed. The blockchain node will verify the corresponding public key through the authentication third party. If the remote authentication report is valid and the remote authentication report is used to indicate that the remote certification is valid, it can be confirmed that the node device indeed runs the first trusted execution environment and that the program running in the first trusted execution environment is legal and trustworthy. It has not been tampered with, so it can be judged that the node device has access rights to the blockchain non-relational database.
在本说明书实施例中,所述获取所述区块链非关系型数据库中维护的所述密文数据,包括:接收所述区块链节点主动推送的所述密文数据;和/或,向所述区块链节点发送区块链数据请求,接收所述区块链节点响应于所述区块链数据请求返回的所述密文数据。In the embodiment of this specification, obtaining the ciphertext data maintained in the blockchain non-relational database includes: receiving the ciphertext data actively pushed by the blockchain node; and/or, Send a blockchain data request to the blockchain node, and receive the ciphertext data returned by the blockchain node in response to the blockchain data request.
本说明书实施例所涉及的维护区块链数据的方法应用于节点设备,具体应用于节点设备链下部署的数据转换引擎。节点设备可以通过两种方式中至少一种方式获取区块链非关系型数据库中维护的密文数据,这两种方式包括:其一,通过接收区块链节点的主动推送的密文数据,例如每次区块链节点在第二可信执行环境中运行区块链服务的过程中向区块链非关系型数据库中新增或修改密文数据的情况下,区块链节点都会向链下的数据转换引擎主动推送携带有最新新增或修改的密文数据的数据更新消息,本方式可以及时将区块链非关系型数据库中的数据转换并同步至区块链关系型数据库中,从而确保区块链关系型数据库中数据的对称性和时效性;其二,通过节点设备向区块链节点发送区块链数据请求以获取所述区块链节点响应于所述区块链数据请求返回的密文数据,本方式通过请求-响应模式来获取密文数据,可以有效控制请求的密文数据的范围从而屏蔽一些不需要维护在区块链关系型数据库中的数据。The method for maintaining blockchain data involved in the embodiments of this specification is applied to node devices, specifically to the data conversion engine deployed under the node device chain. The node device can obtain the ciphertext data maintained in the non-relational database of the blockchain through at least one of two methods. The two methods include: first, by receiving the ciphertext data actively pushed by the blockchain node, For example, every time a blockchain node adds or modifies ciphertext data to the blockchain non-relational database while running the blockchain service in the second trusted execution environment, the blockchain node will send a message to the chain. The data conversion engine under the system actively pushes data update messages carrying the latest newly added or modified ciphertext data. This method can timely convert and synchronize the data in the blockchain non-relational database to the blockchain relational database. Thereby ensuring the symmetry and timeliness of data in the blockchain relational database; secondly, sending a blockchain data request to the blockchain node through the node device to obtain the response of the blockchain node to the blockchain data Request the returned ciphertext data. This method obtains the ciphertext data through the request-response mode, which can effectively control the range of the requested ciphertext data and thus shield some data that does not need to be maintained in the blockchain relational database.
在本说明书实施例中,所述远程证明包含于所述区块链数据请求;或者,所述远程证明预先维护于所述区块链节点。当远程认证包含于区块链数据请求中时,相当于区块链节点对第一可信执行环境对应的最新远程证明进行验证,从而确保了远程证明的时效性。而当远程证明预先维护于区块链节点时,相当于区块链节点事先就可以通过预先维护在区块链节点的远程证明来判断节点设备是否具备区块链非关系型数据库的访问权限,因此可以减少节点设备获取密文数据过程的中间环节,增加密文数据的获取效率。In the embodiment of this specification, the remote certificate is included in the blockchain data request; or, the remote certificate is maintained in the blockchain node in advance. When remote certification is included in the blockchain data request, it is equivalent to the blockchain node verifying the latest remote certification corresponding to the first trusted execution environment, thereby ensuring the timeliness of the remote certification. When the remote certification is pre-maintained on the blockchain node, it is equivalent to the blockchain node being able to determine whether the node device has access rights to the blockchain non-relational database through the remote certification maintained on the blockchain node in advance. Therefore, the intermediate links in the process of node devices obtaining ciphertext data can be reduced, and the efficiency of obtaining ciphertext data can be increased.
可选的,所述向所述区块链节点发送区块链数据请求,包括:向所述区块链节点部署的智能合约发起针对所述智能合约维护在所述区块链非关系型数据库中的所述密文数据的所述区块链数据请求;或者,向所述区块链节点发起针对所述区块链非关系型数据库中维护的所述密文数据的所述区块链数据请求。Optionally, sending a blockchain data request to the blockchain node includes: initiating to the smart contract deployed by the blockchain node a non-relational database maintained in the blockchain for the smart contract. The blockchain data request for the ciphertext data in the blockchain node; or, initiating the blockchain data request for the ciphertext data maintained in the blockchain non-relational database to the blockchain node. Data Request.
本说明书实施例所涉及的区块链数据包括区块数据、状态数据和事件数据。其中,区块数据是指区块链网络中每个区块链节点所维护的区块链账本,区块链账本和/或区块链账本对应的密文数据实质被维护在区块链非关系型数据库中,由于区块链账本是一种特殊的数据结构,其是由多个区块通过哈希锚定首尾相连而成,具有不可篡改性,每个区块由区块头和区块体组成,任一区块的区块头中包含有该个区块的状态树根、交易数根、收据树根、区块高度和对应父区块的哈希值等信息,而区块体中包含有该个区块包含的交易数据(交易哈希)。本说明书实施例所涉及的区块数据指的就是区块链账本中包含的数据。本说明书实施例涉及的状态数据和事件数据则是由区块链节点所部署的各个智能合约所维护,实质上状态数据、事件数据和/或状态数据、事件数据对应的密文数据是维护在区块链非关系型数据库中对应于各个智能合约的合约存储空间。The blockchain data involved in the embodiments of this specification includes block data, status data and event data. Among them, block data refers to the blockchain ledger maintained by each blockchain node in the blockchain network. The blockchain ledger and/or the ciphertext data corresponding to the blockchain ledger are essentially maintained in the non-blockchain database. In relational databases, since the blockchain ledger is a special data structure, it is composed of multiple blocks connected end to end through hash anchoring and cannot be tampered with. Each block consists of a block header and a block The block header of any block contains information such as the status tree root, transaction number root, receipt tree root, block height and the hash value of the corresponding parent block of the block, while the block body Contains the transaction data (transaction hash) contained in the block. The block data involved in the embodiments of this specification refers to the data contained in the blockchain ledger. The status data and event data involved in the embodiments of this specification are maintained by various smart contracts deployed by the blockchain nodes. In essence, the status data, event data and/or the ciphertext data corresponding to the status data and event data are maintained in The contract storage space corresponding to each smart contract in the blockchain non-relational database.
在一实施例中,区块链节点部署有若干的智能合约,任一智能合约中都维护有相应的状态数据,这些状态数据被以在第二可信执行环境中通过第一密钥加密为密文数据的形式维护在区块链非关系型数据库中对应于所述任一智能合约的合约存储空间内。而节点设备可以向区块链节点部署的智能合约(事实上,任一智能合约部署在区块链网络中每个区块链节点上)发起区块链数据请求,该区块链数据请求在形式上属于一种区块链交易,该区块链交易在由区块链节点接收到后,区块链节点会进一步调用该区块链交易所指示的智能合约执行该区块链交易。智能合约在执行该区块链交易时,从区块链非关系型数据库中对应于该智能合约的合约存储空间查找并获取区块链交易所指示的密文数据,并将该密文数据作为区块链数据请求对应的响应消息(如以区块链事件的形式)回调至节点设备,从而实现以调用智能合约的方式来获取区块链非关系型数据库中维护的密文数据。In one embodiment, the blockchain node is deployed with several smart contracts, and each smart contract maintains corresponding status data. These status data are encrypted with the first key in the second trusted execution environment as The form of ciphertext data is maintained in the contract storage space corresponding to any of the smart contracts in the blockchain non-relational database. The node device can initiate a blockchain data request to the smart contract deployed by the blockchain node (in fact, any smart contract is deployed on each blockchain node in the blockchain network). The blockchain data request is Formally it is a blockchain transaction. After the blockchain transaction is received by the blockchain node, the blockchain node will further call the smart contract instructed by the blockchain transaction to execute the blockchain transaction. When the smart contract executes the blockchain transaction, it searches for and obtains the ciphertext data indicated by the blockchain transaction from the contract storage space corresponding to the smart contract in the blockchain non-relational database, and uses the ciphertext data as The response message corresponding to the blockchain data request (such as in the form of a blockchain event) is called back to the node device, thereby achieving the method of calling a smart contract to obtain the ciphertext data maintained in the blockchain non-relational database.
在另一实施例中,节点设备可以向区块链节点直接发起区块链数据请求,例如通过区块链节点的数据查询接口发起区块链数据请求,该区块链数据请求用于使区块链节点从区块链非关系型数据库中调取区块链数据请求所指示的密文数据(由区块数据在第二可信执行环境中经过第一密钥加密得到的)并回调至节点设备。In another embodiment, the node device can directly initiate a blockchain data request to the blockchain node, for example, initiate a blockchain data request through the data query interface of the blockchain node. The blockchain data request is used to make the district The blockchain node retrieves the ciphertext data indicated by the blockchain data request from the blockchain non-relational database (obtained from the block data encrypted by the first key in the second trusted execution environment) and calls back to Node device.
在又一实施例中,节点设备可以直接向区块链非关系型数据库发起区块链数据请求,例如通过区块链非关系型数据库的数据库接口发起区块链数据请求,此时相当于节点设备链下的本地调用而无需经过区块链节点,区块链非关系型数据库直接响应于接收到的区块链数据请求返回区块链数据请求指示的密 文数据。In another embodiment, the node device can directly initiate a blockchain data request to the blockchain non-relational database, for example, through the database interface of the blockchain non-relational database, which is equivalent to the node. Local calls under the device chain without going through the blockchain node, the blockchain non-relational database directly responds to the received blockchain data request and returns the ciphertext data indicated by the blockchain data request.
需要注意的是,虽然区块链数据请求在形式上与区块链交易相同,但不一定具有区块链交易的所有性质,例如区块链节点在接收到区块链数据请求后不一定会将其在区块链网络中进行共识,而是作为本地调用请求进行处理,这种不进行共识仅会在本地区块链节点内部执行的区块链交易称为本地交易;当然,区块链数据请求也可以具有区块链交易的所有性质,即作为共识交易在区块链网络中完成共识后,由区块链网络中的每个区块链节点各自分别执行。It should be noted that although a blockchain data request is in the same form as a blockchain transaction, it does not necessarily have all the properties of a blockchain transaction. For example, a blockchain node may not necessarily Instead of consensus in the blockchain network, it is processed as a local call request. This kind of blockchain transaction that will only be executed within the local blockchain node without consensus is called a local transaction; of course, the blockchain Data requests can also have all the properties of a blockchain transaction, that is, after completing consensus in the blockchain network as a consensus transaction, they are executed separately by each blockchain node in the blockchain network.
S104:在第一可信执行环境中,通过第一密钥将所述密文数据解密为所述区块链数据,并将所述区块链数据转换为所述区块链关系型数据库对应的数据库模式信息定义的标准数据,以及,通过第一可信执行环境对应的第二密钥将所述标准数据加密为密文标准数据。S104: In the first trusted execution environment, decrypt the ciphertext data into the blockchain data using the first key, and convert the blockchain data into the blockchain relational database corresponding The standard data defined by the database schema information, and the standard data is encrypted into ciphertext standard data through the second key corresponding to the first trusted execution environment.
节点设备在获取到密文数据后,会将其读入第一可信执行环境中,同时调用运行在第一可信执行环境中的数据转换引擎在第一可信执行环境中执行有关密文数据的解密、转换和加密任务。具体而言,节点设备通过第一密钥首先将所述密文数据解密为明文数据,也即前述的所述区块链数据,然后将所述区块链数据转换为所述区块链关系型数据库对应的数据库模式信息定义的标准数据,最后通过第一可信执行环境对应的第二密钥将所述标准数据加密为密文标准数据。由于上述过程均在第一可信执行环境中实现,因此可以有效避免数据泄露问题,提高系统的安全性。After the node device obtains the ciphertext data, it will read it into the first trusted execution environment, and at the same time call the data conversion engine running in the first trusted execution environment to execute the relevant ciphertext in the first trusted execution environment. Data decryption, transformation and encryption tasks. Specifically, the node device first decrypts the ciphertext data into plaintext data, that is, the aforementioned blockchain data, through the first key, and then converts the blockchain data into the blockchain relationship. The standard data defined by the database schema information corresponding to the database is finally encrypted into ciphertext standard data through the second key corresponding to the first trusted execution environment. Since the above processes are all implemented in the first trusted execution environment, data leakage issues can be effectively avoided and system security improved.
在本说明书实施例中,第一密钥由所述区块链节点对所述远程证明验证通过的情况下提供至所述节点设备部署的第一可信执行环境;或者,第一密钥预先维护于第一可信执行环境中。第一密钥可以由区块链节点在验证远程证明的情况下(即区块链节点确认节点设备具备区块链非关系型数据库的访问权限的情况下)及时地提供给节点设备中的第一可信执行环境,或预先维护在第一可信执行环境中,例如历史上节点设备已经被区块链节点确认具有相应访问权限而第一密钥已由区块链节点提供给了第一可信执行环境,那么第一可信执行环境就会预先维护有该第一密钥。In the embodiment of this specification, the first key is provided to the first trusted execution environment deployed by the node device when the blockchain node passes the verification of the remote certificate; or, the first key is pre- Maintained in the first trusted execution environment. The first key can be provided by the blockchain node to the third node in the node device in a timely manner under the condition of verifying the remote attestation (that is, the blockchain node confirms that the node device has access rights to the blockchain non-relational database). A trusted execution environment, or pre-maintained in the first trusted execution environment, for example, historically the node device has been confirmed by the blockchain node to have the corresponding access rights and the first key has been provided by the blockchain node to the first Trusted execution environment, then the first trusted execution environment will maintain the first key in advance.
本说明书实施例所涉及的数据库模式信息具体是指数据库schema,schema是元数据的一个抽象集合,包含一套schema component(模式组件):主要是元素与属性的声明、复杂与简单数据类型的定义,具体包括:定义可出现在文档中的元素;定义可出现在文档中的属性;定义哪个元素是子元素;定义子元素的次序;定义子元素的数目;定义元素是否为空,或者是否可包含文本;定义元素和属性的数据类型;定义元素和属性的默认值以及固定值。而在数据库中,schema是数据库的组织和结构。数据库模式信息中包含了schema对象,能够是表(table)、列(column)、数据类型(data type)、视图(view)、存储过程(stored procedures)、关系(relationships)、主键(primary key)、外键(foreign key)等。数据库模式信息能够用一个可视化的图来表示,它显示了数据库对象及其相互之间的关系。由于数据库模式信息用于描述数据库的结构,能够作为创建一个数据库的蓝图,因此通过规定一个数据库对应的数据库模式信息,可以指导该数据库中数据是如何进行储存。The database schema information involved in the embodiments of this specification specifically refers to the database schema. Schema is an abstract collection of metadata, including a set of schema components: mainly the declaration of elements and attributes, and the definition of complex and simple data types. , specifically including: defining the elements that can appear in the document; defining the attributes that can appear in the document; defining which element is a sub-element; defining the order of sub-elements; defining the number of sub-elements; defining whether the element is empty or whether it can Contains text; defines data types for elements and attributes; defines default and fixed values for elements and attributes. In a database, schema is the organization and structure of the database. Database schema information contains schema objects, which can be tables, columns, data types, views, stored procedures, relationships, and primary keys. , foreign key, etc. Database schema information can be represented by a visual diagram that shows database objects and their relationships to each other. Since the database schema information is used to describe the structure of the database and can be used as a blueprint for creating a database, by specifying the database schema information corresponding to a database, it can guide how the data in the database is stored.
节点设备在解密得到区块链数据后,将在第一可信执行环境中基于区块链关系型数据库对应的数据库模式信息,将区块链数据转换为该数据库模式信息所定义的标准数据,这意味着转换得到的标准数据能够被按照一定的规则维护在区块链关系型数据库中,并且标准数据也已经具备了规范化的结构以及被定义有与区块链关系型数据库中其他数据之间的关系。区块链数据到标准数据的转换过程包括但不限于数据表、行、列的转换,例如通过ETL(Extract-Transform-Load,基于数据抽取、转换和加载的数据仓库技术)机制实现了区块链数据到标准数据的转换,其具体实现方式现有技术均有所记载,这里不再赘述。由于密文标准数据是通过对标准数据进行加密得到的,其只是在数值上脱敏处理了,但仍然保留有标准数据状态时的结构、以及标准数据状态时与其他数据之间的关系,即密文标准数据和加密前的标准数据一样,能够被按照一定的规则维护在区块链关系型数据库。After the node device decrypts the blockchain data, it will convert the blockchain data into standard data defined by the database schema information based on the database schema information corresponding to the blockchain relational database in the first trusted execution environment. This means that the converted standard data can be maintained in the blockchain relational database according to certain rules, and the standard data already has a standardized structure and is defined to be connected with other data in the blockchain relational database. Relationship. The conversion process of blockchain data to standard data includes but is not limited to the conversion of data tables, rows, and columns. For example, the block is implemented through the ETL (Extract-Transform-Load, data warehouse technology based on data extraction, conversion, and loading) mechanism. The specific implementation methods for converting chain data into standard data have been documented in existing technologies and will not be described again here. Since the ciphertext standard data is obtained by encrypting the standard data, it is only numerically desensitized, but it still retains the structure of the standard data state and the relationship between the standard data state and other data, that is, The ciphertext standard data, like the standard data before encryption, can be maintained in the blockchain relational database according to certain rules.
可选的,在所述区块链数据请求针对于所述智能合约维护在所述区块链非关系型数据库中的所述密文数据的情况下,所述方法还包括:Optionally, in the case where the blockchain data request is for the ciphertext data maintained in the blockchain non-relational database by the smart contract, the method further includes:
向所述智能合约发起模式信息查询请求,将所述智能合约响应于所述模式信息查询请求返回的记录 于所述智能合约中的第一数据库模式信息确定为所述区块链关系型数据库对应的所述数据库模式信息。Initiate a schema information query request to the smart contract, and determine the first database schema information recorded in the smart contract returned by the smart contract in response to the schema information query request as corresponding to the blockchain relational database The database schema information.
在本说明书实施例中,区块链关系型数据库对应的数据库模式信息可以被预先维护在节点设备处(例如由节点设备的管理员用户所设置),或者,向智能合约请求获取得到。如前所述,由于区块链节点部署的每个智能合约在区块链非关系型数据库中都有对应的合约存储空间,且每个智能合约在处理数据、组织数据、存储数据时具有不同的特性,因此不同智能合约在区块链非关系型中对应的合约存储空间具有不同的数据组织形式,而这个数据组织形式包括数据组织的格式、关系和内涵等,它同样是以数据库模式信息的形式被维护在智能合约中。因此,为了正确应对不同智能合约在区块链非关系型数据库所维护的具有不同组织特性的密文数据,本说明书实施例通过向对应智能合约请求获取该智能合约中维护的对应于该智能合约维护在非关系型数据库中的密文数据的第一数据库模式信息,来作为在区块链关系型数据库中维护该智能合约涉及的密文数据解密、转换并加密(本说明书中也可以将解密、转换并加密的过程简称为转换)得到的密文标准数据的组织模式,从而在区块链关系型数据库中正确地维护该智能合约涉及的密文标准数据。当区块链节点包含多个智能合约时,且不同的智能合约具有不同的数据组织形式的情况下,通过本说明书实施例可以获取每个智能合约对应的数据库模式信息,并按照对应智能合约的数据库模式信息,来作为所述区块链关系型数据库对应的所述数据库模式信息实现对应智能合约涉及的密文数据到密文标准数据的转换,并最终按照不同智能合约各自的数据库模式信息,实现多个智能合约涉及的密文标准数据在区块链关系型数据库中的正确维护。此时相当于区块链关系型数据库应用有多种不同的数据库模式信息,且任一智能合约对应的数据库模式信息仅支持维护该任一智能合约涉及的密文标准数据(即来自该任一智能合约中密文数据解密、转换并加密得到的密文标准数据),从而支持多个采用不同数据组织形式的智能合约维护在区块链非关系型数据库中的密文数据正确地转换为密文标准数据后,最终以密文标准数据的形式迁移至区块链关系型数据库中维护。In the embodiment of this specification, the database schema information corresponding to the blockchain relational database can be maintained at the node device in advance (for example, set by the administrator user of the node device), or can be obtained by requesting a smart contract. As mentioned before, each smart contract deployed by the blockchain node has a corresponding contract storage space in the blockchain non-relational database, and each smart contract has different characteristics when processing data, organizing data, and storing data. characteristics, so the corresponding contract storage spaces of different smart contracts in the non-relational blockchain have different data organization forms, and this data organization form includes the format, relationship and connotation of the data organization, etc. It is also based on database schema information The form is maintained in the smart contract. Therefore, in order to correctly deal with the ciphertext data with different organizational characteristics maintained by different smart contracts in the non-relational database of the blockchain, the embodiment of this specification obtains the ciphertext data maintained in the smart contract corresponding to the smart contract by requesting the corresponding smart contract. The first database schema information of the ciphertext data maintained in the non-relational database is used to decrypt, convert and encrypt the ciphertext data involved in maintaining the smart contract in the blockchain relational database (decryption can also be used in this specification) , the process of conversion and encryption is referred to as conversion), so that the ciphertext standard data involved in the smart contract can be correctly maintained in the blockchain relational database. When a blockchain node contains multiple smart contracts, and different smart contracts have different data organization forms, the database schema information corresponding to each smart contract can be obtained through the embodiments of this specification, and the database schema information corresponding to the smart contract can be obtained according to the corresponding smart contract. The database schema information is used as the database schema information corresponding to the blockchain relational database to realize the conversion of the ciphertext data involved in the corresponding smart contract into the ciphertext standard data, and finally according to the respective database schema information of different smart contracts, Realize the correct maintenance of ciphertext standard data involved in multiple smart contracts in the blockchain relational database. At this time, it is equivalent to the blockchain relational database application having a variety of different database schema information, and the database schema information corresponding to any smart contract only supports the maintenance of the ciphertext standard data involved in any smart contract (that is, from any The ciphertext standard data obtained by decrypting, converting and encrypting the ciphertext data in the smart contract), thereby supporting multiple smart contracts using different data organization forms to correctly convert the ciphertext data maintained in the blockchain non-relational database into ciphertext data. After documenting the standard data, it is finally migrated to the blockchain relational database for maintenance in the form of ciphertext standard data.
S106:将所述密文标准数据维护在所述区块链关系型数据库中,所述区块链关系型数据库用于向分析需求方提供运行在第一可信执行环境中的数据分析服务。S106: Maintain the ciphertext standard data in the blockchain relational database. The blockchain relational database is used to provide data analysis services running in the first trusted execution environment to the analysis requester.
节点设备在第一可信环境中加密得到密文标准数据后,便可以按照区块链关系型数据库对应的区块链模式信息将密文标准数据存储于区块链关系型数据库中,以实现区块链非关系型数据库中的密文数据到区块链关系型数据库中密文标准数据的转换迁移。由于区块链关系型数据库支持多种SQL,具有强大的数据分析能力(例如基于各类条件、索引、关系的数据查询能力),因此区块链关系型数据库可以方便地向分析需求方提供便捷的数据分析服务,同时由于数据分析服务运行在第一可信执行环境中,因此实际上是在第一可信执行环境中将密文标准数据解密后再进行分析以获取的分析结果,对明文数据进行分析可以保证分析的效率,同时在TEE中运行数据分析服务也能确保数据安全。例如,通过节点设备上链下部署的运行在第一可信执行环境中的数据分析引擎向外部提供数据分析接口,来向外部调用该分析接口的分析需求方提供针对区块链关系型数据库的数据分析服务。After the node device encrypts the ciphertext standard data in the first trusted environment, it can store the ciphertext standard data in the blockchain relational database according to the blockchain mode information corresponding to the blockchain relational database to achieve Conversion and migration of ciphertext data in the blockchain non-relational database to ciphertext standard data in the blockchain relational database. Since the blockchain relational database supports a variety of SQL and has powerful data analysis capabilities (such as data query capabilities based on various conditions, indexes, and relationships), the blockchain relational database can easily provide analysis needs to parties. Data analysis service, and because the data analysis service runs in the first trusted execution environment, it actually decrypts the ciphertext standard data in the first trusted execution environment and then analyzes it to obtain the analysis results. Analyzing data can ensure the efficiency of analysis, and running data analysis services in TEE can also ensure data security. For example, the data analysis engine running in the first trusted execution environment deployed on and off the chain of the node device provides a data analysis interface to the outside world, so as to provide analysis requesters that call the analysis interface externally for the blockchain relational database. Data analysis services.
本说明书实施例通过在节点设备上分别部署区块链非关系型数据库和区块链关系型数据库,一方面,由于区块链非关系型数据库用于维护将区块链节点运行区块链服务时生成的区块链数据加密得到的密文数据,这使得区块链节点运行区块链服务时能够对区块链数据加密后进行高效存储以及对密文数据进行高效读取;另一方面,通过将从区块链非关系型数据库中维护的密文数据解密、转换并加密为密文标准数据以同步维护于区块链关系型数据库中,从而利用区块链关系型数据库实现便捷的数据分析服务。另外,无论是区块链节点运行的区块链服务,或是节点设备对密文数据解密、转换并加密的过程均在相应的可信执行环境中进行,同时区块链节点在提供密文数据前需要提前对第一可信执行环境对应的远程证明进行验证,从而确保了数据处理、数据传输和数据存储的系统级别的数据安全。本说明书实施例涉及的维护区块链数据的方法实现了一份数据两处备份,客观上提高了容灾能力,在确保区块链服务执行过程具有高效存取效率的情况下实现便捷的数据分析服务;同时由于结合了可信执行环境技术,因此实现了从链上的区块链服务到链下的数据转换和数据分析服务的全流程的可信数据流转与可信数据处理的过程,尽可能地减少了数据泄露风险。The embodiment of this specification separately deploys a blockchain non-relational database and a blockchain relational database on node devices. On the one hand, the blockchain non-relational database is used to maintain and run blockchain services on blockchain nodes. The ciphertext data obtained by encrypting the blockchain data generated at the time enables the blockchain node to efficiently store the encrypted blockchain data and efficiently read the ciphertext data when running the blockchain service; on the other hand, , by decrypting, converting and encrypting the ciphertext data maintained in the blockchain non-relational database into ciphertext standard data to be simultaneously maintained in the blockchain relational database, thereby using the blockchain relational database to achieve convenient Data analysis services. In addition, whether it is the blockchain service run by the blockchain node, or the process of decrypting, converting and encrypting the ciphertext data by the node device, it is carried out in the corresponding trusted execution environment. At the same time, the blockchain node is providing the ciphertext. The remote certificate corresponding to the first trusted execution environment needs to be verified in advance before data is sent, thereby ensuring system-level data security in data processing, data transmission and data storage. The method for maintaining blockchain data involved in the embodiments of this specification realizes the backup of one data in two places, objectively improves the disaster recovery capability, and realizes convenient data access while ensuring efficient access efficiency during the execution of the blockchain service. Analysis services; at the same time, due to the combination of trusted execution environment technology, it realizes the entire process of trusted data transfer and trusted data processing from on-chain blockchain services to off-chain data conversion and data analysis services. The risk of data leakage is reduced as much as possible.
可选的,还包括:Optional, also includes:
接收所述分析需求方发送的数据分析请求;Receive the data analysis request sent by the analysis requester;
将所述区块链关系型数据库中维护的所述数据分析请求对应的至少一个密文标准数据读入第一可信执行环境,通过第二密钥将所述至少一个密文标准数据分别解密为至少一个标准数据,将基于所述数据分析请求对所述至少一个标准数据进行分析得到的分析结果返回所述分析需求方。Reading at least one ciphertext standard data corresponding to the data analysis request maintained in the blockchain relational database into the first trusted execution environment, and decrypting the at least one ciphertext standard data respectively using the second key For at least one standard data, the analysis result obtained by analyzing the at least one standard data based on the data analysis request is returned to the analysis requester.
作为一种提供数据分析服务的实施例,节点设备上链下部署的数据分析引擎还可以用于接收分析需求方发送的数据分析请求,然后基于所述数据分析引擎调取区块链关系型数据库中维护的所述数据分析请求对应的至少一个密文标准数据读入第一可信执行环境,使用第二密钥将所述至少一个密文标准数据分别解密为至少一个标准数据,并在第一可信执行环境中搭建基于至少一个标准数据(明文状态)构成的内存数据库,并基于所述数据分析请求对该内存数据库进行分析并将分析得到的分析结果返回所述分析需求方,分析结果可以通过第二密钥加密后返回分析需求方,或者以明文状态直接返回分析需求方,本说明书对此并不做任何限制,至此实现一次完整的数据分析服务。例如,数据分析请求是针对同时满足条件A与条件B的数据查询请求,那么数据分析引擎将在区块链关系型数据库中查询同时具备条件A与条件B的密文标准数据,并将这些密文标准数据读入第一可信执行环境中通过第二密钥解密为标准数据后以作为分析结果返回分析需求方。As an embodiment of providing data analysis services, the data analysis engine deployed on and off-chain on the node device can also be used to receive data analysis requests sent by the analysis requester, and then retrieve the blockchain relational database based on the data analysis engine. At least one ciphertext standard data corresponding to the data analysis request maintained in the first trusted execution environment is read into the first trusted execution environment, and the at least one ciphertext standard data is decrypted into at least one standard data using the second key, and in the first Build a memory database based on at least one standard data (plain text state) in a trusted execution environment, analyze the memory database based on the data analysis request, and return the analysis results obtained by the analysis to the analysis requester, and the analysis results It can be encrypted by the second key and then returned to the analysis requester, or it can be directly returned to the analysis requester in plain text. This instruction does not impose any restrictions on this, and a complete data analysis service can be achieved at this point. For example, if the data analysis request is a data query request that satisfies both condition A and condition B, then the data analysis engine will query the ciphertext standard data that satisfies both condition A and condition B in the blockchain relational database, and convert these ciphertext standard data into the blockchain relational database. The text standard data is read into the first trusted execution environment and decrypted into standard data through the second key, and then returned to the analysis requester as an analysis result.
可选的,所述将所述区块链关系型数据库中维护的所述数据分析请求对应的至少一个密文标准数据读入第一可信执行环境,包括:Optionally, reading at least one ciphertext standard data corresponding to the data analysis request maintained in the blockchain relational database into the first trusted execution environment includes:
在确定所述分析需求方属于所述数据分析服务的合法用户的情况下,将所述区块链关系型数据库中维护的所述数据分析请求对应的所述至少一个密文标准数据读入第一可信执行环境。When it is determined that the analysis requester is a legitimate user of the data analysis service, the at least one ciphertext standard data corresponding to the data analysis request maintained in the blockchain relational database is read into the third A trusted execution environment.
在本说明书实施例中,节点设备需要首先验证分析请求方的分析权限,并在确认分析请求方具有分析权限的情况下,才会响应该分析请求方发送的数据分析请求执行后续的步骤。节点设备在第一可信执行环境中维护有数据分析服务对应的合法用户列表,节点设备——具体为数据分析引擎可以在验证分析需求方身份后(例如通过第一分析需求方对应的第一公钥对数据分析请求中包含的数字签名进行验签,在验签通过的情况下确认该数据分析请求确实来自第一公钥对应的第一分析需求方),通过在检查合法用户列表中包含该分析需求方的标识信息的情况下,确定该分析请求方具有分析权限,而在合法用户列表中不包含该分析需求方的标识信息的情况下,确定该分析请求方不具有分析权限。In the embodiment of this specification, the node device needs to first verify the analysis permission of the analysis requester, and only after confirming that the analysis requester has the analysis permission will it respond to the data analysis request sent by the analysis requester and perform subsequent steps. The node device maintains a legal user list corresponding to the data analysis service in the first trusted execution environment. The node device, specifically the data analysis engine, can verify the identity of the analysis requester (for example, through the first analysis requester corresponding to the first The public key is used to verify the digital signature contained in the data analysis request. If the signature verification passes, it is confirmed that the data analysis request does come from the first analysis requester corresponding to the first public key), by checking that the digital signature included in the legal user list If the identification information of the analysis requester is included, it is determined that the analysis requester has the analysis authority. If the legal user list does not contain the identification information of the analysis requester, it is determined that the analysis requester does not have the analysis authority.
可选的,所述合法用户对应的第一用户列表密文维护在所述区块链关系型数据库中,第一用户列表密文由所述节点设备在第一可信执行环境中通过第二密钥对第一用户列表进行加密后得到,第一用户列表由所述节点设备在第一可信执行环境中通过第一密钥对第二用户列表密文进行解密并基于所述数据库模式信息进行转换后得到,其中,第二用户列表密文由所述区块链节点部署的用户授权合约维护在所述区块链非关系型数据库中。Optionally, the first user list ciphertext corresponding to the legal user is maintained in the blockchain relational database, and the first user list ciphertext is passed by the node device in the first trusted execution environment through the second The first user list is obtained by encrypting the first user list with the key. The first user list is decrypted by the node device in the first trusted execution environment using the first key to decrypt the second user list ciphertext and based on the database schema information. Obtained after conversion, wherein the second user list ciphertext is maintained in the blockchain non-relational database by the user authorization contract deployed by the blockchain node.
在本说明书实施例中,所述合法用户对应的合法用户列表是由节点设备从区块链关系型数据库中读取第一用户列表密文后在第一可信执行环境中使用第二密钥解密得到,而区块链关系型数据库中维护的第一用户列表密文同样也是通过本说明书实施例所涉及的维护区块链数据的方法从区块链非关系型数据库中的第二用户列表密文迁移过来的。具体而言,所述合法用户对应的合法用户列表其实是维护在区块链节点所部署的用户授权合约中,其可以通过区块链交易的方式实现修改、更新、增加等操作,如前所述,用户授权合约维护的合法用户列表实际上是被区块链节点通过第二密钥加密为第二用户列表密文后,被维护于区块链非关系型数据库中对应于所述用户授权合约的合约存储空间内,因此,第二用户列表密文可以作为本说明书实施例所涉及的密文数据,通过本说明书实施例所涉及的维护区块链数据的方法,被节点设备上部署的数据转换引擎所获取,在第一可信执行环境中通过第二密钥解密为明文状态的合法用户列表,合法用户列表又进一步被转换为所述区块链关系型数据库对应的数据库模式信息定义的标准合法用户列表(其包含的数据内涵与合法用户列表一致),以使标准合法用户列表最终通过第一密钥加密为第二用户列表密文后备维护在区块链关系数据库中。运行在第一可信执行环境中的数据分析引 擎在需要获取合法用户列表的情况下,可以从区块链关系数据库读取第一用户列表密文并使用第二密钥解密得到标准合法用户列表。本说明书实施例中,合法用户对应的合法用户列表实质上是区块链节点上部署的用户授权合约所维护,而节点设备通过本说明书实施例所涉及的维护区块链数据的方法可以将区块链非关系型数据库中以第二用户列表密文形式存储的合法用户列表以第一用户列表密文的形式同步维护于区块链关系数据库中,从而使得节点设备无需调用链上的用户授权合约而可以通过链下方式获取合法用户列表。In the embodiment of this specification, the legal user list corresponding to the legal user is obtained by the node device reading the first user list ciphertext from the blockchain relational database and using the second key in the first trusted execution environment. Decryption is obtained, and the ciphertext of the first user list maintained in the blockchain relational database is also obtained from the second user list in the blockchain non-relational database through the method of maintaining blockchain data involved in the embodiment of this specification. The ciphertext is migrated. Specifically, the legal user list corresponding to the legal user is actually maintained in the user authorization contract deployed by the blockchain node, which can be modified, updated, added, etc. through blockchain transactions, as mentioned above. As mentioned above, the legal user list maintained by the user authorization contract is actually encrypted by the blockchain node through the second key into the second user list ciphertext, and then maintained in the blockchain non-relational database corresponding to the user authorization. Within the contract storage space of the contract, therefore, the second user list ciphertext can be used as the ciphertext data involved in the embodiments of this specification, and is deployed on the node device through the method of maintaining blockchain data involved in the embodiments of this specification. The legal user list obtained by the data conversion engine is decrypted by the second key in the first trusted execution environment into a clear text state, and the legal user list is further converted into a database schema information definition corresponding to the blockchain relational database. The standard legal user list (the data connotation contained in it is consistent with the legal user list), so that the standard legal user list is finally encrypted by the first key to the second user list ciphertext backup and maintained in the blockchain relational database. When the data analysis engine running in the first trusted execution environment needs to obtain the legal user list, it can read the first user list ciphertext from the blockchain relational database and use the second key to decrypt it to obtain the standard legal user list. . In the embodiment of this specification, the legal user list corresponding to the legal user is essentially maintained by the user authorization contract deployed on the blockchain node, and the node device can use the method of maintaining blockchain data involved in the embodiment of this specification to maintain the area. The legal user list stored in the blockchain non-relational database in the form of the second user list ciphertext is synchronously maintained in the blockchain relational database in the form of the first user list ciphertext, so that the node device does not need to call the user authorization on the chain. The contract can obtain the list of legal users through off-chain methods.
图3是一示例性实施例提供的一种设备的示意结构图。请参考图3,在硬件层面,该设备包括处理器302、内部总线303、网络接口306、内存308以及非易失性存储器310,当然还可能包括其他功能所需要的硬件。本说明书一个或多个实施例可以基于软件方式来实现,比如由处理器302从非易失性存储器310中读取对应的计算机程序到内存308中然后运行。当然,除了软件实现方式之外,本说明书一个或多个实施例并不排除其他实现方式,比如逻辑器件抑或软硬件结合的方式等等,也就是说以下处理流程的执行主体并不限定于各个逻辑单元,也可以是硬件或逻辑器件。Figure 3 is a schematic structural diagram of a device provided by an exemplary embodiment. Please refer to Figure 3. At the hardware level, the device includes a processor 302, an internal bus 303, a network interface 306, a memory 308 and a non-volatile memory 310. Of course, it may also include hardware required for other functions. One or more embodiments of this specification may be implemented based on software. For example, the processor 302 reads the corresponding computer program from the non-volatile memory 310 into the memory 308 and then runs it. Of course, in addition to software implementation, one or more embodiments of this specification do not exclude other implementations, such as logic devices or a combination of software and hardware, etc. That is to say, the execution subject of the following processing flow is not limited to each A logic unit can also be a hardware or logic device.
如图4所示,图4是本说明书根据一示例性实施例提供的一种维护区块链数据的装置的框图,该装置可以应用于如图3所示的设备中,以实现本说明书的技术方案;该装置应用于部署有区块链节点和第一可信执行环境的节点设备,所述节点设备维护有区块链非关系型数据库和区块链关系型数据库,所述区块链非关系型数据库用于维护密文数据,所述密文数据由所述区块链节点将在第二可信执行环境中运行区块链服务时生成的区块链数据通过第二可信执行环境对应的第一密钥加密得到;所述装置包括:As shown in Figure 4, Figure 4 is a block diagram of a device for maintaining blockchain data provided in this specification according to an exemplary embodiment. This device can be applied to the equipment shown in Figure 3 to implement the instructions of this specification. Technical solution: This device is applied to node equipment deployed with blockchain nodes and a first trusted execution environment. The node equipment maintains a blockchain non-relational database and a blockchain relational database. The blockchain The non-relational database is used to maintain ciphertext data. The ciphertext data is generated by the blockchain node when running the blockchain service in the second trusted execution environment through the second trusted execution environment. The first key corresponding to the environment is encrypted and obtained; the device includes:
密文数据获取单元401,用于在所述区块链节点对第一可信执行环境对应的远程证明验证通过的情况下,获取所述区块链非关系型数据库中维护的所述密文数据;The ciphertext data acquisition unit 401 is configured to acquire the ciphertext maintained in the blockchain non-relational database when the blockchain node passes the remote certification verification corresponding to the first trusted execution environment. data;
数据转换单元402,用于在第一可信执行环境中,通过第一密钥将所述密文数据解密为所述区块链数据,并将所述区块链数据转换为所述区块链关系型数据库对应的数据库模式信息定义的标准数据,以及,通过第一可信执行环境对应的第二密钥将所述标准数据加密为密文标准数据; Data conversion unit 402, configured to decrypt the ciphertext data into the blockchain data through the first key in the first trusted execution environment, and convert the blockchain data into the block Link the standard data defined by the database schema information corresponding to the relational database, and encrypt the standard data into ciphertext standard data through the second key corresponding to the first trusted execution environment;
密文标准数据维护单元403,用于将所述密文标准数据维护在所述区块链关系型数据库中,所述区块链关系型数据库用于向分析需求方提供运行在第一可信执行环境中的数据分析服务。The ciphertext standard data maintenance unit 403 is used to maintain the ciphertext standard data in the blockchain relational database, and the blockchain relational database is used to provide analysis demanders with information running on the first trusted Data analysis services in the execution environment.
可选的,所述密文数据获取单元401具体用于:Optionally, the ciphertext data acquisition unit 401 is specifically used to:
接收所述区块链节点主动推送的所述密文数据;和/或,Receive the ciphertext data actively pushed by the blockchain node; and/or,
向所述区块链节点发送区块链数据请求,接收所述区块链节点响应于所述区块链数据请求返回的所述密文数据。Send a blockchain data request to the blockchain node, and receive the ciphertext data returned by the blockchain node in response to the blockchain data request.
可选的,所述密文数据获取单元401进一步用于:Optionally, the ciphertext data acquisition unit 401 is further used to:
向所述区块链节点部署的智能合约发起针对所述智能合约维护在所述区块链非关系型数据库中的所述密文数据的所述区块链数据请求;或者,Initiate the blockchain data request for the ciphertext data maintained in the blockchain non-relational database by the smart contract to the smart contract deployed by the blockchain node; or,
向所述区块链节点发起针对所述区块链非关系型数据库中维护的所述密文数据的所述区块链数据请求。Initiating the blockchain data request for the ciphertext data maintained in the blockchain non-relational database to the blockchain node.
可选的,在所述区块链数据请求针对于所述智能合约维护在所述区块链非关系型数据库中的所述密文数据的情况下,所述装置还包括:Optionally, in the case where the blockchain data request is for the ciphertext data maintained in the blockchain non-relational database by the smart contract, the device further includes:
模式信息查询请求发送单元404,用于向所述智能合约发起模式信息查询请求,将所述智能合约响应于所述模式信息查询请求返回的记录于所述智能合约中的第一数据库模式信息确定为所述区块链关系型数据库对应的所述数据库模式信息。The mode information query request sending unit 404 is configured to initiate a mode information query request to the smart contract, and determine the first database mode information recorded in the smart contract returned by the smart contract in response to the mode information query request. It is the database schema information corresponding to the blockchain relational database.
可选的,所述远程证明包含于所述区块链数据请求;或者,Optionally, the remote certificate is included in the blockchain data request; or,
所述远程证明预先维护于所述区块链节点。The remote certificate is maintained in the blockchain node in advance.
可选的,所述区块链数据包括区块数据、状态数据和事件数据。Optionally, the blockchain data includes block data, status data and event data.
可选的,第一密钥由所述区块链节点对所述远程证明验证通过的情况下提供至所述节点设备部署的第一可信执行环境;或者,第一密钥预先维护于第一可信执行环境中。Optionally, the first key is provided to the first trusted execution environment deployed by the node device when the blockchain node passes the verification of the remote certificate; or, the first key is maintained in advance in the first trusted execution environment. A trusted execution environment.
可选的,还包括:Optional, also includes:
数据分析请求接收单元405,用于接收所述分析需求方发送的数据分析请求;The data analysis request receiving unit 405 is used to receive the data analysis request sent by the analysis requester;
分析结果返回单元406,用于将所述区块链关系型数据库中维护的所述数据分析请求对应的至少一个密文标准数据读入第一可信执行环境,通过第二密钥将所述至少一个密文标准数据分别解密为至少一个标准数据,将基于所述数据分析请求对所述至少一个标准数据进行分析得到的分析结果返回所述分析需求方。The analysis result return unit 406 is configured to read at least one ciphertext standard data corresponding to the data analysis request maintained in the blockchain relational database into the first trusted execution environment, and use the second key to return the ciphertext standard data to the first trusted execution environment. At least one ciphertext standard data is respectively decrypted into at least one standard data, and the analysis result obtained by analyzing the at least one standard data based on the data analysis request is returned to the analysis requester.
可选的,所述分析结果返回单元406进一步用于:Optionally, the analysis result return unit 406 is further used to:
在确定所述分析需求方属于所述数据分析服务的合法用户的情况下,将所述区块链关系型数据库中维护的所述数据分析请求对应的所述至少一个密文标准数据读入第一可信执行环境。When it is determined that the analysis requester is a legitimate user of the data analysis service, the at least one ciphertext standard data corresponding to the data analysis request maintained in the blockchain relational database is read into the third A trusted execution environment.
可选的,所述合法用户对应的第一用户列表密文维护在所述区块链关系型数据库中,第一用户列表密文由所述节点设备在第一可信执行环境中通过第二密钥对第一用户列表进行加密后得到,第一用户列表由所述节点设备在第一可信执行环境中通过第一密钥对第二用户列表密文进行解密并基于所述数据库模式信息进行转换后得到,其中,第二用户列表密文由所述区块链节点部署的用户授权合约维护在所述区块链非关系型数据库中。Optionally, the first user list ciphertext corresponding to the legal user is maintained in the blockchain relational database, and the first user list ciphertext is passed by the node device in the first trusted execution environment through the second The first user list is obtained by encrypting the first user list with the key. The first user list is decrypted by the node device in the first trusted execution environment using the first key to decrypt the second user list ciphertext and based on the database schema information. Obtained after conversion, wherein the second user list ciphertext is maintained in the blockchain non-relational database by the user authorization contract deployed by the blockchain node.
在20世纪90年代,对于一个技术的改进可以很明显地区分是硬件上的改进(例如,对二极管、晶体管、开关等电路结构的改进)还是软件上的改进(对于方法流程的改进)。然而,随着技术的发展,当今的很多方法流程的改进已经可以视为硬件电路结构的直接改进。设计人员几乎都通过将改进的方法流程编程到硬件电路中来得到相应的硬件电路结构。因此,不能说一个方法流程的改进就不能用硬件实体模块来实现。例如,可编程逻辑器件(Programmable Logic Device,PLD)(例如现场可编程门阵列(Field Programmable Gate Array,FPGA))就是这样一种集成电路,其逻辑功能由用户对器件编程来确定。由设计人员自行编程来把一个数字系统“集成”在一片PLD上,而不需要请芯片制造厂商来设计和制作专用的集成电路芯片。而且,如今,取代手工地制作集成电路芯片,这种编程也多半改用“逻辑编译器(logic compiler)”软件来实现,它与程序开发撰写时所用的软件编译器相类似,而要编译之前的原始代码也得用特定的编程语言来撰写,此称之为硬件描述语言(Hardware Description Language,HDL),而HDL也并非仅有一种,而是有许多种,如ABEL(Advanced Boolean Expression Language)、AHDL(Altera Hardware Description Language)、Confluence、CUPL(Cornell University Programming Language)、HDCal、JHDL(Java Hardware Description Language)、Lava、Lola、MyHDL、PALASM、RHDL(Ruby Hardware Description Language)等,目前最普遍使用的是VHDL(Very-High-Speed Integrated Circuit Hardware Description Language)与Verilog。本领域技术人员也应该清楚,只需要将方法流程用上述几种硬件描述语言稍作逻辑编程并编程到集成电路中,就可以很容易得到实现该逻辑方法流程的硬件电路。In the 1990s, improvements in a technology could be clearly distinguished as hardware improvements (for example, improvements in circuit structures such as diodes, transistors, switches, etc.) or software improvements (improvements in method processes). However, with the development of technology, many improvements in today's method processes can be regarded as direct improvements in hardware circuit structures. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement of a method flow cannot be implemented using hardware entity modules. For example, a Programmable Logic Device (PLD) (such as a Field Programmable Gate Array (FPGA)) is such an integrated circuit whose logic functions are determined by the user programming the device. Designers can program themselves to "integrate" a digital system on a PLD, instead of asking chip manufacturers to design and produce dedicated integrated circuit chips. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented using "logic compiler" software, which is similar to the software compiler used in program development and writing, and before compilation The original code must also be written in a specific programming language, which is called Hardware Description Language (HDL), and HDL is not just one kind, but there are many, such as ABEL (Advanced Boolean Expression Language) , AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc., are currently the most commonly used The two are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that by simply logically programming the method flow using the above-mentioned hardware description languages and programming it into the integrated circuit, the hardware circuit that implements the logical method flow can be easily obtained.
控制器可以按任何适当的方式实现,例如,控制器可以采取例如微处理器或处理器以及存储可由该(微)处理器执行的计算机可读程序代码(例如软件或固件)的计算机可读介质、逻辑门、开关、专用集成电路(Application Specific Integrated Circuit,ASIC)、可编程逻辑控制器和嵌入微控制器的形式,控制器的例子包括但不限于以下微控制器:ARC 625D、Atmel AT91SAM、Microchip PIC18F26K20以及Silicone Labs C8051F320,存储器控制器还可以被实现为存储器的控制逻辑的一部分。本领域技术人员也知道,除了以纯计算机可读程序代码方式实现控制器以外,完全可以通过将方法步骤进行逻辑编程来使得控制器以逻辑门、开关、专用集成电路、可编程逻辑控制器和嵌入微控制器等的形式来实现相同功能。因此这种控制器可以被认为是一种硬件部件,而对其内包括的用于实现各种功能的装置也可以视为硬件部件内的结构。或者甚至,可以将用于实现各种功能的装置视为既可以是实现方法的软件模块又可以是硬件部件内的结构。The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer readable medium storing computer readable program code (eg, software or firmware) executable by the (micro)processor. , logic gates, switches, Application Specific Integrated Circuit (ASIC), programmable logic controllers and embedded microcontrollers. Examples of controllers include but are not limited to the following microcontrollers: ARC 625D, Atmel AT91SAM, For Microchip PIC18F26K20 and Silicone Labs C8051F320, the memory controller can also be implemented as part of the memory's control logic. Those skilled in the art also know that in addition to implementing the controller in the form of pure computer-readable program code, the controller can be completely programmed with logic gates, switches, application-specific integrated circuits, programmable logic controllers and embedded logic by logically programming the method steps. Microcontroller, etc. to achieve the same function. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be considered as structures within the hardware component. Or even, the means for implementing various functions can be considered as structures within hardware components as well as software modules implementing the methods.
上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为服务器系统。当然,本发明不排除随着未来计算机技术的发展,实现上述实施例功能的计算机例如可以为个人计算机、膝上型计算机、车载人机交互设备、蜂窝电 话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任何设备的组合。The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a server system. Of course, the present invention does not exclude that with the development of computer technology in the future, the computer that implements the functions of the above embodiments may be, for example, a personal computer, a laptop computer, a vehicle-mounted human-computer interaction device, a cellular phone, a camera phone, a smart phone, or a personal digital assistant. , media player, navigation device, email device, game console, tablet, wearable device, or a combination of any of these devices.
虽然本说明书一个或多个实施例提供了如实施例或流程图所述的方法操作步骤,但基于常规或者无创造性的手段可以包括更多或者更少的操作步骤。实施例中列举的步骤顺序仅仅为众多步骤执行顺序中的一种方式,不代表唯一的执行顺序。在实际中的装置或终端产品执行时,可以按照实施例或者附图所示的方法顺序执行或者并行执行(例如并行处理器或者多线程处理的环境,甚至为分布式数据处理环境)。术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、产品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、产品或者设备所固有的要素。在没有更多限制的情况下,并不排除在包括所述要素的过程、方法、产品或者设备中还存在另外的相同或等同要素。例如若使用到第一,第二等词语用来表示名称,而并不表示任何特定的顺序。Although one or more embodiments of this specification provide method operation steps as described in the embodiments or flow charts, more or fewer operation steps may be included based on conventional or non-inventive means. The sequence of steps listed in the embodiment is only one way of executing the sequence of many steps, and does not represent the only execution sequence. When the actual device or terminal product is executed, it may be executed sequentially or in parallel according to the methods shown in the embodiments or figures (for example, a parallel processor or a multi-thread processing environment, or even a distributed data processing environment). The terms "comprises," "comprises" or any other variation thereof are intended to cover a non-exclusive inclusion such that a process, method, product or apparatus including a list of elements includes not only those elements but also others not expressly listed elements, or also elements inherent to the process, method, product or equipment. Without further limitation, it does not exclude the presence of additional identical or equivalent elements in a process, method, product or apparatus including the stated elements. For example, if the words "first" and "second" are used to express names, they do not indicate any specific order.
为了描述的方便,描述以上装置时以功能分为各种模块分别描述。当然,在实施本说明书一个或多个时可以把各模块的功能在同一个或多个软件和/或硬件中实现,也可以将实现同一功能的模块由多个子模块或子单元的组合实现等。以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。For the convenience of description, when describing the above device, the functions are divided into various modules and described separately. Of course, when implementing one or more of this specification, the functions of each module can be implemented in the same or multiple software and/or hardware, or the modules that implement the same function can be implemented by a combination of multiple sub-modules or sub-units, etc. . The device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated. to another system, or some features can be ignored, or not implemented. On the other hand, the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, and the indirect coupling or communication connection of the devices or units may be in electrical, mechanical or other forms.
本发明是参照根据本发明实施例的方法、装置(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each process and/or block in the flowchart illustrations and/or block diagrams, and combinations of processes and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine, such that the instructions executed by the processor of the computer or other programmable data processing device produce a use A device for realizing the functions specified in one process or multiple processes of the flowchart and/or one block or multiple blocks of the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory that causes a computer or other programmable data processing apparatus to operate in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction means, the instructions The device implements the functions specified in a process or processes of the flowchart and/or a block or blocks of the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions may also be loaded onto a computer or other programmable data processing device, causing a series of operating steps to be performed on the computer or other programmable device to produce computer-implemented processing, thereby executing on the computer or other programmable device. Instructions provide steps for implementing the functions specified in a process or processes of a flowchart diagram and/or a block or blocks of a block diagram.
在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。Memory may include non-permanent storage in computer-readable media, random access memory (RAM) and/or non-volatile memory in the form of read-only memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储、石墨烯存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。Computer-readable media includes both persistent and non-volatile, removable and non-removable media that can be implemented by any method or technology for storage of information. Information may be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), and read-only memory. (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, Magnetic tape, magnetic tape storage, graphene storage or other magnetic storage devices or any other non-transmission medium can be used to store information that can be accessed by a computing device. As defined in this article, computer-readable media does not include transitory media, such as modulated data signals and carrier waves.
本领域技术人员应明白,本说明书一个或多个实施例可提供为方法、系统或计算机程序产品。因此,本说明书一个或多个实施例可采用完全硬件实施例、完全软件实施例或结合软件和硬件方面的实施例的形式。而且,本说明书一个或多个实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机 可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。It should be understood by those skilled in the art that one or more embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, one or more embodiments of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment that combines software and hardware aspects. Furthermore, one or more embodiments of the present description may employ a computer program implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein. Product form.
本说明书一个或多个实施例可以在由计算机执行的计算机可执行指令的一般上下文中描述,例如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型的例程、程序、对象、组件、数据结构等等。也可以在分布式计算环境中实践本本说明书一个或多个实施例,在这些分布式计算环境中,由通过通信网络而被连接的远程处理设备来执行任务。在分布式计算环境中,程序模块可以位于包括存储设备在内的本地和远程计算机存储介质中。One or more embodiments of this specification may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. One or more embodiments of the present description may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including storage devices.
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本说明书的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不必须针对的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任一个或多个实施例或示例中以合适的方式结合。此外,在不相互矛盾的情况下,本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。Each embodiment in this specification is described in a progressive manner. The same and similar parts between the various embodiments can be referred to each other. Each embodiment focuses on its differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple. For relevant details, please refer to the partial description of the method embodiment. In the description of this specification, reference to the terms "one embodiment," "some embodiments," "an example," "specific examples," or "some examples" or the like means that specific features are described in connection with the embodiment or example. , structures, materials or features are included in at least one embodiment or example of this specification. In this specification, the schematic expressions of the above terms are not necessarily directed to the same embodiment or example. Furthermore, the specific features, structures, materials or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, those skilled in the art may combine and combine different embodiments or examples and features of different embodiments or examples described in this specification unless they are inconsistent with each other.
以上所述仅为本说明书一个或多个实施例的实施例而已,并不用于限制本本说明书一个或多个实施例。对于本领域技术人员来说,本说明书一个或多个实施例可以有各种更改和变化。凡在本说明书的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在权利要求范围之内。The above descriptions are only examples of one or more embodiments of this specification, and are not intended to limit one or more embodiments of this specification. To those skilled in the art, various modifications and changes may be made to one or more embodiments of this specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of this specification shall be included in the scope of the claims.

Claims (13)

  1. 一种维护区块链数据的方法,应用于部署有区块链节点和第一可信执行环境的节点设备,所述节点设备维护有区块链非关系型数据库和区块链关系型数据库,所述区块链非关系型数据库用于维护密文数据,所述密文数据由所述区块链节点将在第二可信执行环境中运行区块链服务时生成的区块链数据通过第二可信执行环境对应的第一密钥加密得到;所述方法包括:A method for maintaining blockchain data, applied to a node device deployed with a blockchain node and a first trusted execution environment, the node device maintaining a blockchain non-relational database and a blockchain relational database, The blockchain non-relational database is used to maintain ciphertext data. The ciphertext data is passed by the blockchain node through the blockchain data generated when running the blockchain service in the second trusted execution environment. The first key corresponding to the second trusted execution environment is encrypted and obtained; the method includes:
    在所述区块链节点对第一可信执行环境对应的远程证明验证通过的情况下,获取所述区块链非关系型数据库中维护的所述密文数据;If the blockchain node passes the remote certification verification corresponding to the first trusted execution environment, obtain the ciphertext data maintained in the blockchain non-relational database;
    在第一可信执行环境中,通过第一密钥将所述密文数据解密为所述区块链数据,并将所述区块链数据转换为所述区块链关系型数据库对应的数据库模式信息定义的标准数据,以及,通过第一可信执行环境对应的第二密钥将所述标准数据加密为密文标准数据;In the first trusted execution environment, the ciphertext data is decrypted into the blockchain data through the first key, and the blockchain data is converted into a database corresponding to the blockchain relational database. The standard data defined by the mode information, and encrypting the standard data into ciphertext standard data through the second key corresponding to the first trusted execution environment;
    将所述密文标准数据维护在所述区块链关系型数据库中,所述区块链关系型数据库用于向分析需求方提供运行在第一可信执行环境中的数据分析服务。The ciphertext standard data is maintained in the blockchain relational database, and the blockchain relational database is used to provide data analysis services running in the first trusted execution environment to the analysis requester.
  2. 根据权利要求1所述的方法,所述获取所述区块链非关系型数据库中维护的所述密文数据,包括:According to the method of claim 1, obtaining the ciphertext data maintained in the blockchain non-relational database includes:
    接收所述区块链节点主动推送的所述密文数据;和/或,Receive the ciphertext data actively pushed by the blockchain node; and/or,
    向所述区块链节点发送区块链数据请求,接收所述区块链节点响应于所述区块链数据请求返回的所述密文数据。Send a blockchain data request to the blockchain node, and receive the ciphertext data returned by the blockchain node in response to the blockchain data request.
  3. 根据权利要求2所述的方法,所述向所述区块链节点发送区块链数据请求,包括:The method according to claim 2, said sending a blockchain data request to the blockchain node includes:
    向所述区块链节点部署的智能合约发起针对所述智能合约维护在所述区块链非关系型数据库中的所述密文数据的所述区块链数据请求;或者,Initiate the blockchain data request for the ciphertext data maintained in the blockchain non-relational database by the smart contract to the smart contract deployed by the blockchain node; or,
    向所述区块链节点发起针对所述区块链非关系型数据库中维护的所述密文数据的所述区块链数据请求。Initiating the blockchain data request for the ciphertext data maintained in the blockchain non-relational database to the blockchain node.
  4. 根据权利要求3所述的方法,在所述区块链数据请求针对于所述智能合约维护在所述区块链非关系型数据库中的所述密文数据的情况下,所述方法还包括:The method according to claim 3, in the case where the blockchain data request is for the ciphertext data maintained in the blockchain non-relational database by the smart contract, the method further includes :
    向所述智能合约发起模式信息查询请求,将所述智能合约响应于所述模式信息查询请求返回的记录于所述智能合约中的第一数据库模式信息确定为所述区块链关系型数据库对应的所述数据库模式信息。Initiate a schema information query request to the smart contract, and determine the first database schema information recorded in the smart contract returned by the smart contract in response to the schema information query request as corresponding to the blockchain relational database The database schema information.
  5. 根据权利要求2所述的方法,所述远程证明包含于所述区块链数据请求;或者,The method of claim 2, wherein the remote certificate is included in the blockchain data request; or,
    所述远程证明预先维护于所述区块链节点。The remote certificate is maintained in the blockchain node in advance.
  6. 根据权利要求1所述的方法,所述区块链数据包括区块数据、状态数据和事件数据。According to the method of claim 1, the blockchain data includes block data, status data and event data.
  7. 根据权利要求1所述的方法,第一密钥由所述区块链节点对所述远程证明验证通过的情况下提供至所述节点设备部署的第一可信执行环境;或者,第一密钥预先维护于第一可信执行环境中。According to the method of claim 1, the first key is provided by the blockchain node to the first trusted execution environment deployed by the node device when the remote certificate verification is passed; or, the first key The key is maintained in the first trusted execution environment in advance.
  8. 根据权利要求1所述的方法,还包括:The method of claim 1, further comprising:
    接收所述分析需求方发送的数据分析请求;Receive the data analysis request sent by the analysis requester;
    将所述区块链关系型数据库中维护的所述数据分析请求对应的至少一个密文标准数据读入第一可信执行环境,通过第二密钥将所述至少一个密文标准数据分别解密为至少一个标准数据,将基于所述数 据分析请求对所述至少一个标准数据进行分析得到的分析结果返回所述分析需求方。Reading at least one ciphertext standard data corresponding to the data analysis request maintained in the blockchain relational database into the first trusted execution environment, and decrypting the at least one ciphertext standard data respectively using the second key For at least one standard data, the analysis result obtained by analyzing the at least one standard data based on the data analysis request is returned to the analysis requester.
  9. 根据权利要求8所述的方法,所述将所述区块链关系型数据库中维护的所述数据分析请求对应的至少一个密文标准数据读入第一可信执行环境,包括:The method according to claim 8, wherein reading at least one ciphertext standard data corresponding to the data analysis request maintained in the blockchain relational database into the first trusted execution environment includes:
    在确定所述分析需求方属于所述数据分析服务的合法用户的情况下,将所述区块链关系型数据库中维护的所述数据分析请求对应的所述至少一个密文标准数据读入第一可信执行环境。When it is determined that the analysis requester is a legitimate user of the data analysis service, the at least one ciphertext standard data corresponding to the data analysis request maintained in the blockchain relational database is read into the third A trusted execution environment.
  10. 根据权利要求9所述的方法,所述合法用户对应的第一用户列表密文维护在所述区块链关系型数据库中,第一用户列表密文由所述节点设备在第一可信执行环境中通过第二密钥对第一用户列表进行加密后得到,第一用户列表由所述节点设备在第一可信执行环境中通过第一密钥对第二用户列表密文进行解密并基于所述数据库模式信息进行转换后得到,其中,第二用户列表密文由所述区块链节点部署的用户授权合约维护在所述区块链非关系型数据库中。According to the method of claim 9, the first user list ciphertext corresponding to the legal user is maintained in the blockchain relational database, and the first user list ciphertext is executed by the node device in the first trusted The first user list is obtained by encrypting the first user list with the second key in the environment. The first user list is decrypted by the node device in the first trusted execution environment with the first key and the second user list ciphertext is decrypted based on The database schema information is obtained after conversion, wherein the second user list ciphertext is maintained in the blockchain non-relational database by the user authorization contract deployed by the blockchain node.
  11. 一种维护区块链数据的装置,应用于部署有区块链节点和第一可信执行环境的节点设备,所述节点设备维护有区块链非关系型数据库和区块链关系型数据库,所述区块链非关系型数据库用于维护密文数据,所述密文数据由所述区块链节点将在第二可信执行环境中运行区块链服务时生成的区块链数据通过第二可信执行环境对应的第一密钥加密得到;所述装置包括:A device for maintaining blockchain data, applied to node equipment deployed with blockchain nodes and a first trusted execution environment, the node equipment maintaining a blockchain non-relational database and a blockchain relational database, The blockchain non-relational database is used to maintain ciphertext data. The ciphertext data is passed by the blockchain node through the blockchain data generated when running the blockchain service in the second trusted execution environment. The first key corresponding to the second trusted execution environment is encrypted and obtained; the device includes:
    区块链数据获取单元,用于在所述区块链节点对第一可信执行环境对应的远程证明验证通过的情况下,获取所述区块链非关系型数据库中维护的所述密文数据;A blockchain data acquisition unit configured to acquire the ciphertext maintained in the blockchain non-relational database when the blockchain node passes the remote certification verification corresponding to the first trusted execution environment. data;
    区块链数据获取单元,用于在第一可信执行环境中,通过第一密钥将所述密文数据解密为所述区块链数据,并将所述区块链数据转换为所述区块链关系型数据库对应的数据库模式信息定义的标准数据,以及,通过第一可信执行环境对应的第二密钥将所述标准数据加密为密文标准数据;A blockchain data acquisition unit, configured to decrypt the ciphertext data into the blockchain data through the first key in the first trusted execution environment, and convert the blockchain data into the blockchain data. Standard data defined by the database schema information corresponding to the blockchain relational database, and encrypting the standard data into ciphertext standard data through the second key corresponding to the first trusted execution environment;
    标准数据维护单元,用于将所述密文标准数据维护在所述区块链关系型数据库中,所述区块链关系型数据库用于向分析需求方提供运行在第一可信执行环境中的数据分析服务。A standard data maintenance unit, used to maintain the ciphertext standard data in the blockchain relational database, and the blockchain relational database is used to provide the analysis requester with information running in the first trusted execution environment. data analysis services.
  12. 一种电子设备,包括:An electronic device including:
    处理器;processor;
    用于存储处理器可执行指令的存储器;Memory used to store instructions executable by the processor;
    其中,所述处理器通过运行所述可执行指令以实现如权利要求1-10中任一项所述的方法。Wherein, the processor implements the method according to any one of claims 1-10 by running the executable instructions.
  13. 一种计算机可读存储介质,其上存储有计算机指令,该指令被处理器执行时实现如权利要求1-10中任一项所述方法的步骤。A computer-readable storage medium having computer instructions stored thereon, which when executed by a processor, implements the steps of the method according to any one of claims 1-10.
PCT/CN2022/135413 2022-06-29 2022-11-30 Method and apparatus for maintaining blockchain data, and electronic device and storage medium WO2024001028A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210761451.1 2022-06-29
CN202210761451.1A CN115129785A (en) 2022-06-29 2022-06-29 Method and device for maintaining block chain data, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2024001028A1 true WO2024001028A1 (en) 2024-01-04

Family

ID=83381667

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/135413 WO2024001028A1 (en) 2022-06-29 2022-11-30 Method and apparatus for maintaining blockchain data, and electronic device and storage medium

Country Status (2)

Country Link
CN (1) CN115129785A (en)
WO (1) WO2024001028A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115129785A (en) * 2022-06-29 2022-09-30 蚂蚁区块链科技(上海)有限公司 Method and device for maintaining block chain data, electronic equipment and storage medium
CN115344647A (en) * 2022-10-20 2022-11-15 中国信息通信研究院 Block chain data processing method, device, equipment and medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110880972A (en) * 2019-11-26 2020-03-13 复旦大学 Block chain key management system based on safe multiparty calculation
US20200134209A1 (en) * 2018-10-31 2020-04-30 Alibaba Group Holding Limited Method, apparatus, and electronic device for blockchain-based recordkeeping
CN111899017A (en) * 2019-01-31 2020-11-06 创新先进技术有限公司 Method, node and storage medium for realizing privacy protection in block chain
CN113742370A (en) * 2021-11-02 2021-12-03 阿里云计算有限公司 Data query method and statistical information ciphertext generation method of full-encryption database
CN115129785A (en) * 2022-06-29 2022-09-30 蚂蚁区块链科技(上海)有限公司 Method and device for maintaining block chain data, electronic equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200134209A1 (en) * 2018-10-31 2020-04-30 Alibaba Group Holding Limited Method, apparatus, and electronic device for blockchain-based recordkeeping
CN111899017A (en) * 2019-01-31 2020-11-06 创新先进技术有限公司 Method, node and storage medium for realizing privacy protection in block chain
CN110880972A (en) * 2019-11-26 2020-03-13 复旦大学 Block chain key management system based on safe multiparty calculation
CN113742370A (en) * 2021-11-02 2021-12-03 阿里云计算有限公司 Data query method and statistical information ciphertext generation method of full-encryption database
CN115129785A (en) * 2022-06-29 2022-09-30 蚂蚁区块链科技(上海)有限公司 Method and device for maintaining block chain data, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN115129785A (en) 2022-09-30

Similar Documents

Publication Publication Date Title
WO2024001028A1 (en) Method and apparatus for maintaining blockchain data, and electronic device and storage medium
US10474835B2 (en) Zero-knowledge databases
CN109614823B (en) Data processing method, device and equipment
CN106127075B (en) Encryption method can search for based on secret protection under a kind of cloud storage environment
US10541983B1 (en) Secure storage and searching of information maintained on search systems
US20190173859A1 (en) Systems and methods for implementing modular digital encryption key management solutions
US20230014599A1 (en) Data processing method and apparatus for blockchain system
US11546348B2 (en) Data service system
CN111540449B (en) Electronic medical record sharing method based on blockchain, electronic medical record interface and system
US8769302B2 (en) Encrypting data and characterization data that describes valid contents of a column
CN111737720B (en) Data processing method and device and electronic equipment
US11368441B2 (en) Method and system for general data protection compliance via blockchain
CN112307501B (en) Big data system based on block chain technology, storage method and using method
CN115618321A (en) Access control method and device, electronic equipment and storage medium
WO2024001029A1 (en) Method and apparatus for maintaining blockchain data, electronic device, and storage medium
CN112788151B (en) Method, device and system for data synchronization
US11410173B1 (en) Tokenization web services
WO2024001039A1 (en) Method and apparatus for maintaining blockchain data, electronic device, and storage medium
CN112181983A (en) Data processing method, device, equipment and medium
CN109063061B (en) Cross-distributed system data processing method, device, equipment and storage medium
CN112446035A (en) Data management method and device
Pleskach et al. Mechanisms for Encrypting Big Unstructured Data: Technical and Legal Aspects
WO2024087313A1 (en) Database access method and apparatus
Yan et al. Research on database encryption technology of industrial network monitoring system
Hasija et al. Compression & Security in MongoDB without affecting Efficiency

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22949108

Country of ref document: EP

Kind code of ref document: A1