CN115390986A - Intelligent contract parallel execution system based on state cryptographic chip - Google Patents
Intelligent contract parallel execution system based on state cryptographic chip Download PDFInfo
- Publication number
- CN115390986A CN115390986A CN202210781837.9A CN202210781837A CN115390986A CN 115390986 A CN115390986 A CN 115390986A CN 202210781837 A CN202210781837 A CN 202210781837A CN 115390986 A CN115390986 A CN 115390986A
- Authority
- CN
- China
- Prior art keywords
- intelligent contract
- execution
- parallel
- instruction
- intelligent
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/602—Providing cryptographic facilities or services
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/4557—Distribution of virtual machine instances; Migration and load balancing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/45591—Monitoring or debugging support
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Computing Systems (AREA)
- Health & Medical Sciences (AREA)
- Bioethics (AREA)
- General Health & Medical Sciences (AREA)
- Computer Hardware Design (AREA)
- Computer Security & Cryptography (AREA)
- Multi Processors (AREA)
Abstract
The invention provides an intelligent contract parallel execution system based on a national cipher chip, which comprises a block chain host, a system bus and a plurality of intelligent contract parallel coprocessors, wherein the block chain host is connected with the system bus through a bus; the block chain host computer realizes the parallel execution of a plurality of intelligent contracts by coordinating and calling a plurality of intelligent contract parallel coprocessors. A processor core of a central processing unit in the block chain host is used for realizing the functions of an intelligent contract virtual machine, analyzing an intelligent contract code to obtain an intelligent contract execution instruction, and calling a national password hardware engine if the instruction is a national password calculation instruction; if the instruction is a data parallel processing instruction, calling a vector processing unit; otherwise, the intelligent contract execution instruction is executed by the processor core. The method and the system solve the problem of low operation efficiency of the intelligent contract and provide safe and effective acceleration support for the intelligent contract comprising the national cryptographic algorithm.
Description
Technical Field
The invention relates to a computer application technology and a block chain technology, in particular to an intelligent contract parallel coprocessing technology.
Background
The block chain has the characteristics of traceability, decentralization, non-tampering and the like of internal data and information. Intelligent contracts use informatics to validate the execution of computer protocols based on blockchain technology, so that more complex realistic requirements can be achieved. The current intelligent contract technical scheme is mainly based on intelligent contract language Solidity, and a complete technical system comprising an intelligent contract programming language, a compiler, an intelligent contract virtual machine, events, a state machine and a fault-tolerant mechanism is constructed. With the development of the intelligent contract technical idea, various programming language groups have the requirement of writing the intelligent contract by adopting non-solid. The WebAssembly standard is intended to be a generic and efficient executable compiled file standard to allow code written in multiple high-level languages on the server side to be compiled into a WASM and executed in a browser or virtual machine. Therefore, intelligent contract virtual machines based on the WebAssembly standard are becoming a great trend of development of public link and alliance link intelligent contracts. However, currently, the mainstream intelligent contract virtual machine has low execution efficiency, which severely limits the execution efficiency of the block chain system. Secondly, the asymmetric encryption calculation of the intelligent contract transaction is low in efficiency, the support degree of the intelligent contract virtual machine to the national cryptographic algorithm is low, and the non-national cryptographic algorithm system block chain cannot be applied to the field of the core industry of China. Furthermore, currently, the smart contract virtual machine is executed on the blockchain service host directly and serially. On one hand, when a large number of intelligent contract virtual machines are executed concurrently, a large amount of system resources are consumed. On the other hand, compared with independent hardware execution, the host computer is more easily attacked maliciously and has potential safety hazards.
Disclosure of Invention
The invention aims to solve the technical problem of providing a parallel execution system of a coprocessor for providing acceleration support for an intelligent contract comprising a cryptographic algorithm.
The invention adopts the technical scheme that an intelligent contract parallel execution system based on a cryptographic chip comprises a block chain host, a system bus and a plurality of intelligent contract parallel coprocessors; the block chain host is connected with each intelligent contract parallel coprocessor through a system bus to realize bidirectional data communication;
the block chain host comprises an intelligent contract preloading module and a task scheduling module;
the intelligent contract preloading module is used for carrying out correlation and parallelism analysis on the intelligent contracts;
the task scheduling module is used for distributing tasks and receiving execution results, wherein the task distribution is to send intelligent contract codes belonging to the same task to an intelligent contract parallel coprocessor for execution; the execution result receiving is used for receiving intelligent execution result data returned by the intelligent contract parallel coprocessor after the intelligent contract execution operation is completed;
the intelligent contract parallel coprocessor comprises a central processing unit, an interface unit and a memory, wherein the central processing unit, the interface unit and the memory are all connected with a processor bus, and data interaction is realized through the processor bus;
the central processing unit comprises a processor core, a cryptographic hardware engine and a vector processing unit;
the state cipher hardware engine is used for carrying out accelerated calculation on the intelligent contract codes needing state cipher algorithm calculation in the intelligent contract codes;
the vector processing unit is used for performing parallel optimization processing on intelligent contract codes which need to perform data parallel computation;
the processor core is used for realizing the functions of an intelligent contract virtual machine, analyzing an intelligent contract execution instruction obtained by an intelligent contract code, judging whether the intelligent contract execution instruction is a national password calculation instruction or not, and calling a national password hardware engine if the intelligent contract execution instruction is the national password calculation instruction; if not, further judging whether the intelligent contract execution instruction is a data parallel processing instruction, if so, calling a vector processing unit; if not, the intelligent contract execution instruction is executed by the processor core.
The block chain host realizes the parallel execution of a plurality of intelligent contracts by coordinating and calling a plurality of intelligent contract parallel coprocessors, and provides safe and effective acceleration support for the intelligent contracts comprising the national cryptographic algorithm while solving the problem of low operating efficiency of the intelligent contracts.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a schematic structural diagram of an intelligent contract parallel coprocessor according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a central processing unit in an intelligent contract parallel coprocessor according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of an intelligent contract execution method according to an embodiment of the present invention;
fig. 4 is a schematic flowchart illustrating an intelligent contract virtual machine executing intelligent contract codes in an intelligent contract execution method according to an embodiment of the present invention;
fig. 5 is a schematic diagram of a composition of an intelligent contract parallel execution system according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments of the present invention, belong to the protection scope of the present invention.
The invention aims to construct a special parallel computing platform aiming at intelligent contract optimized execution by matching special software design with special hardware design, namely an intelligent contract parallel coprocessor, and the special hardware is called to accelerate the execution of an intelligent contract by matching the special hardware design with a special intelligent contract virtual machine instruction.
The following describes an embodiment of the intelligent contract parallel coprocessor based on the present invention in detail. As shown in fig. 1, a schematic structural diagram of an intelligent contract parallel coprocessor according to an embodiment of the present invention includes the following components: a central processing unit 101, an interface unit 102 and a memory 103. The central processor 101, the interface unit 102, and the memory 103 are connected by a bus 104. The bus 104 is used to provide a channel for intelligent contract parallel coprocessor internal data transfer.
The central processing unit 101 is configured to deploy an intelligent contract virtual machine for executing an intelligent contract code, and execute an instruction obtained by the intelligent contract virtual machine after analyzing the intelligent contract code. The intelligent contract virtual machine is an intelligent contract virtual machine which accords with a WebAssemably standard, can analyze a national secret algorithm calculation code and a vector processing code and calls corresponding specific hardware to accelerate execution; the intelligent contract code refers to intelligent contract code conforming to WebAssembly standard.
The interface unit 102 is configured to receive intelligent contract execution result data generated by the central processing unit 101, and send the intelligent contract execution result data to a block chain host connected to an intelligent contract parallel coprocessor; and the intelligent contract parallel coprocessor is used for acquiring intelligent contract data sent by the block chain host connected with the intelligent contract parallel coprocessor. The intelligent contract data includes, but is not limited to: intelligent contract code, intelligent contract execution command, intelligent contract input parameters, and the like.
The memory 103 is used for storing the intelligent contract code sent by the block chain host and received by the interface unit; and providing corresponding intelligent contract codes when the central processor executes the intelligent contract execution instruction.
Fig. 2 is a diagram of a cpu architecture according to an embodiment of the present invention. In the embodiment of the present invention, the central processor 101 includes a processor core 1011, a cryptographic hardware engine 1012, a vector processing unit 1013, a control bus 1014, and a data exchange bus 1015.
The processor core 1011 is used for loading intelligent contract codes from the memory 103 through the data exchange bus 1015 and the bus 104 when executing the intelligent contract; after the intelligent contract virtual machine analyzes the intelligent contract code, executing an intelligent contract instruction; further, the processor core maps the cryptographic algorithm calculation to the cryptographic hardware engine 1012 for execution through the control bus 1014 and the data exchange bus 1015 according to the cryptographic calculation instruction; further, the processor core maps the data parallel processing operation to the vector processing unit 1013 through the control bus 1014 and the data exchange bus 1015 according to the data parallel processing instruction;
it should be noted that the central processing unit 101 may be implemented by an Application Specific Integrated Circuit (ASIC), or may be implemented by a Field Programmable logic Array (FPGA) design loaded with a corresponding Circuit logic, which is not limited herein.
By adopting the intelligent contract parallel coprocessor provided by the embodiment of the invention, the specific calculation process can be mapped to the national secret hardware engine and the vector processing unit through the national secret calculation instruction and the data parallel processing instruction defined in the intelligent contract virtual machine to accelerate the execution of the intelligent contract, so that the execution efficiency of the intelligent contract needing the verification of the national secret algorithm is improved.
Corresponding to the intelligent contract parallel coprocessor, the invention provides an intelligent contract execution method. The embodiments of the intelligent contract execution method described below are merely illustrative. Fig. 3 is a schematic flow chart of an intelligent contract execution method according to an embodiment of the present invention.
The intelligent contract execution method specifically comprises the following steps:
step 301: and deploying an intelligent contract virtual machine which accords with the WebAssembly standard based on the central processor.
Step 302: receiving an intelligent contract code which is sent by a block chain host and conforms to the WebAssemblable standard based on an interface unit;
step 303: and storing the intelligent contract codes which are received by the interface unit and are sent by the blockchain host and conform to the WebAssemblable standard in a memory based on the central processor.
Step 304: and receiving an intelligent contract execution command and intelligent contract input parameters sent by the block chain host based on the interface unit.
Step 305: based on the central processing unit, the intelligent contract virtual machine is utilized, and corresponding intelligent contract codes are loaded from a memory according to an intelligent contract execution command sent by the block chain host computer and received by the interface unit, and the intelligent contract codes are analyzed and executed; and after the execution of the intelligent contract codes is completed, corresponding intelligent contract execution result data is sent to the interface unit.
Step 306: and sending corresponding intelligent contract execution result data to the block chain host based on the interface unit.
In an embodiment of the present invention, the implementation process of the intelligent contract code accelerated execution operation includes: analyzing an intelligent contract code based on the intelligent contract virtual machine to obtain an intelligent contract execution instruction; judging whether the intelligent contract instruction is a national contract calculation instruction or not based on the intelligent contract virtual machine; if yes, switching to the cryptographic hardware engine to execute operation; if not, further judging whether the intelligent contract instruction is a data parallel processing instruction or not; if yes, turning to the vector processing unit to execute operation; if not, executing the operation by the processor core; and after the current intelligent contract code instruction is executed, analyzing the next intelligent contract code based on the intelligent contract virtual machine, and if the new intelligent contract code is identified as a contract termination code, determining that the intelligent contract code is executed completely.
Specifically, reference may be made to fig. 4, which is a schematic flowchart illustrating an operation performed by an intelligent contract code instruction in an intelligent contract execution method according to an embodiment of the present invention. Step 401: the virtual machine analyzes the intelligent contract code; step 402: the virtual machine judges whether the instruction obtained by analyzing the codes is a cryptographic calculation instruction; if yes, the cryptographic hardware engine carries out execution; if not, go to step 403; step 403: judging whether the instruction is a data parallel processing instruction or not, if so, executing the instruction by a vector processing unit; if not, performing an execution operation by the processor core; step 404: after the current code is executed, the virtual machine analyzes the next intelligent contract code; if the new instruction obtained by the virtual machine analysis is not the intelligent contract termination instruction, continuing to execute the steps 401 to 404; and if the obtained new instruction is an intelligent contract termination instruction, the contract is completely executed.
By adopting the intelligent contract parallel coprocessor provided by the embodiment of the invention, the specific calculation process can be mapped to the national secret hardware engine and the vector processing unit through the national secret calculation instruction and the data parallel processing instruction defined in the intelligent contract virtual machine to accelerate the execution of the intelligent contract, so that the execution efficiency of the intelligent contract needing the verification of the national secret algorithm is improved.
Corresponding to the intelligent contract parallel coprocessor and the method, the invention also provides an intelligent contract parallel execution system. Because the specific execution embodiment of the intelligent contract in the intelligent contract parallel execution system is similar to the above-mentioned intelligent contract parallel coprocessor and method embodiment, the description is relatively simple, and please refer to the description of the above-mentioned intelligent contract parallel coprocessor and method embodiment, and the below-described intelligent contract parallel execution system is only schematic. Fig. 5 is a schematic diagram illustrating a composition of an intelligent contract parallel execution system according to an embodiment of the present invention.
The intelligent contract parallel execution system comprises: the block chain host 501 and the bus 504 and n intelligent contracts are processed in parallel; the block chain host 501 is connected with the interface unit 102 of each intelligent contract parallel coprocessor through a bus 504 to realize bidirectional data communication; the block chain host 501 analyzes the correlation and the parallelism of the intelligent contract based on the intelligent contract preloading module 502; the task scheduling module 503 transmits the intelligent contracts capable of being executed in parallel to different intelligent contract parallel coprocessors for executing operation through the bus 504 based on the corresponding intelligent contract data of the task scheduling module 503; after the intelligent contract parallel coprocessor completes the execution operation of the intelligent contract; the interface unit 102 based on each intelligent contract parallel coprocessor transmits the intelligent execution result data to the block chain host 501; the blockchain host 501 receives the execution results of each of the concurrently executing intelligent contracts based on the task scheduling module 503.
The embodiments described above are merely illustrative, and the units or modules described as separate parts may or may not be physically separate, and parts displayed as units or modules may or may not be physical units, may be located in one position, or may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, and not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.
Claims (2)
1. An intelligent contract parallel execution system based on a cryptographic chip is characterized by comprising a block chain host, a system bus and a plurality of intelligent contract parallel coprocessors; the block chain host is connected with each intelligent contract parallel coprocessor through a system bus to realize bidirectional data communication;
the block chain host comprises an intelligent contract preloading module and a task scheduling module;
the intelligent contract preloading module is used for carrying out correlation and parallelism analysis on the intelligent contracts;
the task scheduling module is used for distributing tasks and receiving execution results, wherein the task distribution is to send intelligent contract codes belonging to the same task to an intelligent contract parallel coprocessor for execution; the execution result receiving module is used for receiving intelligent execution result data returned by the intelligent contract parallel coprocessor after the intelligent contract execution operation is completed;
the intelligent contract parallel coprocessor comprises a central processing unit, an interface unit and a memory, wherein the central processing unit, the interface unit and the memory are all connected with a processor bus, and data interaction is realized through the processor bus;
the central processing unit comprises a processor core, a cryptographic hardware engine and a vector processing unit;
the state cipher hardware engine is used for carrying out accelerated calculation on the intelligent contract codes needing state cipher algorithm calculation in the intelligent contract codes;
the vector processing unit is used for performing parallel optimization processing on the intelligent contract codes which need to perform data parallel computation in the intelligent contract codes;
the processor core is used for realizing the functions of an intelligent contract virtual machine, analyzing an intelligent contract execution instruction obtained by an intelligent contract code, judging whether the intelligent contract execution instruction is a national password calculation instruction or not, and calling a national password hardware engine if the intelligent contract execution instruction is the national password calculation instruction; if not, further judging whether the intelligent contract execution instruction is a data parallel processing instruction, if so, calling a vector processing unit; if not, the intelligent contract execution instruction is executed by the processor core.
2. The system of claim 1, wherein the intelligent contract code is intelligent contract code that conforms to a webassemasky standard.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210781837.9A CN115390986A (en) | 2022-07-04 | 2022-07-04 | Intelligent contract parallel execution system based on state cryptographic chip |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210781837.9A CN115390986A (en) | 2022-07-04 | 2022-07-04 | Intelligent contract parallel execution system based on state cryptographic chip |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115390986A true CN115390986A (en) | 2022-11-25 |
Family
ID=84115880
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210781837.9A Pending CN115390986A (en) | 2022-07-04 | 2022-07-04 | Intelligent contract parallel execution system based on state cryptographic chip |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115390986A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117896067A (en) * | 2024-03-13 | 2024-04-16 | 杭州金智塔科技有限公司 | Parallel modular reduction method and device suitable for SM2 cryptographic algorithm |
-
2022
- 2022-07-04 CN CN202210781837.9A patent/CN115390986A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117896067A (en) * | 2024-03-13 | 2024-04-16 | 杭州金智塔科技有限公司 | Parallel modular reduction method and device suitable for SM2 cryptographic algorithm |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9134974B2 (en) | Source code separation and generation for heterogeneous central processing unit (CPU) computational devices | |
CN106598549A (en) | Intelligent agreement system based on block chain and implementation method | |
US20080216064A1 (en) | Method, Architecture and Software of Meta-Operating System, Operating Systems and Applications For Parallel Computing Platforms | |
CN109062617A (en) | A kind of application method, the mobile terminal of platform that supporting polymorphic type equipment | |
JP5486611B2 (en) | Parallel task application framework | |
CN117688622A (en) | Trusted computing chip based on blockchain | |
US11016769B1 (en) | Method and apparatus for processing information | |
CN103593221A (en) | Method and apparatus for dynamic data configuration | |
CN115390986A (en) | Intelligent contract parallel execution system based on state cryptographic chip | |
CN114830135A (en) | Hierarchical partitioning of operators | |
CN114265690A (en) | Method and device for realizing remote training | |
CN115469894A (en) | Application program installation control method, device, equipment and storage medium | |
CN106127092B (en) | A kind of smart card and its working method of COS systems application stripping | |
CN110018831B (en) | Program processing method, program processing apparatus, and computer-readable storage medium | |
CN115641249A (en) | Performance optimization method based on domestic platform GPU | |
US10162913B2 (en) | Simulation device and simulation method therefor | |
CN116308990A (en) | Simulation and integration method and system of GPU supporting OpenGL | |
CN115629795A (en) | Configuration method and device of executable file and electronic equipment | |
CN212966171U (en) | Credible computing chip based on block chain | |
CN112905238A (en) | Intelligent contract executor and method for block chain and block chain operation system | |
CN110633077B (en) | Quick development system and method based on modularization | |
CN110888646B (en) | Deployment method, device, system and storage medium | |
CN113703339A (en) | Automatic driving simulation method, device, equipment and storage medium | |
CN111258653B (en) | Atomic access and storage method, storage medium, computer equipment, device and system | |
CN112906073A (en) | Method for realizing block chain secret calculation general model |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |