CN111626787B - Resource issuing method, device, medium and equipment - Google Patents

Resource issuing method, device, medium and equipment Download PDF

Info

Publication number
CN111626787B
CN111626787B CN202010479686.2A CN202010479686A CN111626787B CN 111626787 B CN111626787 B CN 111626787B CN 202010479686 A CN202010479686 A CN 202010479686A CN 111626787 B CN111626787 B CN 111626787B
Authority
CN
China
Prior art keywords
instruction
compensation
executing
resources
instructions
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010479686.2A
Other languages
Chinese (zh)
Other versions
CN111626787A (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

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 issuing method, a device, a medium and equipment, which belong to the technical field of computers and can ensure service consistency. A method of resource issuance, the 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 number of resources to a user account, and executing a third instruction to reduce the total number of user-friendly 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 a first number to the total number of resources reduced by 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 just issued resource from the user account; and in the event that the second or third instruction fails to execute, executing respective compensation instructions corresponding to all instructions preceding the failed instruction.

Description

Resource issuing method, device, medium and equipment
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method, an apparatus, a medium, and a device for resource allocation.
Background
Currently, when issuing coupons to users, it is common practice to first invoke service a to reduce the number of coupons by 1, then invoke service B to place the issued coupons in the user's account, and then invoke service C to reduce the number of coupons to the user by 1. However, if a service is down when it is invoked, for example, if the C service is down, this may result in the user having already taken coupons but the number of coupons is not reduced by 1, which may result in inconsistent traffic.
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 issuing method including 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 number of resources to a user account, and executing a third instruction to reduce the total number of user-available 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 a just issued resource from the user account; and in the event that execution of the second instruction or the third instruction fails, 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 amount; a second module for executing a second instruction to issue the first number of the resources to a user account; and a third module for executing a third instruction to reduce the total number of user-available resources by the first number; the apparatus 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, wherein the first compensation instruction is an instruction to add the total number of resources reduced by the first number to the first number, and the second compensation instruction is an instruction to take out a resource just issued from the user account; and a fourth module for executing, in case of execution failure of the second instruction or the third instruction, respective compensation instructions corresponding to all instructions preceding the failed instruction.
In a third aspect, the present disclosure provides a computer readable medium having stored thereon a computer program which when executed by a processing device 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 said computer program in said storage means to carry out the steps of the method of the first aspect of the disclosure.
By the technical scheme, the first instruction for reducing the total number of the resources to be issued by the first number and the second instruction for issuing the first number of the resources to the user account are executed, and meanwhile, the related compensation instruction is stored, so that the related 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 present disclosure will be set forth in the detailed description which follows.
Drawings
The above and other features, advantages, and aspects of embodiments of the present disclosure will become more apparent by reference to the following detailed description when taken in conjunction with the accompanying drawings. The same or similar reference numbers will be used throughout the drawings to refer to the same or like elements. It should be understood that the figures are schematic and that elements and components 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 yet 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 have been shown in the accompanying 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 are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustration purposes only and are not intended to limit the scope of the present 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. Furthermore, 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 "including" and variations thereof as used herein are intended to be 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. Related definitions of other terms will be given in the description below.
It should be noted that the terms "first," "second," and the like in this disclosure are merely used to distinguish between different devices, modules, or units and are not used to define an order or interdependence of functions performed by the devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those of ordinary skill in the art will appreciate that "one or more" is intended to be understood as "one or more" unless the context clearly indicates otherwise.
The names of messages or information interacted between the various devices in the embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
Fig. 1 is a flowchart of a resource issuing method according to an embodiment of the present disclosure. The resource issuing method 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 number of resources to the user account, and executing a third instruction to reduce the total number of user-available resources by the first amount. As shown in fig. 1, the resource issuing 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 first number to the total number of resources reduced by 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 just issued resource from the user account.
In step S13, in the case where the second instruction or the third instruction fails to execute, respective compensation instructions corresponding to all instructions preceding the failed instruction are executed.
The method comprises the following steps: if the second instruction fails to execute, executing the first compensation instruction; and if the third instruction fails to execute, executing the first compensation instruction and the second compensation instruction.
In the present disclosure, the resource may be one or more of a coupon, a cash gift certificate, a physical object.
In the present disclosure, the execution of the first instruction and the execution of the second instruction may be interchanged, and steps S11 and S12 may also be interchanged.
The following examples describe a resource issuing method according to an embodiment of the present disclosure, and the example in which the resource is a coupon is described as an example.
If the user wishes to get coupons for the campaign, the user clicks on the "get" option on the campaign page. Then, assume that the number of coupons the user wishes to pick up is a first number N 1 After receiving the user's request for acquisition, the resource issuer (e.g., server) executes a first instruction to reduce the total number N of coupons to be issued by a first number N 1 According to the setting of the activity, a first number N 1 May be 1, 2, 3, etc. Moreover, while executing the first instruction, the resource issuer stores 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 N 1 That is, the total number N of coupons to be issued remains unchanged, the resource issuer will not execute the subsequent second and third instructions; if the first instruction is executed successfully, the resource issuer then executes the second instruction to issue a first number N to the user account 1 And while executing the second instruction, the resource issuer stores a second compensation instruction for the second instruction. Then, if the second instruction execution is successful, the resource issuer then executes a third instruction to reduce the total number of user-available coupons M by a first number N 1 The method comprises the steps of carrying out a first treatment on the surface of the If the second instruction fails to execute, this indicates that the first number N has not been successfully issued in the user account 1 The resource issuer executes the first compensation instruction to reduce the first quantity N 1 The total number of coupons after (N-N at this time 1 ) Plus a first number N 1 This 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 user is informed that the complete flow of the coupon is successfully executed; if the third instruction fails to execute, this indicates that the total number of user-available resources M has not been successfully reduced by the first number N 1 The resource issuer will execute the first compensation instruction and the second compensation instruction such that the total number of coupons to be issued is restored to the previous total number N and the just issued coupon is removed from the user account.
By the above technical solution, by storing the first compensation instruction that adds the first number to the total number of resources after the first number is reduced while the first instruction is executed, storing the second compensation instruction that takes the resources just issued from the user account while the second instruction is executed, and executing each compensation instruction corresponding to all instructions before the failed instruction in case that the second instruction or the third instruction is failed to be executed, it is possible to ensure the consistency of the service.
In one embodiment, the first and second compensation instructions may be stored in a stack, but may also be stored in a cache or other electronic device, as long as the compensation instructions can be subsequently invoked for execution in the event of a failure of the second or third instruction.
In one embodiment, under the condition that the second instruction and the third instruction are executed successfully, the first compensation instruction and the second compensation instruction are deleted, so that excessive storage of the compensation instructions can be avoided, the storage space is saved, and the error compensation instruction caused by the subsequent resource issuing flow 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 issuing 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 amount; a second module 22 for executing a second instruction to issue a first amount of resources to the user account; and a third module 23 for executing a third instruction reducing the total number of user-available resources by the first number. As shown in fig. 2, the resource issuing apparatus 2 may further include: a storage module 24 for storing a first compensation instruction for the first instruction while the first module 21 executes the first instruction, which is an instruction to add the first number to the total number of resources after the first number is reduced, and storing a second compensation instruction for the second instruction while the second module 22 executes the second instruction, which is an instruction to take out the just issued resources from the user account; and a fourth module 25 for executing, in case of failure of execution of the second instruction or the third instruction, respective compensation instructions corresponding to all instructions preceding the failed instruction.
By the above technical solution, by storing the first compensation instruction that adds the first number to the total number of resources after the first number is reduced while the first instruction is executed, storing the second compensation instruction that takes the resources just issued from the user account while the second instruction is executed, and executing each compensation instruction corresponding to all instructions before the failed instruction in case that the second instruction or the third instruction is failed to be executed, it is possible to ensure the consistency of the service.
Optionally, in the case that the second instruction or the third instruction fails to execute, executing respective compensation instructions corresponding to all instructions preceding the failed instruction includes: if the second instruction fails to execute, executing the first compensation instruction; and if the third instruction fails to execute, executing the first compensation instruction and the second compensation instruction.
Optionally, the first compensation instruction and the second compensation instruction are stored within a stack.
Fig. 3 is yet another schematic block diagram of a resource issuing apparatus according to an embodiment of the present disclosure. Optionally, as shown in fig. 3, the resource issuing device 2 further includes a deleting module 26, configured to delete the first compensation instruction and the second compensation instruction stored in the storage module 24 in a case where the second instruction and the third instruction are executed successfully.
Referring now to fig. 4, a schematic diagram of an electronic device 600 suitable for use in implementing embodiments of the present disclosure is shown. The terminal devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and stationary terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 4 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
As shown in fig. 4, the electronic device 600 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 601, which may execute various suitable instructions and processes according to a program stored in a Read Only Memory (ROM) 602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data required for instructions of the electronic device 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
In general, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, and the like; an output device 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, magnetic 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 shows an electronic device 600 having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a non-transitory computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via communication means 609, or from storage means 608, or from ROM 602. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by the processing device 601.
It should be noted that the computer readable medium described in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any 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 context of this 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 the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. 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, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
In some implementations, 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 communication 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 networks.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated 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 a first number to the total number of resources reduced by 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 just issued resource from the user account; and in the event that the second or third instruction fails to execute, executing respective compensation instructions corresponding to all instructions preceding the failed instruction. .
Computer program code for carrying out instructions of the present disclosure may be written in 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 kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts 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 which 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 in software or hardware. The name of a module does not in some cases define the module itself.
The functions described above herein 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: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), 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. The 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.
According to one or more embodiments of the present disclosure, example 1 provides a resource provisioning method including executing a first instruction to reduce a total number of resources to be provisioned by a first amount, executing a second instruction to provision a first number of resources to a user account, and executing a third instruction to reduce the total number of user-available 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 a first number to the total number of resources reduced by 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 just issued resource from the user account; and in the event that the second or third instruction fails to execute, executing respective compensation instructions corresponding to all instructions preceding the failed instruction.
In accordance with one or more embodiments of the present disclosure, example 2 provides the method of example 1, wherein, in the event of a failure of execution of the second instruction or the third instruction, 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; and if the third instruction fails to execute, executing the first compensation instruction and the second compensation instruction.
In accordance with one or more embodiments of the present disclosure, example 3 provides the method of example 1, further comprising: the first compensation instruction and the second compensation instruction are stored within the stack.
In accordance with one or more embodiments of the present disclosure, example 4 provides the method of example 1, further comprising: 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 of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by persons skilled in the art that the scope of the disclosure referred to in this disclosure is not limited to the specific combinations of features described above, but also covers other embodiments which may be formed by any combination of features described above or equivalents thereof without departing from the spirit of the disclosure. Such as those described above, are mutually substituted with the technical features having similar functions disclosed in the present disclosure (but not limited thereto).
Moreover, although instructions are depicted in a particular order, this should not be understood as requiring that such instructions be executed in the particular order shown, or in sequential order. In 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 limiting the scope of the present 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 acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and instructions described above are merely exemplary forms of implementing the claims. The specific manner in which the respective modules execute the instructions in the apparatus of the above embodiments has been described in detail in relation to the embodiments of the method, and will not be described in detail here.

Claims (10)

1. A resource issuing method comprising executing a first instruction to reduce the total number of resources to be issued by a first amount, executing a second instruction to issue said first number of resources to a user account, and executing a third instruction to reduce the total number of user-available resources by said first amount, characterized in that the method further comprises:
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 a just issued resource from the user account; and
in the case where the second instruction execution fails or in the case where the third instruction execution fails, respective compensation instructions corresponding to all instructions executed before the failed instruction are executed.
2. The method of claim 1, wherein the executing each compensation instruction corresponding to all instructions executed prior to the failed instruction if the second instruction fails to execute or if the third instruction fails to execute, comprises:
if the second instruction fails to execute, executing the first compensation instruction corresponding to the first instruction executed before the second instruction;
if the third instruction fails to execute, the first and second compensation instructions corresponding to the first and second instructions executed before the third instruction, respectively, are executed.
3. The method of claim 1, wherein the first compensation instruction and the second compensation instruction are stored within a stack.
4. A method according to any one of claims 1 to 3, wherein the first and second compensation instructions are deleted in case the second and third instructions are executed successfully.
5. A resource issuing 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 amount; a second module for executing a second instruction to issue the first number of the resources to a user account; and a third module for executing a third instruction to reduce the total number of user-available resources by the first number;
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, wherein the first compensation instruction is an instruction to add the total number of resources reduced by the first number to the first number, and the second compensation instruction is an instruction to take out a resource just issued from the user account; and
and a fourth module for executing each compensation instruction corresponding to all instructions executed before the failed instruction in case of failure of execution of the second instruction or in case of failure of execution of the third instruction.
6. The apparatus of claim 5, wherein the executing each compensation instruction corresponding to all instructions executed prior to the failed instruction if the second instruction fails to execute or if the third instruction fails to execute, comprises:
if the second instruction fails to execute, executing the first compensation instruction corresponding to the first instruction executed before the second instruction;
if the third instruction fails to execute, the first and second compensation instructions corresponding to the first and second instructions executed before the third instruction, respectively, are executed.
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 a processing device, carries out the steps of the method according to any one of claims 1-4.
10. An electronic device, comprising:
a storage device having a computer program stored thereon;
processing means for executing said computer program in said storage means to carry out the steps of the method according to any one of claims 1-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 CN111626787A (en) 2020-09-04
CN111626787B true 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 (3)

