Blockchain-based equity voucher transaction method, device and equipment and readable medium
By introducing external inventory information into blockchain transactions and using smart contracts to verify inventory quantities, the problems of data errors and low efficiency in equity certificate transactions are solved, and a safe and stable transaction process is achieved.
Patent Information
- Application Number
- CN202211298765.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-20
- Publication Date
- 2026-08-25
- Estimated Expiration
- 2042-10-20
AI Technical Summary
In existing technologies, equity certificate transactions rely on off-chain services for inventory management, which leads to data errors and reduced security, as well as reduced blockchain transaction efficiency.
By introducing off-chain inventory information into the blockchain transaction on-chain process, and using smart contracts to verify the inventory quantity of the vouchers to be traded, a separate sales check process is avoided, ensuring data security and stability, and improving transaction efficiency.
It enables direct verification of inventory quantities during blockchain transactions, avoiding data errors and attacks, improving transaction security and efficiency, and reducing implementation costs and modifications.
Smart Images

Figure CN117952747B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a blockchain-based method, apparatus, device, and readable medium for trading equity certificates. Background Technology
[0002] With the development of blockchain technology, equity certificates, represented by digital collectibles, are being applied in related fields. Digital collectibles, as irreplaceable and unique equity certificates, have found practical applications in the trading of digital products and the management of electronic certificates.
[0003] Currently, in related technologies, when conducting equity certificate transactions, it is usually necessary to first confirm with the issuer or administrator through off-chain services that there is sufficient inventory of equity certificates, and then access the blockchain to carry out the corresponding certificate transaction process.
[0004] However, managing inventory through off-chain services makes the transaction process dependent on offline services. Centralized offline inventory management is prone to data errors or attacks, which can lead to data errors in the blockchain, reduce the security of blockchain data, and reduce the overall transaction efficiency of the blockchain by centrally accessing off-chain services. Summary of the Invention
[0005] To address the aforementioned technical issues, this application provides a blockchain-based method, apparatus, device, and readable medium for trading equity certificates. This avoids data errors or attacks during the individual sales check process that could lead to blockchain data errors, thus improving data security and stability during the certificate trading process. Furthermore, inventory queries are performed during the on-chain process without requiring separate execution, thereby enhancing the overall efficiency of blockchain transactions.
[0006] Other features and advantages of this application will become apparent from the following detailed description, or may be learned in part from practice of this application.
[0007] According to one aspect of the embodiments of this application, a blockchain-based method for trading equity certificates is provided, comprising:
[0008] Obtain a request to put a rights certificate transaction on the blockchain, wherein the request to put a rights certificate transaction on the blockchain includes the certificate transaction information of the rights certificate to be traded;
[0009] In response to the request to put the equity certificate transaction on the blockchain, the first smart contract calls the second smart contract to send an inventory query request to the inventory data source, which is an off-chain data source of the blockchain.
[0010] The second smart contract receives the voucher inventory data sent by the inventory data source according to the inventory query request, and feeds it back to the first smart contract;
[0011] If the voucher inventory data indicates that the remaining number of vouchers meets the transaction requirements of the voucher transaction information, then the voucher transaction information will be uploaded to the blockchain.
[0012] According to one aspect of the embodiments of this application, a blockchain-based equity certificate trading device is provided, characterized in that it includes:
[0013] The on-chain request acquisition module is used to acquire on-chain requests for equity certificate transactions, wherein the on-chain requests for equity certificate transactions contain certificate transaction information of the equity certificate to be traded;
[0014] The inventory query module is used to respond to the equity certificate transaction on-chain request by calling the second smart contract through the first smart contract to send an inventory query request to the inventory data source, which is an off-chain data source of the blockchain.
[0015] The inventory feedback module is used to receive the voucher inventory data sent by the inventory data source according to the inventory query request through the second smart contract, and then feed it back to the first smart contract.
[0016] The transaction on-chain module is used to upload the voucher transaction information to the blockchain if the voucher inventory data indicates that the remaining number of vouchers meets the transaction requirements of the voucher transaction information.
[0017] In some embodiments of this application, based on the above technical solutions, the inventory data source is a node network formed by multiple inventory data nodes; the inventory feedback module includes:
[0018] The response receiving unit is configured to receive an inventory data response from the inventory data nodes in the node network via the second smart contract, wherein the inventory data response is a consensus result generated by the plurality of inventory data nodes after reaching a consensus on the voucher inventory data;
[0019] The inventory determination unit is used to determine the certificate inventory data of the equity certificate to be traded based on the inventory data response of the second smart contract.
[0020] In some embodiments of this application, based on the above technical solutions, the inventory data source includes multiple inventory data nodes; the inventory feedback module includes:
[0021] The feedback receiving unit is used to receive multiple inventory data feedbacks from the multiple inventory data nodes, wherein the inventory data feedbacks carry node inventory data and the corresponding most recent transaction time;
[0022] The data feedback unit is used to feed back the node inventory data with the most recent transaction time as voucher inventory data to the first smart contract.
[0023] In some embodiments of this application, based on the above technical solutions, the voucher transaction information includes the transaction quantity; the transaction on-chain module includes:
[0024] The data acquisition unit is used to acquire the voucher inventory data fed back by the second smart contract through the first smart contract;
[0025] The information uploading unit is used to upload the voucher transaction information to the blockchain through the first smart contract if the number of remaining vouchers in the voucher inventory data is greater than or equal to the number of transactions.
[0026] In some embodiments of this application, based on the above technical solutions, the equity certificate trading device further includes:
[0027] An update instruction sending module is used to send an inventory update instruction to the inventory data source by calling the second smart contract through the first smart contract, so that the inventory data source updates the inventory data according to the voucher transaction information.
[0028] In some embodiments of this application, based on the above technical solutions, the equity certificate trading device further includes:
[0029] The transaction monitoring module is used to monitor blockchain transactions uploaded to the blockchain.
[0030] The update instruction module is used to send an inventory update instruction to the inventory data source if the blockchain transaction on the chain contains voucher transaction information, so that the inventory data source updates the inventory data according to the voucher transaction information on the chain.
[0031] In some embodiments of this application, based on the above technical solutions, the equity certificate trading device further includes:
[0032] The initialization request receiving module is used to receive data source initialization requests from newly added data sources;
[0033] The transaction information reading module is used to read all the certificate transaction information in the blockchain according to the data source initialization request, so as to determine the number of equity certificates that have been traded;
[0034] An initialization information sending module is used to send initialization information to the new data source based on the number of traded equity certificates, so that the new data source initializes the remaining inventory data based on the number of traded equity certificates.
[0035] In some embodiments of this application, based on the above technical solutions, the on-chain request acquisition module includes:
[0036] A transaction request receiving unit is used to receive a certificate transaction request from a client, wherein the certificate transaction request includes the key custody type of the transaction account and transaction information for the equity certificate to be traded;
[0037] The transaction key acquisition unit is used to acquire the transaction key of the transaction account according to the key custody type.
[0038] The on-chain request generation unit is used to sign the transaction information using the transaction key and generate an on-chain request for equity certificate transactions.
[0039] In some embodiments of this application, based on the above technical solutions, the transaction key acquisition unit includes:
[0040] The key query subunit is used to query the transaction key of the transaction account through the credential management service if the key custody type is custody type.
[0041] The key acquisition subunit is used to obtain the transaction key of the transaction account from the credential transaction request if the key custody type is non-custodial.
[0042] In some embodiments of this application, based on the above technical solutions, the equity certificate trading device further includes:
[0043] The service notification module is used to send an on-chain result notification to the credential management service through the first smart contract if the key custody type is custody type, so that the credential management service can provide feedback on the credential transaction result to the client.
[0044] The client notification module is used to send an on-chain result notification to the client through the first smart contract if the key custody type is non-custodial, so that the client can display the certificate transaction result.
[0045] According to one aspect of the embodiments of this application, an electronic device is provided, the electronic device comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the blockchain-based equity certificate transaction method as described above by executing the executable instructions.
[0046] According to one aspect of the embodiments of this application, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the blockchain-based equity certificate transaction method as described above.
[0047] According to one aspect of the embodiments of this application, a computer program product or computer program is provided, which 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 executes the computer instructions, causing the computer device to perform the blockchain-based equity certificate transaction method provided in the various optional implementations described above.
[0048] In the embodiments of this application, inventory information from outside the blockchain is introduced through a separate smart contract during the blockchain transaction on-chain process to verify whether the outstanding vouchers have been sold out. This allows for checking the sales volume of equity vouchers during direct transactions with the blockchain with minimal impact on the transaction process, without the need for a separate sales check process outside the blockchain process. This avoids data errors or attacks during the separate sales check process that could lead to blockchain data errors, which is beneficial to the data security and stability of the voucher transaction process and reduces the amount of modification required to the existing system. Furthermore, the inventory query is performed during the on-chain process without the need for separate execution, which helps to improve the overall efficiency of blockchain transactions, reduce the implementation cost of the solution, and improve the implementation efficiency and resource utilization of the solution.
[0049] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description
[0050] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. It is obvious that the drawings described below are merely some embodiments of this application, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort. In the drawings:
[0051] Figure 1 This is an optional structural diagram of the rights certificate management system applied to a blockchain system in an embodiment of the present invention;
[0052] Figure 2 An exemplary system architecture of the technical solution of this application in an application scenario;
[0053] Figure 3 This is a schematic flowchart illustrating a blockchain-based equity certificate transaction method according to an embodiment of this application;
[0054] Figure 4 This is a schematic flowchart illustrating a blockchain-based equity certificate transaction method according to an embodiment of this application;
[0055] Figure 5This is a schematic diagram of the overall process of the equity certificate trading method in the embodiments of this application;
[0056] Figure 6 This is a schematic diagram illustrating the communication relationships in the embodiments of this application;
[0057] Figure 7 A schematic block diagram illustrating the composition of a blockchain-based equity certificate trading device in an embodiment of this application is shown.
[0058] Figure 8 A schematic diagram of the structure of a computer system suitable for implementing the electronic device of the present application is shown. Detailed Implementation
[0059] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided to make this application more comprehensive and complete, and to fully convey the concept of the exemplary embodiments to those skilled in the art.
[0060] Furthermore, the described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. Numerous specific details are provided in the following description to give a thorough understanding of embodiments of this application. However, those skilled in the art will recognize that the technical solutions of this application can be practiced without one or more of the specific details, or other methods, components, apparatuses, steps, etc., can be employed. In other instances, well-known methods, apparatuses, implementations, or operations are not shown or described in detail to avoid obscuring various aspects of this application.
[0061] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.
[0062] The flowcharts shown in the accompanying drawings are merely illustrative and do not necessarily include all content and operations / steps, nor do they necessarily have to be performed in the described order. For example, some operations / steps can be broken down, while others can be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.
[0063] It should be understood that the solution proposed in this application can be applied to the trading process of digital collectibles and other equity certificates, specifically to the process of consumers purchasing digital collectibles or virtual assets and recording the transaction on the blockchain. For digital collectibles and other equity certificates, the issuer or producer typically imposes restrictions on the total number of certificates, i.e., limited issuance. For such equity certificates, during the trading process, it is usually necessary to first confirm that there is sufficient inventory to facilitate the transaction, in order to avoid selling more than the maximum issuance and causing over-issuance of equity certificates. However, due to the decentralized and closed nature of blockchain itself, such management of the issuance quantity usually requires a corresponding service to be in place before blockchain transactions. This requires the terminal or client to verify the inventory through an inventory management service before trading with the blockchain. The solution proposed in this application implements on-chain inventory management of equity certificates based on smart contracts for transaction management. By introducing external inventory information into the blockchain during the transaction recording process to verify the inventory quantity, the client can complete inventory verification without a separate inventory management process, as it is done during the recording process. This ensures the decentralized nature of the blockchain and avoids over-issuance.
[0064] The solution presented in this application can be applied to blockchain systems, specifically to blockchain systems that implement smart contracts. A blockchain system can be a distributed system formed by clients, multiple blockchain nodes (any form of computing device connected to the network, such as servers or user terminals), and external data sources connected through network communication. See also... Figure 1 , Figure 1 This is an optional structural diagram of the equity certificate management system applied to a blockchain system in an embodiment of the present invention. The blockchain system in this embodiment includes a blockchain 110 and two smart contracts, namely an equity certificate contract and an inventory management contract. The blockchain is formed by multiple nodes (any form of computing device in the network, such as servers and user terminals) and clients 120, forming a peer-to-peer (P2P) network between the nodes. In the equity certificate management system, any machine, such as a server or terminal, can join and become a node. Nodes include a hardware layer, a middleware layer, an operating system layer, and an application layer. The blockchain also communicates with external data sources 130 to obtain external inventory data during the transaction process.
[0065] See Figure 1 The functions of each node in the blockchain shown in the diagram mainly involve:
[0066] Routing is a basic function of nodes, used to support communication between nodes.
[0067] Some nodes of Blockchain 110 will deploy equity certificate contracts. These equity certificate contracts are smart contracts, specifically computerized protocols that can execute terms for managing and trading equity certificates. They are implemented through code deployed on the blockchain that is executed when certain conditions are met, and complete the trading functions of equity certificates according to the actual trading scenario, such as the minting, selling, transferring, and destroying of equity certificates.
[0068] Some nodes of blockchain 110 will deploy an inventory management contract, which is also a smart contract. It is used to obtain inventory data of equity certificates from external data source 130 in order to verify the inventory.
[0069] In Blockchain 110, each block includes the hash value of the transactions stored in that block (the hash value of this block) and the hash value of the previous block. The blocks are linked together by their hash values to form the blockchain. Blocks can also include transaction information for recording information, such as transactions for creating new accounts or selling new equity certificates.
[0070] Please see Figure 2 , Figure 2 An exemplary system architecture of the technical solution in this application scenario. For example... Figure 2As shown, the system architecture includes a terminal device 210, a backend server 220, a rights certificate server 230, and an external data server 240. The terminal device 210 has an application installed for accessing and trading rights certificates. End users access the various servers through the terminal device 210 to complete the rights certificate trading process, including purchase and transfer. Specifically, the terminal device 210 can communicate with the backend server 220 to initiate the rights certificate purchase process. The backend server 220 communicates with the rights certificate server 230 using a transaction key hosted by the end user to conduct the subsequent rights certificate purchase process. The terminal device 210 can also directly communicate with the rights certificate server 230 to directly initiate the purchase process. The rights certificate server 230 deploys a blockchain system to perform transaction consensus in the blockchain based on transaction requests from the terminal device 210 or the backend server 220 to confirm the legality of the transaction content and generate corresponding certificate transaction information. The external data server 240 stores inventory information about rights certificates locally. During the transaction on-chain process, the staking certificate server 230 communicates with the external data server 240 to obtain inventory data, thereby checking the inventory quantity. After confirming that there is sufficient inventory to satisfy the transaction request, the staking certificate server 230 will upload the consensus-agreed transaction to the blockchain and notify the backend server 220 or the terminal device 210 of the transaction result. In some embodiments, the staking certificate server 230 will also notify the external data server 240 to update the locally stored inventory data according to the transaction result. In some embodiments, the external data server 240 will monitor newly uploaded transactions in the blockchain and update its local inventory data according to the uploaded transactions. The aforementioned server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. This document does not impose any restrictions on these aspects. The aforementioned servers can be deployed on the same physical server, and the functions of each server constitute the various functional modules of the management system. Terminal devices include, but are not limited to, mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle terminals, and aircraft. Terminal devices and servers can be directly or indirectly connected via wired or wireless communication, and this application does not impose any restrictions on this. The number of terminal devices and servers is also not limited.
[0071] The solution proposed in this application can be used in the process of managing the transaction inventory of equity certificates in the aforementioned equity certificate management server. The technical solution provided in this application will be described in detail below with reference to specific implementation methods.
[0072] In the specific implementation of this application, data such as user information and transaction data are involved. When the embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0073] For ease of explanation, please refer to Figure 3 , Figure 3 This is a schematic flowchart illustrating a blockchain-based equity certificate trading method according to an embodiment of this application. This method can be applied to the aforementioned equity certificate server. In this embodiment, the equity certificate trading device running on the server is used as the execution subject to describe the blockchain-based equity certificate trading method, which may include the following steps S310 to S340:
[0074] Step S310: Obtain the equity certificate transaction on-chain request, wherein the equity certificate transaction on-chain request contains the certificate transaction information of the equity certificate to be traded.
[0075] In this embodiment, the equity certificate trading device obtains an equity certificate transaction on-chain request from the client or the backend service used for certificate trading. The equity certificate transaction on-chain request is a request to submit certificate transaction information to the blockchain to generate a new block. This request can be triggered by a transaction of equity certificates, or generated according to a predetermined period or conditions, and is typically generated by a blockchain node. It contains certificate transaction information for the equity certificates to be traded. It is understood that the equity certificate transaction on-chain request can contain multiple certificate transaction information, each triggered by a different user's certificate purchase. Each certificate transaction information can be used to trade one or more equity certificates to be traded, and these multiple equity certificates can belong to different types of equity certificates. For example, if a user purchases two songs and a painting in one transaction, the corresponding certificate transaction information can contain three equity certificates to be traded, including song certificates and image certificates. It is understood that the backend service used for certificate trading can be the equity certificate trading device; therefore, the equity certificate transaction on-chain request can also be generated by the equity certificate trading device itself based on the client's transaction request.
[0076] Step S320: In response to the request to put the equity certificate transaction on the blockchain, the first smart contract calls the second smart contract to send an inventory query request to the inventory data source, which is an off-chain data source of the blockchain.
[0077] In this embodiment, the equity certificate trading device responds to the equity certificate trading on-chain request by calling a second smart contract through a first smart contract to send an inventory query request to the inventory data source. Based on the received equity certificate trading on-chain request, the first and second smart contracts deployed in the blockchain retrieve the certificate inventory data of the equity certificates to be traded from the inventory data source. The inventory data source is an off-chain data source. On-chain data is data uploaded to the blockchain after consensus among blockchain nodes, while off-chain data originates from outside the blockchain system and is typically managed by corresponding services. The equity certificate trading on-chain request triggers the execution of the first smart contract, which then calls the second smart contract according to preset configuration information to send an inventory query request to the inventory data source or call an interface. The specific access address or access address rules of the inventory data source can be pre-configured in the second smart contract. A corresponding inventory management service is configured on the inventory data source, and the equity certificate trading device uses the first smart contract to call the corresponding interface of the second smart contract or send a query request to trigger the inventory management service to query the corresponding certificate inventory data based on the equity certificates to be traded involved in the equity certificate trading on-chain request. Understandably, when different types of equity certificates exist, the equity certificate trading device will obtain the corresponding certificate inventory data from the corresponding data source. For example, the equity certificate trading device can obtain the remaining quantity of a certain song and the remaining quantity of a certain image.
[0078] Step S330: Receive the voucher inventory data sent by the inventory data source according to the inventory query request through the second smart contract, and feed it back to the first smart contract;
[0079] In this embodiment, the smart contract includes a first smart contract for managing the transaction process and a second smart contract for managing the inventory. These two smart contracts can be deployed on the same blockchain, namely the blockchain for the equity certificates. After a blockchain node generates an equity certificate transaction on-chain request, this request triggers the first smart contract to execute the transaction on-chain process. Specifically, the equity certificate trading device responds to the equity certificate transaction on-chain request by calling the second smart contract through the first smart contract to send an inventory query request to the inventory data source. Upon receiving the inventory query request, the inventory data source sends the certificate inventory data back to the second smart contract. The equity certificate trading device then receives the certificate inventory data sent by the inventory data source through the second smart contract and sends the received certificate inventory data back to the first smart contract, allowing the first smart contract to continue the subsequent transaction on-chain process. Specifically, the calling and feedback process between the first and second smart contracts can be completed through corresponding interfaces in the contracts. In some embodiments, the first smart contract can be obtained by modifying a smart contract originally used to manage certificate transactions, while the second smart contract is specifically determined according to the management method of the corresponding inventory data source. Secondary smart contracts can exist in various forms. For example, they can retrieve data from databases, services, websites, or networks via software communication, or they can obtain data through hardware detection, such as electronic sensors, IoT devices, QR codes, robots, or other information reading devices. A secondary smart contract may have multiple corresponding data sources. These data sources communicate with each other to form a data network. When the secondary smart contract queries these data sources for inventory data, these data sources first communicate with each other and reach a consensus based on their respective inventory data and corresponding rules, in order to determine a consensus inventory result and feed it back to the secondary smart contract.
[0080] Step S340: If the voucher inventory data indicates that the remaining number of vouchers meets the transaction requirements of the voucher transaction information, then the voucher transaction information is uploaded to the blockchain.
[0081] After obtaining the certificate inventory data, the certificate trading device verifies whether the transaction requirements are met. Transaction requirements typically refer to the number of remaining certificates, meaning there are enough certificates to execute the transaction. If the certificate inventory data indicates that the remaining number of certificates is sufficient to meet the transaction requirements, the transaction information is uploaded to the blockchain, generating a new block containing the transaction information, thus making the transaction officially effective. This uploading process can also be accomplished through smart contracts. For example, after a certificate transaction uploading request is triggered, a smart contract first queries the corresponding certificate inventory data, then verifies whether the transaction can proceed based on the inventory data, and continues the uploading process after confirming that the transaction can proceed. If the certificate inventory data indicates that the remaining number of certificates is insufficient to meet the transaction requirements, the uploading process is stopped, and the requesting party is notified of the failure.
[0082] In the embodiments of this application, by introducing inventory information from outside the blockchain during the blockchain transaction on-chain process, it is possible to verify whether the pending vouchers have been sold out. This allows for checking the sales volume of equity vouchers during direct transactions with the blockchain without the need for a separate sales check process outside the blockchain process. This avoids data errors or attacks during the separate sales check process that could lead to blockchain data errors, which is beneficial to the data security and stability of the voucher transaction process. Furthermore, the inventory query is performed during the on-chain process without the need for separate execution, which helps to improve the overall efficiency of blockchain transactions.
[0083] In one embodiment of this application, based on the above technical solution, the inventory data source is a node network formed by multiple inventory data nodes; for ease of explanation, please refer to... Figure 4 , Figure 4 This is a schematic flowchart illustrating a blockchain-based equity certificate trading method according to an embodiment of this application. Figure 4 As shown, step S330 above, which involves receiving the voucher inventory data sent by the inventory data source according to the inventory query request through the second smart contract and feeding it back to the first smart contract, specifically includes the following steps S410 to S420:
[0084] Step S410: Receive inventory data response from inventory data nodes in the node network through the second smart contract. The inventory data response is a consensus result generated by the multiple inventory data nodes after reaching a consensus on the voucher inventory data.
[0085] Step S420: The second smart contract responds based on the inventory data to determine the certificate inventory data of the equity certificate to be traded, and feeds it back to the first smart contract.
[0086] In this embodiment, the inventory data source is a node network formed by multiple inventory data nodes. The second smart contract sends an inventory query request to one, some, or all of the inventory data nodes in this node network. The inventory data node receiving the inventory query request communicates with other nodes in the node network to conduct a consensus process on the certificate inventory data. It is understood that these inventory data nodes may each have their own corresponding data sources, and the inventory data in different inventory data nodes may differ. The consensus process can determine the final inventory data output by the node network through a majority voting mechanism or a principle based on the nearest minimum. The consensus-reached inventory data is fed back to the second smart contract or the equity certificate trading device along with the inventory data response. The equity certificate trading device receives the inventory data response from the inventory data nodes in the node network through the second smart contract. Subsequently, the equity certificate trading device parses the received inventory data response through the structure in the second smart contract and determines the certificate inventory data of the equity certificate to be traded based on the inventory data in the inventory data response. It is understood that, in the case of multiple types of equity certificates, the inventory data response may contain inventory data corresponding to each type of equity certificate. In one embodiment, inventory data for different types of equity certificates are stored in different node networks. Therefore, the equity certificate trading device receives multiple inventory data responses from different node networks through a second smart contract. Each inventory data response corresponds to the inventory of a type of equity certificate. The second smart contract is used to connect and summarize the data responses to obtain the certificate inventory data of the equity certificates to be traded.
[0087] In the embodiments of this application, the inventory data source is a node network formed by multiple inventory data nodes. The voucher inventory data obtained through the second smart contract is the consensus result in the node network, thereby making the process of obtaining voucher inventory data also have the characteristics of decentralization, improving the overall decentralization of the equity voucher trading process, avoiding abnormalities in the transaction process caused by abnormal inventory data sources, and helping to improve the stability of the overall solution.
[0088] In one embodiment of this application, based on the above technical solution, the inventory data source includes multiple inventory data nodes; the above step S330, receiving the voucher inventory data sent by the inventory data source according to the inventory query request through the second smart contract, and feeding it back to the first smart contract, specifically includes the following steps:
[0089] Receive multiple inventory data feedbacks from the multiple inventory data nodes, wherein the inventory data feedbacks carry node inventory data and the corresponding most recent transaction time;
[0090] The node inventory data with the most recent transaction time is used as the voucher inventory data and fed back to the first smart contract.
[0091] In this embodiment, the inventory data source includes multiple inventory data nodes. These nodes are unaware of each other's existence and communicate independently with the equity certificate trading device. The equity certificate trading device uses a second smart contract to reach a consensus and aggregate the data fed back by the multiple inventory data nodes. Specifically, after receiving an inventory query request, each inventory data node in the inventory data source independently feeds back data based on its stored inventory data. The equity certificate trading device receives these multiple inventory data feedbacks from the multiple inventory data nodes. This receiving process can typically be achieved through the interface or service of the second smart contract. The inventory data feedback sent by the inventory data nodes carries the node's stored node inventory data and the most recent transaction time recorded by the node. This most recent transaction time is the transaction time of the certificate transaction involved when the inventory data node last updated its inventory data. For example, for a certain inventory data node, if its last updated inventory data was due to the sale of two equity certificates in a certificate transaction that occurred on AA year BB month CC day DD hour, then the node inventory data will be updated from 76 to 74, and the transaction information of the certificate transaction will be recorded. When querying the node data feedback later, its node inventory data is 74, and the most recent transaction time is AA year BB month CC day DD hour.
[0092] After receiving inventory data feedback from multiple inventory data nodes, the equity certificate trading device uses a second smart contract to conduct a consensus process on this inventory data feedback. Specifically, the second smart contract first compares the consistency of the received node inventory data. If the data matches, the quantity of the node inventory data can be directly used as the certificate inventory data. If they do not match, the most recent transaction time corresponding to the node inventory data is checked, and the node inventory data with the most recent transaction time is used as the certificate inventory data. The certificate inventory data is then fed back from the second smart contract to the first smart contract, allowing the first smart contract to continue executing the inventory verification and transaction on-chain process.
[0093] In the embodiments of this application, the smart contract determines the voucher inventory data based on the feedback results of multiple inventory data nodes, thereby simplifying the consensus process between inventory data nodes, which helps to reduce the overall communication and computation volume of the system, reduce the waiting time of the on-chain process, and improve the on-chain execution efficiency.
[0094] In one embodiment of this application, based on the above technical solution, the voucher transaction information includes the transaction quantity; in step S340 above, if the voucher inventory data indicates that the remaining voucher quantity meets the transaction requirements of the voucher transaction information, then the voucher transaction information is uploaded to the blockchain, specifically including the following steps:
[0095] Obtain the voucher inventory data fed back by the second smart contract through the first smart contract;
[0096] If the number of remaining vouchers in the voucher inventory data is greater than or equal to the number of transactions, then the voucher transaction information is uploaded to the blockchain through the first smart contract.
[0097] In this embodiment, after obtaining the voucher inventory data from the second smart contract, the first smart contract verifies the inventory quantity based on the voucher inventory data. Only after successful verification is the voucher transaction information uploaded to the blockchain. Specifically, the equity voucher trading device obtains the voucher inventory data fed back by the second smart contract through the first smart contract. This voucher inventory data typically includes the remaining inventory quantity corresponding to each equity voucher to be traded. The equity voucher trading device compares the remaining inventory quantity with the type of equity voucher to be traded and the corresponding transaction quantity in the voucher transaction information to see if it meets the transaction quantity requirements. If the remaining voucher quantity in the voucher inventory data is greater than or equal to the transaction quantity, it indicates that there are enough remaining equity vouchers to complete the transaction. The equity voucher trading device then continues to upload the voucher transaction information to the blockchain through the first smart contract; that is, it packages the voucher transaction information into a new block and uploads it to the blockchain. If the remaining voucher quantity in the voucher inventory data is less than the transaction quantity, it indicates that the remaining inventory is insufficient to complete the current voucher transaction. The equity voucher trading device then stops processing the current voucher transaction and determines that the voucher transaction has failed. Understandably, a single request to add a certificate to the blockchain can contain multiple certificate transaction details. Transactions with sufficient inventory will be packaged into the blockchain, while failed transactions will not. Furthermore, in cases with multiple certificate transaction details, the certificate trading device will sort the transactions by transaction time. After performing an inventory check on the first certificate transaction, if the transaction is successful, the number of transactions executed in the first certificate transaction will be deducted from the current certificate inventory data. This deduction result will then be used for the inventory check process of the next certificate transaction.
[0098] In the embodiments of this application, smart contracts are used to check the inventory of equity certificates during the transaction process, thereby integrating the inventory check process with the transaction on-chain process, avoiding the separate inventory check process outside the blockchain, reducing the centralization of the equity certificate transaction process, thereby avoiding the instability risk brought by a single node and improving stability.
[0099] In one embodiment of this application, based on the above technical solution, in step S340, if the voucher inventory data indicates that the remaining number of vouchers meets the transaction requirements of the voucher transaction information, after the voucher transaction information is uploaded to the blockchain, the solution of this application further includes the following steps:
[0100] The first smart contract calls the second smart contract to send an inventory update instruction to the inventory data source, so that the inventory data source updates the inventory data according to the voucher transaction information.
[0101] In this embodiment, after the transaction is recorded on the blockchain, the first smart contract notifies the second smart contract to update the inventory data based on the transaction results. Specifically, after recording the voucher transaction information on the blockchain, the first smart contract calls the second smart contract to send an inventory update instruction to the inventory data source. This inventory update instruction is generated based on the voucher transaction information recorded on the blockchain by the first smart contract. Specifically, after recording the packaged block on the blockchain, the first smart contract counts the total number of equity vouchers sold in the voucher transaction information involved in the block and determines the inventory quantity that needs to be updated based on the count. Subsequently, the first smart contract calls the second smart contract to pass the inventory quantity to be deducted to the second smart contract. Upon being triggered, the second smart contract generates an inventory update instruction based on the received inventory quantity to be updated and sends it to the inventory data source. Upon receiving the inventory update instruction, the inventory data source updates its local inventory data based on the inventory quantity to be updated contained therein and records the relevant voucher transaction information, thereby reflecting the transaction results of the recorded voucher transaction information in its local inventory data.
[0102] In the embodiments of this application, a smart contract is used to notify the external inventory data source to update its local inventory data based on the on-chain results of the voucher transaction information, thereby avoiding data delays caused by offline updates and ensuring the real-time performance and accuracy of the inventory data in the inventory data source.
[0103] In one embodiment of this application, based on the above technical solution, in step S340, if the voucher inventory data indicates that the remaining number of vouchers meets the transaction requirements of the voucher transaction information, after the voucher transaction information is uploaded to the blockchain, the solution of this application further includes the following steps:
[0104] Monitor blockchain transactions uploaded to the blockchain;
[0105] If the blockchain transaction on the blockchain includes voucher transaction information, an inventory update instruction is sent to the inventory data source according to the voucher transaction information on the blockchain, so that the inventory data source updates the inventory data according to the voucher transaction information on the blockchain.
[0106] In this embodiment, the equity certificate trading device monitors on-chain transactions through a service and updates the inventory data in the inventory data source based on the on-chain transaction status. Specifically, the equity certificate trading device monitors the on-chain block status through a background service or triggers. When a new block is added to the blockchain, the equity certificate trading device parses the added block and reads the on-chain blockchain transactions. The on-chain blockchain transactions can contain various types of transactions, such as transfers, destructions, and certificate transaction information. The equity certificate trading device identifies the certificate transaction information based on the parsed transaction content. When the on-chain blockchain transaction contains certificate transaction information, the equity certificate trading device sends an inventory update instruction to the inventory data source based on the on-chain certificate transaction information. The inventory update instruction can include the on-chain certificate transaction information itself, or information such as the quantity of equity certificates traded in the on-chain certificate transaction information. After receiving the inventory update instruction, the inventory data source updates its local inventory data according to the information contained in the on-chain certificate transaction information.
[0107] It is understood that in some embodiments, the inventory data source itself may also be a component of the equity certificate trading device. Therefore, the above-mentioned monitoring process may also be performed directly by the inventory data source, and when it is confirmed that the blockchain transaction contains certificate transaction information, the on-chain certificate transaction information is directly parsed, and the inventory data is updated according to the equity certificates and transaction volume involved.
[0108] In the embodiments of this application, the inventory data in the inventory data source is updated by monitoring the on-chain credential transaction information, thereby reducing the impact on the blockchain transaction process and lowering the implementation cost of the solution.
[0109] In one embodiment of this application, based on the above technical solution, before obtaining the equity certificate transaction on-chain request in step S310, the solution of this application further includes the following steps:
[0110] Receive data source initialization requests from newly added data sources;
[0111] Based on the data source initialization request, read all certificate transaction information in the blockchain to determine the number of traded equity certificates;
[0112] Based on the number of traded equity certificates, initialization information is sent to the new data source so that the new data source initializes the remaining inventory data according to the number of traded equity certificates.
[0113] In this embodiment, when a new inventory data source is added to the equity certificate trading system, the inventory data is initialized based on the existing certificate transaction information in the blockchain. Specifically, the new inventory data source sends a data source initialization request to the equity certificate trading device. The equity certificate trading device receives this initialization request through the corresponding backend service and reads all certificate transaction information in the blockchain according to the request. For example, the equity certificate trading device scans each block in the blockchain and obtains the certificate transaction information that has been uploaded to the chain from the blocks. After obtaining the certificate transaction information that has been uploaded to the chain, the equity certificate trading device can further count the number of equity certificates that have been traded. Subsequently, the equity certificate trading device sends initialization information to the new inventory data source based on the number of equity certificates that have been traded, which includes the number of these traded equity certificates and the corresponding certificate transaction information. After receiving this initialization information, the new data source can further initialize the remaining inventory data based on the number of traded equity certificates, for example, calculating the difference between the total number of issued certificates and the number of traded equity certificates as the remaining inventory data, and recording the relevant certificate transaction information as the basis for subsequent data updates.
[0114] In the embodiments of this application, when a new data source is added, the existing certificate transaction information in the blockchain is used as the basis for initializing the inventory data, so that the initialization result can conform to the current status in the blockchain, which is beneficial to the data accuracy in the equity certificate transaction process.
[0115] In one embodiment of this application, based on the above technical solution, step S310, obtaining the equity certificate transaction on-chain request, specifically includes the following steps:
[0116] Receive a credential transaction request from a client, the credential transaction request including the key custody type of the transaction account and transaction information for the credential to be traded;
[0117] Based on the key escrow type, obtain the transaction key of the transaction account;
[0118] The transaction information is signed using the transaction key to generate a request to put the equity certificate transaction on the blockchain.
[0119] In this embodiment, the equity certificate transaction on-chain request is generated by the equity certificate trading device based on the certificate transaction request from the client. Specifically, the client generates a certificate transaction request for the equity certificate to be traded based on the end user's purchase or consumption operation. The client sends the certificate transaction request to the equity certificate trading device, and the request includes the key custody type of the trading account and the transaction information for the equity certificate to be traded. The transaction information is transaction content data generated based on the transaction operation, which typically includes transaction time, type, quantity, and price of the equity certificate to be traded, as well as account information of both parties. The key custody type refers to the method of obtaining the key required in the blockchain transaction process, which usually includes custody and non-custodial types. For the custody type, the custodian provides the key; for the non-custodial type, the client directly provides the key. The equity certificate trading device retrieves the transaction key of the trading account from the corresponding key storage location according to the key custody type. Then, it signs the transaction information according to the blockchain rules using the transaction key and continues the blockchain transaction consensus process according to the blockchain transaction logic to generate the equity certificate transaction on-chain request. It is understandable that the request to put the rights certificate transaction on the blockchain is a request to put the certificate transaction on the blockchain. The transaction request contained therein has usually gone through the consensus process between blockchain nodes. That is, the transaction information itself has been verified and confirmed to be legal, meaning that the corresponding account meets the conditions for purchasing the corresponding rights certificate. The specific blockchain transaction consensus process will not be elaborated here.
[0120] In the embodiments of this application, a specific method is provided to obtain the transaction key based on the key escrow type in the credential transaction request from the client and to further generate an on-chain request, thereby satisfying transactions with various key provision methods and improving the compatibility of the solution.
[0121] In one embodiment of this application, based on the above technical solution, the above steps, namely obtaining the transaction key of the transaction account according to the key escrow type, specifically include the following steps:
[0122] If the key custody type is custody type, then query the transaction key of the transaction account through the credential management service;
[0123] If the key custody type is non-custodial, then the transaction key of the transaction account is obtained from the credential transaction request.
[0124] Specifically, if the key custody type is escrow, it means that the transaction account's key is stored in a third party or escrow service, and the client's credential transaction request is sent to the credential management service, which then sends it to the blockchain to trigger the execution of the smart contract. The credential trading device queries the transaction account's transaction key through the credential management service. The relevant information of the credential management service can be preset in the credential trading device or retrieved based on the client's transaction account. Specifically, the credential trading device sends a key query request to the credential management service, which includes the transaction account's account information. The credential management service then retrieves the corresponding transaction key from its stored keys based on the account information and returns it to the credential trading device.
[0125] If the key escrow type is non-custodial, such accounts are required to provide their transaction key when generating a credential transaction request. This key is transmitted along with the credential transaction request to the credential trading device, where the client communicates directly with the blockchain without the need for a management service intermediary. The credential trading device then reads the transaction account's transaction key from the credential transaction request for use in subsequent transactions and consensus processes.
[0126] The proposed solution provides specific methods for obtaining transaction keys for different custody types, which improves the feasibility of the solution.
[0127] In one embodiment of this application, based on the above technical solution, in step S340, if the voucher inventory data indicates that the remaining number of vouchers meets the transaction requirements of the voucher transaction information, after the voucher transaction information is uploaded to the blockchain, the method of this application further includes the following steps:
[0128] If the key custody type is custody type, then the first smart contract sends an on-chain result notification to the credential management service so that the credential management service can provide feedback on the credential transaction result to the client;
[0129] If the key custody type is non-custodial, then the first smart contract sends an on-chain result notification to the client so that the client can display the credential transaction result.
[0130] In this embodiment, the method of reporting transaction results to the client varies depending on the method of obtaining the key. Specifically, if the key custody type is escrow, it means that the certificate management service communicates directly with the client. In this case, the equity certificate trading device will send the on-chain result notification to the certificate management service through the first smart contract, and the certificate management service will then send the on-chain result to the client. If the key custody type is non-escrow, it means that the client communicates directly with the blockchain to conduct the transaction. In this case, the equity certificate trading device will send the on-chain result notification directly to the client through the first smart contract. After receiving the on-chain result, the client will display the corresponding transaction result based on whether the result is successful or not. For example, if the purchase is successful, the virtual content corresponding to the purchased equity certificate will be displayed directly; if it fails, the result notification and the reason for failure will be displayed.
[0131] In the embodiments of this application, a smart contract is used to notify the client of the on-chain result of the credential transaction, thereby enabling the blockchain to directly complete the entire transaction process with the client without the need for additional notification and result query processes, simplifying the complexity of the solution and improving operational efficiency.
[0132] The following describes a complete embodiment of the equity certificate trading method in this application. Please refer to... Figure 5 , Figure 5 This is a schematic diagram of the overall process of the equity certificate trading method in the embodiments of this application. Figure 5As shown, when an end user purchases equity certificates through a client, and the certificate transaction information is ready to be uploaded to the blockchain after consensus, in step 510, the equity certificate trading device obtains an equity certificate transaction upload request, which includes the certificate transaction information of the equity certificate to be traded. Subsequently, in step 520, in response to the equity certificate transaction upload request, the equity certificate trading device calls a second smart contract through a first smart contract to send an inventory query request to the inventory data source. The inventory data source is an off-chain data source of the blockchain, specifically a node network containing multiple inventory data nodes. After multiple inventory data nodes reach a consensus on the certificate inventory data, they generate a consensus result and feed it back to the equity certificate trading device. In step 530, the equity certificate trading device receives the inventory data response from the inventory data nodes in the node network through the second smart contract, and in step 540, the second smart contract determines the certificate inventory data of the equity certificate to be traded based on the inventory data response and feeds it back to the first smart contract. Subsequently, in step 550, the equity certificate trading device obtains the certificate inventory data fed back by the second smart contract through the first smart contract. If the remaining number of certificates in the certificate inventory data is greater than or equal to the number of transactions, then in step 560, the certificate transaction information is uploaded to the blockchain through the first smart contract. After the transaction is uploaded to the blockchain, in step 570, the equity certificate trading device calls the second smart contract through the first smart contract to send an inventory update instruction to the inventory data source, so that the inventory data source updates the inventory data according to the certificate transaction information. In the subsequent step 580, the equity certificate trading device sends an on-chain result notification to the client through the first smart contract, so that the client can display the certificate transaction result.
[0133] The following examples illustrate two trading methods for equity certificate transactions in this application. Please refer to [link / reference]. Figure 6 , Figure 6 This is a schematic diagram illustrating the communication relationships in an embodiment of this application. For example... Figure 6As shown, the purchase process for equity certificates has two implementation methods: purchasing equity certificates through a backend service and purchasing equity certificates directly through blockchain. In the process of purchasing equity certificates through a backend service, the end user purchases equity certificates through a blockchain mini-program in step 601. In step 602, the blockchain mini-program sends the purchase request to the backend service. Finally, in step 603, the backend service obtains the user's key based on the user's key escrow type, signs the on-chain transaction, and then requests the equity certificate contract to upload the transaction information of the equity certificates to the blockchain in step 604. In step 605, the equity certificate contract queries the inventory management contract for the inventory status of equity certificates. When it confirms that the inventory is sufficient to complete the transaction, it uploads the transaction to the blockchain in step 606 to complete the on-chain transfer of equity certificates. Subsequently, in step 607, it notifies the inventory management contract to deduct the corresponding inventory data. Finally, in step 608, the equity certificate contract notifies the backend service that the transaction is complete, and the backend program notifies the blockchain mini-program of the successful purchase result in step 609. The process of users directly connecting to the blockchain to make purchases is similar to that of purchasing through a backend service. The main difference lies in the following steps: In step 610, the blockchain mini-program completes the transaction signature based on the key provided by the end user, and in step 611, the blockchain mini-program directly submits the on-chain request to the equity certificate contract. The specific execution process of the equity certificate contract is similar to the above steps, but finally, in step 612, the equity certificate contract directly returns the transaction result to the blockchain mini-program, and the blockchain mini-program displays the transaction result to the end user in step 613.
[0134] It should be noted that although the steps of the method in this application are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.
[0135] The following describes the implementation of the apparatus of this application, which can be used to execute the blockchain-based equity certificate transaction method in the above embodiments of this application. Figure 7 A schematic block diagram illustrating the composition of a blockchain-based equity certificate trading device in an embodiment of this application is shown. Figure 7 As shown, the blockchain-based equity certificate trading device 700 mainly includes:
[0136] The on-chain request acquisition module 710 is used to acquire on-chain requests for equity certificate transactions, wherein the on-chain requests for equity certificate transactions include certificate transaction information of the equity certificates to be traded;
[0137] The inventory query module 720 is used to respond to the equity certificate transaction on-chain request by calling the second smart contract through the first smart contract to send an inventory query request to the inventory data source, wherein the inventory data source is an off-chain data source of the blockchain.
[0138] The inventory feedback module 730 is used to receive the voucher inventory data sent by the inventory data source according to the inventory query request through the second smart contract, and feed it back to the first smart contract;
[0139] The transaction on-chain module 740 is used to upload the voucher transaction information to the blockchain if the voucher inventory data indicates that the remaining number of vouchers meets the transaction requirements of the voucher transaction information.
[0140] In some embodiments of this application, based on the above technical solutions, the inventory data source is a node network formed by multiple inventory data nodes; the inventory feedback module 730 includes:
[0141] The response receiving unit is configured to receive an inventory data response from the inventory data nodes in the node network via the second smart contract, wherein the inventory data response is a consensus result generated by the plurality of inventory data nodes after reaching a consensus on the voucher inventory data;
[0142] The inventory determination unit is used to determine the certificate inventory data of the equity certificate to be traded based on the inventory data response of the second smart contract.
[0143] In some embodiments of this application, based on the above technical solutions, the inventory data source includes multiple inventory data nodes; the inventory feedback module 730 includes:
[0144] The feedback receiving unit is used to receive multiple inventory data feedbacks from the multiple inventory data nodes, wherein the inventory data feedbacks carry node inventory data and the corresponding most recent transaction time;
[0145] The data feedback unit is used to feed back the node inventory data with the most recent transaction time as voucher inventory data to the first smart contract.
[0146] In some embodiments of this application, based on the above technical solutions, the voucher transaction information includes the transaction quantity; the transaction on-chain module 740 includes:
[0147] The data acquisition unit is used to acquire the voucher inventory data fed back by the second smart contract through the first smart contract;
[0148] The information uploading unit is used to upload the voucher transaction information to the blockchain through the first smart contract if the number of remaining vouchers in the voucher inventory data is greater than or equal to the number of transactions.
[0149] In some embodiments of this application, based on the above technical solutions, the equity certificate trading device 700 further includes:
[0150] An update instruction sending module is used to send an inventory update instruction to the inventory data source by calling the second smart contract through the first smart contract, so that the inventory data source updates the inventory data according to the voucher transaction information.
[0151] In some embodiments of this application, based on the above technical solutions, the equity certificate trading device 700 further includes:
[0152] The transaction monitoring module is used to monitor blockchain transactions uploaded to the blockchain.
[0153] The update instruction module is used to send an inventory update instruction to the inventory data source if the blockchain transaction on the chain contains voucher transaction information, so that the inventory data source updates the inventory data according to the voucher transaction information on the chain.
[0154] In some embodiments of this application, based on the above technical solutions, the equity certificate trading device 700 further includes:
[0155] The initialization request receiving module is used to receive data source initialization requests from newly added data sources;
[0156] The transaction information reading module is used to read all the certificate transaction information in the blockchain according to the data source initialization request, so as to determine the number of equity certificates that have been traded;
[0157] An initialization information sending module is used to send initialization information to the new data source based on the number of traded equity certificates, so that the new data source initializes the remaining inventory data based on the number of traded equity certificates.
[0158] In some embodiments of this application, based on the above technical solutions, the on-chain request acquisition module 710 includes:
[0159] A transaction request receiving unit is used to receive a certificate transaction request from a client, wherein the certificate transaction request includes the key custody type of the transaction account and transaction information for the equity certificate to be traded;
[0160] The transaction key acquisition unit is used to acquire the transaction key of the transaction account according to the key custody type.
[0161] The on-chain request generation unit is used to sign the transaction information using the transaction key and generate an on-chain request for equity certificate transactions.
[0162] In some embodiments of this application, based on the above technical solutions, the transaction key acquisition unit includes:
[0163] The key query subunit is used to query the transaction key of the transaction account through the credential management service if the key custody type is custody type.
[0164] The key acquisition subunit is used to obtain the transaction key of the transaction account from the credential transaction request if the key custody type is non-custodial.
[0165] In some embodiments of this application, based on the above technical solutions, the equity certificate trading device 700 further includes:
[0166] The service notification module is used to send an on-chain result notification to the credential management service through the first smart contract if the key custody type is custody type, so that the credential management service can provide feedback on the credential transaction result to the client.
[0167] The client notification module is used to send an on-chain result notification to the client through the first smart contract if the key custody type is non-custodial, so that the client can display the certificate transaction result.
[0168] It should be noted that the apparatus provided in the above embodiments and the method provided in the above embodiments belong to the same concept, and the specific way in which each module performs the operation has been described in detail in the method embodiments, and will not be repeated here.
[0169] Figure 8 A schematic diagram of the structure of a computer system suitable for implementing the electronic device of the present application is shown.
[0170] It should be noted that, Figure 8 The computer system 800 of the electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0171] like Figure 8As shown, the computer system 800 includes a Central Processing Unit (CPU) 801, which can perform various appropriate actions and processes based on programs stored in Read-Only Memory (ROM) 802 or programs loaded from Storage Unit 808 into Random Access Memory (RAM) 803. The RAM 803 also stores various programs and data required for system operation. The CPU 801, ROM 802, and RAM 803 are interconnected via a bus 804. An Input / Output (I / O) interface 805 is also connected to the bus 804.
[0172] The following components are connected to I / O interface 805: an input section 806 including a keyboard, mouse, etc.; an output section 807 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN (Local Area Network) card, modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to I / O interface 805 as needed. A removable medium 811, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 810 as needed so that computer programs read from it can be installed into storage section 808 as needed.
[0173] Specifically, according to embodiments of this application, the processes described in the various method flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 809, and / or installed from removable medium 811. When the computer program is executed by central processing unit (CPU) 801, it performs various functions defined in the system of this application.
[0174] It should be noted that the computer-readable medium shown in the embodiments of this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such transmitted data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to wireless, wired, etc., or any suitable combination thereof.
[0175] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0176] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of this application, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0177] Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, touch terminal, or network device, etc.) to execute the method according to the embodiments of this application.
[0178] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein.
[0179] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A blockchain-based method for trading equity certificates, characterized in that, include: Obtain a request to put a rights certificate transaction on the blockchain, wherein the request to put a rights certificate transaction on the blockchain includes the certificate transaction information of the rights certificate to be traded; In response to the request to put the equity certificate transaction on the blockchain, the first smart contract calls the second smart contract to send an inventory query request to the inventory data source, which is an off-chain data source of the blockchain. The second smart contract receives the voucher inventory data sent by the inventory data source according to the inventory query request, and feeds it back to the first smart contract; If the voucher inventory data indicates that the remaining number of vouchers meets the transaction requirements of the voucher transaction information, then the voucher transaction information will be uploaded to the blockchain.
2. The method according to claim 1, characterized in that, The inventory data source is a node network formed by multiple inventory data nodes; the step of receiving the voucher inventory data sent by the inventory data source according to the inventory query request through the second smart contract and feeding it back to the first smart contract includes: The second smart contract receives inventory data responses from inventory data nodes in the node network, where the inventory data responses are consensus results generated by the multiple inventory data nodes after reaching a consensus on the voucher inventory data. The second smart contract responds based on the inventory data to determine the certificate inventory data of the equity certificate to be traded, and then feeds it back to the first smart contract.
3. The method according to claim 1, characterized in that, The inventory data source includes multiple inventory data nodes; the step of receiving the voucher inventory data sent by the inventory data source according to the inventory query request through the second smart contract and feeding it back to the first smart contract includes: Receive multiple inventory data feedbacks from the multiple inventory data nodes, wherein the inventory data feedbacks carry node inventory data and the corresponding most recent transaction time; The node inventory data with the most recent transaction time is used as the voucher inventory data and fed back to the first smart contract.
4. The method according to claim 1, characterized in that, The voucher transaction information includes the transaction quantity; if the voucher inventory data indicates that the remaining voucher quantity meets the transaction requirements of the voucher transaction information, then the voucher transaction information is uploaded to the blockchain, including: Obtain the voucher inventory data fed back by the second smart contract through the first smart contract; If the number of remaining vouchers in the voucher inventory data is greater than or equal to the number of transactions, then the voucher transaction information is uploaded to the blockchain through the first smart contract.
5. The method according to claim 1, characterized in that, If the voucher inventory data indicates that the remaining number of vouchers meets the transaction requirements of the voucher transaction information, then after uploading the voucher transaction information to the blockchain, the method further includes: The first smart contract calls the second smart contract to send an inventory update instruction to the inventory data source, so that the inventory data source updates the inventory data according to the voucher transaction information.
6. The method according to claim 1, characterized in that, If the voucher inventory data indicates that the remaining number of vouchers meets the transaction requirements of the voucher transaction information, then after uploading the voucher transaction information to the blockchain, the method further includes: Monitor blockchain transactions uploaded to the blockchain; If the blockchain transaction on the blockchain includes voucher transaction information, an inventory update instruction is sent to the inventory data source according to the voucher transaction information on the blockchain, so that the inventory data source updates the inventory data according to the voucher transaction information on the blockchain.
7. The method according to claim 1, characterized in that, Before the request to obtain the equity certificate transaction on the blockchain, the method further includes: Receive data source initialization requests from newly added data sources; Based on the data source initialization request, read all certificate transaction information in the blockchain to determine the number of traded equity certificates; Based on the number of traded equity certificates, initialization information is sent to the new data source so that the new data source initializes the remaining inventory data according to the number of traded equity certificates.
8. The method according to any one of claims 1 to 7, characterized in that, The request to obtain equity certificate transactions on the blockchain includes: Receive a credential transaction request from a client, the credential transaction request including the key custody type of the transaction account and transaction information for the credential to be traded; Based on the key escrow type, obtain the transaction key of the transaction account; The transaction information is signed using the transaction key to generate a request to put the equity certificate transaction on the blockchain.
9. The method according to claim 8, characterized in that, The step of obtaining the transaction key of the transaction account according to the key escrow type includes: If the key custody type is custody type, then query the transaction key of the transaction account through the credential management service; If the key custody type is non-custodial, then the transaction key of the transaction account is obtained from the credential transaction request.
10. The method according to claim 9, characterized in that, If the voucher inventory data indicates that the remaining number of vouchers meets the transaction requirements of the voucher transaction information, then after uploading the voucher transaction information to the blockchain, the method further includes: If the key custody type is custody type, then the first smart contract sends an on-chain result notification to the credential management service so that the credential management service can provide feedback on the credential transaction result to the client; If the key custody type is non-custodial, then the first smart contract sends an on-chain result notification to the client so that the client can display the credential transaction result.
11. A blockchain-based equity certificate trading device, characterized in that, include: The on-chain request acquisition module is used to acquire on-chain requests for equity certificate transactions, wherein the on-chain requests for equity certificate transactions contain certificate transaction information of the equity certificate to be traded; The inventory query module is used to respond to the equity certificate transaction on-chain request by calling the second smart contract through the first smart contract to send an inventory query request to the inventory data source, which is an off-chain data source of the blockchain. The inventory feedback module is used to receive the voucher inventory data sent by the inventory data source according to the inventory query request through the second smart contract, and then feed it back to the first smart contract. The transaction on-chain module is used to upload the voucher transaction information to the blockchain if the voucher inventory data indicates that the remaining number of vouchers meets the transaction requirements of the voucher transaction information.
12. An electronic device, characterized in that, include: processor; Memory for storing the executable instructions of the processor; The processor is configured to execute the blockchain-based equity certificate transaction method according to any one of claims 1 to 10 by executing the executable instructions.
13. A computer-readable medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the blockchain-based equity certificate trading method as described in any one of claims 1 to 10.
14. A computer program product, characterized in that, The computer program product includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads and executes the computer instructions from the computer-readable storage medium, causing the computer device to perform the blockchain-based equity certificate transaction method as described in any one of claims 1 to 10.
Citation Information
Patent Citations
Transaction query and transaction data processing method, device and apparatus based on block chain
CN110648138A
Information processing method, device and system, storage medium, and electronic device
WO2019100991A1