CN114239039A - Method for dynamically adapting data structure on user-defined block chain - Google Patents

Method for dynamically adapting data structure on user-defined block chain Download PDF

Info

Publication number
CN114239039A
CN114239039A CN202111668129.6A CN202111668129A CN114239039A CN 114239039 A CN114239039 A CN 114239039A CN 202111668129 A CN202111668129 A CN 202111668129A CN 114239039 A CN114239039 A CN 114239039A
Authority
CN
China
Prior art keywords
data
template
user
information
data template
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202111668129.6A
Other languages
Chinese (zh)
Inventor
张小苗
王迪
张斌
庄旭
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Southwest Electronic Technology Institute No 10 Institute of Cetc
Original Assignee
Southwest Electronic Technology Institute No 10 Institute of Cetc
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 Southwest Electronic Technology Institute No 10 Institute of Cetc filed Critical Southwest Electronic Technology Institute No 10 Institute of Cetc
Publication of CN114239039A publication Critical patent/CN114239039A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/31User authentication
    • G06F21/33User authentication using certificates
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Computer Hardware Design (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Databases & Information Systems (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a method for dynamically adapting a data structure on a user-defined block chain, which comprises the following steps: the business system links and stores the data template information through a registered data template contract, establishes indexes with each field of the data information based on the data template or the data template information required to be used by inquiry, and associates the data content with the data template information through the unique identification of the data template on the block chain; a user assembles data by inquiring data information and corresponding templates, selects templates to construct data or creates self-defined data structure templates, generates a model for dynamically adapting any data, dynamically adapts different service data by loosely coupling an intelligent contract and a service system data structure, and adapts a new data structure by the newly added templates when the newly added data structure or the service data structure is changed. The method greatly reduces the workload of development and joint test of the service system and the intelligent contract of the block chain.

Description

Method for dynamically adapting data structure on user-defined block chain
Technical Field
The invention belongs to the technical field of block chains (Blockchain), and particularly relates to a method for a customizable on-chain data structure.
Background
The blockchain is a distributed and point-to-point transmission data storage technology, and is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. Logically, the system is a chain (chain) structure, block information (block) is arranged on each node, and transaction information is stored in the block. Blockchains are a term of art in information technology. A blockchain is essentially a decentralized database, a string of data blocks that are associated using cryptography. The data in the block chain is stored in each node in a distributed mode; data transmission is carried out in a point-to-point manner without a central server; the integrity and the safety of data are ensured through encryption and consensus algorithm; the block data structure mainly comprises a block head and a block body. The block head comprises information such as a father block hash value, a merkle root, transaction data and the like; a chunk embodies this chain by including the hash value of the previous chunk. The hash value of the block is calculated from the information in the block header. This hash value is an identifier of the chunk from which the corresponding chunk can be found. The lookup may be by block height.
Whether block data or status data, they are used and stored by block link points. A blockchain node is a runnable program. A plurality of block chain link points distributed in different hardware environments are connected with each other through a network to form a complete block chain network. The blockchain link points typically store blockchain data in a database, where the most common medium for blockchain data is a disk. Block chain nodes do not directly access disks and they manipulate data through a particular database. Compared with a direct operation disk, the data base abstracts a specific data access model, and the access of block chain nodes and data is more convenient. Because the Key-value database is used as a storage database at the bottom of the block chain, the operation mode is completely different from that of the traditional relational database, and complex data insertion and query operations cannot be met.
At present, service scenes for carrying out on-chain data evidence storage based on a block chain are continuously increased, and different data types lead to various data structures on the block chain in terms of different information obtaining means and different data types. At present, aiming at different data formats and structures, intelligent contracts matched with the data formats and the structures are required to be realized, the development workload of the work of the intelligent contracts for data chaining is greatly increased, the intelligent contracts and service data are strongly bound and tightly coupled, and the self-defined data structures cannot be dynamically adapted.
Disclosure of Invention
The invention aims to provide a method for dynamically adapting a data structure on a self-defined block chain, which is developed and deployed at one time and permanently used and can reduce the development workload of the work of the intelligent contract for data chaining, aiming at different data formats and structures and needing to realize an intelligent contract matched with the different data formats and structures, greatly increasing the development workload of the work of the intelligent contract for data chaining, and overcoming the defects that the intelligent contract is strongly bound and tightly coupled with service data and cannot be dynamically adapted to the self-defined data structure.
The purpose of the invention is realized by the following technical scheme:
a method of dynamically adapting a data structure on a custom blockchain, the method comprising: the business system links and stores the data template information through a registered data template contract, based on the data template or inquires the data template information required to be used, and associates the data content with the data template information through the unique identification of the data template on the block chain and the data template constraint information index of each field in the data content; a user assembles data by inquiring data information and corresponding templates, selects templates to construct data or creates self-defined data structure templates, generates a model for dynamically adapting any data, dynamically adapts different service data by loosely coupling an intelligent contract and a service system data structure, and adapts a new data structure by the newly added templates when the newly added data structure or the service data structure is changed.
According to a preferred embodiment, the service system registers the data template on the block chain, inquires the data template, and selects the data template to carry out data chaining, thereby realizing the self-definition of the data structure.
According to a preferred embodiment, the on-chain data structure is defined by the user or the user's business system for the data template; when a user needs to query data on the chain, the data on the chain and a corresponding data template are queried based on the unique identifier of the data, the data are assembled by an intelligent contract, and the data are returned to the user for structuring.
According to a preferred embodiment, in the data template registration, after the identity authentication is performed based on the chain-on identity authentication contract of the asymmetric cryptographic algorithm, the data template registration of the user is performed.
According to a preferred embodiment, the data template registration information includes: the data template number is the unique identification of the data template on a chain, the data template number is generated and maintained by a user service system, the data template description is the description of a data structure represented by the data template by a data template registration user, the data template content is a structure array representing information of each field in the data template, the user defines the data field information and constraint conditions of the data template through a data template content field, the data template is registered for uplink through signing the data field information, and after the uplink is successful, the related transaction state and the transaction information on the chain are returned.
According to a preferred embodiment, in the process of querying the data template, the user queries the information of the template through the unique identification data template number of the template on the chain, so that the user or the service system obtains the data structure corresponding to the template.
According to a preferred embodiment, in the data uplink process, according to the request parameter, the user associates uplink data with the corresponding template through the template unique identifier, and specifies a certain template content in the template corresponding to the data to be processed through an index value in the identifier attribute, thereby completing uplink of the data to be processed.
The aforementioned main aspects of the invention and their respective further alternatives can be freely combined to form a plurality of aspects, all of which are aspects that can be adopted and claimed by the present invention. The skilled person in the art can understand that there are many combinations, which are all the technical solutions to be protected by the present invention, according to the prior art and the common general knowledge after understanding the scheme of the present invention, and the technical solutions are not exhaustive herein.
The invention has the beneficial effects that:
once development and deployment, and permanent use. The development and joint trial workload of the business system and the intelligent contract of the block chain are greatly reduced. Any data model can be dynamically adapted, and a user can dynamically increase and adjust the data structure on the chain according to the self business process and the data structure.
The invention assembles data by inquiring the template, selects the template to construct data or creates a self-defined data structure template, generates a dynamic adaptation random data model, dynamically adapts different service data by using the loose coupling of an intelligent contract and a service system data structure, and adapts a new data structure by using an additional template if a new data structure or a service data structure is changed. The problem that the intelligent contract is strongly bound and tightly coupled with the service data and cannot dynamically adapt to a user-defined data structure is solved.
The invention can be used for all users to inquire and use. The user can inquire the detailed information of the data template through the unique identification of the data template on the chain. And enabling a user or a business system to know the data structure and details corresponding to the data template for constructing business data information. And (4) inquiring the contract through the data template by the user, transmitting the unique identifier of the data template on the block chain, and returning the description of the data template and the content information of the data template if the unique identifier exists.
Drawings
FIG. 1 is a diagram of the overall architecture of the dynamically adaptive data system on custom blockchains of the present invention.
Fig. 2 is a data template registration flow diagram.
FIG. 3 is a flow chart of data uplink and data assembly.
Fig. 4 is a data template registration flowchart.
FIG. 5 is a data template query flow diagram.
Fig. 6 is a flow chart of data information uplink.
Fig. 7 is a flow chart of data information query.
Detailed Description
The embodiments of the present invention are described below with reference to specific embodiments, and other advantages and effects of the present invention will be easily understood by those skilled in the art from the disclosure of the present specification. The invention is capable of other and different embodiments and of being practiced or of being carried out in various ways, and its several details are capable of modification in various respects, all without departing from the spirit and scope of the present invention. It is to be noted that the features in the following embodiments and examples may be combined with each other without conflict.
It should be noted that, in order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention are clearly and completely described below, and it is obvious that the described embodiments are some embodiments of the present invention, but not all embodiments.
The invention discloses a method for dynamically adapting a data structure on a self-defined block chain, as shown in figure 1, firstly a business system links data template information in a chain storage mode through a registered template contract, then links data contents based on the template or the template information required to be used by inquiry, and associates the data contents with the template information through unique identification of the template on the block chain and indexes of fields in the template.
The intelligent contract for data storage based on the data template can be customized by a user or an application to dynamically adapt to different service data. The intelligent contract is loosely coupled with the service system, and if a newly added data structure or a service data structure is changed, the intelligent contract does not need to be redeveloped, and a new data structure can be adapted through a newly added template.
As shown in fig. 2 and fig. 3, the service system can realize the customization of the data structure by registering the template on the blockchain, querying the template, and selecting the template for data chaining.
The intelligent contracts do not stipulate the format or structure of the data on the chain, and all the data structures on the chain are subjected to template definition by the user or a business system of the user. When a user needs to query data on the chain, the data and the corresponding template on the chain are queried based on the unique identifier of the data, the intelligent contract is assembled, and the data is returned to the user structured data.
The method for dynamically adapting the data structure on the user-defined block chain comprises the following steps: template registration, template query, data chaining, and data query.
The specific design of each part is as follows:
1. template registration
As shown in fig. 4, the template registration sequence diagram is that after the identity authentication is performed by the chain identity authentication contract based on the asymmetric cryptographic algorithm, the template registration of the user can be performed.
the template is a unique identification of the template on the chain, wherein the template is automatically generated and maintained by a user service system. The user defines the data field information of the template mainly through the items array field, wherein the field information comprises the Chinese name, English name, whether filling is necessary, data type, length limit range of data and the like of the field. The user registers the template for uplink by signing the information. And returning the related transaction state and the transaction information on the chain after the chain is successfully linked.
Request parameter description
Figure BDA0003448771350000041
Figure BDA0003448771350000051
Return value
Name Description Value
code Status code 200...
message Message Success/failure
bcInfo Block information Array
bcInfo.blockHeight Number of block in which it is located String
bcInfo.txHash Transaction hash String
bcInfo.createTime Time of block out String
2. Template query
The template query sequence chart is shown in fig. 5, and can be used by all users for querying and using. The user can inquire the detailed information of the template through the unique identifier templateID of the template on the chain. And enabling the user or the service system to obtain the data structure and the details corresponding to the template.
Request parameter description
Figure BDA0003448771350000052
Figure BDA0003448771350000061
Return value
Figure BDA0003448771350000062
3. Data uplink
Referring to fig. 6, according to the request parameters in the following table, the user associates the uplink data with the corresponding template through template id, and specifies which template content in the corresponding template is specified through the index value in the identifier attribute value. Therefore, the user only needs to care about the uplink data on the basis of knowing the template information.
Request parameter description
Figure BDA0003448771350000063
Figure BDA0003448771350000071
Return value
Name Description Value
code Status code 200...
message Message Success/failure
reHandle Data unique identification String
bcInfo Block information Array
bcInfo.blockHeight Number of block in which it is located String
bcInfo.txHash Transaction hash String
bcInfo.createTime Time of block out String
4. Data query
The data query sequence diagram is shown in fig. 7, and based on the data global unique identifier, the data information and the template identifier corresponding to the data are queried, the template information is queried through the template identifier, and the intelligent contract assembly information is returned to the user.
Request parameter description
Name In Type Whether or not it is necessary to Description
handle body String Is that Globally unique identification
Return value
Figure BDA0003448771350000081
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents and improvements made within the spirit and principle of the present invention are intended to be included within the scope of the present invention.

Claims (7)

1. A method for dynamically adapting a data structure on a custom blockchain, the method comprising:
the business system links and stores the data template information through a registered data template contract, based on the data template or inquires the data template information required to be used, and associates the data content with the data template information through the unique identification of the data template on the block chain and the data template constraint information index of each field in the data content;
a user assembles data by inquiring data information and corresponding templates, selects templates to construct data or creates self-defined data structure templates, generates a model for dynamically adapting any data, dynamically adapts different service data by loosely coupling an intelligent contract and a service system data structure, and adapts a new data structure by the newly added templates when the newly added data structure or the service data structure is changed.
2. The method of claim 1, wherein the step of dynamically adapting the data structure on the custom blockchain comprises: the business system registers the data template on the block chain, inquires the data template, and selects the data template to carry out data chaining, thereby realizing the self-definition of the data structure.
3. The method of dynamically adapting data structures on custom blockchains according to claim 2, wherein: defining a data template by a user or a service system of the user in the data structure on the chain;
when a user needs to query data on the chain, the data on the chain and a corresponding data template are queried based on the unique identifier of the data, the data are assembled by an intelligent contract, and the data are returned to the user for structuring.
4. The method of claim 3, wherein in the data template registration, after performing identity authentication based on the on-chain identity authentication contract of the asymmetric cryptographic algorithm, the data template registration of the user is performed.
5. The method for dynamically adapting data structures on custom blockchains according to claim 4, wherein the data template registration information includes: data template number, data template description and data template content,
wherein, the number of the data template is the unique identification of the data template on the chain, the number of the data template is automatically generated and maintained by a user service system, the data template is described as the description of the registered user of the data template on the data structure represented by the data template, the content of the data template is a structure array representing the information of each field in the data template,
the user defines the data field information and the constraint condition of the data template through the content field of the data template, and registers the data template to the uplink through signing the data field information, and returns the related transaction state and the transaction information on the link after the uplink is successful.
6. The method according to claim 5, wherein in the process of querying the data template, the user queries the information of the template by the unique identification data template number of the template on the chain, so that the user or the service system can obtain the data structure corresponding to the template.
7. The method as claimed in claim 6, wherein during data uplink, the user associates uplink data with the corresponding template through the template unique identifier according to the request parameter, and specifies a template content in the template corresponding to the data to be processed through an index value in the identifier attribute, thereby completing uplink of the data to be processed.
CN202111668129.6A 2021-09-30 2021-12-31 Method for dynamically adapting data structure on user-defined block chain Pending CN114239039A (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN2021111591880 2021-09-30
CN202111159188 2021-09-30

Publications (1)

Publication Number Publication Date
CN114239039A true CN114239039A (en) 2022-03-25

Family

ID=80745188

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111668129.6A Pending CN114239039A (en) 2021-09-30 2021-12-31 Method for dynamically adapting data structure on user-defined block chain

Country Status (1)

Country Link
CN (1) CN114239039A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115344329A (en) * 2022-08-15 2022-11-15 北京美蓝智达科技有限公司 Technology for creating data structure in real time according to functional module form

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1700685A (en) * 2005-05-13 2005-11-23 中国联合通信有限公司 A service middleware and service method using the service middleware
CN1996877A (en) * 2006-09-30 2007-07-11 华为技术有限公司 A device, system and method for realizing MIB adaptation
US20120173501A1 (en) * 2010-12-30 2012-07-05 Tata Consultancy Services Limited Configurable catalog builder system
CN106778329A (en) * 2016-11-28 2017-05-31 中国银行股份有限公司 A kind of block chain intelligence contract template dynamic updating method, apparatus and system
CN107918666A (en) * 2017-11-24 2018-04-17 中钞信用卡产业发展有限公司杭州区块链技术研究院 Method of data synchronization and system on a kind of block chain
CN110600096A (en) * 2019-09-16 2019-12-20 上海保险交易所股份有限公司 Medical data management method and system and computer storage medium
CN110851127A (en) * 2019-10-28 2020-02-28 杭州趣链科技有限公司 Universal evidence storage method based on block chain
CN110990879A (en) * 2019-11-08 2020-04-10 中国电子科技网络信息安全有限公司 Data evidence storing method based on block chain
CN111506579A (en) * 2020-05-28 2020-08-07 支付宝(杭州)信息技术有限公司 Method, program and equipment for generating intelligent contract code
CN111666336A (en) * 2020-05-15 2020-09-15 西安纸贵互联网科技有限公司 Data intercommunication method and system among block chains and electronic equipment

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1700685A (en) * 2005-05-13 2005-11-23 中国联合通信有限公司 A service middleware and service method using the service middleware
CN1996877A (en) * 2006-09-30 2007-07-11 华为技术有限公司 A device, system and method for realizing MIB adaptation
US20120173501A1 (en) * 2010-12-30 2012-07-05 Tata Consultancy Services Limited Configurable catalog builder system
CN106778329A (en) * 2016-11-28 2017-05-31 中国银行股份有限公司 A kind of block chain intelligence contract template dynamic updating method, apparatus and system
CN107918666A (en) * 2017-11-24 2018-04-17 中钞信用卡产业发展有限公司杭州区块链技术研究院 Method of data synchronization and system on a kind of block chain
CN110600096A (en) * 2019-09-16 2019-12-20 上海保险交易所股份有限公司 Medical data management method and system and computer storage medium
CN110851127A (en) * 2019-10-28 2020-02-28 杭州趣链科技有限公司 Universal evidence storage method based on block chain
CN110990879A (en) * 2019-11-08 2020-04-10 中国电子科技网络信息安全有限公司 Data evidence storing method based on block chain
CN111666336A (en) * 2020-05-15 2020-09-15 西安纸贵互联网科技有限公司 Data intercommunication method and system among block chains and electronic equipment
CN111506579A (en) * 2020-05-28 2020-08-07 支付宝(杭州)信息技术有限公司 Method, program and equipment for generating intelligent contract code

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
林良金: "基于区块链技术的高效数字图书馆数字版权交易保障策略研究" *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115344329A (en) * 2022-08-15 2022-11-15 北京美蓝智达科技有限公司 Technology for creating data structure in real time according to functional module form

Similar Documents

Publication Publication Date Title
CN101313495B (en) Method, system and apparatus for data synchronization
CN108052321B (en) Method for automatically generating intelligent contract of block chain based on configuration information
CN106227800B (en) Storage method and management system for highly-associated big data
US11343103B2 (en) Sending cross-chain authenticatable messages
US9213764B2 (en) Encrypted in-memory column-store
US20080201338A1 (en) Rest for entities
KR101143217B1 (en) Method, system and apparatus for managing computer identity
CN102867064B (en) Associate field inquiry unit and associate field querying method
JP2006503342A (en) System and method for highly distributed global data management with a database interface for a network of data sources
WO2008014062A2 (en) System and apparatus for optimally trading off the replication overhead and consistency level in distributed applications
CN111859426B (en) Universal encrypted database connector and setting method thereof
CN105049256A (en) Method and system for realizing universal custom interface message
CN111090385A (en) Data management method and device based on block chain
US11356535B2 (en) System and method for asset management and integration
CN114239039A (en) Method for dynamically adapting data structure on user-defined block chain
CN112118133B (en) Method for facilitating quick upgrade of intelligent contracts of Ethernet based on custom structure data
CN112417517A (en) Data standard management method based on block chain
AU2009334742A1 (en) Method, apparatus, and computer program product for polynomial-based data transformation and utilization
CN108345691A (en) Data source general procedure framework establishment method, data source processing method and processing device
CN108874944B (en) XSL language transformation-based heterogeneous data mapping system and method
CN112256728B (en) Data space construction method and identification analysis method based on virtual-real fusion
US20020165975A1 (en) Dynamic mapping of communication protocols
US20090307187A1 (en) Tree automata based methods for obtaining answers to queries of semi-structured data stored in a database environment
CN114519078B (en) Cross-chain credible query method and system based on block chain
US20190294604A1 (en) System, device and method for data update notification

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20220325