Disclosure of Invention
In order to overcome the problems in the prior art, the invention provides a block chain mass data storage certificate system and a block chain mass data storage certificate method for a multi-source database.
The technical scheme adopted by the invention for solving the technical problems is as follows: a block chain mass data storage and certification system facing a multi-source database comprises a data preprocessing subsystem, a data uploading subsystem, a block chain interaction subsystem and a certificate returning subsystem, wherein the data preprocessing subsystem is responsible for screening uplink table information in the database, the data uploading subsystem is responsible for reading data in the database and pushing the data to the block chain interaction subsystem, the block chain interaction subsystem provides functions of on-chain user management, data table management and certification storage data management, and the certificate returning subsystem is responsible for returning data uplink certificates generated by a block chain to the database after the data are written into the block chain;
the block chain interaction subsystem comprises a block chain user module, a chain upper table management module and a chain upper data management module, wherein the block chain user module provides functions of block chain user registration and block chain user login, the chain upper table management module provides functions of newly building a chain upper data table, listing a chain upper data table name, inquiring chain upper data table configuration, modifying chain upper data table fields and modifying chain upper data table names, and the chain upper data management module provides functions of newly adding chain upper data, deleting chain upper data, modifying chain upper data and inquiring chain upper data.
The block chain mass data storage and certification system for the multi-source database comprises a data preprocessing subsystem and a data certification subsystem, wherein the data preprocessing subsystem comprises a database connection module and a table screening module, the database connection module is used for loading corresponding database connection drivers according to database connection information input by a user, and pushing the database connection information which can be connected to the data preprocessing subsystem and the certification back-transmission subsystem; the table screening module is used for screening a data table meeting the block chain table building standard, pushing a table name meeting the standard to the data uploading subsystem, and pushing table building information meeting the standard to the table building module of the block chain interaction subsystem.
The block chain mass data storage and verification system for the multi-source database comprises a data reading module and a data pushing module, wherein the data reading module is used for automatically reading all field names and corresponding field values of each piece of data in a table after receiving database connection information and table names meeting a table building standard; and the data pushing module is used for pushing the read data to an on-chain data management module of the block chain interaction subsystem.
When the block chain mass data storage and verification system for the multi-source database is used for performing on-chain data adding operation, the on-chain data management module can automatically record the current time, the user address of added data and the Hash value of the current data storage and verification, adds separators to three pieces of information, and splices the three pieces of information into a field value to write the field value into a data operation information field; when the on-chain data management module carries out on-chain data modification operation, the on-chain data management module can automatically judge whether a user address is consistent with a user address written in the newly added user address, if not, the data is not allowed to be modified, if so, the data is modified according to the provided table name, the primary key name and the corresponding primary key value positioning data, and according to the provided field name and the field value, other fields which are not provided can inherit the original content by default, and are not modified and cannot be changed; when the data is modified, the on-chain data management module can automatically record the current time, the user address of the modified data, the Hash value of the current data certificate and the Hash value recorded last time of the data, add separators to the four pieces of information, and splice the four pieces of information into a field value to be written into a data operation information field; for the data uploaded to the blockchain, a user can only modify the common field value existing on the blockchain and cannot modify the main key value and the value of the data operation information.
In the block chain mass data storage system oriented to the multi-source database, the on-chain data query function of the on-chain data management module simultaneously supports two query modes, namely, a primary key query mode and a Hash query mode.
The system for storing and verifying the massive data of the block chain facing the multi-source database comprises a credential return subsystem and a credential module, wherein the credential return subsystem comprises a field adding module and a credential recording module, the field adding module is used for newly establishing a field for a table of currently uploaded data in the database, and the field is used for storing a Hash value generated when the data is written into the block chain; the voucher recording module is used for writing the Hash value into the newly added field of the corresponding data and storing the Hash value and the data together.
In the system for storing and verifying the massive data in the block chain oriented to the multi-source database, the on-chain management module and the on-chain data management module of the block chain interaction subsystem are realized by a layered intelligent contract, and include a data operation layer, a function realization layer and an external interaction layer;
the data operation layer comprises a basic contract which is provided by the block chain and directly carries out addition, deletion, modification and check on data on the chain; the function implementation layer comprises a function expansion contract and a tool library contract, the function expansion contract is used for performing function expansion on the contract of the data operation layer so as to realize the modularized distinguishing management of a block chain table and block chain data, and the tool library contract is used for providing a function code which is repeatedly multiplexed in the function expansion contract, reducing the repeatability of the contract code and improving the execution efficiency; the external interaction layer only has one intelligent contract which is used for calling the contract of the function realization layer and providing all functions of the table management module on the block chain and the data management module on the block chain.
The evidence storing method of the block chain mass data evidence storing system facing the multi-source database comprises an automatic full-amount evidence storing mode and a manual evidence storing mode, wherein the automatic full-amount evidence storing mode means that a user can designate a target database, the evidence storing system can automatically create a table containing a main key in the target database on a block chain, automatically upload data in the table to the block chain for evidence storing, and subsequently delete, modify and query uplink data;
the manual evidence storage mode means that a user can create a data table on a block chain by himself and then add, delete, modify and query data on the table.
The above method for storing massive data of a block chain for a multi-source database, the automatic full-volume storage mode includes the following steps:
step 1, a user sends a database type, a database name, a database connection address, a port, a user name and a password to a data preprocessing subsystem;
step 2, the data preprocessing subsystem screens out a table with a main key and pushes table building information of the table to the block chain interaction subsystem;
step 3, a data table newly-built module on the chain checks whether a table with the same name already exists on the block chain, if so, the table is not created, and if not, a table is created on the block chain according to the table name, the main key name and the common field name;
step 4, after the table is successfully established, the data uploading subsystem sends a table name to which the evidence storing data belongs, a field name of the evidence storing data and data corresponding to the field name to the chain data adding module of the block chain interaction subsystem;
step 5, the data newly-added module on the chain detects whether the data to be stored is in accordance with the standard, the standard comprises that the number of field names is consistent with the number of field values, the field names comprise primary key names, the primary key values are not repeated, all the field names are in a table, when the conditions are in accordance, the data is submitted by the data newly-added module on the chain, the data is written into the block chain after the nodes on the block chain are successfully identified, and the data is stored persistently, otherwise, the data is not stored;
step 6, after each data is successfully stored, the block chain returns a Hash value as a certificate of the data uplink, the certificate return subsystem adds a field in the table of the source database, and writes the Hash value into the field of the corresponding data;
and 7, after the data storage is successful, searching, modifying and deleting the data on the block chain.
The above method for storing the massive data of the block chain for the multi-source database, wherein the manual storage mode comprises the following steps:
step 1, a user pushes table building information to a block chain interaction subsystem;
step 2, a data table newly-built module on the chain checks whether a table with the same name already exists on the block chain, if so, the table is not created, and if not, a table is created on the block chain according to the table name, the main key name and the common field name;
step 3, after the table is successfully established, the user calls a link data adding function of the block link interaction subsystem, and pushes the table name to which the certificate storing data belongs, the field name of the certificate storing data and data corresponding to the field name;
step 4, the data newly-added module on the chain detects whether the data to be stored is in accordance with the standard, the standard comprises that the number of the field names is consistent with the number of the field values, the field names comprise primary key names, the primary key values are not repeated, all the field names are in the table, when the conditions are in accordance, the data is submitted by the data newly-added module on the chain, the data is written into the block chain after the nodes on the block chain are successfully identified, and the data is stored persistently, otherwise, the data is not stored;
step 5, after each piece of data succeeds in storing the certificate, the block chain returns a Hash value as a certificate of the data chaining, and a user needs to store the certificate by himself;
and 6, after the data storage is successful, searching, modifying and deleting the data on the block chain.
The method has the advantages that only a small amount of intelligent contracts are used, data containing a main key in any relational database can be linked for storing certificates, two automatic and manual certificate storing modes are supported, the form of the data certificates can be customized, the data in the automatic batch synchronous database can be supported to a block chain, data change records can be inquired in a chain mode, the form of certificate storing data can be dynamically expanded, the data change records can be inquired in a chain mode, and the problems that the authority of a centralized certificate storing system is centralized, the data is easy to be distorted, the certificate storing data form of the existing block chain certificate storing system is single, the certificate storing data form is expanded, and the number of intelligent contracts is increased are solved.
Detailed Description
In order to make the technical solutions of the present invention better understood, the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.
As shown in fig. 1, the present embodiment discloses a blockchain massive data storage certification system for a multi-source database, which includes a data preprocessing subsystem, a data uploading subsystem, a certification returning subsystem, and a blockchain interaction subsystem. FIG. 2 is a system architecture diagram illustrating the general processes and functions of functional blocks for storing data in a database onto a blockchain according to the present invention. The data preprocessing subsystem screens table information capable of being linked in a database, the data uploading subsystem reads and uploads data in tables in batches and pushes the data to the block chain interaction subsystem, and the block chain interaction subsystem provides functions of on-chain user management, data table management and evidence storage data management. And the certificate returning subsystem returns the data chaining certificate generated by the block chain to the database after the data are written into the block chain.
The block chain interaction subsystem comprises a block chain user module, a chain upper table management module and a chain upper data management module. The block chain user module provides functions of block chain user registration and block chain user login, a user can obtain a randomly generated public key, a private key and an address from the block chain only through registration, and information on the chain is operated after login of the private key. All the operations of the user which change the data on the chain are recorded by the block chain and are permanently stored on the block chain.
The chain table management module comprises functions of chain table creation, chain table name list, chain table configuration query, chain table field modification and chain table name modification. Wherein the list of linked data table names function can query all data table names in the chain. When the chain table management module creates a table on the block chain, a data operation information field is automatically added. If the table primary key to be created only has one field, the chain table management module can directly take the field as the primary key and create the table; if the table to be created has a plurality of fields as the joint primary key, the chain table management module adds separators to the fields to be created and splices the fields into one field, and the spliced field is used as the primary key to create the table on the block chain.
The on-chain data management module comprises functions of on-chain data addition, on-chain data deletion, on-chain data modification and on-chain data query. When receiving data of multiple primary keys, the linked data management module can automatically add separators to the data of the primary keys and splice the data into complete primary key data for operation. When data is added newly, the current time, the user address of the added data and the Hash value of the current data certificate are automatically recorded, and separators are added to the three pieces of information and spliced into a field value to be written into a data operation information field. When the newly added function writes data, the data field to be written must contain all the primary keys of the table, and data with the same primary key value cannot be written into the same table. If a field is not uploaded, the value of the field is written into the table of the block chain in the form of an empty string by default, except for the primary key. The sequence of the field names of each piece of data can be inconsistent when the data is uploaded, but the sequence of the field names of the piece of data is consistent with the sequence of the field values and can be in one-to-one correspondence. When data is modified, the data management module on the chain can automatically judge whether the user address is consistent with the user address written in when the user address is newly added, if not, the data is not allowed to be modified, if so, the data is modified according to the provided table name, the primary key name and the corresponding primary key value positioning data, and the data is modified according to the provided field name and the field value, and other fields which are not provided can inherit the original content by default, are not modified, and cannot be changed. When modifying, the on-chain data management module can automatically record the current time, the user address of the modified data, the Hash value of the current data certificate and the Hash value recorded last time of the data, add separators to the four pieces of information, and splice the four pieces of information into a field value to write into the data operation information field. For the data uploaded to the blockchain, the user can only modify the common field value on the blockchain, and cannot modify the value of the primary key value and the data operation information.
The data query function of the uplink data management module supports two ways of querying uplink data at the same time. One is a primary key query mode; the other is a Hash query mode. The primary key query mode is to call an intelligent contract to query uplink data according to the table name, the primary key name and the primary key field, and the mode can query the complete data content and the content of the data operation information field which are stored in the chain. The Hash inquiry mode is to inquire directly on the block chain according to the Hash value generated during data uplink, and the mode can inquire the data content when the Hash is generated, the data operator, the timestamp when the Hash is generated and the block where the data is located. After the data on the blockchain is deleted, the data can not be queried again by means of the primary key query mode, but because all operations of the blockchain leave marks on the chain and have the characteristic of whole-process traceability, the data on the blockchain at the current time can still be resolved by virtue of the Hash value generated during the data chaining. When data is queried, a user can obtain complete data information, chain query can be realized through a Hash query mode according to a Hash value generated during last change in a data operation field, and all previous data during change of the data can be traced.
The upper table management module of the block chain interaction subsystem and the upper data management module of the block chain are realized by a layered intelligent contract, and the functions comprise a data operation layer, a function realization layer and an external interaction layer. The data operation layer comprises a basic contract which is provided by the block chain itself and directly carries out the increasing, deleting, modifying and checking on the data on the chain. The function implementation layer comprises a function expansion contract and a tool library contract, and the function expansion contract is used for performing function expansion on the contract of the data operation layer so as to realize modularized distinguishing management on the block chain table and the block chain data; the tool library contract is responsible for providing function codes which are multiplexed for many times in the function extension contract, reduces the repeatability of the contract codes and improves the execution efficiency. The external interaction layer only has one intelligent contract which is used for calling the contract of the function realization layer and providing all functions of the table management module on the block chain and the data management module on the block chain.
The function expansion contract is divided into two method areas, one method area specially processes the list on the chain, the contract of the data operation layer is called to increase, delete, modify and check the list information on the chain, whether the main key array input by the user is empty or not can be judged when the list is established, and the normalization judgment is carried out on the user input; the other method area specially processes data on the chain, calls a method of a data operation layer according to received increasing, deleting, modifying and checking operation instructions, then operates specific data according to a table name and data content in the instructions, automatically adds data operation information data, calls a tool library contract during execution to judge whether user input contains main key content, and returns the data after analyzing the data formed by splicing on the chain when inquiring the data.
The multiplexing function in the tool library contract comprises three functions, wherein one function is the automatic character string splicing and splitting function, when the combined main key data is written and searched and the data operation information data is recorded, the contents of the two functions are spliced by a plurality of information items, therefore, when the combined main key data is written and searched, the information items are detected, separators are automatically added in the contract, and the information items are combined into a complete character string. When the contract detects that the data content contains the separators when searching the data, the contract extracts the data before and after the separators and restores the data to the original plurality of information items. And secondly, the fields correspond to functions, when data is newly added and modified, the contract reads field information during table building, the field information is used as an information array, the array is traversed to be compared with field names input by a user one by one, field data in the table is extracted, and the field input by the user is prevented from being not the field in the table. And thirdly, the main key detection function needs to judge whether the user inputs the main key field when data is newly added, modified, searched and deleted. The contract reads the field information when building the table, takes the field information as a main key array, and traverses the array to judge whether the main key field does not appear in the input of the user.
In two method areas of an extended contract of a function implementation layer of an external interaction layer, all methods for providing functions of adding and deleting a table management module on a block chain and a data management module on the chain are extracted into the contract, a uniform contract use inlet is provided for a user, and management of the table and the data on the chain can be realized by calling the contract.
The certificate return subsystem comprises a field adding module and a certificate recording module. And the field adding module is used for newly establishing a field for the current table for uploading data in the database, and the field is used for storing a Hash value generated when the data is written into the block chain. The voucher recording module is used for writing the Hash value into the newly-added field of the corresponding data and storing the Hash value and the data together.
In the block chain mass data storage system of the embodiment, a plurality of databases to be stored are assumed to exist, and the databases can keep communication with the block chain nodes under the network environment. The certificate storing system of the embodiment has two use modes, wherein one mode is a full automatic certificate storing mode, and the other mode is a manual certificate storing mode.
The difference between the manual evidence storage and the full automatic evidence storage is that in the full automatic evidence storage mode, all data in the source database can be automatically uploaded, and a field is added to the original table for storing the Hash value of the data uplink. When the manual evidence storage mode is used, manual submission of table building information is needed before data uploading, and after receiving the table building information, a chain table management module of a block chain interaction subsystem firstly inquires whether a table with the same name exists on a block chain, and if the chain already has a table with the same name, the table cannot be continuously created. When the chain does not have a table with the same name, the table building module creates a table on the block chain according to the received database table name, the primary key name and the field name, then, the data can be subjected to the operation of adding, deleting, modifying and checking on the table, and the data need to be stored by a data storage certification initiator after the Hash value of the data chain is returned.
The automatic full-amount evidence storage mode comprises the following steps:
step 1, a user sends a database type, a database name, a database connection address, a port, a user name and a password to a data preprocessing subsystem;
step 2, the data preprocessing subsystem screens out a table with a main key and pushes table building information of the table to the block chain interaction subsystem;
step 3, a new function of the data table on the chain is used for checking whether a table with the same name already exists on the block chain, if so, the table is not created, and if not, a table is created on the block chain according to the table name, the main key name and the common field name;
step 4, after the table is successfully established, the data uploading subsystem sends a table name to which the evidence storing data belongs, a field name of the evidence storing data and data corresponding to the field name to a data adding module of the block chain interaction subsystem;
and 5, detecting whether the data to be stored accords with the standard by the data adding module, wherein the standard comprises that the number of field names and field values is consistent, the field names comprise primary key names, the primary key values are not repeated, all the field names are in the table, when the conditions are consistent, the data adding module submits the data, and after the nodes on the block chain are successfully identified, the data is written into the block chain, and the data is persistently stored. Otherwise, the data is not stored;
step 6, after each data is successfully stored, the block chain returns a Hash value as a certificate of the data uplink, the certificate feedback subsystem adds a field in the table of the source database, and writes the Hash value into the field of the corresponding data;
and 7, after the data storage is successful, searching, modifying and deleting the data on the block chain.
The manual certificate storage mode comprises the following steps:
step 1, a user pushes table building information to a block chain interaction subsystem;
step 2, the table building module checks whether a table with the same name already exists on the block chain, if so, the table is not created, and if not, a table is created on the block chain according to the table name, the main key name and the common field name;
step 3, after the table is successfully established, a user pushes the table name to which the certificate storing data belongs, the field name of the certificate storing data and data corresponding to the field name to the data adding module of the block chain interaction subsystem;
and 4, detecting whether the data to be stored is in accordance with the standard by the data adding module, wherein the standard comprises that the number of field names and field values is consistent, the field names comprise primary key names, the primary key values are not repeated, all the field names are in the table, when the conditions are all in accordance, the data adding module submits the data, the data is written into the block chain after the nodes on the block chain are successfully identified, and the data is stored persistently. Otherwise, the data is not stored;
step 5, after each piece of data succeeds in storing the certificate, the block chain returns a Hash value as a certificate of the data chaining, and a user needs to store the certificate by himself;
and 6, after the data storage is successful, searching, modifying and deleting the data on the block chain.
Fig. 3 is a flow chart of data preprocessing according to the present invention, in which the data preprocessing subsystem includes a database connection module and a table screening module, the database connection module is configured to load a corresponding database connection driver according to database connection information input by a user, determine whether a target database is connectable, and if the connection is successful, the database connection module pushes the database connection information to the data uploading subsystem and the credential returning subsystem. The database connection information comprises a database type, a database address, a database port, a database connection user name, a database connection password and a database name.
The table screening module is used for screening a data table meeting the block chain table building standard, pushing a table name meeting the standard to the data uploading subsystem, and pushing table building information meeting the standard to the table building module of the block chain interaction subsystem. The block link table building standard is met, and tables in the index database have primary keys. And establishing table information, including the table name, the primary key name of the table and all field names of the table.
When the automatic full-amount authentication mode is used, a user needs to select a database connection type (such as mysql, oracle and sql server) in a database connection module of the data preprocessing subsystem and input a user name, a password and a database name for connecting the database. At the moment, the database connection module tries to connect the database, and after the connection is successful, the database connection information is synchronized to the data uploading subsystem and the returning subsystem. The table screening module can automatically find out all table names in the database, then sequentially read all fields of each table, and distinguish the main key field and the common field according to the information set by the table in the database. If the table has a main key, the table screening module extracts the table name, the main key name and the field name of the table as table building information and pushes the table building information to a table building module of the block chain interaction subsystem; if the table has no primary key, the table building information of the table is not pushed.
Fig. 4 is a block chain table building flow chart of the present invention, after receiving table building information, a table building module of a block chain interaction subsystem first determines whether a table name is empty, and if the table name is not empty, queries whether a table with the same name exists on a block chain, and if a table with the same name already exists on the chain, the table building module cannot continue building. When the chain does not have the table with the same name, whether the primary key name of the table is received or not can be continuously judged, after the primary key name is received, the table building module adds a data operation information field according to the received table name, the primary key name and the field name of the database, a table is created on the block chain, and the data can be subjected to increasing, deleting, modifying and checking operations on the table.
Fig. 5 is a flow chart of data uploading according to the present invention, in which the data uploading subsystem includes a data reading module and a data pushing module. And the data reading module is used for automatically reading all field names and corresponding field values of each piece of data in the table after receiving the database connection information and the table names meeting the table building standard. And the data pushing module is used for pushing the read data to a chain data adding module of the block chain interaction subsystem. After the block chain interaction subsystem successfully creates the table, the data uploading subsystem connects the database according to the database information pushed by the data preprocessing subsystem, reads the data in the table one by one, and then submits the data to the data adding module of the block chain interaction subsystem one by one, wherein the submitted data content comprises the table name of the data, all field names and the data content corresponding to each field.
Fig. 6 is a flow chart of data addition in the present invention, after the uplink data management module of the block chain interaction subsystem receives the data to be uplinked, it will first query whether a table to which the data to be uploaded belongs already exists on the block chain, and if the table does not exist, the data cannot be uploaded. When the table exists, the data newly-added module can detect whether the data to be uploaded accords with the standard, and detects whether the content comprises field names and the number of field values are consistent, whether the field names contain primary key names, whether the primary key values are not repeated, and whether all the field names are in the table. If the specifications are all satisfied, the data management module on the chain can submit the data, automatically record the current time, the user address of the newly added data and the Hash value of the current data certificate, add separators to the three pieces of information, splice the three pieces of information into a field value and write the field value into the data operation information field. And writing the data into the block chain after the nodes on the block chain are successfully identified, and persistently storing the data.
Fig. 7 is a flowchart of credential return, where after the node consensus is over, a Hash value is generated, and the return subsystem connects the database according to the database connection information pushed by the data preprocessing module and adds a new field in the table of the uploaded data to store the credential of the data link. The return subsystem updates the data uplink certificate according to the primary key information of the uploaded data, namely, writes the Hash value generated by consensus in the newly added field of the data. When the back transmission subsystem finishes writing the Hash values of all the uplink data, the full automatic evidence storage is finished.
Fig. 8 is a flowchart of the data deleting function of the present invention, and after the chain data management module of the block chain interaction subsystem receives the data to be deleted, it will first query whether the table to which the data to be deleted belongs already exists on the block chain. When the table name exists, whether the received primary key name is consistent with the primary key name in the table building process is continuously confirmed. When the primary key name is consistent with the data, starting to search the data, if the data is inquired, judging whether the address of a data deleter is consistent with the user address recorded in the data operation information field when the data is newly added, if not, deleting the data, and if so, deleting the data; if the query is not successful, the deleting process is ended.
Fig. 9 is a flow chart of data modification according to the present invention, in which after the chain data management module of the blockchain interaction subsystem receives the data to be modified, it first queries whether a table to which the data to be modified belongs already exists on the blockchain. When the table name exists, continuously confirming whether the field name is consistent with the field number; when the number is consistent, continuously confirming whether the received field name contains the primary key name; when the main key name is included, whether the field names are all consistent with the field names in the table building process is continuously confirmed. When the field names are consistent, the data is searched, if the data is searched, whether the address of a data modifier is consistent with the user address recorded in the data operation information field when the data is newly added is judged, if the address is inconsistent, the data is not modified, if the address is consistent, the data is modified according to the content of the received field value, the content of other fields which are not received is kept unchanged, and when the data is modified, the chained data management module can automatically record the current time, the user address of the modified data, the Hash value of the current data certificate and the Hash value recorded last time of the data, add separators to four pieces of information, and splice the four pieces of information into a field value to be written into the data operation information field. If the query is not successful, the modification process is ended.
Fig. 10 is a data query flow chart of the present invention, in which after the data management module on the chain of the block chain interaction subsystem receives the data to be queried, it first distinguishes whether the data is queried according to the Hash value or according to the primary key. When the query is carried out according to the Hash value, the Hash value is directly submitted to the block chain, and the query result is returned. When inquiring according to the primary key, firstly confirming whether the table name to be inquired exists, and when the table name exists, continuously confirming whether the received primary key name is consistent with the primary key name when building the table. And when the primary key name is consistent with the default, starting to search and returning a search result. When the data is queried again, the complete content of the data can be obtained, and at the moment, the user can continuously realize chain query in a Hash query mode according to the Hash value generated during the last change in the data operation field, so that the data can be traced back to all the previous changed data of the data.
FIG. 11 is an intelligent contract architecture diagram of the present invention, which includes a data operation layer, a function implementation layer, and an external interaction layer. The data operation layer comprises a basic contract which is provided by the block chain itself and directly carries out the increasing, deleting, modifying and checking on the data on the chain. The function implementation layer comprises a function extension contract and a tool library contract, and the function extension contract is used for performing function extension on the contract of the data operation layer so as to realize the modularized distinguishing management of the block chain table and the block chain data; the tool library contract is responsible for providing the function codes which are multiplexed for many times in the function extension contract, so that the repeatability of the contract codes is reduced, and the execution efficiency is improved. The external interaction layer only has one intelligent contract which is used for calling the contract of the function realization layer and providing all functions of the table management module on the block chain and the data management module on the block chain. Through the design of the hierarchical intelligent contract framework, the intelligent contracts can be not newly increased or changed subsequently, and the data in various forms can be stored only by calling the table building function on the chain and building the table on the block chain, so that the use convenience of the system is improved. Due to the layered design, the coupling degree between contracts is reduced, the function expansion of subsequent contracts is facilitated, and the expandability of the system is improved.
The above embodiments are only exemplary embodiments of the present invention, and are not intended to limit the present invention, and the scope of the present invention is defined by the claims. Various modifications and equivalents may be made by those skilled in the art within the spirit and scope of the present invention, and such modifications and equivalents should also be considered as falling within the scope of the present invention.