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

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

Info

Publication number
CN111061573A
CN111061573A CN201911122657.4A CN201911122657A CN111061573A CN 111061573 A CN111061573 A CN 111061573A CN 201911122657 A CN201911122657 A CN 201911122657A CN 111061573 A CN111061573 A CN 111061573A
Authority
CN
China
Prior art keywords
resource
transaction
transfer
executing
account
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.)
Withdrawn
Application number
CN201911122657.4A
Other languages
Chinese (zh)
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.)
Beijing Sankuai Online Technology Co Ltd
Original Assignee
Beijing Sankuai Online Technology 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 Beijing Sankuai Online Technology Co Ltd filed Critical Beijing Sankuai Online Technology Co Ltd
Priority to CN201911122657.4A priority Critical patent/CN111061573A/en
Publication of CN111061573A publication Critical patent/CN111061573A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/542Event management; Broadcasting; Multicasting; Notifications
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services

Abstract

The application discloses a resource transfer system belongs to the technical field of internet and is beneficial to improving the accuracy of resource data stored in a resource transfer process. According to the resource transfer system disclosed by the embodiment of the application, the system server is arranged, the first resource service module and the second resource transfer module are arranged in the system server in a layered mode, the interface service of the virtual resource, the virtual resource transfer and the real resource transfer are isolated, the logical judgment and processing of the resource transfer are firstly carried out, then the virtual resource and the real resource transfer are synchronously executed based on the transaction mechanism, the synchronous transfer of the marketing funds of the virtual resource and the business line of a user is effectively guaranteed, the consistency of account information is guaranteed, the accuracy of data such as the quantity of the stored resources and the resource transfer operation records is improved, and the stability of the resource transfer operation is further improved.

Description

