Data circulation method, system, storage medium and electronic device based on alliance chain
Through the data circulation method based on alliance chain, data resource requests are analyzed and forwarded, cross-chain data sharing between blockchain ecology is realized, blockchain island problem is solved, and data security is ensured.
Patent Information
- Application Number
- CN202211261859.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-14
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2042-10-14
AI Technical Summary
The lack of interoperability between blockchains has led to the inability to circulate effectively, forming an island effect, hindering the integrated development of the blockchain application ecosystem.
The data circulation method based on the alliance chain is adopted to analyze the data resource request, determine the request type, and use the cross-link routing forwarding request mechanism to obtain data resources from databases of different levels and types to realize cross-chain data sharing.
Cross-chain data circulation between blockchain ecology is realized, island problems are solved, and data security is ensured through attribute access strategies.
Smart Images

Figure CN115643074B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of blockchain technology, and in particular to a data circulation method, system, storage medium and electronic device based on alliance chain. Background Art
[0002] With the development of blockchain technology, the problem of insufficient interoperability between blockchains and ineffective data circulation has also arisen, forming an "island effect" in applications and data, hindering the integrated development of blockchain application ecology. Therefore, how to achieve cross-chain data circulation and break through the blockchain ecological island is an urgent problem to be solved. Summary of the invention
[0003] The purpose of the embodiments of the present invention is to provide a data circulation method, system, storage medium and electronic device based on alliance chain. The specific technical solution is as follows:
[0004] The present invention provides a data circulation method based on alliance chain, comprising:
[0005] Parsing the data resource request to determine the type of the data resource request;
[0006] If the type of the data resource request is a multi-level request of the same type, then when the requested data resource is a first-level resource, the data resource pointed to by the data resource request is obtained from the database where the first-level resource is located by using a cross-link routing forwarding request method; when the requested data resource is a second-level resource, the data resource request is verified for legitimacy, and after the verification is passed, the data resource pointed to by the data resource request is obtained from the database where the second-level resource is located by using a cross-link routing forwarding request method;
[0007] If the type of the data resource request is a multi-type and multi-level request, the data resource request is sent to a cross-link route of the same type and target level, target level information is added to the data resource request, the data resource request with the target level information added is sent to the cross-link route of the target type, and the data resource pointed to by the data resource request is obtained.
[0008] Optionally, also include:
[0009] If the type of the data resource request is a request of the same type and level, the data resource pointed to by the data resource request is obtained from the local database.
[0010] Optionally, determining the type of the data resource request includes:
[0011] Obtaining a level identifier and a type identifier parsed from the data resource request;
[0012] Determine the level of the requested resource and the level of the data requester based on the level identifier, and obtain the type of the requested resource and the type of the data requester based on the type identifier;
[0013] If the level of the requested resource is the same as the level of the data requester, and the type of the requested resource is the same as the type of the data requester, then determining that the type of the data resource request is a request of the same type and level;
[0014] If the level of the requested resource is different from the level of the data requester, and the type of the requested resource is the same as the type of the data requester, then determining that the type of the data resource request is a same-type multi-level request;
[0015] If the level of the requested resource is different from the level of the data requester, and the type of the requested resource is different from the type of the data requester, then it is determined that the type of the data resource request is a multi-type and multi-level request.
[0016] Optionally, adding target level information to the data resource request specifically includes:
[0017] In the case where the requested data resource is the first level resource, adding target level information to the data resource request;
[0018] In the case that the requested data resource is the second-level resource, the legitimacy of the data resource request is verified, and after the verification is passed, the target level information is added to the data resource request.
[0019] Optionally, the method for obtaining the data resource pointed to by the data resource request includes:
[0020] generating an access request with attributes based on the attribute information carried in the data resource request;
[0021] Verifying the access request based on the attribute access policy;
[0022] If the verification is successful, the data holder uses the public key carried in the access request and the hash value of the requested data resource to find the key corresponding to the requested data resource, and uses the key to encrypt the public key and send it to the data requester, so that the data requester uses the private key to decrypt the key and obtain the data resource pointed to by the data resource request based on the key.
[0023] The present invention also provides a data circulation system based on the alliance chain, comprising:
[0024] A parsing module, configured to parse the data resource request and determine the type of the data resource request;
[0025] The first data resource acquisition module is configured to, if the type of the data resource request is a multi-level request of the same type, then in the case where the requested data resource is a first-level resource, obtain the data resource pointed to by the data resource request from the database where the first-level resource is located by means of cross-link routing forwarding request; in the case where the requested data resource is a second-level resource, perform a legitimacy verification on the data resource request, and after the verification is passed, obtain the data resource pointed to by the data resource request from the database where the second-level resource is located by means of cross-link routing forwarding request;
[0026] The second data resource acquisition module is configured to send the data resource request to the cross-link route of the same type and target level if the type of the data resource request is a multi-type and multi-level request, add the target level information to the data resource request, send the data resource request with the target level information added to the cross-link route of the target type, and obtain the data resource pointed to by the data resource request.
[0027] Optionally, also include:
[0028] The third data resource obtaining module is configured to obtain the data resource pointed to by the data resource request from the local database if the type of the data resource request is a request of the same type and level.
[0029] Optionally, the parsing module is specifically configured as follows:
[0030] Obtaining a level identifier and a type identifier parsed from the data resource request;
[0031] Determine the level of the requested resource and the level of the data requester based on the level identifier, and obtain the type of the requested resource and the type of the data requester based on the type identifier;
[0032] If the level of the requested resource is the same as the level of the data requester, and the type of the requested resource is the same as the type of the data requester, then determining that the type of the data resource request is a request of the same type and level;
[0033] If the level of the requested resource is different from the level of the data requester, and the type of the requested resource is the same as the type of the data requester, then determining that the type of the data resource request is a same-type multi-level request;
[0034] If the level of the requested resource is different from the level of the data requester, and the type of the requested resource is different from the type of the data requester, then it is determined that the type of the data resource request is a multi-type and multi-level request.
[0035] The present invention also provides a computer-readable storage medium, on which a program is stored, and when the program is executed by a processor, the above-mentioned data circulation method based on the alliance chain is implemented.
[0036] The present invention also provides an electronic device, comprising:
[0037] At least one processor, and at least one memory and bus connected to the processor;
[0038] The processor and the memory communicate with each other through the bus; the processor is used to call the program instructions in the memory to execute the above-mentioned data circulation method based on the alliance chain.
[0039] The embodiment of the present invention provides a data circulation method, system, storage medium and electronic device based on alliance chain, which parses the data resource request and determines the type of the data resource request; if the type of the data resource request is a multi-level request of the same type, then when the requested data resource is a first-level resource, the data resource pointed to by the data resource request is obtained from the database where the first-level resource is located by using a cross-chain routing forwarding request; when the requested data resource is a second-level resource, the data resource request is verified for legitimacy, and after the verification is passed, the data resource pointed to by the data resource request is obtained from the database where the second-level resource is located by using a cross-chain routing forwarding request; if the type of the data resource request is a multi-type multi-level request, the data resource request is sent to the cross-chain routing of the same type target level, the target level information is added to the data resource request, and the data resource request after adding the target level information is sent to the cross-chain routing of the target type and the data resource pointed to by the data resource request is obtained. The present invention can realize cross-chain data circulation by sharing data resources of different levels and types, solves the problem of blockchain ecological islands, and can ensure the security of circulating data based on alliance chains.
[0040] Of course, it is not necessary to achieve all of the advantages described above at the same time to implement any product or method of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0042] Figure 1 A flow chart of a data circulation method based on a consortium chain provided in an embodiment of the present invention;
[0043] Figure 2 A diagram of the alliance chain architecture provided by an embodiment of the present invention;
[0044] Figure 3 A schematic diagram of data flow provided by an embodiment of the present invention;
[0045] Figure 4 A timing diagram of a data flow method for requests of the same type and level provided in an embodiment of the present invention;
[0046] Figure 5 A timing diagram of a data flow method for multi-type and multi-level requests provided by an embodiment of the present invention;
[0047] Figure 6 A structural diagram of a data circulation system based on a consortium chain provided in an embodiment of the present invention;
[0048] Figure 7 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0049] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0050] The present invention provides a data circulation method based on alliance chain, such as Figure 1 As shown, the method includes:
[0051] Step 101: Parse the data resource request to determine the type of the data resource request.
[0052] The present invention realizes data circulation based on the alliance chain, establishes private chains of different types and levels, and the same levels can communicate with each other, and cross-chain communication is established between different levels. Different types establish cross-chain communication through business to form an alliance chain and realize cross-domain data circulation to solve the problem of blockchain ecological islands.
[0053] Figure 2 This is the alliance chain architecture diagram, such as Figure 2 As shown in the figure, the vertical direction represents multiple levels, and the horizontal direction represents multiple types. There is a data flow relationship between the alliance chain formed by several private chains and the governance chain and their private chains. When data is circulated, the data resource request initiated by the data requester is parsed to determine the type of data resource request, which includes: same type and same level request, same type and multiple level request, and multiple types and multiple levels request. For example, the same type and same level request can be Figure 2The first level of type 1 corresponds to data resource requests between private chains. Multi-level requests of the same type can be Figure 2 In type 1, the first level corresponds to the private chain and the second level corresponds to the data resource request between the private chains. Multi-type and multi-level requests can be Figure 2 The first level in type 1 corresponds to the private chain and the second level in type 2 corresponds to the data resource request between private chains. Different types and levels have identifiers to determine the type of data resource request when making a data resource request. After the data requester initiates the data resource request, the governance chain parses the data resource request and determines the type of the data resource request.
[0054] As an optional implementation, determining the type of the data resource request includes:
[0055] Obtain the level identifier and type identifier parsed from the data resource request;
[0056] Determine the level of the requested resource and the level of the data requester based on the level identifier, and obtain the type of the requested resource and the type of the data requester based on the type identifier;
[0057] If the level of the requested resource is the same as the level of the data requester, and the type of the requested resource is the same as the type of the data requester, then the type of the data resource request is determined to be a request of the same type and level;
[0058] If the level of the requested resource is different from the level of the data requester, and the type of the requested resource is the same as the type of the data requester, then the type of the data resource request is determined to be a same-type multi-level request;
[0059] If the level to which the requested resource belongs is different from the level of the data requester, and the type to which the requested resource belongs is different from the type of the data requester, then it is determined that the type of the data resource request is a multi-type multi-level request.
[0060] Step 102: If the type of the data resource request is a multi-level request of the same type, then when the requested data resource is a first-level resource, a cross-link routing forwarding request is used to obtain the data resource pointed to by the data resource request from the database where the first-level resource is located; when the requested data resource is a second-level resource, the data resource request is verified for legitimacy, and after the verification is passed, a cross-link routing forwarding request is used to obtain the data resource pointed to by the data resource request from the database where the second-level resource is located.
[0061] Optionally, if the requested data resource corresponds to a level lower than the data resource level corresponding to the data requester, that is, when the requested data resource is a first-level resource, the data resource pointed to by the data resource request is obtained from the database where the first-level resource is located by using a cross-chain routing forwarding request. If the requested data resource corresponds to a level higher than the data resource level corresponding to the data requester, that is, when the requested data resource is a second-level resource, the data resource request is verified for legitimacy, and after the verification is passed, the data resource pointed to by the data resource request is obtained from the database where the second-level resource is located by using a cross-chain routing forwarding request.
[0062] Figure 2 In the vertical direction, the same type is represented as a whole. A private chain is established at each level in each type. Different nodes at the same level are different organizations. The resource requests between nodes of each private chain do not perform cross-chain operations. The chain at each level can establish a cross-chain relationship with the upper and lower chains according to the level division in the actual business.
[0063] For multi-level requests of the same type, cross-chain operations are involved, and the upper level has higher authority than the lower level, such as Figure 2 In type 1, the first-level permission is higher than the second-level permission, and the second-level permission is higher than the third-level permission. There are two cases for multi-level requests of the same type. The first is the request from top to bottom of the same type. In this case, the data request can be made after verifying the identity and permission; the second is the request from bottom to top of the same type. When making a request from bottom to top, the superior will judge whether the request issued by the subordinate is legal according to the access control policy. If it is legal, the request continues to go up. If it is not legal, the request can be rejected. The private chains established at each level of the same type use the same cross-chain routing service, and the cross-chain routings at each level are interconnected to establish a cross-chain relationship for multi-level requests of the same type.
[0064] Optionally, a method for obtaining the data resource pointed to by the data resource request includes:
[0065] Generate an access request with attributes based on the attribute information carried in the data resource request;
[0066] Verify access requests based on attribute access policies;
[0067] If the verification is successful, the data holder uses the public key carried in the access request and the hash value of the requested data resource to find the key corresponding to the requested data resource, and encrypts the public key with the key and sends it to the data requester, so that the data requester uses the private key to decrypt the key and obtain the data resource pointed to by the data resource request based on the key.
[0068] The above attribute information may include but is not limited to subject attributes, resource attributes, operation attributes and environment attributes. Verification of attribute information can ensure data security.
[0069] Step 103: If the type of the data resource request is a multi-type and multi-level request, send the data resource request to the cross-link routing of the same type and target level, add the target level information to the data resource request, send the data resource request with the target level information added to the cross-link routing of the target type and obtain the data resource pointed to by the data resource request.
[0070] Figure 2 In the horizontal direction, it is represented as multiple isolated types. Data resource requests between different types establish cross-chain relationships through business-related smart contracts. Chains that need to establish business relationships use cross-chain routing to communicate. Cross-chain routing is a service process that bridges the blockchain and the business smart contracts deployed therein. Multiple cross-chain routings are connected to each other. Each chain sends a request to the cross-chain routing, and the cross-chain routing forwards the request to each other, thereby completing the cross-chain resource access operation.
[0071] For multi-type and multi-level requests, since the multiple types are isolated domains and no connection is established between the multiple chains, in this case, the smart contracts for the business can be defined through negotiation between the multiple types of departments, and the defined smart contracts can be deployed to the cross-chain routes that need to be connected to each other. Through the connection and request forwarding of the cross-chain routes, the cross-chain relationship between the multiple types of private chains can be confirmed, and the data flow and information exchange between different departments can be realized.
[0072] Optionally, target level information is added to the data resource request, including:
[0073] In the case where the requested data resource is a first-level resource, target level information is added to the data resource request;
[0074] In the case where the requested data resource is a second-level resource, the data resource request is subjected to a validity verification, and after passing the verification, the target level information is added to the data resource request.
[0075] If the superior requests data resources from the subordinate, that is, when the requested data resources are first-level resources, the target level information can be directly added to the data resource request. If the subordinate requests data resources from the superior, that is, when the requested data resources are second-level resources, the data resource request is verified for legitimacy, and the target level information is added to the data resource request after the verification is passed.
[0076] In an optional embodiment, the alliance chain-based data circulation method provided by the present invention further includes: if the type of the data resource request is a request of the same type and level, obtaining the data resource pointed to by the data resource request from the local database.
[0077] For requests of the same type and level, since both nodes are on the same chain, the data requester can verify the identity and authority through the governance chain. The data holder can encrypt the data resources with the private key and send the ciphertext data, public key information, transaction receipt and other data back to the data requester. After the data requester obtains the data, it verifies the public key information and transaction receipt. After the verification is passed, the data is decrypted using the public key to complete the entire process.
[0078] For the three types of requests, in the actual operation process, when the data requester initiates a resource request, it can first determine whether the requested resource is at the current level. If it is determined to be a superior resource, the request is forwarded to a cross-chain route established with the superior chain of the same type, and the cross-chain route forwards the request, thereby completing the same type and multi-level request process. If it is determined to be a resource of the current level or a subordinate level during the process, the data domain type is judged again. If it is not the same type, the request is forwarded to a cross-chain route established with another chain of the same level, and the cross-chain route forwards the request, thereby completing the multi-type and multi-level request process; when it is determined to be of the same type and level, the data resource can be sent directly.
[0079] Figure 2The governance chain in the system mainly implements functions such as access control, transactions, supervision and access by deploying a variety of cross-chain governance smart contracts. Among them, the types of smart contracts deployed by the governance chain include access control smart contracts, transaction management smart contracts, supervision smart contracts and access smart contracts. The access control smart contract can ensure the information security on the blockchain through reliable permission management and authorization mechanisms. The present invention uses attribute-based access control mechanisms to achieve dynamic, fine-grained and flexible permission management and authorization. The transaction management smart contract, through the consensus of the governance chain nodes, records the complete life cycle of the transaction from generation to end, so as to prevent attacks and avoid single point failure problems, and achieve disaster recovery effects; and the transaction management smart contract is to manage transactions by implementing a two-phase submission protocol including voting and submission, and completes the entire transaction management by recording the complete life cycle of the transaction through the consensus of the nodes in the governance chain, ensuring the normal operation of the system. The supervision smart contract records the key information such as the initiator identification, initiator organization identification, resource interface, operation results, operation time, etc. of non-cross-chain or cross-chain operations by deploying supervision smart contracts, and uses the supervisor's public key to encrypt and store, which is only available for the supervisor to read and decrypt, so as to implement pre-interception, in-process monitoring and post-event accountability. The access smart contract is also formulated and deployed by the regulatory agency responsible for the governance chain, which will initiate voting for malicious transactions or business operations, and hold the relevant operating institutions accountable or punish them. The access smart contract provides two service functions in the form of a committee. The first is to establish a PKI (Public Key Infrastructure) platform to distribute public and private keys to business departments and institutions participating in the cross-chain to ensure secure communication within the system; the second is to provide access control services to dynamically add, delete, modify and check access information; and manage the committee itself, initiate voting for members who do evil within the committee, and remove and punish them.
[0080] like Figure 3 As shown in the figure, to achieve data circulation, the data holder uploads the data to the alliance chain and formulates the access policy to the governance chain. After the data requester initiates the data resource request, the governance chain authenticates and sends the receipt to the alliance chain. After the alliance chain obtains the corresponding resources, it sends them to the data requester, and the data circulation is completed. Among them, the governance chain can control the data circulation through access control smart contracts, transaction management smart contracts, supervision smart contracts and access smart contracts.
[0081] The present invention uses an attribute-based access control model (ABAC), and uses a unified attribute standard to describe the access control strategy between blockchains, so as to achieve cross-domain data circulation with autonomous controllable sharing and flexible resource management. The specific process of data circulation is mainly based on ABAC data resource access control: first, the data holder formulates an attribute access strategy and uploads the strategy information to the chain through an access control smart contract. Then the resource request process is executed: after receiving the data resource request, the relevant attribute information is queried on the corresponding private chain based on the policy information, and an attribute-based access request (AAR) is constructed. The AAR describes the subject, resource, operation and environment attributes, etc., and then broadcasts it in the alliance chain network. The private chain with the corresponding resources will verify the AAR based on the policy information, and the verification result and the address and access key of the resource will be encrypted with the public key of the data requester and encapsulated, and propagated in the alliance chain network, so that the data requester can obtain the corresponding resource data.
[0082] In one embodiment, the data flow method for the same type of same level request can be found in Figure 4 . Figure 4 In the example, the two nodes on the same chain are data requester A (hereinafter referred to as A) and data holder B (hereinafter referred to as B). B first encrypts the data to be shared Data with a randomly generated symmetric encryption key S1 to obtain EncData, and then uploads it to the private chain, returns Hash (EncData) and S1 to B and saves them locally. Using Hash (EncData) can find data on the chain faster. Then B formulates the attribute access policy of the resource. The access policy records the information that only institutions of a certain level can access this data resource under certain conditions or environments. The browsing permissions of desensitized data such as data resource metadata (data type, upload time, upload organization, data Hash result) are made public so that other users can quickly find the required data on the blockchain browser. A sends a request to B through the blockchain browser, generates a data resource request with attributes based on the attribute information, and the access control smart contract verifies it according to the attribute access policy uploaded by B. If the verification fails, it means that A cannot complete this request; if the verification succeeds, a notification is sent to B, and the public key of A and the hash value of the requested data resource carried in the request are used to find the key S1 corresponding to the resource, encrypt it with A's public key, and send it to A. After A obtains the encrypted S1, it uses the private key to decrypt it to obtain S1. If the decryption fails, it means that B is transmitting false information and uploading this transaction to the regulatory smart contract; if the decryption succeeds, A queries the local database to obtain the encrypted data, decrypts it with S1, and completes this data circulation.
[0083] In another embodiment, the data flow method for multi-type and multi-level requests can be found in Figure 5 . Figure 5 In the figure, there are type A third-level data requester A' (hereinafter referred to as A') and type B second-level data holder B' (hereinafter referred to as B'), type A second-level chain C1, type B second-level chain C2, and cross-chain routes used for request forwarding between chains. B' first encrypts the data Data to be shared with a randomly generated key S1 to obtain EncData, and then uploads it to the chain C2 where B' is located, obtains Hash (EncData) and S1 and saves them locally, and then B formulates the attribute access policy of the resource. A' obtains the type and level of B' and other institutional information through the blockchain browser, and first sends a request to the cross-chain route established with the same type of second-level chain C1. After receiving the request, the cross-chain route forwards the request to C1. The request from the upper chain to the lower chain needs to be verified to see if it is a legitimate request. If the verification fails, the request can be directly interrupted, the contract record can be supervised, and the reason can be returned to the initiator of the request. If the verification passes, since the level of the request chain will be judged first when verifying the request, it is necessary to sign the secondary chain after the verification, that is, add the secondary chain information and its verification information for this request to the original request, and continue to forward the request. At this time, C1 forwards the request to C2 and reaches the destination chain. The access control smart contract makes a judgment based on the attribute access policy uploaded by B', and the judgment result is returned to the cross-chain route for forwarding. After A' decrypts the key S1 encrypted by B' using A's public key with its own private key, this cross-type and cross-level data request is completed. It should be noted that the first cross-chain route mentioned above refers to the cross-chain route established between the third-level chain where A is located and the secondary chain, and the second cross-chain route refers to the cross-chain route established between the type A chain and the type B chain through business-related.
[0084] The present invention also provides a data circulation system based on alliance chain, such as Figure 6 As shown, the system includes:
[0085] The parsing module 601 is configured to parse the data resource request and determine the type of the data resource request.
[0086] Optionally, the parsing module is configured as follows:
[0087] Obtain the level identifier and type identifier parsed from the data resource request;
[0088] Determine the level of the requested resource and the level of the data requester based on the level identifier, and obtain the type of the requested resource and the type of the data requester based on the type identifier;
[0089] If the level of the requested resource is the same as the level of the data requester, and the type of the requested resource is the same as the type of the data requester, then the type of the data resource request is determined to be a request of the same type and level;
[0090] If the level of the requested resource is different from the level of the data requester, and the type of the requested resource is the same as the type of the data requester, then the type of the data resource request is determined to be a same-type multi-level request;
[0091] If the level to which the requested resource belongs is different from the level of the data requester, and the type to which the requested resource belongs is different from the type of the data requester, then it is determined that the type of the data resource request is a multi-type multi-level request.
[0092] The first data resource acquisition module 602 is configured to, if the type of the data resource request is a multi-level request of the same type, then when the requested data resource is a first-level resource, obtain the data resource pointed to by the data resource request from the database where the first-level resource is located by means of cross-link routing forwarding requests; when the requested data resource is a second-level resource, perform legitimacy verification on the data resource request, and after the verification is passed, obtain the data resource pointed to by the data resource request from the database where the second-level resource is located by means of cross-link routing forwarding requests.
[0093] The second data resource acquisition module 603 is configured to send a data resource request to a cross-link route of the same type and target level if the type of the data resource request is a multi-type and multi-level request, add the target level information to the data resource request, send the data resource request with the target level information added to the cross-link route of the target type, and obtain the data resource pointed to by the data resource request.
[0094] The second data resource acquisition module 603 is specifically configured to:
[0095] In the case where the requested data resource is the first level resource, adding target level information to the data resource request;
[0096] In the case that the requested data resource is the second-level resource, the legitimacy of the data resource request is verified, and after the verification is passed, the target level information is added to the data resource request.
[0097] Optionally, when obtaining the data resource pointed to by the data resource request, an access request with attributes can be generated based on the attribute information carried in the data resource request; the access request is verified based on the attribute access policy; if the verification passes, the data holder uses the public key carried in the access request and the hash value of the requested data resource to find the key corresponding to the requested data resource, and uses the key to encrypt the public key and send it to the data requester, so that the data requester uses the private key to decrypt the key and obtain the data resource pointed to by the data resource request based on the key.
[0098] As an optional implementation, the system further includes:
[0099] The third data resource obtaining module is configured to obtain the data resource pointed to by the data resource request from the local database if the type of the data resource request is a request of the same type and level.
[0100] An embodiment of the present invention provides a computer-readable storage medium on which a program is stored. When the program is executed by a processor, the above-mentioned data circulation method based on the alliance chain is implemented.
[0101] An embodiment of the present invention provides an electronic device, such as Figure 7 As shown, the electronic device 70 includes at least one processor 701, at least one memory 702 and a bus 703 connected to the processor 701; the processor 701 and the memory 702 communicate with each other through the bus 703; the processor 701 is used to call the program instructions in the memory 702 to execute the above-mentioned data circulation method based on the alliance chain. The electronic device in this article can be a server, a PC, a PAD, a mobile phone, etc.
[0102] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program that initializes the steps included in the above-mentioned alliance chain-based data circulation method.
[0103] The present application is described with reference to the flowcharts and / or block diagrams of the methods, systems and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0104] In a typical configuration, the device includes one or more processors (CPU), memory and bus. The device may also include input / output interface, network interface and the like.
[0105] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip. The memory is an example of a computer-readable medium.
[0106] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0107] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0108] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. It should also be noted that the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0109] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0110] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A data circulation method based on alliance chain, characterized in that: include: Parsing the data resource request to determine the type of the data resource request; the data resource request is based on the corresponding private chain circulation; The private chains corresponding to different types of data resource requests constitute a consortium chain; the consortium chain represents the level in the vertical direction and the type in the horizontal direction; there is a data flow relationship between the consortium chain and the private chain; If the type of the data resource request is a multi-level request of the same type, then when the requested data resource is a first-level resource, the data resource pointed to by the data resource request is obtained from the database where the first-level resource is located by using a cross-link routing forwarding request method; when the requested data resource is a second-level resource, the data resource request is verified for legitimacy, and after the verification is passed, the data resource pointed to by the data resource request is obtained from the database where the second-level resource is located by using a cross-link routing forwarding request method; If the type of the data resource request is a multi-type and multi-level request, the data resource request is sent to a cross-chain route of the same type and target level, the target level information is added to the data resource request, the data resource request with the target level information added is sent to the cross-chain route of the target type, and the data resource pointed to by the data resource request is obtained; the cross-chain route is a service process that bridges the blockchain and the business smart contract deployed therein, and multiple cross-chain routers are connected to each other, and each chain sends a request to the cross-chain router, and the cross-chain routers forward the request to each other, thereby completing the operation of cross-chain access to resources.
2. The data circulation method based on alliance chain according to claim 1 is characterized in that: Also includes: If the type of the data resource request is a request of the same type and level, the data resource pointed to by the data resource request is obtained from the local database.
3. The data circulation method based on alliance chain according to claim 2 is characterized in that: The determining the type of the data resource request includes: Obtaining a level identifier and a type identifier parsed from the data resource request; Determine the level of the requested resource and the level of the data requester based on the level identifier, and obtain the type of the requested resource and the type of the data requester based on the type identifier; If the level of the requested resource is the same as the level of the data requester, and the type of the requested resource is the same as the type of the data requester, then determining that the type of the data resource request is a request of the same type and level; If the level of the requested resource is different from the level of the data requester, and the type of the requested resource is the same as the type of the data requester, then determining that the type of the data resource request is a same-type multi-level request; If the level of the requested resource is different from the level of the data requester, and the type of the requested resource is different from the type of the data requester, then it is determined that the type of the data resource request is a multi-type and multi-level request.
4. The data circulation method based on alliance chain according to claim 1 is characterized in that: The adding target level information to the data resource request specifically includes: In the case where the requested data resource is the first level resource, adding target level information to the data resource request; In the case that the requested data resource is the second-level resource, the legitimacy of the data resource request is verified, and after the verification is passed, the target level information is added to the data resource request.
5. The data circulation method based on the alliance chain according to any one of claims 1 to 4, characterized in that: The method for obtaining the data resource pointed to by the data resource request includes: generating an access request with attributes based on the attribute information carried in the data resource request; Validating the access request based on an attribute access policy; If the verification is successful, the data holder uses the public key carried in the access request and the hash value of the requested data resource to find the key corresponding to the requested data resource, and uses the key to encrypt the public key and send it to the data requester, so that the data requester uses the private key to decrypt the key and obtain the data resource pointed to by the data resource request based on the key.
6. A data circulation system based on alliance chain, characterized in that: include: A parsing module, configured to parse the data resource request and determine the type of the data resource request; The data resource request is based on the corresponding private chain circulation; the private chains corresponding to the different types of data resource requests constitute a consortium chain; the consortium chain represents the level in the vertical direction and the type in the horizontal direction; there is a data circulation relationship between the consortium chain and the private chain; The first data resource acquisition module is configured to, if the type of the data resource request is a multi-level request of the same type, then in the case where the requested data resource is a first-level resource, obtain the data resource pointed to by the data resource request from the database where the first-level resource is located by means of cross-link routing forwarding request; in the case where the requested data resource is a second-level resource, perform a legitimacy verification on the data resource request, and after the verification is passed, obtain the data resource pointed to by the data resource request from the database where the second-level resource is located by means of cross-link routing forwarding request; The second data resource acquisition module is configured to send the data resource request to the cross-chain route of the same type and target level if the type of the data resource request is a multi-type and multi-level request, add the target level information to the data resource request, send the data resource request with the target level information added to the cross-chain route of the target type and obtain the data resource pointed to by the data resource request; the cross-chain route is a service process that bridges the blockchain and the business smart contract deployed therein, and multiple cross-chain routers are connected to each other, and each chain sends a request to the cross-chain router, and the cross-chain routers forward the request to each other, thereby completing the operation of cross-chain access to resources.
7. The data circulation system based on alliance chain according to claim 6 is characterized in that: Also includes: The third data resource obtaining module is configured to obtain the data resource pointed to by the data resource request from the local database if the type of the data resource request is a request of the same type and level.
8. The data circulation system based on alliance chain according to claim 7 is characterized in that: The parsing module is specifically configured as follows: Obtaining a level identifier and a type identifier parsed from the data resource request; Determine the level of the requested resource and the level of the data requester based on the level identifier, and obtain the type of the requested resource and the type of the data requester based on the type identifier; If the level of the requested resource is the same as the level of the data requester, and the type of the requested resource is the same as the type of the data requester, then determining that the type of the data resource request is a request of the same type and level; If the level of the requested resource is different from the level of the data requester, and the type of the requested resource is the same as the type of the data requester, then determining that the type of the data resource request is a same-type multi-level request; If the level of the requested resource is different from the level of the data requester, and the type of the requested resource is different from the type of the data requester, then it is determined that the type of the data resource request is a multi-type and multi-level request.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program, and when the program is executed by the processor, the data circulation method based on the alliance chain described in any one of claims 1 to 5 is implemented.
10. An electronic device, characterized in that: include: At least one processor, and at least one memory and bus connected to the processor; The processor and the memory communicate with each other via the bus; The processor is used to call the program instructions in the memory to execute the data circulation method based on the alliance chain as described in any one of claims 1-5.
