CN111626787A - Resource distribution method, device, medium and equipment - Google Patents

Resource distribution method, device, medium and equipment Download PDF

Info

Publication number
CN111626787A
CN111626787A CN202010479686.2A CN202010479686A CN111626787A CN 111626787 A CN111626787 A CN 111626787A CN 202010479686 A CN202010479686 A CN 202010479686A CN 111626787 A CN111626787 A CN 111626787A
Authority
CN
China
Prior art keywords
instruction
compensation
executing
resources
resource
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010479686.2A
Other languages
Chinese (zh)
Other versions
CN111626787B (en
Inventor
侯文杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network 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 ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN202010479686.2A priority Critical patent/CN111626787B/en
Publication of CN111626787A publication Critical patent/CN111626787A/en
Application granted granted Critical
Publication of CN111626787B publication Critical patent/CN111626787B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/02Marketing; Price estimation or determination; Fundraising
    • G06Q30/0207Discounts or incentives, e.g. coupons or rebates
    • G06Q30/0212Chance discounts or incentives
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Business, Economics & Management (AREA)
  • Engineering & Computer Science (AREA)
  • Accounting & Taxation (AREA)
  • Development Economics (AREA)
  • Strategic Management (AREA)
  • Finance (AREA)
  • Game Theory and Decision Science (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Retry When Errors Occur (AREA)

Abstract

The disclosure relates to a resource distribution method, a resource distribution device, a resource distribution medium and a resource distribution device, which belong to the technical field of computers and can ensure service consistency. A resource issuance method comprising executing a first instruction that reduces a total number of resources to be issued by a first amount, executing a second instruction that issues the first amount of resources to a user account, and executing a third instruction that reduces the total number of user-accessible resources by the first amount, the method further comprising: storing a first compensation instruction for the first instruction while executing the first instruction, wherein the first compensation instruction is an instruction that adds the total number of resources reduced by the first number to the first number; storing a second compensation instruction for the second instruction while executing the second instruction, wherein the second compensation instruction is an instruction to take the resource just issued from the user account; and in the event of a failure of execution of the second or third instruction, executing respective compensation instructions corresponding to all instructions preceding the failed instruction.

Description

Resource distribution method, device, medium and equipment
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a resource distribution method, apparatus, medium, and device.
Background
Currently, when issuing coupons to users, it is common to invoke service a first to reduce the number of coupons by 1, then service B to place the issued coupons in the user account, and then service C to reduce the number of coupons for the user by 1. However, if a service is down when it is invoked, for example, if service C is down, it may result in the user having received the coupon but not receiving the coupon 1 times, which may result in inconsistent business.
Disclosure of Invention
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
In a first aspect, the present disclosure provides a resource issuance method that includes executing a first instruction to reduce a total number of resources to be issued by a first amount, executing a second instruction to issue the first amount of the resources to a user account, and executing a third instruction to reduce the total number of user-accessible resources by the first amount, the method further including: storing a first compensation instruction for the first instruction while executing the first instruction, wherein the first compensation instruction is an instruction that adds the total number of resources reduced by the first number to the first number; storing a second compensation instruction for the second instruction while executing the second instruction, wherein the second compensation instruction is an instruction to take the resource just issued from the user account; and in the event of a failure of execution of the second or third instruction, executing respective compensation instructions corresponding to all instructions preceding the failed instruction.
In a second aspect, the present disclosure provides a resource issuing apparatus, including: a first module for executing a first instruction that reduces a total number of resources to be issued by a first number; a second module for executing a second instruction to issue the first amount of the resource to a user account; and a third module for executing a third instruction to reduce a total number of user-accessible resources by the first number; the device also includes: a storage module, configured to store a first compensation instruction for the first instruction while the first module executes the first instruction, and store a second compensation instruction for the second instruction while the second module executes the second instruction, where the first compensation instruction is an instruction that adds the total amount of the resources after the first amount is reduced to the first amount, and the second compensation instruction is an instruction that takes away the resource that has just been issued from the user account; and a fourth module for executing respective compensation instructions corresponding to all instructions preceding the failed instruction, if execution of the second instruction or the third instruction fails.
In a third aspect, the present disclosure provides a computer readable medium having stored thereon a computer program which, when executed by a processing apparatus, performs the steps of the method of the first aspect of the present disclosure.
In a fourth aspect, the present disclosure provides an electronic device comprising: a storage device having a computer program stored thereon; processing means for executing the computer program in the storage means to implement the steps of the method of the first aspect of the present disclosure.
According to the technical scheme, the relevant compensation instruction can be stored while the first instruction for reducing the total amount of the resources to be issued by the first amount and the second instruction for issuing the first amount of the resources to the user account are executed, so that the relevant compensation instruction can be executed under the condition that the second instruction or the third instruction fails, and the consistency of the service can be ensured.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and features are not necessarily drawn to scale.
In the drawings:
fig. 1 is a flowchart of a resource issuing method according to an embodiment of the present disclosure.
Fig. 2 is a schematic block diagram of a resource issuing apparatus according to an embodiment of the present disclosure.
Fig. 3 is still another schematic block diagram of a resource issuing apparatus according to an embodiment of the present disclosure.
FIG. 4 is a schematic block diagram of an electronic device according to one embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
Fig. 1 is a flowchart of a resource issuing method according to an embodiment of the present disclosure. The resource issuance method includes executing a first instruction that reduces a total number of resources to be issued by a first number, executing a second instruction that issues the first number of resources to a user account, and executing a third instruction that reduces the total number of user-accessible resources by the first number. As shown in fig. 1, the resource issuance method may further include the following steps S11 to S13.
In step S11, a first compensation instruction for the first instruction is stored while the first instruction is executed, wherein the first compensation instruction is an instruction that adds the total number of resources reduced by the first number to the first number.
In step S12, a second compensation instruction for the second instruction is stored while the second instruction is executed, wherein the second compensation instruction is an instruction to take the resource just issued from the user account.
In step S13, in the case where the second instruction or the third instruction fails to be executed, the respective compensation instructions corresponding to all instructions before the failed instruction are executed.
The step may specifically include: if the second instruction fails to execute, executing a first compensation instruction; if the third instruction fails to execute, the first compensation instruction and the second compensation instruction are executed.
In the present disclosure, the resource may be one or more of a coupon, a cash red envelope, a physical object.
In the present disclosure, the execution of the first instruction and the execution of the second instruction may exchange the order, and the steps S11 and S12 may also exchange the order.
The following describes, by way of example, a resource issuing method according to an embodiment of the present disclosure, and in the description of examples, a resource is a coupon.
If the user wishes to get the active coupon, the user clicks on the "get" option on the active page. Then, assume that the number of coupons the user wishes to receive is a first number N1Then the resource issuer (e.g., server)) After receiving a pickup request of a user, executing a first instruction to reduce the total number N of coupons to be issued by a first number N1According to the setting of the activity, the first number N1And may be any number of 1, 2, 3, etc. Furthermore, while executing the first instruction, the resource issuer may store a first compensation instruction for the first instruction. Then, if the first instruction fails to execute, this indicates that the total number N of coupons to be issued has not been successfully reduced by the first number N1That is, the total number N of the coupons to be issued remains unchanged, the resource issuer does not execute the subsequent second instruction and third instruction; if the first instruction is successfully executed, the resource issuer may then execute a second instruction to issue a first quantity N to the user account1And while executing the second instruction, the resource issuer stores a second compensation instruction for the second instruction. Then, if the second instruction is executed successfully, the resource issuer may then execute a third instruction to reduce the total number M of user-receivable coupons by the first number N1(ii) a If the second instruction fails to execute, this indicates that the first number N has not been successfully issued in the user account1The resource issuer executes a first compensation instruction to reduce the first number N1Total number of coupons thereafter (in this case N-N)1) Plus a first quantity N1This allows the total number of coupons to be issued to be restored to the previous total number N. Then, if the third instruction is successfully executed, the complete process of the user for getting the coupon is successfully executed; if the third instruction fails to execute, this indicates that the total number M of user-accessible resources has not been successfully reduced by the first number N1The resource issuer may execute the first compensation instruction and the second compensation instruction so that the total number of coupons to be issued is restored to the previous total number N and the coupon just issued is taken from the user account.
According to the technical scheme, the first compensation instruction which adds the total amount of the resources after the first amount is reduced to the first amount is stored while the first instruction is executed, the second compensation instruction which takes the resources which are just issued from the user account is stored while the second instruction is executed, and in the case that the second instruction or the third instruction fails to be executed, the compensation instructions corresponding to all instructions before the failed instruction are executed, so that the consistency of the service can be ensured.
In one embodiment, the first compensation instruction and the second compensation instruction may be stored in a stack, or may be stored in a cache or other electronic device, as long as the compensation instructions can be called to be executed later in case of a failure in execution of the second instruction or the third instruction.
In an embodiment, when the second instruction and the third instruction are executed successfully, the first compensation instruction and the second compensation instruction are deleted, so that the storage of excessive compensation instructions can be avoided, that is, the storage space is saved, and the compensation instruction with a wrong call in the subsequent resource issuing process can be avoided.
Fig. 2 is a schematic block diagram of a resource issuing apparatus according to an embodiment of the present disclosure. The resource distribution apparatus 2 includes: a first module 21 for executing a first instruction to reduce the total number of resources to be issued by a first number; a second module 22 for executing a second instruction to issue the first amount of resources to the user account; and a third module 23 for executing a third instruction for reducing the total number of user-accessible resources by the first number. As shown in fig. 2, the resource issuing apparatus 2 may further include: a storage module 24, configured to store a first compensation instruction for the first instruction while the first module 21 executes the first instruction, and store a second compensation instruction for the second instruction while the second module 22 executes the second instruction, where the first compensation instruction is an instruction that adds the total amount of the resources after the first amount is reduced to the first amount, and the second compensation instruction is an instruction that takes the resource that has just been issued from the user account; and a fourth module 25 for executing, in the event of a failure of execution of the second or third instruction, respective compensation instructions corresponding to all instructions preceding the failed instruction.
According to the technical scheme, the first compensation instruction which adds the total amount of the resources after the first amount is reduced to the first amount is stored while the first instruction is executed, the second compensation instruction which takes the resources which are just issued from the user account is stored while the second instruction is executed, and in the case that the second instruction or the third instruction fails to be executed, the compensation instructions corresponding to all instructions before the failed instruction are executed, so that the consistency of the service can be ensured.
Optionally, in the case that the second instruction or the third instruction fails to execute, executing each compensation instruction corresponding to all instructions before the failed instruction includes: if the second instruction fails to execute, executing a first compensation instruction; if the third instruction fails to execute, the first compensation instruction and the second compensation instruction are executed.
Optionally, the first compensation instruction and the second compensation instruction are stored within a stack.
Fig. 3 is still another schematic block diagram of a resource issuing apparatus according to an embodiment of the present disclosure. As shown in fig. 3, the resource issuing apparatus 2 further optionally includes a deleting module 26, configured to delete the first compensation instruction and the second compensation instruction stored in the storage module 24 when the second instruction and the third instruction are both successfully executed.
Referring now to FIG. 4, a block diagram of an electronic device 600 suitable for use in implementing embodiments of the present disclosure is shown. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 4 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 4, electronic device 600 may include a processing device (e.g., central processing unit, graphics processor, etc.) 601 that may execute various appropriate instructions and processes in accordance with a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage device 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the electronic apparatus 600 to instruct are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Generally, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. While fig. 4 illustrates an electronic device 600 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 609, or may be installed from the storage means 608, or may be installed from the ROM 602. The computer program, when executed by the processing device 601, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP (HyperText transfer protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: storing a first compensation instruction for the first instruction while executing the first instruction, wherein the first compensation instruction is an instruction that adds the total number of resources reduced by the first number to the first number; storing a second compensation instruction for the second instruction while executing the second instruction, wherein the second compensation instruction is an instruction to take the resource just issued from the user account; and in the event of a failure of execution of the second or third instruction, executing respective compensation instructions corresponding to all instructions preceding the failed instruction. .
Computer program code for executing instructions of the present disclosure may be written in any combination of one or more programming languages, including but not limited to an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and instructions of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or instructions, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present disclosure may be implemented by software or hardware. Wherein the name of a module in some cases does not constitute a limitation on the module itself.
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
In accordance with one or more embodiments of the present disclosure, example 1 provides a resource issuance method that includes executing a first instruction to reduce a total number of resources to be issued by a first amount, executing a second instruction to issue the first amount of resources to a user account, and executing a third instruction to reduce the total number of resources available to a user by the first amount, the method further comprising: storing a first compensation instruction for the first instruction while executing the first instruction, wherein the first compensation instruction is an instruction that adds the total number of resources reduced by the first number to the first number; storing a second compensation instruction for the second instruction while executing the second instruction, wherein the second compensation instruction is an instruction to take the resource just issued from the user account; and in the event of a failure of execution of the second or third instruction, executing respective compensation instructions corresponding to all instructions preceding the failed instruction.
Example 2 provides the method of example 1, wherein, in a case of execution failure of the second instruction or the third instruction, executing respective compensation instructions corresponding to all instructions preceding the failed instruction, includes: if the second instruction fails to execute, executing a first compensation instruction; if the third instruction fails to execute, the first compensation instruction and the second compensation instruction are executed.
Example 3 provides the method of example 1, further comprising, in accordance with one or more embodiments of the present disclosure: the first compensation instruction and the second compensation instruction are stored within a stack.
Example 4 provides the method of example 1, further comprising, in accordance with one or more embodiments of the present disclosure: and deleting the first compensation instruction and the second compensation instruction under the condition that the second instruction and the third instruction are successfully executed.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.
Further, while instructions are depicted in a particular order, this should not be understood as requiring that such instructions be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological instructions, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or instructions described above. Rather, the specific features and instructions described above are merely exemplary forms of implementing the claims. With regard to the apparatus in the above embodiments, the specific manner in which each module executes instructions has been described in detail in the embodiments related to the method, and will not be elaborated here.

Claims (10)

1. A resource issuance method comprising executing a first instruction to reduce a total number of resources to be issued by a first amount, executing a second instruction to issue the first amount of the resources to a user account, and executing a third instruction to reduce a total number of user-accessible resources by the first amount, the method further comprising:
storing a first compensation instruction for the first instruction while executing the first instruction, wherein the first compensation instruction is an instruction that adds the total number of resources reduced by the first number to the first number;
storing a second compensation instruction for the second instruction while executing the second instruction, wherein the second compensation instruction is an instruction to take the resource just issued from the user account; and
in the event of a failure of the second or third instruction to execute, executing respective compensation instructions corresponding to all instructions preceding the failed instruction.
2. The method of claim 1, wherein in the event that execution of the second or third instruction fails, executing respective compensation instructions corresponding to all instructions preceding the failed instruction comprises:
if the second instruction fails to execute, executing the first compensation instruction;
executing the first compensation instruction and the second compensation instruction if the third instruction fails to execute.
3. The method of claim 1, wherein the first compensation instruction and the second compensation instruction are stored within a stack.
4. The method of any of claims 1-3, wherein the first compensation instruction and the second compensation instruction are deleted if the second instruction and the third instruction both execute successfully.
5. A resource distribution apparatus, the apparatus comprising: a first module for executing a first instruction that reduces a total number of resources to be issued by a first number; a second module for executing a second instruction to issue the first amount of the resource to a user account; and a third module for executing a third instruction to reduce a total number of user-accessible resources by the first number;
it is characterized in that the device further comprises:
a storage module, configured to store a first compensation instruction for the first instruction while the first module executes the first instruction, and store a second compensation instruction for the second instruction while the second module executes the second instruction, where the first compensation instruction is an instruction that adds the total amount of the resources after the first amount is reduced to the first amount, and the second compensation instruction is an instruction that takes away the resource that has just been issued from the user account; and
a fourth module for executing respective compensation instructions corresponding to all instructions preceding the failed instruction, if execution of the second instruction or the third instruction fails.
6. The apparatus of claim 5, wherein in the event that execution of the second or third instruction fails, executing respective compensation instructions corresponding to all instructions preceding the failed instruction comprises:
if the second instruction fails to execute, executing the first compensation instruction;
executing the first compensation instruction and the second compensation instruction if the third instruction fails to execute.
7. The apparatus of claim 5, wherein the first compensation instruction and the second compensation instruction are stored within a stack.
8. The apparatus according to any one of claims 5 to 7, further comprising a deletion module configured to delete the first compensation instruction and the second compensation instruction stored in the storage module if the second instruction and the third instruction are both executed successfully.
9. A computer-readable medium, on which a computer program is stored, characterized in that the program, when being executed by processing means, carries out the steps of the method of any one of claims 1-4.
10. An electronic device, comprising:
a storage device having a computer program stored thereon;
processing means for executing the computer program in the storage means to carry out the steps of the method according to any one of claims 1 to 4.
CN202010479686.2A 2020-05-29 2020-05-29 Resource issuing method, device, medium and equipment Active CN111626787B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010479686.2A CN111626787B (en) 2020-05-29 2020-05-29 Resource issuing method, device, medium and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010479686.2A CN111626787B (en) 2020-05-29 2020-05-29 Resource issuing method, device, medium and equipment

Publications (2)

Publication Number Publication Date
CN111626787A true CN111626787A (en) 2020-09-04
CN111626787B CN111626787B (en) 2023-09-01

Family

ID=72271967

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010479686.2A Active CN111626787B (en) 2020-05-29 2020-05-29 Resource issuing method, device, medium and equipment

Country Status (1)

Country Link
CN (1) CN111626787B (en)

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006053730A (en) * 2004-08-11 2006-02-23 Chugoku Electric Power Co Inc:The Processing system, computer and program for obstructive transfer compensation business
US20060195844A1 (en) * 2005-02-25 2006-08-31 Microsoft Corporation Task execution mechanism with automated condition checking and compensation
US20100281490A1 (en) * 2009-04-29 2010-11-04 International Business Machines Corporation Generating transaction message
US20110106696A1 (en) * 2009-10-30 2011-05-05 Ryan Seven Systems, Methods and Computer Program Products for Payment Processing
WO2017058148A1 (en) * 2015-09-28 2017-04-06 Hewlett Packard Enterprise Development Lp Executing transactions based on success or failure of the transactions
CN107730296A (en) * 2017-01-04 2018-02-23 北京奥斯达兴业科技有限公司 Parking lot electronic coupons distribution method and device
CN108153795A (en) * 2016-12-02 2018-06-12 阿里巴巴集团控股有限公司 A kind of data processing method, system and the device of electronics red packet
US20190057384A1 (en) * 2017-08-17 2019-02-21 Amadeus S.A.S. Generating rollback requests to reverse partially approved payments
US20190196875A1 (en) * 2017-10-27 2019-06-27 EMC IP Holding Company LLC Method, system and computer program product for processing computing task
US20190303803A1 (en) * 2018-03-30 2019-10-03 Mastercard International Incorporated Method and system for providing digital compensation
CN110428320A (en) * 2019-08-06 2019-11-08 中国工商银行股份有限公司 Data processing method and system and electronic equipment and computer-readable medium
CN111008202A (en) * 2018-10-08 2020-04-14 北京京东尚科信息技术有限公司 Distributed transaction processing method and framework
CN111095326A (en) * 2019-04-12 2020-05-01 阿里巴巴集团控股有限公司 Parallel execution of transactions in a distributed ledger system

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006053730A (en) * 2004-08-11 2006-02-23 Chugoku Electric Power Co Inc:The Processing system, computer and program for obstructive transfer compensation business
US20060195844A1 (en) * 2005-02-25 2006-08-31 Microsoft Corporation Task execution mechanism with automated condition checking and compensation
US20100281490A1 (en) * 2009-04-29 2010-11-04 International Business Machines Corporation Generating transaction message
US20110106696A1 (en) * 2009-10-30 2011-05-05 Ryan Seven Systems, Methods and Computer Program Products for Payment Processing
WO2017058148A1 (en) * 2015-09-28 2017-04-06 Hewlett Packard Enterprise Development Lp Executing transactions based on success or failure of the transactions
CN108153795A (en) * 2016-12-02 2018-06-12 阿里巴巴集团控股有限公司 A kind of data processing method, system and the device of electronics red packet
CN107730296A (en) * 2017-01-04 2018-02-23 北京奥斯达兴业科技有限公司 Parking lot electronic coupons distribution method and device
US20190057384A1 (en) * 2017-08-17 2019-02-21 Amadeus S.A.S. Generating rollback requests to reverse partially approved payments
US20190196875A1 (en) * 2017-10-27 2019-06-27 EMC IP Holding Company LLC Method, system and computer program product for processing computing task
US20190303803A1 (en) * 2018-03-30 2019-10-03 Mastercard International Incorporated Method and system for providing digital compensation
CN111008202A (en) * 2018-10-08 2020-04-14 北京京东尚科信息技术有限公司 Distributed transaction processing method and framework
CN111095326A (en) * 2019-04-12 2020-05-01 阿里巴巴集团控股有限公司 Parallel execution of transactions in a distributed ledger system
CN110428320A (en) * 2019-08-06 2019-11-08 中国工商银行股份有限公司 Data processing method and system and electronic equipment and computer-readable medium

Also Published As

Publication number Publication date
CN111626787B (en) 2023-09-01

Similar Documents

Publication Publication Date Title
US20220253458A1 (en) Method and device for synchronizing node data
CN111274503B (en) Data processing method, device, electronic equipment and computer readable medium
CN111400068B (en) Interface control method and device, readable medium and electronic equipment
CN112256231A (en) Volume control method, device, terminal and storage medium
CN110704833A (en) Data permission configuration method, device, electronic device and storage medium
US20230385080A1 (en) Method and apparatus for presenting information on lock screen interface, terminal, and storage medium
CN111596992B (en) Navigation bar display method and device and electronic equipment
CN111460432B (en) On-line document authority control method, device, equipment and computer readable medium
CN111355784A (en) Method, device, medium and electronic equipment for processing request information
CN116302271A (en) Page display method and device and electronic equipment
CN113518183A (en) Camera calling method and device and electronic equipment
CN111444457B (en) Data release method and device, storage medium and electronic equipment
CN111626787B (en) Resource issuing method, device, medium and equipment
CN112163176A (en) Data storage method and device, electronic equipment and computer readable medium
CN111367590A (en) Interrupt event processing method and device
CN111538717A (en) Data processing method and device, electronic equipment and computer readable medium
CN111241443A (en) Method and device for pushing information and electronic equipment
CN111756833A (en) Node processing method and device, electronic equipment and computer readable medium
CN111459893A (en) File processing method and device and electronic equipment
CN112306317A (en) Unread message notification method and device and electronic equipment
CN113391860A (en) Service request processing method and device, electronic equipment and computer storage medium
CN115114051B (en) Node communication method, device, equipment and storage medium
CN115994120B (en) Data file merging method, device, electronic equipment and computer readable medium
CN111262776B (en) Method, device, electronic equipment and computer readable medium for sending notification message
CN111294611B (en) Video insertion method and device, electronic equipment and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant