CN110378678B - Numerical value integration method, device, system, node equipment and storage medium - Google Patents

Numerical value integration method, device, system, node equipment and storage medium Download PDF

Info

Publication number
CN110378678B
CN110378678B CN201910672709.9A CN201910672709A CN110378678B CN 110378678 B CN110378678 B CN 110378678B CN 201910672709 A CN201910672709 A CN 201910672709A CN 110378678 B CN110378678 B CN 110378678B
Authority
CN
China
Prior art keywords
utxos
target account
utxo
account
block
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910672709.9A
Other languages
Chinese (zh)
Other versions
CN110378678A (en
Inventor
郭锐
李茂材
王宗友
屠海涛
孔利
周开班
杨常青
王楠
丁勇
时一防
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201910672709.9A priority Critical patent/CN110378678B/en
Publication of CN110378678A publication Critical patent/CN110378678A/en
Application granted granted Critical
Publication of CN110378678B publication Critical patent/CN110378678B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/04Payment circuits
    • G06Q20/06Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme
    • G06Q20/065Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme using e-cash
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/30Payment architectures, schemes or protocols characterised by the use of specific devices or networks
    • G06Q20/36Payment architectures, schemes or protocols characterised by the use of specific devices or networks using electronic wallets or electronic money safes
    • G06Q20/367Payment architectures, schemes or protocols characterised by the use of specific devices or networks using electronic wallets or electronic money safes involving electronic purses or money safes
    • G06Q20/3678Payment architectures, schemes or protocols characterised by the use of specific devices or networks using electronic wallets or electronic money safes involving electronic purses or money safes e-cash details, e.g. blinded, divisible or detecting double spending

Abstract

The application discloses a numerical integration method, a numerical integration device, a numerical integration system, node equipment and a storage medium, and belongs to the technical field of networks. The method and the device provide the numerical value integration service through the block chain system, acquire the UTXO information of the target account from the account table of the block chain system, and convert the UTXO with a large quantity in the target account into the UTXO with a small quantity when the UTXO in the target account is determined to accord with the numerical value integration condition according to the UTXO information, so that the quantity of the UTXO in the target account is reduced, the storage space occupied by the UTXO in the target account is reduced, and the load of the node equipment in the block chain system is reduced.

Description

Numerical value integration method, device, system, node equipment and storage medium
The application is a divisional application with application date of 2018, 6 and 20 months and application number of 201810635826.3, and title of' numerical integration method, device, electronic device and computer-readable storage medium
Technical Field
The present application relates to the field of network technologies, and in particular, to a method, an apparatus, a system, a node device, and a storage medium for integrating numerical values.
Background
With the development of network technology, numerical value transfer is involved in more and more scenes. Electronic payment is a value transfer process. The electronic payment refers to that a user sends a value transfer request to certain electronic equipment through a network, and the electronic equipment transfers a certain value in an account of the user to other accounts according to information in the value transfer request.
In a scenario of processing a value transfer process by using a blockchain technique, a user generally sends a value transfer request to a blockchain system through a network, the blockchain system generates a block based on the value transfer request, identifies the block, and when the identification passes, deletes an unconsumed Transaction Output (UTXO) to be transferred from a payment account in an account table, and adds a certain value of UTXO to the payment account in the account table. For example, if user a needs to pay for user B3-tuple and user a does not have a 3-tuple denomination UTXO in its account, the node device in the blockchain system may delete the 5-tuple denomination UTXO in user a's account, add a 3-tuple denomination UTXO in user B's account, and add a new 2-tuple denomination UTXO in user a's account.
However, as the number of value transfer times increases, some UTXOs with small or irregular denominations may not be easily spent, which may result in more and more UTXOs in the account and larger occupied storage space, so that the load of the node device in the block chain becomes larger and larger, and therefore, a method for integrating the values to reduce the number of the UTXOs in the account is needed to reduce the storage space occupied by the UTXOs in the account.
Disclosure of Invention
The embodiment of the application provides a method, a device, a system, a node device and a storage medium for numerical integration, which can solve the problems that the number of UTXOs in an account is large and excessive storage space is occupied in the related technology. The technical scheme is as follows:
in one aspect, a method for numerical integration is provided, which is applied to any node device in a blockchain system, and the method includes:
obtaining non-spent transaction output UTXO information of a target account from an account table of the blockchain system;
when the UTXO in the target account is determined to meet the numerical value integration condition according to the UTXO information, determining a first number of UTXOs to be transferred out and a second number of UTXOs to be transferred in the target account according to the UTXO information and the numerical value integration rule, wherein the second number is smaller than the first number;
generating a numerical value integration request, and generating a block based on the numerical value integration request;
sending the block to other node equipment in the block chain system, and performing consensus on the block;
adding the block to a chain of blocks when the block passes consensus;
converting the first number of UTXOs in the target account to the second number of UTXOs in an account table in the blockchain system.
In one aspect, a numerical integration apparatus is provided, the apparatus comprising:
an acquisition module, configured to acquire unspent transaction output UTXO information of a target account from an account table of the blockchain system;
the obtaining module is further configured to determine, according to the UTXO information and a value integration rule, a first number of UTXOs to be transferred out and a second number of UTXOs to be transferred in the target account number, where the second number is smaller than the first number, when it is determined that the UTXO in the target account conforms to a value integration condition;
the consensus module is used for generating a numerical integration request and generating a block based on the numerical integration request;
the consensus module is further configured to send the block to other node devices in the blockchain system, and perform consensus on the block;
an adding module, configured to add the block to a block chain when the block passes consensus;
a value integration module to convert the first number of UTXOs in the target account to the second number of UTXOs in an account table in the blockchain system.
In one aspect, a blockchain system is provided, where the blockchain system includes a plurality of node devices, and any node device in the plurality of node devices is configured to perform the operations performed by the numerical integration method.
In one aspect, a node device is provided, and the node device includes one or more processors and one or more memories, where at least one instruction is stored in the one or more memories, and the instruction is loaded and executed by the one or more processors to implement the operations performed by the value integration method.
In one aspect, a computer-readable storage medium is provided, in which at least one instruction is stored, and the instruction is loaded and executed by a processor to implement the operation performed by the value integration method.
The beneficial effects brought by the technical scheme provided by the embodiment of the application at least comprise:
according to the embodiment of the application, when the UTXO in the target account is detected to meet the numerical integration condition, the numerical integration service is provided for the UTXO through the block chain system, the UTXO with a larger quantity in the target account is converted into the UTXO with a smaller quantity, so that the quantity of the UTXO in the target account is reduced, the storage space occupied by the UTXO in the target account is reduced, and the load of the node equipment in the block chain system is reduced.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is an implementation environment of a numerical integration method provided in an embodiment of the present application;
FIG. 2 is a flow chart of a numerical integration method provided in an embodiment of the present application;
FIG. 3 is a flow chart of a numerical integration method provided in an embodiment of the present application;
FIG. 4 is a schematic structural diagram of a numerical integration apparatus according to an embodiment of the present disclosure;
FIG. 5 is a schematic structural diagram of a numerical integration apparatus according to an embodiment of the present disclosure;
fig. 6 is a block diagram of an electronic device according to an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
Fig. 1 is an implementation environment of a numerical integration method provided in an embodiment of the present application, and referring to fig. 1, the implementation environment may include a terminal 101, a server 102, and a plurality of servers 103, where two of the terminal 101, the server 102, and the plurality of servers 103 may be connected through a network to implement data interaction, and the plurality of servers 103 are all node devices in a blockchain system, where a network formed by the plurality of servers 103 may be a Peer-to-Peer (P2P) network, and node devices in the P2P network are all peers, that is, have the same status.
The terminal 101 refers to a user equipment, the server 102 is an external device of the blockchain system, the terminal 101 may directly perform data interaction with the blockchain system to obtain a numerical integration service provided by the blockchain system, and may also obtain the numerical integration service from the blockchain system through the server 102, which is not limited in this embodiment of the present application.
In the embodiment of the present application, each server (node device) in the blockchain system has its own blockchain, where the blockchain includes a plurality of blocks, and each block may record therein different content of the value transfer request or content of the value integration request, and of course, may also record other content, which is not limited in this embodiment of the present application.
The following is a description of the terms referred to in this application:
intelligent contract: the contract program automatically executed according to specific conditions is an important way for a user to interact with the block chain and realize business logic by utilizing the block chain.
The numerical integration method may be applied to an electronic device, which may be the terminal 101, the server 102, or any one of the servers 103, and the following description will be given by taking an example in which the terminal 101 or the server 102 and the server 103 interact with each other in the embodiment shown in fig. 2. Fig. 2 is a flowchart of a numerical integration method provided in an embodiment of the present application, and referring to fig. 2, the method may include the following steps:
201. the electronic device obtains UTXO information for the target account from an account table of the blockchain system.
In the embodiment of the application, the electronic device can detect the UTXO information in the target account and perform numerical integration on the UTXO when the UTXO meets the numerical integration condition, so that the number of the UTXO in the target account is reduced, and the storage space occupied by the UTXO in the target account is reduced.
Wherein the target account may be any user account. The node device of the block chain system generally stores the account table, and the account table is used for storing UTXO in the account. In the account table, each account usually has its corresponding index information, and the electronic device can obtain UTXO information of a certain account according to the index information. In this embodiment of the present application, the electronic device may obtain UTXO information of the target account from an account table of the blockchain system according to the index information of the target account; wherein, the index information is the account address of the target account; or, the index information is a transaction hash value. Of course, the index information may also be other information that can uniquely identify the target account, which is not limited in this embodiment of the application.
Specifically, the electronic device may send an information acquisition request to the blockchain system, and the blockchain system acquires the UTXO information of the target account according to the index information carried in the information acquisition request and sends the UTXO information to the electronic device, which is of course, the electronic device may also acquire the UTXO information in other manners, for example, the electronic device may access and read an account table stored in any node device in the blockchain system, and locally generate an account table copy according to the read content, so as to acquire the UTXO information of the target account, which is not limited in this embodiment of the present application.
In the embodiment of the present application, the electronic device may be the terminal 101 in fig. 1 or may be the server 102. When the electronic device is a server 102, the relationship between the server 102 and a terminal 101 may be different, wherein the terminal 101 refers to a user device. Specifically, the following three cases may be included:
in one case, the electronic device is the terminal 101 described above.
The terminal may obtain UTXO information of the target account from the account table of the blockchain system, that is, the user equipment may access the account table to obtain UTXO information of a certain account from the account table.
In one possible implementation manner, the terminal may access the node device in the blockchain system through an installed client or through a web portal to acquire the UTXO information of the target account. In a specific possible embodiment, an access interface of the node device may be set in the client or in the web portal, and the terminal may access the account table on the node device through the access interface. In a possible implementation manner, the terminal may further obtain UTXO information of the target account from the account table and provide the UTXO management function of the target account for the user. For example, the terminal may provide the sum of the denomination of the UTXO of the target account for the user according to the obtained UTXO information of the target account, that is, the user may learn the "balance" in a certain account through a "wallet" in the terminal.
In one case, the electronic device is the server 102, and the server 102 stores a unique key of the target account provided by the terminal 101.
The terminal may provide the unique key of the target account to the server, and the server may manage the target account according to the unique key. For example, this case may be an account escrow, in which the terminal escrows the target account to the server, that is, the terminal gives the server the management right of the target account, and the server may perform any operation on the target account through the unique key.
In one case, the electronic device is the server 102, and the key with the target account partial authority provided by the terminal 101 is stored in the server 102.
The terminal can delegate a part of business functions of the target account to the server and the server completes the business functions. The unlocking method may specifically be implemented by using a multiple signature technology, where the multiple signature technology may be an M-N multiple signature technology, where N is the total number of public keys, and M is at least M public keys of the N public keys required for unlocking. For example, a multiple signature technique 1-2 may be adopted, that is, the terminal generates two pairs of keys for the target account, where there are two private keys and two public keys, and unlocking may be performed using one of the public keys, and of course, the public key needs to be a public key corresponding to the private key used for locking. The terminal may provide one pair of keys to the server and may also set an operation right for the key, that is, the key has a partial right of the target account. In a possible implementation manner, the terminal may also generate a plurality of private keys and a public key for the target account, where the public key may be used to unlock information locked by any one of the plurality of private keys.
202. And when the UTXO in the target account is determined to meet the numerical value integration condition according to the UTXO information, the electronic equipment determines a first quantity of UTXOs to be transferred out and a second quantity of UTXOs to be transferred in the target account according to the UTXO information and the numerical value integration rule.
The electronic device may detect whether the UTXO in the target account meets a numerical value integration condition according to the obtained UTXO information, and if so, may perform the following steps related to numerical value integration, and if not, may perform the above steps 201 and 202, and continue the detection. In one possible implementation manner, the electronic device may periodically perform step 201 described above, and perform a step of detecting whether the UTXO in the target account meets the value integration condition.
The condition that the UTXO in the target account meets the value integration condition may include: the number of UTXOs in the target account is greater than a first number threshold; or the number of UTXOs with the denomination less than the denomination threshold in the target account is greater than a second number threshold; or the storage space occupied by the UTXO in the target account is larger than a preset capacity. The first quantity threshold, the second quantity threshold, the denomination threshold, or the preset capacity may be preset by a relevant technician, or may be adjusted by a user according to the actual use requirement of the user. It should be noted that, the above are only examples in which the UTXO in the target accounts meets the value integration condition, and the value integration condition may be preset by a relevant technician according to an actual service function or requirement, or set by a user according to an actual use requirement of the UTXO, and in a possible implementation manner, the value integration conditions of different accounts may also be different, which is not limited in this embodiment of the present application.
For example, a number upper limit may be set in the electronic device, and the electronic device may determine that the number integration is required when it detects that the number of UTXOs in the account is large and the number upper limit has been reached. Alternatively, if the electronic device detects that the number of small-denomination UTXOs is large and the upper limit of the number is reached, it may be determined that numerical integration is required. Or a capacity upper limit may be set in the electronic device, the electronic device may detect a storage space occupied by the UTXO in the account, and if the occupied storage space is large and reaches the capacity upper limit, it may be determined that numerical value integration is required.
When the electronic device determines that the UTXO in the target account meets a value integration condition according to the UTXO information, the electronic device may send a value integration request to the blockchain system, where the value integration request is used to instruct the blockchain system to convert a first number of UTXOs in the target account into a second number of UTXOs, where the second number is smaller than the first number, so that the number of UTXOs in the target account may be reduced, a storage space occupied by the UTXOs in the target account may be reduced, and a load of a node device in the blockchain may be reduced.
Before sending the value integration request, the electronic device may determine specific content of the value integration request, where the specific content may include a first number of UTXOs to be transferred out and a second number of UTXOs to be transferred in the target account. Specifically, the value integration rule adopted by the process of determining the first number of UTXOs and the second number of UTXOs by the electronic device may be preset by a person skilled in the art, which is not specifically limited in the embodiment of the present application, and the following only gives a few examples of the possibilities:
in one possible implementation, the electronic device may treat all UTXOs in the target account as the first number of UTXOs to be transferred out, and determine a sum of the denominations of the second number of UTXOs according to a sum of the denominations of the first number of UTXOs. The electronic device may determine the sum of the denominations of the second number of UTXOs according to the sum of the denominations of the first number of UTXOs by: and the electronic equipment determines the maximum value in each denomination range as the denomination of the second quantity of UTXOs according to the denomination range to which the denomination of each UTXO in the target account belongs, wherein the second quantity is one or is more than one.
For example, the electronic device may integrate all the UTXOs in the target account, and for the denomination of the second number of UTXOs, when the second number is one, the electronic device may integrate all the UTXOs in the target account into one UTXO, and the denomination of the second number of UTXOs is also fixed. When the second number is greater than one, the electronic device may integrate all the UTXOs in the target account into a second number of UTXOs, and a different denomination range may be set in the electronic device, for example, [0,5], (5-10], … …, and if the denominations of the first number of UTXOs are 4, 6, 3, and 2, respectively, 5 and 10 may be used as the second number of UTXOs.
In one possible implementation, the second amount may be determined according to historical transaction information of the target account, for example, a maximum number of transactions performed in parallel in the historical transaction information may be determined as the second amount. Of course, the second number may be a preset number, or the second number may be determined according to the sum of the denomination of the determined second number of UTXOs and the denomination of the first number of UTXOs, which is not limited in this embodiment.
In one possible implementation, the electronic device may treat the UTXOs in the target account having a denomination less than the denomination threshold as the first number of UTXOs and determine a sum of the denominations of the second number of UTXOs based on the sum of the denominations of the first number of UTXOs.
For example, the denominations of the UTXOs included in the target account are 20, 13, 8, 5, 4, 1, and 9, for example, the denomination threshold is 10, the electronic device may use the UTXOs with the denomination less than 10 as the UTXOs to be transferred out, that is, the first number may be 5, the first number of UTXOs may be 8, 5, 4, 1, and 9, and the determination process of the second number of UTXOs is the same as in the foregoing implementation manner, which is not described in detail herein.
In one possible implementation manner, the electronic device may use, according to the historical transaction information of the target account, the UTXOs in the first range of denominations in the target account as the first number of UTXOs, and use the UTXOs in the second range of denominations as the second number of UTXOs, where the first range of denominations is a range of denominations of the UTXOs in the historical transaction information, where the frequency of the UTXOs in the historical transaction information is smaller than the first frequency threshold, and the second range of denominations is a range of denominations of the UTXOs in the historical transaction information, where the frequency of the UTXOs in the historical transaction information is larger than the second frequency threshold.
For example, if it can be determined in the historical transaction information of the target account that the UTXO with the denomination of 20, 50 or 100 is frequently used by the user or the UTXO with the denomination range of [20,100] is frequently used by the user and the UTXO with the denomination range of [0,20] is rarely used by the user, the electronic device may use the UTXO with the denomination range within [0,20] in the current account as the UTXO to be transferred out, use the denomination of the UTXO to be transferred into 20, 50 or 100, or use [20,100] as the denomination range of the UTXO to be transferred into.
In one possible implementation, when determining the first number of UTXOs and the second number of UTXOs, the electronic device may determine the size relationship between the sum of the denominations of the first number of UTXOs and the sum of the denominations of the second number of UTXOs by:
in one case, the first number of UTXOs is the same as the sum of the denominations of the second number of UTXOs.
Generally, when providing a value transfer service for a user, a node device in a blockchain may charge a certain fee, and in the value integration method provided in the embodiment of the present application, in order to reduce a load condition of the node device in the blockchain, the value integration is performed on the UTXO in the account of the user, which may be a maintenance manner for the device in the blockchain system, and possibly the user does not actually have a desire to perform the value integration actively, so that the method may further include: when the value integration is carried out on the target account, the fee of the value integration service is not charged. That is, the sum of the transferred-in and transferred-out UTXO denominations is the same when the target account is subjected to value integration.
Specifically, the utility of the numerical integration service can be improved by realizing intelligent contracts, or specifying that the transferred-in and transferred-out denominations of the numerical integration request are the same when the block chain system is established, without charging fees. Of course, the above process may also be implemented in other manners, for example, all transfer-in addresses of the charges that are charged are rewritten into account addresses of the target accounts, which is not limited in this embodiment of the application.
In one case, the sum of the denominations of the first number of UTXOs is the sum of the denominations of the second number of UTXOs and a preset denomination.
The predetermined denomination is the cost of integration through the blockchain system. For example, a commission is required for transferring value from the blockchain system, and the value integration process is also a value transfer process, and the preset denomination can be transferred into the account of the blockchain system. Then a portion of the first number of UTXOs in the target account may be transferred back to the target account after being integrated, and another portion may be transferred to the account charged for the predetermined denomination. The preset denomination is preset in the block chain system by a relevant technician, and certainly, the preset denomination of the UTXO collected in the value integration process may be set to be smaller than the denomination of the UTXO collected in the value transfer process.
Based on the value integration condition and the value integration rule, the UTXO in the target account is subjected to value integration, so that the number of UTXOs in the target account can be reduced, the load of node equipment is reduced, the integrated UTXO is easier to cost, and convenience is brought to the UTXO use of a user.
203. The electronic device sends a value integration request to the blockchain system.
The electronic device may send a numerical integration request to the blockchain system after determining the content of the numerical integration request. Generally, the electronic device may store an address of any node device in the blockchain system, and the electronic device may obtain the address and send the value integration request to the address.
In a possible implementation manner, the value integration request may carry a key of the target account, and it should be noted that the electronic device may lock the value integration request by using a private key and then send the value integration request to the blockchain system, that is, send the value integration request after signing the value integration request, and the blockchain system may unlock the value integration request by using a corresponding public key.
In the first two cases, the key is the unique key of the target account provided by the user equipment, corresponding to the three cases in step 201. In the last case, the key is a key provided by the user device with partial rights to the target account. If the multiple signature technology is adopted, the terminal entrusts the target account to the server, the terminal can lock the numerical value integration request by using a private key of the terminal, the server can also lock the numerical value integration request by using the private key with partial authority of the target account provided by the terminal, the block chain system can be unlocked by using the public key corresponding to the private key, and the public key adopted by the block chain system for subsequent unlocking and the numerical value integration request are correspondingly stored, so that the numerical value integration task specifically initiated by a user can be known.
The process of locking the numerical value integration request by the private key is also the process of generating the signature information, and the signature information is carried by the numerical value integration request. If the electronic device adopts a mode of managing the target account by a plurality of private keys and one public key, the blockchain system can correspondingly store the signature information carried by the numerical value integration request and the numerical value integration request in the subsequent process, so that the initiator of the numerical value integration request can be known. Of course, in the step 203, the value integration request may further include other contents, for example, rules referred to by the value integration process or transaction initiation time, which is not limited in the embodiment of the present application.
The above step 202 and step 203 are processes of sending a value integration request to the blockchain system when it is determined that the UTXO in the target account meets the value integration condition according to the UTXO information, so that the blockchain system can subsequently provide the value integration service for the electronic device according to the value integration request.
204. When a value integration request is received, the block chain system generates a block based on the value integration request, and identifies the block, wherein the value integration request is triggered by the fact that the UTXO in the target account meets a value integration condition.
In one possible implementation manner, the electronic device may send a value integration request to any node device in the blockchain system, and after receiving the value integration request, the node device may generate a block based on the value integration request, where the block includes content of the value integration request. Of course, the node device may also generate a block based on a plurality of value integration requests or value transfer requests, and broadcast the block to other node devices, so that the blockchain system may recognize the block.
For example, the process of the node device generating the block may be: the last block in the current blockchain is called the first block, that is, the first block is the block with the highest block height in the current blockchain, and the block being generated by the node device is called the second block. The node device may obtain all information of the first block from the block chain, so as to obtain a block header feature value of the first block based on all information of the first block, perform feature value calculation on information of a contract to be stored in the second block and a value integration request, and obtain a block body feature value of the second block, and further, the node device may store the block header feature value of the first block and the block body feature value of the second block (which may further include a version number, a difficulty value, and a time stamp) to a block header of the second block, and store the information of the contract and the value integration request to a block body of the second block, thereby generating the second block. Thus, the first block and the second block are related by the characteristic value of the block head of the first block, and the aim of connecting blocks in series in a block chain can be achieved. Of course, the above is only an example of generating a block, and the embodiment of the present application does not limit the specific generating process of the block.
Wherein, when the blockchain system identifies the block, it may determine whether the information of the block is accurate, and as to the content of the above-mentioned value integration request in the block, any node device in the blockchain system may query, in an account table stored locally, whether each UTXO in the first number of UTXOs exists and is used, and may determine whether the sum of the transferred-in and transferred-out denominations of the value integration request is the same, wherein the UTXOs need to be able to be queried in the account table and are not used, and the sum of the transferred-in and transferred-out denominations of the value integration request is the same, and the value integration request may be valid, and of course, the identity information of the sender of the value integration request may also be verified, and in a possible implementation manner, after each node device verifies the block, the verification result may be broadcast to other node devices, when the verification result of the node device in the blockchain system that is greater than the preset ratio passes, the blockchain system may determine that the block passes the consensus, and certainly, the specific implementation process of the broadcast verification result and the preset ratio may be preset by a related technician or may be adjusted by the related technician. The blockchain system may perform steps 205-206 described below when it determines that the block passes the consensus.
205. When the block passes the consensus, the blockchain system adds the block to the blockchain.
206. The blockchain system converts the first number of UTXOs in the target account to the second number of UTXOs in an account table of the blockchain system.
Step 205 and step 206 are performed by the blockchain system performing value integration when the block passes the consensus, and recording the process of value integration content at this time. Each node device in the blockchain system may add the block to the blockchain as the block passes the consensus. The node device may further update its own account table information, and the node device may delete the first number of UTXOs from the account table and add the second number of UTXOs to the account table, that is, delete the spent UTXOs from the account table and add an unused UTXO to the account table. Therefore, the account table comprises the UTXO in each account, the block adding step in the block chain of each node device in the block chain system is synchronously performed with the UTXO information updating in the account table, and the accuracy of the account information can be ensured. It should be noted that, the blockchain system may first perform step 205 and then perform step 206, may first perform step 206 and then perform step 205, and may also perform step 205 and step 206 at the same time, which is not limited in this embodiment of the present invention.
It should be noted that, for any node device in the blockchain system, when the block passes the consensus, the node device may perform the step 205 and the step 206, so that the information recorded by each node device is consistent, and the accuracy of the account information can be ensured.
In a possible implementation manner, in the latter case in step 202, the sum of the denominations of the first number of UTXOs is the sum of the denominations of the second number of UTXOs and a preset denomination, and the blockchain system may further add the UTXOs with the denominations of the preset denomination in the account table in the account of the blockchain system.
207. The blockchain system sends an integration success message to the electronic device.
The integration success message is used to inform the electronic device that the first number of UTXOs in the target account has been successfully converted to the second number of UTXOs.
208. The electronic equipment receives the integration success message sent by the blockchain system.
When the electronic device receives the integration success message, integration success prompt information can be displayed in the interface so as to prompt the change condition of the UTXO in the user target account.
The steps 204 to 208 are performed by the blockchain system or the electronic device when the blocks are identified, and in one possible implementation, the blocks may not be identified, and when the blocks do not pass the identification, the blockchain system may ignore the value integration request. That is, if the block does not pass the consensus, the blockchain system may not add the block to the blockchain, e.g., the block may be discarded, and of course, the blockchain system does not need to modify the account table.
Accordingly, the blockchain system may also send an integration failure message to the electronic device. The integration failure message is used for informing the electronic device that the UTXO in the target account is not successfully subjected to value integration. So that the electronic device can receive the integration failure message sent by the blockchain system. In one possible implementation manner, the electronic device may also display an integration failure prompt message in the interface when receiving the integration failure message, so as to prompt that the integration process of the UTXO in the user target account fails. The electronic equipment can also display prompt information to prompt a user that numerical value integration operation can be carried out again. Of course, the electronic device may further re-execute the steps 201 to 203 without being triggered by the user, which is not limited in this embodiment.
According to the embodiment of the application, when the UTXO in the target account is detected to meet the numerical integration condition, the numerical integration service is provided for the UTXO through the block chain system, the UTXO with a larger quantity in the target account is converted into the UTXO with a smaller quantity, so that the quantity of the UTXO in the target account is reduced, the storage space occupied by the UTXO in the target account is reduced, and the load of the node equipment in the block chain system is reduced.
As described above by taking the example that the value integration request is sent from the electronic device outside the blockchain system to any node device in the blockchain system through the embodiment shown in fig. 2, in a possible implementation manner, any node device in the blockchain system may further generate the value integration request when detecting that the UTXO in the target account meets the value integration condition, so as to obtain the value integration request. This implementation is described in detail below with the embodiment shown in fig. 3. Fig. 3 is a flowchart of a numerical integration method provided in an embodiment of the present application, where in the embodiment of the present application, the numerical integration method is applied to an electronic device, and the electronic device may be any one of the servers 103, that is, any node device in a blockchain system, referring to fig. 3, the method may include the following steps:
301. the node equipment acquires UTXO information of a target account from an account table of the blockchain system.
An account table is stored in each node device in the block chain system, and the node device may obtain UTXO information of the target account from the locally stored account table, where step 301 is similar to step 201 described above, and this is not described in detail in this embodiment of the present application.
In a possible implementation manner, the node device may periodically perform step 301, and detect whether the UTXO in the target account meets the value integration condition based on the acquired UTXO information, and if so, may perform step 302 described below, and if not, may continue to perform the steps of acquiring and detecting.
302. And when the UTXO in the target account is determined to meet the numerical value integration condition according to the UTXO information, the node equipment determines a first quantity of UTXOs to be transferred out and a second quantity of UTXOs to be transferred in the target account according to the UTXO information and the numerical value integration rule.
The specific content of the value integration request may also be determined when the node device determines that the UTXO in the target account needs to perform value integration, and the specific determination process is the same as that in step 202, which is not described herein again.
303. The node device generates a value integration request and generates a block based on the value integration request.
The difference between step 301 to step 303 is that the node device obtains the value integration request, and step 303 is different from step 203, in that the node device may generate the value integration request after determining the specific content of the value integration request, and may also generate a block including the content of the value integration request, so that step 304 described below may be performed to broadcast the block to other node devices.
304. The node device sends the block to other node devices in the blockchain system.
The node device broadcasts the block to other node devices in the blockchain system so that the blockchain system can perform step 305, described below, to identify the block.
305. The node device shares the block with other node devices in the blockchain system.
The steps 303 to 305 are processes of generating a block and commonly identifying the block based on the value integration request, wherein the block generation process is the same as the process of step 204, and the block chain system can commonly identify the content of the value integration request in the block and also commonly identify other contents in the block, which is not described herein. When the block passes the consensus, each node device may perform steps 306 and 307 described below.
306. When the block passes the consensus, the node apparatus adds the block to the blockchain.
307. The node device converts the first number of UTXOs in the target account into the second number of UTXOs in an account table of the blockchain system.
Step 306 and step 307 are the same as step 205 and step 206, and any node device in the blockchain system can execute step 306 and step 307, which is not described herein again. Like step 205 and step 206, the execution order of step 306 and step 307 is not limited in this embodiment of the application.
In one possible implementation, the block may also fail to pass consensus, each node device in the blockchain system may ignore the value integration request, and the node device may discard the block, not add the block to the blockchain, and not modify the account table.
According to the embodiment of the application, when the UTXO in the target account is detected to meet the numerical value integration condition through the block chain system, numerical value integration is directly carried out, the UTXO with a large quantity in the target account is converted into the UTXO with a small quantity, so that the quantity of the UTXO in the target account can be reduced without user operation or operation of equipment outside the block chain system, the storage space occupied by the UTXO in the target account is reduced, and the load of node equipment in the block chain system is reduced.
All the above optional technical solutions may be combined arbitrarily to form optional embodiments of the present application, and are not described herein again.
Fig. 4 is a schematic structural diagram of a numerical integration apparatus provided in an embodiment of the present application, applied to an electronic device, and referring to fig. 4, the apparatus includes:
an obtaining module 401, configured to obtain UTXO information of a target account from an account table of a blockchain system;
a sending module 402, configured to send a value integration request to the blockchain system when it is determined that the UTXO in the target account meets a value integration condition according to the UTXO information, where the value integration request is used to instruct the blockchain system to convert a first number of the UTXOs in the target account into a second number of the UTXOs, where the second number is smaller than the first number;
a receiving module 403, configured to receive an integration success message sent by the blockchain system.
In a possible implementation manner, the obtaining module 401 is configured to obtain UTXO information of the target account from an account table of a block chain system according to the index information of the target account; wherein, the index information is the account address of the target account; or, the index information is a transaction hash value.
In one possible implementation, the UTXO in the target account satisfies a value integration condition, including:
the number of UTXOs in the target account is greater than a first number threshold; or the number of UTXOs with the denomination less than the denomination threshold in the target account is greater than a second number threshold; or the storage space occupied by the UTXO in the target account is larger than a preset capacity.
In one possible implementation, the apparatus further includes:
and the determining module is used for determining a first number of UTXOs to be transferred out and a second number of UTXOs to be transferred in the target account according to the UTXO information and the value integration rule when the UTXO in the target account is determined to accord with the value integration condition according to the UTXO information.
In one possible implementation, the determining module is configured to:
all UTXOs in the target account are used as the UTXOs of the first quantity to be transferred out, and the sum of the denominations of the UTXOs of the second quantity is determined according to the sum of the denominations of the UTXOs of the first quantity; or the like, or, alternatively,
using the UTXO with the denomination smaller than the denomination threshold value in the target account as a first quantity of UTXOs, and determining the sum of the denominations of the second quantity of UTXOs according to the sum of the denominations of the first quantity of UTXOs; or the like, or, alternatively,
according to the historical transaction information of the target account, using the UTXO in a first denomination range in the target account as a first quantity of UTXOs, and using the UTXOs in a second denomination range as a second quantity of UTXOs, wherein the first denomination range is the denomination range of the UTXOs with the transaction input frequency smaller than a first frequency threshold value in the historical transaction information, and the second denomination range is the denomination range of the UTXOs with the transaction input frequency larger than a second frequency threshold value in the historical transaction information;
wherein determining the sum of the denominations of the second number of UTXOs based on the sum of the denominations of the first number of UTXOs further comprises:
and determining the maximum value in each denomination range as the denomination of the second number of UTXOs according to the denomination range to which the denomination of each UTXO in the target account belongs, wherein the second number is one or is more than one.
In one possible implementation, the first number of UTXOs is the same as the sum of the denominations of the second number of UTXOs; or the sum of the denominations of the first number of UTXOs is the sum of the denominations of the second number of UTXOs and a preset denomination.
In one possible implementation, the value integration request carries a key of the target account, where the key is a unique key of the target account provided by the user equipment; or, the key is a key provided by the user equipment and having the partial authority of the target account.
The device provided by the embodiment of the application provides the numerical integration service for the UTXO in the target account through the blockchain system when detecting that the UTXO meets the numerical integration condition, and converts the UTXO with a larger quantity in the target account into the UTXO with a smaller quantity, so that the quantity of the UTXO in the target account is reduced, the storage space occupied by the UTXO in the target account is reduced, and the load of the node equipment in the blockchain system is reduced.
It should be noted that: in the above embodiment, when integrating the numerical value, the numerical value integrating device is only illustrated by dividing the functional modules, and in practical applications, the functions may be distributed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the numerical integration device and the numerical integration method provided by the above embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiments and are not described herein again.
Fig. 5 is a schematic structural diagram of a numerical integration apparatus according to an embodiment of the present application, applied to any node device in a blockchain system, referring to fig. 5, the apparatus includes:
an obtaining module 501, configured to obtain a value integration request, where the value integration request is used to instruct to convert a first number of UTXOs in a target account into a second number of UTXOs, and the value integration request is triggered by that the UTXOs in the target account meet a value integration condition;
a consensus module 502, configured to generate a block based on the value integration request, and perform consensus on the block;
an adding module 503, configured to add the block to the blockchain when the block passes the consensus;
a value integration module 504, configured to convert the first number of UTXOs in the target account into the second number of UTXOs in the account table of the blockchain system.
In one possible implementation, the obtaining module 501 is configured to:
receiving a numerical value integration request sent by electronic equipment; or the like, or, alternatively,
and generating a numerical value integration request when detecting that the UTXO in the target account meets the numerical value integration condition.
In one possible implementation, the UTXO in the target account satisfies a value integration condition, including:
the number of UTXOs in the target account is greater than a first number threshold; or the number of UTXOs with the denomination less than the denomination threshold in the target account is greater than a second number threshold; or the storage space occupied by the UTXO in the target account is larger than a preset capacity.
In one possible implementation, the first number of UTXOs is the same as the sum of the denominations of the second number of UTXOs.
In one possible implementation, the sum of the denominations of the first number of UTXOs is the sum of the denominations of the second number of UTXOs and a preset denomination;
the value integration module 504 is further configured to add the UTXO with the predetermined denomination to the account of the blockchain system in the account table when the block passes the consensus.
In one possible implementation, the value integration request carries a key of the target account, where the key is a unique key of the target account provided by the user equipment; or, the key is a key provided by the user equipment and having the partial authority of the target account.
The device provided by the embodiment of the application provides the numerical integration service for the UTXO in the target account through the blockchain system when detecting that the UTXO meets the numerical integration condition, and converts the UTXO with a larger quantity in the target account into the UTXO with a smaller quantity, so that the quantity of the UTXO in the target account is reduced, the storage space occupied by the UTXO in the target account is reduced, and the load of the node equipment in the blockchain system is reduced.
It should be noted that: in the above embodiment, when integrating the numerical value, the numerical value integrating device is only illustrated by dividing the functional modules, and in practical applications, the functions may be distributed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the numerical integration device and the numerical integration method provided by the above embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiments and are not described herein again.
Fig. 6 is a block diagram of an electronic device according to an embodiment of the present application. The electronic device 600 may be provided as a terminal. The electronic device 600 may be: a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III, motion video Experts compression standard Audio Layer 3), an MP4 player (Moving Picture Experts Group Audio Layer IV, motion video Experts compression standard Audio Layer 4), a notebook computer, or a desktop computer. The electronic device 600 may also be referred to by other names such as user equipment, portable terminal, laptop terminal, desktop terminal, and so forth.
In general, the electronic device 600 includes: a processor 601 and a memory 602.
The processor 601 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and so on. The processor 601 may be implemented in at least one hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), and a PLA (Programmable Logic Array). The processor 601 may also include a main processor and a coprocessor, where the main processor is a processor for Processing data in an awake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor 601 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content required to be displayed on the display screen. In some embodiments, processor 601 may also include an AI (Artificial Intelligence) processor for processing computational operations related to machine learning.
The memory 602 may include one or more computer-readable storage media, which may be non-transitory. The memory 602 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer readable storage medium in memory 602 is used to store at least one instruction for execution by processor 601 to implement the numerical integration methods provided by the method embodiments herein.
In some embodiments, the electronic device 600 may further optionally include: a peripheral interface 603 and at least one peripheral. The processor 601, memory 602, and peripheral interface 603 may be connected by buses or signal lines. Various peripheral devices may be connected to the peripheral interface 603 via a bus, signal line, or circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 604, a touch screen display 605, a camera 606, an audio circuit 607, a positioning component 608, and a power supply 609.
The peripheral interface 603 may be used to connect at least one peripheral related to I/O (Input/Output) to the processor 601 and the memory 602. In some embodiments, the processor 601, memory 602, and peripheral interface 603 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 601, the memory 602, and the peripheral interface 603 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.
The Radio Frequency circuit 604 is used for receiving and transmitting RF (Radio Frequency) signals, also called electromagnetic signals. The radio frequency circuitry 604 communicates with communication networks and other communication devices via electromagnetic signals. The rf circuit 604 converts an electrical signal into an electromagnetic signal to transmit, or converts a received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 604 comprises: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber identity module card, and so forth. The radio frequency circuitry 604 may communicate with other electronic devices via at least one wireless communication protocol. The wireless communication protocols include, but are not limited to: metropolitan area networks, various generation mobile communication networks (2G, 3G, 4G, and 5G), Wireless local area networks, and/or WiFi (Wireless Fidelity) networks. In some embodiments, the rf circuit 604 may further include NFC (Near Field Communication) related circuits, which are not limited in this application.
The display 605 is used to display a UI (User Interface). The UI may include graphics, text, icons, video, and any combination thereof. When the display screen 605 is a touch display screen, the display screen 605 also has the ability to capture touch signals on or over the surface of the display screen 605. The touch signal may be input to the processor 601 as a control signal for processing. At this point, the display 605 may also be used to provide virtual buttons and/or a virtual keyboard, also referred to as soft buttons and/or a soft keyboard. In some embodiments, the display 605 may be one, providing the front panel of the electronic device 600; in other embodiments, the display 605 may be at least two, respectively disposed on different surfaces of the electronic device 600 or in a foldable design; in still other embodiments, the display 605 may be a flexible display disposed on a curved surface or on a folded surface of the electronic device 600. Even more, the display 605 may be arranged in a non-rectangular irregular pattern, i.e., a shaped screen. The Display 605 may be made of LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), and the like.
The camera assembly 606 is used to capture images or video. Optionally, camera assembly 606 includes a front camera and a rear camera. Generally, a front camera is disposed on a front panel of an electronic apparatus, and a rear camera is disposed on a rear surface of the electronic apparatus. In some embodiments, the number of the rear cameras is at least two, and each rear camera is any one of a main camera, a depth-of-field camera, a wide-angle camera and a telephoto camera, so that the main camera and the depth-of-field camera are fused to realize a background blurring function, and the main camera and the wide-angle camera are fused to realize panoramic shooting and VR (Virtual Reality) shooting functions or other fusion shooting functions. In some embodiments, camera assembly 606 may also include a flash. The flash lamp can be a monochrome temperature flash lamp or a bicolor temperature flash lamp. The double-color-temperature flash lamp is a combination of a warm-light flash lamp and a cold-light flash lamp, and can be used for light compensation at different color temperatures.
Audio circuitry 607 may include a microphone and a speaker. The microphone is used for collecting sound waves of a user and the environment, converting the sound waves into electric signals, and inputting the electric signals to the processor 601 for processing or inputting the electric signals to the radio frequency circuit 604 to realize voice communication. For stereo capture or noise reduction purposes, the microphones may be multiple and disposed at different locations of the electronic device 600. The microphone may also be an array microphone or an omni-directional pick-up microphone. The speaker is used to convert electrical signals from the processor 601 or the radio frequency circuit 604 into sound waves. The loudspeaker can be a traditional film loudspeaker or a piezoelectric ceramic loudspeaker. When the speaker is a piezoelectric ceramic speaker, the speaker can be used for purposes such as converting an electric signal into a sound wave audible to a human being, or converting an electric signal into a sound wave inaudible to a human being to measure a distance. In some embodiments, audio circuitry 607 may also include a headphone jack.
The positioning component 608 is used to locate a current geographic Location of the electronic device 600 to implement navigation or LBS (Location Based Service). The Positioning component 608 can be a Positioning component based on the united states GPS (Global Positioning System), the chinese beidou System, the russian graves System, or the european union's galileo System.
The power supply 609 is used to supply power to various components in the electronic device 600. The power supply 609 may be ac, dc, disposable or rechargeable. When the power supply 609 includes a rechargeable battery, the rechargeable battery may support wired or wireless charging. The rechargeable battery may also be used to support fast charge technology.
In some embodiments, the electronic device 600 also includes one or more sensors 610. The one or more sensors 610 include, but are not limited to: acceleration sensor 611, gyro sensor 612, pressure sensor 613, fingerprint sensor 614, optical sensor 615, and proximity sensor 616.
The acceleration sensor 611 may detect the magnitude of acceleration in three coordinate axes of a coordinate system established with the electronic device 600. For example, the acceleration sensor 611 may be used to detect components of the gravitational acceleration in three coordinate axes. The processor 601 may control the touch screen display 605 to display the user interface in a landscape view or a portrait view according to the gravitational acceleration signal collected by the acceleration sensor 611. The acceleration sensor 611 may also be used for acquisition of motion data of a game or a user.
The gyro sensor 612 may detect a body direction and a rotation angle of the electronic device 600, and the gyro sensor 612 and the acceleration sensor 611 may cooperate to acquire a 3D motion of the user on the electronic device 600. The processor 601 may implement the following functions according to the data collected by the gyro sensor 612: motion sensing (such as changing the UI according to a user's tilting operation), image stabilization at the time of photographing, game control, and inertial navigation.
The pressure sensor 613 may be disposed on a side bezel of the electronic device 600 and/or on an underlying layer of the touch display screen 605. When the pressure sensor 613 is disposed on a side frame of the electronic device 600, a user's holding signal of the electronic device 600 can be detected, and the processor 601 performs left-right hand recognition or shortcut operation according to the holding signal collected by the pressure sensor 613. When the pressure sensor 613 is disposed at the lower layer of the touch display screen 605, the processor 601 controls the operability control on the UI interface according to the pressure operation of the user on the touch display screen 605. The operability control comprises at least one of a button control, a scroll bar control, an icon control and a menu control.
The fingerprint sensor 614 is used for collecting a fingerprint of a user, and the processor 601 identifies the identity of the user according to the fingerprint collected by the fingerprint sensor 614, or the fingerprint sensor 614 identifies the identity of the user according to the collected fingerprint. Upon identifying that the user's identity is a trusted identity, the processor 601 authorizes the user to perform relevant sensitive operations including unlocking the screen, viewing encrypted information, downloading software, paying, and changing settings, etc. The fingerprint sensor 614 may be disposed on the front, back, or side of the electronic device 600. When a physical button or vendor Logo is provided on the electronic device 600, the fingerprint sensor 614 may be integrated with the physical button or vendor Logo.
The optical sensor 615 is used to collect the ambient light intensity. In one embodiment, processor 601 may control the display brightness of touch display 605 based on the ambient light intensity collected by optical sensor 615. Specifically, when the ambient light intensity is high, the display brightness of the touch display screen 605 is increased; when the ambient light intensity is low, the display brightness of the touch display screen 605 is turned down. In another embodiment, the processor 601 may also dynamically adjust the shooting parameters of the camera assembly 606 according to the ambient light intensity collected by the optical sensor 615.
Proximity sensor 616, also referred to as a distance sensor, is typically disposed on the front panel of electronic device 600. The proximity sensor 616 is used to capture the distance between the user and the front of the electronic device 600. In one embodiment, when the proximity sensor 616 detects that the distance between the user and the front face of the electronic device 600 gradually decreases, the processor 601 controls the touch display screen 605 to switch from the bright screen state to the dark screen state; when the proximity sensor 616 detects that the distance between the user and the front surface of the electronic device 600 gradually becomes larger, the processor 601 controls the touch display screen 605 to switch from the breath screen state to the bright screen state.
Those skilled in the art will appreciate that the configuration shown in fig. 6 does not constitute a limitation of the electronic device 600, and may include more or fewer components than those shown, or combine certain components, or employ a different arrangement of components.
Fig. 7 is a schematic structural diagram of an electronic device provided in an embodiment of the present application, where the electronic device may be provided as a server, and the electronic device 700 may generate a relatively large difference due to different configurations or performances, and may include one or more processors (CPUs) 701 and one or more memories 702, where the memory 702 stores at least one instruction, and the at least one instruction is loaded and executed by the processor 701 to implement the methods provided by the foregoing method embodiments. Of course, the electronic device may further have components such as a wired or wireless network interface, a keyboard, and an input/output interface, so as to perform input/output, and the electronic device may further include other components for implementing the functions of the device, which is not described herein again.
In an exemplary embodiment, a computer-readable storage medium, such as a memory, including instructions executable by a processor to perform the value integration method in the above embodiments is also provided. For example, the computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a Compact Disc Read-Only Memory (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, and the like.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (15)

1. A method for numerical integration, applied to any node device in a blockchain system, the method comprising:
obtaining non-spent transaction output UTXO information of a target account from an account table of the blockchain system;
when the UTXO in the target account is determined to meet a numerical value integration condition according to the UTXO information, determining a first number of UTXOs to be transferred out and a second number of UTXOs to be transferred in the target account according to the UTXO information and a numerical value integration rule, wherein the second number is smaller than the first number;
generating a numerical value integration request, and generating a block based on the numerical value integration request;
sending the block to other node equipment in the block chain system, and performing consensus on the block;
adding the block to a chain of blocks when the block passes consensus;
converting the first number of UTXOs in the target account to the second number of UTXOs in an account table in the blockchain system.
2. The method of claim 1, wherein obtaining UTXO information for a target account from an account table of the blockchain system comprises:
acquiring UTXO information of the target account from an account table of the blockchain system according to the index information of the target account; wherein the index information is an account address of the target account; or, the index information is a transaction hash value.
3. The method of claim 1, wherein the UTXO in the target account is compliant with a value integration condition comprising:
the number of UTXOs in the target account is greater than a first number threshold; or the number of UTXOs in the target account with the denomination less than the denomination threshold is greater than a second quantity threshold; or the UTXO in the target account occupies a storage space larger than a preset capacity.
4. The method of claim 1, wherein determining a first number of UTXOs to be rolled out and a second number of UTXOs to be rolled in from the target account based on the UTXO information and a value integration rule comprises:
all UTXOs in the target account are used as the first quantity of UTXOs to be transferred out, and the sum of the denominations of the second quantity of UTXOs is determined according to the sum of the denominations of the first quantity of UTXOs; or the like, or, alternatively,
using the UTXO with the denomination smaller than the denomination threshold value in the target account as a first quantity of UTXOs, and determining the sum of the denominations of the second quantity of UTXOs according to the sum of the denominations of the first quantity of UTXOs; or the like, or, alternatively,
according to the historical transaction information of the target account, using the UTXO in a first denomination range in the target account as a first quantity of UTXOs, and using the UTXOs in a second denomination range as a second quantity of UTXOs, wherein the first denomination range is the denomination range of the UTXOs with the transaction input frequency smaller than a first frequency threshold value in the historical transaction information, and the second denomination range is the denomination range of the UTXOs with the transaction input frequency larger than a second frequency threshold value in the historical transaction information;
wherein determining the sum of the denominations of the second number of UTXOs from the sum of the denominations of the first number of UTXOs further comprises:
and determining the maximum value in each denomination range as the denomination of the second number of UTXOs according to the denomination range to which the denomination of each UTXO in the target account belongs, wherein the second number is one or is more than one.
5. The method of claim 1, wherein the first number of UTXOs and the second number of UTXOs have a same sum of denominations.
6. The method of claim 1 wherein the sum of the denominations of the first number of UTXOs is a sum of the denominations of the second number of UTXOs and a preset denomination;
the method further comprises the following steps:
and when the block passes the consensus, adding UTXO with the denomination of the preset denomination in the account table in the account of the block chain system.
7. The method of claim 1, further comprising:
receiving a value integration request sent by an electronic device, wherein the value integration request is used for indicating that a first amount of unspent transaction output UTXO in a target account is converted into a second amount of UTXO, and the value integration request is triggered by the fact that the UTXO in the target account meets a value integration condition;
generating a block based on the numerical integration request, and commonly identifying the block, wherein the block comprises the content of the numerical integration request;
adding the block to a chain of blocks when the block passes consensus;
converting the first number of UTXOs in the target account to the second number of UTXOs in an account table of a blockchain system.
8. The method according to claim 7, wherein the value integration request sent by the electronic device carries a key of the target account, and the key is a unique key of the target account provided by a user device; or, the key is a key provided by the user equipment and having the partial authority of the target account.
9. The method of claim 7, wherein after converting the first number of UTXOs in the target account to the second number of UTXOs in an account table of a blockchain system, the method further comprises:
and when the blocks pass the consensus, sending an integration success message to the electronic equipment.
10. A value integration apparatus, comprising:
the acquisition module is used for acquiring the unconsumed transaction output UTXO information of the target account from the account table of the blockchain system;
the obtaining module is further configured to determine, according to the UTXO information and a value integration rule, a first number of UTXOs to be transferred out and a second number of UTXOs to be transferred in the target account when it is determined that the UTXOs in the target account conform to a value integration condition according to the UTXO information, where the second number is smaller than the first number;
the consensus module is used for generating a numerical integration request and generating a block based on the numerical integration request;
the consensus module is further configured to send the block to other node devices in the blockchain system, and perform consensus on the block;
an adding module, configured to add the block to a block chain when the block passes consensus;
a value integration module to convert the first number of UTXOs in the target account to the second number of UTXOs in an account table in the blockchain system.
11. The apparatus of claim 10, wherein the obtaining module is configured to:
acquiring UTXO information of the target account from an account table of the blockchain system according to the index information of the target account; wherein the index information is an account address of the target account; or, the index information is a transaction hash value.
12. The apparatus of claim 10, wherein the UTXO in the target account is compliant with a value integration condition comprising:
the number of UTXOs in the target account is greater than a first number threshold; or the number of UTXOs in the target account with the denomination less than the denomination threshold is greater than a second quantity threshold; or the UTXO in the target account occupies a storage space larger than a preset capacity.
13. A blockchain system, comprising a plurality of node devices, wherein any node device of the plurality of node devices is configured to perform the operations performed by the value integration method of any one of claims 1 to 9.
14. A node device, comprising one or more processors and one or more memories having stored therein at least one instruction that is loaded and executed by the one or more processors to perform an operation performed by the value integration method of any of claims 1 to 9.
15. A computer-readable storage medium having stored therein at least one instruction, which is loaded and executed by a processor to perform operations performed by the value integration method of any one of claims 1 to 9.
CN201910672709.9A 2018-06-20 2018-06-20 Numerical value integration method, device, system, node equipment and storage medium Active CN110378678B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910672709.9A CN110378678B (en) 2018-06-20 2018-06-20 Numerical value integration method, device, system, node equipment and storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910672709.9A CN110378678B (en) 2018-06-20 2018-06-20 Numerical value integration method, device, system, node equipment and storage medium
CN201810635826.3A CN108805560B (en) 2018-06-20 2018-06-20 Numerical value integration method and device, electronic equipment and computer readable storage medium

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
CN201810635826.3A Division CN108805560B (en) 2018-06-20 2018-06-20 Numerical value integration method and device, electronic equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN110378678A CN110378678A (en) 2019-10-25
CN110378678B true CN110378678B (en) 2021-06-29

Family

ID=64083625

Family Applications (2)

Application Number Title Priority Date Filing Date
CN201910672709.9A Active CN110378678B (en) 2018-06-20 2018-06-20 Numerical value integration method, device, system, node equipment and storage medium
CN201810635826.3A Active CN108805560B (en) 2018-06-20 2018-06-20 Numerical value integration method and device, electronic equipment and computer readable storage medium

Family Applications After (1)

Application Number Title Priority Date Filing Date
CN201810635826.3A Active CN108805560B (en) 2018-06-20 2018-06-20 Numerical value integration method and device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (2) CN110378678B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109360101A (en) * 2018-12-18 2019-02-19 百度在线网络技术(北京)有限公司 A kind of block chain transaction processing method, device, equipment and medium
MY192336A (en) 2019-07-23 2022-08-17 Advanced New Technologies Co Ltd Managing transactions on blockchain networks
CN110687821B (en) * 2019-11-14 2021-10-29 腾讯科技(深圳)有限公司 Intelligent home control system and method based on block chain
CN111027947B (en) * 2019-12-06 2023-09-19 湖北文理学院 UTXO wallet selection method, device, storage medium and device
CN111161071A (en) * 2019-12-30 2020-05-15 致信互链(北京)科技有限公司 Data processing method, device, equipment and storage medium based on block chain
CN111598571A (en) * 2020-07-20 2020-08-28 百度在线网络技术(北京)有限公司 Transaction processing method, device, equipment and storage medium of block chain
CN112115498B (en) * 2020-09-28 2023-12-01 上海申铁信息工程有限公司 Data access authority control method and device based on blockchain
CN113409140A (en) * 2021-05-27 2021-09-17 卓尔智联(武汉)研究院有限公司 Block chain data processing method and device, computer equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107369084A (en) * 2017-06-26 2017-11-21 中国人民银行数字货币研究所 A kind of settlement method and system of interbank digital cash
CN108171511A (en) * 2017-12-26 2018-06-15 陈晶 A kind of block chain model with privacy protection function

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU2016246428B2 (en) * 2015-04-05 2017-11-09 Digital Asset (Switzerland) GmbH Digital asset intermediary electronic settlement platform
US20170091726A1 (en) * 2015-09-07 2017-03-30 NXT-ID, Inc. Low bandwidth crypto currency transaction execution and synchronization method and system
US11941588B2 (en) * 2015-11-06 2024-03-26 Cable Television Laboratories, Inc. Systems and methods for blockchain virtualization and scalability
US10529042B2 (en) * 2016-04-18 2020-01-07 Rs Ltd. System and method for managing transactions in dynamic digital documents
CN106982205B (en) * 2017-03-01 2020-05-19 中钞信用卡产业发展有限公司杭州区块链技术研究院 Block chain-based digital asset processing method and device
CN106920169A (en) * 2017-03-07 2017-07-04 中钞信用卡产业发展有限公司北京智能卡技术研究院 A kind of digital ticket method of commerce and system based on block chain and digital cash
CN107358525B (en) * 2017-06-26 2021-05-25 中国人民银行数字货币研究所 Account transaction method and device
CN107392608B (en) * 2017-07-11 2020-07-07 北京博晨技术有限公司 Block chain system-based digital asset transaction method and block chain system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107369084A (en) * 2017-06-26 2017-11-21 中国人民银行数字货币研究所 A kind of settlement method and system of interbank digital cash
CN108171511A (en) * 2017-12-26 2018-06-15 陈晶 A kind of block chain model with privacy protection function

Also Published As

Publication number Publication date
CN108805560B (en) 2021-12-14
CN108805560A (en) 2018-11-13
CN110378678A (en) 2019-10-25

Similar Documents

Publication Publication Date Title
CN110378678B (en) Numerical value integration method, device, system, node equipment and storage medium
CN109615516B (en) Resource transfer method, device, electronic equipment and storage medium
CN110674022B (en) Behavior data acquisition method and device and storage medium
CN109615515B (en) Credit right certificate transfer method, device, electronic equipment and storage medium
CN111083516B (en) Live broadcast processing method and device
CN111190748B (en) Data sharing method, device, equipment and storage medium
CN111241115B (en) Data synchronization method, device, equipment and storage medium
CN110942308A (en) Resource transfer method, device, computer equipment and storage medium
CN110290191B (en) Resource transfer result processing method, device, server, terminal and storage medium
CN115766490A (en) Calibration data acquisition method, calibration data storage method, device and equipment
CN111523878A (en) Service processing method, device, system and storage medium
CN112036887A (en) Resource transfer method, device, equipment and storage medium
CN111198922A (en) Game resource management method and device based on block chain
CN110990728A (en) Method, device and equipment for managing point of interest information and storage medium
CN110825465A (en) Log data processing method and device, electronic equipment and storage medium
CN110597840A (en) Partner relationship establishing method, device, equipment and storage medium based on block chain
CN110891086B (en) Resource transfer method, device, terminal, server and storage medium
CN110971692B (en) Method and device for opening service and computer storage medium
CN111191254B (en) Access verification method, device, computer equipment and storage medium
CN111131619B (en) Account switching processing method, device and system
CN112765571A (en) Authority management method, system, device, server and storage medium
CN111681098A (en) Resource transfer method, device, server and computer readable storage medium
CN111490979B (en) Information interaction method and device and storage medium
CN113919864A (en) Electronic bill issuing method, device, equipment and storage medium
CN113935740A (en) Method, device, terminal and storage medium for transmitting check information

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40016174

Country of ref document: HK

GR01 Patent grant
GR01 Patent grant