External chain code actuator controller, peer-to-peer controller, and methods for use in external chain code actuator controller and peer-to-peer controller
By introducing external chain code executor controllers and peer controllers into the blockchain platform, the problem of traditional blockchain platforms being difficult to support non-traditional data models is solved, and the entrusted execution of smart contract data models and multiple data are realized. The efficient processing of models improves the flexibility and efficiency of the blockchain system.
Patent Information
- Application Number
- CN202280069674.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-21
- Publication Date
- 2024-08-23
AI Technical Summary
It is difficult for traditional blockchain platforms to support non-traditional data models, resulting in technical challenges in the entrusted execution of smart contracts. Especially when adding a new world state database or replacing an existing database, the complexity is high and the new data model cannot be effectively integrated.
Provide an external chain code executor controller to realize the conversion and storage of different data models through the block tracking circuit, block submitter circuit, data model type chain code interface and data access layer, and support the smart contract data model Delegate execution and deploy new chaincode versions on peers via peer controllers, increasing efficiency and reducing latency.
It realizes the non-invasive integration of new data models into smart contract APIs, supports smart contract entrustment execution of different data model types, including time series and graph data models, improves the flexibility and efficiency of the blockchain system, and can Efficiently handle databases with multiple data model types.
Smart Images

Figure CN118541682A
Abstract
Description
Technical Field
[0001] The present invention generally relates to the field of blockchain technology, and more specifically, to an external chaincode (CC) executor controller and a method used in the external CC executor controller. In addition, the present invention more specifically relates to a peer controller and a method used in the peer controller for receiving a script from the external CC executor controller. Background Art
[0002] Typically, a blockchain platform includes multiple blockchain nodes that include an append-only, tamper-proof distributed ledger and a blockchain. Each block in the blockchain in each blockchain node includes a batch of transactions and a reference point to the previous block by storing a hash value of the previous block generated by a cryptographic hash function. In addition, each blockchain node in the blockchain platform keeps a current snapshot of the global state for easy data lookup, which is stored in a distributed ledger that is managed in a world state database.
[0003] Traditionally, a world state database stores a key-value abstraction that is used to capture updates to keys that are changed by transactions. However, in traditional blockchain platforms, adding one or more new world state databases or replacing one or more new world state databases with existing ones is very complex because the world state database is integrated into the architecture of the blockchain platform and the smart contract application programming interface (API). Therefore, in traditional blockchain platforms, adding a new world state database or replacing a new world state database with a non-traditional data model is complex and undesirable. However, traditional blockchain platforms cannot support different databases with non-traditional data models, and there are technical issues on how to provide delegated execution of smart contracts.
[0004] Therefore, in view of the above discussion, there is a need to overcome the above-mentioned shortcomings associated with traditional blockchain platforms and methods related to integrating new data models into smart contract application programming interfaces (APIs). Summary of the invention
[0005] The present invention provides an external chaincode (CC) executor controller and a method used in the external CC executor controller. The present invention also provides a peer controller and a method used in the peer controller for receiving a script from the external CC executor controller. The present invention provides a solution to the existing problem of how to efficiently and reliably provide delegated execution of smart contracts. The purpose of the present invention is to provide a solution that at least partially overcomes the problems encountered in the prior art and provides an improved external executor (CC) controller by, for example, non-invasively integrating a new data model into a smart contract API.
[0006] One or more objects of the invention are achieved by what is presented in the attached independent claims. Advantageous implementations of the invention are further defined in the dependent claims.
[0007] In one aspect, the present invention provides an external chaincode (CC) executor controller, the external chaincode executor controller comprising: a block tracking circuit for registering events with one or more peer controllers; a block committer circuit; a first data model type chaincode interface; a first data model type data access layer (DAL) for receiving data points, converting the data points to a native first data model type, and storing the native first data model type in a first data model type database. In addition, the external CC executor controller comprises: a second data model type chaincode interface; a second data model type DAL for receiving data points, converting the data points to a native second data model type, and storing the native second data model type in a second data model type database. In addition, the block committer circuit is used to: receive a new block notification, determine that the new block notification includes a smart contract data model, and respond thereto. In addition, the block committer circuit is used to: when the smart contract data model is related to the first data model type, schedule the smart contract data model to the first data model type DAL through the first data model type chain code interface; when the smart contract data model is related to the second data model type, schedule the smart contract data model to the second data model type DAL through the second data model type chain code interface.
[0008] The external CC executor controller is used to efficiently and reliably support the delegated execution of smart contract data models. In addition, the external CC executor controller can also efficiently handle time series data model type databases (i.e., Internet of Things (IoT) workloads), graph data model type databases, etc. In addition, the external CC executor controller is used to detect non-key-value databases pre-configured for computing new CC versions by registering new block events for supporting different data model types in the blockchain system.
[0009] In one implementation, the external CC executor controller is used to receive a CC query, determine which DAL the CC query is associated with, and cause a matching DAL to execute the query on a connected database.
[0010] The external CC executor controller enables new data models to run within smart contracts without changing the existing implementation of the blockchain platform.
[0011] In another implementation, the first data model type DAL is used to collect the received point elements into a first data model type database using a collection method, and to perform a query on the first data model type database.
[0012] In this implementation, the first data model type DAL is used to enable the first data model type database to efficiently and effectively execute queries while reducing latency by efficiently detecting the type of the data model.
[0013] In another implementation, the acquisition method causes the external CC executor controller to convert the incoming point element into a key-value pair, key = DATAMODEL_ID_<hash of the incoming point element>, value = serialization of the incoming point element, and calls the peer controller to inject the generated key-value pair.
[0014] Advantageously, the acquisition method can efficiently and reliably detect native data types, such as a first native data type and a second native data type, to generate a unique key.
[0015] In another implementation, the first data model type DAL is used to identify a received key-value pair that encapsulates an element of the first smart contract data model type using an identification method, wherein the identification method enables the external CC executor controller to accept a key-value pair, determine whether the key starts with "DATAMODEL_ID_", and then return "true", and if the key does not start with "DATAMODEL_ID_", it returns "false".
[0016] In this implementation, the first data model type DAL is used to efficiently and reliably identify encapsulated data types.
[0017] In another implementation, the block committer circuit is used to track processed blocks using the Hyperledger Fabric block distribution bookkeeping and only request blocks that have not been fully processed by the block committer circuit. The Hyperledger Fabric block distribution bookkeeping can implement delegated execution of smart contracts that support different data model types.
[0018] In another implementation, the first data model type is a time series data type.
[0019] In another implementation, the first data model type is a graphic data type.
[0020] In these implementations, an external CC executor controller can implement smart contract delegated execution including new database-specific plugins to provide different operations performed by different data model types (e.g., time series data types and graph data types).
[0021] In another aspect, the present invention provides a peer controller for receiving a script from an external CC executor controller according to any one of the above claims. In addition, the peer controller is used to provide notification of new blocks to the external CC executor when a new chain code version is deployed on the peer.
[0022] Beneficially, peer controllers are used to support delegated execution of smart contracts by, for example, deploying new chaincode versions on peer controllers with increased efficiency and reduced latency.
[0023] In yet another aspect, the present invention provides a method for use in an external chaincode (CC) executor controller, the method comprising: a block tracking circuit for registering events with one or more peer controllers; a block committer circuit; a first data model type chaincode interface; a first data model type data access layer (DAL) for receiving a data point, converting the data point to a native first data model type data type, and storing the native first data model type data type in a first data model type database; a second data model type chaincode interface; a second data model type DAL for receiving a data point, converting the data point to a native second data model type data type, and storing the native second data model type data type in a second data model type database. The method comprises: receiving a new block notification, determining that the new block notification includes a smart contract data model, and responding thereto. In addition, the method includes: when the smart contract data model is related to the first data model type, scheduling the smart contract to the first data model type DAL through the first data model type chain code interface; when the smart contract data model is related to the second data model type, scheduling the smart contract to the second data model type DAL through the second data model type chain code interface.
[0024] The method achieves all the advantages and technical effects of the external CC actuator controller of the present invention.
[0025] In another aspect, the present invention provides a method for use in a peer controller for receiving a script from an external CC executor controller. The method includes providing notification of new blocks to the external CC executor when a new chain code version is deployed on the peer.
[0026] The method achieves all the advantages and technical effects of the peer controller of the present invention.
[0027] It should be understood that all the aforementioned implementations can be combined together.
[0028] It should be noted that all equipment, elements, circuits, units and devices described in this application can be implemented in software or hardware elements or any type of combination thereof. All steps performed by various entities described in this application and the functions to be performed by various entities described are intended to refer to that the corresponding entities are suitable for or used to perform the corresponding steps and functions. Although in the description of the following specific embodiments, the specific functions or steps to be performed by the external entity are not reflected in the description of the specific detailed elements of the entity performing the specific steps or functions, it should be clear to the technician that these methods and functions can be implemented by corresponding hardware or software elements or any combination thereof. It should be understood that the features of the present invention are easy to be combined in various combinations without departing from the scope of the present invention defined by the appended claims.
[0029] Other aspects, advantages, features and objects of the present invention will become apparent from the accompanying drawings and detailed description of illustrative implementations interpreted in conjunction with the following appended claims. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] The above summary of the invention and the following detailed description of illustrative embodiments may be better understood when read in conjunction with the accompanying drawings. In order to illustrate the present invention, exemplary structures of the present invention are shown in the accompanying drawings. However, the present invention is not limited to the specific methods and tools disclosed herein. In addition, it should be understood by those skilled in the art that the accompanying drawings are not drawn to scale. Where possible, similar elements are represented by the same numerals.
[0031] Embodiments of the present invention are described below by way of example only with reference to the following drawings, in which:
[0032] Figure 1 is a block diagram of an external chain code executor controller according to an embodiment of the present invention;
[0033] Figure 2 is a flowchart of a method used in an external chain code (chaincode, CC) actuator controller according to an embodiment of the present invention;
[0034] Figure 3 A block diagram of a peer controller for receiving a script from an external chaincode (CC) controller according to an embodiment of the present invention is shown;
[0035] Figure 4 is a flow chart of a method used in a peer controller for receiving a script from an external CC executor controller according to an embodiment of the present invention;
[0036] Figure 5 An architectural diagram for implementing delegated execution of smart contracts according to an embodiment of the present invention is shown.
[0037] In the drawings, underlined numbers are used to indicate the item in which the underlined number is located or an item adjacent to the underlined number. Non-underlined numbers are associated with the item identified by the line that associates the non-underlined number with the item. When a number is not underlined and has an associated arrow, the non-underlined number is used to identify the general item that the arrow points to. DETAILED DESCRIPTION
[0038] The following detailed description describes embodiments of the invention and ways in which these embodiments may be implemented. Although some modes of implementing the invention have been disclosed, those skilled in the art will recognize that there may be other embodiments for implementing or practicing the invention.
[0039] Figure 1 is a block diagram of an external chain code executor controller according to an embodiment of the present invention. Figure 1 , a block diagram 100 of an external chaincode (CC) executor controller 102 including a block tracking circuit 106 and a block committer circuit 108 is shown.
[0040] The external CC executor controller 102 is used to receive CC queries to non-invasively integrate new data models into the smart contract API. In addition, the external CC executor controller 102 is used to support new data model types (i.e., time series databases or graph databases) by making full use of existing parts of Hyperledger Fabric. Examples of implementing the external CC executor controller 102 may include, but are not limited to: central data processing devices, microprocessors, microcontrollers, complex instruction set computing (CISC) processors, application-specific integrated circuit (ASIC) processors, reduced instruction set (RISC) processors, very long instruction word (VLIW) processors, state machines, and other processors or control circuits.
[0041] refer to Figure 1, one or more peer controllers 104 are shown for receiving scripts from an external CC executor controller 102. Examples of implementing one or more peer controllers 104 may include, but are not limited to: central data processing devices, microprocessors, microcontrollers, complex instruction set computing (CISC) processors, application-specific integrated circuit (ASIC) processors, reduced instruction set (RISC) processors, very long instruction word (VLIW) processors, state machines, and other processors or control circuits.
[0042] At runtime, the block tracking circuit 106 is used to register events with the one or more peer controllers 104. According to one embodiment, the block tracking circuit 106 is used to register new block events on all channels that a peer controller in the one or more peer controllers 104 has joined. In addition, the external CC executor controller 102 is dedicated to the corresponding peer controller, and the block tracking circuit 106 is used to handle the CC version on the corresponding peer controller. In one implementation, the block tracking circuit 106 is used to register events on new blocks through the Hyperledger Fabric software development kit (SDK) application programming interface (API) of the one or more peer controllers 104.
[0043] According to one embodiment, the external CC executor controller 102 is further configured to receive a CC query, determine which data access layer (DAL) the CC query is associated with, and cause a matching DAL to perform the CC query on a connected database. For example, the external CC executor controller 102 receives a time range query to retrieve data from a time series database. In addition, a CC query application programming interface (API) method is used to determine a matching DAL to perform a CC query on a connected database through a getTSQueryResult(query_string) operation, etc., to retrieve data. In one example, the external CC executor controller 102 determines through a CC query API method, etc. that the CC query is associated with a first data model type DAL 112. In this case, the first data model type DAL 112 is used to perform the CC query on a first data model type database 114. In another example, the external CC executor controller 102 determines through a CC query API method, etc. that the CC query is associated with a second data model type DAL 120. In this case, the second data model type DAL 120 is used to perform the CC query on a second data model type database 122. Therefore, the external CC actuator controller 102 supports new data models to run within smart contracts without changing the existing implementation of the blockchain platform.
[0044] In addition, the external CC executor controller 102 includes a block committer circuit 108, which is used to receive a new block notification and then determine that the new block notification includes a smart contract data model. In addition, if the new block notification includes a smart contract data model, the block committer circuit 108 is used to determine whether the smart contract data model is related to the first data model type DAL 112 or the second data model type DAL 120. Thereafter, the block committer circuit 108 is used to: when the smart contract data model is related to the first data model type DAL 112, dispatch the smart contract data model to the first data model type DAL 112 through the first data model type CC interface 110. In addition, the block committer circuit 108 is used to: when the smart contract data model is related to the second data model type DAL 120, dispatch the smart contract data model to the second data model type DAL 120 through the second data model type chain code interface 118.
[0045] In addition, the first data model type DAL 112 is further configured to receive a data point and convert the data point into a native first data model type 116. Thereafter, the first data model type DAL 112 is configured to store the native first data model type 116 in the first data model type database 114. In addition, the second data model type DAL 120 is configured to receive a data point and convert the data point into a native second data model type 124; thereafter, the native second data model type 124 is stored in the second data model type database 122.
[0046] In one implementation, the first data model type DAL 112 is a time series data type for processing Internet of Things (IoT) workloads by efficiently and effectively processing non-traditional data types. In another implementation, the first data model type DAL 112 is a graph data type for processing workloads including relationship management by efficiently and effectively processing non-traditional data types. Therefore, the external CC executor controller 102 can implement smart contract delegation execution including new database-specific plug-ins to provide different operations performed by different data model types (e.g., time series data types and graph data types).
[0047] According to one embodiment, the first data model type DAL 112 is used to collect the received data point elements into the first data model type database 114 using a collection method to perform a query on the first data model type database 114. In one implementation, the first data model type DAL 112 is a time series data type, which is used to collect the received data point elements into the time series data model type database using a collection method to perform a query on the time series data model type database. In another implementation, the first data model type DAL 112 is a graph sequence data type, which is used to collect the received data point elements into the graph sequence data model type database using a collection method to perform a query on the graph sequence data model type database (e.g., the first data model type database 114). Therefore, the first data model type DAL 112 is used to enable the first data model type database 114 to perform queries efficiently and effectively while reducing delays by efficiently detecting the type of the data model and the like. According to one embodiment, the collection method causes the external CC executor controller 102 to convert the incoming point element into a key-value pair, for example, key = DATAMODEL_ID_<hash of the incoming point element>, value = serialization of the incoming point element. Thereafter, the external CC executor controller 102 is used to call a peer controller in one or more peer controllers 104 to inject the generated key-value pair. For example, the external CC executor controller 102 is used to convert the incoming point element into a key-value pair, that is, key = TS_<hash of the incoming point element>, value = serialization of the incoming point element into an influxDB line protocol string representation. Thereafter, the external CC executor controller 102 is used to call a peer controller in one or more peer controllers 104 through a putState(k,v) method with the generated key-value pair. In addition, the smart contract calls the collection application programming interface (API) through a collection method that includes a "traditional" key-value API set. In one example, the acquisition method is non-key-valued, and the external CC actuator controller 102 receives "putTSState(Point)" from a time-series (TS) provider, for example, from the first data model type DAL 112. In addition, the TS data access layer (DAL) is used to convert the data point into a key-value structure, and can efficiently detect the native data type to provide a unique key, which is easy to convert the native data type back to the original data type. Therefore, the native data types, such as the native first data model type 116 and the native second data model type 124, can be efficiently and reliably detected to generate a unique key.
[0048] According to one embodiment, the first data model type DAL 112 is used to identify the received key-value pairs that encapsulate the elements of the first smart contract data model type using an identification method. First, the identification method enables the external CC executor controller 102 to accept the key-value pairs. Thereafter, it is determined whether the key starts with "DATAMODEL_ID_". In addition, if the key starts with "DATAMODEL_ID", in this case, the external CC executor controller 102 is used to return a "true" statement, and if the key does not start with "DATAMODEL_ID", in this case, the external CC executor controller 102 is used to return a "false" statement. Therefore, the first data model type DAL 112 can efficiently and reliably identify the encapsulated data type.
[0049] According to one embodiment, the block committer circuit 108 is used to receive a transaction marked as valid from a peer controller. In addition, the transaction includes one or more write sets, each of which includes one or more key-value elements. In addition, the block committer circuit 108 is used to identify the type of the value of the key-value element by matching the key with the key-value element of the DATAMODEL_ID of the smart contract data model type. Thereafter, the block committer circuit 108 is used to send the key-value pair to the acquisition method of any matching smart contract data model DAL to perform a query on the corresponding database. For example, finally, the block committer circuit 108 is used to mark the corresponding transaction as completed. In one implementation, once the new block is verified by the peer controller, the block committer circuit 108 is used to receive a transaction marked as valid from the peer controller. Thereafter, the block committer circuit 108 detects various data points where the data model type key value does not match. In addition, these data points are routed to the matching data model DAL component to be converted back to the native data type and persisted in the corresponding database.
[0050] According to one embodiment, the block committer circuit 108 is used to track processed blocks using the Hyperledger Fabric block distribution bookkeeping, and only request blocks that have not been fully processed by the block committer circuit. The Hyperledger Fabric block distribution bookkeeping provides many APIs to support smart contract data models in various programming languages. The Hyperledger Fabric block distribution bookkeeping (e.g., Kubernetes (Container Cluster Management System)) can preconfigure CC execution managed by peer controllers in one or more peer controllers 104. In addition, the external CC executor controller 102 is regarded as stateless, and the peer controller is used to handle all state queries, such as CC queries. In addition, the Hyperledger Fabric block distribution bookkeeping can implement delegated execution of smart contracts. Therefore, delegated execution of smart contracts supporting different data model types can be implemented.
[0051] Therefore, the external CC executor controller 102 is used to efficiently and reliably support the delegated execution of the smart contract data model. In addition, the external CC executor controller 102 can also efficiently handle time series data model type databases (i.e., Internet of Things (IoT) workloads), graph data model type databases, etc. In addition, the external CC executor controller 102 is used to detect a non-key-value database pre-configured for calculating a new CC version by registering new block events for supporting different data model types in the blockchain system.
[0052] Figure 2 is a flowchart of a method used in an external chaincode (CC) executor controller according to an embodiment of the present invention. Figure 2 Combination Figure 1 The elements in the reference are described. Figure 2 , a flow chart of method 200 including steps 202 to 208 is shown. Figure 1 The external chain code (chaincode, CC) executor controller 102 is used to execute the method 200.
[0053] A method 200 is provided for use in an external CC executor controller 102. The external CC executor controller 102 includes: a block tracking circuit 106 for registering events with one or more peer controllers 104; a block committer circuit 108; a first data model type chain code interface 110; a first data model type data access layer (DAL) 112 for receiving data points, converting the data points to a native first data model type 116, and storing the native first data model type 116 in a first data model type database 114. The external CC executor controller 102 also includes: a second data model type chain code interface 118; a second data model type DAL 120 for receiving data points, converting the data points to a native second data model type 124, and storing the native second data model type 124 in a second data model type database 122.
[0054] In step 202, method 200 includes: receiving a new block notification. In addition, in step 204, method 200 also includes: determining that the new block notification includes a smart contract data model. In addition, if the new block notification includes a smart contract data model, method 200 includes: determining whether the smart contract data model is associated with the first data model type DAL 112 or the second data model type DAL 120. In addition, in step 206, method 200 also includes: when the smart contract data model is associated with the first data model type DAL 112, scheduling the smart contract to the first data model type DAL 112 through the first data model type chaincode interface 110. In addition, in step 208, method 200 includes: when the smart contract data model is associated with the second data model type, scheduling the smart contract to the second data model type DAL through the second data model type chaincode interface.
[0055] Therefore, the method 200 efficiently and reliably supports the delegated execution of smart contracts. In addition, the method 200 is used to efficiently process time series data model type databases (i.e., Internet of Things (IoT) workloads), graph data model type databases, etc. In addition, the method 200 is used to detect a non-key-value database pre-configured for computing a new chain code version by registering new block events for supporting different data model types in a blockchain system.
[0056] Steps 202 to 208 are merely illustrative, and other alternatives may be provided in which one or more steps are added, one or more steps are deleted, or one or more steps are provided in a different order without departing from the scope of the claims herein.
[0057] A computer program product is provided, comprising program instructions, wherein the program instructions are used to perform method 200 when executed by one or more processors in a blockchain system. The computer program product is implemented as an algorithm, embedded in software stored in a non-transitory computer-readable storage medium, on which the program instructions are stored, and the program instructions can be executed by one or more processors in a computer system to perform method 200. The non-transitory computer-readable storage medium may include, but is not limited to: an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the above devices. Examples of implementing computer-readable storage media include, but are not limited to: an electrically erasable programmable read-only memory (EEPROM), a random access memory (RAM), a read-only memory (ROM), a hard disk drive (HDD), a flash memory, a secure digital (SD) card, a solid-state drive (SSD), a computer-readable storage medium, and / or a CPU cache memory.
[0058] Figure 3 A block diagram of a peer controller for receiving a script from an external chaincode (CC) controller according to an embodiment of the present invention is shown. Figure 2 , a block diagram 300 of a peer controller 302 and an external CC actuator controller 102 is shown.
[0059] The peer controller 302 is used to receive the script from the external CC executor controller 102. Examples of implementing the peer controller 302 may include, but are not limited to: a central data processing device, a microprocessor, a microcontroller, a complex instruction set computing (CISC) processor, an application-specific integrated circuit (ASIC) processor, a reduced instruction set (RISC) processor, a very long instruction word (VLIW) processor, a state machine, and other processors or control circuits.
[0060] At runtime, the peer controller 302 is used to receive scripts from the external CC executor controller 102 and provide notifications of new blocks to the external CC executor controller 102 when a new chain code version is deployed on the peer controller 302. In one implementation, the build package script is deployed on the file system of the peer, such as on the peer controller 302, so as to trigger the pre-configuration of the external CC executor controller 102 when a new chain code version is deployed on the peer controller 302. According to one embodiment, the peer controller 302 is used to execute the script to resolve on which channel ID the chain code has been deployed. In addition, the peer controller 302 is used to register the external CC executor controller 102 as an entity in Hyperledger Fabric. Thereafter, a unique business name is generated for the external CC executor controller 102. In addition, the peer controller 302 is used to inject the channel ID, the business name of the chain code 'packageID' and the peer connection details into the external CC executor configuration file. Finally, the peer controller 302 is used to call the pre-configuration business to pre-configure the external CC executor controller 102 with the notification of the new block. For example, Kubernetes is a pre-configuration service called by the peer controller 302 to pre-configure the external CC executor controller 102. Therefore, the peer controller 302 is used to support the delegated execution of smart contracts by, for example, deploying new chain code versions on the peer controller 302 with improved efficiency and reduced latency.
[0061] Figure 4 is a flow chart of a method used in a peer controller for receiving a script from an external CC executor controller according to an embodiment of the present invention. Figure 4 Combination Figure 1 and Figure 3 The elements in the reference are described. Figure 4 , a flow chart of a method 400 including steps 402 to 404 is shown. Figure 3 ) peer controller 302 is used to execute method 400.
[0062] At step 402, a method 400 is provided for use in a peer controller 302 for receiving a script from an external CC executor controller 102. In one implementation, the buildpack script is deployed on a file system of a peer by the peer controller 302, etc., so as to trigger pre-configuration of the external CC executor controller 102 when a new chaincode version is deployed on the peer. In addition, at step 404, the method 400 includes: providing notification of a new block to the external CC executor when a new chaincode version is deployed on the peer. Thus, the method 400 is used to support delegated execution of smart contracts by, for example, deploying a new chaincode version on the peer controller 302 with increased efficiency and reduced latency.
[0063] Steps 402 to 404 are merely illustrative, and other alternatives may be provided in which one or more steps are added, one or more steps are deleted, or one or more steps are provided in a different order without departing from the scope of the claims herein.
[0064] A computer program product is provided, comprising program instructions, wherein the program instructions are used to perform method 400 when executed by one or more processors in a blockchain system. The computer program product is implemented as an algorithm, embedded in software stored in a non-transitory computer-readable storage medium, on which the program instructions are stored, and the program instructions can be executed by one or more processors in a computer system to perform method 400. The non-transitory computer-readable storage medium may include, but is not limited to: an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the above devices. Examples of implementing computer-readable storage media include, but are not limited to: an electrically erasable programmable read-only memory (EEPROM), a random access memory (RAM), a read-only memory (ROM), a hard disk drive (HDD), a flash memory, a secure digital (SD) card, a solid-state drive (SSD), a computer-readable storage medium, and / or a CPU cache memory.
[0065] Figure 5 An architectural diagram for implementing delegated execution of smart contracts according to an embodiment of the present invention is shown. Figure 5 Combination Figure 1 and Figure 3 The elements in the reference are described. Figure 5 , a diagram 500 is shown including a peer controller 302 and an external CC executor controller 102 for non-intrusively integrating a new data model into a smart contract API.
[0066] In one implementation, Hyperledger Fabric is used to support delegated execution of smart contracts. In addition, the external CC executor controller 102 is used to register events with the peer controller 302, for example, through the block tracking circuit 106 included in the external CC executor controller 102 in operation 502. Thereafter, the block committer circuit 108 is used to receive new notifications through operations 504, etc. In addition, in operation 506, the peer controller 302 is used to perform endorsement. In one example, a key value data access layer (KV DAL) 508 is used to extract data points from a key value database (DB) 510, and the block committer circuit 108 is used to convert the incoming data point elements into key-value pairs.
[0067] The block committer circuit 108 is further configured to: when the smart contract data model is associated with a time series DAL 516 (i.e., the first data model type DAL 112), determine that the new block notification includes the smart contract data model, and in response thereto, dispatch the smart contract data model to a time series data access layer (DAL) 516 (i.e., the first data model type DAL 112) via a time series data model type chaincode application programming interface (API) 514. In addition, the time series DAL 516 is configured to receive data points, convert the data points to native time series data model type data types, and store the native time series data model types in a time series (TS) database 518 (e.g., the first data model type database 114). In another implementation, the block committer circuit 108 is configured to: when the smart contract data model is associated with the graph sequence DAL 522 (i.e., the first data model type DAL 112), determine that the new block notification includes the smart contract data model, and in response thereto, dispatch the smart contract data model to the graph sequence data model type DAL 522 (i.e., the first data model type DAL 112) through the graph sequence CC API 520 (i.e., the first data model type CC interface 110). In addition, the graph sequence DAL 522 is configured to receive the data point, convert the data point to a native graph sequence data model type data type, and store the native graph sequence data model type data type in the graph sequence database 524 (e.g., the first data model type database 114). In addition, the smart contract is executed through the external CC executor controller 102 to take full advantage of the new functionality enabled by the databases (e.g., the TS database 518 and the graph sequence database 524) by utilizing the data model properties and operations of the databases. In one example, a pre-configured agent 512 (e.g., Kubernetes) is used to monitor peer controllers 302 and external CC executor controllers 102. Thus, the ability to delegate smart contract execution is fully exploited through new DB specific plugins, etc., which provide new operations enabled by the plugin's data model type.
[0068] Without departing from the scope of the invention as defined by the appended claims, the embodiments of the invention described above may be modified. Expressions such as "including", "comprising", "incorporating", "having", "being / being" etc. used to describe and claim the present invention are intended to be interpreted in a non-exclusive manner, i.e., allowing items, components or elements not explicitly described to also exist. References to the singular should also be interpreted as involving the plural. The word "exemplary" used herein means "as an example, instance or illustration". Any embodiment described as "exemplary" is not necessarily interpreted as being more preferred or more advantageous than other embodiments, or excluding the combination of the features of other embodiments. The word "optionally" used herein means "provided in some embodiments and not provided in other embodiments". It should be understood that certain features of the present invention described in the context of a single embodiment for the sake of clarity may also be provided in a single embodiment by combination. On the contrary, the various features of the present invention described in the context of a single embodiment for the sake of clarity may also be provided individually or by any suitable combination or as any other described embodiment of the present invention.
Claims
1. An external chain code (CC) actuator controller (102), characterized in that: include: Block tracking circuitry (106) for registering events with one or more peer controllers (104); Block committer circuit (108); First data model type chain code interface (110); a first data model type data access layer (DAL) (112) for receiving data points, converting the data points into a native first data model type, and storing the native first data model type in a first data model type database (114); Second data model type chain code interface (118); a second data model type DAL (120) for receiving a data point, converting the data point into a native second data model type, and storing the native second data model type in a second data model type database (220), wherein the block committer circuit (108) is configured to: Receive notifications of new blocks, determining that the new block notification includes a smart contract data model, and in response thereto, When the smart contract data model is related to the first data model type DAL (112), the smart contract data model is dispatched to the first data model type DAL (112) through the first data model type chain code interface (110), When the smart contract data model is related to the second data model type DAL (120), the smart contract data model is dispatched to the second data model type DAL (120) through the second data model type chain code interface (118).
2. The external CC actuator controller (102) according to claim 1, characterized in that The external CC executor controller (102) is used to receive a CC query, determine which DAL the CC query is associated with, and enable the matching DAL to execute the query on the connected database.
3. The external CC actuator controller (102) according to claim 1 or 2, characterized in that: The first data model type DAL (112) is used to collect the received point elements into the first data model type database (114) using a collection method, and to perform a query on the first data model type database (114).
4. The external CC actuator controller (102) according to claim 3, characterized in that The acquisition method enables the external CC actuator controller (102) to perform the following operations: Convert the incoming point element into the following key-value pair: Key = DATAMODEL_ID_<hash of the incoming point element>, Value = serialization of the incoming point element, The peer controller (302) is called to inject the generated key-value pairs.
5. The external CC actuator controller (102) according to any one of the preceding claims, characterized in that The first data model type DAL (112) is used to identify a received key-value pair encapsulating an element of the first smart contract data model type using an identification method, wherein the identification method causes the external CC executor controller (102) to perform the following operations: Accepts key-value pairs Determine if the key begins with "DATAMODEL_ID_", then Returns "true" if the key does not begin with "DATAMODEL_ID_", It returns "false".
6. The external CC actuator controller (102) according to any one of the preceding claims, characterized in that The block committer circuit (108) is used to: receiving a transaction marked as valid from the peer controller (302), wherein the transaction comprises one or more write-sets, each write-set comprising one or more key-value elements; Identifying the type of the value of the key-value element by matching the key of the key-value element with any DATAMODEL_ID of the smart contract data model type; Send the key-value pair to any matching smart contract data model DAL collection method; Marks the transaction as completed.
7. The external CC actuator controller (102) according to claim 6, characterized in that The block committer circuit (108) is used to track processed blocks using Hyperledger Fabric block distribution bookkeeping and only request blocks that have not been fully processed by the block committer circuit.
8. The external CC actuator controller (102) according to any one of the preceding claims, characterized in that The block tracker circuit (106) is used to register new block events on all channels that the peer controller (302) has joined that process the chain code version dedicated to the external CC executor controller (102).
9. The external CC actuator controller (102) according to any one of the preceding claims, characterized in that The first data model type DAL (112) is a time series data type.
10. The external CC actuator controller (102) according to any one of the preceding claims, characterized in that The first data model type DAL (112) is a graphic data type.
11. A peer controller (302) for receiving a script from an external CC actuator controller (102) according to any one of the preceding claims, characterized in that The peer controller (302) is used to: When a new chaincode version is deployed on the peer controller (302), notification of new blocks is provided to the external CC executor controller (102).
12. The peer controller 302 according to claim 11, characterized in that: The peer controller (302) is used to execute the script, thereby: Parse the channel ID on which the chain code is deployed. Registering the external CC executor controller (102) as an entity in Hyperledger Fabric, generating a unique service name for the external CC actuator controller (102), Inject the channel ID, the business name 'packageID' of the chaincode and the peer connection details into the external executor configuration file, A preconfiguration service is invoked to preconfigure the external CC executor controller (102) with the notification of the new block.
13. A method (200) used in an external chain code (CC) actuator controller (102), characterized in that: include: Block tracking circuitry (106) for registering events with one or more peer controllers (104); Block committer circuit (108); First data model type chain code interface (110); a first data model type data access layer (DAL) (112) for receiving data points, converting the data points into native first data model type data types, and storing the native first data model type data types in a first data model type database (114); Second data model type chain code interface (118); A second data model type DAL (120) is configured to receive a data point, convert the data point into a native second data model type data type, and store the native second data model type data type in a second data model type database (122), wherein the method (200) comprises: Receive notifications of new blocks, determining that the new block notification includes a smart contract data model, and in response thereto, When the smart contract data model is related to the first data model type DAL (112), the smart contract is dispatched to the first data model type DAL (112) through the first data model type chain code interface (110), When the smart contract data model is related to a second data model type DAL (120), the smart contract is dispatched to the second data model type DAL (120) through the second data model type chain code interface (118).
14. A computer program product, characterized in that The method comprises program instructions, wherein the program instructions are used to perform the method (200) according to claim 13 when executed by one or more processors in a blockchain system.
15. A method (400) for use in a peer controller (302) for receiving a script from an external CC actuator controller (102) according to any one of claims 1 to 8, characterized in that The method (400) comprises: When a new chaincode version is deployed on the peer controller (302), notification of new blocks is provided to the external CC executor controller (102).
16. A computer program product, characterized in that The method comprises program instructions, wherein the program instructions are used to perform the method (400) according to claim 15 when executed by one or more processors in a blockchain system.