* 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
WO2017058148A1 (en) * 2015-09-28 2017-04-06 Hewlett Packard Enterprise Development Lp Executing transactions based on success or failure of the transactions
CN110428320A (en) * 2019-08-06 2019-11-08 中国工商银行股份有限公司 Data processing method and system and electronic equipment and computer-readable medium

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060195844A1 (en) * 2005-02-25 2006-08-31 Microsoft Corporation Task execution mechanism with automated condition checking and compensation
US11182752B2 (en) * 2009-04-29 2021-11-23 International Business Machines Corporation Generating transaction message
WO2011053934A2 (en) * 2009-10-30 2011-05-05 Ryan Seven Systems, methods and computer program products for payment processing
CN108153795B (en) * 2016-12-02 2023-12-26 阿里巴巴集团控股有限公司 Data processing method, system and device for electronic 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
CN109729106B (en) * 2017-10-27 2021-07-16 伊姆西Ip控股有限责任公司 Method, system and computer program product for processing computing tasks
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
SG11201909757RA (en) * 2019-04-12 2019-11-28 Alibaba Group Holding Ltd Performing parallel execution of transactions in a distributed ledger system

Patent Citations (3)

* 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
WO2017058148A1 (en) * 2015-09-28 2017-04-06 Hewlett Packard Enterprise Development Lp Executing transactions based on success or failure of the transactions
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
CN111626787A (en) 2020-09-04

