Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the present invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
FIG. 1 is a diagram illustrating a scenario of a checkout agent according to an embodiment of the present invention. Fig. 2 is a flowchart of a collection agent method according to an embodiment of the present invention.
As shown in fig. 1 and fig. 2, in this embodiment, the present invention provides a collection agent method for a blockchain node, where the method includes:
s103: in performing a transfer transaction for payment to a first account, determining whether a proxy receive address for the first account includes a legitimate address:
if yes, executing step S105, transferring the proxy receiving address according to the pre-configured proxy receiving strategy.
In the scenario shown in FIG. 1, the proxy-receive address of account A is configured as address add of account BBMeanwhile, account B is not configured with a proxy collect address as an example:
when user B initiates a transfer transaction tx1, which pays for account A, the nodes of the first blockchain receive the transfer transaction tx1 and pack into a block;
in step S103, when the node executes the transfer transaction tx1 through the transfer contract, it is determined whether the proxy receive address of account a includes a legitimate address:
the transfer contract detects that the proxy receiving address of the account A is a legal address, namely the address add configured as aboveBStep S105 is executed: add to proxy collect address according to preconfigured proxy collect policyBAnd (6) transferring accounts.
If the transfer contract detects that the proxy collection address of the account A is empty or is an illegal address field and the like, the transfer contract will address add of the account AAAnd (6) transferring accounts.
Specifically, in the present embodiment, when the transfer is performed to the agent receiving address in step S105, the transfer contract also performs the above-mentioned receiving agent method, that is, the agent receiving address add is determinedBWhether the proxy collection address of the corresponding account B comprises a legal address or not:
the transfer contract detects that the agent collection address of the account B is empty, and transfers the money paid by the transfer transaction tx1 to the address add of the account BB。
If the proxy collection address of account B is also configured with address add of account CCIf the transfer contract needs to further judge the proxy receiving address addCWhether the proxy collect address of the corresponding account C includes a legitimate address, and so on.
In another embodiment, when the transfer is made to an agent collection address in step S105, the transfer contract no longer performs the above-described collection agent method, i.e., regardless of the agentCollecting address addBWhether the proxy collection address of the corresponding account B includes a legal address or not is judged, and in step S105, the money paid in the transfer transaction tx1 is transferred to the address add of the account BB。
According to the embodiment, the transfer contract can directly transfer the authorized agent collection address when the transfer transaction is executed by configuring the agent collection address for the blockchain account, so that the transfer can be automatically transferred to the designated agent account when the blockchain transfer is executed, the user experience of the balance management of the collection account is improved, and the balance management cost is reduced.
FIG. 3 is a flow chart of a preferred embodiment of the method shown in FIG. 2. As shown in fig. 3, in a preferred embodiment, the method further includes:
s101: and receiving and executing the authorized transaction to configure the address of the second account as a proxy collection address of the first account, and recording the address of the second account as a proxy collection address of the first account on the first blockchain through consensus.
The authorization transaction is generated through a private key signature of the first account, and the authorization transaction comprises first address authorization information for authorizing the address of the second account to be the proxy collection address of the first account.
Also using the scenario shown in FIG. 1 as an example, the user A holding account A wants to reconfigure the proxy collection address of account A to address add of account DDThen, the user side of the user A generates an add through the private key signature of the account ADAuthorizing a transaction tx2 of first address authorization information for a proxy receive address for account a and sending tx2 to a node of the first blockchain;
in step S101, the node executes an authorized transaction tx2 according to the corresponding contract, and after the signature is successfully verified, configures the proxy collection address of account a as addDAnd recording the data to the first block chain through consensus. When the node re-executes the transfer transaction tx3 for payment of account A, add will be paired through steps S103 and S105 described aboveDAnd (6) transferring accounts.
In a preferred embodiment, the authorized transaction further includes a proxy credit for the proxy credit, and step S105 includes transferring the proxy credit without exceeding the proxy credit. Wherein the proxy amount may include at least one of: the agent collection list limit and the agent collection total limit can also be configured with other different types of limits commonly used in the field according to the actual requirements.
For example, authorizing transaction tx2 would be proxy payee address addDIs configured to 100xxx coins, and when the node executes a transfer transaction tx4 of paying 120 xxx coins to account a, in step S105, it sends an add to the proxy collection address addDTransfer 100xxx coins to addATransfer 20 xxx coins; when the node performs a transfer transaction tx5 of paying 87 xxx coins for account a, in step S105, add to the proxy collection address addDTransfer 87 xxx coins.
As another example, authorizing transaction tx2 would be proxy payee address addDIs configured to 1000 xxx coins, then when the node performs a transfer transaction tx6 for 300 xxx coins to account a, it is determined that addDWhether the proxy collection amount of (a) is greater than 300 xxx coins: if yes, then addD300 xxx coins are transferred, and a new agent collection total amount of 700 xxx coins are recorded on the first block chain for judgment when the next transfer transaction is executed.
As another example, the authorization transaction tx2 may have the proxy payee address add configured at the same timeDThe agent collection list amount and the agent collection total amount, the transfer in step S105 needs to satisfy both of the amounts.
In a preferred embodiment, authorizing the transaction further includes authorizing second address authorization information authorizing an address of the number of accounts to be a secondary proxy collect address of the first account; step S105 includes: and transferring the agent collection address and the plurality of secondary agent collection addresses according to a pre-configured agent collection rule.
For example, authorizing a transaction while configuring proxy collect address add for account AEAnd secondary proxy collection address addFAgent collection rules may be configured by transfer contracts and authorized transactions, such as 80% transfer of a single transfer to an agent collection address addE20% transfer toSecondary proxy receive address addFOr, the single transfer is transferred to the proxy receiving address add in 100xxx currencyEAnd transferring the part exceeding the 100xxx money amount to a secondary agent collection address addFAnd so on.
The above embodiments further satisfy more diverse business requirements by configuring a plurality of proxy collection addresses for the blockchain account.
In a preferred embodiment, the authorized transaction further includes validity period information for the proxy payment address, the validity period information including at least one of: agent collection starting time, agent collection ending time and agent collection effective time period;
the judgment of the step S103 further includes: and judging whether the proxy collection address is valid at present according to the valid period information of the proxy collection address.
Specifically, the proxy collection start time may be configured as a time point, such as 0 point 0 minute 0 second on 1 day 2 month 2019, etc.; may also be configured to have a block height, such as block height 20000, etc.; the agent can also be configured to be null, namely the agent collection takes effect immediately after the agent collection is configured from the agent collection address;
similarly, the agent payment due end time may be configured as a time point, such as 0 point 0 minute 0 second on 1 month 1 day 2020; may also be configured as a block height, such as block height 30000, etc.; the agent collection can be configured to be null, namely the agent collection is valid forever after the agent collection address is configured and before the agent collection address is modified or cleared;
similarly, the agent payment valid period may be configured as a period of time, such as 9 o 'clock 30 minutes to 15 o' clock 30 minutes per day, two times per week, 1 day to 20 days per month, and so on; it can also be configured as a block height segment, such as block height 20001-.
Further preferably, the transfer contract can also judge whether the agent collection address is permanently expired according to the validity information at regular time, and if the agent collection address is permanently expired, the agent collection address which is permanently expired is automatically cleared.
FIG. 4 is a flow chart of a preferred embodiment of the method shown in FIG. 2. As shown in fig. 4, in a preferred embodiment, the method further includes:
s107: and receiving and executing a revocation authorization transaction to clear the proxy payment address of the first account and recording the proxy payment address on the first blockchain through consensus.
Also taking the scenario shown in fig. 1 as an example, when the user a who is the holder of the account a wants to revoke the authorization of the proxy collection address of the account a, the user side of the user a generates a revocation authorization transaction tx7 through the private key signature of the account a and sends the revocation authorization transaction tx7 to the node of the first blockchain;
in step S107, the node receives and executes the revocation authorization transaction tx7, clears the proxy payment address of account a, and records it on the first blockchain by consensus. At this time, the transfer transaction for paying the account a is executed, and in step S103, it is detected that the proxy receiving address of the account a is empty, and add is directly performedAAnd (6) transferring accounts.
Fig. 5 is a flowchart of another method for a collection agent according to an embodiment of the invention. The method illustrated in fig. 5 may be performed in conjunction with the method illustrated in fig. 3.
As shown in fig. 5, in this embodiment, the present invention further provides another method for a collection agent at a user end, including:
s201: generating an authorized transaction and sending the authorized transaction to a node of the first blockchain for execution to configure an address of the second account as a proxy receive address of the first account, recording the authorized transaction on the first blockchain through consensus, and judging whether the proxy receive address of the first account comprises a legal address when executing a transfer transaction for payment of the first account: if yes, transferring the proxy receiving address according to the pre-configured proxy receiving strategy.
The authorization transaction is signed by a private key of the first account, and the authorization transaction comprises first address authorization information for authorizing the address of the second account to be a proxy collection address of the first account.
Preferably, the authorized transaction further includes a proxy collect amount for the proxy collect address; the transferring the agent receiving address according to the preconfigured agent receiving policy comprises: and transferring the agent collection address without exceeding the agent collection amount.
Preferably, the proxy amount includes at least one of: the agent collection list amount and the agent collection total amount.
Preferably, authorizing the transaction further comprises authorizing an address of the number of accounts as second address authorization information for a secondary proxy receive address of the first account; the transferring the agent receiving address according to the preconfigured agent receiving policy comprises: and transferring the agent collection address and the plurality of secondary agent collection addresses according to a pre-configured agent collection rule.
Preferably, the authorized transaction further includes validity period information for the agent collection address, the validity period information including at least one of: agent collection starting time, agent collection ending time and agent collection effective time period; the above determining whether the proxy receive address of the first account includes a legal address further includes: and judging whether the proxy collection address is valid at present according to the valid period information of the proxy collection address.
The collection agent principle of the method shown in fig. 5 can refer to the method shown in fig. 3, and is not described herein again.
FIG. 6 is a flow chart of a preferred embodiment of the method shown in FIG. 5. The method illustrated in fig. 6 may be performed in conjunction with the method illustrated in fig. 4.
As shown in fig. 6, in a preferred embodiment, the method further includes:
s203: and generating a revocation authorization transaction and sending the revocation authorization transaction to a node of the first blockchain for execution to clear the proxy collection address of the first account and recording the revocation authorization transaction on the first blockchain through consensus.
The collection agent principle of the method shown in fig. 6 can refer to the method shown in fig. 4, and is not described herein again.
Fig. 7 is a schematic structural diagram of an apparatus according to an embodiment of the present invention.
As shown in fig. 7, as another aspect, the present application also provides an apparatus 700 including one or more Central Processing Units (CPUs) 701 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)702 or a program loaded from a storage section 708 into a Random Access Memory (RAM) 703. In the RAM703, various programs and data necessary for the operation of the apparatus 700 are also stored. The CPU701, the ROM702, and the RAM703 are connected to each other via a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
The following components are connected to the I/O interface 705: an input portion 706 including a keyboard, a mouse, and the like; an output section 707 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 708 including a hard disk and the like; and a communication section 709 including a network interface card such as a LAN card, a modem, or the like. The communication section 709 performs communication processing via a network such as the internet. A drive 710 is also connected to the I/O interface 705 as needed. A removable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 710 as necessary, so that a computer program read out therefrom is mounted into the storage section 708 as necessary.
In particular, according to an embodiment of the present disclosure, the collection agent method described in any of the above embodiments may be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program comprising program code for performing a checkout proxy method. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 709, and/or installed from the removable medium 711.
As yet another aspect, the present application also provides a computer-readable storage medium, which may be the computer-readable storage medium included in the apparatus of the above-described embodiment; or it may be a separate computer readable storage medium not incorporated into the device. The computer readable storage medium stores one or more programs for use by one or more processors in performing the cash register method described herein.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units or modules described in the embodiments of the present application may be implemented by software or hardware. The described units or modules may also be provided in a processor, for example, each of the described units may be a software program provided in a computer or a mobile intelligent device, or may be a separately configured hardware device. Wherein the designation of a unit or module does not in some way constitute a limitation of the unit or module itself.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the present application. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.