Resource transfer method, device, electronic equipment and storage medium
Technical Field
The embodiment of the application relates to the technical field of internet, in particular to a resource transfer method, a resource transfer device, electronic equipment and a computer-readable storage medium.
Background
Issuing virtual resources such as coupons or reward points is an important marketing means for leading user traffic into the internet platform, and different service lines can issue corresponding amount of virtual resources to the user so as to stimulate the user to make orders on each service line of the internet platform. In the prior art, virtual resources are independently distributed between service lines and used by users, so that the number of the virtual resources in a user account cannot be uniformly managed, and further, the virtual resource data of the user side is inconsistent with the virtual resource data of the service line side.
Therefore, the virtual resource transferring method in the prior art at least has the defect that the stored virtual resource data is inaccurate.
Disclosure of Invention
The embodiment of the application provides a resource transfer system which is beneficial to improving the accuracy of resource data stored in a resource transfer process.
In a first aspect, an embodiment of the present application provides a resource transfer system, including:
the system comprises at least one client, at least one server corresponding to the at least one client and a system server, wherein the system server further comprises a first resource service module and a second resource transfer module: wherein the content of the first and second substances,
the at least one client is used for generating a first resource issuing request and sending the first resource issuing request to the corresponding server through the electronic equipment;
the server is used for receiving the first resource issuing request sent by the client and mapping the first resource issuing request into a call to a first resource issuing interface;
the first resource service module is used for receiving the call of the first resource issuing interface, and determining a first resource provider, a first resource receiver and the issuing number of the first resources according to the call of the first resource issuing interface and the registration information of the first resource provider stored in the system server;
the first resource service module is further configured to start a pre-created first common transaction for executing a multi-database write operation, where the first common transaction, in a processing process, starts a preset first transaction for executing a first resource addition operation and a preset second transaction for executing a second resource transfer operation at the same time; and the number of the first and second groups,
committing the first common transaction in response to the first transaction and the second transaction being successfully executed concurrently;
wherein committing the first common transaction comprises: and submitting the first transaction and the second transaction, and returning information indicating that the first resource adding operation and the second resource transferring operation which are executed simultaneously are successful.
In a second aspect, an embodiment of the present application provides a resource transfer method, which is applied to the above resource transfer system, and the method includes:
generating a first resource issuing request at the client, and sending the first resource issuing request to the corresponding server through the electronic equipment;
receiving the first resource issuing request sent by the client at the server, and mapping the first resource issuing request to be a call to a first resource issuing interface;
receiving, at the system server, a call to the first resource issuing interface through the first resource service module, and determining, according to the call to the first resource issuing interface and registration information of the first resource provider stored at the system server, a first resource provider and a first resource receiver, and an issuing number of first resources;
starting a pre-established first common transaction for executing multi-database write operation through the first resource service module, wherein the first common transaction simultaneously starts a preset first transaction for executing a first resource adding operation and a preset second transaction for executing a second resource transferring operation in the processing process; and the number of the first and second groups,
committing the first common transaction in response to the first transaction and the second transaction being successfully executed concurrently;
wherein committing the first common transaction comprises: and submitting the first transaction and the second transaction, and returning information indicating that the first resource adding operation and the second resource transferring operation which are executed simultaneously are successful. In a third aspect, an embodiment of the present application further discloses an electronic device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the resource transfer method according to the embodiment of the present application when executing the computer program.
In a fourth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to perform the steps of the resource transfer method disclosed in the present application.
The resource transfer system disclosed in the embodiment of the present application includes at least one client, at least one server corresponding to the at least one client, and a system server, where the system server further includes a first resource service module and a second resource transfer module: the at least one client is used for generating a first resource issuing request and sending the first resource issuing request to the corresponding server through the electronic equipment; the server is used for receiving the first resource issuing request sent by the client and mapping the first resource issuing request into a call to a first resource issuing interface; the first resource service module is used for receiving the call of the first resource issuing interface, and determining a first resource provider, a first resource receiver and the issuing number of the first resources according to the call of the first resource issuing interface and the registration information of the first resource provider stored in the system server; the first resource service module is further configured to start a pre-created first common transaction for executing a multi-database write operation, where the first common transaction, in a processing process, starts a preset first transaction for executing a first resource addition operation and a preset second transaction for executing a second resource transfer operation at the same time; and, in response to successful concurrent execution of the first transaction and the second transaction, committing the first common transaction; wherein committing the first common transaction comprises: and submitting the first transaction and the second transaction, and returning information indicating that the first resource adding operation and the second resource transferring operation are executed at the same time successfully, so that the accuracy of the resource data stored in the resource transferring process is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic structural diagram of a resource transfer system according to a first embodiment of the present application;
FIG. 2 is a flowchart of a resource transfer method according to a second embodiment of the present application;
FIG. 3 is a second flowchart of a resource transfer method according to a second embodiment of the present application;
fig. 4 is a schematic diagram of an application example of the resource transfer method according to the second embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. 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 application.
Example one
As shown in fig. 1, a resource transfer system disclosed in an embodiment of the present application includes: at least one client 101, at least one server 102 corresponding to the at least one client 101, and a system server 103, wherein the system server 103 further includes a first resource service module 1031 and a second resource transfer module 1032.
The at least one client 101 may correspond to different service lines, and each service line is preset with a corresponding server 102. For each service line, the client 101 of the service line is connected with the server 102 of the service line through the internet, and the client 101 generates an information acquisition request according to the operation of a user, acquires the product, marketing and other service data of the service line, and locally displays the service data to the user at the client 101.
In the embodiment of the present application, the at least one client 101 is further configured to generate a first resource issuance request, and send the first resource issuance request to the corresponding server 102 through an electronic device. The first resource described in the embodiment of the present application is a virtual resource, such as a coupon, a credit amount, and the like. In some embodiments of the present application, the at least one server 102 may be disposed on the system server 103.
For example, when a user browses a product of the service line a through a product interface of the client 101 on the electronic device, the client 101 may actively apply for the first resource for the user. Specifically, the client 101 obtains a user identifier of a current user, generates a first resource allocation request by combining the identifier of the current service line, and sends the first resource allocation request to the corresponding server 102. The first resource issuing request carries information of a first resource provider and a first resource receiver, and the issuing number of the first resource to the first resource receiver. In some embodiments of the present application, the information of the first resource provider is represented by an identifier of a current service line, and the information of the first resource receiver is represented by a user identifier of a current user.
Then, the client 101 sends the generated virtual resource issuance request to the corresponding server 102 through network communication.
Correspondingly, the server 101 is configured to receive the first resource allocation request sent by the client, and map the first resource allocation request as a call to a first resource allocation interface. After receiving the first resource issuing request sent by the client, the server 101 generates a preset calling parameter of a first resource issuing interface according to the information of the first resource provider and the first resource receiver carried in the first resource issuing request and the issuing quantity of the first resource issued to the first resource receiver, and calls the first resource issuing interface. Taking the vertical deduction (i.e. the first resource) issuing scenario as an example, the service line develops a marketing campaign, the user participates in the marketing campaign of the service line, and wins a certain amount of vertical deduction according to the campaign rules, and the service line server calls the first resource issuing interface provided by the first resource service module 1031 to initiate an issuing instruction of the vertical deduction. When the first resource issuance interface is invoked, the incoming parameters may include: a number of releases, a user identification, a first resource lifetime, a user characteristic, a second resource account of the first resource provider, and the like.
The first resource service module 1031 preset on the system server 103 receives the call to the first resource issuing interface.
The first resource service module 1031 mainly manages the interface with the business application scenario, the usage rule of the first resource and the logic of the business party issuing the first resource, and implements the peer-to-peer logic of the first resource (such as reducing the fund immediately) and the second resource (such as marketing fund).
The first resource service module 1031 includes a plurality of sub-service modules, such as a first resource distribution rule determining sub-module, a first resource distribution service sub-module, a first resource validity period management sub-module, and the like, to ensure that the first resource distribution and use logic is normal.
The first resource service module 1031 is configured to receive the call to the first resource issuing interface, and determine the first resource provider, the first resource receiver, and the issuing number of the first resource according to the call to the first resource issuing interface and the registration information of the first resource provider stored in the system server 103. In some embodiments of the present application, the first resource service module 1031 determines the first resource provider and the first resource receiver, and the issue amount of the first resource, according to the calling parameter of the first resource issue interface.
Further, the first resource service module 1031 determines whether to execute the call-specified first resource distribution and the distribution quantity of the first resources according to the first resource provider information configured in advance when the first resource provider is registered, or according to the first resource provider information and the first resource receiver information configured in advance, and according to a preset first resource distribution policy. In some embodiments of the present application, the first resource provider information is service scenario information matched with a service line, and may include: the expected number of releases, the second resource payment account, the first resource release period, the first resource expiration date, etc., and a user representation of the potential first resource recipient, etc. For example. The first resource service module 1031 determines a first resource provider and a first resource receiver according to the calling parameter of the first resource issuing interface, then determines whether the calling time of the first resource issuing interface matches the first resource issuing period according to configuration information pre-stored by the first resource service module 1031 at the system server 103, and if so, determines that the issuing number of the first resource is the issuing number carried in the calling parameter.
The second resource transfer module 1032 manages the transfer and storage of all lines of business with a second resource, such as marketing funds.
In some embodiments of the present application, the first resource service module 1031 is further configured to perform a first resource adding operation and a second resource transferring operation at the system server 103 at the same time; wherein the first resource addition operation comprises: performing, by the first resource service module, adding the release amount of the first resource to a first resource account of the first resource recipient; the second resource transfer operation comprises: performing, by the second resource transfer module, a second resource transfer from a second resource account of the first resource provider to a second resource account of a resource management platform.
When the business line issues the first resource (such as a standing deduction), the first resource service module 1031 is firstly passed through to determine whether the business line can issue the first resource, the lifetime of the issued first resource and the specific quantity are, then, the first resource service module 1031 calls the second resource transfer module 1032 to transfer the second resource (namely, real marketing fund) in real time, and when the transfer of the second resource is successful, the money adding and billing of the virtual account are carried out for the user. The first resource service module 1031 needs to ensure that the first resource accounting and the second resource transfer are synchronous and consistent in state, and if not, needs to initiate re-transfer or return to the original route, so as to ensure that the states of the first resource and the second resource transfer are consistent. For example, the first resource service module 1031 may synchronously perform accounting on the deduction account for the target user and transfer marketing funds to the payment system account, ensure that the two operation states are equal, submit the posting transaction at the same time, and return a success instruction to the service line server after the posting transaction is successfully operated.
If the states of the first resource account billing and the second resource account may be inconsistent due to system interaction or network jitter, the first resource service module 1031 needs to initiate a reconciliation function to achieve the equal amount of the two billing accounts (such as the standing deduction account and the real marketing fund account).
In some embodiments of the present application, the first resource service module 1031 is further configured to perform a first resource adding operation and a second resource transferring operation at the system server 103 at the same time, for example, the first resource service module 1031 is configured to start a pre-created first common transaction for performing a multi-database write operation, and the first common transaction will start a preset first transaction for performing the first resource adding operation and a preset second transaction for performing the second resource transferring operation at the same time during a processing procedure; and, in response to successful concurrent execution of the first transaction and the second transaction, committing the first common transaction; wherein committing the first common transaction comprises: and submitting the first transaction and the second transaction, and returning information indicating that the first resource adding operation and the second resource transferring operation which are executed simultaneously are successful. Wherein the first resource addition operation comprises: adding the first resource of the issuing quantity to a first resource account of the first resource receiver by the first resource service module, and storing a corresponding operation record; the second resource transfer operation comprises: and executing second resource transfer from the second resource account of the first resource provider to the second resource account of the resource management platform by the second resource transfer module, and storing a corresponding operation record. The multiple databases in the implementation of the application comprise: a virtual resource database (e.g., a database storing virtual resource account information of a first resource recipient and a database storing virtual resource operation records) and a real resource database (e.g., a database storing operation records of a second resource transfer operation from a second resource account of a first resource provider to a second resource account of a resource management platform).
In some embodiments of the present application, the step of performing the first resource adding operation and the second resource transferring operation at the system server simultaneously comprises: a first resource addition operation and a second resource transfer operation are performed concurrently at the system server based on a transaction mechanism. Further, based on the transaction mechanism, performing the first resource adding operation and the second resource transferring operation at the system server simultaneously, including: and starting a pre-created first common transaction, wherein the first common transaction simultaneously starts a preset first transaction for executing a first resource adding operation and a preset second transaction for executing a second resource transferring operation in the processing process. Wherein the performing the first resource addition operation comprises: executing, by the first resource service module, a first resource adding operation of adding the issuance amount of the first resource to the first resource account of the first resource receiver, and storing a corresponding operation record (i.e., storing the operation record of adding the issuance amount of the first resource to the first resource account of the first resource receiver); the performing a second resource transfer operation comprises: executing, by the second resource transfer module, a second resource transfer operation from the second resource account of the first resource provider to the second resource account of the resource management platform, and storing a corresponding operation record (i.e., storing the operation record of the second resource transfer from the second resource account of the first resource provider to the second resource account of the resource management platform); committing the first common transaction in response to the first transaction and the second transaction being successfully executed concurrently; wherein committing the first common transaction comprises: and submitting the first transaction and the second transaction, and returning information indicating that the first resource adding operation and the second resource transferring operation which are executed simultaneously are successful.
The transaction mechanism is a specific term of database operation, and a series of operations executed by a single logic work unit prevent data inconsistency when data updating occurs synchronously. The transaction mechanism in the prior art is generally applied to write operations to the same database. For example, when different write operations are performed on a database, either all write operations are successful or the data in the database is not updated. In the embodiment of the application, input write-in operations are executed on different databases, so that in the implementation process, the write-in operations of different databases are further encapsulated based on a transaction mechanism, and a common transaction mechanism is defined.
By establishing a common transaction mechanism, the first resource service module 1031 uniformly controls the accounting accuracy of the first resource transfer and the accounting accuracy of the second resource transfer, through a basic principle, accounts in the two accounts are booked, the first common transaction is successfully submitted at the same time, if the accounting in the single account is successful, data rollback is performed, retry is initiated on the data according to an error reason, or a failure prompt is returned.
In some embodiments of the present application, a first common transaction may be defined, where a first state variable corresponding to an execution result of a first resource adding operation and a second state variable corresponding to an execution result of a second resource transferring operation are defined in the first common transaction; defining a statement for executing a first resource adding operation and a second resource transferring operation, wherein the first resource adding operation modifies the first state variable when the first resource adding operation is executed, and the second resource transferring operation modifies the second state variable when the second resource transferring operation is executed; and then setting a first state variable and a second state variable judgment statement, submitting the first common transaction when the first state variable and the second state variable both indicate that the corresponding operation returns successfully, and rolling back the first resource adding operation and the second resource transferring operation when the first state variable and the second state variable do not indicate that the corresponding operation returns successfully at the same time.
In other embodiments of the present application, a first transaction and a second transaction are added to the first common transaction, such that the first common transaction will begin both the first transaction and the second transaction during processing. The first transaction is a transaction for executing a first resource adding operation, and the second transaction is a transaction for executing a second resource transferring operation. In the first common transaction, further determining an execution result of a first transaction and a second transaction, and if the first transaction and the second transaction are successfully executed at the same time, submitting the first transaction and the second transaction, solidifying operations executed by the first transaction and the second transaction, and then submitting the first common transaction, and outputting information indicating that the execution of the first resource adding operation and the second resource transferring operation is successful to the first resource service module 1031. And if the first transaction and the second transaction are not successfully executed at the same time (namely the first resource adding operation and the second resource transferring operation are not successfully executed at the same time), rolling back the first transaction and the second transaction, namely rolling back the executed first resource adding operation and the executed second resource transferring operation.
Further, a retry condition may be preset, and when the first resource adding operation and the second resource transferring operation are not executed successfully at the same time, whether to retry to execute the first resource adding operation and the second resource transferring operation may be determined according to a return result of the operations that are not executed successfully. The retry condition may include: write error, system busy, etc. For example, when the returned result of the first resource addition operation indicates a write error, the first resource addition operation and the second resource transfer operation may be re-executed once to reduce a resource transfer failure rate due to network jitter. For another example, when the return result of the second resource transfer operation indicates that the balance of the transferred account is insufficient, the return result does not meet the preset retry condition.
In some embodiments of the present application, when the first resource adding operation is executed, the first resource service module 1031 executes the first resource adding operation of adding the first resource of the issue amount to the first resource account of the first resource receiver, and stores a resource adding record corresponding to the first resource adding operation at the system server 103. Wherein the first resource addition operation may be implemented by calling a write interface of the first resource billing database.
In some embodiments of the present application, the first common transaction starts the second transaction by calling a second resource transfer interface provided by the second resource transfer module 1032 during the processing, and the second transaction executes the second resource transfer during the processing. The calling parameters of the second resource transfer interface comprise: a second resource account of the first resource provider and a second resource account of the resource management platform, and a second amount of resources transferred. Wherein, the second resource amount is equal to the transferred amount of the first resource, and the second resource account information of the first resource provider is determined by the first resource service module 1031 according to the preconfigured first resource provider information stored in the system server 103; the second resource account of the resource management platform is determined according to the configuration information stored in the system server 103. When executing the second resource transfer, the second resource transfer module executes a second resource transfer operation from the second resource account of the first resource provider to the second resource account of the resource management platform, and stores a corresponding operation record, that is, stores an operation record of resource transfer corresponding to the second resource transfer operation. Wherein the second resource transfer operation may be implemented by calling a write interface of the second resource billing database and an interface of a preset funds payment system.
In some embodiments of the present application, for a specific operation of executing the second resource transfer by the second resource transfer module 1032, refer to a specific fund transfer implementation manner in the payment service background in the prior art, which is not described in detail in this embodiment of the present application.
After the starting of the pre-created first common transaction, the method further comprises: and in the processing process of the first common transaction, in response to the first transaction and the second transaction not being executed successfully at the same time, rolling back the first transaction and the second transaction, and returning information indicating that the execution of the first resource adding operation and the second resource transferring operation at the same time fails. For example, when the execution of the first resource addition operation is successful but the execution of the second resource transfer operation fails, the first common transaction will roll back the execution of the first resource addition operation and the second resource transfer operation, so that the resource in the user's first resource account and the bill of the account are restored to a state in which the current second resource addition operation is not executed, and the second resource account of the first resource provider, the resource in the second resource account of the resource management platform and the bill of the corresponding account are restored to a state in which the current second resource transfer operation is not executed.
In some embodiments of the present application, after the step of rolling back the first transaction and the second transaction in response to the first transaction and the second transaction not being successfully executed at the same time, the method further includes: and in response to that the execution failure reason returned by the first transaction and/or the second transaction meets a preset retry condition, restarting a preset first transaction for executing the first resource adding operation and a preset second transaction for executing the second resource transferring operation at the same time. In order to avoid network jitter and instability of write operation, in some embodiments of the present application, a retry condition may be preset, and when a cause of an execution failure returned by any one of the first transaction and the second transaction satisfies the preset retry condition, the first transaction and the second transaction are restarted. Wherein the preset retry condition may include: retry number, write operation failure, system busy, etc.
In some embodiments of the application, the first resource service module 1031 is further configured to output a resource transfer result corresponding to the first resource issuing request to the server according to a result of performing the first resource adding operation and the second resource transferring operation at the same time. After the first resource issuance and the second resource transfer corresponding to the first resource issuance operation are completed, the first resource service module 1031 returns a resource transfer result indicating that the first resource issuance is successful to the server 102 invoking the first resource issuance interface.
In some embodiments of the present application, a user may use a first resource in an account.
Embodiments of the components of the system are further described below in conjunction with a scenario in which a user uses a first resource in an account.
The at least one client 101 is further configured to generate a first resource usage request, and send the first resource usage request to the corresponding server 102 through an electronic device. For example, when the user selects the payment channel on the cash register interface of the client 101, the user selects the payment of the vertical deduction fee, inputs the use amount, and submits a payment application, the client 101 generates a first resource use request according to the operation of the user, where the first resource use request at least includes user identification information and the payment amount. Then, the client 101 sends the first resource usage request to the corresponding server 102.
The server 102 is further configured to receive the first resource usage request sent by the client 101, and map the first resource usage request as a call to a first resource usage interface. After receiving the first resource usage request sent by the client 101, the server 102 maps the first resource usage request to a call to the first resource usage interface. The call parameters of the first resource usage interface include: user identification information and payment amount.
The first resource service module 1031 is further configured to receive a call to the first resource usage interface, and determine a first resource payer and a payment amount of the first resource according to the call to the first resource usage interface. The first resource service module 1031 at the system server 103, after receiving the call to the first resource usage interface, determines a first resource payer according to the user identification information in the call parameter, and determines the payment amount of the first resource according to the payment amount.
The first resource service module 1031 is further configured to execute, on the system server 103, a first resource deduction operation for reducing the first resource in the first resource account of the first resource payer by the payment amount. Then, the first resource service module 1031 subtracts the first resource in the first resource account matched with the user identifier, and stores a subtraction record.
The first resource service module 1031 is further configured to store, in response to the successful execution of the first resource deduction operation, a record corresponding to the first resource deduction operation on the system server 103.
In some embodiments of the present application, a user may use a first resource and a second resource in an account in combination.
Embodiments of the components of the system are further described below in conjunction with a scenario in which a user uses a first resource and a second resource in an account in combination.
The at least one client 101 is further configured to generate a combined resource usage request, and send the combined resource usage request to the corresponding server through the electronic device. For example, when the user selects a payment channel on the cash register interface of the client 101, the user selects a combined payment of the deposit fund and the bank card account, inputs the deposit fund usage amount and the bank card transfer amount, and then submits a payment application, so that the client 101 generates a combined resource usage request according to the operation of the user, where the combined resource usage request at least includes: a first resource payer (such as user identification information), a payment amount of the first resource, a second resource payment account, second resource receiver information, and a second resource transfer amount. Then, the client 101 sends the combined resource usage request to the corresponding server 102.
The server 102 is further configured to receive the combined resource usage request sent by the client, and map the combined resource usage request as a call to a combined resource usage interface.
The first resource service module 1031 is further configured to receive a call to the combined resource usage interface, and determine a first resource payer, a payment amount of the first resource, a second resource payment account, a second resource receiving account, and a second resource transfer amount according to the call to the combined resource usage interface. And the second resource receiving account is determined according to the second resource receiving party information carried in the registration information and the calling parameter which are pre-stored in the system server user.
The first resource service module 1031, further configured to perform a first resource deduction operation and a second resource transfer operation at the system server 1031 at the same time; wherein the performing a first resource deduction operation comprises: executing, by the first resource service module, deducting the first resource of the payment amount from the first resource account of the first resource payer, and storing a corresponding operation record (i.e., the operation record deducting the first resource of the payment amount from the first resource account of the first resource payer); the performing a second resource transfer operation comprises: a second resource transfer from the second resource payment account to the second resource receiving account is performed by the second resource transfer module and a corresponding operational record (i.e., an operational record of the second resource transfer from the second resource payment account to the second resource receiving account) is stored.
In some embodiments of the present application, the step of performing the first resource deduction operation and the second resource transfer operation at the system server simultaneously comprises: based on a transaction mechanism, simultaneously executing a first resource deduction operation and a second resource transfer operation at the system server, specifically: starting a pre-established second common transaction for executing multi-database write operation, wherein the second common transaction simultaneously starts a preset third transaction for executing the first resource deduction operation and a preset fourth transaction for executing the second resource transfer operation in the processing process; committing the common transaction in response to the third transaction and the fourth transaction being successfully executed concurrently; wherein committing the common transaction comprises: and submitting the third transaction and the fourth transaction, and returning information indicating that the first resource deduction operation and the second resource transfer operation which are executed simultaneously are successful.
The common transaction mechanism is as described above and will not be described in detail here.
In a specific implementation, a second common transaction may be defined first, and a third transaction and a fourth transaction are added to the second common transaction, so that the second common transaction will start the third transaction and the fourth transaction simultaneously during processing. And the third transaction is a transaction for executing a first resource deduction operation, and the fourth transaction is a transaction for executing a second resource transfer operation. In the second common transaction, further determining an execution result of a third transaction and a fourth transaction, and if the third transaction and the fourth transaction are successfully executed at the same time, submitting the third transaction and the fourth transaction, solidifying operations executed by the third transaction and the fourth transaction, and then submitting the second common transaction, and outputting information indicating that the execution of the first resource deduction operation and the execution of the second resource transfer operation are successful to the first resource service module 1031. And if the third transaction and the fourth transaction are not successfully executed at the same time (namely the first resource deduction operation and the second resource transfer operation are not successfully executed at the same time), rolling back the third transaction and the fourth transaction, namely rolling back the executed first resource deduction operation and second resource transfer operation.
Further, a retry condition may be preset, and when the first resource deduction operation and the second resource transfer operation are not successfully executed at the same time, whether to retry to execute the first resource deduction operation and the second resource transfer operation may be determined according to a return result of the operations that are not successfully executed. The retry condition may include: write error, system busy, etc. For example, when the returned result of the first resource deduction operation indicates a write error, the first resource addition operation and the second resource transfer operation may be re-executed once to reduce a resource transfer failure rate due to network jitter. For another example, when the return result of the second resource transfer operation indicates that the balance of the transferred account is insufficient, the return result does not meet the preset retry condition.
In some embodiments of the present application, when the first resource deduction operation is executed, the first resource service module 1031 executes the first resource deduction operation of deducting the first resource of the payment amount from the first resource account of the first resource payer, and stores an operation record corresponding to the first resource deduction operation. Wherein the first resource deduction operation may be implemented by calling a write interface of the first resource billing database.
In some embodiments of the present application, during the processing of the second common transaction, the fourth transaction is started by calling a second resource transfer interface provided by the second resource transfer module 1032, and the fourth transaction executes the second resource transfer during the processing. And when executing the second resource transfer, executing the second resource transfer from the second resource payment account to the second resource receiving account by the second resource transfer module, and storing a corresponding operation record. Wherein the second resource transfer operation may be implemented by calling a write interface of the second resource billing database and an interface of a preset funds payment system.
In some embodiments of the present application, for a specific operation of executing the second resource transfer by the second resource transfer module 1032, refer to a specific fund transfer implementation manner in the payment service background in the prior art, which is not described in detail in this embodiment of the present application.
After the starting of the pre-created second common transaction, the method further comprises: and in the process of processing the second common transaction, in response to that the third transaction and the fourth transaction are not successfully executed at the same time, rolling back the third transaction and the fourth transaction, and returning information indicating that the first resource deduction operation and the second resource transfer operation which are executed at the same time are failed.
In some embodiments of the present application, after the step of rolling back the third transaction and the fourth transaction in response to the third transaction and the fourth transaction not being successfully executed at the same time, the method further includes: and in response to that the execution failure reason returned by the third transaction and/or the fourth transaction meets a preset retry condition, restarting a preset third transaction for executing the first resource deduction operation and a preset fourth transaction for executing the second resource transfer operation at the same time.
The client of the service line also supports a first resource query operation.
In some embodiments of the present application, the at least one client 101 is further configured to generate a first resource query request according to an operation of a user, and send the first resource query request to the corresponding server 102 through an electronic device, where the first resource query request carries user identification information of the user. For example, when a user executes an account balance query or a consumption record query through the client 101 of the service line, the client 101 generates a first resource query request according to an operation of the user, where the first resource query request includes user identification information and may further include a parameter for indicating a query balance or a consumption record.
The server 102 is further configured to receive the first resource query request sent by the client 101, and map the first resource query request as a call to a first resource query interface. The calling parameter of the first resource inquiry interface comprises user identification information and also comprises a parameter used for indicating an inquiry balance or a consumption record.
The first resource service module 1031 is further configured to receive a call to the first resource query interface, and output the remaining first resource amount of the first resource account and/or the operation record of the first resource, which are matched with the user identification information. After receiving the call to the first resource query interface, the first resource service module 1031 determines a first resource account according to the user identification information, and outputs the remaining first resource amount of the first resource account and/or the operation record of the first resource according to a call parameter.
In some embodiments of the present application, the first resource service module 1031 is further configured to receive a resource reconciliation request, where the resource reconciliation request carries identification information and recording time information of a target first resource provider; then, the first resource service module 1031 is further configured to output, according to the identification information of the target first resource provider, a second resource transfer record of the second resource account of the target first resource provider, where the second resource transfer record matches the record time information. Wherein the second resource transfer record comprises: transferring, by the second resource account of the target first resource provider, a record to a second resource of the second resource account of the resource management platform.
The resource transfer system disclosed in the embodiment of the present application includes: the system comprises at least one client, at least one server corresponding to the at least one client and a system server, wherein the system server further comprises a first resource service module and a second resource transfer module: the at least one client is used for generating a first resource issuing request and sending the first resource issuing request to the corresponding server through the electronic equipment; the server is used for receiving the first resource issuing request sent by the client and mapping the first resource issuing request into a call to a first resource issuing interface; the first resource service module is used for receiving the call of the first resource issuing interface, and determining a first resource provider, a first resource receiver and the issuing number of the first resources according to the call of the first resource issuing interface and the registration information of the first resource provider stored in the system server; the first resource service module is further configured to start a pre-created first common transaction for executing a multi-database write operation, where the first common transaction, in a processing process, starts a preset first transaction for executing a first resource addition operation and a preset second transaction for executing a second resource transfer operation at the same time; and, in response to successful concurrent execution of the first transaction and the second transaction, committing the first common transaction; wherein committing the first common transaction comprises: and submitting the first transaction and the second transaction, and returning information indicating that the first resource adding operation and the second resource transferring operation are executed at the same time successfully, so that the accuracy of the resource data stored in the resource transferring process is improved. According to the resource transfer system disclosed by the embodiment of the application, the system server is arranged, the first resource service module and the second resource transfer module are arranged in the system server in a layered mode, the interface service of the virtual resource, the virtual resource transfer and the real resource transfer are isolated, the logical judgment and processing of the resource transfer are firstly carried out, then the virtual resource and the real resource transfer are synchronously executed based on the transaction mechanism, the synchronous transfer of the marketing funds of the virtual resource and the business line of a user is effectively guaranteed, the consistency of account information is guaranteed, the accuracy of data such as the quantity of the stored resources and the resource transfer operation records is improved, and the stability of the resource transfer operation is further improved.
In the prior art, in order to improve the traffic import capability between different service lines of a platform, different service lines may issue virtual resources such as general coupons or credits, so that a user may use the virtual resources sent by the service lines of the platform in multiple services. However, under the marketing strategy, when the user uses the resources issued by a plurality of service lines, the order data complexity of the platform is greatly improved in the resource settlement process. By the resource transfer system disclosed in the embodiment of the application, the virtual resources can be uniformly managed at the system server and synchronously transferred with the real resources in real time, so that the subsequent data processing workload is reduced, and the performance of the resource transfer system is improved.
Example two
The embodiment of the application discloses a resource transfer method, which is applied to a resource transfer system shown in fig. 1. As shown in fig. 2, the method includes:
step 201, generating a first resource issuing request at the client, and sending the first resource issuing request to the corresponding server through the electronic device.
In an embodiment of the present application, the at least one client 101 is configured to generate a first resource issuance request, and send the first resource issuance request to the corresponding server 102 through an electronic device. The first resource described in the embodiment of the present application is a virtual resource, such as a coupon, a credit amount, and the like.
For example, when a user browses a product of the service line a through a product interface of the client 101 on the electronic device, the client 101 may actively apply for the first resource for the user. Specifically, the client 101 obtains a user identifier of a current user, generates a first resource allocation request by combining the identifier of the current service line, and sends the first resource allocation request to the corresponding server 102. The first resource issuing request carries information of a first resource provider and a first resource receiver, and the issuing number of the first resource to the first resource receiver. In some embodiments of the present application, the information of the first resource provider is represented by an identifier of a current service line, and the information of the first resource receiver is represented by a user identifier of a current user.
Then, the client 101 sends the generated virtual resource issuance request to the corresponding server 102 through the network interface of the electronic device.
Step 202, at the server, receiving the first resource issuing request sent by the client, and mapping the first resource issuing request to a call to a first resource issuing interface.
The server 101 is configured to receive the first resource allocation request sent by the client, and map the first resource allocation request as a call to a first resource allocation interface. After receiving the first resource issuing request sent by the client, the server 101 generates a preset calling parameter of a first resource issuing interface according to the information of the first resource provider and the first resource receiver carried in the first resource issuing request and the issuing quantity of the first resource issued to the first resource receiver, and calls the first resource issuing interface.
When the first resource issuance interface is invoked, the incoming parameters may include: a number of releases, a user identification, a first resource lifetime, a user characteristic, a second resource account of the first resource provider, and the like.
For a specific implementation manner of the server receiving the first resource allocation request sent by the client and mapping the first resource allocation request to a call to the first resource allocation interface, refer to the related description of the resource transfer system in embodiment one, which is not described herein again.
Step 203, at the system server, receiving, by the first resource service module, the call to the first resource issuing interface, and determining, according to the call to the first resource issuing interface and the registration information of the first resource provider stored at the system server, the first resource provider, the first resource receiver, and the issuing number of the first resource.
The first resource service module 1031 included in the system server is configured to receive the call to the first resource issuance interface, and determine the first resource provider, the first resource receiver, and the issuance number of the first resource according to the call to the first resource issuance interface and the registration information of the first resource provider stored in the system server 103. In some embodiments of the present application, the first resource service module 1031 determines the first resource provider and the first resource receiver, and the issue amount of the first resource, according to the calling parameter of the first resource issue interface.
Step 204, starting a pre-created first common transaction for executing the multi-database write operation through the first resource service module.
And the first common transaction starts a preset first transaction for executing the first resource adding operation and a preset second transaction for executing the second resource transferring operation simultaneously in the processing process.
In some embodiments of the present application, after determining the first resource provider and the first resource recipient, and the number of issues of the first resource, a first resource addition operation and a second resource transfer operation are performed concurrently at the system server. For example, a first resource addition operation and a second resource transfer operation are performed concurrently at the system server based on a transaction mechanism.
The transaction mechanism is a specific term of database operation, and a series of operations executed by a single logic work unit prevent data inconsistency when data updating occurs synchronously. In the embodiment of the application, the multi-database write operation is further encapsulated based on a transaction mechanism, and a common transaction mechanism is defined.
For a specific implementation of defining a common transaction mechanism, creating a first common transaction for performing a multi-database write operation, and starting the first common transaction for performing the multi-database write operation, reference is made to the relevant description in the first embodiment, and details are not repeated here.
In some embodiments of the present application, the performing the first resource addition operation includes: executing, by the first resource service module, a first resource adding operation of adding the issuance amount of the first resource to the first resource account of the first resource receiver, and storing a corresponding operation record (i.e., storing the operation record of adding the issuance amount of the first resource to the first resource account of the first resource receiver); the performing a second resource transfer operation comprises: and executing, by the second resource transfer module, a second resource transfer operation from the second resource account of the first resource provider to the second resource account of the resource management platform, and storing a corresponding operation record (i.e., storing the operation record of the second resource transfer from the second resource account of the first resource provider to the second resource account of the resource management platform).
Step 205, determining whether the first transaction and the second transaction are executed successfully at the same time, if yes, executing step 206, otherwise, executing step 207.
After starting the first common transaction, it may be determined whether the first common transaction commits by judging an execution result of a different transaction included in the first common transaction. Committing the first common transaction only if the first transaction and the second transaction are successfully executed simultaneously; otherwise, a different transaction included in the first common transaction is rolled back.
Step 206, in response to the first transaction and the second transaction being successfully executed simultaneously, committing the first common transaction.
In some embodiments of the present application, committing the first common transaction comprises: and submitting the first transaction and the second transaction, and returning information indicating that the first resource adding operation and the second resource transferring operation which are executed simultaneously are successful.
For a specific implementation of submitting the first common transaction, refer to the related description in the first embodiment, and details are not repeated here.
Step 207, rolling back the first transaction and the second transaction, and returning information indicating that the simultaneous execution of the first resource adding operation and the second resource transferring operation fails.
In some embodiments of the present application, after starting the pre-created first common transaction, the method further includes: and in the processing process of the first common transaction, in response to the first transaction and the second transaction not being executed successfully at the same time, rolling back the first transaction and the second transaction, and returning information indicating that the execution of the first resource adding operation and the second resource transferring operation at the same time fails.
For a specific implementation of the determining means that the first transaction and the second transaction are not executed successfully at the same time and the rolling back of the first transaction and the second transaction, refer to the related description in the first embodiment, and are not described herein again.
In some embodiments of the present application, after the step of rolling back the first transaction and the second transaction in response to the first transaction and the second transaction not being successfully executed at the same time, the method further includes: and in response to that the execution failure reason returned by the first transaction and/or the second transaction meets a preset retry condition, restarting a preset first transaction for executing the first resource adding operation and a preset second transaction for executing the second resource transferring operation at the same time.
In response to that the execution failure reason returned by the first transaction and/or the second transaction meets the preset retry condition, refer to the related description in the first embodiment for a specific implementation manner that the preset first transaction for executing the first resource adding operation and the preset second transaction for executing the second resource transferring operation are restarted at the same time, and details are not repeated here.
Generating a first resource use request according to user operation at the client, and sending the first resource use request to the corresponding server through electronic equipment;
receiving the first resource use request sent by the client at the server side, and mapping the first resource use request into a call to a first resource use interface;
receiving, at a system server, a call to the first resource usage interface through the first resource service module, and determining a first resource payer and a payment amount for a first resource based on the call to the first resource usage interface;
performing, by the first resource service module, a first resource deduction operation to reduce the first resource in a first resource account of the first resource payer by the payment amount;
and responding to the successful execution of the first resource deduction operation, and storing a corresponding operation record through the first resource service module.
In some embodiments of the present application, as shown in fig. 3, after the virtual resource is successfully issued, the method further includes:
and 208, generating a combined resource using request according to the user operation at the client, and sending the combined resource using request to the corresponding server through the electronic equipment.
After the service line issues the virtual resource for the user, the user can use the virtual resource in the own account. For example, when the user selects the payment channel on the cash register interface of the client 101, the user selects the payment of the vertical deduction fee, inputs the use amount, and submits a payment application, the client 101 generates a first resource use request according to the operation of the user, where the first resource use request at least includes user identification information and the payment amount. Then, the client 101 sends the first resource usage request to the corresponding server 102 through the network interface of the electronic device.
Step 209, receiving the combined resource usage request sent by the client at the server, and mapping the combined resource usage request to a call to a combined resource usage interface.
The server 102 receives the first resource usage request sent by the client 101, and then maps the first resource usage request to a call to a first resource usage interface. The call parameters of the first resource usage interface include: user identification information and payment amount.
Step 210, at the system server, receiving, by the first resource service module, a call to the combined resource usage interface, and determining, according to the call to the combined resource usage interface, a first resource payer, a payment amount of the first resource, a second resource payment account, a second resource receiving account, and a second resource transfer amount.
The system server includes a first resource service module 1031, where the first resource service module 1031 is configured to receive a call to the first resource usage interface, and determine a first resource payer and a payment amount of the first resource according to the call to the first resource usage interface.
Step 211, executing, by the first resource service module, a first resource deduction operation and a second resource transfer operation at the system server at the same time.
In some embodiments of the present application, said performing, at the system server, a first resource deduction operation and a second resource transfer operation simultaneously comprises: starting a pre-established second common transaction for executing multi-database write operation, wherein the second common transaction simultaneously starts a preset third transaction for executing the first resource deduction operation and a preset fourth transaction for executing the second resource transfer operation in the processing process; committing the common transaction in response to the third transaction and the fourth transaction being successfully executed concurrently; wherein committing the common transaction comprises: and submitting the third transaction and the fourth transaction, and returning information indicating that the first resource deduction operation and the second resource transfer operation which are executed simultaneously are successful.
Wherein the performing a first resource deduction operation comprises: executing, by the first resource service module, deducting the first resource of the payment amount from the first resource account of the first resource payer, and storing a corresponding operation record; the performing a second resource transfer operation comprises: and executing second resource transfer from the second resource payment account to the second resource receiving account by the second resource transfer module, and storing a corresponding operation record.
The definition, creation, and execution processes of the second common transaction refer to the related description in the first embodiment, and are not described herein again. The resource transfer method and the implementation process based on the resource transfer system described in the embodiment of the present application are illustrated in conjunction with fig. 4. The resource transfer system includes: client, server and system server. The resource transfer method comprises the following steps:
step 401, generating a first resource issuing request at the client, and sending the first resource issuing request to the corresponding server through the electronic device.
Step 402, at the server, receiving the first resource issuing request sent by the client, and mapping the first resource issuing request to a call to a first resource issuing interface.
Step 403, at the system server, receiving, by the first resource service module, a call to the first resource issuing interface, and determining, according to the call to the first resource issuing interface and the registration information of the first resource provider stored at the system server, a first resource provider, a first resource receiver, and an issuing number of the first resource.
Step 404, starting a pre-created first common transaction for executing a multi-database write operation through the first resource servicing module.
Step 405, determining whether the first transaction and the second transaction are executed successfully at the same time, if yes, executing step 406, otherwise, executing step 407.
Step 406, in response to successful execution of the first transaction and the second transaction simultaneously, committing the first common transaction.
Step 407, roll back the first transaction and the second transaction, and return information indicating that the simultaneous execution of the first resource adding operation and the second resource transferring operation failed.
Step 408, at the client, generating a combined resource use request according to the user operation, and sending the combined resource use request to the corresponding server through the electronic device.
Step 409, receiving the combined resource using request sent by the client at the server, and mapping the combined resource using request to a call for a combined resource using interface.
Step 410, at the system server, receiving, by the first resource service module, a call to the combined resource usage interface, and determining, according to the call to the combined resource usage interface, a first resource payer, a payment amount of the first resource, a second resource payment account, a second resource receiving account, and a second resource transfer amount.
Step 411, executing, by the first resource service module, a first resource deduction operation and a second resource transfer operation at the system server at the same time.
The resource transfer method disclosed in the embodiment of the present application is applied to the resource transfer system described in the first embodiment of the present application, and specific implementation manners of each step of the method are not described again, and reference may be made to specific implementation manners of corresponding modules or sub-modules in system embodiments.
According to the resource transfer method disclosed by the embodiment of the application, a first resource issuing request is generated at the client, and the first resource issuing request is sent to the corresponding server through the electronic equipment; receiving the first resource issuing request sent by the client at the server, and mapping the first resource issuing request to be a call to a first resource issuing interface; receiving, at the system server, a call to the first resource issuing interface through the first resource service module, and determining, according to the call to the first resource issuing interface and registration information of the first resource provider stored at the system server, a first resource provider and a first resource receiver, and an issuing number of first resources; starting a pre-established first common transaction for executing multi-database write operation through the first resource service module, wherein the first common transaction simultaneously starts a preset first transaction for executing a first resource adding operation and a preset second transaction for executing a second resource transferring operation in the processing process; and, in response to successful concurrent execution of the first transaction and the second transaction, committing the first common transaction; wherein committing the first common transaction comprises: and submitting the first transaction and the second transaction, and returning information indicating that the first resource adding operation and the second resource transferring operation are executed at the same time successfully, so that the accuracy of the resource data stored in the resource transferring process is improved.
According to the resource transfer method disclosed by the embodiment of the application, the system server is arranged, the first resource service module and the second resource transfer module are arranged in the system server in a layered mode, interface service, virtual resource transfer and real resource transfer of virtual resources are isolated, logical judgment and processing of resource transfer are firstly carried out, then virtual resource transfer and real resource transfer are synchronously executed based on an affair mechanism, synchronous transfer of marketing funds of user virtual resources and service lines is effectively guaranteed, consistency of account information is guaranteed, accuracy of data such as the number of stored resources and resource transfer operation records is improved, and stability of resource transfer operation is further improved.
Correspondingly, the present application also discloses an electronic device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the computer program, the resource transfer method according to the second embodiment of the present application is implemented. The electronic device can be a PC, a mobile terminal, a personal digital assistant, a tablet computer and the like.
The present application also discloses a computer-readable storage medium, on which a computer program is stored, which when executed by a processor, performs the steps of the resource transfer method according to embodiment two of the present application.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
The resource transfer method and system provided by the present application are introduced in detail, and a specific example is applied in the description to explain the principle and the implementation of the present application, and the description of the above embodiment is only used to help understanding the method and the core idea of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.

