Block chain evidence storing method and device and computer equipment

文档序号:190945 发布日期:2021-11-02 浏览:20次 中文

阅读说明:本技术 区块链存证方法、装置和计算机设备 (Block chain evidence storing method and device and computer equipment ) 是由 何晟 雷凯 闵江松 陈佩淑 任俊 焦少帅 张良杰 于 2021-09-29 设计创作,主要内容包括:本申请涉及一种区块链存证方法、装置、计算机设备和存储介质。方法包括:通过智能合约获取原始存证信息,从原始存证信息中获取格式数据,获取格式模板,格式模板中包括关键字段与关键字段的存储条件;按照智能合约,将原始存证信息的格式数据与关键字段的存储条件进行匹配;若匹配成功,将原始存证信息存储于区块链,得到区块链存证数据,将关键字段作为区块链存证数据的索引,得到目标存证数据。采用本方法,如此针对多种多样的异构数据上链,避免了智能合约的大量开发,大幅降低了企业系统与区块链系统集成、企业数据上链的成本和负担。(The application relates to a block chain evidence storing method and device, computer equipment and a storage medium. The method comprises the following steps: acquiring original certificate storing information through an intelligent contract, acquiring format data from the original certificate storing information, and acquiring a format template, wherein the format template comprises key fields and storage conditions of the key fields; according to the intelligent contract, matching the format data of the original evidence storage information with the storage conditions of the key fields; and if the matching is successful, storing the original evidence storing information in the block chain to obtain block chain evidence storing data, and taking the key field as an index of the block chain evidence storing data to obtain target evidence storing data. By adopting the method, aiming at various heterogeneous data chaining, the massive development of intelligent contracts is avoided, and the cost and the burden of enterprise system and block chain system integration and enterprise data chaining are greatly reduced.)

1. A method for chain of blocks authentication, the method comprising:

acquiring original certificate storing information through an intelligent contract, acquiring format data from the original certificate storing information, and acquiring a format template, wherein the format template comprises key fields and storage conditions of the key fields;

according to the intelligent contract, matching the format data of the original evidence storage information with the storage conditions of the key fields;

and if the matching is successful, storing the original evidence storing information in a block chain to obtain block chain evidence storing data, and taking the key field as an index of the block chain evidence storing data to obtain target evidence storing data.

2. The method of claim 1, wherein the key field comprises a set of storage data types, the set of storage data types comprising storage conditions of the associated key field;

if the matching is successful, storing the original evidence storing information in a block chain to obtain block chain evidence storing data, and using the key field as an index of the block chain evidence storing data, including:

and if the format data of the original evidence storing information meets the storage condition of the associated key field, storing the original evidence storing information in a block chain to obtain block chain evidence storing data, and taking the storage data type set and/or the associated key field as the index of the block chain evidence storing data.

3. The method according to claim 2, wherein if a preset identifier is detected, it is determined that a set of stored data types corresponding to the preset identifier characterizes an object type, and the method further comprises a step of defining an object set, the step comprising: aggregating the storage conditions of the associated key fields, and dividing the hierarchical structure of the storage conditions through the preset identification to generate an object set.

4. The method of claim 2 or 3, wherein the associated key field is stored conditional to a predetermined data type, the method further comprising: and if the format data of the original evidence storing information is detected to be not accordant with the preset data type, converting the format data of the original evidence storing information into the preset data type.

5. The method of claim 1, wherein the key fields comprise an information certificate field and a blockchain identification field; the matching of the format data of the original certificate-storing information and the storage condition of the key field comprises:

matching the format data of the original certificate storing information with the storage condition of the information certificate storing field;

the using the key field as the index of the block chain evidence storing data includes:

generating a blockchain identifier of the blockchain credit data through the intelligent contract, wherein the blockchain identifier comprises one or more of an on-chain data identifier, a service data identifier, a data format type identifier and a blockchain transaction identifier generated by the intelligent contract;

and taking the block chain identification and/or the information evidence storage field as an index of the block chain evidence storage data.

6. The method of claim 1, wherein obtaining the format template comprises:

acquiring category identification from the original certificate storing information;

judging whether a candidate format template in the intelligent contract has a category identification corresponding to the original evidence storing information;

and if the category identification corresponding to the original evidence storing information exists, acquiring a corresponding candidate format template.

7. The method of claim 6, wherein the obtaining the format template further comprises:

if the category identification corresponding to the original certificate storing information does not exist, recording the category identification corresponding to the original certificate storing information;

and generating the format template according to the format data of the original certificate storing information and the category identification corresponding to the original certificate storing information.

8. The method according to claim 1, wherein the obtaining of the original credential information further comprises obtaining an operation right of the target credential data;

the method further comprises a step of accessing the target deposit evidence data, and specifically comprises the following steps:

receiving a target evidence storage data access instruction, and acquiring the digital identity of an instruction sender through a block chain;

and if the digital identity of the instruction sender is matched with the operation authority of the target deposit certificate data, accessing the block chain deposit certificate data through the index of the block chain deposit certificate data.

9. The method according to claim 8, further comprising the step of applying the target credentialing data according to a digital identity of an instruction issuer, specifically comprising:

receiving a target certificate storage data access instruction, and acquiring the digital identity of an instruction sender;

if the digital identity of the instruction sender is in a first grade, the corresponding instruction sender accesses the target card storage data, and/or controls the target card storage data, and/or endows other digital identities with a second grade;

and if the digital identity of the instruction issuer is in a second level, the corresponding instruction issuer accesses the target card storage data and/or controls the target card storage data.

10. A blockchain credentialing apparatus, said apparatus comprising:

the system comprises an information acquisition module, a format template acquisition module and a data processing module, wherein the information acquisition module is used for acquiring original certificate storage information through an intelligent contract, acquiring format data from the original certificate storage information and acquiring the format template, and the format template comprises storage conditions of key fields;

the information matching module is used for matching the format data of the original deposit evidence information with the storage conditions of the key fields according to the intelligent contract;

and the information evidence storage module is used for successfully matching the format data of the original evidence storage information with the storage condition of the corresponding key field, storing the original evidence storage information in the block chain to obtain block chain evidence storage data, and taking the storage condition of the key field as an index of the block chain evidence storage data to obtain target evidence storage data.

11. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor implements the steps of the method of any one of claims 1 to 9 when executing the computer program.

12. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 9.

Technical Field

The present application relates to the field of data storage technologies, and in particular, to a method and an apparatus for block chain storage of a certificate, a computer device, and a storage medium.

Background

With the development of data storage technology, a blockchain evidence storage technology appears, wherein the blockchain evidence storage technology is that business data such as identity, information, assets and behaviors are linked up, so that the evidence cannot be falsified, is convenient to share by all parties, and is used as an electronic evidence when disputes occur, so that full-flow trace retention, full-link credibility and full-node witness are realized, multi-party disputes are efficiently solved, the collaborative business climate control cost is reduced, and an inter-credible environment is created.

However, the existing blockchain underlying system is large and complex, and the business system and the blockchain system of the enterprise often adopt different development languages and different development specifications, and adopt different data storage methods, for example, the blockchain system generally adopts a key-value database, the business system of the enterprise mostly adopts a relational database, and when the business data chaining of the enterprise needs to be realized, different heterogeneous business data formats are different, business logics are different, and post-processing methods are different. Thus, when the business system of the enterprise is integrated with the blockchain technology, the business system of the enterprise needs to re-develop an intelligent contract meeting the requirements aiming at different heterogeneous business data and develop functions such as interaction and integration with the blockchain by adopting forms such as an SDK or an API supported by a blockchain bottom layer framework. After the development and debugging of the intelligent contract are completed and the corresponding block chain SDK or API interface is packaged, the block chain service is called in the actual service scenes of form entry, audit, filing and the like of the service system. Therefore, in order to realize business data uplink, an enterprise needs to redevelop an intelligent contract meeting requirements for heterogeneous data due to different formats, different business logics and different subsequent processing modes of the heterogeneous business data, so that the intelligent contract is large in development requirement, repeated development and even wrong development are easily caused, the intelligent contract is high in development entry difficulty, and the cost and the burden of enterprise system and block chain system integration and enterprise data uplink are greatly increased.

Disclosure of Invention

In view of the foregoing, it is desirable to provide a blockchain attestation method, apparatus, computer device, and storage medium that can develop heterogeneous data using the same intelligent contract.

A method of blockchain credentialing, the method comprising:

acquiring original certificate storing information through an intelligent contract, acquiring format data from the original certificate storing information, and acquiring a format template, wherein the format template comprises key fields and storage conditions of the key fields;

according to the intelligent contract, matching the format data of the original evidence storage information with the storage conditions of the key fields;

and if the matching is successful, storing the original evidence storing information in a block chain to obtain block chain evidence storing data, and taking the key field as an index of the block chain evidence storing data to obtain target evidence storing data.

In one embodiment, the key field comprises a set of storage data types comprising storage conditions of the associated key field;

if the matching is successful, storing the original evidence storing information in a block chain to obtain block chain evidence storing data, and using the key field as an index of the block chain evidence storing data, including:

and if the format data of the original evidence storing information meets the storage condition of the associated key field, storing the original evidence storing information in a block chain to obtain block chain evidence storing data, and taking the storage data type set and/or the associated key field as the index of the block chain evidence storing data.

In one embodiment, if a preset identifier is detected, it is determined that a set of stored data types corresponding to the preset identifier represents an object type, and the method further includes a step of defining an object set, where the step includes: aggregating the storage conditions of the associated key fields, and dividing the hierarchical structure of the storage conditions through the preset identification to generate an object set.

In one embodiment, the storage condition of the associated key field is that a preset data type is met, and the method further comprises: and if the format data of the original evidence storing information is detected to be not accordant with the preset data type, converting the format data of the original evidence storing information into the preset data type.

In one embodiment, the key fields include an information evidence field and a block chain identification field; the matching of the format data of the original certificate-storing information and the storage condition of the key field comprises:

matching the format data of the original certificate storing information with the storage condition of the information certificate storing field;

the using the key field as the index of the block chain evidence storing data includes:

generating a blockchain identifier of the blockchain credit data through the intelligent contract, wherein the blockchain identifier comprises one or more of an on-chain data identifier, a service data identifier, a data format type identifier and a blockchain transaction identifier generated by the intelligent contract;

and taking the block chain identification and/or the information evidence storage field as an index of the block chain evidence storage data.

In one embodiment, the obtaining the format template includes:

acquiring category identification from the original certificate storing information;

judging whether a candidate format template in the intelligent contract has a category identification corresponding to the original evidence storing information;

and if the category identification corresponding to the original evidence storing information exists, acquiring a corresponding candidate format template.

In one embodiment, the obtaining the format template further includes:

if the category identification of the original certificate storing information does not exist, recording the category identification of the original certificate storing information;

and generating the format template according to the format data of the original certificate storing information and the category identification of the original certificate storing information.

In one embodiment, the obtaining of the original certificate storing information further comprises obtaining an operation right of the target certificate storing data;

the method further comprises a step of accessing the target deposit evidence data, and specifically comprises the following steps:

receiving a target evidence storage data access instruction, and acquiring the digital identity of an instruction sender through a block chain;

and if the digital identity of the instruction sender is matched with the operation authority of the target deposit certificate data, accessing the block chain deposit certificate data through the index of the block chain deposit certificate data.

In one embodiment, the method further includes the step of applying the target deposit data according to the digital identity of the instruction issuer, specifically including:

receiving a target certificate storage data access instruction, and acquiring the digital identity of an instruction sender;

if the digital identity of the instruction sender is in a first grade, the corresponding instruction sender accesses the target card storage data, and/or controls the target card storage data, and/or endows other digital identities with a second grade;

and if the digital identity of the instruction issuer is in a second level, the corresponding instruction issuer accesses the target card storage data and/or controls the target card storage data.

A blockchain credentialing apparatus, the apparatus comprising:

the system comprises an information acquisition module, a format template acquisition module and a data processing module, wherein the information acquisition module is used for acquiring original certificate storage information through an intelligent contract, acquiring format data from the original certificate storage information and acquiring the format template, and the format template comprises storage conditions of key fields;

the information matching module is used for matching the format data of the original deposit evidence information with the storage conditions of the key fields according to the intelligent contract;

and the information evidence storage module is used for successfully matching the format data of the original evidence storage information with the storage condition of the corresponding key field, storing the original evidence storage information in the block chain to obtain block chain evidence storage data, and taking the storage condition of the key field as an index of the block chain evidence storage data to obtain target evidence storage data.

A computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:

acquiring original certificate storing information through an intelligent contract, acquiring format data from the original certificate storing information, and acquiring a format template, wherein the format template comprises key fields and storage conditions of the key fields;

according to the intelligent contract, matching the format data of the original evidence storage information with the storage conditions of the key fields;

and if the matching is successful, storing the original evidence storing information in a block chain to obtain block chain evidence storing data, and taking the key field as an index of the block chain evidence storing data to obtain target evidence storing data.

A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:

acquiring original certificate storing information through an intelligent contract, acquiring format data from the original certificate storing information, and acquiring a format template, wherein the format template comprises key fields and storage conditions of the key fields;

according to the intelligent contract, matching the format data of the original evidence storage information with the storage conditions of the key fields;

and if the matching is successful, storing the original evidence storing information in a block chain to obtain block chain evidence storing data, and taking the key field as an index of the block chain evidence storing data to obtain target evidence storing data.

The block link evidence storing method, the block link evidence storing device, the computer equipment and the storage medium acquire original evidence storing information, format data of the original evidence storing information and a format template through an intelligent contract, wherein the format template comprises storage conditions of key fields; according to the intelligent contract, matching the format data of the original evidence storage information with the storage conditions of the key fields; if the format data of the original certificate storing information all accord with the storage condition of the key field, matching is successful, and the original certificate storing information is stored in the block chain to obtain target certificate storing data; and enabling the relevant information meeting the storage condition of the key field to be recorded into the block chain. When the original evidence storage information is various heterogeneous data, an intelligent contract does not need to be re-developed for different heterogeneous data, but the original evidence storage information is input according to a corresponding format template, although the key information of the heterogeneous data is different, the storage conditions of key fields are also different, various heterogeneous data can be directly input to a block chain through the format template to obtain block chain evidence storage data, and then the key fields are used as indexes of the block chain evidence storage data to generate target evidence storage data so as to adapt to query of various heterogeneous data. Therefore, a large amount of development of intelligent contracts is avoided aiming at various heterogeneous data chaining, and the cost and burden of enterprise system and block chain system integration and enterprise data chaining are greatly reduced.

Drawings

FIG. 1 is a diagram of an exemplary block chain verification method;

FIG. 2 is a flowchart illustrating a method for block chain credentialing in one embodiment;

FIG. 3 is a diagram illustrating a data structure of a formatting template in one embodiment;

FIG. 4 is a flowchart illustrating a process of obtaining an index of block chain credential data according to another embodiment;

FIG. 5 is a flow diagram illustrating the process of obtaining a format template in one embodiment;

FIG. 6 is a flowchart illustrating the process of obtaining a format template according to another embodiment;

FIG. 7 is a schematic diagram illustrating the flow of accessing target credential data in one embodiment;

FIG. 8 is a block diagram of an exemplary blockchain credential device;

FIG. 9 is a block diagram of an exemplary blockchain credential device;

FIG. 10 is a block diagram of a blockchain credentialing apparatus in another embodiment;

FIG. 11 is a diagram illustrating an internal structure of a computer device in one embodiment.

Detailed Description

In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.

The block link certificate storage means that original certificate storage data such as identity, information, assets and behaviors are linked up, so that the certificate storage cannot be tampered, is convenient to share by all parties, and is used as an electronic evidence when disputes occur, full-flow trace retention, full-link credibility and full-node witness are achieved, multi-party disputes are efficiently solved, the collaborative business wind control cost is reduced, and an inter-credible environment is created.

Due to the cross-enterprise distributed architecture adopted by blockchain, and due to the complexity and development mode of blockchain networks, business systems and blockchain systems often adopt different development languages and different development specifications. Even for those familiar with the development of business systems, accessing a key-value type blockchain to a business system using a relational database is a complicated development work, and the problems of low performance, large call delay and the like inherent in the blockchain are even more difficult for the business developers who first know the blockchain. There are generally significant obstacles to repeatedly developing the underlying blockchain services and requiring developers to correctly understand and apply blockchain techniques.

This is because it is difficult for a general service developer familiar with the relational database to satisfy the user habit with the Key-Value pair (Key-Value) database that is often used at the bottom of the blockchain. The concrete expression is as follows: when the requirement of data uplink needs to be realized, different heterogeneous service data have different formats, different service logics and different post-processing modes, which easily causes repeated development and even wrong development.

Particularly, for service data, which has more categories and serious isomerization, if corresponding data uplink tasks are completed through different intelligent contracts according to the traditional technology, the problem of high difficulty in developing the intelligent contracts is also revealed, and further the cost and burden of service development are increased.

The credential data processing method provided by the application can be applied to the application environment shown in fig. 1. Wherein the terminal 102 communicates with the server 104 via a network. The communication network may be a wireless or wired communication network, such as an IP network, a cellular mobile communication network, etc., the terminal 102 may be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers and portable wearable devices, and the server 104 may be implemented by a stand-alone server or a server cluster composed of a plurality of servers.

The block link evidence storing method is mainly applied to the server, and the server can be realized by an independent server or a server cluster formed by a plurality of servers.

For example, the server acquires original certificate storing information through an intelligent contract, acquires format data from the original certificate storing information, and acquires a format template, wherein the format template comprises key fields and storage conditions of the key fields; according to the intelligent contract, matching the format data of the original evidence storage information with the storage conditions of the key fields; and if the format data of the original evidence storage information conforms to the storage condition of the corresponding key field, the matching is successful, at least one key field in the format template is filled with the original evidence storage information to obtain filled data, the filled data is stored in the block chain, and the key field is used as an index of the evidence storage data of the block chain to obtain target evidence storage data.

In one embodiment, as shown in fig. 2, a block chain verification method is provided, which includes the following steps:

s202, original certificate storing information is obtained through the intelligent contract, format data are obtained from the original certificate storing information, and a format template is obtained, wherein the format template comprises key fields and storage conditions of the key fields.

An intelligent contract is a set of commitments defined in digital form, including agreements on which contract participants can execute the commitments. The intelligent contract is equivalent to a conditional expression, can be executed by itself, and realizes a protocol of at least partial functions for inputting data to the block chain. In the prior art, each field needs to set a respective intelligent contract, and in the application, the intelligent contract may store data for calling the format template and may also store the format template.

Original evidence storage information, which includes at least one variable that is used to store values, has variable identification and data type information, all variables having data types to decide which data can be stored. It can be unprocessed data, or can be various data record texts written according to the specified format and requirements, wherein the acquired data is induced, sorted and comprehensively analyzed. It may take the form of a computer storage medium or a non-computer storage medium. The non-computer storage medium may be paper or audio. Different application scenes correspond to different original evidence storing information. In different scenarios, the original credential information may have different meanings, which may be service data of a certain field.

The format data mainly refers to the data types representing different data in the programming language. The definition of a data type in a data structure is a collection of a set of qualitatively identical values and a collection of operations defined on this set of values. The data type comprises an original type and a combined type; the original type comprises data types such as character strings, numerical values and the like; the combination type may be a tuple, a unit of record, an algebraic data type, an abstract data type, a reference type, a function type, and so on.

The format template is provided with at least one key field and at least one storage condition of the key field. The storage condition is mainly the format data of the original evidence storage information.

The key fields are defined for specific fields. The field in the present application may be a field in which any element such as a person or age is subdivided or integrated, or a field in which different data structures exist for behaviors, identities, information, assets, and the like.

In a specific embodiment, the whole system design of the block chain technology is integrated in a low-code mode, after the original evidence storing information is input through a visual interface, the original evidence storing information is obtained through an intelligent contract, and the original evidence storing information is analyzed to obtain format data. And meanwhile, acquiring a format template and determining the required storage condition.

And step S204, matching the format data of the original evidence storage information with the storage conditions of the key fields according to the intelligent contract.

Different original evidence storing information may have the same format data, so that the format data of the original evidence storing information and the storage condition of the key field can save calculation power and improve calculation speed.

Specifically, the original type data of the original certificate-storing information may be matched with the storage condition of the key field. For example: when the storage condition of the key field is: and when the character string data is allowed to be chained, acquiring the original certificate storing information and judging whether the character string data is stored or not. When the storage condition of the key field is: when data of types such as numerical values, character strings, template identifications, and the like are allowed to be stored, the storage conditions corresponding to the data are used for judgment.

And S206, if the matching is successful, storing the original evidence storing information in the block chain to obtain block chain evidence storing data, and taking the key field as an index of the block chain evidence storing data to obtain target evidence storing data.

In this embodiment, it is necessary to determine whether format data of the original certificate storing information meets the storage condition of the key field; if the format data of the original evidence storing information comprises a plurality of original data types and the format template relates to a plurality of key fields, the format data of the original evidence storing information can be considered to be in accordance with the storage conditions of the key fields as long as the original data types meet the storage conditions of any key fields.

Optionally, in order to make it easier to query the data on the blockchain, at least one key field may be used as an index of the blockchain credential data.

Step S208, if the matching fails, a prompt message is returned to avoid affecting the uplink progress.

The block link evidence storing method, the block link evidence storing device, the computer equipment and the storage medium acquire original evidence storing information, format data of the original evidence storing information and a format template through an intelligent contract, wherein the format template comprises storage conditions of key fields; according to the intelligent contract, matching the format data of the original evidence storage information with the storage conditions of the key fields; if the format data of the original certificate storing information all accord with the storage condition of the key field, matching is successful, and the original certificate storing information is stored in the block chain to obtain target certificate storing data; and enabling the relevant information meeting the storage condition of the key field to be recorded into the block chain. When the original evidence storage information is various heterogeneous data, an intelligent contract does not need to be re-developed for different heterogeneous data, but the original evidence storage information is input according to a corresponding format template, although the key information of the heterogeneous data is different, the storage conditions of key fields are also different, various heterogeneous data can be directly input to a block chain through the format template to obtain block chain evidence storage data, and then the key fields are used as indexes of the block chain evidence storage data to generate target evidence storage data so as to adapt to query of various heterogeneous data. Therefore, a large amount of development of intelligent contracts is avoided aiming at various heterogeneous data chaining, and the cost and burden of enterprise system and block chain system integration and enterprise data chaining are greatly reduced.

As shown in FIG. 3, the key fields include a set of storage data types that includes storage conditions for the associated key fields.

The storage data type set is equivalent to an object in programming, is formed by aggregating storage conditions of a plurality of associated key fields, and comprises a set name and the storage conditions of the associated key fields in the set. The collection name can be represented by a specific field in the data type collection, and the specific field can be any field such as 'description'; the storage condition contained in the collection can also be described by using another specific field, and the specific field can be any field such as "properties". In some cases, the set of stored data types may be referred to as a class identifier, primarily characterizing a set of certain classes of information.

The storage condition defines the data type or length threshold value and other related information corresponding to the template; the storage condition of the set can be used as an index of the block chain storage certificate data so as to facilitate the arrangement of the data structure. When the storage condition defines the type of the uplink data, the storage condition may be a data type such as a string, a numerical value, a boolean value, an array, and the like.

On the basis of the above embodiments, in order to store data more flexibly, the application also sets a special key field for storing a data type set.

A set of storage data types is a set of storage conditions that are aggregated for one or more key fields. By setting the storage data type set, an object having a plurality of storage conditions can be constituted. Therefore, the input data is more standard, and the whole structure is also improved. In this embodiment, the storage data type set is set, which facilitates the input and call of various data.

In one embodiment, the storage condition is the uplink data type supported by the block chain, which is shown in table 1:

TABLE 1

In one embodiment, if a preset identifier is detected, it is determined that a set of stored data types corresponding to the preset identifier represents an object type, and the method further includes a step of defining an object set, where the step includes: aggregating the storage conditions of the associated key fields, and dividing the hierarchical structure of the storage conditions through the preset identification to generate an object set.

The preset identifier may be any type of data such as "object", each preset identifier has a corresponding name, and one preset identifier may correspond to at least one storage condition, and a preset identifier belonging to a next hierarchy may also be set in one storage condition.

It should be understood that the data of an object type, which cannot be defined individually, is a collection of one or more uplink data types, and the conditions associated with the collection are identified by "properties" so that the data types are combined into a composite type.

As shown in table 1, to facilitate data input, when a set of stored data types is used to characterize an object, the storage condition of the key field of the object may be associated into the set of stored data types to form an uplink data type "object", so as to more clearly represent the features of the object; the hash value can be calculated by applying the service data related to the object, and the calculated hash value is associated to the key field of the object, so that the subsequent verification of the integrity of the service data is facilitated, and the lost data can be found in time. For example, when the stored data type set is used for representing the object of 'person', the stored data type set, the 'last name' field and the 'first name' field are associated; the "last name" field and the "first name" field may have the same chaining condition, and both are chained in a string type. Further, when the "person" is linked to the object, in order to facilitate determining the integrity of the data related to the object, a hash value is generated according to the service data related to the "person" field, and the hash value is linked to the object. The format template for "person" is shown in FIG. 3.

In this embodiment, the step of defining the object "person" may be represented as:

{

"title": "Person",

"type": "object",

"properties": {

"operation": {

"type": "object",

"description": personnel ",

"properties": {

"lastName": {

"type": "string",

description of last name "

},

"firstName": {

"type": "string",

Description name "

}

}

},

"attachments": {

"type": "array",

"items": {

"type": "string"

},

"description" hash value array of attachment "

}

}

}

It will be appreciated that when the "people" object has a key field of "age," people older than 18 years may be queried to facilitate the user's invocation of the data.

In one embodiment, focusing on the description of compatibility, the storage condition of the associated key field is that the associated key field conforms to a preset data type, and the method further includes: and if the format data of the original certificate storing information is detected not to conform to the preset data type, converting the format data of the original certificate storing information into the preset data type.

In order to meet the strong dependence of a business system on a relational database, a set of data format metadata templates described in JSON language can be designed. The template only supports uplink of a plurality of limited data types, but other complex service data types can be easily converted into corresponding uplink data types through a certain format conversion rule. At the same time, a series of rules can be set so that different types of data can be converted to one of a string, a numeric value, a boolean value, and an array.

Specifically, specific data in the programming language can be converted to improve compatibility, and complex data types such as objects can be converted into simple character strings; for example, Date and Time types such as Date/Time in the Access database, Hyperlink type such as Hyperlink, XML formatted data, and different data types such as these may be converted into String character String or Number value type for uplink storage; and the serialization function can convert complex service data such as Java objects into a serialized String character String and the like.

In one embodiment, if matching is successful, storing the original evidence storing information in the block chain to obtain block chain evidence storing data, and using the key field as an index of the block chain evidence storing data includes:

and if the format data of the original evidence storing information accords with the storage condition of the associated key field, storing the original evidence storing information in the block chain to obtain block chain evidence storing data, and using the stored data type set and/or the associated key field as the index of the filled data.

Optionally, if the format data of the original evidence storing information includes a plurality of original data types and the format template includes a plurality of associated key fields, as long as the original data types satisfy the storage condition of any associated key field, the type of format data of the original evidence storing information may be considered to conform to the storage condition of the key field.

In the embodiment, a plurality of associated key fields are acquired simultaneously through the calling of a certain stored data type set, so that when the stored data type set is used for representing a certain object, data can be input or output quickly, and the data can be called conveniently and quickly.

In one embodiment, as shown in fig. 4, the key fields include an information evidence field and a blockchain identification field; matching the format data of the original certificate-storing information with the storage condition of the key field comprises the following steps:

and step S402, matching the format data of the original certificate-storing information with the storage condition of the information certificate-storing field.

And the information evidence storing field corresponds to the original evidence storing information and is used for storing the original evidence storing information. The storage condition of the information evidence storage field can be the data type of the original evidence storage information, and can also be threshold information such as the maximum length of a character string.

Specifically, the format data of the original certificate storing information is matched with the information certificate storing field, and whether the format data of the original certificate storing information conforms to the data type of the information certificate storing field is mainly judged.

Correspondingly, the step of using the key field as an index of the block chain evidence storage data comprises the following steps:

step S404, generating a block chain identification of block chain deposit evidence data through the intelligent contract, wherein the block chain identification comprises one or more items of an on-chain data identification, a service data identification, a data format type identification and a block chain transaction identification generated by the intelligent contract;

the blockchain identifier may be any type of format, which may be a data format in the programming sense of a string, a numerical value, etc. It should be noted that when generating a plurality of blockchain identifiers, not all blockchain identifiers are necessarily used as indexes, and the identifiers may be selected as indexes according to settings.

The data identifier on the chain generated by the intelligent contract can be represented as data _ id, which is a main key of the traditional technical scheme, and the association is established through the main key and the corresponding value thereof, so that a traditional developer of the block chain can conveniently enter data.

The service data identifier may be represented as index _ id, which is an identifier corresponding to the service data, and may be uploaded by a service system, acquired by temporarily storing historical data, or obtained by sorting service numbers. The service data identification is used, so that service personnel in various industries can conveniently inquire corresponding data.

The data format type identifier may be represented as data _ type, and the type name of the data format on the chain is similar to the table name in the relational database, and the data format type identifier may be a key field, may be an uplink condition, and may include various data. After the data format type identifier is generated, the corresponding key field can be more conveniently acquired and data calling is carried out.

The blockchain transaction identifier may be denoted as tx _ ID, which is an ID identifier generated during blockchain transaction, and may facilitate business personnel to find out a specific transaction.

Step S406, the block chain identification and/or the information evidence storage field are/is used as an index of the block chain evidence storage data to obtain the target evidence storage data.

Therefore, after the target evidence storing data is stored in the block chain, the block chain identification is generated, and the retrieval efficiency is further improved. When a user needs to access original certificate storage information such as 'service data', the query can be completed according to the data index (data _ ID) on the chain and the service data identifier (index _ ID) defined by the service through an intelligent contract, and compared with the common query of the associated data through the block chain transaction ID, the query is more convenient for service developers, and the threshold of entry is lower.

In one embodiment, as shown in FIG. 5, obtaining the format template includes:

and step S502, acquiring category identification from the original certificate storing information.

The category identification can also be called the identification of the evidence storing entity. Each category identification corresponds to a different domain. The fields in the present application may include not only conventional fields such as different societies and disciplines, but also fields with specific attributes such as identities and behaviors.

Step S504, whether the candidate format template in the intelligent contract has the category identification corresponding to the original evidence storing information is judged.

