CN108898368B - Resource transfer method and device, storage medium and electronic device - Google Patents

Resource transfer method and device, storage medium and electronic device Download PDF

Info

Publication number
CN108898368B
CN108898368B CN201810581536.5A CN201810581536A CN108898368B CN 108898368 B CN108898368 B CN 108898368B CN 201810581536 A CN201810581536 A CN 201810581536A CN 108898368 B CN108898368 B CN 108898368B
Authority
CN
China
Prior art keywords
target
sub
address
addresses
resource
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
CN201810581536.5A
Other languages
Chinese (zh)
Other versions
CN108898368A (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 CN201910697208.6A priority Critical patent/CN110428237B/en
Priority to CN201810581536.5A priority patent/CN108898368B/en
Publication of CN108898368A publication Critical patent/CN108898368A/en
Application granted granted Critical
Publication of CN108898368B publication Critical patent/CN108898368B/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/08Payment architectures
    • G06Q20/10Payment architectures specially adapted for electronic funds transfer [EFT] systems; specially adapted for home banking systems
    • 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
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Landscapes

  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Technology Law (AREA)
  • Marketing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The invention discloses a resource transfer method and device, a storage medium and an electronic device. Wherein, the method comprises the following steps: acquiring a uplink request of a target account, wherein the uplink request is used for requesting a node in a block chain to execute a target task; responding to the uplink request, and allocating unallocated target sub-addresses in a plurality of sub-addresses of the target account to the target task, wherein each sub-address in the plurality of sub-addresses is used for storing partial resources in the resource address of the target account; and under the condition that the node in the block chain executes the target task, transferring a first resource consumed by executing the target task to the node in the block chain, wherein the first resource is a resource stored by the target sub-address. The invention solves the technical problem that the uplink operation cannot be executed when the block chain address fails in the related art.

Description

Resource transfer method and device, storage medium and electronic device
Technical Field
The invention relates to the field of internet, in particular to a resource transfer method and device, a storage medium and an electronic device.
Background
The Blockchain (Blockchain) is a string of data blocks generated by using a cryptography method, and each data block contains information of bitcoin network transaction, and is used for verifying the validity of the information and generating the next block. Miners can run corresponding software on special hardware to generate virtual digital currency such as bitcoin, Ethernet and the like. The mining software listens to the transaction broadcasts over the P2P network and performs the appropriate tasks to process and confirm the transactions. In a network based on blockchain technology, miners doing this work can earn transaction commission fees paid by users to expedite transaction processing and virtual digital currency, otherwise known as blockchain tokens, accrued by fixed formulas.
A blockchain token is a more important part of a blockchain system. The essence of a blockchain token transaction is a data structure containing information about the value transfer of the blockchain token transaction participants. Blockchain token blockchains are global compound accounting ledgers, with each blockchain token transaction being a public record on the blockchain. The basic unit of a Transaction may be an unused Transaction Output (UTXO), which is a certain amount of blockchain tokens that are locked or recorded in the blockchain by the owner. When a user receives a blockchain token, the amount is recorded as UTXO in the blockchain. Thus, a user's blockchain tokens may be dispersed as UTXOs over multiple transactions and multiple blocks. In fact, there is no place to store the address or account balance of the blockchain token, only a scattered UTXO that is locked by the owner. The UTXO consumed by the transaction is referred to as the transaction input and the UTXO created by the transaction is referred to as the transaction output. In this way, a certain amount of blockchain token value is transferred between different owners and the UTXO is consumed and created in the transaction. A transaction unlocks the UTXO using the owner's signature and locks and creates the UTXO using the new owner's bitcoin address.
With the block chain of the UTXO model, since each user has only one commission TOKEN (the commission account allocated to the user by the block chain is generally a block chain address, and there is a commission UTXO available below), in case that the block chain address is attacked, and has a fault, the related operations (such as uplink operation and transaction operation) of the user cannot be executed.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
Embodiments of the present invention provide a resource transfer method and apparatus, a storage medium, and an electronic apparatus, so as to at least solve the technical problem in the related art that an uplink operation cannot be performed when a block chain address fails.
According to an aspect of the embodiments of the present invention, there is provided a resource transfer method, including: acquiring a uplink request of a target account, wherein the uplink request is used for requesting a node in a block chain to execute a target task; responding to the uplink request, and allocating unallocated target sub-addresses in a plurality of sub-addresses of the target account to the target task, wherein each sub-address in the plurality of sub-addresses is used for storing partial resources in the resource address of the target account; and under the condition that the node in the block chain executes the target task, transferring a first resource consumed by executing the target task to the node in the block chain, wherein the first resource is a resource stored by the target sub-address.
According to an aspect of the embodiments of the present invention, there is also provided a resource transfer apparatus, including: an obtaining unit, configured to obtain an uplink request of a target account, where the uplink request is used to request a node in a block chain to execute a target task; the allocation unit is used for responding to the uplink request, and allocating the unallocated target sub-address in the plurality of sub-addresses of the target account to the target task, wherein each sub-address in the plurality of sub-addresses is used for storing partial resources in the resource address of the target account; and the transfer unit is used for transferring a first resource consumed by the execution of the target task to the node in the block chain under the condition that the node in the block chain executes the target task, wherein the first resource is a resource stored by the target sub-address.
According to an aspect of the embodiments of the present invention, there is also provided a storage medium including a stored program which, when executed, performs the above-described method.
According to an aspect of the embodiments of the present invention, there is also provided an electronic apparatus, including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the above method through the computer program.
In the embodiment of the invention, when acquiring the uplink request of the target account, the unallocated target sub-address in the plurality of sub-addresses of the target account is allocated to the target task, and each sub-address in the plurality of sub-addresses is used for storing partial resources in the resource address of the target account; under the condition that a node in a block chain executes a target task, transferring a first resource consumed by executing the target task to the node in the block chain, wherein the first resource is a resource stored by a target sub-address, namely a plurality of sub-addresses are obtained by splitting a resource address (namely a block chain address of a commission TOKEN), and each sub-address is used for storing partial resources.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
FIG. 1 is a schematic diagram of a hardware environment for a method of transferring resources according to an embodiment of the invention;
FIG. 2 is a flow diagram of an alternative resource transfer method according to an embodiment of the invention;
FIG. 3 is a schematic diagram of an alternative resource split according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of an alternative resource split according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of an alternative resource split according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of an alternative resource split according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of an alternative resource address according to an embodiment of the invention;
FIG. 8 is a schematic diagram of an alternative resource split in accordance with an embodiment of the present invention;
FIG. 9 is a flow diagram of an alternative resource transfer method according to an embodiment of the invention;
FIG. 10 is a schematic diagram of an alternative resource transfer apparatus according to an embodiment of the invention;
and
fig. 11 is a block diagram of a terminal according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
First, partial terms or terms appearing in the description of the embodiments of the present invention are applied to the following explanations:
blockchain (Blockchain): is an important concept of the bitcoin, which is essentially a decentralized database and simultaneously serves as the bottom layer technology of the bitcoin. The block chain is a string of data blocks which are generated by using a cryptographic method in a correlation mode, and each data block contains information of bitcoin network transaction, so that the validity (anti-counterfeiting) of the information is verified and the next block is generated.
According to an aspect of the embodiments of the present invention, a method embodiment of a resource transfer method is provided.
Optionally, in this embodiment, the resource transfer method may be applied to a hardware environment formed by the blockchain 101 shown in fig. 1, optionally, the hardware environment may further include a terminal 103, as shown in fig. 1, where the terminal 103 is connected to the blockchain 101 through a network, where the network includes but is not limited to: the terminal 103 is not limited to a PC, a mobile phone, a tablet computer, a server, etc.
The resource transfer method according to the embodiment of the present invention may be performed by a node device (also referred to as a node, such as node a to node K) in the blockchain 101, and the node device executing the method may be denoted as a first node (such as node a).
Fig. 2 is a flowchart of an alternative resource transfer method according to an embodiment of the present invention, and as shown in fig. 2, the method may include the following steps:
step S202, the first node obtains an uplink request of the target account, where the uplink request is used to request a node in the block chain to execute a target task.
The nodes in the blockchain 101 may be specific hardware devices (e.g., PCs, mobile phones, tablets, servers, blades, etc.), or may be virtual devices (e.g., virtual machines).
The target account is used for representing a user and is an account used on the first node or the terminal; the uplink request is used for requesting a node in a block chain to execute a target task, specifically, the node executing the target task can be marked as a second node, the target task is the uplink task requested to be executed by the uplink request, the uplink task is different along with different fields of landing of the block chain, and if the block chain is used in a game field, the uplink task can refer to a virtual article, a prop and the like in an uplink game; if the blockchain is used in the e-commerce domain, the uplink task may refer to the goods, services, etc. of the uplink, and the rest of the domains are similar, not to mention one example.
Step S204, in response to the uplink request, the first node allocates an unallocated target sub-address of the plurality of sub-addresses of the target account to the target task, where each sub-address of the plurality of sub-addresses is used to store a part of resources in the resource address of the target account.
The resource address of the target account number is the address used for storing the resource of the token, the token can be represented by UTXO, UTXO is the output of the uneconomical transaction and is a core concept of token transaction generation and verification, the transactions form a group of chain structures, the legal transactions can be traced back to the output of one or more forward transactions, the source of the chain can be the mine digging reward, and the tail end is the output of the current uneconomical transaction.
Under the scheme based on the UTXO model, due to the characteristic that UTXO can only use once but does not exist, a single-hand charging address is used, a user cannot perform concurrent transactions, and the execution of the uplink task is influenced when the resource address fails, the technical scheme of the application can be adopted to solve the problems, in the technical scheme of the application, the UTXO model uses a single-hand charging address (namely the resource address) of the user to split the single-hand charging address into N sub-charging addresses (namely a plurality of sub-addresses), wherein N is larger than or equal to the expected concurrent number of tasks, then the plurality of sub-addresses are written into a message queue, a user takes out the sub-charging addresses before each transaction to perform uplink operation (namely to perform uplink tasks), after the uplink operation, whether the residual amount can satisfy the next transaction is judged, if the residual amount can satisfy the next transaction, if the residual amount can be written back into the message queue, if the residual amount cannot be written back into the recycle address, the recovery address can be reused, and UTXO of the recovery address is combined periodically and written back to the address of the sub-commission account; since the selected target sub-address is always usable (in other words, when an error occurs to one sub-address, the remaining usable sub-addresses are selected), and the non-allocated sub-addresses (in other words, the non-allocated sub-addresses can be allocated for use, and if the uplink tasks are concurrent, the corresponding sub-addresses can be respectively selected for the concurrent tasks), the problem that the user cannot concurrently transact due to a single-handed charging address, and the execution of the uplink task is affected when the resource address fails can be solved.
Step S206, when the second node in the block chain completes executing the target task, the first node transfers the first resource consumed by executing the target task to the second node in the block chain, where the first resource is a resource stored in the target sub-address. I.e., the corresponding token (i.e., the first resource) is awarded after the second node performs the uplink task.
The resource transfer method according to the embodiment of the present invention may be executed by a node in the blockchain 101, or may be executed by the terminal 103, and the difference from the foregoing embodiment is only that the execution subject is replaced by a node in the blockchain, or may be executed by the terminal 103 and a node in the blockchain 101 together, for example, the terminal 103 executes one or two steps of step S202 to step S206, and the node in the blockchain 101 executes the remaining steps. The terminal 103 may execute the resource transfer method according to the embodiment of the present invention by a client installed thereon.
Through the above steps S202 to S206, when acquiring the uplink request of the target account, allocating an unallocated target sub-address in the plurality of sub-addresses of the target account to the target task, where each sub-address in the plurality of sub-addresses is used to store a part of resources in the resource address of the target account; under the condition that a node in a block chain executes a target task, transferring a first resource consumed by executing the target task to the node in the block chain, wherein the first resource is a resource stored by a target sub-address, namely a plurality of sub-addresses are obtained by splitting a resource address (namely a block chain address of a commission TOKEN), and each sub-address is used for storing partial resources.
In the block chain based on the UTXO model, the commission fee needs to be added to the UTXO model of the transaction, and since the Hash of UTXO changes every time the UTXO is used, in other words, the commission fee TOKEN changes every time the UTXO is used, the use of the commission fee can only be operated serially, and the transaction of the user cannot be executed concurrently. Taking the game as an example, if there is an article to be linked in the game, a transaction needs to be made on the chain, and since the linking operation needs to consume a handling fee, a handling fee is added at this time, but since there is generally only one handling fee TOKEN, the amount of concurrency is limited by the number of the handling fee TOKEN, and each transaction (i.e. each linking task) can only be executed in series, resulting in a reduction in the linking speed.
By adopting the technical scheme of the application, the problem existing in the block chain based on the UTXO model can be solved through the following scheme, and before the uplink request of the target account is acquired, the resources in the resource address of the target account are divided into a plurality of second resources; creating a plurality of sub-addresses for storing the plurality of split second resources, and storing the plurality of sub-addresses into an address list, wherein the plurality of sub-addresses are used for providing resources required to be consumed for tasks executed in parallel, and the tasks executed in parallel are tasks with overlapped execution time, and the overlapped execution time can be understood as a situation that the execution time is partially crossed or completely overlapped; each of the plurality of second resources is stored to a corresponding one of the plurality of sub-addresses, such that the plurality of sub-addresses can be utilized to handle concurrent transactions.
When splitting the resource in the resource address of the target account into a plurality of second resources, the splitting manner includes, but is not limited to, the following manners:
1) in the first mode, splitting is performed according to a fixed resource value, as shown in fig. 3, a background dotted rectangle is used to represent a resource in a resource address, the resource may be split according to the fixed resource value and split into a plurality of second resources S1 to Sn, if the resource in the resource address cannot be divided by the fixed resource value, the remainder between the resource in the resource address and the fixed resource value may be used as a second resource (e.g., Sn);
2) in the second mode, splitting is performed according to the fixed number of the shares, as shown in fig. 4, if the expected number of the shares is N, the value of each resource is a quotient between the resource in the resource address and the expected number of the shares N;
3) in a third way, splitting is performed according to the task number of the current target task, as shown in fig. 5, if the current task number is m, resources in the resource address can be equally divided into m parts; as shown in fig. 6, m second resources may be split from the resources of the resource address according to the amount of resources that each target task needs to consume, in other words, for each target task, the split second resources are actually split.
The resource address is the commission fee token address allocated to the user, and the sub-address can be called as a sub-commission fee address and is a receiving address for splitting the commission fee by the user.
In the technical solution provided in step S202, the first node obtains an uplink request of the target account, where the uplink request is used to request a node in the block chain to execute a target task, and for the received target task, the number of concurrences can be infinitely increased, and multiple target tasks can be executed in parallel, thereby increasing the uplink speed. The technical scheme of the application is suitable for the scenes of games, e-commerce and the like needing concurrent chaining, and ensures efficient chaining operation.
In the technical solution provided in step S204, in response to the uplink request, the first node allocates an unallocated target sub-address of the plurality of sub-addresses of the target account to the target task, where each sub-address of the plurality of sub-addresses is used to store a part of resources in the resource address of the target account.
In an alternative embodiment, assigning the unassigned target sub-address from the plurality of sub-addresses of the target account to the target task may comprise: under the condition that one target task is selected, one target sub-address is selected and distributed for the target task from an address list, and the address list is used for storing a plurality of sub-addresses; and under the condition that the number of the target tasks is multiple, selecting and distributing a plurality of unallocated target sub-addresses for the plurality of target tasks from the address list, wherein each target task is distributed with a corresponding target sub-address.
In the above embodiment, selecting and allocating a plurality of target sub-addresses for a plurality of target tasks from the address list may include: in the case that the execution time of at least two target tasks of the multiple target tasks overlap, in other words, the at least two target tasks are uplink tasks executed in parallel, at this time, at least two target sub-addresses which are not currently allocated may be selected from the address list and allocated to the at least two target tasks, where the current non-allocation refers to sub-addresses which are not allocated to other tasks before the at least two target tasks are executed (may be sub-addresses which are not allocated, or sub-addresses which are recovered after being used).
In yet another alternative embodiment, selecting and allocating the target sub-address for the target task includes, but is not limited to, the following two implementation manners:
one is that when a plurality of target sub-addresses are selected and allocated for a plurality of target tasks from AN address list, the plurality of target sub-addresses are selected from the address list according to a target sequence, and the plurality of target sub-addresses are allocated to the plurality of target tasks, one sub-address of the plurality of target sub-addresses is a sub-address next to a sub-address selected according to the target sequence last time, as shown in fig. 7, sub-addresses corresponding to resources S1 to SN are a1 to AN, respectively, and if the sub-address selected last time is A3, the sub-address corresponding to the number of tasks of the plurality of target tasks is selected from a4 at this time of selection.
Secondly, when the target sub-address which is not allocated in the plurality of sub-addresses of the target account is allocated to the target task, the target sub-address is selected according to the amount of the resource which needs to be consumed, and the first resource amount of the first resource which needs to be consumed by the second node in the block chain system for executing the target task can be acquired; and allocating the target sub-address of which the second resource amount of the resources stored in the plurality of sub-addresses is larger than the first resource amount to the target task.
In the above embodiment, in order to utilize the token resources of each sub-address to the maximum extent, when the target sub-address, in which the second resource amount of the resources stored in the plurality of sub-addresses is greater than the first resource amount, is allocated to the target task, the second resource amount of the resources stored in each of the plurality of sub-addresses may be acquired respectively; obtaining a difference value between a second resource amount and a first resource amount of each sub-address in the plurality of sub-addresses; obtaining a target difference value in a plurality of difference values of a plurality of sub-addresses, wherein the target difference value is the difference value which has the smallest value and is a positive number in the plurality of difference values; and allocating a target sub-address corresponding to the target difference value in the plurality of sub-addresses to the target task.
In the above embodiment, as shown in fig. 8, the resources in the sub-addresses in the address list may be pre-split in the foregoing embodiment, or may be re-optimized in the process of performing the uplink task (since the sub-addresses of the resources that are not consumed during the use process may be restored back to the address list, the resource amount of each sub-address in the list is relatively large, or the number of the sub-addresses is too small, and optimization is needed), an optional optimization manner is as follows: after acquiring the uplink request of the target account, recovering second resources stored on the subaddresses in the address list under the condition that the number i of the subaddresses stored in the address list is less than the number of the target tasks before selecting and allocating a plurality of target subaddresses for the target tasks from the address list; splitting the recycled second resource into a plurality of third resources (for example, j is larger than i), configuring a sub-address for each third resource in the plurality of third resources, and storing the reconfigured sub-address into an address list, wherein the number of the sub-addresses of the plurality of third resources is not less than the number of the plurality of target tasks. Through the optimization, the requirement of transaction concurrency can be met, and at the moment, when a plurality of target sub-addresses are selected and distributed for a plurality of target tasks from the address list, the reconfigured sub-addresses can be selected and distributed for the plurality of target tasks from the address list.
In the technical solution provided in step S206, when the second node in the block chain completes executing the target task, the first node transfers the first resource consumed by completing executing the target task to the second node in the block chain, where the first resource is a resource stored in the target sub-address.
In the above embodiment, after transferring the first resource consumed by executing the target task to the node in the block chain, in the case that the difference between the resource amount of the resource held by the target sub-address and the first resource amount of the first resource is greater than the target threshold, the target sub-address is held back to the address list; and under the condition that the difference value between the resource quantity of the resource stored in the target sub-address and the first resource quantity is not larger than the target threshold value, recovering the resource left after the first resource is deducted from the target sub-address, wherein the recovered resource is used for re-splitting and distributing the corresponding sub-address.
By adopting the technical scheme of the application, a single-hand charging address can be firstly split into N sub-charging addresses, N is larger than the expected concurrent number of times, then the N is written into a message queue (namely an address list), a user takes out the charging sub-address before each transaction, performs chain winding operation, judges whether the residual amount (or called resource amount) can meet the target threshold value required by the next transaction after the chain winding operation, and writes the residual amount (or called resource amount) into a recovery address (namely a charging back address of the charging back with insufficient transaction amount) if the residual amount (or called resource amount) can meet the target threshold value required by the next transaction. The recovery address can be reused, and the UTXO of the recovery address is merged periodically and written back to the address of the sub-commission account.
As an alternative embodiment, the technical solution of the present application is described in detail below. As shown in fig. 9:
in step S901, the splitting module (which is provided with a splitting program for executing the method of the present application) obtains the user commission address.
In the scenes of e-commerce, games and the like, the method can be stored on the terminal and the first node in the form of software modules (such as a splitting module and a transaction module) for running. Before the transaction is carried out, the splitting of the commission TOKEN can be realized through the splitting module.
In step S902, the first device (which stores the commission address) returns the commission address to the splitting module.
Step S903, assembling a split request (for requesting to split the commission fee address into N), and sending the split request to the first device.
In step S904, the first device splits the commission address into N sub-commission addresses, and stores the commission addresses in the second device (the first device and the second device may be the same device or different devices).
In step S905, the splitting module writes the splitting result into a message queue (i.e., an address list).
In step S906, the transaction module requests to obtain an available commission fee from the message queue before the transaction.
For example, when a game character, a game prop and the like need to be put on the shelf in a game and goods and services need to be put on the shelf in an e-market scene, an available commission charge can be requested from a message queue to meet the demand of putting on the shelf.
In step S907, the message queue returns an available commission, or a sub-commission address for the commission.
In step S908, the transaction module performs a transaction using the available commission.
In step S909, the consumed commission fee is deducted from the available commission fee, and if the remaining commission fee is available for the next use, the message queue is written back again.
In step S910, if the remaining commission is not enough for the next use, the recycle address is written back.
In step S911, the recycling module periodically queries the commission fees TOKEN to be recycled.
Step S912, combine the collected commission TOKEN and store the combined commission TOKEN to a sub-commission address.
The recovery address can be reused, and the UTXO in the recovery address is merged periodically and written back to the sub-commission address. The merging method is to do a transaction of a block chain, the input of the transaction is scattered commission UTXO in the recovery address, and the output is the commission address.
In step S913, the sub-commission address of the combined commission TOKEN is written into the message queue.
In step S914, the splitting module checks regularly whether the available handling fee amount in the message queue meets the requirement of the task concurrency amount, and if not, continues splitting to ensure the reliability of the transaction.
The scheme can firstly split a single-hand charge address into N sub-charge TOKEN (N is an expected concurrent number), the splitting method is to do a transaction of a block chain, the input of the transaction is the charge TOKEN, and the output is N sub-charges. After successful splitting, writing the split sub-commission UTXO into a message queue, taking out the commission sub-address by the user before each transaction, carrying out chain winding operation, after the chain winding operation, judging whether the residual amount is less than a recovery threshold (the threshold can be set by the user, for example, the maximum commission amount of one transaction is set), if so, writing back the message queue, and if not, writing into the recovery address.
Because the original UTXO does not exist after the UTXO is used, a new UTXO can be generated, so that the UTXO can only carry out serial transaction, and the user processing concurrency difficulty is higher in the scenes of games, e-commerce and the like which need large concurrent use of the commission TOKEN. In the technical scheme of the application, any large concurrency number can be supported, namely the concurrency number is realized by controlling the splitting number N; the reliability guarantee is strong, the TOKEN of the sub-commission charge is used only once, and the sub-commission charge is written back to the message queue after being successful, so that the commission charge taken by each transaction is available; the method can deal with the large concurrency of sudden increase, and if the sub-commission account is not available, the sub-commission account can be continuously split to ensure that the transaction can be carried out.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required by the invention.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
According to another aspect of the embodiment of the present invention, there is also provided a resource transfer apparatus for implementing the resource transfer method. Fig. 10 is a schematic diagram of an alternative resource transfer apparatus according to an embodiment of the present invention, and as shown in fig. 10, the apparatus may include: an acquisition unit 1001, a distribution unit 1003, and a transfer unit 1005.
An obtaining unit 1001 is configured to obtain an uplink request of a target account, where the uplink request is used to request a node in a block chain to execute a target task.
The nodes in the blockchain 101 may be specific hardware devices (e.g., PCs, mobile phones, tablets, servers, blades, etc.), or may be virtual devices (e.g., virtual machines).
The target account is used for representing a user and is an account used on the first node or the terminal; the uplink request is used for requesting a node in a block chain to execute a target task, specifically, the node executing the target task can be marked as a second node, the target task is the uplink task requested to be executed by the uplink request, the uplink task is different along with different fields of landing of the block chain, and if the block chain is used in a game field, the uplink task can refer to a virtual article, a prop and the like in an uplink game; if the blockchain is used in the e-commerce domain, the uplink task may refer to uplink goods, services, etc., and the rest of the domains are similar, not to mention one example.
An allocating unit 1003, configured to allocate, in response to the uplink request, an unallocated target sub-address from among multiple sub-addresses of the target account to the target task, where each sub-address from among the multiple sub-addresses is used to store a part of resources in the resource address of the target account.
The resource address of the target account number is the address used for storing the resource of the token, the token can be represented by UTXO, UTXO is the output of the uneconomical transaction and is a core concept of token transaction generation and verification, the transactions form a group of chain structures, all legal transactions can be traced back to the output of one or more forward transactions, the source of the chain can be the mine digging reward, and the tail end is the output of the current uneconomical transaction.
Under the scheme based on the UTXO model, due to the characteristic that UTXO can only use once but does not exist, a single-hand charging address, which cannot be used for concurrent transactions and affects the execution of the uplink task when the resource address fails, when the above problems are encountered, in the technical scheme of the present application, the UTXO model uses a single-hand charging address (i.e. a resource address) of a user, the single-hand charging address is firstly split into N sub-charging addresses (i.e. a plurality of sub-addresses), N is greater than or equal to the expected concurrent number of tasks, then the plurality of sub-addresses are written into a message queue, a user takes out the sub-charging addresses before each transaction, performs uplink operation (i.e. performs uplink task), after the uplink operation, judges whether the remaining amount can satisfy the next transaction, if the remaining amount can be written back to the message queue, if not, the recycling address is written into the recycling address, the recycling address can be reused, regularly merging UTXO of the recovered address, and writing back the merged UTXO to the address of the sub-commission account; since the selected target sub-address is always usable (in other words, when an error occurs to one sub-address, the remaining usable sub-addresses are selected), and the non-allocated sub-addresses (in other words, the non-allocated sub-addresses can be allocated for use, and if the uplink tasks are concurrent, the corresponding sub-addresses can be respectively selected for the concurrent tasks), the problem that the user cannot concurrently transact due to a single-handed charging address, and the execution of the uplink task is affected when the resource address fails can be solved.
A transferring unit 1005, configured to, when a node in the blockchain completes executing the target task, transfer a first resource consumed by executing the target task to the node in the blockchain, where the first resource is a resource stored by the target sub-address.
It should be noted that the obtaining unit 1001 in this embodiment may be configured to execute step S202 in this embodiment, the allocating unit 1003 in this embodiment may be configured to execute step S204 in this embodiment, and the transferring unit 1005 in this embodiment may be configured to execute step S206 in this embodiment.
It should be noted here that the modules described above are the same as the examples and application scenarios implemented by the corresponding steps, but are not limited to the disclosure of the above embodiments. It should be noted that the modules described above as a part of the apparatus may operate in a hardware environment as shown in fig. 1, and may be implemented by software or hardware.
Through the module, when acquiring a uplink request of a target account, an unallocated target sub-address in a plurality of sub-addresses of the target account is allocated to a target task, and each sub-address in the plurality of sub-addresses is used for storing partial resources in a resource address of the target account; under the condition that a node in a block chain executes a target task, transferring a first resource consumed by executing the target task to the node in the block chain, wherein the first resource is a resource stored by a target sub-address, namely a plurality of sub-addresses are obtained by splitting a resource address (namely a block chain address of a commission TOKEN), and each sub-address is used for storing partial resources.
Alternatively, the dispensing unit may comprise: the first allocation module is used for selecting and allocating a target sub-address for the target task from the address list under the condition that one target task is selected, wherein the address list is used for storing a plurality of sub-addresses; and the second distribution module is used for selecting and distributing a plurality of target sub-addresses for the plurality of target tasks from the address list under the condition that the plurality of target tasks are available, wherein each target task is distributed with a corresponding target sub-address.
The second allocation module described above may be further configured to: and under the condition that the execution time of at least two target tasks is overlapped, at least two target sub-addresses which are not allocated currently are selected from the address list and allocated to the at least two target tasks.
The second allocation module described above may be further configured to: and selecting a plurality of target sub-addresses from the address list according to a target sequence, and distributing the plurality of target sub-addresses to a plurality of target tasks, wherein one sub-address in the plurality of target sub-addresses is the next sub-address of the sub-address selected according to the target sequence at the previous time.
Optionally, the dispensing unit may further comprise: the acquisition module is used for acquiring a first resource amount of a first resource required to be consumed by a node in a block chain to execute a target task; and the third allocation module is used for allocating the target sub-address of which the second resource amount of the resources stored in the plurality of sub-addresses is larger than the first resource amount to the target task.
The third distribution module described above may also be used to: respectively acquiring a second resource amount of resources stored in each sub-address in the plurality of sub-addresses; obtaining a difference value between a second resource amount and a first resource amount of each sub-address in the plurality of sub-addresses; obtaining a target difference value in a plurality of difference values of a plurality of sub-addresses, wherein the target difference value is the difference value which has the smallest value and is a positive number in the plurality of difference values; and allocating a target sub-address corresponding to the target difference value in the plurality of sub-addresses to the target task.
In an alternative embodiment, the apparatus of the present application may further comprise: the recovery unit is used for recovering second resources stored on the subaddresses in the address list under the condition that the number of the subaddresses stored in the address list is smaller than that of the plurality of target tasks after the uplink request of the target account is acquired and before the plurality of target subaddresses are selected and allocated for the plurality of target tasks from the address list; and splitting the recycled second resource into a plurality of third resources, configuring a sub-address for each third resource in the plurality of third resources, and storing the reconfigured sub-addresses into an address list, wherein the number of the sub-addresses of the plurality of third resources is not less than the number of the plurality of target tasks.
When the distribution unit selects and distributes a plurality of target sub-addresses for a plurality of target tasks from the address list, the distribution unit may select and distribute reconfigured sub-addresses for the plurality of target tasks from the address list.
In yet another alternative embodiment, the apparatus of the present application may further comprise: a first splitting unit, configured to split resources in a resource address of a target account into multiple second resources before acquiring a uplink request of the target account; the creating unit is used for creating a plurality of sub-addresses used for storing the plurality of split second resources and storing the plurality of sub-addresses into an address list, wherein the plurality of sub-addresses are used for providing resources required to be consumed for the tasks executed in parallel, and the tasks executed in parallel are tasks with overlapped execution time; and the storage unit is used for respectively storing each second resource in the plurality of second resources to a corresponding sub-address in the plurality of sub-addresses.
Optionally, the apparatus of the present application may further comprise: the restoring unit is used for saving the target sub-address back to the address list under the condition that the difference value between the resource quantity of the resource saved by the target sub-address and the first resource quantity of the first resource is greater than a target threshold value after the first resource consumed by executing the target task is transferred to the node in the block chain; and the first splitting unit is used for recovering the resources left by deducting the first resources from the target sub-address under the condition that the difference value between the resource quantity of the resources stored in the target sub-address and the first resource quantity is not greater than the target threshold value, wherein the recovered resources are used for re-splitting and distributing the corresponding sub-addresses.
In the block chain based on the UTXO model, the commission fee needs to be added to the UTXO model of the transaction, and since the Hash of UTXO changes every time the UTXO is used, in other words, the commission fee TOKEN changes every time the UTXO is used, the use of the commission fee can only be operated serially, and the transaction of the user cannot be executed concurrently. Taking the game as an example, if there is an article to be linked in the game, a transaction needs to be made on the chain, and since the linking operation needs to consume a handling fee, a handling fee is added at this time, but since there is generally only one handling fee TOKEN, the amount of concurrency is limited by the number of the handling fee TOKEN, and each transaction (i.e. each linking task) can only be executed in series, resulting in a reduction in the linking speed.
In the technical scheme of the application, a single-hand charge address can be firstly split into N sub-charge TOKEN (N is an expected concurrent number), the splitting method is a transaction of a block chain, the input of the transaction is the charge TOKEN, and the output is N sub-charges. After successful splitting, writing the split sub-commission UTXO into a message queue, taking out the commission sub-address by the user before each transaction, carrying out chain winding operation, after the chain winding operation, judging whether the residual amount is less than a recovery threshold (the threshold can be set by the user, for example, the maximum commission amount of one transaction is set), if so, writing back the message queue, and if not, writing into the recovery address.
Because the original UTXO does not exist after the UTXO is used, a new UTXO can be generated, so that the UTXO can only carry out serial transaction, and the user processing concurrency difficulty is higher in the scenes of games, e-commerce and the like which need large concurrent use of the commission TOKEN. In the technical scheme of the application, any large concurrency number can be supported, namely the concurrency number is realized by controlling the splitting number N; the reliability guarantee is strong, the TOKEN of the sub-commission charge is used only once, and the sub-commission charge is written back to the message queue after being successful, so that the commission charge taken by each transaction is available; the method can deal with the large concurrency of sudden increase, and if the sub-commission account is not available, the sub-commission account can be continuously split to ensure that the transaction can be carried out.
It should be noted here that the modules described above are the same as the examples and application scenarios implemented by the corresponding steps, but are not limited to the disclosure of the above embodiments. It should be noted that the modules described above as a part of the apparatus may be operated in a hardware environment as shown in fig. 1, and may be implemented by software, or may be implemented by hardware, where the hardware environment includes a network environment.
According to another aspect of the embodiment of the present invention, a server or a terminal for implementing the method for transferring resources is also provided.
Fig. 11 is a block diagram of a terminal according to an embodiment of the present invention, and as shown in fig. 11, the terminal may include: one or more processors 1101 (only one shown in fig. 11), a memory 1103, and a transmitting means 1105, as shown in fig. 11, the terminal may further include an input-output device 1107.
The memory 1103 may be configured to store software programs and modules, such as program instructions/modules corresponding to the method and apparatus for transferring resources in the embodiment of the present invention, and the processor 1101 executes various functional applications and data processing by running the software programs and modules stored in the memory 1103, that is, implements the method for transferring resources described above. The memory 1103 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 1103 can further include memory located remotely from the processor 1101, which can be connected to the terminal over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmitting device 1105 is used for receiving or sending data via a network, and can also be used for data transmission between the processor and the memory. Examples of the network may include a wired network and a wireless network. In one example, the transmission device 1105 includes a Network adapter (NIC) that can be connected to a router via a Network cable and other Network devices to communicate with the internet or a local area Network. In one example, the transmitting device 1105 is a Radio Frequency (RF) module, which is used to communicate with the internet in a wireless manner.
The memory 1103 is used for storing, among other things, application programs.
The processor 1101 may call an application stored in the memory 1103 through the transmission device 1105 to perform the following steps:
acquiring a uplink request of a target account, wherein the uplink request is used for requesting a node in a block chain to execute a target task;
responding to the uplink request, and allocating unallocated target sub-addresses in a plurality of sub-addresses of the target account to the target task, wherein each sub-address in the plurality of sub-addresses is used for storing partial resources in the resource address of the target account;
and under the condition that the node in the block chain executes the target task, transferring a first resource consumed by executing the target task to the node in the block chain, wherein the first resource is a resource stored by the target sub-address.
The processor 1101 is further configured to perform the following steps:
splitting resources in the resource address of the target account into a plurality of second resources;
creating a plurality of sub-addresses for storing the plurality of split second resources, and storing the plurality of sub-addresses into an address list, wherein the plurality of sub-addresses are used for providing resources required to be consumed for tasks executed in parallel, and the tasks executed in parallel are tasks with overlapped execution time;
and storing each second resource in the plurality of second resources to a corresponding sub-address in the plurality of sub-addresses.
By adopting the embodiment of the invention, when the uplink request of the target account is acquired, the target sub-address which is not allocated in the plurality of sub-addresses of the target account is allocated to the target task, and each sub-address in the plurality of sub-addresses is used for storing partial resources in the resource address of the target account; under the condition that a node in a block chain executes a target task, transferring a first resource consumed by executing the target task to the node in the block chain, wherein the first resource is a resource stored by a target sub-address, namely a plurality of sub-addresses are obtained by splitting a resource address (namely a block chain address of a commission TOKEN), and each sub-address is used for storing partial resources.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment is not described herein again.
It can be understood by those skilled in the art that the structure shown in fig. 11 is only an illustration, and the terminal may be a terminal device such as a smart phone (e.g., an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, and a Mobile Internet Device (MID), a PAD, etc. Fig. 11 is a diagram illustrating a structure of the electronic device. For example, the terminal may also include more or fewer components (e.g., network interfaces, display devices, etc.) than shown in FIG. 11, or have a different configuration than shown in FIG. 11.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by a program instructing hardware associated with the terminal device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
The embodiment of the invention also provides a storage medium. Alternatively, in this embodiment, the storage medium may be a program code for executing the resource transfer method.
Optionally, in this embodiment, the storage medium may be located on at least one of a plurality of network devices in a network shown in the above embodiment.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps:
s12, acquiring the uplink request of the target account, wherein the uplink request is used for requesting the node in the block chain to execute the target task;
s14, responding to the uplink request, allocating the unallocated target sub-address in the plurality of sub-addresses of the target account to the target task, wherein each sub-address in the plurality of sub-addresses is used for storing part of resources in the resource address of the target account;
and S16, when the node in the block chain finishes executing the target task, transferring a first resource consumed by the execution of the target task to the node in the block chain, wherein the first resource is a resource stored in the target sub-address.
Optionally, the storage medium is further arranged to store program code for performing the steps of:
s22, splitting the resource in the resource address of the target account into a plurality of second resources;
s24, creating a plurality of sub-addresses for storing the plurality of split second resources, and storing the plurality of sub-addresses into an address list, wherein the plurality of sub-addresses are used for providing resources required to be consumed for parallel tasks, and the parallel tasks are tasks with overlapped execution time;
s26, storing each of the plurality of second resources to a corresponding one of the plurality of sub-addresses.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment is not described herein again.
Optionally, in this embodiment, the storage medium may include, but is not limited to: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
The integrated unit in the above embodiments, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing one or more computer devices (which may be personal computers, servers, network devices, etc.) to execute all or part of the steps of the method according to the embodiments of the present invention.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (14)

1. A method for transferring resources, comprising:
acquiring a uplink request of a target account, wherein the uplink request is used for requesting a node in a block chain to execute a target task;
responding to the uplink request, allocating an unallocated target sub-address of the plurality of sub-addresses of the target account to the target task, specifically including: under the condition that the target tasks are multiple, selecting and allocating multiple target sub-addresses for the multiple target tasks from an address list, wherein each sub-address in the multiple sub-addresses is used for storing partial resources in resource addresses of the target account, each target task is allocated with a corresponding target sub-address, and the address list is used for storing the multiple sub-addresses;
under the condition that the node in the block chain finishes executing the target task, transferring a first resource consumed by finishing executing the target task to the node in the block chain, wherein the first resource is a resource stored by the target sub-address; wherein, after acquiring the uplink request of the target account, before selecting and allocating a plurality of target sub-addresses for a plurality of target tasks from the address list, the method further comprises: under the condition that the number of the sub-addresses stored in the address list is smaller than the number of the target tasks, recovering second resources stored on the sub-addresses in the address list; splitting the recycled second resource into a plurality of third resources, configuring a sub-address for each third resource in the plurality of third resources, and storing the reconfigured sub-addresses into the address list, wherein the number of the sub-addresses of the plurality of third resources is not less than the number of the plurality of target tasks; selecting and allocating a plurality of target sub-addresses for a plurality of target tasks from the address list comprises: and selecting and distributing reconfigured sub-addresses for a plurality of target tasks from the address list.
2. The method of claim 1, wherein assigning the target task with an unassigned one of the plurality of sub-addresses of the target account comprises:
and under the condition that one target task is selected, selecting and distributing one target sub-address for the target task from the address list.
3. The method of claim 2, wherein selecting and allocating a plurality of the target sub-addresses for a plurality of the target tasks from the address list comprises:
and under the condition that the execution time of at least two target tasks is overlapped, at least two target sub-addresses which are not distributed currently are selected from the address list and distributed to the at least two target tasks.
4. The method of claim 2, wherein selecting and allocating a plurality of the target sub-addresses for a plurality of the target tasks from the address list comprises:
and selecting a plurality of target sub-addresses from the address list according to a target sequence, and distributing the plurality of target sub-addresses to a plurality of target tasks, wherein one sub-address in the plurality of target sub-addresses is a next sub-address of a sub-address selected according to the target sequence at the previous time.
5. The method of claim 1, wherein assigning the target task with an unassigned one of the plurality of sub-addresses of the target account comprises:
acquiring a first resource amount of the first resource required to be consumed by the node in the block chain to execute the target task;
and allocating the target sub-address of which the second resource amount of the resources saved in the plurality of sub-addresses is larger than the first resource amount to the target task.
6. The method of claim 5, wherein allocating the target sub-address to the target task, where a second amount of resources of the saved resources in the plurality of sub-addresses is greater than the first amount of resources, comprises:
respectively acquiring a second resource amount of resources stored in each sub-address in the plurality of sub-addresses;
obtaining a difference value between a second resource amount of each sub-address in the plurality of sub-addresses and the first resource amount;
obtaining a target difference value in a plurality of difference values of the plurality of sub-addresses, wherein the target difference value is a difference value which has a minimum value and is a positive number in the plurality of difference values;
and distributing the target sub-address corresponding to the target difference value in the plurality of sub-addresses to the target task.
7. The method according to any of claims 1 to 6, wherein before acquiring the uplink request of the target account, the method further comprises:
splitting the resources in the resource address of the target account into a plurality of second resources;
creating a plurality of sub-addresses for storing the plurality of split second resources, and storing the plurality of sub-addresses to an address list, wherein the plurality of sub-addresses are used for providing resources required to be consumed for tasks to be executed in parallel, and the tasks to be executed in parallel are tasks with overlapped execution times;
and respectively storing each second resource in the plurality of second resources to a corresponding sub-address in the plurality of sub-addresses.
8. The method of claim 7, wherein after transferring the first resource consumed by executing the target task to a node in the blockchain, the method further comprises:
saving the target sub-address back to the address list if a difference between the resource amount of the resource saved by the target sub-address and the first resource amount of the first resource is greater than a target threshold;
and under the condition that the difference value between the resource quantity of the resource stored in the target sub-address and the first resource quantity is not greater than the target threshold value, recovering the resource left in the target sub-address after the first resource is deducted, wherein the recovered resource is used for re-splitting and allocating the corresponding sub-address.
9. An apparatus for transferring a resource, comprising:
an obtaining unit, configured to obtain an uplink request of a target account, where the uplink request is used to request a node in a block chain to execute a target task;
an allocating unit, configured to allocate, in response to the uplink request, an unallocated target sub-address from among the multiple sub-addresses of the target account to the target task, where the allocating unit specifically includes: a second allocating module, configured to select and allocate a plurality of target sub-addresses to a plurality of target tasks from an address list when the target tasks are multiple, where each sub-address in the plurality of sub-addresses is used to store a part of resources in a resource address of the target account, each target task is allocated with a corresponding one of the target sub-addresses, and the address list is used to store the plurality of sub-addresses;
a transfer unit, configured to transfer, to a node in the block chain, a first resource consumed by the target task being executed when the node in the block chain completes executing the target task, where the first resource is a resource stored in the target sub-address;
a recovery unit, configured to, after acquiring the uplink request of the target account, recover, when the number of sub-addresses stored in the address list is smaller than the number of the target tasks, second resources stored in the sub-addresses in the address list before selecting and allocating the plurality of target sub-addresses for the plurality of target tasks from the address list; splitting the recycled second resource into a plurality of third resources, configuring a sub-address for each third resource in the plurality of third resources, and storing the reconfigured sub-addresses into the address list, wherein the number of the sub-addresses of the plurality of third resources is not less than the number of the plurality of target tasks;
the allocation unit is further configured to select and allocate reconfigured sub-addresses for the plurality of target tasks from the address list.
10. The apparatus of claim 9, wherein the allocation unit further comprises:
the first allocation module is configured to select and allocate one target sub-address for the target task from the address list when the target task is one, where the address list is used to store the plurality of sub-addresses.
11. The apparatus of claim 10, wherein the second allocating module is further configured to:
and under the condition that the execution time of at least two target tasks is overlapped, at least two target sub-addresses which are not distributed currently are selected from the address list and distributed to the at least two target tasks.
12. The apparatus of claim 10, wherein the second allocating module is further configured to:
and selecting a plurality of target sub-addresses from the address list according to a target sequence, and distributing the plurality of target sub-addresses to a plurality of target tasks, wherein one sub-address in the plurality of target sub-addresses is a next sub-address of a sub-address selected according to the target sequence at the previous time.
13. A storage medium, characterized in that the storage medium comprises a stored program, wherein the program when executed performs the method of any of the preceding claims 1 to 8.
14. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor executes the method of any of the preceding claims 1 to 8 by means of the computer program.
CN201810581536.5A 2018-06-07 2018-06-07 Resource transfer method and device, storage medium and electronic device Active CN108898368B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201910697208.6A CN110428237B (en) 2018-06-07 2018-06-07 Resource processing method and device, storage medium and electronic device
CN201810581536.5A CN108898368B (en) 2018-06-07 2018-06-07 Resource transfer method and device, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810581536.5A CN108898368B (en) 2018-06-07 2018-06-07 Resource transfer method and device, storage medium and electronic device

Related Child Applications (1)

Application Number Title Priority Date Filing Date
CN201910697208.6A Division CN110428237B (en) 2018-06-07 2018-06-07 Resource processing method and device, storage medium and electronic device

Publications (2)

Publication Number Publication Date
CN108898368A CN108898368A (en) 2018-11-27
CN108898368B true CN108898368B (en) 2021-05-14

Family

ID=64344195

Family Applications (2)

Application Number Title Priority Date Filing Date
CN201910697208.6A Active CN110428237B (en) 2018-06-07 2018-06-07 Resource processing method and device, storage medium and electronic device
CN201810581536.5A Active CN108898368B (en) 2018-06-07 2018-06-07 Resource transfer method and device, storage medium and electronic device

Family Applications Before (1)

Application Number Title Priority Date Filing Date
CN201910697208.6A Active CN110428237B (en) 2018-06-07 2018-06-07 Resource processing method and device, storage medium and electronic device

Country Status (1)

Country Link
CN (2) CN110428237B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113554417A (en) * 2018-11-29 2021-10-26 创新先进技术有限公司 Resource processing system, and method, device and equipment for approving resource project declaration
CN109711201A (en) * 2018-12-29 2019-05-03 百度在线网络技术(北京)有限公司 Poverty alleviation processing method, device, equipment and medium based on block chain
CN110443055B (en) * 2019-08-07 2021-01-01 北京瑞策科技有限公司 Uplink method and device for self-media associated data on Internet
CN110427380A (en) * 2019-08-07 2019-11-08 北京艾摩瑞策科技有限公司 It is related to rent a house associated data processing method and its device of block chain
CN110324363B (en) * 2019-08-07 2020-08-14 北京瑞策科技有限公司 Uplink method and device for Internet e-commerce associated data

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106603698A (en) * 2016-12-28 2017-04-26 北京果仁宝科技有限公司 Block chain consensus method based on DPOS and nodes
CN107508680A (en) * 2017-07-26 2017-12-22 阿里巴巴集团控股有限公司 Digital certificate management method, device and electronic equipment

Family Cites Families (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101431745B (en) * 2008-12-09 2010-06-23 杭州东信北邮信息技术有限公司 Account resource reservation and distribution method used for IMS multi-service on-line charging
CA2951498A1 (en) * 2015-12-18 2017-06-18 Wal-Mart Stores, Inc. Automated statistical analysis job chunking
CN105700958B (en) * 2016-01-07 2019-05-03 北京京东尚科信息技术有限公司 The method and its system that a kind of task is split automatically and subtask executes parallel
KR20180114939A (en) * 2016-02-23 2018-10-19 엔체인 홀딩스 리미티드 Systems and methods for controlling asset-related activities through block chaining
CN105809420A (en) * 2016-03-08 2016-07-27 杭州复杂美科技有限公司 Liquidation method of multi-layer block chain
WO2017189031A1 (en) * 2016-04-25 2017-11-02 Digital Asset Holdings Asset and obligation management using flexible settlement times
CN106780025B (en) * 2016-11-30 2021-03-02 中国银行股份有限公司 Method, device and system for transferring digital assets in block chain
CN106600245A (en) * 2016-12-15 2017-04-26 国云科技股份有限公司 Cloud computing resource scheduling system and realizing method thereof
CN106940854A (en) * 2017-03-06 2017-07-11 钱德君 A kind of bridging method between UTXO models and contract
CN107147735B (en) * 2017-05-12 2020-08-11 北京博晨技术有限公司 Distributed account book system based on hierarchical structure
CN107358420B (en) * 2017-06-09 2020-08-11 北京博晨技术有限公司 Block chain system for realizing hot spot account and method for realizing hot spot account
CN107464112B (en) * 2017-07-20 2021-05-25 捷德(中国)科技有限公司 Transaction management method and system based on block chain
CN107423124A (en) * 2017-07-27 2017-12-01 中链科技有限公司 A kind of method for being used to carry out transaction data parallel processing
CN107688999B (en) * 2017-08-11 2020-11-13 杭州溪塔科技有限公司 Block chain-based parallel transaction execution method
CN108009811B (en) * 2017-11-30 2021-06-04 中国人民解放军国防科技大学 Inter-cloud computing environment value exchange-oriented cross-chain communication method
CN107992356B (en) * 2017-12-13 2021-09-14 深圳壹账通智能科技有限公司 Block chain transaction block processing method, electronic device and readable storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106603698A (en) * 2016-12-28 2017-04-26 北京果仁宝科技有限公司 Block chain consensus method based on DPOS and nodes
CN107508680A (en) * 2017-07-26 2017-12-22 阿里巴巴集团控股有限公司 Digital certificate management method, device and electronic equipment

Also Published As

Publication number Publication date
CN110428237A (en) 2019-11-08
CN110428237B (en) 2021-05-14
CN108898368A (en) 2018-11-27

Similar Documents

Publication Publication Date Title
CN108898368B (en) Resource transfer method and device, storage medium and electronic device
CN109829718B (en) Block chain multi-level framework based on storage application scene and operation method thereof
KR102107115B1 (en) Distributed computing resources sharing system and computing apparatus thereof based on block chain system supporting smart contract
CN111091429A (en) Electronic bill identification distribution method and device and electronic bill generation system
CN110597916B (en) Data processing method and device based on block chain, storage medium and terminal
CN104951360A (en) Configuration management mode and device based on Docker
CN112800466B (en) Data processing method and device based on privacy protection and server
CN110659134A (en) Data processing method and device applied to artificial intelligence platform
CN109087111A (en) Common recognition verification method, digging mine machine and block catenary system based on block chain
CN108898021B (en) Threat information processing method, system and computing device based on block chain
CN107527222B (en) Information processing method, device and system
CN104364779B (en) Service provider system, service computer and terminal
CN110233741B (en) Service charging method, device, equipment and storage medium
TW201947481A (en) Virtual card generation method, user terminal and token server
CN104461698A (en) Dynamic virtual disk mounting method, virtual disk management device and distributed storage system
CN109087105A (en) For digging the Hash Search method of mine, digging mine machine and block catenary system
CN106096926B (en) Event processing method, device, electronic device and storage medium
CN112417052B (en) Data synchronization method, device, equipment and storage medium in block chain network
CN106341497A (en) Digital ID generating method and apparatus
CN103634322B (en) Heartbeat management method, heartbeat management device and heartbeat management system for application programs
CN105740278A (en) Data processing method and apparatus
CN108876339B (en) E-pet transaction method and device based on certificate
JP2021520580A (en) Message exchange methods and devices, computer programs, electronic devices
CN112231415B (en) Data synchronization method and system of block chain network, electronic device and readable medium
CN113011607B (en) Resource recycling method, device, equipment and storage medium

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
GR01 Patent grant
GR01 Patent grant