Block chain platform system based on relational database

By reorganizing the block and transaction data of the blockchain platform to MySQL, and integrated the SQL function to the chain code, the problem that the existing blockchain platform cannot support complex relationship query, and realized more flexible and efficient data query functions Essence

CN119377324APending Publication Date: 2025-01-28WUXI URBAN BLOCKCHAIN ADVANCED RES CENT
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411591656.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-08
Publication Date
2025-01-28

AI Technical Summary

Technical Problem

The existing blockchain platform mainly relies on NoSQL-type databases and cannot support complex relationship queries, resulting in the inability to meet the needs of data queries in application scenarios such as financial services and supply chain management.

Method used

The blockchain platform system based on a relational database is reorganized to MySQL to provide customized query interfaces, integrated SQL functions to chain code, and supports user custom data tables.

Benefits of technology

It enriches the query function of the blockchain platform, allows users to improve the flexibility and efficiency of query based on more attributes and conditional indexes and query block and transaction data, and meet the data query requirements of complex application scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119377324A_ABST
    Figure CN119377324A_ABST
Patent Text Reader

Abstract

The invention discloses a block chain platform system based on a relational database. The system comprises a block chain module for defining a block structure; system query chain codes are built in the chain code module, the chain code module is used for conducting complex retrieval query on blocks and transactions, user-defined data table chain codes are built in the chain code module, and the function of creating and operating a user-defined data table is provided; the database module is used for storing blocks and transaction information on the basis of a relational database MySQL, and comprises system tables such as a BlockTable and a Transaction Table, and a user-defined data table; and the monitoring and oracle module is used for monitoring the event in the chain code, analyzing the content of the historical block after the event is monitored, and calling a method in the chain code to insert data in batches. According to the method, the block and the transaction data are recombined to the MySql, so that the query function of the platform is enriched, and the query limitation that the original query only depends on the block ID, the transaction number and the transaction Hash is exceeded. Meanwhile, a customized query interface is provided, so that a user can build a data table on a chain by himself / herself.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of blockchain, and more specifically, particularly relates to a blockchain platform system based on a relational database. Background Art

[0002] Blockchain is a decentralized distributed ledger that is chain-stored, tamper-proof, secure and reliable. Currently, the mainstream blockchain platforms BitCoin, Ethereum, and Hyperledger Fabric only support NoSql databases for Key-Value storage. The query function for on-chain data is relatively simple, and it cannot support complex relationship queries. The on-chain index query is also relatively simple. For example, it can only query blocks and transaction information based on transaction hashes, block numbers, and block IDs. Blockchain has broad application prospects in traditional financial services, supply chain management services and other industries, but these application scenarios often require complex query functions, and the current blockchain query function is far from supporting these scenarios.

[0003] However, there are some problems with the existing technology: the current mainstream blockchain platform mainly relies on NoSQL databases. Although this storage method is suitable for the basic characteristics of blockchain, it has obvious limitations in data query. Specifically, the platform can only provide simple query functions based on transaction hash, block number and block ID, and cannot support complex relational queries. Therefore, we propose a blockchain platform system based on relational database. Summary of the invention

[0004] In view of the problems existing in the prior art, the purpose of the present invention is to provide a blockchain platform system based on a relational database. By reorganizing the block and transaction data into MySql, the query function of the platform is enriched, which goes beyond the query limitation of the original one that only relies on the block ID, transaction number, and transaction hash. At the same time, a customized query interface is provided to allow users to build their own on-chain data tables. In addition, the SQL function is integrated into the chain code, which is more suitable for the needs of scenarios such as finance and supply chain.

[0005] To achieve the above objectives, the present invention provides the following technical solutions: a blockchain platform system based on a relational database, comprising:

[0006] Blockchain module: defines the block structure, and the blockchain module includes a block header, a block body, and metadata;

[0007] Chaincode module: built-in system query chaincode, used for complex search and query of blocks and transactions, built-in user-defined data table chaincode, providing the function of creating and operating custom data tables;

[0008] Database module: Based on the relational database MySQL, it stores block and transaction information, including system tables such as Block_Table and Transaction_Table, as well as user-defined data tables;

[0009] Listener and oracle module: listen to events in the chain code, parse the historical block content after listening to the events, and call the methods in the chain code to insert data in batches;

[0010] Interface module: provides a SQL-based smart contract development interface and supports the creation of custom application business status data storage tables;

[0011] Verification module: used to verify SQL statements in the read-write set when the endorsement node simulates the execution of transactions;

[0012] Node module: includes endorsement nodes, which are used to simulate transactions and generate read-write sets, and submission nodes, which are used to verify read-write sets, execute SQL statements, and submit transactions to the blockchain.

[0013] Optionally, the block header in the blockchain module includes basic information and metadata in the block, such as timestamp, block hash function Hash, hash function Hash of the previous block, etc.

[0014] The block body Data: contains all transaction information, including the read-write set and signature of the operation;

[0015] The metadata MetaData: contains additional information related to the current block, such as block size, creator, etc.

[0016] Optionally, the blockchain module is specifically:

[0017] The block data in the blockchain module is organized and stored in the relational database MySql.

[0018] The block header and metadata information are stored in the Block_Table system table;

[0019] The data stored in the Block_Table system table is the block height, including: current block Hash, previous block Hash, transaction data Hash, block configuration information, block creator, block signature, etc.

[0020] The transaction information in the block body is stored in the Transaction_Table system table;

[0021] The data stored in the Transaction_Table system table include transaction number, transaction hash, transaction signature verification, transaction read / write set, transaction verification result and other information.

[0022] Optionally, the system query chaincode is used to perform complex search queries on the Block_Table system table and the Transaction_Table system table, such as querying blocks based on timestamps, querying transactions based on creators, etc.

[0023] The custom data chain code table is used to provide custom query retrieval requirements;

[0024] The custom chain code table has a built-in storage table and array string;

[0025] The storage table contains information of a user-defined table and a table name of a user-defined data table;

[0026] The array string contains the SQL statement for creating the table and all the table field names.

[0027] Optionally, the main contract methods of the custom data chain code include:

[0028] 1) Create a user-defined data table;

[0029] 2)Insert user-defined data table data;

[0030] 3) Query user-defined table names and field names.

[0031] Optionally, the monitoring and oracle module is specifically:

[0032] 1) Detect that an event in the chaincode is triggered, such as creating a custom data table;

[0033] 2) Obtain events and signal the oracle to provide services;

[0034] 3) The oracle receives the signal and parses the historical block content to obtain relevant data;

[0035] 4) The oracle calls the method in the chain code to insert data in batches into the user-defined data table.

[0036] Optionally, the smart contract development interface includes a Create interface, a Drop interface, an Insert interface, an Update interface, a Delete interface and a Query interface;

[0037] The Create interface is used to create a new custom chain code table, specifically:

[0038] Call the custom chain code to create an application business status data storage table. The chain code contains a contract method, which includes: creating a status data table with table name tableName and creating table statement sqlStatement, etc.

[0039] The contract method is specifically as follows: when the endorsement node simulates and verifies the execution of the read-write set, it queries whether the table already exists in the relational database MySQL. If the table already exists, the execution of the transaction is rejected;

[0040] When the block transaction verification is submitted, the submitting node executes the create table statement in the relational database MySQL, and at the same time, stores the newly created table name and statement in the system table.

[0041] Optionally, the Drop interface is used to delete a system table, specifically:

[0042] The endorsement node determines whether the table has been deleted during the read-write set verification, and verifies whether there is any interaction with the table in the same batch of transactions. If there is an interaction between a table and the table, the transaction execution fails;

[0043] When the commit node is executed in the relational database MySQL, the statement is directly executed in the relational database MySQL, and the field of the row where the table name is located is set to 1, indicating that the table has been deleted;

[0044] The Insert interface is used to add data to the data table, specifically:

[0045] The endorsement node cannot directly perform the insert operation when the read-write set is being verified. First, the primary key of the inserted data is queried. If it exists, the transaction fails; if it does not exist, an Insert SQL statement is returned; finally, it is synchronized to the submission node. After the submission node verifies the read-write set, the insertion operation is directly performed in the relational database MySQL.

[0046] Optionally, the Update interface is used to modify records in a data table, specifically:

[0047] When verifying the read-write set, the endorsement node determines whether the record exists and whether the record is used by subsequent transactions. If the record is used by subsequent transactions, the execution fails. If the record is not used, the read set contains an SQL statement to query the data record, and the write set contains a statement to update the record.

[0048] The commit node first saves the changed record to the history system table. The main fields in the table are BlockHeight, TransactionNumber, OriginTableName, and the original table name. The JSON string DataJson of the original table data record is saved in the history system table, and then the data of the original table is modified.

[0049] The Delete interface is used to delete records in the data table, specifically:

[0050] When verifying the read-write set, the endorsement node determines whether the record exists and whether the record is used by subsequent transactions. If the record is used by subsequent transactions, the execution fails.

[0051] If it is not used, the endorsement node read set contains an SQL statement for querying the data record, and the write set contains an SQL statement for deleting the record;

[0052] The submit node first saves the deleted record to the history system table, and finally deletes the original record.

[0053] Optionally, the Query interface is used to query records in a data table, specifically:

[0054] Based on user needs, enter SQL query statements in the chain code to query the data in the relational database MySQL; the Query interface allows traceability queries to be performed directly in the chain code through SQL, where the application business data on the historical status database is stored in the DataJson field in JSON format, and the relational database MySQL supports query processing of JSON field data.

[0055] Technical effects and advantages of the present invention: Compared with the traditional Fabric query method, the present invention firstly greatly enriches the query function. The new storage structure allows users to index and query blocks and transaction data according to more attributes and conditions, which not only improves the flexibility of the query, but also significantly improves the data retrieval efficiency, allowing users to obtain the required information more quickly;

[0056] Secondly, it provides a chaincode interface to support customized query of block and transaction attributes, giving users great autonomy. They can create unique on-chain query data tables according to their own needs, thereby meeting the data query requirements in specific application scenarios, which not only enhances the scalability of the system, but also improves the user's query experience. The SQL function is integrated into the chaincode to further expand the query capability of the chaincode, allowing the chaincode to interact with relational databases more conveniently, realizing the diversification and complexity of data queries.

[0057] Further features and advantages of the present invention will become apparent from the following detailed description of exemplary embodiments of the present invention with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] Figure 1 It is a schematic diagram of the system layered architecture provided by the present invention;

[0059] Figure 2 This is a schematic diagram of the blockchain transaction process analysis provided by the present invention;

[0060] Figure 3 It is a schematic diagram of the chain code and data interaction process provided by the present invention. DETAILED DESCRIPTION

[0061] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention is further described in detail below in conjunction with specific embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0062] like Figures 1 to 3 As shown, a blockchain platform system based on a relational database provided by an embodiment of the present invention includes:

[0063] Blockchain module: defines the block structure, and the blockchain module includes a block header, a block body, and metadata;

[0064] Chaincode module: built-in system query chaincode, used for complex search and query of blocks and transactions, built-in user-defined data table chaincode, providing the function of creating and operating custom data tables;

[0065] Database module: Based on the relational database MySQL, it stores block and transaction information, including system tables such as Block_Table and Transaction_Table, as well as user-defined data tables;

[0066] Listener and oracle module: listen to events in the chain code, parse the historical block content after listening to the events, and call the methods in the chain code to insert data in batches;

[0067] Interface module: provides a SQL-based smart contract development interface and supports the creation of custom application business status data storage tables;

[0068] Verification module: used to verify SQL statements in the read-write set when the endorsement node simulates the execution of transactions;

[0069] Node module: includes endorsement nodes, which are used to simulate transactions and generate read-write sets, and submission nodes, which are used to verify read-write sets, execute SQL statements, and submit transactions to the blockchain.

[0070] Furthermore, the system architecture of the platform is divided into application layer, contract layer, identity management layer, consensus layer, network layer, data layer and storage layer;

[0071] The application layer includes traditional applications and SDK, the contract layer includes the chain code module Docker, the identity management layer includes MSP and CA services, the consensus layer includes Kafka sorting, Raft sorting and endorsement verification, the network layer includes p2p network and gossip protocol, the data layer includes blockchain module, and the storage layer includes file system, levelDB, couchDB and MySql;