Step S506, if the category identification corresponding to the original evidence storing information exists, the corresponding candidate format template is obtained.

It should be understood that different format templates include an information certificate field and a blockchain identification field, and format templates with different category identifications may also have specific information certificate fields and blockchain identification fields. Therefore, different templates can be set for different evidence storing entities, and matching is carried out through different templates so as to be compatible with more heterogeneous data.

In one embodiment, as shown in fig. 6, obtaining the format template further includes:

step S602, if the category identification corresponding to the original certificate storing information does not exist, the category identification corresponding to the original certificate storing information is recorded.

Step S604, generating a format template according to the format data of the original certificate storing information and the category identification corresponding to the original certificate storing information.

In this embodiment, the format template generated by the method is equivalent to a data table of a relational database, the category identifier is equivalent to a table name in a conventional database, and the format data of the original evidence storage information is equivalent to a field type of the conventional database. The steps in this embodiment are equivalent to defining a data table structure first, and then writing data according to the data table structure, so that a conventional database is converted into a block chain to store data, and the method has the characteristics of history non-falsification, process traceability, transparent and controllable authority, and the like, and can establish a trust relationship between an identity and data for different parties in an environment without trust or with weak trust.

In one embodiment, as shown in fig. 7, the obtaining of the original credential information further includes obtaining an operation right of the target credential data;

correspondingly, the method of this embodiment further includes a step of accessing the target credential data, which specifically includes:

step S702, receiving a target evidence storage data access instruction, and acquiring the digital identity of an instruction sender through a block chain;

step S704, if the digital identity of the instruction sender is matched with the operation authority of the target deposit certificate data, accessing the block chain deposit certificate data through the index of the block chain deposit certificate data.

In this embodiment, the related data is set with the related authority to perform data isolation. Because the operation authority of the target evidence storing data exists and the authority isolation exists, even under the condition of complex query, the risk that unauthorized data is queried on the block chain can be avoided, so that the block chain evidence storing information in the embodiment has higher safety and related information is not easy to leak.

The block chain certificate storing method further comprises the step of applying target certificate storing data according to the digital identity of the command issuer, and specifically comprises the following steps:

receiving a target certificate storage data access instruction, and acquiring the digital identity of an instruction sender;

if the digital identity of the instruction sender is in a first grade, the corresponding instruction sender accesses the target card storage data, and/or controls the target card storage data, and/or endows other digital identities with a second grade;

and if the digital identity of the instruction sender is in the second level, the corresponding instruction sender accesses the target certificate storage data and/or controls the target certificate storage data.

And controlling the target evidence storing data mainly refers to adding or modifying the target evidence storing data.

Specifically, for the data format of the data type registered in the same blockchain, any user (i.e., digital identity) having access to the blockchain can acquire the data and uplink data according to the data format.

However, the uplink service data cannot access the detailed information of the service data except the primary digital identity of the service system, the uplink caller digital identity, and the uplink data owner digital identity without explicit authorization. Only after the ownership party of the uplink data can re-authorize to other users (i.e. digital identities) through their digital identities, the other users can access the detailed information of the uplink service data. Therefore, only the ownership party of the uplink data is the digital identity of the first level; the main digital identity and the uplink calling party digital identity of the service system are digital identities of a second level. In this embodiment, the ownership digital identity is taken as the highest level, and the overall data structure has higher flexibility.

In one embodiment, the class identification is used to characterize a "depository," which implements a customizable on-chain data format via an intelligent contract for a blockchain. If the method is based on the golden butterfly dynamic domain model, different storage bodies can be defined to realize association and application to different service scenes under the same use flow.

In one embodiment, the information related to the intelligent contract is divided into metadata in a data format and service uplink data shared by different data formats; the "data format" metadata includes the above format template, and the "business uplink data" includes a block chain identifier, a digital identity, and verification information for verifying whether the business data is complete. In the intelligent contract, the related information of the "data format" metadata is shown in table 2, and it can determine the corresponding template in the uplink process:

TABLE 2

In one embodiment, the "business uplink data" includes a blockchain identifier as an index, a data hash value for verifying data integrity, and a digital identity corresponding to data operation authority, as shown in table 3.

TABLE 3

In this embodiment, the block link evidence storing method defines heterogeneous service data and link authority control by using a metadata template. A configurable data definition template is adopted to realize data format conversion and integration from a relational complex service system to a block chain system, metadata standardization and sharing are required when data chaining of the service system is realized by setting shared data types on a chain and service data with separated authority on the chain, and requirements for protecting service data privacy, authority controllability and authorization are also required, so that data integration of an uplink block chain can be quickly realized by service data in a standardized mode under the condition that service developers do not need to know the technical complexity of the bottom layer of the block chain.

It should be understood that although the various steps in the flowcharts of fig. 2, 4-7 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2, 4-7 may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed in turn or alternately with other steps or at least some of the other steps or stages.

In one embodiment, as shown in fig. 8, a blockchain credentialing apparatus is provided, the apparatus comprising: an information acquisition module 802, an information matching module 804 and an information evidence storage module 806;

an information obtaining module 802, configured to obtain original certificate storing information through an intelligent contract, obtain format data from the original certificate storing information, and obtain a format template, where the format template includes a storage condition of a key field;