Claims (16)

1. A resource transfer system, comprising: the system comprises at least one client, at least one server corresponding to the at least one client and a system server, wherein the system server further comprises a first resource service module and a second resource transfer module: wherein the content of the first and second substances,
the at least one client is used for generating a first resource issuing request and sending the first resource issuing request to the corresponding server through the electronic equipment;
the server is used for receiving the first resource issuing request sent by the client and mapping the first resource issuing request into a call to a first resource issuing interface;
the first resource service module is used for receiving the call of the first resource issuing interface, and determining a first resource provider, a first resource receiver and the issuing number of the first resources according to the call of the first resource issuing interface and the registration information of the first resource provider stored in the system server;
the first resource service module is further configured to start a pre-created first common transaction for executing a multi-database write operation, where the first common transaction, in a processing process, starts a preset first transaction for executing a first resource addition operation and a preset second transaction for executing a second resource transfer operation at the same time; and the number of the first and second groups,
committing the first common transaction in response to the first transaction and the second transaction being successfully executed concurrently;
wherein committing the first common transaction comprises: and submitting the first transaction and the second transaction, and returning information indicating that the first resource adding operation and the second resource transferring operation which are executed simultaneously are successful.
2. The system of claim 1, wherein the performing a first resource addition operation comprises: adding the first resource of the issuing quantity to a first resource account of the first resource receiver by the first resource service module, and storing a corresponding operation record; the performing a second resource transfer operation comprises: and executing second resource transfer from the second resource account of the first resource provider to the second resource account of the resource management platform by the second resource transfer module, and storing a corresponding operation record.
3. The system of claim 1,
the at least one client is further used for generating a first resource use request and sending the first resource use request to the corresponding server through the electronic equipment;
the server is further configured to receive the first resource usage request sent by the client, and map the first resource usage request as a call to a first resource usage interface;
the first resource service module is further used for receiving the call of the first resource using interface, and determining a first resource payer and the payment amount of the first resource according to the call of the first resource using interface;
the first resource service module is further configured to execute, on the system server, a first resource deduction operation to reduce the first resource in a first resource account of the first resource payer by the payment amount;
the first resource service module is further configured to respond to that the first resource deduction operation is successfully executed, and store a corresponding operation record.
4. The system of claim 1,
the at least one client is also used for generating a combined resource using request and sending the combined resource using request to the corresponding server through the electronic equipment;
the server is further configured to receive the combined resource usage request sent by the client, and map the combined resource usage request as a call to a combined resource usage interface;
the first resource service module is further configured to receive a call to the combined resource usage interface, and determine a first resource payer, a payment amount of the first resource, a second resource payment account, a second resource receiving account, and a second resource transfer amount according to the call to the combined resource usage interface;
the first resource service module is further configured to perform a first resource deduction operation and a second resource transfer operation at the system server at the same time; wherein the performing a first resource deduction operation comprises: executing, by the first resource service module, deducting the first resource of the payment amount from the first resource account of the first resource payer, and storing a corresponding operation record; the performing a second resource transfer operation comprises: and executing second resource transfer from the second resource payment account to the second resource receiving account by the second resource transfer module, and storing a corresponding operation record.
5. The system of claim 4, wherein the step of concurrently performing a first resource deduction operation and a second resource transfer operation at the system server comprises:
starting a pre-established second common transaction for executing multi-database write operation, wherein the second common transaction simultaneously starts a preset third transaction for executing the first resource deduction operation and a preset fourth transaction for executing the second resource transfer operation in the processing process;
committing the common transaction in response to the third transaction and the fourth transaction being successfully executed concurrently; wherein committing the common transaction comprises: and submitting the third transaction and the fourth transaction, and returning information indicating that the first resource deduction operation and the second resource transfer operation which are executed simultaneously are successful.
6. The system of claim 1, wherein after the beginning of the pre-created first common transaction, further comprising:
and in the processing process of the first common transaction, in response to the first transaction and the second transaction not being executed successfully at the same time, rolling back the first transaction and the second transaction, and returning information indicating that the execution of the first resource adding operation and the second resource transferring operation at the same time fails.
7. The system of claim 6, wherein after the step of rolling back the first transaction and the second transaction in response to the first transaction and the second transaction not being performed successfully simultaneously, further comprising:
and in response to that the execution failure reason returned by the first transaction and/or the second transaction meets a preset retry condition, restarting a preset first transaction for executing the first resource adding operation and a preset second transaction for executing the second resource transferring operation at the same time.
8. A resource transfer method applied to the resource transfer system according to any one of claims 1 to 7, the method comprising:
generating a first resource issuing request at the client, and sending the first resource issuing request to the corresponding server through the electronic equipment;
receiving the first resource issuing request sent by the client at the server, and mapping the first resource issuing request to be a call to a first resource issuing interface;
receiving, at the system server, a call to the first resource issuing interface through the first resource service module, and determining, according to the call to the first resource issuing interface and registration information of the first resource provider stored at the system server, a first resource provider and a first resource receiver, and an issuing number of first resources;
starting a pre-established first common transaction for executing multi-database write operation through the first resource service module, wherein the first common transaction simultaneously starts a preset first transaction for executing a first resource adding operation and a preset second transaction for executing a second resource transferring operation in the processing process; and the number of the first and second groups,
committing the first common transaction in response to the first transaction and the second transaction being successfully executed concurrently;
wherein committing the first common transaction comprises: and submitting the first transaction and the second transaction, and returning information indicating that the first resource adding operation and the second resource transferring operation which are executed simultaneously are successful.
9. The method of claim 8, wherein the performing the first resource addition operation comprises: adding the first resource of the issuing quantity to a first resource account of the first resource receiver by the first resource service module, and storing a corresponding operation record; the performing a second resource transfer operation comprises: and executing second resource transfer from the second resource account of the first resource provider to the second resource account of the resource management platform by the second resource transfer module, and storing a corresponding operation record.
10. The method of claim 8, further comprising:
generating a first resource use request according to user operation at the client, and sending the first resource use request to the corresponding server through electronic equipment;
receiving the first resource use request sent by the client at the server side, and mapping the first resource use request into a call to a first resource use interface;
receiving, at a system server, a call to the first resource usage interface through the first resource service module, and determining a first resource payer and a payment amount for a first resource based on the call to the first resource usage interface;
performing, by the first resource service module, a first resource deduction operation to reduce the first resource in a first resource account of the first resource payer by the payment amount;
and responding to the successful execution of the first resource deduction operation, and storing a corresponding operation record through the first resource service module.
11. The method of claim 8,
generating a combined resource using request according to user operation at the client, and sending the combined resource using request to the corresponding server through the electronic equipment;
receiving the combined resource use request sent by the client at the server, and mapping the combined resource use request to a call of a combined resource use interface;
receiving, at the system server, a call to the combined resource usage interface through the first resource service module, and determining a first resource payer, a payment amount of a first resource, a second resource payment account, a second resource reception account, and a second resource transfer amount according to the call to the combined resource usage interface;
concurrently performing, by the first resource serving module, a first resource deduction operation and a second resource transfer operation at the system server; wherein the performing a first resource deduction operation comprises: executing, by the first resource service module, deducting the first resource of the payment amount from the first resource account of the first resource payer, and storing a corresponding operation record; the performing a second resource transfer operation comprises: and executing second resource transfer from the second resource payment account to the second resource receiving account by the second resource transfer module, and storing a corresponding operation record.
12. The method of claim 11, wherein the step of concurrently performing a first resource deduction operation and a second resource transfer operation at the system server comprises:
starting a pre-established second common transaction for executing multi-database write operation, wherein the second common transaction simultaneously starts a preset third transaction for executing the first resource deduction operation and a preset fourth transaction for executing the second resource transfer operation in the processing process;
committing the common transaction in response to the third transaction and the fourth transaction being successfully executed concurrently; wherein committing the common transaction comprises: and submitting the third transaction and the fourth transaction, and returning information indicating that the first resource deduction operation and the second resource transfer operation which are executed simultaneously are successful.
13. The method of claim 8, wherein after the beginning of the pre-created first common transaction, further comprising:
and in the processing process of the first common transaction, in response to the first transaction and the second transaction not being executed successfully at the same time, rolling back the first transaction and the second transaction, and returning information indicating that the execution of the first resource adding operation and the second resource transferring operation at the same time fails.
14. The method of claim 13, wherein after the step of rolling back the first transaction and the second transaction in response to the first transaction and the second transaction not being performed successfully simultaneously, further comprising:
and in response to that the execution failure reason returned by the first transaction and/or the second transaction meets a preset retry condition, restarting a preset first transaction for executing the first resource adding operation and a preset second transaction for executing the second resource transferring operation at the same time.
15. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the resource transfer method of any one of claims 8 to 14 when executing the computer program.
16. A computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, is adapted to carry out the steps of the resource transfer method according to any one of claims 8 to 14.
CN201911122657.4A 2019-11-15 2019-11-15 Resource transfer method, device, electronic equipment and storage medium Withdrawn CN111061573A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911122657.4A CN111061573A (en) 2019-11-15 2019-11-15 Resource transfer method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911122657.4A CN111061573A (en) 2019-11-15 2019-11-15 Resource transfer method, device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN111061573A true CN111061573A (en) 2020-04-24

Family

ID=70297921

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911122657.4A Withdrawn CN111061573A (en) 2019-11-15 2019-11-15 Resource transfer method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111061573A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113486121A (en) * 2021-07-26 2021-10-08 北京达佳互联信息技术有限公司 Resource transfer method, device and storage medium

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104348830A (en) * 2014-10-16 2015-02-11 腾讯科技(深圳)有限公司 Resource exchanging method, device and system
CN104572299A (en) * 2014-12-31 2015-04-29 腾讯科技(深圳)有限公司 resource transfer method and device
CN105933295A (en) * 2016-04-12 2016-09-07 北京红马传媒文化发展有限公司 Credit distribution method, system and device
CN106209577A (en) * 2016-06-23 2016-12-07 网易无尾熊(杭州)科技有限公司 A kind of e-sourcing distribution method and device
WO2017000061A1 (en) * 2015-07-02 2017-01-05 Royal Bank Of Canada Secure processing of electronic payments
CN107729124A (en) * 2017-09-12 2018-02-23 阿里巴巴集团控股有限公司 Transaction methods and device, electronic equipment
CN108717652A (en) * 2018-03-30 2018-10-30 北京三快在线科技有限公司 Order processing system and method, order placement service end, the second client
CN109801049A (en) * 2017-11-15 2019-05-24 腾讯科技(深圳)有限公司 Resource transfers method and apparatus, computer equipment and storage medium
CN110196769A (en) * 2018-04-19 2019-09-03 财付通支付科技有限公司 A kind of information processing method, device, server and storage medium
CN110210732A (en) * 2019-05-20 2019-09-06 平安银行股份有限公司 Resource transfers method, apparatus, computer equipment and storage medium

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104348830A (en) * 2014-10-16 2015-02-11 腾讯科技(深圳)有限公司 Resource exchanging method, device and system
CN104572299A (en) * 2014-12-31 2015-04-29 腾讯科技(深圳)有限公司 resource transfer method and device
WO2017000061A1 (en) * 2015-07-02 2017-01-05 Royal Bank Of Canada Secure processing of electronic payments
CN105933295A (en) * 2016-04-12 2016-09-07 北京红马传媒文化发展有限公司 Credit distribution method, system and device
CN106209577A (en) * 2016-06-23 2016-12-07 网易无尾熊(杭州)科技有限公司 A kind of e-sourcing distribution method and device
CN107729124A (en) * 2017-09-12 2018-02-23 阿里巴巴集团控股有限公司 Transaction methods and device, electronic equipment
CN109801049A (en) * 2017-11-15 2019-05-24 腾讯科技(深圳)有限公司 Resource transfers method and apparatus, computer equipment and storage medium
CN108717652A (en) * 2018-03-30 2018-10-30 北京三快在线科技有限公司 Order processing system and method, order placement service end, the second client
CN110196769A (en) * 2018-04-19 2019-09-03 财付通支付科技有限公司 A kind of information processing method, device, server and storage medium
CN110210732A (en) * 2019-05-20 2019-09-06 平安银行股份有限公司 Resource transfers method, apparatus, computer equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113486121A (en) * 2021-07-26 2021-10-08 北京达佳互联信息技术有限公司 Resource transfer method, device and storage medium
CN113486121B (en) * 2021-07-26 2024-03-12 北京达佳互联信息技术有限公司 Resource transfer method, device and storage medium

