Blockchain data processing method and system combining native transactions and smart contracts
Patent Information
- Application Number
- CN202610727272.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-25
- Publication Date
- 2026-08-18
AI Technical Summary
[0004]然而,原生交易模型可能会限制交易处理的灵活性,无法灵活应对不同的交易场景和需求
[0014] Corresponding to the above methods, the present invention also provides an electronic device, including a processor, a memory, and a computer program/instructions stored in the memory, wherein the processor is configured to execute the computer program/instructions, and when the computer program/instructions are executed, the electronic device implements the steps of any of the methods described in the above embodiments.
Smart Images

Figure CN122596940A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of blockchain data processing technology, and in particular to a blockchain data processing method and system that combines native transactions and smart contracts. Background Technology
[0002] In the development of blockchain technology, smart contracts, as computer programs that automatically execute contracts, are widely used in various fields, from finance to supply chain to digital asset management. However, the relatively slow running speed of smart contract virtual machines introduces a certain degree of delay and inefficiency into transaction processing.
[0003] To address this issue, a promising approach is to pre-configure native transaction models directly on the blockchain to process transactions, thereby achieving faster transaction processing. Pre-configuring native transaction models on the blockchain eliminates the need for manual intervention. The distributed nature of the blockchain allows transactions to be processed in parallel across multiple nodes, and the native transaction models can optimize the transaction process, reduce single points of failure, and ultimately improve overall throughput.
[0004] However, native transaction models may limit the flexibility of transaction processing, making it difficult to adapt to different transaction scenarios and needs. On the one hand, native transaction models may not meet the requirements when faced with complex transaction logic or special transaction needs. On the other hand, when transaction models need to be expanded or updated, it may be difficult to pre-set native transaction models on the blockchain, requiring additional processing and adjustments, which may lead to instability and operational problems in the transaction system. Summary of the Invention
[0005] In view of this, embodiments of the present invention provide a blockchain data processing method and system that combines native transactions and smart contracts to eliminate or improve one or more defects existing in the prior art.
[0006] One aspect of the present invention provides a blockchain data processing method combining native transactions and smart contracts. The method includes the following steps: uploading native transaction data to an on-chain data module included in a smart contract module using a native transaction module, and receiving data credentials returned from the on-chain module; invoking the smart contract module to process the native transaction data based on the data credentials, including: triggering a pre-compiled contract through a contract virtual machine included in the smart contract module; obtaining and parsing the native transaction data from the on-chain data module based on the data credentials using the interface of the pre-compiled contract; and submitting the parsed native transaction data to the contract virtual machine, thereby enabling the smart contract module to obtain and process the native transaction data.
[0007] In some embodiments of the present invention, the step of uploading native transaction data to the on-chain data module included in the smart contract module using the native transaction module includes: the native transaction module pre-deployed on the blockchain receiving the native transaction data uploaded by the client and returning data credentials to the client; the native transaction module processing the native transaction data and uploading the native transaction data to the on-chain data module included in the smart contract module.
[0008] In some embodiments of the present invention, the native transaction module processes native transaction data, including: the native transaction module verifies the signature of the received native transaction data and reaches a consensus on the native transaction data.
[0009] In some embodiments of the present invention, the step of using the interface of the precompiled contract to obtain and parse the native transaction data from the on-chain data module based on the data credentials includes: obtaining the interface of the corresponding precompiled contract according to the address of the precompiled contract, and the interface of the precompiled contract obtaining and parsing the corresponding native transaction data from the on-chain data module based on the data credentials.
[0010] In some embodiments of the present invention, the method further includes the step of pre-deploying the written contract script to a smart contract module on the blockchain, so that the smart contract module can obtain and process the native transaction data according to the contract script.
[0011] Corresponding to the above method, the present invention also provides a blockchain data processing method combining native transactions and smart contracts, comprising: a client uploading native transaction data to a native transaction module and receiving a data credential returned by the on-chain native transaction module; wherein, the native transaction module further uploads the native transaction data to an on-chain data module included in the smart contract module; the client sends a processing request containing the data credential to the smart contract module, which processes the native transaction data based on the data credential, including: triggering a pre-compiled contract through a contract virtual machine included in the smart contract module; obtaining and parsing the native transaction data from the on-chain data module based on the data credential using the interface of the pre-compiled contract; and passing the parsed native transaction data to the contract virtual machine, thereby enabling the smart contract module to obtain and process the native transaction data.
[0012] Corresponding to the above method, the present invention also provides a blockchain data processing system combining native transactions and smart contracts, comprising: a native transaction module for receiving native transaction data uploaded by a client, uploading the native transaction data to an on-chain data module included in the smart contract module, and returning a data certificate on-chain; and a smart contract module for processing the native transaction data based on the data certificate, comprising: triggering a pre-compiled contract using a contract virtual machine included in the smart contract module; obtaining and parsing the native transaction data from the on-chain data module based on the data certificate using the interface of the pre-compiled contract; and delivering the parsed native transaction data to the contract virtual machine, thereby enabling the smart contract module to obtain and process the native transaction data.
[0013] In some embodiments of the present invention, the data processing system on the blockchain further includes a pre-written contract script of a smart contract module deployed on the blockchain, wherein the smart contract module obtains and processes the native transaction data according to the contract script.
[0014] Corresponding to the above methods, the present invention also provides an electronic device, including a processor, a memory, and a computer program / instructions stored in the memory, wherein the processor is configured to execute the computer program / instructions, and when the computer program / instructions are executed, the electronic device implements the steps of any of the methods described in the above embodiments.
[0015] In accordance with the above methods, the present invention also provides a computer-readable storage medium having a computer program / instructions stored thereon, which, when executed by a processor, implements the steps of the method as described in any of the above embodiments.
[0016] The blockchain data processing method and system proposed in this invention, which combines native transactions and smart contracts, can improve the speed of business processing by combining native transaction models and smart contracts. It can also improve the flexibility of transaction processing by expanding diverse transaction needs or complex transaction logic through smart contracts. Furthermore, since there is no need to expand the native transaction model on the chain, it is beneficial to ensure the stability and smooth operation of the transaction system.
[0017] Additional advantages, objects, and features of the invention will be set forth in part in the description which follows, and will also become apparent in part to those skilled in the art upon studying the description, or may be learned by practice of the invention. The objects and other advantages of the invention can be realized and obtained by means of the structures specifically pointed out in the description and drawings.
[0018] Those skilled in the art will understand that the objectives and advantages achievable with this invention are not limited to those specifically described above, and that the above and other objectives achievable with this invention will become clearer from the following detailed description. Attached Figure Description
[0019] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, are not intended to limit the scope of the invention. In the drawings: Figure 1 This is a flowchart of a blockchain data processing method that combines native transactions and smart contracts in one embodiment of the present invention.
[0020] Figure 2 This is a flowchart of a blockchain data processing method that combines native transactions and smart contracts, according to another embodiment of the present invention. Detailed Implementation
[0021] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the embodiments and accompanying drawings. Here, the illustrative embodiments and descriptions of this invention are used to explain the invention, but are not intended to limit the invention.
[0022] It should also be noted that, in order to avoid obscuring the invention with unnecessary details, only the structures and / or processing steps closely related to the solution according to the invention are shown in the accompanying drawings, while other details that are not closely related to the invention are omitted.
[0023] It should be emphasized that the term "including / comprises" as used herein refers to the presence of a feature, element, step, or component, but does not exclude the presence or addition of one or more other features, elements, steps, or components.
[0024] It should also be noted that, unless otherwise specified, the term "connection" in this article can refer not only to a direct connection, but also to an indirect connection involving an intermediary.
[0025] In the following description, embodiments of the invention will be illustrated with reference to the accompanying drawings. In the drawings, the same reference numerals represent the same or similar parts, or the same or similar steps.
[0026] First, let's introduce the concepts mentioned in this plan: (1) A smart contract is an automatically executed, immutable computer program based on blockchain technology. The contract code is deployed on the blockchain network and maintained by distributed nodes to ensure that the data is immutable and transparent. When external events (such as transactions, timestamps) or on-chain data (such as state variables) meet preset conditions, the contract is executed automatically and the results are recorded on the blockchain.
[0027] (2) The native transaction model is a set of automated transaction rules that are pre-implemented through mathematical modeling and programming and deployed on the blockchain. It can be executed without the need for a third-party intermediary and is automated by taking advantage of the decentralized and immutable characteristics of the blockchain.
[0028] The problems with the existing technology are: (1) the native transaction model limits the flexibility of transaction processing and cannot handle complex transaction logic or meet special transaction needs; (2) when the transaction model needs to be expanded or updated, the native transaction model cannot be set directly on the blockchain, which requires additional processing and adjustment, and may lead to instability and operation problems of the transaction system.
[0029] To overcome the problems of existing technologies, this solution proposes a blockchain data processing method and system that combines native transactions and smart contracts. This method combines smart contracts and native transaction models, using the native transaction model to upload data and smart contracts to process the native transaction data. Since smart contract processing is relatively slow, a fixed native transaction model (or business model) can be pre-defined on the chain for data uploading. The data is saved to the on-chain data module and a data credential (which can be a request ID) is returned to the client. The client can then retrieve the uploaded data from the on-chain data module using the data credential (i.e., the request ID).
[0030] Figure 1 This is a flowchart of a blockchain data processing method combining native transactions and smart contracts according to an embodiment of the present invention. The execution entity is a whole composed of a native transaction module, a smart contract module, and a pre-compiled contract. The method includes the following steps: Step S100: Upload native transaction data to the on-chain data module included in the smart contract module using the native transaction module, and receive the data certificate returned from the on-chain module. In specific implementation, the data certificate in step S110 can be a request ID, which is used to indicate the corresponding native transaction data uploaded to the on-chain data module.
[0031] Step S200: Call the smart contract module to process the raw transaction data based on the data credentials.
[0032] Specifically, step S200 includes the following steps: Step S210: Trigger the pre-compiled contract through the contract virtual machine included in the smart contract module. The pre-compiled contract is a piece of fixed code logic running in the blockchain system, used to directly access data within the blockchain system. It can be configured with interfaces to implement various functions and can be set to any address (such as 0x10) as the external interface address. Through the interface of the pre-compiled contract, various complex transaction logic processing can be performed on the native on-chain transaction data.
[0033] Step S220: Use the interface of the pre-compiled contract to obtain and parse the native transaction data from the on-chain data module based on the data credentials.
[0034] Step S230: The parsed raw transaction data is handed over to the contract virtual machine, so that the smart contract module can obtain the raw transaction data and process it.
[0035] The blockchain data processing method combining native transactions and smart contracts proposed in this invention can improve the speed of business processing by combining native transaction models and smart contracts. It can also improve the flexibility of transaction processing by expanding diverse transaction needs or complex transaction logic through smart contracts. Furthermore, since there is no need to expand the native transaction model on the chain, it is beneficial to ensure the stability and smooth operation of the transaction system.
[0036] In some embodiments of the present invention, the step of uploading native transaction data to the on-chain data module included in the smart contract module using the native transaction module includes: the native transaction module, which is pre-deployed on the blockchain, receives the native transaction data uploaded by the client and returns data credentials to the client; the native transaction module processes the native transaction data and uploads the native transaction data to the on-chain data module included in the smart contract module.
[0037] By employing the embodiments of the present invention, a native transaction model is used for transactions, which helps users complete transactions faster. While introducing smart contracts, the native transaction model is retained, which helps to ensure the stability and smooth operation of the transaction system.
[0038] Furthermore, in some embodiments of the present invention, the steps of the native transaction module processing native transaction data include: the native transaction module verifying the signature of the received native transaction data and reaching a consensus on the native transaction data. After ensuring the accuracy of the data, the native transaction data is then handed over to the on-chain data module for storage.
[0039] By employing this embodiment of the invention, the native transaction module can more quickly verify and reach consensus on native transaction data on the blockchain, enabling users to complete transactions faster without manual intervention, reducing single points of failure, and improving overall throughput. Furthermore, data signature verification and consensus help ensure data accuracy.
[0040] In some embodiments of the present invention, step S220, which involves obtaining and parsing native transaction data from the on-chain data module using the interface of the precompiled contract based on the data credentials, includes: obtaining the interface of the corresponding precompiled contract according to the address of the precompiled contract, and obtaining and parsing the corresponding native transaction data from the on-chain data module based on the data credentials.
[0041] By adopting this embodiment of the invention, a smart contract module is introduced on the basis of the native transaction module. The use of smart contracts can directly interact with the underlying transaction data, which is conducive to realizing more complex logic and condition judgments, more refined and complex processing, and meeting more diverse business needs.
[0042] In some embodiments of the present invention, the method further includes the step of pre-deploying the written contract script to a smart contract module on the blockchain, so that the smart contract module can obtain and process the native transaction data according to the contract script.
[0043] By employing this embodiment of the invention, by deploying the contract script to the smart contract module on the blockchain, functions that the original on-chain native transaction module cannot achieve can be flexibly implemented. Furthermore, this method does not require any modification to the blockchain itself, and therefore does not increase the bloat of the blockchain.
[0044] Accordingly, this invention also proposes a blockchain data processing method combining native transactions and smart contracts. The executing entity is the client, and the method includes the following steps: the client uploads native transaction data to the native transaction module and receives data credentials returned by the on-chain native transaction module; wherein, the native transaction module further uploads the native transaction data to the on-chain data module included in the smart contract module; the client sends a processing request containing the data credentials to the smart contract module, which then processes the native transaction data based on the data credentials, including: triggering a pre-compiled contract through the contract virtual machine included in the smart contract module; obtaining and parsing the native transaction data from the on-chain data module based on the data credentials using the interface of the pre-compiled contract; and submitting the parsed native transaction data to the contract virtual machine, thereby enabling the smart contract module to obtain and process the native transaction data.
[0045] Using this method, clients can quickly complete the on-chain transaction process through the native transaction module, and then flexibly handle complex transaction logic and condition judgments through the smart contract module. Combining the native transaction model and smart contracts helps to improve the speed and flexibility of business processing.
[0046] Corresponding to the above method, the present invention also provides a blockchain data processing system combining native transactions and smart contracts, comprising: a native transaction module for receiving native transaction data uploaded by a client, uploading the native transaction data to an on-chain data module included in the smart contract module, and returning a data certificate on-chain; and a smart contract module for processing the native transaction data based on the data certificate, comprising: triggering a pre-compiled contract using a contract virtual machine included in the smart contract module; obtaining and parsing the native transaction data from the on-chain data module based on the data certificate using the interface of the pre-compiled contract; and passing the parsed native transaction data to the contract virtual machine, thereby enabling the smart contract module to obtain and process the native transaction data.
[0047] The blockchain data processing system proposed in this invention, which combines native transactions and smart contracts, can improve the speed of business processing by combining native transaction models and smart contracts. It can also improve the flexibility of transaction processing by expanding diverse transaction needs or complex transaction logic through smart contracts. Furthermore, since there is no need to expand the native transaction model on the chain, it helps to ensure the stability and smooth operation of the transaction system.
[0048] In some embodiments of the present invention, the data processing system on the blockchain further includes a pre-written contract script of a smart contract module deployed on the blockchain, wherein the smart contract module obtains and processes the native transaction data according to the contract script.
[0049] In the actual implementation process, after writing the contract script of the smart contract module, the interface address exposed by the pre-compiled contract can be called to obtain data from the on-chain data module and process it through the pre-compiled contract.
[0050] By employing this embodiment of the invention, by deploying the contract script to the smart contract module on the blockchain, functions that the original on-chain native transaction module cannot achieve can be flexibly implemented. Furthermore, this method does not require any modification to the blockchain itself, and therefore does not increase the bloat of the blockchain.
[0051] Figure 2 This is a flowchart of a blockchain data processing method that combines native transactions and smart contracts, according to another embodiment of the present invention.
[0052] ①: The client uploads native transaction data to the native transaction module on the blockchain, and the client receives the data credentials returned by the native transaction module on the chain.
[0053] The native transaction module is the implementation method of the native transaction model. Both the native transaction module and the smart contract module are part of the blockchain.
[0054] In practice, the data credential can be a request ID, used to distinguish and retrieve native transaction data.
[0055] ②: The native transaction module processes native transaction data and uploads it.
[0056] ③: The client calls the smart contract module to process the native transaction data based on the data credentials.
[0057] The client initiates the call to obtain the native transaction data and then hands it over to the smart contract module for processing.
[0058] ④: The smart contract module includes (or loads) pre-compiled contracts triggered by the contract virtual machine.
[0059] ⑤: The interface of the pre-compiled contract accesses the on-chain data module through data credentials to obtain the corresponding native transaction data.
[0060] The smart contract module includes an on-chain data module, which refers to a loading relationship. The smart contract module loads the on-chain data module. After the smart contract module is initialized on the blockchain, the on-chain data module is loaded first, so that the pre-compiled module can access the on-chain data module.
[0061] ⑥: The pre-compiled contract delivers the raw transaction data to the contract virtual machine for processing. Afterwards, the smart contract module, having obtained the raw transaction data through the contract virtual machine, can process it as needed.
[0062] When a contract is invoked, the contract virtual machine triggers a pre-compiled contract. The corresponding pre-compiled contract interface is obtained based on the address of the pre-compiled contract. The pre-compiled contract interface obtains the corresponding native transaction data from the on-chain data module based on the request ID, parses it, and returns it to the contract virtual machine.
[0063] Compared with the prior art, the technical effects of adopting the above-described embodiments include: (1) improving business processing speed by combining native transaction models and smart contracts; and (2) enabling diversified business needs to be expanded based on smart contracts without needing to extend the on-chain native transaction model.
[0064] To explain the differences between this solution and existing technologies in layman's terms, the following is a statement: (1) If existing technologies are used to meet the needs of the traceability business process, since the on-chain native transaction model does not meet the traceability function, a separate traceability module needs to be developed and integrated into the blockchain, which increases the bloat of the blockchain. (2) However, if it is done through smart contracts, only a contract script needs to be written and deployed to the on-chain smart contract module. The traceability function can be achieved through the interaction between the smart contract module and the on-chain native transaction module. This method does not require any modification to the blockchain itself, so it does not increase the bloat of the blockchain.
[0065] Corresponding to the above method, the present invention also provides an electronic device, which includes a computer device, the computer device including a processor and a memory, the memory storing computer instructions, the processor executing the computer instructions stored in the memory, and when the computer instructions are executed by the processor, the electronic device performs the steps of the method as described above.
[0066] Corresponding to the methods described above, the present invention also provides a computer-readable storage medium having a computer program / instructions stored thereon, which, when executed by a processor, implements the steps of the method as described in any of the above embodiments. The computer-readable storage medium may be a tangible storage medium, such as random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, register, floppy disk, hard disk, removable storage disk, CD-ROM, or any other form of storage medium known in the art.
[0067] Corresponding to the above methods, the present invention also provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of the method as described in any of the above embodiments.
[0068] Those skilled in the art will understand that the exemplary components, systems, and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software, or a combination of both. Whether implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this invention. When implemented in hardware, it can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this invention are programs or code segments used to perform the desired tasks. The programs or code segments can be stored in a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried in a carrier wave.
[0069] It should be clarified that the present invention is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of the present invention.
[0070] In this invention, features described and / or illustrated for one embodiment may be used in the same or similar manner in one or more other embodiments, and / or combined with or in place of features of other embodiments.
[0071] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, various modifications and variations of the embodiments of the present invention are possible. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A blockchain-based data processing method combining native transactions and smart contracts, characterized in that, include: Upload native transaction data to the on-chain data module included in the smart contract module using the native transaction module, and receive the data credentials returned from the on-chain module; Based on data credentials, the smart contract module is invoked to process native transaction data, including: triggering a pre-compiled contract through the contract virtual machine included in the smart contract module; The pre-compiled contract interface is used to obtain and parse native transaction data from the on-chain data module based on the data credentials; the parsed native transaction data is then handed over to the contract virtual machine, so that the smart contract module can obtain and process the native transaction data.
2. The method according to claim 1, characterized in that, The process of uploading native transaction data to the smart contract module using the native transaction module includes the following steps: the native transaction module, which is pre-deployed on the blockchain, receives the native transaction data uploaded by the client and returns data credentials to the client; the native transaction module processes the native transaction data and uploads the native transaction data to the on-chain data module included in the smart contract module.
3. The method according to claim 2, characterized in that, The native transaction module processes native transaction data, including: verifying the signature of the received native transaction data and reaching a consensus on the native transaction data.
4. The method according to claim 1, characterized in that, The step of using the interface of the precompiled contract to obtain and parse the native transaction data from the on-chain data module based on the data credentials includes: obtaining the interface of the corresponding precompiled contract according to the address of the precompiled contract, and the interface of the precompiled contract obtaining and parsing the corresponding native transaction data from the on-chain data module based on the data credentials.
5. The method according to claim 1, characterized in that, The method also includes the step of pre-deploying the written contract script to the smart contract module on the blockchain, so that the smart contract module can obtain and process the native transaction data according to the contract script.
6. A blockchain-based data processing method combining native transactions and smart contracts, characterized in that, include: The client uploads native transaction data to the native transaction module and receives data credentials returned by the on-chain native transaction module; the native transaction module further uploads the native transaction data to the on-chain data module included in the smart contract module; The client sends a processing request containing the data credentials to the smart contract module, which then processes the native transaction data based on the data credentials. This process includes: triggering a pre-compiled contract through the contract virtual machine included in the smart contract module; obtaining and parsing the native transaction data from the on-chain data module based on the data credentials using the interface of the pre-compiled contract; and passing the parsed native transaction data to the contract virtual machine, thereby enabling the smart contract module to obtain and process the native transaction data.
7. A blockchain-based data processing system combining native transactions and smart contracts, characterized in that, include: The native transaction module is used to receive native transaction data uploaded by the client, upload the native transaction data to the on-chain data module included in the smart contract module, and return data credentials on-chain. The smart contract module is used to process raw transaction data based on data credentials; it includes: triggering pre-compiled contracts using the contract virtual machine included in the smart contract module; The pre-compiled contract interface is used to obtain and parse native transaction data from the on-chain data module based on the data credentials; the parsed native transaction data is then handed over to the contract virtual machine, so that the smart contract module can obtain and process the native transaction data.
8. The blockchain data processing system according to claim 7, characterized in that, The blockchain-based data processing system also includes pre-written contract scripts for smart contract modules deployed on the blockchain. The smart contract modules obtain and process the raw transaction data according to the contract scripts.
9. An electronic device comprising a processor, a memory, and a computer program / instructions stored in the memory, characterized in that, The processor is used to execute the computer program / instructions, and when the computer program / instructions are executed, the electronic device implements the steps of the method as described in any one of claims 1 to 5.
10. A computer-readable storage medium having a computer program / instructions stored thereon, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method as described in any one of claims 1 to 5.