[0072] like Figure 1 From the analysis of the layered architecture and the transaction process in 2, it can be seen that the application of the present invention on Fabric implements the chain code based on MySql. Both the block data and the transaction data are stored in the MySql database, which enriches the query function of blocks and transactions. However, the overall architecture and transaction process of the fabric are not changed. The database natively supported by Hyperledger fabric is not removed, and users can choose to use it.

[0073] Furthermore, the present invention realizes comprehensive management and efficient query of block and transaction data by integrating multiple modules, bringing multiple benefits such as clear structure, strong complex retrieval query capability, high data storage and query efficiency, real-time data synchronization and update, low threshold for smart contract development, and strong data verification and security.

[0074] Specifically, the block header in the blockchain module contains basic information and metadata in the block, such as timestamp, block hash function Hash, hash function Hash of the previous block, etc.

[0075] The block body Data: contains all transaction information, including the read-write set and signature of the operation;

[0076] The metadata MetaData: contains additional information related to the current block, such as block size, creator, etc.

[0077] Furthermore, in the blockchain module, the block header contains basic information such as timestamp, block and previous block hash to ensure data integrity and timing; the block body records all transaction information, including read-write sets and signatures, to ensure the traceability and tamper-proofing of transactions; metadata provides additional information such as block size and creator to enhance data transparency and manageability, and improve the security, traceability and data management capabilities of the blockchain system.

[0078] Specifically, the blockchain module is:

[0079] The block data in the blockchain module is organized and stored in the relational database MySql.

[0080] The block header and metadata information are stored in the Block_Table system table;

[0081] The data stored in the Block_Table system table is the block height, including: current block Hash, previous block Hash, transaction data Hash, block configuration information, block creator, block signature, etc.

[0082] The transaction information in the block body is stored in the Transaction_Table system table;

[0083] The data stored in the Transaction_Table system table include transaction number, transaction hash, transaction signature verification, transaction read / write set, transaction verification result and other information.

[0084] Furthermore, firstly, the block data and related information are organized and stored in the relational database MySql, which not only improves the query and retrieval speed of data, but also makes data management and maintenance more convenient. By storing the block header and metadata information in the Block_Table system table, the system can efficiently track the chain relationship between blocks and ensure the integrity and consistency of the data;

[0085] Secondly, the Block_Table system table records in detail key information such as the block height, current block hash, previous block hash, transaction data hash, block configuration information, block creator, and block signature, providing strong support for block verification, tracing, and auditing, further enhancing the security and credibility of the blockchain system.

[0086] Furthermore, the Transaction_Table system table not only records basic information such as transaction number and transaction hash, but also contains key data such as transaction signature verification, transaction read / write set, and transaction verification results, making the query and verification of transaction information extremely simple and efficient, providing a solid foundation for the execution of smart contracts and the confirmation of transactions;

[0087] In summary, the blockchain module realizes efficient storage and management of data, providing a strong guarantee for the security and credibility of the blockchain system.

[0088] Specifically, the system query chaincode is used to perform complex search queries on the Block_Table system table and the Transaction_Table system table, such as querying blocks based on timestamps, querying transactions based on creators, etc.

[0089] The custom data chain code table is used to provide custom query retrieval requirements;

[0090] The custom chain code table has a built-in storage table and array string;

[0091] The storage table contains information of a user-defined table and a table name of a user-defined data table;

[0092] The array string contains the SQL statement for creating the table and all the table field names.

[0093] Furthermore, the system query chaincode can efficiently retrieve Block_Table and Transaction_Table to meet complex query requirements, such as querying blocks by timestamp, querying transactions by creator, etc. The custom data chaincode table supports user-defined queries, built-in storage tables and array strings, and can flexibly create and manage data tables and fields, improving the system's query flexibility and user customization capabilities, and enhancing the practicality and adaptability of the blockchain system.

[0094] Specifically, the main contract methods of the custom data chain code include:

[0095] 1) Create a user-defined data table;

[0096] 2)Insert user-defined data table data;

[0097] 3) Query user-defined table names and field names.

[0098] Furthermore, the core contract methods of custom data chain codes, such as creating, inserting and querying user-defined data tables, greatly enhance the flexibility and user customization capabilities of the system. Users can flexibly define data table structures according to business needs, and conveniently insert and query data, thereby meeting the needs of diverse application scenarios and enhancing the practicality and scalability of the blockchain system.

[0099] Specifically, the monitoring and oracle modules are:

[0100] 1) Detect that an event in the chaincode is triggered, such as creating a custom data table;

[0101] 2) Obtain events and signal the oracle to provide services;

[0102] 3) The oracle receives the signal and parses the historical block content to obtain relevant data;

[0103] 4) The oracle calls the method in the chain code to insert data in batches into the user-defined data table.

[0104] Furthermore, the monitoring and oracle modules can detect chaincode events in real time, such as creating custom data tables and automatically parsing historical block contents. After obtaining relevant data, they can be inserted into user-defined tables in batches by calling chaincode methods. This mechanism improves the automation and real-time nature of data processing, ensures the accuracy and integrity of data, and enhances the flexibility and responsiveness of the blockchain system.

[0105] It should be noted that due to the closed nature and security of the blockchain, it cannot directly access data from the outside world. Therefore, the oracle is a bridge connecting the blockchain and reality, used to obtain, verify and transmit data from the outside world to the blockchain.

[0106] Specifically, the smart contract development interface includes Create interface, Drop interface, Insert interface, Update interface, Delete interface and Query interface;

[0107] The Create interface is used to create a new custom chain code table, specifically:

[0108] Call the custom chain code to create an application business status data storage table. The chain code contains a contract method, which includes: creating a status data table with table name tableName and creating table statement sqlStatement, etc.

[0109] The contract method is specifically as follows: when the endorsement node simulates and verifies the execution of the read-write set, it queries whether the table already exists in the relational database MySQL. If the table already exists, the execution of the transaction is rejected;

[0110] When the block transaction verification is passed and submitted, the submitting node executes the create table statement in the relational database MySQL, and at the same time, stores the newly created table name and statement in the system table;

[0111] Furthermore, the Create interface can conveniently create an application business status data storage table by calling a custom chain code. When executing the read-write set, the endorsement node will first verify whether the table exists in MySQL to avoid duplicate creation and ensure data consistency. After the transaction verification is passed, the commit node will execute the verification and read-write set in MySQL and store the new table information in the system table. This design improves the efficiency and security of chain code table creation and enhances the data management capabilities of the blockchain system.

[0112] The Drop interface is used to delete the system table, specifically:

[0113] The endorsement node determines whether the table has been deleted during the read-write set verification, and verifies whether there is any interaction with the table in the same batch of transactions. If there is an interaction between a table and the table, the transaction execution fails;

[0114] When the commit node is executed in the relational database MySQL, the statement is directly executed in the relational database MySQL, and the field of the row where the table name is located is set to 1, indicating that the table has been deleted;

[0115] The Insert interface is used to add data to the data table, specifically:

[0116] The endorsement node cannot directly perform the insert operation when the read-write set is being verified. First, the primary key of the inserted data is queried. If it exists, the transaction fails; if it does not exist, an Insert SQL statement is returned; finally, it is synchronized to the submission node. After the submission node verifies the read-write set, the insertion operation is directly performed in the relational database MySQL.

[0117] The Update interface is used to modify records in the data table, specifically:

[0118] When verifying the read-write set, the endorsement node determines whether the record exists and whether the record is used by subsequent transactions. If the record is used by subsequent transactions, the execution fails. If the record is not used, the read set contains an SQL statement to query the data record, and the write set contains a statement to update the record.

[0119] The commit node first saves the changed record to the history system table. The main fields in the table are BlockHeight, TransactionNumber, OriginTableName, and the original table name. The JSON string DataJson of the original table data record is saved in the history system table, and then the data of the original table is modified.

[0120] The Delete interface is used to delete records in the data table, specifically:

[0121] When verifying the read-write set, the endorsement node determines whether the record exists and whether the record is used by subsequent transactions. If the record is used by subsequent transactions, the execution fails.

[0122] If it is not used, the endorsement node read set contains an SQL statement for querying the data record, and the write set contains an SQL statement for deleting the record;

[0123] The submit node first saves the deleted record to the history system table, and finally deletes the original record.

[0124] The Query interface is used to query records in the data table, specifically:

[0125] Based on user needs, enter SQL query statements in the chain code to query the data in the relational database MySQL; the Query interface allows traceability queries to be performed directly in the chain code through SQL, where the application business data on the historical status database is stored in the DataJson field in JSON format, and the relational database MySQL supports query processing of JSON field data.

[0126] Furthermore, by setting up interfaces, efficient management of data tables can be achieved. When deleting a table, the Drop interface can ensure that there is no interaction with the table in the same batch of transactions to avoid data inconsistency; when adding data, the Insert interface can first verify whether the primary key exists to avoid nodes submitting the same data multiple times and data insertion failure; when modifying or deleting records, the Update and Delete interfaces will first save the changed or deleted records to the historical system table to ensure data traceability.

[0127] Furthermore, these interfaces not only improve the efficiency and security of data operations, but also greatly enhance the flexibility and scalability of the system. In particular, the Query interface allows users to perform traceability queries directly through SQL in the chain code, making the query of application business data on the historical state database extremely simple and efficient. At the same time, the query processing support of the relational database MySQL for JSON field data further enhances the system's data query capabilities.

[0128] In summary, the embodiment of the present invention proposes to reorganize and store the block and transaction data in the relational database MySql;

[0129] Compared with the traditional Fabric query method, it first brings a great enrichment of query functions. The new storage structure allows users to index and query blocks and transaction data based on more attributes and conditions, which not only improves the flexibility of queries, but also significantly improves the efficiency of data retrieval, allowing users to obtain the required information more quickly;

[0130] Secondly, it provides a chaincode interface to support customized query of block and transaction attributes, giving users great autonomy. They can create unique on-chain query data tables according to their own needs, thereby meeting the data query requirements in specific application scenarios, which not only enhances the scalability of the system, but also improves the user's query experience. The SQL function is integrated into the chaincode to further expand the query capability of the chaincode, allowing the chaincode to interact with relational databases more conveniently, realizing the diversification and complexity of data queries.

[0131] Finally, it should be noted that the above is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for those skilled in the art to modify the technical solutions described in the aforementioned embodiments or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A blockchain platform system based on a relational database, characterized in that: include: Blockchain module: defines the block structure, and the blockchain module includes a block header, a block body, and metadata; Chaincode module: built-in system query chaincode, used for complex search and query of blocks and transactions, built-in user-defined data table chaincode, providing the function of creating and operating custom data tables; Database module: Based on the relational database MySQL, it stores block and transaction information, including system tables such as Block_Table and Transaction_Table, as well as user-defined data tables; Listener and oracle module: listen to events in the chain code, parse the historical block content after listening to the events, and call the methods in the chain code to insert data in batches; Interface module: provides a SQL-based smart contract development interface and supports the creation of custom application business status data storage tables; Verification module: used to verify SQL statements in the read-write set when the endorsement node simulates the execution of transactions; Node module: includes endorsement nodes, which are used to simulate transactions and generate read-write sets, and submission nodes, which are used to verify read-write sets, execute SQL statements, and submit transactions to the blockchain.

2. A blockchain platform system based on a relational database according to claim 1, characterized in that: The block header in the blockchain module contains basic information and metadata in the block, such as timestamp, block hash function Hash, hash function Hash of the previous block, etc. The block body Data: contains all transaction information, including the read-write set and signature of the operation; The metadata MetaData: contains additional information related to the current block, such as block size, creator, etc.

3. A blockchain platform system based on a relational database according to claim 2, characterized in that: The blockchain module is specifically: The block data in the blockchain module is organized and stored in the relational database MySql. The block header and metadata information are stored in the Block_Table system table; The data stored in the Block_Table system table is the block height, including: current block Hash, previous block Hash, transaction data Hash, block configuration information, block creator, block signature, etc. The transaction information in the block body is stored in the Transaction_Table system table; The data stored in the Transaction_Table system table include transaction number, transaction hash, transaction signature verification, transaction read / write set, transaction verification result and other information.