Similar Documents

Publication Publication Date Title
US20220253458A1 (en) Method and device for synchronizing node data
CN111555940B (en) Client test method and device, electronic equipment and computer readable storage medium
CN111274503B (en) Data processing method, device, electronic equipment and computer readable medium
CN111309415B (en) User Interface (UI) information processing method and device of application program and electronic equipment
CN112256231B (en) Volume control method, device, terminal and storage medium
CN110865852B (en) Webpage component loading method and device, electronic equipment and storage medium
CN112379982B (en) Task processing method, device, electronic equipment and computer readable storage medium
CN111857720B (en) User interface state information generation method and device, electronic equipment and medium
CN111400068B (en) Interface control method and device, readable medium and electronic equipment
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
CN111858381B (en) Application fault tolerance capability test method, electronic device and medium
CN111460432B (en) On-line document authority control method, device, equipment and computer readable medium
CN113391860B (en) Service request processing method and device, electronic equipment and computer storage medium
CN110888773B (en) Method, device, medium and electronic equipment for acquiring thread identification
CN116302271A (en) Page display method and device and electronic equipment
CN111626787B (en) Resource issuing method, device, medium and equipment
WO2023273564A1 (en) Virtual machine memory management method and apparatus, storage medium, and electronic device
CN111756833B (en) Node processing method, node processing device, electronic equipment and computer readable medium
CN111538717B (en) Data processing method, device, electronic equipment and computer readable medium
CN111459893B (en) File processing method and device and electronic equipment
CN111444457B (en) Data release method and device, storage medium and electronic equipment
CN111338827B (en) Method and device for pasting form data and electronic equipment
CN113518183A (en) Camera calling method and device and electronic equipment
CN110764995B (en) Method, device, medium and electronic equipment for detecting file access abnormality

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