Methods, systems, and cross-shard / cross-blockchain interaction methods, systems, terminals, and media supporting cross-shard / cross-blockchain calls
By defining the syntax structure of the relay statement in a smart contract and translating it into a cross-contract call function, the problem that existing smart contracts cannot directly express cross-slice or cross-chain operations is solved, and the effect of simplifying writing, improving readability and maintainability is achieved, and the efficiency of cross-slice or cross-chain communication is improved.
Patent Information
- Application Number
- CN202510034787.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-09
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2045-01-09
AI Technical Summary
Existing smart contracts lack explicit relay syntax structure, and the compiler does not support the compilation of relay syntax, and cannot directly use relay statements to express cross-chip or cross-chain requirements in smart contracts. In multi-shard or multi-chain architecture, it relies on complex intermediate layer protocols or lengthy messaging mechanisms, which increases the complexity of cross-chip/cross-chain operations.
Pre-defined the syntax structure of the relay statement and generated the initial relay statement. Based on the syntax structure, the compilation rules of the contract compiler are generated. The initial relay statement is translated into a cross-contract calling function through the compilation rules, and the contract execution engine is modified to perform relay operations, realizing cross-slicing or cross-blockchain calls.
It explicitly supports the declaration of cross-chip or cross-chain operations in smart contracts, simplifies contract writing, improves code readability and maintainability, reduces the burden of developers to manually handle complex coding logic, improves development efficiency, and achieves efficient cross-shaft or cross-chain communication.
Smart Images

Figure CN119512522B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of blockchain technology, and in particular to a method and system for supporting cross-shard / cross-blockchain calls, and a cross-shard / cross-blockchain interaction method, interaction system, terminal, and medium. Background Art
[0002] With the rapid development of blockchain technology, smart contracts, as its core component, have been widely used in many fields such as decentralized finance and supply chain management. Ethereum, as the earliest platform to support smart contracts, has also become the first choice of many developers with its Solidity language. However, existing smart contracts such as Solidity smart contracts lack explicit relay syntax structure, and the compiler does not support the compilation of relay syntax. Relay statements cannot be used directly in smart contracts to express cross-shard or cross-chain requirements. In addition, in the existing multi-shard or multi-chain architecture, complex middle-layer protocols or lengthy message passing mechanisms are often relied on to complete data exchange between different shards or chains, which greatly increases the complexity of cross-shard / cross-chain operations. Summary of the invention
[0003] The technical problem to be solved by the present invention is to provide a method and system supporting cross-shard / cross-blockchain calls, and a cross-shard / cross-blockchain interaction method, interaction system, terminal and medium in view of the deficiencies in the prior art.
[0004] In order to solve the above technical problems, the technical solution adopted by the present invention is as follows:
[0005] In a first aspect, the present invention provides a cross-shard / cross-blockchain interaction method, wherein the method comprises:
[0006] Predefine the grammatical structure of relay statements and generate initial relay statements;
[0007] Generate compilation rules of the contract compiler based on the grammatical structure of the predefined relay statement;
[0008] Translate the initial relay statement into a corresponding cross-contract call function through the compilation rule;
[0009] The contract execution engine is modified based on the cross-contract call function, and the relay operation of the initial relay statement is executed based on the modified contract execution engine to implement the cross-shard or cross-blockchain call of the initial relay statement.
[0010] In one implementation, predefining the grammatical structure of a relay statement and generating an initial relay statement includes:
[0011] The grammatical structure of the relay statement is predefined, and the grammatical structure includes grammatical parameters, grammatical parameter types and grammatical parameter logic, wherein the grammatical parameters include keywords, identifiers, target shards or target blockchains, target contract addresses, target contract functions and parameter lists, and the parameter lists are used to reflect the parameters required to execute the target contract function; the grammatical parameter types include the type of the target contract address as the address type, the type of the target shard or target blockchain and the type of the target contract function as the string type, and the grammatical parameter types also include basic data types, structures and arrays; the grammatical parameter logic is that the keywords, identifiers, target shards or target blockchains, target contract addresses, target contract functions and parameter lists are arranged in order from front to back;
[0012] An initial relay statement is generated based on the grammatical structure.
[0013] In one implementation, the generating of the compilation rules of the contract compiler based on the grammatical structure of the predefined relay statement includes:
[0014] Constructing the lexical analysis rules, grammatical analysis rules and semantic analysis rules of the contract compiler respectively according to the grammatical structure of the predefined relay statement;
[0015] Based on the lexical analysis rules, the syntax analysis rules and the semantic analysis rules, compilation rules of the contract compiler are obtained.
[0016] In one implementation, constructing the lexical analysis rules of the contract compiler according to the grammatical structure of the predefined relay statement includes:
[0017] Obtain the keywords of the predefined relay statement, and add the keywords of the predefined relay statement to the keyword table in the contract compiler;
[0018] Defining matching rules according to the grammatical parameters of the predefined relay statement;
[0019] Parsing the grammatical parameters of the initial relay statement based on the keywords of the predefined relay statements in the keyword table and the matching rule;
[0020] If the grammatical parameters of the initial relay are parsed successfully, then marks are added to the other grammatical parameters of the grammatical parameters of the initial relay statement except for the keywords to obtain the extended mark information of the initial relay statement.
[0021] In one implementation, constructing the syntax analysis rules of the contract compiler according to the syntax structure of the predefined relay statement includes:
[0022] Generate a verification identifier of the initial relay statement based on the keyword of the predefined relay statement in the keyword table and the extended mark information of the initial relay statement;
[0023] Acquire the grammatical structure of the initial relay statement according to the verification identifier of the initial relay statement;
[0024] Verifying the integrity of the grammatical structure of the initial relay statement according to the grammatical structure of the predefined relay statement;
[0025] If the grammatical structure of the initial relay statement is complete, an abstract syntax tree of the initial relay statement is constructed according to the grammatical structure of the initial relay statement.
[0026] In one implementation, constructing the semantic analysis rules of the contract compiler according to the grammatical structure of the predefined relay statement includes:
[0027] Acquire a syntax parameter type of the initial relay statement according to the abstract syntax tree of the initial relay statement;
[0028] Checking the correctness of the syntax parameter type of the initial relay statement based on the syntax parameter type of the predefined relay statement;
[0029] Get the target contract address in the initial relay statement and verify the validity of the target contract address.
[0030] In one implementation, translating the initial relay statement into a corresponding cross-contract call function through the compilation rule includes:
[0031] Compile the initial relay statement based on the compilation rule to obtain a compilation result;
[0032] According to the compilation result, the initial relay statement is translated into the cross-contract call function by the contract compiler.
[0033] In one implementation, translating the current relay statement into the cross-contract call function by the contract compiler according to the compilation result includes:
[0034] When the initial relay statement passes compilation, the contract compiler translates the initial relay statement into the cross-contract call function, wherein the cross-contract call function includes a special address and a cross-contract call parameter, the special address is an identifier of the relay operation for executing the initial relay statement, and the cross-contract call parameter is obtained according to the syntax parameter of the initial relay statement;
[0035] The cross-contract call function is generated into bytecode that can be deployed on the chain.
[0036] In one implementation, the modifying the contract execution engine based on the cross-contract call function, and executing the relay operation of the initial relay statement based on the modified contract execution engine, includes:
[0037] Identify the special address of the cross-contract call function, and encapsulate the cross-contract call parameters into a call transaction;
[0038] The target shard or target blockchain executes the cross-contract call function corresponding to the initial relay statement according to the call transaction.
[0039] In a second aspect, an embodiment of the present invention further provides a cross-shard / cross-blockchain interaction method, which implements cross-shard / cross-blockchain interaction based on the method for supporting cross-shard / cross-blockchain calls described in the above scheme, wherein the method includes:
[0040] Obtain a first smart contract with an initial relay statement according to a predefined grammatical structure of a relay statement;
[0041] Compile the initial relay statement based on the contract compiler of the first smart contract to obtain a cross-contract call function corresponding to the initial relay statement;
[0042] The target shard or target blockchain implements the cross-shard or cross-blockchain interaction of the initial relay statement by calling the cross-contract call function corresponding to the initial relay statement and performing the relay operation of the cross-contract call function.
[0043] In one implementation, the contract compiler based on the first smart contract compiles the initial relay statement to obtain a cross-contract call function corresponding to the initial relay statement, including:
[0044] Based on the contract compiler, the initial relay statement is sequentially subjected to lexical analysis, grammatical analysis and semantic analysis to obtain a compilation result;
[0045] According to the compilation result, the initial relay statement is translated into the cross-contract call function by the contract compiler.
[0046] In one implementation, the contract-based compiler sequentially performs lexical analysis, grammatical analysis, and semantic analysis on the initial relay statement to obtain a compilation result, including:
[0047] Based on the contract compiler, the grammatical parameters of the initial relay statement are identified for integrity to obtain a lexical analysis result;
[0048] Analyze the grammatical structure of the initial relay statement according to the lexical analysis result to obtain a grammatical analysis result;
[0049] According to the grammatical analysis result, the initial relay statement is semantically analyzed to obtain the compilation result.
[0050] In one implementation, the contract compiler performs integrity analysis on the grammatical parameters of the initial relay statement to obtain a lexical analysis result, including:
[0051] Obtaining the keyword table and matching rules in the contract compiler;
[0052] Parsing the grammatical parameters of the initial relay statement based on the keyword table and the matching rule to obtain the lexical analysis result;
[0053] If the grammatical parameters of the initial relay are parsed successfully, then marks are added to the other grammatical parameters of the grammatical parameters of the initial relay statement except for the keywords to obtain the extended mark information of the initial relay statement.
[0054] In one implementation, parsing the grammatical parameters of the initial relay statement based on the keyword table and the matching rule to obtain the lexical analysis result includes:
[0055] Matching the keywords in the initial relay statement with the keywords of the relay statement predefined in the keyword table;
[0056] If the keyword in the initial relay statement successfully matches the keyword of the relay statement predefined in the keyword table, then the other syntax parameters of the initial relay statement except the keyword are matched with the corresponding syntax parameters of the relay statement predefined in the matching rule respectively;
[0057] If the match is successful, it is determined that the lexical analysis result is that the grammatical parameter parsing of the initial relay statement is successful.
[0058] In one implementation, analyzing the grammatical structure of the initial relay statement according to the lexical analysis result to obtain a grammatical analysis result includes:
[0059] If the syntax parameters of the initial relay statement are parsed successfully, a verification identifier of the initial relay statement is generated based on the keywords of the predefined relay statement in the keyword table and the extended token information of the initial relay statement;
[0060] Acquiring the grammatical structure of the initial relay statement according to the verification identifier of the relay statement, and verifying the integrity of the grammatical structure of the initial relay statement according to the grammatical structure of the predefined relay statement;
[0061] If the grammatical structure of the initial relay statement is complete, an abstract syntax tree of the initial relay statement is constructed according to the grammatical structure of the initial relay statement.
[0062] In one implementation, performing semantic analysis on the initial relay statement according to the syntax analysis result to obtain the compilation result includes:
[0063] If the grammatical structure of the initial relay statement is complete, the grammatical parameter type of the initial relay statement is obtained according to the abstract syntax tree of the initial relay statement, and the correctness of the grammatical parameter type of the obtained initial relay statement is verified according to the grammatical parameter type of the predefined relay statement;
[0064] Obtain the target contract address in the initial relay statement, and verify the validity of the target contract address in the initial relay statement;
[0065] If the syntax parameter type of the initial relay statement is correct and the target contract address is valid, it is determined that the initial relay statement is compiled successfully.
[0066] In one implementation, translating the initial relay statement into the cross-contract call function by the contract compiler according to the compilation result includes:
[0067] When the initial relay statement is compiled successfully, the contract compiler translates the initial relay statement into the cross-contract call function, wherein the cross-contract call function includes a special address and cross-contract call parameters, the special address is an identifier of the relay operation that executes the initial relay statement, and the cross-contract call parameters are obtained according to the syntax parameters of the initial relay statement;
[0068] The cross-contract call function is generated into bytecode that can be deployed on the chain.
[0069] In one implementation, the target shard or target blockchain calls the cross-contract call function corresponding to the initial relay statement and performs the relay operation of the cross-contract call function to implement the cross-shard or cross-blockchain interaction of the initial relay statement, including:
[0070] Identify the special address of the cross-contract call function, and encapsulate the cross-contract call function into a call transaction;
[0071] The target shard or target blockchain executes the relay operation of the cross-contract call function corresponding to the initial relay statement according to the call transaction to realize the cross-shard or cross-blockchain interaction of the initial relay statement.
[0072] In a third aspect, an embodiment of the present invention further provides a system for supporting cross-shard / cross-blockchain calls, wherein the system is used to implement the steps of supporting cross-shard / cross-blockchain calls as described in any one of the above solutions, and the system includes:
[0073] The relay statement generation module is used to predefine the grammatical structure of the relay statement and generate the initial relay statement;
[0074] A compilation rule generation module, used to generate compilation rules of a contract compiler based on the grammatical structure of the predefined relay statement;
[0075] A relay statement translation module, used to translate the initial relay statement into a corresponding cross-contract call function through the compilation rule;
[0076] The relay statement interaction module is used to modify the contract execution engine based on the cross-contract call function, and execute the relay operation of the initial relay statement based on the modified contract execution engine to realize the cross-shard or cross-blockchain call of the initial relay statement.
[0077] In a fourth aspect, an embodiment of the present invention further provides a cross-shard / cross-blockchain interaction system, wherein the system is used to implement the steps of the cross-shard / cross-blockchain interaction method described in any one of the schemes, and the system includes:
[0078] A smart contract acquisition module, used to acquire a first smart contract with an initial relay statement according to a grammatical structure of a predefined relay statement;
[0079] A relay statement analysis module, configured to compile the initial relay statement based on the contract compiler of the first smart contract to obtain a cross-contract call function corresponding to the initial relay statement;
[0080] The relay statement execution module is used for the target shard or target blockchain to call the cross-contract call function corresponding to the initial relay statement and execute the relay operation of the cross-contract call function to realize the cross-shard or cross-blockchain interaction of the initial relay statement.
[0081] In a fifth aspect, an embodiment of the present invention further provides a terminal, wherein the terminal includes a memory, a processor, and a program supporting cross-shard / cross-blockchain calls or a cross-shard / cross-blockchain interaction program stored in the memory and runnable on the processor, and when the processor executes the program supporting cross-shard / cross-blockchain calls or the cross-shard / cross-blockchain interaction program, the steps of the method supporting cross-shard / cross-blockchain calls described in the above scheme are implemented, or the steps of the cross-shard / cross-blockchain interaction method described in the above scheme are implemented.
[0082] In a sixth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein a program supporting cross-shard / cross-blockchain calls or a cross-shard / cross-blockchain interaction program is stored on the computer-readable storage medium, and when the program supporting cross-shard / cross-blockchain calls or the cross-shard / cross-blockchain interaction program is executed by a processor, the steps of the method supporting cross-shard / cross-blockchain calls described in the above scheme are implemented, or the steps of the cross-shard / cross-blockchain interaction method described in the above scheme are implemented.
[0083] Beneficial effects: Compared with the prior art, the present invention provides a method for supporting cross-shard / cross-blockchain calls. The present invention first predefines the grammatical structure of the relay statement and generates an initial relay statement. Then, the compilation rules of the contract compiler are generated based on the grammatical structure of the predefined relay statement. Next, the initial relay statement is translated into a corresponding cross-contract call function through the compilation rules. Finally, the contract execution engine is modified based on the cross-contract call function, and the relay operation of the initial relay statement is executed based on the modified contract execution engine to realize the cross-shard or cross-blockchain call of the initial relay statement. The present invention adds an initial relay statement to the smart contract, which can explicitly support the declaration of cross-shard or cross-chain operations in the smart contract, simplify the writing of the contract, and improve the readability and maintainability of the code. In addition, the present invention generates the compilation rules of the contract compiler based on the grammatical structure of the predefined relay statement, and the initial relay statement can be compiled based on the compilation rules, and the initial relay statement can be automatically converted into a cross-contract call function, thereby reducing the burden of developers manually processing complex coding logic and improving development efficiency. In addition, in this embodiment, when other smart contracts call the cross-contract call function corresponding to the initial relay statement, the system will automatically execute the corresponding relay operation, which greatly simplifies the communication logic and thus realizes efficient cross-shard or cross-chain communication. BRIEF DESCRIPTION OF THE DRAWINGS
[0084] Figure 1 A flowchart of a preferred embodiment of a method for supporting cross-shard / cross-blockchain calls provided in an embodiment of the present invention.
[0085] Figure 2 A schematic diagram of a smart contract with an initial relay statement written by a contract developer in an embodiment of the present invention.
[0086] Figure 3 The figure is a schematic diagram of the principle of implementing cross-shard / cross-blockchain interaction according to an embodiment of the present invention.
[0087] Figure 4 This is a schematic diagram of a process for modifying a contract compiler of a first smart contract in an embodiment of the present invention.
[0088] Figure 5 A first flow chart of a specific application of a contract compiler for a first smart contract provided in an embodiment of the present invention processing an initial relay statement.
[0089] Figure 6 A second flow chart of a specific application of a contract compiler for a first smart contract provided in an embodiment of the present invention processing an initial relay statement.
[0090] Figure 7 The figure is a flow chart of executing a cross-contract function call according to an embodiment of the present invention.
[0091] Figure 8 The figure is a schematic diagram of the calling principle of the initial relay statement in practical application of the embodiment of the present invention.
[0092] Fig. 9 This is a schematic diagram of implementing the initial relay statement call between blockchain A and blockchain B in an embodiment of the present invention.
[0093] Fig.10 A flowchart of a preferred embodiment of the cross-shard / cross-blockchain interaction method provided in an embodiment of the present invention.
[0094] Fig.11 A schematic diagram of a first system architecture of a system supporting cross-shard / cross-blockchain calls provided by an embodiment of the present invention.
[0095] Fig.12 A schematic diagram of a second system architecture of a cross-shard / cross-blockchain interactive system provided in an embodiment of the present invention.
[0096] Fig.13 A functional block diagram of a terminal provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0097] In order to make the purpose, technical solution and effect of the present invention clearer and more specific, the present invention is further described in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0098] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations or steps, nor must they be executed in the order described. For example, some operations or steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.
[0099] It should be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0100] It should be understood that, in order to clearly describe the technical solutions of the embodiments of the present invention, in the embodiments of the present invention, words such as "first" and "second" are used to distinguish between identical or similar items with substantially identical functions and effects. For example, the first control information and the second control information are only used to distinguish different control information, and their order is not limited.
[0101] Those skilled in the art can understand that the words "first", "second", etc. do not limit the quantity and execution order, and the words "first", "second", etc. do not necessarily limit the differences.
[0102] It should be further understood that the term “and / or” used in the present specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0103] In the existing technology of sharding solutions, taking Ethereum 2.0 as an example, the proposed sharding architecture requires cross-shard information synchronization and interaction. However, the cross-shard communication of Ethereum 2.0 depends on the global state update of the Beacon Chain. Smart contract developers cannot express cross-shard or cross-chain operations in the contract code, but need to rely on the intermediate protocol layer to pass information from one shard to another through the Beacon Chain. Although this process solves the problem of cross-shard communication, it involves multiple intermediate steps and communication protocols, which increases the workload and complexity of developers. In addition, the lack of explicit expression of cross-shard or cross-chain in smart contracts leads to semantic ambiguity and maintenance difficulties, which is not efficient in practical applications.
[0104] In terms of cross-chain interaction, although cross-chain and cross-chip technologies have achieved certain success on these platforms, their solutions are not directly applicable to the existing ecosystem of Ethereum. Ethereum's smart contract environment, especially the contract development based on Solidity, does not currently support explicit relay syntax. Due to the lack of intuitive syntax support, developers often need to manually write complex call logic when facing cross-chip or cross-chain communication problems, which will lead to a decrease in the readability and maintainability of the code. In addition, the Solidity compiler currently does not support the compilation of relay syntax, resulting in contract developers being unable to directly use relay statements in smart contracts to express cross-chip or cross-chain requirements, increasing the workload of coding. Existing smart contracts based on Solidity can either only be executed on a single chain or chip, or need to indirectly implement cross-chain or cross-chip operations through complex communication protocols. This limitation not only increases the difficulty of development, but also limits the flexibility and scalability of smart contracts, thereby affecting the widespread deployment of decentralized applications.
[0105] This embodiment aims to solve the problems that the existing Solidity smart contract lacks an explicit relay syntax structure, the compiler does not support the compilation of relay syntax, and the relay statement cannot be directly used in the smart contract to express cross-shard or cross-chain requirements. In the existing multi-shard or multi-chain architecture, complex middle-layer protocols or lengthy message passing mechanisms are often relied on to complete data exchange between different shards or chains, which greatly increases the complexity of cross-shard / cross-chain operations. This embodiment provides a method for supporting cross-shard / cross-blockchain calls. This embodiment first predefines the syntax structure of the relay statement and generates an initial relay statement. Then, the compilation rules of the contract compiler are generated based on the predefined syntax structure of the relay statement. Then, the initial relay statement is translated into a corresponding cross-contract call function through the compilation rules. Finally, the contract execution engine is modified based on the cross-contract call function, and the relay operation of the initial relay statement is executed based on the modified contract execution engine to realize the cross-shard or cross-blockchain call of the initial relay statement. Based on the method of this embodiment, this embodiment adds an initial relay statement to the smart contract, which can explicitly support the declaration of cross-shard or cross-chain operations in the smart contract, simplify the writing of the contract, and improve the readability and maintainability of the code. In addition, the present invention generates the compilation rules of the contract compiler based on the pre-defined grammatical structure of the relay statement, and the initial relay statement can be compiled based on the compilation rules, and the initial relay statement can be automatically converted into a cross-contract call function, thereby reducing the burden of developers manually processing complex coding logic and improving development efficiency. In addition, in this embodiment, when other smart contracts call the cross-contract call function corresponding to the initial relay statement, the system will automatically execute the corresponding relay operation, which greatly simplifies the communication logic, thereby achieving efficient cross-shard or cross-chain communication.
[0106] Specifically, the cross-shard / cross-blockchain interaction method of this embodiment can be applied to terminals, including intelligent product terminals such as computers, mobile phones, and smart TVs. Figure 1 As shown in , the cross-shard / cross-blockchain interaction method includes the following steps:
[0107] Step S100: predefine the grammatical structure of the relay statement and generate an initial relay statement.
[0108] The relay statement introduced in this embodiment is intended to provide a concise and clear way for developers to explicitly declare cross-shard or cross-chain operations in the first smart contract. To this end, this embodiment predefines the grammatical structure of the relay statement, wherein the grammatical structure includes grammatical parameters, grammatical parameter types, and grammatical parameter logic, wherein the grammatical parameters include keywords, identifiers, target shards or target blockchains, target contract addresses, target contract functions, and parameter lists, wherein the parameter list is used to reflect the parameters required to execute the target contract function, and the parameters are separated by commas; the grammatical parameter type includes the type of the target contract address as an address type, and the type of the target shard or target blockchain and the target contract function as a string type. The grammatical parameter type also includes the data type of the parameter list, and the data type of each parameter in the parameter list includes basic data types, structures, and arrays. The grammatical parameter logic is that the keywords, identifiers, target shards or target blockchains, target contract addresses, target contract functions, and parameter lists are arranged in order from front to back. Specifically, the grammatical structure of the relay statement is as follows:
[0109] relay@ <target><target contract address>::<target contract function>(<parameter 1>,<parameter 2>, ...);
[0110] Among them, relay is a keyword, and the @ after the keyword is an identifier used to identify the relay statement as a cross-shard or cross-chain call; target is the identifier of the target shard or target blockchain to be called, ensuring that the call request can be correctly routed to the target shard or blockchain. The target contract address is the contract address called on the target shard or target blockchain. The target contract function is the function name in the contract address called on the target shard or target blockchain. Each parameter in the parameter list has a clear data type so that it can be correctly parsed during execution. The basic data types of the parameters in the parameter list include unsigned integers (unit), signed integers (int), contract or account addresses (address), Boolean values (bool), strings (string), byte arrays (bytes), etc.; the parameter types in the parameter list of this embodiment can also be composed of structures (struct) and arrays (array), where the definition of the structure can be separately declared in the source chain / source shard contract, for example:
[0111] relay@chainBcontractB::f(a,b);
[0112] It means that this call will pass (a, b) as function parameters to blockchain B to call the f function in the smart contract contractB on blockchain B.
[0113] After the grammatical structure of the relay statement is defined, the initial relay statement can be generated based on the grammatical structure. Figure 2 As shown in . The contract developer (ie, the user) writes a first smart contract A with an initial relay statement off-chain. For example, the first smart contract may be a Solidity smart contract, and the initial relay statement is relay@chainB contractB::g(), which is used to implement a cross-shard / cross-chain call in Solidity smart contract A to the g() function in the contractB contract on blockchain B.
[0114] This invention predefines the grammatical structure of relay statements, allowing developers to clearly and intuitively declare cross-shard or cross-chain operations in Solidity smart contracts, avoiding the cumbersome manual coding process in traditional methods. This direct grammatical expression simplifies contract writing, greatly improves the readability and maintainability of the code, and lowers the technical threshold for developers.
[0115] Step S200: Generate compilation rules for the contract compiler based on the grammatical structure of the predefined relay statement.
[0116] The following uses the first smart contract as a Solidity smart contract as an example to illustrate the technical solution of the present invention. In this example, in order to compile the initial relay statement so that the first smart contract A can support the initial relay statement, after defining the grammatical structure of the relay statement, Figure 3 As shown in , it is also necessary to modify the contract compiler of the first smart contract (i.e., the Solidity smart contract) and modify the smart contract execution engine. This embodiment makes a series of modifications to the native contract compiler of the first smart contract. These modifications are mainly concentrated on the lexical analysis, grammatical analysis, and semantic analysis of the contract compiler. Specifically, this embodiment constructs the lexical analysis rules, grammatical analysis rules, and semantic analysis rules of the contract compiler based on the grammatical structure of the predefined relay statement, and then obtains the compilation rules of the contract compiler based on the lexical analysis rules, the grammatical analysis rules, and the semantic analysis rules. This embodiment obtains the compilation rules by constructing the lexical analysis rules, grammatical analysis rules, and semantic analysis rules of the contract compiler to ensure that the contract compiler of the first smart contract can compile the initial relay statement of this embodiment based on the compilation rules, thereby facilitating the cross-contract call function. Specifically, as Figure 4 As shown in , when modifying the contract compiler of the first smart contract, this embodiment first expands the lexical analysis rules so that the contract compiler can recognize grammatical parameters such as keywords in the initial relay statement; then, constructs grammatical analysis rules so that the contract compiler can recognize the complete grammatical structure of the initial relay statement; then constructs semantic analysis rules so that the contract compiler can verify the correctness and validity of the initial relay statement to implement the compilation of the initial relay statement; finally, after the compilation rules of lexical analysis, semantic analysis, and grammatical analysis are compiled, this embodiment can translate the initial relay statement, and the contract compiler can translate the initial relay statement into a cross-contract call function for execution by the execution engine.
[0117] In specific applications, in order to enable the contract compiler to recognize grammatical parameters such as keywords in the initial relay statement, this embodiment can add a "relay" keyword and define matching rules in the lexical analyzer of the contract compiler so that the lexical analyzer can recognize and parse the statements of the keyword. Specifically, this embodiment can obtain the keyword corresponding to the pre-defined relay statement, and then add the keyword of the pre-defined relay statement (such as "relay") to the keyword table of the contract compiler in the keyword definition area of the lexical analyzer. This will enable the lexical analyzer to mark the keyword "relay" as a token named RELAY when it encounters it, and consider that the initial relay statement may be a relay statement, thereby realizing the recognition and parsing of other grammatical parameters of the initial relay statement. Next, this embodiment constructs the matching rules of the contract compiler according to the grammatical parameters and regular expressions of the predefined relay statements. Based on the keywords of the predefined relay statements in the keyword table and the matching rules, the grammatical parameters of the initial relay statement can be identified and parsed to determine whether the initial relay statement contains all the grammatical parameters of the predefined relay statement, that is, whether the initial relay statement satisfies the predefined grammatical parameters of the relay statement, thereby parsing the grammatical parameters of the initial relay. The purpose of the parsing is to identify the integrity of the grammatical parameters of the initial relay to ensure that only the initial relay statement containing the complete grammatical parameters of the predefined relay statement is identified and parsed, rather than only the grammatical parameters of the string part of the initial relay statement. If the grammatical parameters of the initial relay are identified and parsed as complete, this embodiment also adds marks to the other grammatical parameters in the grammatical parameters of the initial relay statement except for the keywords, to obtain the extended mark information of the initial relay statement. Specifically, the target shard or target blockchain ( <target>), add tokens to the target contract address, target contract function, and parameter list to obtain extended token information, and classify these extended token information into corresponding parts in the grammatical structure. These extended token information can help the contract compiler better identify the parsed relay statements.
[0118] In addition, in order to enable the contract compiler of the first smart contract to recognize the complete grammatical structure of the initial relay statement, this embodiment needs to construct the grammatical analysis rules of the contract compiler and introduce new grammatical analysis rules so as to analyze the grammatical structure of the initial relay statement based on the new grammatical analysis rules to obtain the grammatical analysis results. In this embodiment, the new grammatical analysis rules are to check whether the initial relay statement conforms to the grammatical structure of the above-mentioned predefined relay statement, that is, to check whether the current initial relay statement conforms to the following grammatical structure:
[0119] relay@ <target><target contract address>::<target contract function>(<parameter 1>,<parameter 2>, ...). Specifically, when constructing a new syntax analysis rule, this embodiment first generates a verification identifier for the initial relay statement based on the keywords of the predefined relay statement in the keyword table and the extended symbol information of the initial relay statement, that is, the keywords of the predefined relay statement in the keyword table and the extended symbol information of the initial relay statement are used as the verification identifier of the initial relay statement. Then, the grammatical structure of the initial relay statement is obtained according to the verification identifier of the initial relay statement; and the integrity of the grammatical structure of the initial relay statement is verified according to the grammatical structure of the predefined relay statement. If the grammatical structure of the initial relay statement is complete, it means that the initial relay statement at this time is a complete grammatical structure that conforms to the predefined relay statement, and therefore the abstract syntax tree of the initial relay statement is constructed according to the grammatical structure of the initial relay statement. Specifically, this embodiment obtains the grammatical structure of the initial relay statement, that is, obtains the grammatical parameters, grammatical parameter types, and grammatical parameter logic, and then uses the keywords in the initial relay statement as the root node, and uses the keywords in the initial relay statement, the target shard or target blockchain, the target contract address, the target contract function, and the parameter list as leaf nodes to construct an abstract syntax tree. Specifically, when constructing the abstract syntax tree, this embodiment, after obtaining the grammatical parameters and grammatical parameter types, uses the "relay" keyword of the initial relay statement as the root node, the target shard or target blockchain ( <target>) as the leaf node of the root node, the target contract address is <target>The target contract function is the leaf node of the target contract address node, <parameter 1>, <parameter 2>, ... are the leaf nodes of the <target contract function> node, and so on to construct an abstract syntax tree. This embodiment converts the syntax structure of the initial relay statement to the node on the abstract syntax tree, which is convenient for subsequent compilation and execution stages. This embodiment constructs the syntax analysis rules of the contract compiler through the above-mentioned verification identifier and the abstract syntax tree, so as to determine whether the initial relay statement conforms to the syntax structure of the predefined relay statement based on the syntax analysis rules.
[0120] Further, in order to verify the validity and correctness of the initial relay statement, the present embodiment modifies the semantic analysis rules of the contract compiler of the first smart contract and constructs a new semantic analysis rule. Specifically, the present embodiment can obtain the syntax parameter type of the initial relay statement according to the abstract syntax tree of the initial relay statement. Then, based on the syntax parameter type of the predefined relay statement, the correctness of the syntax parameter type of the initial relay statement is checked, and the syntax parameter type of the initial relay statement can be compared with the syntax parameter type of the predefined relay statement to check the correctness of the syntax parameter type of the initial relay statement. Specifically, the syntax parameter type of the target shard or target blockchain, target contract address, target contract function and parameter list in the initial relay statement is matched with the syntax parameter type of the target shard or target blockchain, target contract address, target contract function and parameter list of the predefined relay statement. If the match is successful, it can be determined that the syntax parameter type of the initial relay statement is correct. Next, the present embodiment obtains the target contract address in the initial relay statement and verifies the validity of the target contract address. Specifically, the present embodiment can obtain the encoding rules of the target contract address in the predefined relay statement. Then the encoding rules of the target contract address in the initial relay statement are matched with the encoding rules of the target contract address in the predefined relay statement. If the match is successful, it can be determined that the target contract address of the initial relay statement is valid. If the syntax parameter type and the target contract address in the initial relay statement are valid, it is determined that the initial relay statement is compiled successfully. Based on the above correctness and validity detection, the present embodiment constructs semantic analysis rules to ensure the rationality and validity of the initial relay statement. Furthermore, after completing the construction of lexical analysis rules, grammatical analysis rules and semantic analysis rules in the contract compiler, the present embodiment can integrate the lexical analysis rules, grammatical analysis rules and semantic analysis rules and set them in order to obtain the compilation rules of the contract compiler.
[0121] Step S300: Translate the initial relay statement into a corresponding cross-contract call function through the compilation rule.
[0122] After obtaining the compilation rules of this embodiment, this embodiment can perform lexical analysis, grammatical analysis and semantic analysis on the initial relay statement in sequence according to the compilation rules. Finally, the contract compiler translates the initial relay statement that meets the requirements and can be compiled into a cross-contract call function.
[0123] Specifically, this embodiment performs lexical analysis, grammatical analysis and semantic analysis on the current initial relay statement in sequence based on the compilation rules of the contract compiler to obtain a compilation result. This embodiment can first perform integrity analysis on the grammatical parameters of the initial relay statement based on the lexical analysis rules in the compilation rules to obtain a lexical analysis result. Then, based on the lexical analysis result, the grammatical structure of the initial relay statement is analyzed based on the grammatical analysis rules in the compilation rules to obtain a grammatical analysis result. Next, based on the grammatical analysis result, the initial relay statement is semantically analyzed based on the semantic analysis rules in the compilation rules to obtain a compilation result, which reflects that the initial relay statement is identified as a complete relay statement, that is, the initial relay statement can pass the compilation of the contract compiler. After completing the lexical analysis, grammatical analysis and semantic analysis, this embodiment can translate the initial relay statement into the cross-contract call function through the contract compiler according to the compilation result.
[0124] When the initial relay statement is compiled successfully, the contract compiler translates the initial relay statement into the cross-contract call function, wherein the cross-contract call function includes a special address and a cross-contract call parameter, wherein the special address is the identifier of the relay operation that executes the initial relay statement, and the cross-contract call parameter is obtained according to the syntax parameter of the initial relay statement. Specifically, the cross-contract call function call() is as follows:
[0125] address(<special address>).call(<target shard / target chain identifier>, <target contract address>, <parameter list>); where <special address> is a special identifier for performing relay operations.
[0126] After obtaining the cross-contract call function, this embodiment can generate bytecode that can be deployed on the chain from the cross-contract call function, specifically binary code, to ensure that the cross-shard / cross-chain operation can be correctly executed. It can be seen that after a series of modifications and constructions are made to the contract compiler of the first smart contract in this embodiment, the modified contract compiler of the first smart contract can perform lexical analysis, grammatical analysis, and semantic analysis on the relay statement, and finally translate it to obtain the cross-contract call function, wherein the initial relay statement is translated into a cross-contract call function specifically according to the needs of cross-shard / blockchain interaction, and the cross-contract call function is obtained by overloading the parameters of the call function in the contract compiler, and the target shard / chain identifier, target contract address, and parameter list in the cross-contract call function correspond to the target shard / blockchain (target), target contract address, and parameter list of the pre-defined relay statement, respectively, and the special address can be a fixed address parameter, such as 0x123456.
[0127] like Figure 5 and Figure 6 As shown, in actual application, the contract developer of this embodiment uses the contract compiler of the first smart contract to compile the initial relay statement, and first performs lexical analysis by parsing the grammatical parameters in the initial relay statement, that is, first checks whether it matches the keywords of the predefined relay statement, and then checks whether the remaining grammatical parameters match other parameters of the predefined relay statement through matching rules, so as to determine whether the grammatical parameters of the initial relay statement contain all the grammatical parameters of the predefined relay statement, thereby judging whether the grammatical parameters of the initial relay statement are complete. If the initial relay statement can parse out the complete grammatical parameters of the relay statement, a grammatical analysis is performed. If the grammatical parameters of the complete relay statement cannot be parsed, the contract compiler will report an error. When performing grammatical analysis on the initial relay statement, first check whether the initial relay statement conforms to the grammatical structure of the predefined relay statement. If not, the contract compiler will report an error and return the result of the grammatical analysis error. If it conforms to the grammatical structure of the predefined relay statement, a semantic analysis is performed to verify the correctness and validity of the initial relay statement, that is, check whether the grammatical parameter type of the initial relay statement matches the grammatical parameter type of the predefined relay statement, and check whether the target contract address of the initial relay statement is a legal address. If it does not match or the target contract address of the initial relay statement is illegal, the contract compiler will report an error and return the result of the semantic check error. On the contrary, if the initial relay statement conforms to the grammatical structure of the predefined relay statement, the contract compiler will translate the initial relay statement to obtain a cross-contract call function.
[0128] This embodiment introduces a relay syntax compilation mechanism in the contract compiler of the first smart contract, which can automatically identify and convert the initial relay statements written by the user and translate them into cross-contract call functions. Developers no longer need to manually handle complex cross-chain and cross-shard logic, reducing potential errors and improving development efficiency.
[0129] Step S400: modify the contract execution engine based on the cross-contract call function, and execute the relay operation of the initial relay statement based on the modified contract execution engine to implement the cross-shard or cross-blockchain call of the initial relay statement.
[0130] This embodiment translates the initial relay statement into a cross-contract call function, which is a function with a special address and can be deployed on the chain. In order to enable the initial relay statement to support cross-shard / cross-blockchain calls, this embodiment modifies the contract execution engine. When the modified contract execution engine executes a cross-contract call function with a special address, it overloads the cross-contract call function to perform the relay operation corresponding to the cross-contract call function, thereby achieving the purpose of relaying to another shard or another blockchain.
[0131] like Figure 7 As shown, in this embodiment, when generating a binary code that can be deployed on the chain from the cross-contract call function, in the modified contract execution engine, first identify whether the cross-contract call function has a special address, that is, the above-mentioned address (<special address>). Once the contract executor executes the cross-contract call function with the special address, it is necessary to overload the cross-contract call function, that is, enter the step of generating a cross-chain / cross-shard transaction, and complete the relay operation; otherwise, execute the ordinary cross-contract call logic. Specifically, in this embodiment, the parameters of the cross-contract call function can be encapsulated into a call transaction, and the call transaction can be placed in the execution queue of the target shard or target blockchain. Based on the modified contract execution engine, the target shard or target blockchain executes the cross-contract call function corresponding to the current initial relay statement according to the call transaction, overloads the cross-contract call function, captures the cross-contract call parameters in the cross-contract call function with the special address (that is, (<target shard / target blockchain identifier>, <target contract address>, <parameter list>)), and obtains the target contract function of the target contract address in the cross-contract call function to call, and executes the relay operation corresponding to the current initial relay statement. In addition, when modifying the contract execution engine, since each shard or blockchain has a unique identifier, if the identifier of the target shard / blockchain is consistent with the identifier of the source shard / chain, that is, the target shard / blockchain is the source shard / blockchain, then the cross-contract call function is directly called in the current shard / blockchain to perform the relay operation. If the identifier of the target shard / blockchain is inconsistent with the identifier of the source shard / chain, it means that the target shard / blockchain is not the source shard / blockchain. At this time, the contract execution engine is modified in the target shard / blockchain to encapsulate the cross-contract call parameters into a call transaction of the target shard / blockchain, and the call transaction is placed in the execution queue of the target shard or target blockchain. The execution engine of the target shard / blockchain obtains the target contract address, target function and call parameters in the parameter list according to the call transaction to execute the relay statement.
[0132] In practical applications, combined with Figure 8 and Fig. 9 As shown in the figure, the user sends a transaction to the transaction pool of blockchain A to be packaged, where the transaction is to call the f function in the smart contract (contractA) on blockchain A. Then, after the transaction is packaged and uploaded to the chain, it enters the contract execution engine of blockchain A for execution; the contract execution engine captures the parameters of the initial relay statement in the transaction (i.e., the parameters in the cross-contract call function), including the target shard or target blockchain of the relay operation, the target contract address, the target contract function, and the parameter list. Then, the contract execution engine synthesizes the target blockchain (i.e., Figure 8 The call transaction on the target blockchain B) is placed in the transaction pool of the target blockchain and waits to be packaged. Then, after the call transaction is packaged by blockchain B, it is handed over to the contract execution engine of blockchain B for execution. The contract execution engine in blockchain B (i.e. the target blockchain) executes the relay operation corresponding to the initial relay statement according to the target contract address, target contract function and call parameters, thus completing the entire process of the initial relay statement call. The initial relay statement enables blockchain A to call the smart contract function of blockchain B across blockchains.
[0133] It can be seen that this embodiment uses a dedicated cross-contract call function to implement the relay operation. When the smart contract issues a call to the cross-contract call function, the system will automatically execute the corresponding relay operation, simplifying the process of cross-shard operations, thereby achieving efficient cross-shard / cross-blockchain communication.
[0134] Based on the above embodiments, the present invention also provides a cross-shard / cross-blockchain interaction method, which is an application of the method supporting cross-shard / cross-blockchain calls based on the above embodiments. Fig.10 As shown, the following steps are included:
[0135] Step S10: Obtain a first smart contract with an initial relay statement according to a grammatical structure of a predefined relay statement.
[0136] In practical applications, the first smart contract may be a Solidity smart contract.
[0137] Similarly, this embodiment predefines the grammatical structure of the relay statement, wherein the grammatical structure includes grammatical parameters, grammatical parameter types and grammatical parameter logic, wherein the grammatical parameters include keywords, identifiers, target shards or target blockchains, target contract addresses, target contract functions and parameter lists, wherein the parameter list is used to reflect the parameters required to execute the target contract function, and the parameters are separated by commas; the grammatical parameter types include the type of the target contract address as an address type, and the types of the target shards or target blockchains and the target contract functions as string types. The grammatical parameter type also includes the data type of the parameter list, and the data type of each parameter in the parameter list includes basic data types, structures and arrays. The grammatical parameter logic is that the keywords, identifiers, target shards or target blockchains, target contract addresses, target contract functions and parameter lists are arranged in order from front to back. Specifically, the grammatical structure of the relay statement is as follows:
[0138] relay@ <target><target contract address>::<target contract function>(<parameter 1>,<parameter 2>, ...);
[0139] Among them, relay is a keyword, and the @ after the keyword is used to identify the relay statement as a cross-shard or cross-chain call; target is the identifier of the target shard or target blockchain to be called, ensuring that the call request can be correctly routed to the target shard or blockchain. The target contract address is the contract address called on the target shard or target blockchain. The target contract function is the function name in the contract address called on the target shard or target blockchain. Each parameter in the parameter list has a clear data type so that it can be correctly parsed during execution. The basic data types of the parameters in the parameter list include unsigned integers (unit), signed integers (int), contract or account addresses (address), Boolean values (bool), strings (string), byte arrays (bytes), etc. The parameter types in the parameter list of this embodiment can also be composed of structures (struct) and arrays (array), where the definition of the structure can be separately declared in the source chain / source shard contract, for example:
[0140] relay@chainBcontractB::f(a,b);
[0141] It means that this call will pass (a, b) as function parameters to blockchain B to call the f function in the smart contract contractB on blockchain B.
[0142] After the grammatical structure of the relay statement is predefined, the contract developer (i.e., the user) can write the first smart contract A with the initial relay statement off-chain. Figure 2 As shown in , the first smart contract can be a Solidity smart contract, and the initial relay statement is relay@chainB contractB::g(), which is used to implement the cross-shard / cross-chain call of the g() function in the contractB contract on blockchain B in Solidity smart contract A.
[0143] By pre-defining the grammatical structure of the relay statement, the present invention enables developers to clearly and intuitively declare cross-shard or cross-chain operations in the first smart contract, avoiding the cumbersome manual coding process in the traditional method. This direct grammatical expression simplifies the contract writing work, greatly improves the readability and maintainability of the code, and lowers the technical threshold for developers.
[0144] Step S20: Compile the initial relay statement based on the contract compiler of the first smart contract to obtain a cross-contract call function corresponding to the initial relay statement.
[0145] The following describes this embodiment by taking the first smart contract as a Solidity smart contract as an example.
[0146] The contract compiler of the first smart contract A in this embodiment can perform lexical analysis, syntactic analysis, and semantic analysis on the initial relay statement in sequence, and finally the contract compiler translates the initial relay statement that meets the requirements into a cross-contract call function.
[0147] Specifically, this embodiment performs lexical analysis, grammatical analysis and semantic analysis on the initial relay statement in sequence based on the contract compiler to obtain a compilation result. This embodiment can first perform integrity analysis on the grammatical parameters of the initial relay statement based on the contract compiler to obtain a lexical analysis result so that the compiler can recognize and parse the initial relay statement. Then, based on the lexical analysis result, the grammatical structure of the initial relay statement is analyzed to obtain a grammatical analysis result to verify that the grammatical structure of the initial relay statement conforms to the grammatical structure of the predefined relay statement and is a complete relay statement. Next, based on the grammatical analysis result, the initial relay statement is semantically analyzed to obtain the compilation result. After completing the lexical analysis, grammatical analysis and semantic analysis, this embodiment can translate the initial relay statement into the cross-contract call function through the contract compiler according to the compilation result.
[0148] When applying it in specific Figure 5 As shown, when the relay statement is lexically analyzed, the keywords in the relay statement are actually identified. This embodiment first obtains the keyword table and matching rules in the contract compiler. Then, the grammatical parameters of the initial relay statement are parsed based on the keyword table and the matching rules. The purpose of the parsing is to identify the integrity of the grammatical parameters of the initial relay statement and obtain the lexical analysis result. If the grammatical parameters of the initial relay are parsed successfully, the other grammatical parameters in the grammatical parameters of the initial relay statement except for the keywords are marked respectively to obtain the extended mark information of the initial relay statement.
[0149] Specifically, when the present embodiment identifies the grammatical parameter integrity of the initial relay statement based on the keyword table and the matching rules, the keywords in the initial relay statement are first matched with the keywords of the relay statement predefined in the keyword table. If the keywords in the initial relay statement successfully match the keywords of the relay statement predefined in the keyword table, the other grammatical parameters of the initial relay statement except the keywords are matched with the corresponding grammatical parameters of the relay statement predefined in the matching rules, that is, to determine whether the grammatical parameters of the initial relay statement are the same as the grammatical parameters of the predefined relay statement, and to determine whether the grammatical parameter type of the initial relay statement is the same as the grammatical parameter type of the predefined relay statement. If the match is successful, it is determined that the lexical analysis result is that the grammatical parameter parsing of the initial relay statement is successful. The present embodiment analyzes the initial relay statement based on the above-mentioned keyword table and matching rules to ensure that only complete relay statements are matched and identified, rather than part of the string.
[0150] Furthermore, if the grammatical parameter parsing of the initial relay statement is successful, then the complete initial relay statement is subjected to grammatical analysis to check whether the initial relay statement conforms to the grammatical structure of the above-mentioned predefined relay statement. Specifically, this embodiment first generates a verification identifier of the initial relay statement based on the keywords of the predefined relay statement in the keyword table and the extended symbol information of the initial relay statement. Then, the grammatical structure of the initial relay statement is obtained according to the verification identifier of the initial relay statement; and the integrity of the grammatical structure of the initial relay statement is verified according to the grammatical structure of the predefined relay statement. If the grammatical structure of the initial relay statement is complete, it means that the initial relay statement at this time is a complete grammatical structure that conforms to the predefined relay statement, and therefore an abstract syntax tree of the initial relay statement is constructed according to the grammatical structure of the initial relay statement. Specifically, this embodiment obtains the grammatical structure of the initial relay statement, that is, obtains the grammatical parameters, grammatical parameter types, and grammatical parameter logic, and then uses the keywords in the initial relay statement as the root node, and uses the keywords in the initial relay statement, the target shard or target blockchain, the target contract address, the target contract function, and the parameter list as leaf nodes to construct an abstract syntax tree. Specifically, when constructing the abstract syntax tree, this embodiment, after obtaining the grammatical parameters and grammatical parameter types, uses the "relay" keyword of the initial relay statement as the root node, the target shard or target blockchain ( <target>) as the leaf node of the root node, the target contract address is <target>The target contract function is the leaf node of the target contract address node, <parameter 1>, <parameter 2>, ... are the leaf nodes of the <target contract function> node, and so on to construct an abstract syntax tree. This embodiment converts the syntax structure of the initial relay statement to the node on the abstract syntax tree, which is convenient for subsequent compilation and execution stages. This embodiment constructs the syntax analysis rules of the contract compiler through the above-mentioned verification identifier and the abstract syntax tree, so as to determine whether the initial relay statement conforms to the syntax structure of the predefined relay statement based on the syntax analysis rules.
[0151] Further, if the grammatical structure of the initial relay statement is complete, the relay statement that conforms to the grammatical structure is semantically analyzed at this time to verify the validity and correctness of the initial relay statement. This embodiment verifies the correctness of the grammatical parameter type of the acquired initial relay statement according to the grammatical parameter type of the predefined relay statement. In actual application, this embodiment traverses the abstract syntax tree, obtains the grammatical parameter types of the target shard or target blockchain, target contract address, target contract function and parameter list in the initial relay statement, and then matches them with the grammatical parameter types of the target shard or target blockchain, target contract address, target contract function and parameter list of the predefined relay statement. If the grammatical parameter type of the initial relay statement is correct, the target contract address in the initial relay statement is further obtained, and the validity of the target contract address in the initial relay statement is verified. This embodiment can match the target contract address in the initial relay statement with the encoding rule of the target contract address in the predefined relay statement, that is, to determine whether the encoding rule of the target contract address in the initial relay statement is the same as the encoding rule of the target contract address in the predefined relay statement. If the match is successful, it is determined that the target contract address in the initial relay statement is valid. If the syntax parameter type of the initial relay statement is correct and the target contract address is valid, it is determined that the initial relay statement is compiled successfully. Based on the above correctness and validity detection, this embodiment verifies that the rationality and validity of the initial relay statement are ensured, thereby ensuring that there is an interface corresponding to the target contract address to support the operation requested by the relay statement.
[0152] After the above-mentioned lexical analysis, syntax analysis and semantic analysis are performed on the initial relay statement in sequence, this embodiment obtains a compilation result, which reflects that the initial relay statement is identified as a complete relay statement. If the initial relay statement is compiled successfully, the contract compiler translates the current relay statement into a cross-contract call function with a special address, wherein the cross-contract call function includes a special address and cross-contract call parameters, the special address is an identifier of the relay operation that executes the initial relay statement, and the cross-contract call parameters are obtained according to the syntax parameters of the initial relay statement. Specifically, the cross-contract call function call() is as follows:
[0153] address(<special address>).call(<target shard / target chain identifier>, <target contract address>, <parameter list>); where <special address> is a special identifier for the relay operation.
[0154] After obtaining the cross-contract call function, this embodiment can generate the cross-contract call function into bytecode that can be deployed on the chain, specifically binary code, to ensure that the cross-chip operation can be correctly executed. It can be seen that after this embodiment makes a series of modifications and constructions to the contract compiler of the first smart contract, the modified contract compiler of the first smart contract can perform lexical analysis, grammatical analysis and semantic analysis on the relay statement, and finally translate it to obtain the cross-contract call function. Figure 5 and Figure 6 As shown, in actual application, the contract developer of this embodiment uses the contract compiler of the first smart contract to compile the initial relay statement. First, lexical analysis can be performed, that is, to identify the keywords in the initial relay statement, check whether there are keyword errors, determine whether the initial relay statement is complete, etc., such as whether the keywords are fully defined. Then perform grammatical analysis, that is, check whether the initial relay statement conforms to the grammatical structure of the predefined relay statement. If not, the contract compiler will report an error and return the result of the grammatical analysis error. If it conforms to the grammatical structure of the predefined relay statement, a semantic analysis is performed to verify the correctness and validity of the initial relay statement, such as checking whether the grammatical parameter type of the initial relay statement matches the grammatical parameter type of the predefined relay statement, and checking whether the target contract address of the initial relay statement is a legal address. If it does not match, the contract compiler will report an error and return the result of the semantic check error. If the initial relay statement conforms to the grammatical structure of the predefined relay statement, the contract compiler will translate the initial relay statement to obtain a cross-contract call function.
[0155] This embodiment introduces a relay syntax parsing mechanism in the contract compiler of the first smart contract, which can automatically identify and convert the user-defined initial relay syntax and translate it into a standard cross-contract call function. Developers no longer need to manually handle complex cross-chain and cross-shard logic, which reduces potential errors and improves development efficiency.
[0156] Step S30: The target shard or target blockchain calls the cross-contract call function corresponding to the initial relay statement and performs the relay operation of the cross-contract call function to realize the cross-shard or cross-blockchain interaction of the initial relay statement.
[0157] This embodiment translates the initial relay statement into a cross-contract call function, which is a function with a special address and can be deployed on the chain. In order to enable the initial relay statement to support cross-shard / cross-blockchain calls, this embodiment modifies the contract execution engine. When the modified contract execution engine executes a cross-contract call function with a special address, it overloads the cross-contract call function to perform the relay operation corresponding to the cross-contract call function, thereby achieving the purpose of relaying to another shard or another blockchain.
[0158] like Figure 7 As shown, this embodiment generates binary code that can be deployed on the chain from the cross-contract call function. In the modified contract execution engine, it first identifies whether the cross-contract call function has a special address, that is, the above-mentioned address (<special address>). Once the contract executor executes the cross-contract call function with the special address, it needs to overload the cross-contract call function, that is, enter the step of generating a cross-chain / cross-shard transaction and complete the relay operation; otherwise, execute the ordinary cross-contract call logic. Specifically, this embodiment can encapsulate the parameters of the cross-contract call function into a call transaction, and put the call transaction into the execution queue of the target shard or target blockchain. Based on the modified contract execution engine, the target shard or target blockchain executes the cross-contract call function corresponding to the current initial relay statement according to the call transaction, overloads the cross-contract call function, captures the cross-contract call parameters in the cross-contract call function with a special address (i.e. (<target shard / target blockchain identifier>, <target contract address>, <parameter list>)), obtains the target contract function of the target contract address in the cross-contract call function, and executes the relay operation corresponding to the current initial relay statement to achieve cross-shard or cross-blockchain interaction of the initial relay statement. In addition, during execution, since each shard or blockchain has a unique identifier, if the identifier of the target shard / blockchain is consistent with the identifier of the source shard / chain, the cross-contract call function is directly called again in the current shard / blockchain to perform the relay operation.
[0159] In practical applications, combined with Figure 8 and Fig. 9 As shown in the figure, the user sends a transaction to the transaction pool of blockchain A to be packaged, where the transaction is to call the f function in the smart contract (contractA) on blockchain A. Then, after the transaction is packaged and uploaded to the chain, it enters the contract execution engine of blockchain A for execution; the contract execution engine captures the parameters of the initial relay statement in the transaction (i.e., the parameters in the cross-contract call function), including the target shard or target blockchain of the relay operation, the target contract address, the target contract function, and the parameter list. Then, the contract execution engine synthesizes the target blockchain (i.e., Figure 8 The call transaction on the target blockchain B) is placed in the transaction pool of the target blockchain and waits to be packaged. Then, after the call transaction is packaged by blockchain B, it is handed over to the contract execution engine of blockchain B for execution. The contract execution engine in blockchain B (i.e. the target blockchain) executes the relay operation corresponding to the initial relay statement according to the target contract address, target contract function and call parameters, thus completing the entire process of the initial relay statement call. The initial relay statement call enables blockchain A to call the smart contract function of blockchain B.
[0160] It can be seen that this embodiment uses a dedicated cross-contract call function to implement the relay operation. When the smart contract issues a call to the cross-contract call function, the system will automatically execute the corresponding relay operation, simplifying the process of cross-shard operations, thereby achieving efficient cross-shard / cross-blockchain communication.
[0161] Based on the above embodiments, the present invention also provides a system that supports cross-shard / cross-blockchain calls, such as Fig.11 As shown, the system includes: a relay statement generation module 110, a compilation rule generation module 120, a relay statement translation module 130 and a relay statement interaction module 140. Specifically, the relay statement generation module 110 is used to predefine the grammatical structure of the relay statement and generate an initial relay statement. The compilation rule generation module 120 is used to generate the compilation rules of the contract compiler based on the predefined grammatical structure of the relay statement. The relay statement translation module 130 is used to translate the initial relay statement into a corresponding cross-contract call function through the compilation rules. The relay statement interaction module 140 is used to modify the contract execution engine based on the cross-contract call function, and execute the relay operation of the initial relay statement based on the modified contract execution engine to realize the cross-shard or cross-blockchain call of the initial relay statement.
[0162] The working principles of each module in the system supporting cross-shard / cross-blockchain calls in this embodiment are the same as the principles of each step in the above method embodiment, and will not be repeated here.
[0163] In another implementation, the present invention may also provide a cross-shard / cross-blockchain interactive system, such as Fig.12 As shown, the system includes: a smart contract acquisition module 10, a relay statement analysis module 20, and a relay statement execution module 30. Specifically, the smart contract acquisition module 10 is used to obtain a first smart contract with an initial relay statement according to a predefined grammatical structure of a relay statement. The relay statement analysis module 20 is used to compile the initial relay statement based on the contract compiler of the first smart contract to obtain a cross-contract call function corresponding to the initial relay statement. The relay statement execution module 30 is used for the target shard or target blockchain to call the cross-contract call function corresponding to the initial relay statement and perform the relay operation of the cross-contract call function to realize the cross-shard or cross-blockchain interaction of the initial relay statement.
[0164] The working principles of each module in the cross-shard / cross-blockchain interactive system of this embodiment are the same as the principles of each step in the above method embodiment, and will not be repeated here.
[0165] Each module in the above cross-shard / cross-blockchain interactive system can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of the processor in the terminal in hardware form, or can be stored in the memory in the terminal in software form, so that the processor can call and execute the operations corresponding to each module above.
[0166] Based on the above embodiment, the present invention further provides a terminal, the principle block diagram of the terminal can be as follows: Fig.13 The terminal may include one or more processors 100 ( Fig.13 Only one is shown in the figure), a memory 101 and a computer program 102 stored in the memory 101 and executable on one or more processors 100, for example, a cross-shard / cross-blockchain interactive program. When one or more processors 100 execute the computer program 102, the various steps in the cross-shard / cross-blockchain interactive method embodiment can be implemented. Alternatively, when one or more processors 100 execute the computer program 102, the functions of each module / unit in the cross-shard / cross-blockchain interactive system embodiment can be implemented, which is not limited here.
[0167] In one embodiment, the processor 100 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0168] In one embodiment, the memory 101 may be an internal storage unit of an electronic device, such as a hard disk or memory of the electronic device. The memory 101 may also be an external storage device of the electronic device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device. Further, the memory 101 may also include both an internal storage unit of the electronic device and an external storage device. The memory 101 is used to store computer programs and other programs and data required by the terminal. The memory 101 may also be used to temporarily store data that has been output or is to be output.
[0169] Those skilled in the art will understand that Fig.13 The principle block diagram shown in the figure is only a block diagram of a partial structure related to the scheme of the present invention, and does not constitute a limitation on the terminal to which the scheme of the present invention is applied. The specific terminal may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0170] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, operating database or other media used in the embodiments provided by the present invention may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double operational data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0171] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.< / target> < / target> < / target> < / target> < / target> < / target> < / target> < / target>
Claims
1. A method for supporting cross-shard / cross-blockchain calls, characterized in that: The method comprises: Predefine the grammatical structure of relay statements and generate initial relay statements; Generate compilation rules of the contract compiler based on the grammatical structure of the predefined relay statement; Translate the initial relay statement into a corresponding cross-contract call function through the compilation rule; Modifying the contract execution engine based on the cross-contract call function, and executing the relay operation of the initial relay statement based on the modified contract execution engine to implement the cross-shard or cross-blockchain call of the initial relay statement; The generating of the compilation rules of the contract compiler based on the grammatical structure of the predefined relay statement includes: Constructing the lexical analysis rules, grammatical analysis rules and semantic analysis rules of the contract compiler respectively according to the grammatical structure of the predefined relay statement; Based on the lexical analysis rule, the syntax analysis rule and the semantic analysis rule, a compilation rule of the contract compiler is obtained; Among them, constructing the lexical analysis rules of the contract compiler according to the grammatical structure of the predefined relay statement includes: Obtain the keywords of the predefined relay statement, and add the keywords of the predefined relay statement to the keyword table in the contract compiler; Defining matching rules according to the grammatical parameters of the predefined relay statement; Parsing the grammatical parameters of the initial relay statement based on the keywords of the predefined relay statements in the keyword table and the matching rule; If the grammatical parameters of the initial relay are parsed successfully, then marks are added to the other grammatical parameters of the grammatical parameters of the initial relay statement except for the keywords to obtain the extended mark information of the initial relay statement.
2. The method for supporting cross-shard / cross-blockchain calls according to claim 1, characterized in that: The step of predefining the grammatical structure of a relay statement and generating an initial relay statement includes: The grammatical structure of the relay statement is predefined, and the grammatical structure includes grammatical parameters, grammatical parameter types and grammatical parameter logic, wherein the grammatical parameters include keywords, identifiers, target shards or target blockchains, target contract addresses, target contract functions and parameter lists, and the parameter lists are used to reflect the parameters required to execute the target contract function; the grammatical parameter types include the type of the target contract address as the address type, the type of the target shard or target blockchain and the type of the target contract function as the string type, and the grammatical parameter types also include basic data types, structures and arrays; the grammatical parameter logic is that the keywords, identifiers, target shards or target blockchains, target contract addresses, target contract functions and parameter lists are arranged in order from front to back; An initial relay statement is generated based on the grammatical structure.
3. The method for supporting cross-shard / cross-blockchain calls according to claim 1, characterized in that: Constructing the syntax analysis rules of the contract compiler according to the syntax structure of the predefined relay statement, including: Generate a verification identifier of the initial relay statement based on the keyword of the predefined relay statement in the keyword table and the extended mark information of the initial relay statement; Acquire the grammatical structure of the initial relay statement according to the verification identifier of the initial relay statement; Verifying the integrity of the grammatical structure of the initial relay statement according to the grammatical structure of the predefined relay statement; If the grammatical structure of the initial relay statement is complete, an abstract syntax tree of the initial relay statement is constructed according to the grammatical structure of the initial relay statement.
4. The method for supporting cross-shard / cross-blockchain calls according to claim 3, characterized in that: Constructing the semantic analysis rules of the contract compiler according to the grammatical structure of the predefined relay statement, including: Acquire a syntax parameter type of the initial relay statement according to the abstract syntax tree of the initial relay statement; Checking the correctness of the syntax parameter type of the initial relay statement based on the syntax parameter type of the predefined relay statement; Get the target contract address in the initial relay statement and verify the validity of the target contract address.
5. The method for supporting cross-shard / cross-blockchain calls according to any one of claims 1 to 4, characterized in that: The translating the initial relay statement into a corresponding cross-contract call function through the compilation rule includes: Compile the initial relay statement based on the compilation rule to obtain a compilation result; According to the compilation result, the initial relay statement is translated into the cross-contract call function by the contract compiler.
6. The method for supporting cross-shard / cross-blockchain calls according to claim 5, characterized in that: The translating the initial relay statement into the cross-contract call function by the contract compiler according to the compilation result includes: When the initial relay statement passes compilation, the contract compiler translates the initial relay statement into the cross-contract call function, wherein the cross-contract call function includes a special address and a cross-contract call parameter, the special address is an identifier of the relay operation for executing the initial relay statement, and the cross-contract call parameter is obtained according to the syntax parameter of the initial relay statement; The cross-contract call function is generated into bytecode that can be deployed on the chain.
7. The method for supporting cross-shard / cross-blockchain calls according to claim 6, characterized in that: The step of modifying the contract execution engine based on the cross-contract calling function and executing the relay operation of the initial relay statement based on the modified contract execution engine includes: Identify the special address of the cross-contract call function, and encapsulate the cross-contract call parameters into a call transaction; The target shard or target blockchain executes the cross-contract call function corresponding to the initial relay statement according to the call transaction.
8. A cross-shard / cross-blockchain interaction method, which implements cross-shard / cross-blockchain interaction based on the method for supporting cross-shard / cross-blockchain calls according to any one of claims 1 to 7, characterized in that: The method comprises: Obtain a first smart contract with an initial relay statement according to a predefined grammatical structure of a relay statement; Compile the initial relay statement based on the contract compiler of the first smart contract to obtain a cross-contract call function corresponding to the initial relay statement; The target shard or target blockchain implements the cross-shard or cross-blockchain interaction of the initial relay statement by calling the cross-contract call function corresponding to the initial relay statement and performing the relay operation of the cross-contract call function.
9. The cross-shard / cross-blockchain interaction method according to claim 8, characterized in that: The contract compiler based on the first smart contract compiles the initial relay statement to obtain a cross-contract call function corresponding to the initial relay statement, including: Based on the contract compiler, the initial relay statement is sequentially subjected to lexical analysis, grammatical analysis and semantic analysis to obtain a compilation result; According to the compilation result, the initial relay statement is translated into the cross-contract call function by the contract compiler.
10. The cross-shard / cross-blockchain interaction method according to claim 9, characterized in that: The contract-based compiler sequentially performs lexical analysis, grammatical analysis, and semantic analysis on the initial relay statement to obtain a compilation result, including: Based on the contract compiler, the grammatical parameters of the initial relay statement are identified for integrity to obtain a lexical analysis result; Analyze the grammatical structure of the initial relay statement according to the lexical analysis result to obtain a grammatical analysis result; According to the grammatical analysis result, the initial relay statement is semantically analyzed to obtain the compilation result.
11. The cross-shard / cross-blockchain interaction method according to claim 10, characterized in that: The contract compiler performs integrity recognition on the grammatical parameters of the initial relay statement to obtain a lexical analysis result, including: Obtaining the keyword table and matching rules in the contract compiler; Parsing the grammatical parameters of the initial relay statement based on the keyword table and the matching rule to obtain the lexical analysis result; If the grammatical parameters of the initial relay are parsed successfully, then marks are added to the other grammatical parameters of the grammatical parameters of the initial relay statement except for the keywords to obtain the extended mark information of the initial relay statement.
12. The cross-shard / cross-blockchain interaction method according to claim 11, characterized in that: The parsing of the grammatical parameters of the initial relay statement based on the keyword table and the matching rule to obtain the lexical analysis result includes: Matching the keywords in the initial relay statement with the keywords of the relay statement predefined in the keyword table; If the keyword in the initial relay statement successfully matches the keyword of the relay statement predefined in the keyword table, then the other syntax parameters of the initial relay statement except the keyword are matched with the corresponding syntax parameters of the relay statement predefined in the matching rule respectively; If the match is successful, it is determined that the lexical analysis result is that the grammatical parameter parsing of the initial relay statement is successful.
13. The cross-shard / cross-blockchain interaction method according to claim 11, characterized in that: The grammatical structure of the initial relay statement is analyzed according to the lexical analysis result to obtain a grammatical analysis result, including: If the syntax parameters of the initial relay statement are parsed successfully, a verification identifier of the initial relay statement is generated based on the keywords of the predefined relay statement in the keyword table and the extended token information of the initial relay statement; Acquiring the grammatical structure of the initial relay statement according to the verification identifier of the relay statement, and verifying the integrity of the grammatical structure of the initial relay statement according to the grammatical structure of the predefined relay statement; If the grammatical structure of the initial relay statement is complete, an abstract syntax tree of the initial relay statement is constructed according to the grammatical structure of the initial relay statement.
14. The cross-shard / cross-blockchain interaction method according to claim 13, characterized in that: The step of performing semantic analysis on the initial relay statement according to the grammatical analysis result to obtain the compilation result includes: If the grammatical structure of the initial relay statement is complete, the grammatical parameter type of the initial relay statement is obtained according to the abstract syntax tree of the initial relay statement, and the correctness of the grammatical parameter type of the obtained initial relay statement is verified according to the grammatical parameter type of the predefined relay statement; Obtain the target contract address in the initial relay statement, and verify the validity of the target contract address in the initial relay statement; If the syntax parameter type of the initial relay statement is correct and the target contract address is valid, it is determined that the initial relay statement is compiled successfully.
15. The cross-shard / cross-blockchain interaction method according to any one of claims 9 to 14, characterized in that: The translating the initial relay statement into the cross-contract call function by the contract compiler according to the compilation result includes: When the initial relay statement is compiled successfully, the contract compiler translates the initial relay statement into the cross-contract call function, wherein the cross-contract call function includes a special address and cross-contract call parameters, the special address is an identifier of the relay operation that executes the initial relay statement, and the cross-contract call parameters are obtained according to the syntax parameters of the initial relay statement; The cross-contract call function is generated into bytecode that can be deployed on the chain.
16. The cross-shard / cross-blockchain interaction method according to claim 15, characterized in that: The target shard or target blockchain calls the cross-contract call function corresponding to the initial relay statement and performs the relay operation of the cross-contract call function to implement the cross-shard or cross-blockchain interaction of the initial relay statement, including: Identify the special address of the cross-contract call function, and encapsulate the cross-contract call function into a call transaction; The target shard or target blockchain executes the relay operation of the cross-contract call function corresponding to the initial relay statement according to the call transaction to realize the cross-shard or cross-blockchain interaction of the initial relay statement.
17. A system supporting cross-shard / cross-blockchain calls, characterized in that: The system is used to implement the steps of supporting cross-shard / cross-blockchain calls according to any one of claims 1 to 7, and the system includes: The relay statement generation module is used to predefine the grammatical structure of the relay statement and generate the initial relay statement; A compilation rule generation module, used to generate compilation rules of a contract compiler based on the grammatical structure of the predefined relay statement; A relay statement translation module, used to translate the initial relay statement into a corresponding cross-contract call function through the compilation rule; The relay statement interaction module is used to modify the contract execution engine based on the cross-contract call function, and execute the relay operation of the initial relay statement based on the modified contract execution engine to realize the cross-shard or cross-blockchain call of the initial relay statement.
18. A cross-shard / cross-blockchain interactive system, characterized in that: The system is used to implement the steps of the cross-shard / cross-blockchain interaction method according to any one of claims 8 to 16, and the system includes: A smart contract acquisition module, used to acquire a first smart contract with an initial relay statement according to a grammatical structure of a predefined relay statement; A relay statement analysis module, configured to compile the initial relay statement based on the contract compiler of the first smart contract to obtain a cross-contract call function corresponding to the initial relay statement; The relay statement execution module is used for the target shard or target blockchain to call the cross-contract call function corresponding to the initial relay statement and execute the relay operation of the cross-contract call function to realize the cross-shard or cross-blockchain interaction of the initial relay statement.
19. A terminal, characterized in that: The terminal includes a memory, a processor, and a program supporting cross-shard / cross-blockchain calls or a cross-shard / cross-blockchain interaction program stored in the memory and executable on the processor. When the processor executes the program supporting cross-shard / cross-blockchain calls or the cross-shard / cross-blockchain interaction program, the steps of the method supporting cross-shard / cross-blockchain calls as described in any one of claims 1 to 7 are implemented, or the steps of the cross-shard / cross-blockchain interaction method as described in any one of claims 8 to 16 are implemented.
20. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program supporting cross-shard / cross-blockchain calls or a cross-shard / cross-blockchain interaction program. When the program supporting cross-shard / cross-blockchain calls or the cross-shard / cross-blockchain interaction program is executed by the processor, the steps of the method supporting cross-shard / cross-blockchain calls as described in any one of claims 1 to 7 are implemented, or the steps of the cross-shard / cross-blockchain interaction method as described in any one of claims 8 to 16 are implemented.
Citation Information
Patent Citations
Method and device for translating intelligent contract language and electronic equipment
CN116149671A
Intelligent contract generation method and system of cross-block chain engine
CN116880857A
Data interaction method and system based on high-performance block chain, terminal and medium
CN117633090A