Similar Documents

Publication Publication Date Title
CN110599276B (en) Bill reimbursement method, device and equipment and computer storage medium
CN110599323B (en) Resource processing method and processing equipment
CN107133788B (en) Refund processing method and device
CN109784515B (en) Service reservation method, providing method, resource acquisition method, terminal and server
CN110796440A (en) Payment method, device and system, payment service architecture, electronic equipment and medium
CN110659993A (en) Resource management method and device based on block chain network
US20020035479A1 (en) Access contract changing method for automatically changing an access contract between a prepaid contract and a postpaid contract
US20150206145A1 (en) Id management device, id management method, and id management program
CN112435114A (en) Internet fund storage and management service management method, system, electronic equipment and readable storage medium
CN110400139B (en) Payment method, device and system based on public digital wallet
CN112001732A (en) Service processing system, method and device
CN111415146A (en) Resource data processing method, device and equipment
CN110335133A (en) Processing method, system, electronic equipment and the storage medium of transaction data
CN110874728A (en) Online payment system, online payment method, device, medium and server
CN109587244A (en) Cloud data in mobile phone processing method, device, computer readable storage medium and electronic equipment
US8655754B2 (en) Intercompany transactions elimination system
CN111061573A (en) Resource transfer method, device, electronic equipment and storage medium
CN112950355B (en) Transaction data processing method and device
CN111461798B (en) Big data-based ticket business processing method, device, medium and equipment for individual user
CN111292073B (en) Offline payment system and method based on payment platform
CN113177772A (en) Service data processing method, device and system
CN110930206A (en) Invoice matching method and device and storage medium
TW201106286A (en) System and method for adaptively selecting bank card for payment
CN110675246A (en) Credit limit management method and device
CN112995244B (en) Subscription withholding method, resource access method and equipment

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
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20200424