Data processing method and device based on block chain, equipment and medium
The blockchain-based data processing method extends the asset management components function, which solves the problems of decreased usage and high development costs during the update process, achieves higher usage and lower development costs, and enhances data security.
Patent Information
- Application Number
- CN202311554739.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-20
- Publication Date
- 2025-05-20
AI Technical Summary
The asset management components affect the normal use of users during the update process, resulting in a decrease in usage rate, and the update process involves a large number of code modifications, increasing development costs.
The blockchain-based data processing method is adopted to determine the matching asset transaction expansion component by receiving functional expansion requests, and the initial asset management component is functionally expanded to realize the validity verification and signature of asset transactions, and finally the transaction is put on the chain for processing.
It improves the utilization rate of asset management components, reduces development costs, and enhances the security and reliability of data through the decentralized characteristics of blockchain.
Smart Images

Figure CN120020854A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of blockchain technology, and in particular, to a data processing method, apparatus, device, and medium based on blockchain. Background Art
[0002] The asset management component is a tool for assisting an object in managing various digital assets. A user can use the asset management component to store, transfer, etc. digital assets. Currently, in order to meet the diverse needs of users, developers will update the asset management component irregularly. However, the update process of the asset management component will affect the normal use of users, resulting in a decrease in the usage rate of the asset management component; in addition, the update process of the asset management component usually involves modifying a large amount of development code. Frequent updates to the asset management component will increase the development cost of the asset management component. Summary of the Invention
[0003] Embodiments of this application provide a data processing method, apparatus, device, and medium based on blockchain, which can improve the usage rate of the asset management component and reduce the development cost of the asset management component.
[0004] Embodiments of this application on the one hand provide a data processing method based on blockchain, the method comprising:
[0005] Receiving a function extension request corresponding to an initial asset management component, and determining an asset transaction extension component matching the function extension request in a function extension library;
[0006] Functionally extending the initial asset management component according to the asset transaction extension component to obtain a target asset management component;
[0007] If an asset transaction request is received, validating the validity of the asset transaction corresponding to the asset transaction request according to the asset transaction extension component in the target asset management component to obtain a transaction verification result;
[0008] If the transaction verification result indicates that the asset transaction verification is passed, signing the asset transaction with the private key bound to the target asset management component to obtain a transaction signature to be uploaded to the blockchain;
[0009] Sending the transaction signature to be uploaded to the blockchain node so that the blockchain node processes the transaction signature to be uploaded to the blockchain.
[0010] Embodiments of this application on the one hand provide a data processing apparatus based on blockchain, the apparatus comprising:
[0011] An extension component matching module, configured to receive a function extension request corresponding to an initial asset management component, and determine an asset transaction extension component matching the function extension request in a function extension library;
[0012] A function extension module, which is used to extend the functions of the initial asset management component according to the asset transaction extension component to obtain a target asset management component;
[0013] A validity verification module, which is used to, if an asset transaction request is received, verify the validity of the asset transaction corresponding to the asset transaction request according to the asset transaction extension component in the target asset management component to obtain a transaction verification result;
[0014] An asset transaction signature module, which is used to, if the transaction verification result indicates that the asset transaction verification is passed, sign the asset transaction with the private key bound by the target asset management component to obtain a signature transaction to be uploaded to the blockchain;
[0015] A signature transaction upload module, which is used to send the signature transaction to be uploaded to the blockchain node so that the blockchain node processes the signature transaction to be uploaded to the blockchain.
[0016] Among them, the blockchain-based data processing device further includes:
[0017] An extension function creation module, which is used to create an asset management extension class for inheriting the asset management interface, and create a first function extension function in the asset management extension class; the first function extension function has the same function name as the asset management function in the initial asset management component;
[0018] A function adjustment module, which is used to obtain the function adjustment parameters corresponding to the initial asset management component, and generate the implementation logic of the first function extension function according to the function adjustment parameters and the asset management interface;
[0019] An extension component addition module, which determines the asset management extension class containing the implementation logic of the first function extension function as a newly added extension component, and adds the newly added extension component to the function extension library.
[0020] Among them, the extension component matching module determines the asset transaction extension component matching the function extension request in the function extension library, including:
[0021] Display an extension component selection page in the initial asset management component; the extension component selection page includes one or more function extension components in the function extension library;
[0022] In response to the extension component selection operation in the extension component selection page, determine the function extension component triggered by the extension component selection operation as the asset transaction extension component matching the function extension request.
[0023] Among them, the extension component matching module determines the asset transaction extension component matching the function extension request in the function extension library, including:
[0024] In the initial asset management component;
[0025] In response to an input operation on the extended requirement input page, determine the extended requirement information corresponding to the function extension request based on the input information on the extended requirement input page;
[0026] Obtain the function label information corresponding to the function extension components included in the function extension library, and determine the function extension components whose function label information matches the extended requirement information as asset transaction extension components.
[0027] Among them, the function extension module performs function extension on the initial asset management component according to the asset transaction extension component to obtain a target asset management component, including:
[0028] Through the second function extension function in the asset transaction extension component, call the asset management function in the initial asset management component that has the same function name as the second function extension function in the asset transaction extension component;
[0029] Execute the implementation logic of the asset management function and the implementation logic of the second function extension function in the asset transaction extension component to obtain a target asset management component.
[0030] Among them, the asset transaction extension component in the target asset management component includes multiple function extension components; the function extension module executes the implementation logic of the asset management function and the second function extension function to obtain a target asset management component, including:
[0031] Determine the execution order of the second function extension functions in each function extension component according to the asset transaction extension functions of each function extension component in the target asset management component;
[0032] According to the execution order of the second function extension functions in each function extension component, execute the implementation logic of the asset management function and the implementation logic of the second function extension functions in each function extension component to obtain a target asset management component.
[0033] Among them, the asset transaction extension component in the target asset management component includes multiple function extension components; if the validity verification module receives an asset transaction request, it performs validity verification on the asset transaction corresponding to the asset transaction request according to the asset transaction extension component in the target asset management component to obtain a transaction verification result, including:
[0034] Determine the verification priority of each function extension component for the asset transaction corresponding to the asset transaction request according to the execution order of each function extension component in the target asset management component;
[0035] Call each function extension component to perform validity verification on the asset transaction according to the verification priority;
[0036] If the verification result of the asset transaction indicated by any of the functional extension components indicates a failed verification, the verification of the asset transaction is terminated, and it is determined that the transaction verification result corresponding to the asset transaction indicates a failed verification;
[0037] If the verification results of the asset transaction indicated by all the functional extension components indicate a passed verification, it is determined that the transaction verification result corresponding to the asset transaction indicates a passed verification.
[0038] Among them, the asset transaction extension component in the target asset management component includes a transaction whitelist component and a transaction value constraint component; if the validity verification module receives an asset transaction request, it performs a validity verification on the asset transaction corresponding to the asset transaction request according to the asset transaction extension component in the target asset management component, and obtains a transaction verification result, including:
[0039] If an asset transaction request is received, obtain the asset transaction object and the asset transaction value included in the asset transaction corresponding to the asset transaction request;
[0040] Call the transaction whitelist component to obtain the asset transaction whitelist, and call the transaction value constraint component to obtain the transaction value constraint conditions;
[0041] If the asset transaction object belongs to the asset transaction whitelist and the asset transaction value meets the transaction value constraint conditions, it is determined that the transaction verification result corresponding to the asset transaction indicates a passed verification.
[0042] Among them, the blockchain-based data processing device further includes:
[0043] A transaction value statistics module, configured to call the transaction value constraint component to obtain a unit transaction threshold and a transaction statistics threshold, and count the total historical transaction value of the asset transaction object within the historical transaction period;
[0044] A constraint condition judgment module, configured to determine that the asset transaction value meets the transaction value constraint conditions if the asset transaction value is less than or equal to the unit transaction threshold and the sum of the asset transaction value and the total historical transaction value is less than or equal to the transaction statistics threshold.
[0045] Among them, if the transaction verification result indicates that the asset transaction verification is passed, the asset transaction signature module signs the asset transaction with the private key bound by the target asset management component to obtain a transaction signature to be uploaded to the chain, including:
[0046] If the transaction verification result indicates that the asset transaction verification is passed, determine multiple transaction signature objects corresponding to the asset transaction;
[0047] Send a transaction signature request corresponding to the asset transaction to each transaction signature object, so that each transaction signature object signs the asset transaction with the private key bound in the target asset management component to generate an initial signature transaction;
[0048] Obtain an initial signature transaction, count the number of signatures corresponding to the initial signature transaction. If the number of signatures is greater than or equal to the quantity threshold, determine the initial signature transaction as a signature transaction to be chained.
[0049] Among them, the asset transaction extension component in the target asset management component includes a block voting component; the data processing device based on the blockchain further includes:
[0050] A voting object acquisition module, configured to, if receiving a block voting request sent by a blockchain node, call the block voting component to obtain a set of voting objects; the transaction block corresponding to the block voting request includes a signature transaction to be chained.
[0051] A transaction block verification module, configured to send a block voting request to each voting object in the set of voting objects, so that each voting object verifies the transaction block according to the block voting request to obtain block voting information corresponding to each voting object; one voting object corresponds to one block voting information.
[0052] A voting result sending module, configured to obtain the block voting information corresponding to each voting object, determine the block voting result of the target asset management component for the transaction block according to the block voting information corresponding to each voting object, and return the block voting result to the blockchain node.
[0053] Among them, the asset transaction extension component in the target asset management component includes multiple function extension components; the data processing device based on the blockchain further includes:
[0054] An extended function removal module, configured to receive a function removal request corresponding to the target asset management component, determine a component to be removed among the multiple function extension components included in the asset transaction extension component according to the function removal request, and remove the component to be removed from the target asset management component.
[0055] An embodiment of the present application provides a computer device on the one hand, including a memory and a processor. When the computer program stored in the memory is executed by the processor, the processor executes the steps of the method in the embodiment of the present application on the one hand.
[0056] An embodiment of the present application provides a computer-readable storage medium on the one hand. The computer-readable storage medium stores a computer program, and the computer program includes program instructions. When the program instructions are executed by the processor, the steps of the method in the embodiment of the present application on the one hand are executed.
[0057] According to one aspect of the present application, a computer program product or a computer program is provided. The computer program product or the computer program includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in the various alternative manners of the above-mentioned one aspect.
[0058] In the embodiments of the present application, through the asset trading extension component, new extension functions can be dynamically added to the initial asset management component, and thus the function extension of the initial asset management component can be realized to meet business requirements. During the process of function extension of the asset management component, the main code of the asset management component does not change, and the old version of the asset management component may still be used normally, thereby improving the utilization rate of the asset management component. In addition, during the process of function extension of the asset management component, since the main code of the asset management component does not change and no complex code modification is involved, the development cost of the asset management component can be significantly reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0060] Figure 1 is a network architecture diagram provided by an embodiment of the present application;
[0061] Figure 2 is a schematic diagram of the function extension of an asset management component provided by an embodiment of the present application;
[0062] Figure 3 is a flowchart of a data processing method based on a blockchain provided by an embodiment of the present application Figure 1 ;
[0063] Figure 4 is a schematic diagram of determining an asset trading extension component provided by an embodiment of the present application Figure 1 ;
[0064] Figure 5 is a schematic diagram of determining an asset trading extension component provided by an embodiment of the present application Figure 2 ;
[0065] Figure 6 is a flowchart of a data processing method based on a blockchain provided by an embodiment of the present application Figure 2 ;
[0066] Figure 7 It is a schematic diagram for verifying an asset transaction based on an asset transaction extension component provided by an embodiment of the present application;
[0067] Figure 8 It is a schematic diagram for performing multi-signature on an asset transaction provided by an embodiment of the present application;
[0068] Figure 9 It is a schematic structural diagram of a data processing device based on a blockchain provided by an embodiment of the present application;
[0069] Figure 10 It is a schematic structural diagram of a computer device provided by an embodiment of the present application. Detailed implementation manners
[0070] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the protection scope of the present application.
[0071] Blockchain is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, and encryption algorithm. Essentially, blockchain is a decentralized database, a string of data blocks generated by using cryptographic methods. Each data block contains information about a batch of network transactions, which is used to verify the validity (anti-counterfeiting) of the information and generate the next block. Blockchain can include a blockchain underlying platform, a platform product service layer, and an application service layer.
[0072] The underlying blockchain platform may include processing modules such as object management, basic services, smart contracts, and operation management. Among them, the object management module is responsible for the identity information management of all blockchain participants, including maintaining the generation of public and private keys (account management), key management, and maintaining the correspondence between the real identity of users and blockchain addresses (permission management). And under authorization, it supervises and audits the transaction situations of certain real identities, and provides rule configuration for risk control (risk control and auditing); the basic service module is deployed on all blockchain node devices to verify the validity of business requests, and records the valid requests on the storage after consensus. For a new business request, the basic service first performs interface adaptation parsing and authentication processing (interface adaptation), then encrypts the business information through the consensus algorithm (consensus management), transmits it to the shared ledger completely and consistently after encryption (network communication), and performs record storage; the smart contract module is responsible for the registration and issuance of contracts, contract triggering, and contract execution. Developers can define contract logic through a certain programming language, publish it to the blockchain (contract registration), trigger the execution by calling keys or other events according to the logic of the contract terms, complete the contract logic, and at the same time provide functions for contract upgrade and cancellation; the operation management module is mainly responsible for the deployment, configuration modification, contract setting, cloud adaptation during the product release process, and visual output of the real-time status during product operation, such as: alarm, detecting network conditions, detecting the health status of node devices, etc.
[0073] A smart contract can be understood as a computer program that runs on a distributed ledger (i.e., blockchain), has preset rules, state, and conditional responses, can encapsulate, verify, and execute complex behaviors of distributed nodes, and complete information exchange, value transfer, and asset management. Based on the distributed architecture, consensus algorithm, etc. of the blockchain, smart contracts allow objects that do not trust each other to complete transactions without the need for any third-party trusted intermediary or authority. At the same time, digital smart contracts can be flexibly embedded in various tangible or intangible assets, transactions, and data to achieve active or passive asset, information management and control, and gradually build programmable smart assets, systems, etc.
[0074] Please refer to Figure 1 , Figure 1 FIG. is a schematic structural diagram of a network architecture provided by an embodiment of the present application. The network architecture may include a service node 10a and a blockchain network. The service node 10a may refer to a device outside the blockchain network or a device in the blockchain network. The embodiment of the present application does not make any limitation on this.
[0075] The blockchain network may be composed of multiple blockchain nodes. The embodiment of the present application does not make any limitation on the number of blockchain nodes included in the blockchain network. Figure 1 Taking 6 blockchain nodes as an example for illustration, as Figure 1As shown in the figure, the blockchain network may include blockchain nodes 20a, 20b, 20c, 20d, 20e, 20f, etc. Among them, each blockchain node in the blockchain network is networked in a peer-to-peer network manner, and nodes can communicate with each other according to the peer-to-peer network protocol. Each node in the blockchain network jointly follows the broadcast mechanism and consensus mechanism to jointly ensure the immutability and non-forgery of the data on the blockchain, and at the same time realize the characteristics of decentralization and trustlessness of the blockchain.
[0076] Among them, the service node 10a can perform data interaction with each blockchain node in the blockchain network. For example, the service node 10a can initiate a data uploading request to the blockchain node 20a in the blockchain network so that the blockchain node 20a stores the service data generated by the service node 10a into the blockchain. The service node 10a can also initiate a data query request to the blockchain node 20a so that the blockchain node 20a returns a corresponding data query result to the service node 10a according to the data query request corresponding to the service node 10a. It can be understood that the embodiments of the present application do not limit the connection method between the service node 10a and each blockchain node in the blockchain network, and can be directly or indirectly connected through a wired communication method, or can be directly or indirectly connected through a wireless communication method.
[0077] The service node 10a and the blockchain nodes in the blockchain network can be terminal devices, or can also be servers, or can also be a system composed of terminal devices and servers. The embodiments of the present application do not limit this. Terminal devices may include, but are not limited to: personal computers, smart phones, tablet computers, laptop computers, palmtop computers, mobile internet devices (MID), wearable devices (such as smart watches, smart bracelets, etc.), intelligent voice interaction devices, smart home appliances (such as smart TVs, etc.), vehicle-mounted devices, aircraft and other electronic devices. The embodiments of the present application do not limit the type of terminal devices.
[0078] The server can be an independent physical server, or can also be a server cluster or distributed system composed of multiple physical servers, or can also be a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms. The embodiments of the present application do not limit the type of the background server corresponding to the service application.
[0079] In an embodiment of the present application, the service node 10a may be installed with one or more asset management components. Among them, the asset management component is a tool for assisting business objects to manage various digital assets (such as digital artworks, electronic documents, game accounts, etc.). Business objects can store, transfer, etc. digital assets through the asset management component. For example, a business object can transfer digital assets to other accounts based on the asset management component, or can receive digital assets transferred from other accounts based on the asset management component, and so on.
[0080] Optionally, the asset management component running on the service node 10a may also be a Decentralized Application (DAPP). Among them, DAPP refers to an application program built based on blockchain technology. It does not rely on traditional centralized servers or institutions to run, but realizes functions such as data storage, computing, and transactions through a decentralized blockchain network. Specifically, DAPP combines smart contracts and a front-end interface. When the smart contract of DAPP is successfully deployed on the blockchain, DAPP can provide services for business objects that hope to interact with the smart contract; that is to say, when the asset management component is a DAPP, it can interact with the smart contract deployed on the blockchain. It can be understood that when the asset management component is a DAPP, when a business object interacts with the smart contract deployed on the blockchain in the asset management component, all operations it performs can be stored on the blockchain in the form of transaction data to improve the security and reliability of the data.
[0081] Currently, in order to meet the diverse needs of business objects, developers will update the asset management component irregularly. However, the update process of the asset management component will affect the normal use of business objects. Especially when the asset management component is a DAPP, once the development code of the asset management component is modified, the old version of the asset management component will become invalid, resulting in the old version of the asset management component being unable to be used normally, thus causing a decrease in the usage rate of the asset management component. In addition, the update process of the asset management component usually also involves a large amount of modification of development code. Frequent updates to the asset management component will increase the development cost of the asset management component.
[0082] To solve the above problems, the embodiments of the present application provide an asset management component with high flexibility, scalability, and customizability, which can solve the limitations of traditional asset management components in terms of fixed functions, lack of flexibility and scalability. Business objects can dynamically add or combine new asset transaction extension functions to the asset management component according to their own usage requirements, thereby better meeting the specific needs of business objects. In addition, when the embodiments of the present application expand the functions of the asset management component, the main code of the asset management component does not change, but the parameters in the asset management function in the asset management component change. Therefore, when updating, the asset management component can be used normally. In addition, since the main code of the asset management component in the embodiments of the present application does not change, the development cost of the asset management component can be significantly reduced.
[0083] For ease of description, the following takes the example where the user of business node 10a is business object A and the initial asset management component 21a is installed on business node 10a. Please refer to Figure 2 , Figure 2 which is a schematic diagram of the function expansion of an asset management component provided by the embodiments of the present application. As Figure 2 shown, the function expansion library 21b includes multiple function expansion components with different functions, including but not limited to: blacklist component, whitelist component, transaction value constraint component, multiple approval component, block proposal component, block voting component, and other function expansion components.
[0084] It can be understood that the initial asset management component 21a includes basic asset management functions (such as storage, transfer, etc.). The function extension components in the function extension library 21b are supplements to the basic asset management functions in the initial asset management component 21a. In the embodiments of the present application, the initial asset management component 21a can be arbitrarily combined with one or more function extension components in the function extension library 21b to generate a target asset management component 21d. For example, the initial asset management component 21a can be functionally extended according to the blacklist component, so that when the generated target asset management component 21d conducts asset transactions, it can call the blacklist component to obtain the asset transaction blacklist, thereby filtering out asset transactions whose asset transaction objects belong to the asset transaction blacklist through the blacklist component; another example is that the initial asset management component 21a can be functionally extended according to the multiple approval component, so that when the generated target asset management component 21d conducts asset transactions, it can call the multiple approval component to obtain the approval object list, thereby filtering out asset transactions for which any one of the approval objects in the approval object list indicates non-approval through the multiple approval component; yet another example is that the initial asset management component 21a can be functionally extended according to the block proposal component, so that when the generated target asset management component 21d receives a block proposal request, it can call the block proposal component to generate a block proposal for the asset transaction included in the block proposal request.
[0085] As Figure 2 shown, when business object A uses the initial asset management component 21a, the function of the initial asset management component 21a can be extended according to the change of usage requirements. Specifically, business object A can perform a trigger operation on the function extension control in the initial asset management component 21a. The initial asset management component 21a responds to the trigger operation of business object A on the function extension control, generates a function extension request corresponding to the initial asset management component 21a, and then, according to this function extension request, searches in the function extension library 21b for an asset transaction extension component 21c that matches the function extension request. The determination process of the asset transaction extension component 21c will be described in detail below and will not be elaborated here.
[0086] As Figure 2 shown, assuming that the asset transaction extension component 21c includes a blacklist component and a multiple approval component, the initial asset management component 21a can be functionally extended according to the blacklist component and the multiple approval component to obtain a target asset management component 21d, so that the target asset management component 21d includes the basic asset management functions in the initial asset management component 21a and the asset transaction extension functions included in the blacklist component and the multiple approval component.
[0087] Further, business object A can initiate an asset transaction request in the target asset management component 21d. When the target asset management component 21d receives the asset transaction request, it can perform validity verification on the asset transaction 21e corresponding to the asset transaction request according to the blacklist component and the multiple approval components in the target asset management component 21d. As Figure 2 shown, the asset transaction information in the asset transaction 21e may include, but is not limited to: the asset to be traded, the asset transaction value, and the asset transaction object (for example, the asset transfer object and the asset transfer-in object), etc. For example, the target asset management component 21d can verify whether the asset transaction objects (for example, asset transaction object a and asset transaction object b) in the asset transaction 21e belong to the asset transaction blacklist corresponding to the blacklist component, and verify the asset transaction 21e through each approval object in the approval object list corresponding to the multiple approval components.
[0088] As Figure 2 shown, when both the blacklist component and the multiple approval components indicate that the verification of the asset transaction 21e passes, the asset transaction 21e is signed with the private key bound by the target asset management component 21d to obtain the transaction signature to be uploaded to the blockchain 21f, and the transaction signature to be uploaded to the blockchain 21f is uploaded to the blockchain node 21g. The private key may specifically be the object private key stored by the business object A in the target asset management component 21d. After receiving the transaction signature to be uploaded to the blockchain 21f, the blockchain node 21g can process the transaction signature to be uploaded to the blockchain 21f (for example, verify the signature, store, etc.). The specific processing process will be described in detail below and will not be elaborated here.
[0089] The asset management component provided by the embodiments of the present application can be used in multiple application fields such as asset management, community governance of the blockchain, and decentralized finance. The function expansion method of the asset management component involved in the embodiments of the present application will be described in detail below.
[0090] Please refer to Figure 3 , Figure 3 which is a schematic flowchart of a blockchain-based data processing method provided by the embodiments of the present application. Figure 1 . It can be understood that the blockchain-based data processing method can be executed by a business node. The business node can be installed with an initial asset management component, and the business node can be the Figure 1 business node 10a in the network architecture shown. As Figure 3 shown, the blockchain-based data processing method may include the following steps S101 to S105:
[0091] Step S101: Receive a function expansion request corresponding to the initial asset management component, and determine an asset transaction expansion component matching the function expansion request in the function expansion library.
[0092] The initial asset management component refers to an asset management component with basic asset management functions such as storage and transfer; a function extension request refers to a request initiated to expand or improve the functions of the initial asset management component. The function extension library may refer to a storage space for storing multiple function extension components, and different function extension components have different extension functions. For example, it may store function extension components related to asset management. By combining the initial asset management component with the function extension components related to asset management, the basic asset management functions in the initial asset management component can be supplemented to meet business requirements. The function extension components related to asset management in the function extension library may include, but are not limited to: transaction permission management components (such as blacklist components, whitelist components, transaction value constraint components, multiple approval components, etc.), community management components (such as block proposal components and block voting components, etc.) and other function extension components.
[0093] In the embodiments of the present application, operations such as dynamically adding and deleting function extension components in the function extension library can be performed. For example, if the usage frequency of some function extension components in the function extension library is too low, the function extension component can be deleted from the function extension library to save storage space. For example, when new asset management-related functions are added, the asset management-related functions can be encapsulated to obtain new function extension components (hereinafter referred to as newly added extension components), and the newly added extension components can be added to the function extension library to provide more function extension options for the initial asset management component.
[0094] The process of adding a new function extension component to the function extension library may include: creating an asset management extension class for inheriting the asset management interface, and creating a first function extension function in the asset management extension class; obtaining the function adjustment parameters corresponding to the initial asset management component, and generating the implementation logic of the first function extension function according to the function adjustment parameters and the asset management interface; and then the asset management extension class containing the implementation logic of the first function extension function can be determined as the newly added extension component, and the newly added extension component can be added to the function extension library.
[0095] Among them, the asset management interface may refer to an abstract interface that defines basic asset management functions, and may include an initial management function, and the initial management function can define specific methods for basic asset management functions such as asset transfer and asset storage. In the embodiments of the present application, both the initial asset management component and the function extension components associated with the initial management component (such as blacklist components or whitelist components, etc.) can inherit or implement the asset management interface. The asset management extension class refers to a class that can inherit or implement the asset management interface, and is specifically used to add or expand the asset management functions of the initial asset management component.
[0096] The first function extension function refers to a method created in the asset management extension class, which can be used to extend the asset management function of the asset management interface. Among them, the first function extension function has the same function name as the asset management function in the initial asset management component. The asset management function refers to a method created in the initial asset management component for implementing asset management. The asset management function can inherit or implement the initial management function in the asset management interface. By running the implementation logic of the asset management function, the initial asset management component can implement basic asset management functions. The function adjustment parameter refers to a parameter used to configure or adjust the asset transaction extension function. The function adjustment parameter can be used to define the behavior or logic of the newly added asset function in the newly added extension component. The function adjustment parameter can be the function adjustment requirement information input by the business object in the initial asset management component, or the adjustment parameter provided by the developer corresponding to the initial asset management component according to technological development and business requirements. Specifically, it can include function parameters corresponding to asset management functions such as permission management, voting, transaction, blacklist, whitelist, transaction value constraint, and multiple approvals.
[0097] Specifically, when creating a newly added extension component, an asset management extension class can be created first. The asset management extension class can inherit or implement the asset management interface. A first function extension function with the same function name as the asset management function in the initial management component can be created in the created asset management extension class, thereby establishing an association relationship between the asset management extension class and the initial asset management component, so that the newly added extension component can call the asset management function in the initial asset management component in the future. Further, the function adjustment parameter corresponding to the initial asset management component can be obtained. In the asset management extension class, the initial management function provided by the asset management interface is modified according to the function adjustment parameter to generate the implementation logic of the first function extension function. Then, the implementation logic of the first function extension function is run, and the asset management extension class containing the implementation logic of the first function extension function is determined as the newly added extension component to complete the encapsulation of the newly added extension component, and the newly added extension component is added to the function extension library for subsequent use.
[0098] In the embodiment of the present application, since the first function extension function in the newly added extension component has the same function name as the asset management function in the initial asset management component, and both the newly added extension component and the initial asset management component can inherit or implement the asset management interface, the newly added extension component and the initial asset management component can be in a relationship of decorator and decorated. That is to say, in the embodiment of the present application, the initial asset management component allows the newly added extension component to be dynamically added during runtime to implement the function extension of the initial asset management component without changing the original class of the initial asset management component or using inheritance. The initial asset management component may be normally used during the update process. Therefore, the embodiment of the present application can achieve the hot update of the initial asset management component.
[0099] The asset transaction extension component refers to one or more function extension components in the function extension component that match the function extension request. Similarly, the asset transaction extension component and the initial asset management component can implement the same interface, such as the asset management interface, etc. Therefore, the initial asset management component can be arbitrarily combined with the asset transaction extension component to achieve the extension of the basic functions of the initial asset management component. The creation method of the asset transaction extension component can refer to the creation method of the newly added extension component mentioned above and will not be elaborated here.
[0100] In a possible implementation manner, the determination process of the asset transaction extension component may include: displaying an extension component selection page in the initial asset management component; and then, in response to the extension component selection operation in the extension component selection page, determining the function extension component triggered by the extension component selection operation as the asset transaction extension component that matches the function extension request.
[0101] Specifically, please refer to Figure 4 , Figure 4 which is a schematic diagram of determining the asset transaction extension component provided by the embodiment of the present application. Figure 1 As Figure 4 shown, the initial asset management component 30a may include a function extension control 31a, and the function extension control 31a may be used to trigger the function extension request corresponding to the initial asset management component 30a to extend the functions of the initial asset management component 30a. It can be understood that the initial asset management component 30a provided by the embodiment of the present application has high flexibility, scalability, and customizability. The user object of the initial asset management component 30a (for example, business object A) can arbitrarily add and combine the asset management functions of the initial asset management component 30a according to the usage requirements, so as to obtain a personalized asset management component.
[0102] As Figure 4As shown, when business object A has a function expansion requirement, a trigger operation can be performed on the function expansion control 31a in the initial asset management component 30a. In response to the trigger operation of business object A on the function expansion control 31a, the initial asset management component 30a can generate a function expansion request in the background server corresponding to the initial asset management component 30a, and then can perform function expansion for the initial asset management component 30a according to the function expansion request. As Figure 4 shown, after the background server corresponding to the initial asset management component 30a generates a function expansion request, an extended component selection page 31b can be displayed in the initial asset management component 30a. The extended component selection page 31b can include one or more function expansion components in the function expansion library. Specifically, the function expansion components included in the extended component selection page 31b are function expansion components that implement the same interface as the initial asset management component 30a. For example, function expansion components such as function expansion component 1, function expansion component 2, function expansion component 3, and function expansion component 4 can all provide asset management expansion functions for the initial asset management component 30a.
[0103] Business object A can select one or more function expansion components in the extended component selection page 31b for function expansion. For example, business object A can select function expansion component 1 and function expansion component 2 in the extended component selection page 31b, and perform a trigger operation on the "confirm" control 31c in the extended component selection page 31b to determine function expansion component 1 and function expansion component 2 as asset transaction expansion components 31e that match the function expansion request. The initial asset management component 30a can respond to the extended component selection operation in the extended component selection page 31b and determine the function expansion components triggered by the extended component selection operation (for example, function expansion component 1 and function expansion component 2) as asset transaction expansion components 31e.
[0104] Furthermore, the initial asset management component 30a can be functionally expanded according to the asset transaction expansion component 31e to obtain a target asset management component 30b. The specific function expansion process will be described in detail below and will not be elaborated here. After the function expansion is completed, a successful expansion prompt page 31d can be generated to prompt business object A that the function expansion of the initial asset management component 30a has been completed. Optionally, the successful expansion prompt page 31d can include a "return" control 31f. Business object A can perform a trigger operation on the "return" control 31f, and then in response to the trigger operation on the "return" control 31f, display the asset management page of the target asset management component 30b so that business object A can perform asset transactions on the asset management page of the target asset management component 30b.
[0105] The embodiments of the present application do not limit the display form of the asset trading extension component 31e. For example, the function extension components included in the asset trading extension component 31e can be independently displayed on the asset management page of the target asset management component 30b. As Figure 4 shown, the asset management page of the target asset management component 30b may include the function extension component 1 and the function extension component 2 in the asset trading extension component 31e. When the business object A conducts an asset transaction in the target asset management component 30b, a trigger operation can be performed on the function extension component 1 or the function extension component 2, and then the function extension component 1 or the function extension component 2 is used to perform validity verification for the asset transaction corresponding to the business object A to meet the business requirements of the business object A. Among them, the specific implementation process of performing validity verification on the asset transaction through the asset trading extension component will be described in detail below and will not be elaborated here.
[0106] Optionally, when the asset trading extension component 31e includes multiple function extension components, the multiple function extension components can be integrated into a comprehensive extension component according to the asset trading extension functions corresponding to each function extension component. The comprehensive extension component can simultaneously include the asset management extension functions of multiple function extension components. Furthermore, the comprehensive extension component can be displayed on the asset management page of the target asset management component 30b, and the business object A can perform a trigger operation on the comprehensive extension component to perform validity verification on the asset transaction according to the comprehensive extension component.
[0107] Optionally, the asset trading extension component 31e can also be integrated with the basic asset management component (such as a transfer component or a receipt component) in the initial asset management component 30a according to the asset management extension function provided by the asset trading extension component 31e to generate an asset transaction processing component. The asset transaction processing component can simultaneously include the basic asset management functions of the transfer component or the receipt component, as well as the asset management extension functions of the asset trading extension component; similarly, the asset transaction processing component can be displayed on the asset management page of the target asset management component 30b, and the business object A can perform a trigger operation on the asset transaction processing component to conduct an asset transaction through the asset transaction processing component.
[0108] In a possible implementation, the determination process of the asset trading extension component may include: displaying an extension requirement input page in the initial asset management component; in response to an input operation in the extension requirement input page, determining the input information in the extension requirement input page as the extension requirement information corresponding to the function extension request, where the extension requirement information may be used to indicate the asset management extension function required by the user of the initial asset management component; and then obtaining the function label information corresponding to the function extension component included in the function extension library, and determining the function extension component whose function label information matches the extension requirement information as the asset trading extension component.
[0109] Specifically, please refer to Figure 5 , Figure 5 which is a schematic diagram of determining an asset trading extension component provided by an embodiment of the present application. Figure 2 . As Figure 5 shown, the initial asset management component 40a may include a function extension control 41a. When the business object A has a function extension requirement, a trigger operation may be performed on the function extension control 41a. In response to the trigger operation of the business object A on the function extension control 41a, the initial asset management component 40a may generate a function extension request for the initial asset management component 40a in the background server corresponding to the initial asset management component 40a, and display an extension requirement input page 41b in the initial asset management component 40a.
[0110] As Figure 5 shown, the extension requirement input page 41b may include an extension requirement input field 41c. The business object A may manually input extension requirement information in the extension requirement input field 41c. For example, "whitelist" may be input in the extension requirement input field 41c as the extension requirement information; the extension requirement input page 41b may further include a popular requirement selection field 41d, and the popular requirement selection field 41d may include some popular requirements with high usage frequencies of the business object, such as requirement information such as "blacklist", "whitelist", "multiple approvals", "proposal", and "vote". The business object A may select one or more popular requirements in the popular requirement selection field 41d, and the initial asset management component 40a may respond to the popular requirement selection operation of the business object A in the popular requirement selection field 41d, and visually display one or more popular requirements (such as "vote") triggered by the popular requirement selection operation in the extension requirement input field 41c. As Figure 5 shown, the business object A may perform a trigger operation on the "confirm" control 41e in the extension requirement input page 41b, and the initial asset management component 40a may respond to the trigger operation of the business object A on the "confirm" control 41e, and determine the input information (such as "whitelist" and "vote") in the extension requirement input field 41c of the extension requirement input page 41b as the extension requirement information corresponding to the function extension request.
[0111] Further, according to the extended requirement information, an asset transaction extension component 42b that matches the extended requirement information can be found in the function extension library 42a. As Figure 5 shown, the function extension components in the function extension library 42a can carry function label information describing the asset management extension functions corresponding to the function extension components. For example, the function label information corresponding to the blacklist component can include: blacklist, security, asset transaction, etc. label information; the function label information corresponding to the whitelist component can include: whitelist, security, asset transaction, etc. label information; the function label information corresponding to the transaction value constraint component can include: transaction value, security, asset transaction, etc. label information; the function label information corresponding to the block voting component can include: block, voting, etc. label information. The function label information corresponding to the function extension component can be matched with the extended requirement information (such as "whitelist" and "voting"). For example, the "whitelist" in the function label information corresponding to the whitelist component matches the "whitelist" in the extended requirement information, and the "voting" in the function label information corresponding to the block voting component matches the "voting" in the extended requirement information. Therefore, the whitelist component and the block voting component can be determined as the asset transaction extension component 42b.
[0112] As Figure 5 shown, the initial asset management component 40a can be functionally extended according to the asset transaction extension component 42b to obtain the target asset management component 40b. The specific functional extension process will be described in detail below and will not be elaborated here. After the functional extension is completed, an extension success prompt page 42c can be generated to prompt that business object A has completed the functional extension of the initial asset management component 40a. Business object A can perform a trigger operation on the "Return" control 42d in the extension success prompt page 42c, and then, in response to the trigger operation on the "Return" control 42d, display the asset management page of the target asset management component 40b. As Figure 5 shown, the asset management page of the target asset management component 40b can include the whitelist component and the block voting component in the asset transaction extension component 42b. When business object A conducts an asset transaction in the target asset management component 40b, a trigger operation can be performed on the whitelist component, and then the whitelist component can perform validity verification on the asset transaction corresponding to business object A to meet the business requirements of business object A; business object A can participate in the maintenance of the blockchain through the block voting component. For example, business object A can verify the transaction block through the block voting component to participate in the voting of the transaction block. The specific block voting process will be described in detail below and will not be elaborated here.
[0113] Optionally, when a function extension request corresponding to the initial asset management component is received, an asset trading extension component can also be matched for the initial asset management component in the function extension library according to the total asset holding corresponding to the digital assets managed by the initial asset management component. For example, the function extension components in the function extension library can be divided into two types of function extension components according to the security level of the function extension components, namely the first type of function extension components (for example, whitelist component, multiple approval component, transaction value constraint component, block proposal component, block voting component, etc.) and the second type of function extension components (for example, blacklist component, etc.), where the security level of the first type of function extension components is higher than that of the second type of function extension components.
[0114] Furthermore, the total asset holding managed by the initial asset management component can be compared with an asset holding threshold (the specific value can be determined according to the actual situation). If the total asset holding is less than the asset holding threshold, it means that the digital assets managed by the initial asset management component have a low requirement for the security level of the service extension component, and the second type of function extension component in the function extension library can be determined as the asset trading extension component that matches the function extension request. If the total asset holding is greater than or equal to the asset holding threshold, it means that the digital assets managed by the initial asset management component have a high requirement for the security level of the service extension component, and the first type of function extension component in the function extension library can be determined as the asset trading extension component that matches the function extension request. It can be understood that in practical applications, in addition to classifying function extension components according to the security level of function extension components, function extension components can also be classified according to indicators such as the usage frequency and usage evaluation of function extension components.
[0115] Step S102: Functionally extend the initial asset management component according to the asset trading extension component to obtain a target asset management component.
[0116] In the embodiment of the present application, the second function extension function in the asset trading extension component has the same function name as the asset management function in the initial asset management component, and both the asset trading extension component and the initial asset management component can inherit or implement the asset management interface. Therefore, the asset trading extension component and the initial asset management component are in a relationship of decorator and decorated, so the asset trading extension component can be dynamically integrated with the initial asset management component according to the decorator pattern to extend the asset management function of the asset trading extension component, thereby obtaining a target asset management component. Among them, the second function extension function refers to a method created in the asset management extension class corresponding to the asset trading extension component for implementing the asset management extension function corresponding to the asset trading extension component.
[0117] Among them, the decorator pattern can, without changing the original object, wrap the original object in a decorator object and then extend the functions of the original object through the decorator object. In the embodiments of the present application, the original object may refer to the initial asset management component, and the decorator object may refer to the asset trading extension component. That is to say, in the decorator pattern, it is possible to expand the functions of the initial asset management component through the asset trading extension component without modifying the main code corresponding to the initial asset management component, and generate the target asset management component.
[0118] The process of expanding the functions of the initial asset management component may include: calling, through the second function expansion function in the asset trading extension component, the asset management function in the initial asset management component that has the same function name as the second function expansion function in the asset trading extension component; and then executing the implementation logic of the asset management function and the implementation logic of the second function expansion function in the asset trading extension component to obtain the target asset management component.
[0119] In the embodiments of the present application, since the asset trading extension component and the initial asset management component are in a relationship of decorator and decorated, and the second function expansion function in the asset trading extension component has the same function name as the asset management function in the initial asset management component, therefore, the asset management function can be called through the second function expansion function, and on the basis of the implementation logic corresponding to the asset management function, the implementation logic corresponding to the second function expansion function can be added, thereby adding the asset trading extension function corresponding to the asset trading extension component to the initial asset management component. Further, the implementation logic of the asset management function and the implementation logic of the second function expansion function in the asset trading extension component can be executed to perform a hot update on the initial asset management component to obtain the target asset management component, so that the target asset management component includes both the basic asset management function of the initial asset management component and the asset trading extension function of the asset trading extension component.
[0120] It can be seen that in the embodiments of the present application, when expanding the functions of the initial asset management component, what is updated is the input parameter of the asset management function in the initial asset management component, and there is no need to modify the main code of the initial asset management component. Therefore, the development cost of the asset management component can be significantly reduced.
[0121] The asset trading extension component in the target asset management component may include multiple function extension components. In this case, according to the execution order of the second function expansion functions in each function extension component included in the asset trading extension component, the implementation logic of the asset management function and the second function expansion functions in each function extension function can be executed to obtain the target asset management component.
[0122] Optionally, multiple function extension components included in the asset transaction extension component can be randomly combined, and the execution order of the second function extension functions in each function extension component can be determined according to the random combination result. For example, the asset transaction extension component includes a blacklist component and a whitelist component. The execution order of the second function extension functions in the blacklist component and the whitelist component can be: whitelist component(blacklist component()), that is, first execute the second function extension function of the blacklist component, and then execute the second function extension function of the whitelist component; or it can also be blacklist component(whitelist component()), that is, first execute the second function extension function of the whitelist component, and then execute the second function extension function of the blacklist component.
[0123] Optionally, the execution order of the second function extension functions in each function extension component can also be determined according to the selection order of business object A. For example, the asset transaction extension component includes a blacklist component and a whitelist component. The function extension components sequentially selected by business object A are: blacklist component, whitelist component. Then the execution order of the second function extension functions in the blacklist component and the whitelist component can be: whitelist component(blacklist component()), that is, first execute the second function extension function of the blacklist component, and then execute the second function extension function of the whitelist component.
[0124] Optionally, the execution order of the second function extension functions in each function extension component can also be determined according to the asset transaction extension functions corresponding to each function extension component. For example, the asset transaction extension component includes a whitelist component, a transaction value constraint component, and a multiple approval component. The execution order of the second function extension functions in the whitelist component, the transaction value constraint component, and the multiple approval component can be determined according to the asset transaction extension functions of the whitelist component, the transaction value constraint component, and the multiple approval component. For example, the execution order can be: whitelist component(transaction value constraint component(multiple approval component())), that is, first execute the second function extension function of the multiple approval component, then execute the second function extension function of the transaction value constraint component, and finally execute the second function extension function of the whitelist component.
[0125] After obtaining the execution order of the second functional extension functions in each functional extension component included in the asset transaction extension component, the implementation logic of the asset management function can be executed first, and then, according to the execution order of the second functional extension functions in each functional extension component, the implementation logic of the second functional extension functions in each functional extension component can be executed to obtain the target asset management component. For example, the asset transaction extension component includes a blacklist component and a whitelist component, and the execution order of the second functional extension functions in the blacklist component and the whitelist component can be: whitelist component(blacklist component()); the execution order of the implementation logic of the asset management function and the second functional extension functions in the blacklist component and the whitelist component can be: whitelist component(blacklist component(initial asset management component())), that is, first execute the implementation logic of the asset management function, then execute the implementation logic of the second functional extension function in the blacklist component, and finally execute the implementation logic of the second functional extension function in the whitelist component, so as to obtain the target asset management component.
[0126] It can be understood that the business object A can add, combine, and remove the functional extension components in the asset management component at any time according to its own usage requirements, so as to obtain different asset management components to meet the constantly changing business requirements. The specific implementation methods of adding and combining functional extension components in the asset management component can refer to the foregoing implementation methods, and the embodiments of the present application will describe the removal process of the functional extension components in detail.
[0127] When the asset transaction extension component in the target asset management component includes multiple functional extension components, the functional extension components with very low usage frequency in the target asset management component can be removed to save the data storage space of the target asset management component. The function removal process of the target asset management component can include: receiving a function removal request corresponding to the target asset management component, and then, according to the function removal request, determining the component to be removed among the multiple functional extension components included in the asset transaction extension component, and removing the component to be removed from the target asset management component.
[0128] A function removal request refers to a request initiated to remove one or more function extension controls included in a target asset management component. The function removal request can be initiated actively by business object A. For example, the target asset management component may include a function removal control, and business object A can perform a triggering operation on the function removal control, thereby actively triggering the corresponding function removal request of the target asset management component through the function removal control; or the function removal request can also be initiated by the target asset management component for business object A. For example, if a certain function extension component in the target asset management component has not been used for more than a time threshold (such as one month, etc.), a function removal request for this function extension component can be initiated by the target asset management component. Among them, the function removal request can include the component to be removed (the specific extension function component to be removed, such as a multiple approval component, etc.), or it can also include removal requirement information (information related to the function extension component to be removed, such as removing the function extension component related to "voting", or removing the function extension component that has not been used within 1 month, etc.).
[0129] Furthermore, the component to be removed corresponding to the function removal request can be determined among the multiple function extension components included in the asset transaction extension component, and the component to be removed can be removed from the target asset management component. It can be understood that the second function extension function in the component to be removed has the same function name as the asset management function in the target asset management component. Therefore, in the implementation logic corresponding to the asset management function in the target asset management component, the implementation logic corresponding to the second function extension function in the component to be removed can be deleted to remove the component to be removed from the target asset management component, thereby improving the scalability and diversity of the asset management component and improving the user experience.
[0130] Step S103: If an asset transaction request is received, the validity of the asset transaction corresponding to the asset transaction request is verified according to the asset transaction extension component in the target asset management component to obtain a transaction verification result.
[0131] An asset transaction request may refer to a request initiated by business object A for asset transaction operations such as asset transfer or asset storage in the target asset management component. For example, the asset transaction extension component in the target asset management component may be a blacklist component. The process of validating the effectiveness of the asset transaction corresponding to the asset transaction request through the blacklist component may include: obtaining the asset transaction object included in the asset transaction corresponding to the asset transaction request, and calling the blacklist component to obtain the asset transaction blacklist. Among them, the transaction objects in the asset transaction blacklist may refer to transaction objects not trusted by the target asset management component; then comparing the asset transaction object with the asset transaction blacklist. If the asset transaction object does not belong to the asset transaction blacklist, it is determined that the transaction verification result corresponding to the asset transaction indicates verification passed; if the asset transaction object belongs to the asset transaction blacklist, it is determined that the transaction verification result corresponding to the asset transaction indicates verification failed. It can be seen that validating the effectiveness of asset transactions through the blacklist component can improve the security of asset transactions.
[0132] In a possible implementation manner, the asset transaction extension component in the target asset management component may include multiple function extension components. In this case, the verification priority of each function extension component for the asset transaction corresponding to the asset transaction request may be determined according to the execution order of each function extension component in the target asset management component. Then, according to the verification priority, each function extension component is called to validate the effectiveness of the asset transaction; if there is a function extension component among each function extension component whose verification result for the asset transaction indicates verification failed, the verification of the asset transaction is ended, and it is determined that the transaction verification result corresponding to the asset transaction indicates verification failed; if the verification results of each function extension component for the asset transaction all indicate verification passed, it is determined that the transaction verification result corresponding to the asset transaction indicates verification passed.
[0133] Among them, the verification priority can be used to characterize the verification order of each functional extension component for asset transactions. The verification priority is directly proportional to the execution order. For example, the earlier the execution order of a functional extension component in the target asset management component, the higher the verification priority of this functional extension component. For example, the asset transaction extension component includes a whitelist component, a transaction value constraint component, and a multiple approval component. The execution order of the whitelist component, the transaction value constraint component, and the multiple approval component can be: whitelist component (transaction value constraint component (multiple approval component ())). Then the target asset management component can be expressed as target asset management component = initial asset management component (whitelist component (transaction value constraint component (multiple approval component ()))). Correspondingly, the verification priorities of the whitelist component, the transaction value constraint component, and the multiple approval component for asset transactions can be whitelist component (transaction value constraint component (multiple approval component ())), that is, first call the multiple approval component to perform validity verification on the asset transaction, then call the transaction value constraint component to perform validity verification on the asset transaction, and finally call the whitelist component to perform validity verification on the asset transaction.
[0134] Suppose the asset transaction request is expressed as Pay(form(x)to(y), amount), where Pay() indicates that the specific asset transaction in the asset transaction request is a transfer transaction, form(x) indicates that the account address of the asset transfer object in the asset transaction is x, form(y) indicates that the account address of the asset transfer-in object in the asset transaction is y, and amount indicates the asset transaction value included in the asset transaction. According to the verification priorities of each functional extension component, first call the multiple approval component to perform validity verification on the asset transaction. For example, confirm whether each approval object in the approval object list corresponding to the multiple approval component has approved the asset transaction. When the verification result of the multiple approval component for this asset transaction indicates that the verification fails, end the verification of the asset transaction, that is, no longer call the transaction value constraint component and the whitelist component to verify this asset transaction. At this time, it is determined that the transaction verification result corresponding to this asset transaction indicates that the verification fails.
[0135] When the verification result of the multi - approval component for the asset transaction indicates that the verification is passed, the transaction value constraint component is called to perform validity verification on the asset transaction value in the asset transaction. For example, it is confirmed whether the asset transaction value meets the transaction value constraint conditions corresponding to the transaction value constraint component. The definition of the transaction value constraint conditions and the specific verification process of the transaction value constraint component will be described below and will not be elaborated here. Similarly, when the verification result of the transaction value constraint component for the asset transaction indicates that the verification fails, the verification of the asset transaction is ended. That is to say, at this time, the whitelist component is no longer called to verify the asset transaction, and it is determined that the transaction verification result corresponding to the asset transaction indicates that the verification fails. When the verification result of the transaction value constraint component for the asset transaction indicates that the verification is passed, the whitelist component is called to verify the asset transaction. If the verification result of the whitelist component for the asset transaction indicates that the verification is passed, it is determined that the transaction verification result corresponding to the asset transaction indicates that the verification is passed.
[0136] Step S104: If the transaction verification result indicates that the asset transaction verification is passed, sign the asset transaction with the private key bound by the target asset management component to obtain the transaction to be signed and uploaded to the blockchain.
[0137] Step S105: Send the transaction to be signed and uploaded to the blockchain node so that the blockchain node processes the transaction to be signed and uploaded to the blockchain.
[0138] In the embodiment of the present application, the target asset management component can provide the import and export function of the private key. The business object A can store its corresponding private key in the local database, cloud server or hardware device of the target asset management component, thereby establishing a binding relationship between the private key of the business object A and the target asset management component. Optionally, the private key of the business object A can also be stored in the key management device. The association relationship between the key management device and the target asset management component can be established, and then the binding relationship between the private key of the business object A and the target asset management component can be established, so that the target asset management component can call the private key of the business object A for signing.
[0139] After the business object A determines that the transaction information in the asset transaction is correct, the target asset management component can respond to the confirmation operation of the business object A for the asset transaction, sign with the private key bound by the target asset management component to generate the transaction to be signed and uploaded to the blockchain, and call the asset transfer component corresponding to the initial asset management component to upload the transaction to be signed and uploaded to the blockchain node. It can be understood that the transaction to be signed and uploaded to the blockchain carries a digital signature, which can prevent the transaction to be signed and uploaded to the blockchain from being tampered with during the transmission process and ensure the integrity of the asset transaction in the transaction to be signed and uploaded to the blockchain.
[0140] After receiving the transaction to be signed and uploaded to the blockchain, the blockchain node can obtain the public key corresponding to business object A to verify the digital signature carried in the transaction to be signed and uploaded to the blockchain. When the verification of the transaction to be signed and uploaded to the blockchain passes, it indicates that the transaction to be signed and uploaded to the blockchain has not been tampered with during the transmission process. Assume that the asset transaction in the transaction to be signed and uploaded to the blockchain is a transfer transaction. After the verification passes, the transaction settlement contract deployed in the blockchain can be called. The transaction settlement contract transfers the asset transaction value included in the asset transaction in the transaction to be signed and uploaded to the blockchain from the account address corresponding to the asset transfer object included in the asset transaction in the transaction to be signed and uploaded to the blockchain to the account address corresponding to the asset transfer-in object included in the asset transaction in the transaction to be signed and uploaded to the blockchain, so as to execute the asset transaction on the chain and store the transaction to be signed and uploaded to the blockchain in the blockchain. After the asset transaction is executed on the chain, the execution result of the asset transaction can be updated in the target asset management component, and the asset holdings of the asset transaction object in the asset transaction can be updated according to the asset transaction value.
[0141] In the embodiment of the present application, through the asset transaction extension component, new extension functions can be dynamically added to the initial asset management component, and then the function of the initial asset management component can be extended to meet business requirements. During the process of extending the function of the asset management component, the main code of the asset management component does not change, and the old version of the asset management component may still be used normally, thus improving the utilization rate of the asset management component. In addition, during the process of extending the function of the asset management component, since the main code of the asset management component does not change and no complex code modification is involved, the development cost of the asset management component can be significantly reduced.
[0142] Please refer to Figure 6 , Figure 6 which is a schematic flow of a data processing method based on blockchain provided by the embodiment of the present application. Figure 2 It can be understood that this data processing method based on blockchain can be executed by a business node. The business node can be installed with an initial asset management component, and the business node can be Figure 1 business node 10a in the network architecture shown in Figure 6 . As shown in
[0143] Step S201: Receive a function extension request corresponding to the initial asset management component, and determine an asset transaction extension component that matches the function extension request in the function extension library.
[0144] Step S202: Extend the function of the initial asset management component according to the asset transaction extension component to obtain a target asset management component.
[0145] Among them, the specific implementation processes of step S201 and step S202 can refer to Figure 3 the descriptions of step S101 and step S102 shown, which will not be elaborated here.
[0146] Step S203: If an asset transaction request is received, obtain the asset transaction object and the asset transaction value included in the asset transaction corresponding to the asset transaction request.
[0147] Step S204: Call the transaction white list component to obtain the asset transaction white list, and call the transaction value constraint component to obtain the transaction value constraint conditions.
[0148] Please refer to Figure 7 , Figure 7 which is a schematic diagram of verifying an asset transaction based on an asset transaction extension component provided by an embodiment of the present application. As Figure 7 shown, the asset transaction extension component in the target asset management component 50a may include a transaction white list component 50b and a transaction value constraint component 50c. When the business object A has an asset transaction requirement, an asset transaction request can be triggered in the target asset management component 50a. For example, the business object A can perform a triggering operation on the asset transfer component or the asset storage component in the target asset management component 50a, and the target asset management component 50a generates an asset transaction request for the business object A.
[0149] In the embodiment of the present application, the asset transaction corresponding to the asset transaction request can be generated in the target asset management component 50a. For example, the target asset management component 50a can encapsulate the transaction data (such as input transaction information, operation timestamp, transaction status, etc.) generated when the business object A performs an asset transaction operation in the target asset management component 50a into an asset transaction. Or, the transaction data generated when the business object A performs an asset transaction operation in the target asset management component 50a can also be sent to any transaction encapsulation node, and the transaction encapsulation node encapsulates the transaction data generated when the business object A performs an asset transaction operation in the target asset management component 50a into an asset transaction, and then the transaction encapsulation node returns the asset transaction to the target asset management component 50a.
[0150] As Figure 7As shown in the figure, the asset trading object (e.g., the asset transfer object or the asset transfer-in object) and the asset trading value included in the asset transaction corresponding to the asset trading request can be obtained. The transaction white list component 50b is called to obtain the asset trading white list 50d, and the transaction value constraint component 50c is called to obtain the transaction value constraint condition 50e. Among them, the asset trading object in the asset trading white list 50d may refer to the asset trading object trusted by the target asset management component 50a. For example, the asset trading object 1, the asset trading object 2, the asset trading object 3, and the asset trading object 4. The transaction value constraint condition 50e refers to the restriction conditions set for the asset trading value in the asset transaction when conducting the asset transaction. For example, the transaction value constraint condition 50e may include that the single-asset transaction value is less than 1000, and the total asset transaction value on the same day is less than 10000, etc.
[0151] Step S205: If the asset trading object belongs to the asset trading white list and the asset trading value meets the transaction value constraint condition, it is determined that the transaction verification result corresponding to the asset transaction indicates verification passed.
[0152] As Figure 7 shown in the figure, the asset trading object in the asset transaction can be compared with the asset trading white list 50d, and the asset trading value in the asset transaction can be compared with the transaction value constraint condition 50e. When the asset trading object belongs to the asset trading white list 50d and the asset trading value meets the transaction value constraint condition 50e, it is determined that the transaction verification result corresponding to the asset transaction indicates verification passed; when the asset trading object does not belong to the asset trading white list 50d, or the asset trading value does not meet the transaction value constraint condition 50e, it is determined that the transaction verification result corresponding to the asset transaction indicates verification failed.
[0153] Optionally, the implementation process of determining whether the asset transaction value meets the transaction value constraint condition may include: calling a transaction value constraint component to obtain a per-transaction threshold and a transaction statistics threshold. Among them, the per-transaction threshold may refer to the maximum allowable asset transaction value for a single asset transaction; the transaction statistics threshold may refer to the maximum allowable cumulative asset transaction value within a statistical period (for example, 24 hours, or 48 hours, etc.). The specific values of the per-transaction threshold and the transaction statistics threshold can be determined according to the actual situation, and the embodiments of the present application do not limit this. Furthermore, the total historical transaction value of the asset transaction object within the historical transaction period is counted. The total historical transaction value within the historical transaction period refers to: excluding the current asset transaction, the cumulative asset transaction value in the historical asset transactions generated within the statistical period. If the asset transaction value is less than or equal to the per-transaction threshold, and the sum of the asset transaction value and the total historical transaction value is less than or equal to the transaction statistics threshold, it is determined that the asset transaction value meets the transaction value constraint condition; if the asset transaction value is greater than the per-transaction threshold, or the sum of the asset transaction value and the total historical transaction value is greater than the transaction statistics threshold, it is determined that the asset transaction value does not meet the transaction value constraint condition.
[0154] Step S206: If the transaction verification result indicates that the asset transaction verification is passed, determine multiple transaction signature objects corresponding to the asset transaction.
[0155] In the embodiments of the present application, the target asset management component may be an asset management component that requires multiple transaction signature objects to complete the signature before an asset transaction can be carried out. When the transaction verification result corresponding to the asset transaction indicates that the asset transaction verification is passed, the target asset management component may determine multiple transaction signature objects for the asset transaction. The transaction signature object may be manually set by Business Object A in the target asset management component, or may also be automatically selected by the target asset management component. The embodiments of the present application do not limit this.
[0156] Step S207: Send a transaction signature request corresponding to the asset transaction to each transaction signature object, so that each transaction signature object signs the asset transaction according to the private key bound in the target asset management component to generate an initial signed transaction.
[0157] Please refer to Figure 8 , Figure 8 which is a schematic diagram of multi-signature for asset transactions provided by the embodiments of the present application. As Figure 8As shown, the target asset management component 60a refers to the target asset management component used by business object A. After business object A determines that the transaction content in asset transaction 60b is correct, it can perform a trigger operation on the "Send Signature Request" control 60c in the target asset management component 60a. In response to the trigger operation of business object A on the "Send Signature Request" control 60c, the target asset management component 60a displays a signature object confirmation page 61a. The signature object confirmation page 61a may include the minimum confirmation signature number and a transaction signature object list 61b. Among them, the minimum confirmation signature number can indicate how many signatures the signature transaction corresponds to before the asset transaction can be executed. The transaction signature object list 61b may include multiple transaction signature objects that can sign the asset transaction. For example, transaction signature object 1, transaction signature object 2, and transaction signature object 3. Business object A can perform a trigger operation on the "Edit" control corresponding to the minimum confirmation signature number and modify the quantity of the minimum confirmation signature number through the "Edit" control; it can remove the corresponding transaction signature object from the transaction signature object list 61b through the "Remove" control; it can also add a transaction signature object to the transaction signature object list 61b through the "Add Signature Object" control.
[0158] After business object A determines that the information of the minimum confirmation signature number and the transaction signature objects included in the transaction signature object list 61b is correct, it can perform a trigger operation on the "Confirm" control 61c in the object confirmation page 61a. The target asset management component 60a sends a transaction signature request corresponding to the asset transaction 60b to each transaction signature object. Among them, each transaction signature object sends one transaction signature request. Each transaction signature object can log in to the target asset management component to receive the transaction signature request, verify the asset transaction corresponding to the transaction signature request. After confirming that the transaction information in the asset transaction is correct, each transaction signature object signs the asset transaction according to the private key bound in its own target asset management component, generating an initial signed transaction.
[0159] As Figure 8 shown, the signature progress prompt page 62a in the target asset management component 60a can display the signature progress corresponding to each transaction signature object. For example, the prompt message "Waiting for transaction signature object signature 1 / 2" in the signature progress prompt page 62a can indicate that the current signature progress is an unfinished progress, the current number of collected signatures is 1, and one more transaction signature object is needed to sign the asset transaction to end the signature process. Optionally, the signature progress prompt page 62a may also include a "Signature Progress Query" control 62b. Business object A can perform a trigger operation on the "Signature Progress Query" control 62b to view detailed signature information. For example, it can query which transaction signature objects have completed signing, which transaction signature objects have not completed signing, and which transaction signature objects have refused to sign.
[0160] Step S208: Obtain the initial signature transaction, count the number of signatures corresponding to the initial signature transaction. If the number of signatures is greater than or equal to the quantity threshold, then determine the initial signature transaction as the signature transaction to be uploaded to the blockchain.
[0161] The target asset management component 60a can obtain the initial signature transaction and count the number of signatures included in the initial signature transaction. When the number of signatures included in the initial signature transaction is greater than or equal to the quantity threshold (i.e., the minimum signature confirmation number), then the initial signature transaction can be determined as the signature transaction to be uploaded to the blockchain, upload the signature transaction to be uploaded to the blockchain node, and display a signature completion prompt page 63a on the target asset management component 60a to prompt the business object A that the signature is completed. If the time threshold is exceeded and the number of signatures included in the initial signature transaction is still less than the quantity threshold, then the asset transaction 60b can be cleared on the target asset management component 60a to save the data storage space of the target asset management component 60a.
[0162] Step S209: Send the signature transaction to be uploaded to the blockchain node so that the blockchain node processes the signature transaction to be uploaded.
[0163] Among them, the specific implementation process of step S209 can refer to Figure 3 the description of step S1052 shown, and will not be elaborated here.
[0164] Step S210: If a block voting request sent by the blockchain node is received, then call the block voting component to obtain the set of voting objects.
[0165] Step S211: Send a block voting request to each voting object in the set of voting objects so that each voting object verifies the transaction block according to the block voting request to obtain the block voting information corresponding to each voting object.
[0166] The asset transaction extension component in the target asset management component can also assist in the community governance of the blockchain. For example, activities such as block proposal and block voting proposal can be carried out through the asset transaction extension component. For the convenience of description, this embodiment of the present application takes the asset transaction extension component including a block voting component as an example.
[0167] In an embodiment of the present application, a blockchain node may send a block voting request to a target asset management component, and the block voting request is used to instruct the target asset management component to verify a transaction block corresponding to the block voting request. The transaction block corresponding to the block voting request may include the signature transaction to be chained mentioned above, and may also include other asset transactions. When the target asset management component receives the block voting request, it may call a block voting component to obtain a set of voting objects. The set of voting objects includes multiple voting objects, and each voting object in the set of voting objects may verify the transaction block. Each voting object in the set of voting objects may be a trusted object manually selected by business object A, or a trusted object selected by the target asset management component according to the object authentication information of each object.
[0168] After determining the set of voting objects, a block voting request may be sent to each voting object in the set of voting objects, and the block voting request is used to instruct each voting object to verify a transaction block corresponding to the block voting request. After each voting object receives the block voting request, it may verify each transaction data included in the transaction block, verify the block generation node that generates the transaction block, etc., and then generate block voting information according to the verification result corresponding to the transaction block, and return the block voting information to the target asset management component. The block voting information may be used to indicate the verification result of the voting object corresponding to the block voting information for the transaction block, and the verification result may be a verification passed result or a verification failed result. Among them, each voting object in the set of voting objects needs to return a block voting information to the target asset management component.
[0169] Step S212: Obtain the block voting information corresponding to each voting object, determine the block voting result of the target asset management component for the transaction block according to the block voting information corresponding to each voting object, and return the block voting result to the blockchain node.
[0170] The target asset management component can obtain the block voting information corresponding to each voting object. From the block voting information corresponding to each voting object, it can count the number of votes indicating that the transaction block verification is passed, that is, the number of voting objects in the voting object set whose verification result for the transaction block is passed. If the number of votes is less than the vote number threshold (the vote number threshold here can be determined according to the actual situation. For example, the vote number threshold can be set to 2 / 3 of the number of voting objects included in the voting object set), then it is determined that the block voting result of the target asset management component for the transaction block is a negative voting result; if the number of votes is greater than the vote number threshold, it is determined that the block voting result of the target asset management component for the transaction block is a positive voting result. After obtaining the block voting result corresponding to the transaction block, the target asset management component can return the block voting result to the blockchain node. After receiving the block voting result, the blockchain node can broadcast the block voting result in the blockchain network so that the blockchain nodes included in the blockchain network can perform consensus processing on the transaction block. After the consensus is passed, the transaction block can be stored in the blockchain.
[0171] In the embodiment of the present application, through the asset transaction extension component, new extended functions can be dynamically added to the initial asset management component, and thus the function expansion of the initial asset management component can be realized to meet the business requirements. During the process of function expansion of the asset management component, the main code of the asset management component does not change, and the old version of the asset management component may still be used normally, thereby improving the utilization rate of the asset management component. In addition, during the process of function expansion of the asset management component, since the main code of the asset management component does not change and no complex code modification is involved, the development cost of the asset management component can be significantly reduced.
[0172] It can be understood that in the specific implementation manner of the present application, it may involve relevant information of users (such as users' asset information, users' private key information, etc.). When the above embodiments of the present application are applied to specific products or technologies, the permission or consent of the users needs to be obtained, and the collection, use, and processing of relevant data need to comply with the relevant laws, regulations, and standards of the relevant regions.
[0173] Please refer to Figure 9 , Figure 9 which is a schematic structural diagram of a blockchain-based data processing device provided by an embodiment of the present application; it can be understood that the blockchain-based data processing device 1 can be applied in Figure 1 the business nodes shown in the figure. The business nodes may be installed with an initial asset management component. As Figure 9As shown in the figure, the blockchain-based data processing device may include an extended component matching module 11, a function extension module 12, a validity verification module 13, an asset transaction signature module 14, and a signed transaction upload module 15, where:
[0174] The extended component matching module 11 is configured to receive a function extension request corresponding to an initial asset management component, and determine an asset transaction extension component matching the function extension request in a function extension library;
[0175] The function extension module 12 is configured to perform function extension on the initial asset management component according to the asset transaction extension component to obtain a target asset management component;
[0176] The validity verification module 13 is configured to, if receiving an asset transaction request, perform validity verification on the asset transaction corresponding to the asset transaction request according to the asset transaction extension component in the target asset management component to obtain a transaction verification result;
[0177] The asset transaction signature module 14 is configured to, if the transaction verification result indicates that the asset transaction verification is passed, sign the asset transaction with the private key bound to the target asset management component to obtain a signed transaction to be uploaded to the blockchain;
[0178] The signed transaction upload module 15 is configured to send the signed transaction to be uploaded to the blockchain node, so that the blockchain node processes the signed transaction to be uploaded to the blockchain.
[0179] In a possible implementation manner, the extended component matching module 11 determines an asset transaction extension component matching the function extension request in the function extension library, including:
[0180] Display an extended component selection page in the initial asset management component; the extended component selection page includes one or more function extension components in the function extension library;
[0181] In response to an extended component selection operation on the extended component selection page, determine the function extension component triggered by the extended component selection operation as the asset transaction extension component matching the function extension request.
[0182] In a possible implementation manner, the extended component matching module 11 determines an asset transaction extension component matching the function extension request in the function extension library, including:
[0183] Display an extended requirement input page in the initial asset management component;
[0184] In response to an input operation on the extended requirement input page, determine the input information on the extended requirement input page as the extended requirement information corresponding to the function extension request;
[0185] Obtain the function label information corresponding to the function extension components included in the function extension library, and determine the function extension components whose function label information matches the extension requirement information as the asset transaction extension components.
[0186] In a possible implementation manner, the function extension module 12 performs function extension on the initial asset management component according to the asset transaction extension component to obtain a target asset management component, including:
[0187] Through the second function extension function in the asset transaction extension component, call the asset management function in the initial asset management component that has the same function name as the second function extension function in the asset transaction extension component;
[0188] Execute the implementation logic of the asset management function and the implementation logic of the second function extension function in the asset transaction extension component to obtain the target asset management component.
[0189] In a possible implementation manner, the asset transaction extension component in the target asset management component includes multiple function extension components; the function extension module 12 executes the implementation logic of the asset management function and the second function extension function to obtain the target asset management component, including:
[0190] Determine the execution order of the second function extension functions in each function extension component according to the asset transaction extension functions of each function extension component in the target asset management component;
[0191] According to the execution order of the second function extension functions in each function extension component, execute the implementation logic of the asset management function and the second function extension functions in each function extension function to obtain the target asset management component.
[0192] In a possible implementation manner, the asset transaction extension component in the target asset management component includes multiple function extension components; if the validity verification module 13 receives an asset transaction request, it performs validity verification on the asset transaction corresponding to the asset transaction request according to the asset transaction extension component in the target asset management component to obtain a transaction verification result, including:
[0193] Determine the verification priority of each function extension component for the asset transaction corresponding to the asset transaction request according to the execution order of each function extension component in the target asset management component;
[0194] Call each function extension component to perform validity verification on the asset transaction according to the verification priority;
[0195] If there is a function extension component among each function extension component whose verification result for the asset transaction indicates that the verification fails, end the verification of the asset transaction, and determine that the transaction verification result corresponding to the asset transaction indicates that the verification fails;
[0196] If the verification results of each functional extension component for the asset transaction all indicate verification passed, then determine that the transaction verification result corresponding to the asset transaction indicates verification passed.
[0197] In a possible implementation, the asset transaction extension component in the target asset management component includes a transaction whitelist component and a transaction value constraint component; if the validity verification module 13 receives an asset transaction request, it performs validity verification on the asset transaction corresponding to the asset transaction request according to the asset transaction extension component in the target asset management component, and obtains a transaction verification result, including:
[0198] If an asset transaction request is received, obtain the asset transaction object and the asset transaction value included in the asset transaction corresponding to the asset transaction request;
[0199] Call the transaction whitelist component to obtain the asset transaction whitelist, and call the transaction value constraint component to obtain the transaction value constraint conditions;
[0200] If the asset transaction object belongs to the asset transaction whitelist and the asset transaction value meets the transaction value constraint conditions, then determine that the transaction verification result corresponding to the asset transaction indicates verification passed.
[0201] In a possible implementation, the data processing device 1 based on the blockchain may further include: a transaction value statistics module 16 and a constraint condition judgment module 17, where:
[0202] The transaction value statistics module 16 is used to call the transaction value constraint component to obtain the unit transaction threshold and the transaction statistics threshold, and statistically calculate the total historical transaction value of the asset transaction object within the historical transaction period;
[0203] The constraint condition judgment module 17 is used to determine that the asset transaction value meets the transaction value constraint conditions if the asset transaction value is less than or equal to the unit transaction threshold and the sum of the asset transaction value and the total historical transaction value is less than or equal to the transaction statistics threshold.
[0204] In a possible implementation, if the transaction verification result indicates that the asset transaction verification is passed, the asset transaction signature module 14 signs the asset transaction with the private key bound by the target asset management component to obtain a transaction signature to be uploaded to the chain, including:
[0205] If the transaction verification result indicates that the asset transaction verification is passed, determine multiple transaction signature objects corresponding to the asset transaction;
[0206] Send a transaction signature request corresponding to the asset transaction to each transaction signature object, so that each transaction signature object signs the asset transaction with the private key bound in the target asset management component to generate an initial signature transaction;
[0207] Obtain an initial signature transaction, count the number of signatures corresponding to the initial signature transaction. If the number of signatures is greater than or equal to the quantity threshold, determine the initial signature transaction as a signature transaction to be chained.
[0208] In a possible implementation, the asset transaction extension component in the target asset management component includes a block voting component; the data processing device 1 based on the blockchain may further include: a voting object acquisition module 18, a transaction block verification module 19, and a voting result sending module 20, where:
[0209] The voting object acquisition module 18 is configured to, if receiving a block voting request sent by a blockchain node, call the block voting component to obtain a set of voting objects; the transaction block corresponding to the block voting request includes a signature transaction to be chained.
[0210] The transaction block verification module 19 is configured to send a block voting request to each voting object in the set of voting objects, so that each voting object verifies the transaction block according to the block voting request to obtain block voting information corresponding to each voting object; one voting object corresponds to one block voting information.
[0211] The voting result sending module 20 is configured to obtain the block voting information corresponding to each voting object, determine the block voting result of the target asset management component for the transaction block according to the block voting information corresponding to each voting object, and return the block voting result to the blockchain node.
[0212] In a possible implementation, the data processing device 1 based on the blockchain may further include: an extended function creation module 21, a function adjustment module 22, and an extended component addition module 23, where:
[0213] The extended function creation module 21 is configured to create an asset management extended class for inheriting the asset management interface, and create a first function extension function in the asset management extended class; the first function extension function has the same function name as the asset management function in the initial asset management component.
[0214] The function adjustment module 22 is configured to obtain function adjustment parameters corresponding to the initial asset management component, and generate the implementation logic of the first function extension function according to the function adjustment parameters and the asset management interface.
[0215] The extended component addition module 23 determines the asset management extended class including the implementation logic of the first function extension function as a newly added extended component, and adds the newly added extended component to the function extension library.
[0216] In a possible implementation, the asset transaction extension component in the target asset management component includes multiple function extension components; the data processing device 1 based on the blockchain may further include: an extended function removal module 24, where:
[0217] An extended function removal module 24 is configured to receive a function removal request corresponding to a target asset management component, determine a component to be removed from multiple function extension components included in an asset transaction extension component according to the function removal request, and remove the component to be removed from the target asset management component.
[0218] In the embodiments of the present application, the term "module" or "unit" refers to a computer program with a predetermined function or a part of a computer program, which works together with other related parts to achieve a predetermined goal, and can be fully or partially implemented by using software, hardware (such as a processing circuit or a memory), or a combination thereof. Similarly, one processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be a part of an overall module or unit that includes the function of the module or unit.
[0219] According to an embodiment of the present application, the foregoing Figure 3 and Figure 6 The steps involved in the data processing method based on a blockchain shown can be executed by Figure 9 each module in the data processing device 1 based on a blockchain shown. For example, Figure 3 the step S101 shown can be executed by Figure 9 the extended component matching module 11 shown, Figure 3 the step S102 shown can be executed by Figure 9 the function extension module 12 shown, Figure 3 the step S103 shown can be executed by Figure 3 the validity verification module 13 shown, Figure 3 the step S104 shown can be executed by Figure 9 the asset transaction signature module 14 shown, Figure 3 the step S105 shown can be executed by Figure 9 the signature transaction upload module 15 shown, and so on.
[0220] According to an embodiment of the present application, Figure 9Each module in the blockchain-based data processing device 1 shown can be separately or entirely combined into one or several units to form, or a certain one (or some) of the units can be further split into at least two smaller sub-units in terms of function, which can achieve the same operations without affecting the realization of the technical effects of the embodiments of this application. The above modules are divided based on logical functions. In practical applications, the function of one module can also be realized by at least two units, or the functions of at least two modules can be realized by one unit. In other embodiments of this application, the blockchain-based data processing device 1 can also include other units. In practical applications, these functions can also be assisted by other units and can be realized by the cooperation of at least two units.
[0221] In the embodiments of this application, through the asset trading extension component, new extension functions can be dynamically added to the initial asset management component, and thus the function extension of the initial asset management component can be realized to meet business requirements. During the process of function extension of the asset management component, the main code of the asset management component does not change, and the old version of the asset management component may still be used normally, thereby improving the utilization rate of the asset management component. In addition, during the process of function extension of the asset management component, since the main code of the asset management component does not change and there is no need for complex code modification, the development cost of the asset management component can be significantly reduced.
[0222] Please refer to Figure 10 , Figure 10 is a schematic structural diagram of a computer device provided by the embodiments of this application. The computer device 1000 can be a service node, specifically a terminal device or a server. The embodiments of this application take the computer device 1000 being a terminal device as an example for illustration. As Figure 10 shown, the computer device 1000 can include: a processor 1001, a network interface 1004, and a memory 1005. In addition, the computer device 1000 can also include: a user interface 1003, and at least one communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. Among them, the user interface 1003 can include a display screen (Display), a keyboard (Keyboard). Optionally, the user interface 1003 can also include a standard wired interface and a wireless interface. The network interface 1004 can optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 can be a high-speed RAM memory or a non-volatile memory, such as at least one disk memory. Optionally, the memory 1005 can also be at least one storage device located far from the aforementioned processor 1001. As Figure 10As shown in the figure, the memory 1005, which is a computer-readable storage medium, may include an operating system, a network communication module, a user interface module, and a device control application program.
[0223] Among them, in Figure 10 the computer device 1000 shown in the figure, the network interface 1004 can provide network communication functions; the user interface 1003 is mainly used to provide an interface for users to input; and the processor 1001 can be used to call the device control application program stored in the memory 1005 to implement:
[0224] Receiving a function extension request corresponding to the initial asset management component, and determining an asset transaction extension component that matches the function extension request in the function extension library;
[0225] Functionally extending the initial asset management component according to the asset transaction extension component to obtain a target asset management component;
[0226] If an asset transaction request is received, then according to the asset transaction extension component in the target asset management component, perform validity verification on the asset transaction corresponding to the asset transaction request to obtain a transaction verification result;
[0227] If the transaction verification result indicates that the asset transaction verification passes, then sign the asset transaction with the private key bound to the target asset management component to obtain a transaction signature to be uploaded to the blockchain;
[0228] Send the transaction signature to be uploaded to the blockchain node so that the blockchain node processes the transaction signature to be uploaded to the blockchain.
[0229] It should be understood that the computer device 1000 described in the embodiments of the present application can execute the descriptions of the data processing method based on the blockchain in the corresponding embodiments mentioned above Figure 3 and Figure 6 and can also execute the descriptions of the data processing device 1 based on the blockchain in the corresponding embodiments mentioned above Figure 9 which will not be elaborated here. In addition, the beneficial effects of the same method will not be elaborated either.
[0230] In addition, it should be pointed out here that: the embodiments of the present application also provide a computer-readable storage medium, and the computer-readable storage medium stores a computer program executed by the data processing device 1 based on the blockchain mentioned above, and the computer program includes program instructions. When the processor executes the program instructions, it can execute the above Figure 3 and Figure 6The description of the blockchain-based data processing method in any corresponding embodiment will not be repeated here. In addition, the beneficial effects of adopting the same method will not be described again. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM), etc. For the technical details not disclosed in the embodiments of the computer-readable storage medium involved in this application, please refer to the description of the method embodiments of this application. As an example, the program instructions may be deployed to be executed on a computer device, or on multiple computer devices located at one place, or on multiple computer devices distributed at multiple places and interconnected through a communication network. The multiple computer devices distributed at multiple places and interconnected through a communication network may form a blockchain system.
[0231] In addition, it should be noted that: The embodiments of the present application also provide a computer program product or a computer program. The computer program product or the computer program may include computer instructions, and the computer instructions may be stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor may execute the computer instructions, so that the computer device executes the Figure 3 and Figure 6 description of the blockchain-based data processing method in any corresponding embodiment. Therefore, it will not be repeated here. In addition, the beneficial effects of adopting the same method will not be described again. For the technical details not disclosed in the embodiments of the computer program product or the computer program involved in this application, please refer to the description of the method embodiments of this application.
[0232] It should be noted that for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that this application is not limited by the described action sequence, because according to this application, some steps may be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0233] The steps in the method embodiments of the present application can be adjusted, combined, and deleted according to actual needs.
[0234] The modules in the device embodiments of the present application can be combined, divided, and deleted according to actual needs.
[0235] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above various methods. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM), etc.
[0236] The above-disclosed are only the preferred embodiments of the present application. Of course, the scope of rights of the present application cannot be limited thereby. Therefore, equivalent changes made according to the claims of the present application still fall within the scope covered by the present application.
Claims
1. A data processing method based on blockchain, characterized in that: include: Receive a function extension request corresponding to the initial asset management component, and determine an asset transaction extension component matching the function extension request in a function extension library; Expanding the functionality of the initial asset management component according to the asset transaction extension component to obtain a target asset management component; If an asset transaction request is received, the validity of the asset transaction corresponding to the asset transaction request is verified according to the asset transaction extension component in the target asset management component to obtain a transaction verification result; If the transaction verification result indicates that the asset transaction verification is passed, the asset transaction is signed by the private key bound to the target asset management component to obtain the signed transaction to be uploaded to the chain; The signed transaction to be uploaded to the blockchain node is sent to the blockchain node so that the blockchain node processes the signed transaction to be uploaded to the blockchain node.
2. The method according to claim 1, characterized in that The method further comprises: Creating an asset management extension class for inheriting an asset management interface, and creating a first functional extension function in the asset management extension class; the first functional extension function has the same function name as the asset management function in the initial asset management component; Acquire function adjustment parameters corresponding to the initial asset management component, and generate implementation logic of the first function extension function according to the function adjustment parameters and the asset management interface; The asset management extension class including the implementation logic of the first functional extension function is determined as a newly added extension component, and the newly added extension component is added to the functional extension library.
3. The method according to claim 1, characterized in that The determining of the asset transaction extension component matching the function extension request in the function extension library includes: Displaying an extension component selection page in the initial asset management component; the extension component selection page includes one or more function extension components in the function extension library; In response to an extension component selection operation in the extension component selection page, the function extension component triggered by the extension component selection operation is determined as an asset transaction extension component that matches the function extension request.
4. The method according to claim 1, characterized in that: The determining of the asset transaction extension component matching the function extension request in the function extension library includes: Displaying an extended requirement input page in the initial asset management component; In response to an input operation in the extension requirement input page, the input information in the extension requirement input page is used to determine the extension requirement information corresponding to the function extension request; The function label information corresponding to the function extension component contained in the function extension library is obtained, and the function extension component whose function label information matches the extension requirement information is determined as the asset transaction extension component.
5. The method according to claim 1, characterized in that The function expansion of the initial asset management component according to the asset transaction extension component to obtain a target asset management component includes: Calling, through the second functional extension function in the asset transaction extension component, an asset management function in the initial asset management component having the same function name as the second functional extension function in the asset transaction extension component; The implementation logic of the asset management function and the implementation logic of the second functional extension function in the asset transaction extension component are executed to obtain a target asset management component.
6. The method according to claim 5, characterized in that The asset transaction extension component in the target asset management component includes multiple function extension components; The executing the implementation logic of the asset management function and the second functional extension function to obtain a target asset management component includes: Determining the execution order of the second functional extension functions in each functional extension component according to the asset transaction extended function of each functional extension component in the target asset management component; According to the execution order of the second function extension function in each function extension component, the asset management function and the implementation logic of the second function extension function in each function extension function are executed to obtain the target asset management component.
7. The method according to claim 1, characterized in that The asset transaction extension component in the target asset management component includes multiple function extension components; If an asset transaction request is received, the validity of the asset transaction corresponding to the asset transaction request is verified according to the asset transaction extension component in the target asset management component to obtain a transaction verification result, including: Determining, according to the execution order of each function extension component in the target asset management component, a verification priority of each function extension component for the asset transaction corresponding to the asset transaction request; According to the verification priority, calling each functional extension component to verify the validity of the asset transaction; If the verification result of the asset transaction of the function extension component among the function extension components indicates that the verification fails, then the verification of the asset transaction is terminated, and it is determined that the transaction verification result corresponding to the asset transaction indicates that the verification fails; If the verification results of the asset transaction by each functional extension component indicate that the verification is passed, it is determined that the transaction verification result corresponding to the asset transaction indicates that the verification is passed.
8. The method according to claim 1, characterized in that The asset transaction extension component in the target asset management component includes a transaction whitelist component and a transaction value constraint component; If an asset transaction request is received, the validity of the asset transaction corresponding to the asset transaction request is verified according to the asset transaction extension component in the target asset management component to obtain a transaction verification result, including: If an asset transaction request is received, then obtaining the asset transaction object and the asset transaction value contained in the asset transaction corresponding to the asset transaction request; Calling the transaction whitelist component to obtain an asset transaction whitelist, and calling the transaction value constraint component to obtain a transaction value constraint condition; If the asset transaction object belongs to the asset transaction whitelist and the asset transaction value satisfies the transaction value constraint condition, it is determined that the transaction verification result corresponding to the asset transaction indicates that the verification is passed.
9. The method according to claim 8, characterized in that The method further comprises: Calling the transaction value constraint component to obtain a unit transaction threshold and a transaction statistics threshold, and counting the total historical transaction value of the asset transaction object in a historical transaction cycle; If the asset transaction value is less than or equal to the unit transaction threshold, and the sum of the asset transaction value and the total historical transaction value is less than or equal to the transaction statistics threshold, it is determined that the asset transaction value satisfies the transaction value constraint condition.
10. The method according to claim 1, characterized in that If the transaction verification result indicates that the asset transaction verification is passed, the asset transaction is signed by the private key bound to the target asset management component to obtain the signed transaction to be uploaded to the chain, including: If the transaction verification result indicates that the asset transaction verification is passed, determining a plurality of transaction signature objects corresponding to the asset transaction; Sending a transaction signature request corresponding to the asset transaction to each transaction signature object, so that each transaction signature object signs the asset transaction according to the private key bound in the target asset management component to generate an initial signature transaction; The initial signature transaction is obtained, and the number of signatures corresponding to the initial signature transaction is counted. If the number of signatures is greater than or equal to a quantity threshold, the initial signature transaction is determined as the signature transaction to be uploaded to the chain.
11. The method according to claim 1, characterized in that: The asset transaction extension component in the target asset management component includes a block voting component; The method further comprises: If a block voting request sent by the blockchain node is received, the block voting component is called to obtain a set of voting objects; the transaction block corresponding to the block voting request includes the signature transaction to be uploaded to the chain; Sending the block voting request to each voting object in the voting object set, so that each voting object verifies the transaction block according to the block voting request, and obtains the block voting information corresponding to each voting object; one voting object corresponds to one block voting information; Obtain the block voting information corresponding to each voting object, determine the block voting result of the target asset management component on the transaction block according to the block voting information corresponding to each voting object, and return the block voting result to the blockchain node.
12. The method according to claim 1, characterized in that The asset transaction extension component in the target asset management component includes multiple function extension components; The method further comprises: A function removal request corresponding to the target asset management component is received, and according to the function removal request, a component to be removed is determined from a plurality of function extension components included in the asset transaction extension component, and the component to be removed is removed from the target asset management component.
13. A data processing device based on blockchain, characterized in that: include: An extension component matching module, used to receive a function extension request corresponding to the initial asset management component, and determine an asset transaction extension component matching the function extension request in the function extension library; A function extension module, used to extend the function of the initial asset management component according to the asset transaction extension component to obtain a target asset management component; A validity verification module, for, upon receiving an asset transaction request, performing validity verification on the asset transaction corresponding to the asset transaction request according to the asset transaction extension component in the target asset management component to obtain a transaction verification result; An asset transaction signature module, used to sign the asset transaction by using the private key bound to the target asset management component to obtain a signed transaction to be uploaded to the chain if the transaction verification result indicates that the asset transaction verification has passed; The signature transaction uploading module is used to send the signature transaction to be uploaded to the blockchain node so that the blockchain node can process the signature transaction to be uploaded to the blockchain.
14. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the method according to any one of claims 1 to 12.
15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the steps of the method according to any one of claims 1 to 12 are executed.
16. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 12 when being executed by a processor.