the information matching module 804 is used for matching the format data of the original deposit evidence information with the storage conditions of the key fields according to the intelligent contract;

and the information evidence storing module 806 is configured to, if the format data of the original evidence storing information conforms to the storage condition of the corresponding key field, successfully match the original evidence storing information, store the original evidence storing information in the block chain to obtain block chain evidence storing data, and use the storage condition of the key field as an index of the block chain evidence storing data to obtain target evidence storing data.

According to the block chain evidence storing device, an intelligent contract does not need to be re-developed for different heterogeneous data, the heterogeneous data are input according to the corresponding format template, although key information of the heterogeneous data is different, storage conditions of key fields are also different, various heterogeneous data can be directly input to the block chain through the format template to obtain block chain evidence storing data, and then the storage conditions of the key fields are used as indexes of the block chain evidence storing data to generate target evidence storing data so as to adapt to query of various heterogeneous data.

In one embodiment, the key field comprises a set of storage data types, the set of storage data types comprising storage conditions of the associated key field; the information evidence storage module 806 includes:

and the first index definition unit is used for storing the original evidence storage information into the block chain to obtain block chain evidence storage data when the format data of the original evidence storage information accords with the storage condition of the associated key field, and using the storage data type set and/or the associated key field as the index of the block chain evidence storage data.

In one embodiment, the information matching module 804 further includes an object generation unit;

and the object generation unit is used for determining that the storage data type set corresponding to the preset identifier represents the object type, aggregating the storage conditions of the associated key fields, and dividing the hierarchical structure of the storage conditions through the preset identifier to generate the object set if the preset identifier is detected.

In one embodiment, the storage condition of the associated key field is that the associated key field conforms to a preset data type, and the information matching module 804 further includes a type conversion unit;

and the type conversion unit is used for converting the format data of the original evidence storing information into the preset data type if the format data of the original evidence storing information is detected not to conform to the preset data type.

In one embodiment, the key fields include an information certificate field and a blockchain identification field, and the information matching module 804 includes:

the cochain judging unit is used for matching the format data of the original certificate-storing information with the storage conditions of the information certificate-storing field;

the information evidence storage module 806 includes:

the uplink data generation unit is used for generating a block chain identifier of the block chain deposit evidence data through the intelligent contract, wherein the block chain identifier comprises one or more of an uplink data identifier, a service data identifier, a data format type identifier and a block chain transaction identifier generated by the intelligent contract;

and the second index definition unit is used for taking the block chain identification and/or the information evidence storage field as an index of the block chain evidence storage data.

In one embodiment, the information obtaining module 802 includes:

the certificate storing and verifying unit is used for acquiring category identification from the original certificate storing information;

the template determining unit is used for judging whether the candidate format template in the intelligent contract stores the category identification corresponding to the original certificate storing information;

and the template obtaining unit is used for obtaining a corresponding candidate format template if the category identification corresponding to the original evidence storing information exists.

In one embodiment, the information obtaining module 802 further includes:

the certificate storing body generating unit is used for recording the category identification of the original certificate storing information if the category identification corresponding to the original certificate storing information does not exist;

and the template generating unit is used for generating a format template according to the format data of the original certificate storing information and the category identification corresponding to the original certificate storing information.

In an embodiment, as shown in fig. 9, the block chain verification apparatus further includes:

the authority acquiring module 902 is configured to acquire an operation authority of the target certificate storage data;

the authority judgment module 904 is configured to receive a target evidence storage data access instruction, and obtain a digital identity of an instruction issuer through a block chain;

and the data calling module 906 is configured to, if the digital identity of the instruction issuer matches with the operation authority of the target evidence storing data, access the block link evidence storing data through the index of the block link evidence storing data and according to the index of the block link evidence storing data.

In one embodiment, as shown in fig. 10, the block chain verification apparatus further includes:

the identity judging module 1002 is configured to receive a target card storage data access instruction, and acquire a digital identity of an instruction issuer;

a first rank determining module 1004, configured to, if the digital identity of the instruction issuer is a first rank, access the target certificate storage data by the corresponding instruction issuer, and/or control the target certificate storage data, and/or assign other digital identities to a second rank;

and the second-level determining module 1006 is configured to, if the digital identity of the instruction issuer is in the second level, access the target deposit data and/or control the target deposit data by the corresponding instruction issuer.

The control of the target evidence storing data is mainly adding and modifying the target evidence storing data.

For specific definition of the blockchain evidence storing device, reference may be made to the above definition of the blockchain evidence storing method, which is not described herein again. The modules in the block chain verification device can be wholly or partially realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent of a processor in the computer device, or can be stored in a memory in the computer device as a software form, so that the processor can call and execute operations corresponding to the modules.

In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as shown in fig. 11. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing the block chain evidence storing data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a blockchain credentialing method.

Those skilled in the art will appreciate that the architecture shown in fig. 11 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.

In one embodiment, a computer device is further provided, which includes a memory and a processor, the memory stores a computer program, and the processor implements the steps of the above method embodiments when executing the computer program.

In an embodiment, a computer-readable storage medium is provided, on which a computer program is stored which, when being executed by a processor, carries out the steps of the above-mentioned method embodiments.

It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.

The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.

The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

24页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种基于政务网的政务文件移动存储设备及其使用方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类