4. A blockchain platform system based on a relational database according to claim 1, characterized in that: The system query chaincode is used to perform complex search queries on the Block_Table system table and the Transaction_Table system table, such as querying blocks based on timestamps and querying transactions based on creators. The custom data chain code table is used to provide custom query retrieval requirements; The custom chain code table has a built-in storage table and array string; The storage table contains information of a user-defined table and a table name of a user-defined data table; The array string contains the SQL statement for creating the table and all the table field names.

5. A blockchain platform system based on a relational database according to claim 4, characterized in that: The main contract methods of the custom data chain code include: 1) Create a user-defined data table; 2)Insert user-defined data table data; 3) Query user-defined table names and field names.

6. A blockchain platform system based on a relational database according to claim 1, characterized in that: The monitoring and oracle modules are specifically: 1) Detect that an event in the chaincode is triggered, such as creating a custom data table; 2) Obtain events and signal the oracle to provide services; 3) The oracle receives the signal and parses the historical block content to obtain relevant data; 4) The oracle calls the method in the chain code to insert data in batches into the user-defined data table.

7. A blockchain platform system based on a relational database according to claim 1, characterized in that: The smart contract development interface includes Create interface, Drop interface, Insert interface, Update interface, Delete interface and Query interface; The Create interface is used to create a new custom chain code table, specifically: Call the custom chain code to create an application business status data storage table. The chain code contains a contract method, which includes: creating a status data table with table name tableName and creating table statement sqlStatement, etc. The contract method is specifically as follows: when the endorsement node simulates and verifies the execution of the read-write set, it queries whether the table already exists in the relational database MySQL. If the table already exists, the execution of the transaction is rejected; When the block transaction verification is submitted, the submitting node executes the create table statement in the relational database MySQL, and at the same time, stores the newly created table name and statement in the system table.

8. A blockchain platform system based on a relational database according to claim 7, characterized in that: The Drop interface is used to delete the system table, specifically: The endorsement node determines whether the table has been deleted during the read-write set verification, and verifies whether there is any interaction with the table in the same batch of transactions. If there is an interaction between a table and the table, the transaction execution fails; When the commit node is executed in the relational database MySQL, the statement is directly executed in the relational database MySQL, and the field of the row where the table name is located is set to 1, indicating that the table has been deleted; The Insert interface is used to add data to the data table, specifically: The endorsement node cannot directly perform the insert operation when the read-write set is being verified. First, the primary key of the inserted data is queried. If it exists, the transaction fails; if it does not exist, an Insert SQL statement is returned; finally, it is synchronized to the submission node. After the submission node verifies the read-write set, the insertion operation is directly performed in the relational database MySQL.

9. A blockchain platform system based on a relational database according to claim 7, characterized in that: The Update interface is used to modify records in the data table, specifically: When verifying the read-write set, the endorsement node determines whether the record exists and whether the record is used by subsequent transactions. If the record is used by subsequent transactions, the execution fails. If the record is not used, the read set contains an SQL statement to query the data record, and the write set contains a statement to update the record. The commit node first saves the changed record to the history system table. The main fields in the table are BlockHeight, TransactionNumber, OriginTableName, and the original table name. The JSON string DataJson of the original table data record is saved in the history system table, and then the data of the original table is modified. The Delete interface is used to delete records in the data table, specifically: When verifying the read-write set, the endorsement node determines whether the record exists and whether the record is used by subsequent transactions. If the record is used by subsequent transactions, the execution fails. If it is not used, the endorsement node read set contains an SQL statement for querying the data record, and the write set contains an SQL statement for deleting the record; The submit node first saves the deleted record to the history system table, and finally deletes the original record.

10. A blockchain platform system based on a relational database according to claim 7, characterized in that: The Query interface is used to query records in the data table, specifically: Based on user needs, enter SQL query statements in the chain code to query the data in the relational database MySQL; the Query interface allows traceability queries to be performed directly in the chain code through SQL, where the application business data on the historical status database is stored in the DataJson field in JSON format, and the relational database MySQL supports query processing of JSON field data.