Electronic voucher issuance control method, device, computer equipment and storage medium
By evenly allocating the electronic vouchers to be issued to multiple queues in high concurrency scenarios, and selecting target electronic vouchers from these queues for issuance, the problem of low efficiency in electronic vouchers in traditional methods is solved, and more efficient electronic vouchers are achieved.
Patent Information
- Application Number
- CN202210365065.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-08
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2042-04-08
AI Technical Summary
In high concurrency scenarios, traditional electronic voucher issuance methods are prone to conflict and long queues, resulting in low efficiency in issuance of electronic vouchers.
By selecting the target electronic voucher queue from M electronic voucher queues and distributing the first N electronic vouchers to be issued evenly into these queues, dispersing concurrent pressure when issuing electronic vouchers and reducing conflicts.
It improves the efficiency of issuing electronic vouchers, simplifies the distribution process of electronic vouchers, and avoids complex processing caused by uneven number of electronic vouchers queues.
Smart Images

Figure CN114638655B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to an electronic voucher issuance control method, apparatus, computer equipment, storage medium and computer program product. Background Art
[0002] With the development of Internet technology, various electronic coupons have appeared on the Internet for users to use when selecting goods.
[0003] In traditional technology, when there are sufficient electronic coupons, all electronic coupons are generally arranged, and electronic coupons are selected from the arranged electronic coupons for issuance based on requests; however, in high concurrency scenarios, all requests are competing for the electronic coupons at the front, which can easily cause conflicts and long waiting times, resulting in low efficiency in electronic coupon issuance. Summary of the invention
[0004] Based on this, it is necessary to provide an electronic voucher issuance control method, device, computer equipment, computer readable storage medium and computer program product that can improve the efficiency of electronic voucher issuance in response to the above technical problems.
[0005] In a first aspect, the present application provides a method for controlling the issuance of an electronic voucher. The method comprises:
[0006] In response to an electronic voucher issuance request, a target electronic voucher is selected from a target electronic voucher queue in the M electronic voucher queues for issuance; the target electronic voucher queue is the selected electronic voucher queue, and the target electronic voucher is the first electronic voucher in each target electronic voucher queue; the electronic vouchers stored in the M electronic voucher queues are obtained by evenly distributing the first N electronic vouchers among the electronic vouchers to be issued;
[0007] The electronic voucher to be issued is updated according to the target electronic voucher to obtain an updated electronic voucher to be issued;
[0008] Evenly distribute the first N electronic coupons among the updated electronic coupons to be issued to the M electronic coupon queues to obtain the updated M electronic coupon queues;
[0009] From the target electronic voucher queues in the updated M electronic voucher queues, target electronic vouchers are selected for issuance until the updated number of electronic vouchers to be issued is less than N.
[0010] In one of the embodiments, before selecting a target electronic voucher from a target electronic voucher queue in the M electronic voucher queues for issuance in response to the electronic voucher issuance request, the method further includes:
[0011] When the number of electronic coupons to be issued is greater than or equal to N, selecting the first N electronic coupons from the electronic coupons to be issued;
[0012] The first N electronic coupons are evenly grouped to obtain M groups of electronic coupons;
[0013] The M groups of electronic coupons are allocated to the M electronic coupon queues.
[0014] In one embodiment, in response to the electronic voucher issuance request, selecting a target electronic voucher from a target electronic voucher queue in the M electronic voucher queues for issuance includes:
[0015] In response to the electronic voucher issuance request, determining a target electronic voucher queue from the M electronic voucher queues;
[0016] Selecting the first electronic voucher from the target electronic voucher queue as the target electronic voucher;
[0017] The target electronic voucher is issued to a terminal corresponding to the electronic voucher issuance request.
[0018] In one embodiment, the updating of the to-be-issued electronic voucher according to the target electronic voucher to obtain an updated to-be-issued electronic voucher includes:
[0019] Deleting the target electronic voucher from the electronic vouchers to be issued, and obtaining the deleted electronic voucher to be issued;
[0020] The deleted electronic voucher to be issued is determined as the updated electronic voucher to be issued.
[0021] In one embodiment, the step of evenly distributing the first N electronic coupons in the updated electronic coupons to be issued to the M electronic coupon queues to obtain the updated M electronic coupon queues includes:
[0022] Selecting the first N electronic coupons again from the updated electronic coupons to be issued;
[0023] The first N electronic coupons selected again are evenly grouped to obtain new M groups of electronic coupons;
[0024] The new M groups of electronic vouchers are allocated to the M electronic voucher queues to obtain updated M electronic voucher queues.
[0025] In one embodiment, selecting a target electronic voucher from the target electronic voucher queue in the updated M electronic voucher queues for issuance until the updated number of electronic vouchers to be issued is less than N further includes:
[0026] When the number of the updated electronic coupons to be issued is less than N, arranging the updated electronic coupons to be issued to obtain arranged electronic coupons to be issued;
[0027] The electronic vouchers are selected in sequence from the arranged electronic vouchers to be issued for issuance.
[0028] In a second aspect, the present application also provides an electronic voucher issuance control device. The device comprises:
[0029] A first selection module is used to select a target electronic voucher from a target electronic voucher queue in M electronic voucher queues for issuance in response to an electronic voucher issuance request; the target electronic voucher queue is the selected electronic voucher queue, and the target electronic voucher is the first electronic voucher in each target electronic voucher queue; the electronic vouchers stored in the M electronic voucher queues are obtained by evenly distributing the first N electronic vouchers among the electronic vouchers to be issued;
[0030] A first updating module, configured to update the electronic voucher to be issued according to the target electronic voucher to obtain an updated electronic voucher to be issued;
[0031] A second updating module, configured to evenly distribute the first N electronic coupons among the updated electronic coupons to be issued to the M electronic coupon queues to obtain the updated M electronic coupon queues;
[0032] The second selection module is used to select a target electronic voucher from the target electronic voucher queues in the updated M electronic voucher queues for issuance until the updated number of electronic vouchers to be issued is less than N.
[0033] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0034] In response to an electronic voucher issuance request, a target electronic voucher is selected from a target electronic voucher queue in the M electronic voucher queues for issuance; the target electronic voucher queue is the selected electronic voucher queue, and the target electronic voucher is the first electronic voucher in each target electronic voucher queue; the electronic vouchers stored in the M electronic voucher queues are obtained by evenly distributing the first N electronic vouchers among the electronic vouchers to be issued;
[0035] The electronic voucher to be issued is updated according to the target electronic voucher to obtain an updated electronic voucher to be issued;
[0036] Evenly distribute the first N electronic coupons among the updated electronic coupons to be issued to the M electronic coupon queues to obtain the updated M electronic coupon queues;
[0037] From the target electronic voucher queues in the updated M electronic voucher queues, target electronic vouchers are selected for issuance until the updated number of electronic vouchers to be issued is less than N.
[0038] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0039] In response to an electronic voucher issuance request, a target electronic voucher is selected from a target electronic voucher queue in the M electronic voucher queues for issuance; the target electronic voucher queue is the selected electronic voucher queue, and the target electronic voucher is the first electronic voucher in each target electronic voucher queue; the electronic vouchers stored in the M electronic voucher queues are obtained by evenly distributing the first N electronic vouchers among the electronic vouchers to be issued;
[0040] The electronic voucher to be issued is updated according to the target electronic voucher to obtain an updated electronic voucher to be issued;
[0041] Evenly distribute the first N electronic coupons among the updated electronic coupons to be issued to the M electronic coupon queues to obtain the updated M electronic coupon queues;
[0042] From the target electronic voucher queues in the updated M electronic voucher queues, target electronic vouchers are selected for issuance until the updated number of electronic vouchers to be issued is less than N.
[0043] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0044] In response to an electronic voucher issuance request, a target electronic voucher is selected from a target electronic voucher queue in the M electronic voucher queues for issuance; the target electronic voucher queue is the selected electronic voucher queue, and the target electronic voucher is the first electronic voucher in each target electronic voucher queue; the electronic vouchers stored in the M electronic voucher queues are obtained by evenly distributing the first N electronic vouchers among the electronic vouchers to be issued;
[0045] The electronic voucher to be issued is updated according to the target electronic voucher to obtain an updated electronic voucher to be issued;
[0046] Evenly distribute the first N electronic coupons among the updated electronic coupons to be issued to the M electronic coupon queues to obtain the updated M electronic coupon queues;
[0047] From the target electronic voucher queues in the updated M electronic voucher queues, target electronic vouchers are selected for issuance until the updated number of electronic vouchers to be issued is less than N.
[0048] The above-mentioned electronic voucher issuance control method, device, computer equipment, storage medium and computer program product select a target electronic voucher for issuance from a target electronic voucher queue in M electronic voucher queues in response to an electronic voucher issuance request; the target electronic voucher queue is the selected electronic voucher queue, and the target electronic voucher is the first electronic voucher in each target electronic voucher queue; the electronic vouchers stored in the M electronic voucher queues are obtained by evenly distributing the first N electronic vouchers in the electronic vouchers to be issued; then the electronic vouchers to be issued are updated according to the target electronic vouchers to obtain updated electronic vouchers to be issued; the first N electronic vouchers in the updated electronic vouchers to be issued are evenly distributed to the M electronic voucher queues to obtain the updated M electronic voucher queues; finally, the target electronic voucher is selected from the target electronic voucher queue in the updated M electronic voucher queues for issuance until the number of updated electronic vouchers to be issued is less than N. In this way, when the number of electronic vouchers to be issued is greater than or equal to N, the first N electronic vouchers to be issued are evenly distributed to the M electronic voucher queues, which is conducive to dispersing concurrent pressure, reducing electronic voucher issuance conflicts, and thus improving the efficiency of electronic voucher issuance; at the same time, each time a target electronic voucher is selected from a target electronic voucher queue in the M electronic voucher queues for issuance, and then the M electronic voucher queues are updated to ensure that the number of electronic vouchers in each electronic voucher queue is the same, which simplifies the reallocation process, is conducive to ensuring the timely issuance of electronic vouchers, and further improves the efficiency of electronic voucher issuance; it avoids the situation where the number of electronic vouchers in each electronic voucher queue is unbalanced after a period of time, and the electronic vouchers in other electronic voucher queues need to be allocated to an empty electronic voucher queue, while the number of electronic vouchers in each electronic voucher queue is different, and the allocation scheme is also different, which is more complicated to handle, resulting in the defect of low electronic voucher issuance efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 It is a flowchart of an electronic voucher issuance control method in one embodiment;
[0050] Figure 2 A flowchart of steps for allocating M groups of electronic coupons to M electronic coupon queues in one embodiment;
[0051] Figure 3 A schematic diagram of a flow chart of steps for selecting a target electronic voucher for issuance in one embodiment;
[0052] Figure 4 It is a flowchart of an electronic voucher issuance control method in another embodiment;
[0053] Figure 5 It is a structural block diagram of an electronic voucher issuance control device in one embodiment;
[0054] Figure 6FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0056] In one embodiment, Figure 1 As shown, a method for controlling the issuance of an electronic voucher is provided, which is described by taking the method applied to a server as an example, and includes the following steps:
[0057] Step S101 , in response to an electronic voucher issuance request, selecting a target electronic voucher from a target electronic voucher queue in M electronic voucher queues for issuance.
[0058] The target electronic voucher queue is the selected electronic voucher queue, the target electronic voucher is the first electronic voucher in each target electronic voucher queue; the electronic vouchers stored in the M electronic voucher queues are evenly distributed from the first N electronic vouchers to be issued. M is a positive integer, and N is a positive integer.
[0059] The electronic voucher refers to various electronic vouchers on the Internet, such as electronic vouchers, electronic coupons, etc., which are not specifically limited here. The electronic voucher issuance request refers to a request for obtaining an electronic voucher, such as an electronic voucher collection request, which is generally a high-concurrency request.
[0060] Among them, the electronic voucher queue refers to a queue storing electronic vouchers, and each distributed machine corresponds to an electronic voucher queue. Each electronic voucher queue stores the same number of electronic vouchers in order. Except for the last electronic voucher queue, the next sequence number of the sequence number of the last electronic voucher in each electronic voucher queue is the sequence number of the first electronic voucher in the next electronic voucher queue. For example, there are a total of 5 electronic voucher queues, the first electronic voucher queue stores electronic vouchers with sequence numbers 1-10, the second electronic voucher queue stores electronic vouchers with sequence numbers 11-20, the third electronic voucher queue stores electronic vouchers with sequence numbers 21-30, the fourth electronic voucher queue stores electronic vouchers with sequence numbers 31-40, and the fifth electronic voucher queue stores electronic vouchers with sequence numbers 41-50.
[0061] The selected electronic voucher queue refers to the queue that responds to the electronic voucher issuance request this time; the electronic voucher queue selected each time is random, and the number of selected electronic voucher queues is less than or equal to M. Assuming that the first electronic voucher queue is the selected electronic voucher queue, the target electronic voucher is the electronic voucher with a sequence number of 1 in the first electronic voucher queue. Assuming that the first electronic voucher queue, the second electronic voucher queue and the third electronic voucher queue are the selected electronic voucher queues, the target electronic voucher is the electronic voucher with a sequence number of 1 in the first electronic voucher queue, the electronic voucher with a sequence number of 11 in the second electronic voucher queue, and the electronic voucher with a sequence number of 21 in the third electronic voucher queue.
[0062] Among them, the electronic vouchers to be issued refer to the electronic vouchers that need to be issued; the number of electronic vouchers to be issued is generally large, such as 100,000; the electronic vouchers to be issued are arranged in order, and each electronic voucher to be issued is marked with a corresponding number, such as 1, 2, 3, 4, 5, 6...99998, 99999, 100000. N is generally greater than the maximum concurrent number, for example, N is 50, and the maximum concurrent number is 10. The number of electronic vouchers in each electronic voucher queue is greater than or equal to (maximum concurrent number / M); in general, the number of electronic vouchers in each electronic voucher queue is greater than or equal to [(maximum concurrent number×2) / M].
[0063] It should be noted that the first time is to evenly distribute the first N electronic coupons in the electronic coupons to be issued arranged in sequence to M electronic coupon queues for storage; for example, N = 50, M = 5, the electronic coupons with serial numbers from 1 to 50 in the electronic coupons to be issued are evenly divided into 5 groups of electronic coupons, namely 1-10, 11-20, 21-30, 31-40 and 41-50, and distributed to 5 electronic coupon queues, the first electronic coupon queue: 1-10, the second electronic coupon queue: 11-20, the third electronic coupon queue: 21-30, the fourth electronic coupon queue: 31-40, and the fifth electronic coupon queue: 41-50. After issuing an electronic coupon, such as the electronic coupon with serial number 21, the server will select the first N electronic coupons (such as 1, 2, 3...20, 22, 23...49, 50, 51) from the remaining sorted electronic coupons to be issued, and then evenly distribute them to M electronic coupon queues for storage.
[0064] Specifically, when the number of electronic vouchers to be issued is greater than or equal to N, the server arranges the electronic vouchers to be issued, and selects the first N electronic vouchers from the electronic vouchers to be issued arranged in order; the first N electronic vouchers are evenly distributed to M electronic voucher queues for storage. After receiving the electronic voucher issuance request, the server determines the corresponding electronic voucher queue from the M electronic voucher queues as the target electronic voucher queue according to the electronic voucher issuance request; determines the first electronic voucher in the target electronic voucher queue as the target electronic voucher, and sends the target electronic voucher to the corresponding terminal.
[0065] For example, the server selects the first 50 electronic coupons (such as 1, 2, 3, 4, 5, 6...99998, 99999, 100000) from the electronic coupons to be issued in sequence (such as 1, 2, 3, 4, 5, 6...50), and divides them into 5 groups, and allocates each group of electronic coupons to each electronic coupon queue; among them, the first electronic coupon queue: 1-10, the second electronic coupon queue: 11-20, the third electronic coupon queue: 21-30, the fourth electronic coupon queue: 31-40, the fifth electronic coupon queue: 41-50; assuming that the selected electronic coupon queue is the third electronic coupon queue, the first electronic coupon in the third electronic coupon queue (serial number 21) will be issued to the corresponding terminal.
[0066] Step S102, updating the electronic voucher to be issued according to the target electronic voucher to obtain an updated electronic voucher to be issued.
[0067] Here, updating the electronic voucher to be issued according to the target electronic voucher means deleting the target electronic voucher from the electronic vouchers to be issued, so that the updated electronic vouchers to be issued do not include the target electronic voucher.
[0068] Specifically, the server deletes the target electronic voucher from the electronic vouchers to be issued, obtains the remaining electronic vouchers to be issued, and reorders the remaining electronic vouchers to be issued to obtain the reordered electronic vouchers to be issued as updated electronic vouchers to be issued.
[0069] For example, assuming that the target electronic voucher is the electronic voucher with serial number 21, the server deletes the electronic voucher with serial number 21 from the electronic vouchers to be issued (for example, 1, 2, 3, 4, 5, 6...99998, 99999, 100000), and obtains the remaining electronic vouchers to be issued (for example, 1, 2, 3, 4, 5, 6...20, 22, 23...99998, 99999, 100000), and re-orders the remaining electronic vouchers to be issued to obtain updated electronic vouchers to be issued (for example, 1, 2, 3, 4, 5, 6...99997, 99998, 99999).
[0070] Step S103, evenly distribute the first N electronic coupons in the updated electronic coupons to be issued to M electronic coupon queues to obtain the updated M electronic coupon queues.
[0071] The updated M electronic voucher queues store the latest allocated electronic vouchers.
[0072] Specifically, the server selects the first N electronic coupons from the updated electronic coupons to be issued again; distributes the first N electronic coupons evenly to M electronic coupon queues, so that each electronic coupon queue stores the same number of latest electronic coupons in sequence, thereby obtaining updated M electronic coupon queues.
[0073] For example, the server selects the first 50 electronic coupons (such as 1, 2, 3, 4, 5, 6...99997, 99998, 99999) from the updated electronic coupons to be issued (such as 1, 2, 3, 4, 5, 6...99997, 99998, 99999), and divides them into 5 groups, and redistributes each group of electronic coupons to M electronic coupon queues; among them, the first electronic coupon queue: 1-10, replaces the original second electronic coupon queue: 11-20, the third electronic coupon queue: 21-30, the fourth electronic coupon queue: 31-40, and the fifth electronic coupon queue: 41-50.
[0074] Step S104: Select a target electronic voucher from the target electronic voucher queue in the updated M electronic voucher queues for issuance, until the updated number of electronic vouchers to be issued is less than N.
[0075] Specifically, the server determines the corresponding electronic voucher queue from the updated M electronic voucher queues as the target electronic voucher queue based on the received electronic voucher issuance request; determines the first electronic voucher in each target electronic voucher queue as the target electronic voucher, and sends the target electronic voucher to the corresponding terminal; repeats steps S102 to S104 until the updated number of electronic vouchers to be issued is less than N.
[0076] For example, assuming that the target electronic voucher queue is the fourth electronic voucher queue, the first electronic voucher (serial number 31) in the fourth electronic voucher queue is issued to the corresponding terminal, and the electronic voucher with serial number 31 is deleted from the electronic vouchers to be issued (for example, 1, 2, 3, 4, 5, 6...99997, 99998, 99999), and the remaining electronic vouchers to be issued are obtained (for example, 1, 2, 3, 4, 5, 6...30, 32, 33...99997, 99998, 99999), and the remaining electronic vouchers to be issued are re-sorted to obtain updated electronic vouchers to be issued (for example, 1, 2, 3, 4, 5, 6...99996, 99997, 99998). From the updated electronic vouchers to be issued (such as 1, 2, 3, 4, 5, 6...99996, 99997, 99998), select the first 50 electronic vouchers (such as 1, 2, 3, 4, 5, 6...50) and divide them into 5 groups, and redistribute each group of electronic vouchers to M electronic voucher queues; among them, the first electronic voucher queue: 1-10, replaces the original second electronic voucher queue: 11-20, the third electronic voucher queue: 21-30, the fourth electronic voucher queue: 31-40, the fifth electronic voucher queue: 41-50; select the first electronic voucher from the target electronic voucher queue among these 5 electronic voucher queues for issuance, and repeat the above process until the number of updated electronic vouchers to be issued is less than 50.
[0077] In the above-mentioned electronic voucher issuance control method, by responding to the electronic voucher issuance request, a target electronic voucher is selected from a target electronic voucher queue in M electronic voucher queues for issuance; the target electronic voucher queue is the selected electronic voucher queue, and the target electronic voucher is the first electronic voucher in each target electronic voucher queue; the electronic vouchers stored in the M electronic voucher queues are obtained by evenly distributing the first N electronic vouchers in the electronic vouchers to be issued; then the electronic vouchers to be issued are updated according to the target electronic vouchers to obtain updated electronic vouchers to be issued; the first N electronic vouchers in the updated electronic vouchers to be issued are evenly distributed to the M electronic voucher queues to obtain updated M electronic voucher queues; finally, the target electronic voucher is selected from the target electronic voucher queue in the updated M electronic voucher queues for issuance, until the number of updated electronic vouchers to be issued is less than N. In this way, when the number of electronic vouchers to be issued is greater than or equal to N, the first N electronic vouchers to be issued are evenly distributed to the M electronic voucher queues, which is conducive to dispersing concurrent pressure, reducing electronic voucher issuance conflicts, and thus improving the efficiency of electronic voucher issuance; at the same time, each time a target electronic voucher is selected from a target electronic voucher queue in the M electronic voucher queues for issuance, and then the M electronic voucher queues are updated to ensure that the number of electronic vouchers in each electronic voucher queue is the same, which simplifies the reallocation process, is conducive to ensuring the timely issuance of electronic vouchers, and further improves the efficiency of electronic voucher issuance; it avoids the situation where the number of electronic vouchers in each electronic voucher queue is unbalanced after a period of time, and the electronic vouchers in other electronic voucher queues need to be allocated to an empty electronic voucher queue, while the number of electronic vouchers in each electronic voucher queue is different, and the allocation scheme is also different, which is more complicated to handle, resulting in the defect of low electronic voucher issuance efficiency.
[0078] In one embodiment, Figure 2 As shown, the above step S101, before selecting a target electronic voucher from the target electronic voucher queues in the M electronic voucher queues for issuance in response to the electronic voucher issuance request, further includes the following steps:
[0079] Step S201: When the number of electronic coupons to be issued is greater than or equal to N, the first N electronic coupons are selected from the electronic coupons to be issued.
[0080] Step S202: group the first N electronic coupons equally to obtain M groups of electronic coupons.
[0081] Step S203, allocating M groups of electronic coupons to M electronic coupon queues.
[0082] When performing average grouping, the number of electronic coupon groups is the same as the number of electronic coupon queue columns.
[0083] The allocating M groups of electronic coupons to the M electronic coupon queues means allocating each group of electronic coupons to each electronic coupon queue respectively.
[0084] For example, when the number of electronic coupons to be issued (for example, 100,000) is greater than or equal to N (for example, 50), the server arranges the electronic coupons to be issued in order to obtain the electronic coupons to be issued arranged in order (for example, 1, 2, 3, 4, 5, 6 ... 99998, 99999, 100000); selects the first N electronic coupons (for example, 1, 2, 3, 4, 5, 6 ... 50) from the electronic coupons to be issued arranged in order; determines the number of electronic coupons to be issued according to the number of each electronic coupon queue. The number of allocated groups is, for example, 5 groups; according to the number of groups to be allocated, the first N electronic coupons are evenly grouped to obtain M groups of electronic coupons, namely 1-10, 11-20, 21-30, 31-40 and 41-50, and each group of electronic coupons is allocated to each electronic coupon queue for storage; among them, the first electronic coupon queue: 1-10, the second electronic coupon queue: 11-20, the third electronic coupon queue: 21-30, the fourth electronic coupon queue: 31-40, and the fifth electronic coupon queue: 41-50.
[0085] In this embodiment, when the number of electronic coupons to be issued is greater than or equal to N, the first N electronic coupons to be issued are evenly distributed to each electronic coupon queue, which is conducive to dispersing concurrent pressure, reducing electronic coupon issuance conflicts, and thus improving electronic coupon issuance efficiency.
[0086] In one embodiment, Figure 3 As shown, the above step S101, in response to the electronic voucher issuance request, selects a target electronic voucher from the target electronic voucher queue in the M electronic voucher queues for issuance, and specifically includes the following steps:
[0087] Step S301, in response to an electronic voucher issuance request, determining a target electronic voucher queue from M electronic voucher queues.
[0088] Step S302: Select the first electronic voucher from the target electronic voucher queue as the target electronic voucher.
[0089] Step S303: issuing the target electronic voucher to the terminal corresponding to the electronic voucher issuance request.
[0090] Specifically, in response to the electronic voucher issuance request, the server determines a corresponding electronic voucher queue from M electronic voucher queues as a target electronic voucher queue; selects the first electronic voucher from the target electronic voucher queue, and determines the first electronic voucher as the target electronic voucher; and issues the target electronic voucher to the terminal corresponding to the electronic voucher issuance request, so that the terminal receives the issued target electronic voucher.
[0091] For example, suppose there are 5 electronic voucher queues, among which the first electronic voucher queue: 1-10, the second electronic voucher queue: 11-20, the third electronic voucher queue: 21-30, the fourth electronic voucher queue: 31-40, and the fifth electronic voucher queue: 41-50; assuming that the selected electronic voucher queue is the second electronic voucher queue, the first electronic voucher (serial number 11) in the second electronic voucher queue will be issued to the corresponding terminal.
[0092] In this embodiment, in response to an electronic voucher issuance request, a target electronic voucher is selected from a target electronic voucher queue in the M electronic voucher queues for issuance, which is beneficial to dispersing concurrent pressure, reducing waiting time, and thus improving the efficiency of electronic voucher issuance.
[0093] In one embodiment, the above step S102, updating the electronic voucher to be issued according to the target electronic voucher to obtain the updated electronic voucher to be issued, specifically includes: deleting the target electronic voucher from the electronic vouchers to be issued to obtain the deleted electronic voucher to be issued; determining the deleted electronic voucher to be issued as the updated electronic voucher to be issued.
[0094] For example, assuming that the target electronic voucher is the electronic voucher with serial number 31, the server deletes the electronic voucher with serial number 31 from the electronic vouchers to be issued (for example, 1, 2, 3, 4, 5, 6...99998, 99999, 100000), and obtains the remaining electronic vouchers to be issued (for example, 1, 2, 3, 4, 5, 6...30, 32, 33...99998, 99999, 100000), and reorders the remaining electronic vouchers to be issued in order to obtain the reordered electronic vouchers to be issued (1, 2, 3, 4, 5, 6...99997, 99998, 99999) as the updated electronic vouchers to be issued.
[0095] In this embodiment, after selecting the target electronic voucher for issuance from the target electronic voucher queue in the M electronic voucher queues, the M electronic voucher queues are updated to ensure that the number of electronic vouchers in each electronic voucher queue is the same, which simplifies the reallocation process, is conducive to ensuring the timely issuance of electronic vouchers, and further improves the efficiency of electronic voucher issuance; it avoids the situation where the number of electronic vouchers in each electronic voucher queue is unbalanced after a period of time, and the electronic vouchers in other electronic voucher queues need to be allocated to an empty electronic voucher queue. The number of electronic vouchers in each electronic voucher queue is different, and the allocation scheme is also different, which makes the processing more complicated, resulting in the defect of low efficiency in electronic voucher issuance.
[0096] In one embodiment, the above step S103 evenly distributes the first N electronic coupons among the updated electronic coupons to be issued to M electronic coupon queues to obtain updated M electronic coupon queues, which specifically includes: selecting the first N electronic coupons again from the updated electronic coupons to be issued; evenly grouping the first N electronic coupons selected again to obtain new M groups of electronic coupons; and distributing the new M groups of electronic coupons to M electronic coupon queues to obtain updated M electronic coupon queues.
[0097] Among them, the first N electronic coupons selected again are also evenly grouped according to the number of each electronic coupon queue.
[0098] For example, the server selects the first N electronic coupons (such as 1, 2, 3, 4, 5, 6...99997, 99998, 99999) from the updated electronic coupons to be issued (such as 1, 2, 3, 4, 5, 6...50); determines the number of groups to be allocated according to the number of each electronic coupon queue, such as 5 groups; according to the number of groups to be allocated, the first N electronic coupons selected again are evenly grouped to obtain M groups of new electronic coupons, namely 1-10, 11-20, 21-30, 31-40 and 41-50, and each group of new electronic coupons is allocated to each electronic coupon queue for storage to obtain the updated M electronic coupon queues; among them, the updated first electronic coupon queue: 1-10, the updated second electronic coupon queue: 11-20, the updated third electronic coupon queue: 21-30, the updated fourth electronic coupon queue: 31-40, and the updated fifth electronic coupon queue: 41-50.
[0099] In this embodiment, the first N electronic coupons are selected again from the updated electronic coupons to be issued; the first N electronic coupons selected again are evenly grouped to obtain new M groups of electronic coupons; the new M groups of electronic coupons are allocated to M electronic coupon queues to obtain updated M electronic coupon queues, which is conducive to the subsequent selection of target electronic coupons from the target electronic coupon queues in the updated M electronic coupon queues for issuance, thereby ensuring the timely issuance of electronic coupons and further improving the efficiency of electronic coupon issuance.
[0100] In one embodiment, the above step S104, in which a target electronic voucher is selected from the target electronic voucher queue in the updated M electronic voucher queues for issuance until the number of updated electronic vouchers to be issued is less than N, further includes: when the number of updated electronic vouchers to be issued is less than N, arranging the updated electronic vouchers to be issued to obtain arranged electronic vouchers to be issued; and selecting electronic vouchers from the arranged electronic vouchers to be issued in turn for issuance.
[0101] For example, when the number of updated electronic coupons to be issued (for example, 49) is less than N (for example, 50), the server arranges the updated electronic coupons to be issued in a preset order to obtain arranged electronic coupons to be issued (for example, 1, 2, 3, 4, 5, 6...49); according to the received electronic coupon issuance request, the first electronic coupon is selected from the arranged electronic coupons to be issued (for example, 1, 2, 3, 4, 5, 6...49) and sent to the corresponding terminal until the remaining number of electronic coupons to be issued is 0.
[0102] In this embodiment, when the number of updated electronic coupons to be issued is less than N, the updated electronic coupons to be issued are arranged in a preset order to obtain arranged electronic coupons to be issued; electronic coupons are selected in turn from the arranged electronic coupons to be issued for issuance, further ensuring the successful issuance of the electronic coupons.
[0103] In one embodiment, Figure 4 As shown, another electronic voucher issuance control method is provided, which is described by taking the method applied to a server as an example, and includes the following steps:
[0104] Step S401: when the number of electronic coupons to be issued is greater than or equal to N, the first N electronic coupons are selected from the electronic coupons to be issued.
[0105] Step S402: group the first N electronic coupons evenly to obtain M groups of electronic coupons; and distribute the M groups of electronic coupons to M electronic coupon queues.
[0106] Step S403, in response to the electronic voucher issuance request, determining a target electronic voucher queue from the M electronic voucher queues; selecting the first electronic voucher from the target electronic voucher queue as the target electronic voucher.
[0107] Step S404: issuing the target electronic voucher to the terminal corresponding to the electronic voucher issuance request.
[0108] Step S405, deleting the target electronic voucher from the electronic vouchers to be issued, and obtaining the deleted electronic voucher to be issued; determining the deleted electronic voucher to be issued as the updated electronic voucher to be issued.
[0109] Step S406, reselect the first N electronic coupons from the updated electronic coupons to be issued; group the reselected first N electronic coupons evenly to obtain new M groups of electronic coupons.
[0110] Step S407: Allocate the new M groups of electronic vouchers to the M electronic voucher queues to obtain the updated M electronic voucher queues.
[0111] Step S408: Select a target electronic voucher from the target electronic voucher queue in the updated M electronic voucher queues for issuance, until the updated number of electronic vouchers to be issued is less than N.
[0112] Step S409: when the updated number of electronic coupons to be issued is less than N, the updated electronic coupons to be issued are arranged to obtain arranged electronic coupons to be issued; and electronic coupons are selected in sequence from the arranged electronic coupons to be issued for issuance.
[0113] In the above-mentioned electronic voucher issuance control method, when the number of electronic vouchers to be issued is greater than or equal to N, the first N electronic vouchers to be issued are evenly distributed to M electronic voucher queues, which is conducive to dispersing concurrent pressure, reducing electronic voucher issuance conflicts, and thus improving the efficiency of electronic voucher issuance; at the same time, each time a target electronic voucher is selected from a target electronic voucher queue in the M electronic voucher queues for issuance, and then the M electronic voucher queues are updated to ensure that the number of electronic vouchers in each electronic voucher queue is the same, simplifying the reallocation process, which is conducive to ensuring the timely issuance of electronic vouchers and further improving the efficiency of electronic voucher issuance; avoiding the situation where the number of electronic vouchers in each electronic voucher queue is unbalanced after a period of time, and the electronic vouchers in other electronic voucher queues need to be allocated to an empty electronic voucher queue, while the number of electronic vouchers in each electronic voucher queue is different, and the allocation scheme is also different, which is more complicated to handle, resulting in the defect of low electronic voucher issuance efficiency.
[0114] In one embodiment, in order to more clearly illustrate the electronic voucher issuance control method provided by the embodiment of the present application, the electronic voucher issuance control method is specifically described below with a specific embodiment. In one embodiment, the present application also provides a control method for electronic voucher issuance in a distributed framework; assuming that there are k distributed machines, the number of electronic vouchers is S, and the maximum total concurrency is X, the electronic voucher issuance control method is described below in chronological order and divided into three stages:
[0115] 1. First issuance:
[0116] The original queue is split into multiple queues using the following method when there are sufficient tickets. Since there are sufficient tickets at this time, the method is to obtain m tickets at a time in order, m = k × C (k is the number of distributed servers, C is a custom constant), where m ≤ S. Each distributed machine is numbered from 1 to k, where the first C number of tickets is assigned to machine 1, the second C number of tickets is assigned to machine 2, and the kth C number of tickets is assigned to machine k. Each machine has its own queue, and each machine takes tickets from the head of its own queue. Assuming k = 5 and C = 10, the original queue is split into a 5-head queue, as shown in Table 1. The new method optimizes the queue:
[0117] Table 1
[0118]
[0119] There will be no update conflicts between the queues. The original concurrency takes the ticket "1", and the new solution provides "1", "11", "21", "31", and "41", which are distributed internally by each queue. The original X concurrent conflicts are scattered in each queue. Assuming the total concurrency is 10 and the number of distributed machines is 5, the original method queue is 10; the new method queue is 10 / 5=2. For example, "1", only two concurrent people are getting it, and the queue number of the new solution method is reduced to 1 / 5 of the original method.
[0120] 2. Issuance of mid-term circulation vouchers:
[0121] After a coupon is issued, for example, if "21" is selected to be out of the queue, since we always obtain 50 coupons in order, the first 49 coupons of "21" are removed, and the order remains relatively unchanged. "51" is added to the original position of "50". We use the unified method of "first issuance" mentioned above to split it into a multi-head sequence. This queue is relatively stable, and only "41" and "31" have changed their positions in the original queue and are at the end of the new queue, as shown in Table 2. The queue changes of the new method:
[0122] Table 2
[0123]
[0124] According to the new sequence numbering, "22" is added to the original position of "21", and "23" to "50" are added to the previous position in sequence, see Table 3:
[0125] Table 3
[0126]
[0127]
[0128] Assuming that n coupons have been issued, we do not need to care about the original serial number of the coupons. We only need to renumber all coupons in order from 1 to Sn, as shown in Table 4:
[0129] Table 4
[0130]
[0131] Assuming that "31" is selected when the n+1th ticket is issued, then "31" is removed from the queue, that is, "32" is added to the original position of "31", "33" to "50" are added to the previous position in order, and "51" is added to the original position of "50", see Table 5:
[0132] Table 5
[0133]
[0134] Renumber according to the new order, see Table 6:
[0135] Table 6
[0136]
[0137] The mid-term issuance of coupons will cycle this process.
[0138] 3. Post-issuance processing:
[0139] Assuming that the total number of coupons is 10,000, when less than 50 coupons are issued, they are still processed according to the priority queuing method in Table 7. Then the number of coupons issued after optimization by this method is: (10,000-50) = 9,950, that is, 9950 / 10,000 = 99.5% of the time, coupons are issued efficiently according to this method, and only 0.5% of the time, the original method is used. When the number of coupons is relatively large, such as 100,000 coupons, 99.95% of the coupons are issued using the new solution, and only 0.05% use the original method, and the optimization effect is more obvious.
[0140] So far, through the three stages of front, middle and back, a complete coupon issuance method has been formed. The multi-head queue constructed by this method can effectively reduce conflicts in the sufficient period when coupon issuance accounts for a large proportion, making coupon issuance more efficient.
[0141] Table 7
[0142] 1 2 3 4 5 6 7 8 9 10 ... S
[0143] It should be noted that the constant C ≥ 1. If it is 0, the multi-head queue is meaningless. However, C cannot be too large. Retrieving too much data at one time will waste space resources and transmission costs.
[0144] We can calculate a lower limit of C based on the number of distributed system servers k and the maximum total concurrent number X. From the perspective of the cyclic release process, we need to ensure that the elements of each queue are relatively stable, that is, the queues will not conflict. When the number of acquisitions m = k × C is greater than the concurrent number X, there will be no conflict in theory. in Indicates rounding up. In actual operation, the maximum total concurrent number is X. It is recommended to reserve some room for growth. The initial value of C can be: When it is found that the maximum concurrency is slightly higher than X but less than 2X, it can still be supported and you can consider adjusting C.
[0145] Appropriate C makes coupon issuance more stable and efficient. You can increase the C value appropriately if necessary according to the system operation situation. However, it is not recommended to reduce the C value, as it will become unstable once the number of concurrent connections increases suddenly.
[0146] The control method for electronic voucher issuance in the above-mentioned distributed framework can achieve the following technical effects: (1) By splitting the multi-head queue, the concurrent pressure is dispersed and the conflict of voucher issuance is reduced; (2) In the period of sufficient vouchers, the advantages of the distributed system are brought into play and the efficiency of voucher issuance is improved; (3) When the number of vouchers is relatively large, the advantages are more obvious.
[0147] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0148] Based on the same inventive concept, the embodiment of the present application also provides an electronic voucher issuance control device for implementing the electronic voucher issuance control method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more electronic voucher issuance control device embodiments provided below can refer to the limitations of the electronic voucher issuance control method above, and will not be repeated here.
[0149] In one embodiment, Figure 5 As shown, an electronic voucher issuance control device is provided, comprising: a first selection module 510, a first update module 520, a second update module 530 and a second selection module 540, wherein:
[0150] The first selection module 510 is used to respond to an electronic voucher issuance request and select a target electronic voucher for issuance from a target electronic voucher queue in M electronic voucher queues; the target electronic voucher queue is the selected electronic voucher queue, and the target electronic voucher is the first electronic voucher in each target electronic voucher queue; the electronic vouchers stored in the M electronic voucher queues are evenly distributed from the first N electronic vouchers to be issued.
[0151] The first updating module 520 is used to update the electronic voucher to be issued according to the target electronic voucher to obtain an updated electronic voucher to be issued.
[0152] The second updating module 530 is used to evenly distribute the first N electronic coupons in the updated electronic coupons to be issued to the M electronic coupon queues to obtain the updated M electronic coupon queues.
[0153] The second selection module 540 is used to select a target electronic voucher from the target electronic voucher queue in the updated M electronic voucher queues for issuance until the updated number of electronic vouchers to be issued is less than N.
[0154] In one embodiment, the electronic voucher issuance control device also includes an electronic voucher allocation module, which is used to select the first N electronic vouchers from the electronic vouchers to be issued when the number of electronic vouchers to be issued is greater than or equal to N; group the first N electronic vouchers evenly to obtain M groups of electronic vouchers; and allocate the M groups of electronic vouchers to M electronic voucher queues.
[0155] In one embodiment, the first selection module 510 is also used to determine a target electronic voucher queue from M electronic voucher queues in response to an electronic voucher issuance request; select the first electronic voucher from the target electronic voucher queue as the target electronic voucher; and issue the target electronic voucher to a terminal corresponding to the electronic voucher issuance request.
[0156] In one embodiment, the first updating module 520 is further used to delete the target electronic voucher from the electronic vouchers to be issued to obtain the deleted electronic voucher to be issued; and determine the deleted electronic voucher to be issued as the updated electronic voucher to be issued.
[0157] In one embodiment, the second update module 530 is also used to re-select the first N electronic coupons from the updated electronic coupons to be issued; group the re-selected first N electronic coupons evenly to obtain new M groups of electronic coupons; and allocate the new M groups of electronic coupons to M electronic coupon queues to obtain updated M electronic coupon queues.
[0158] In one embodiment, the electronic voucher issuance control device further includes an electronic voucher issuance module, which is used to arrange the updated electronic vouchers to be issued to obtain arranged electronic vouchers to be issued when the number of updated electronic vouchers to be issued is less than N; and select electronic vouchers from the arranged electronic vouchers to be issued in sequence for issuance.
[0159] Each module in the electronic voucher issuance control device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0160] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 6As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data such as electronic coupons. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, an electronic coupon issuance control method is implemented.
[0161] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0162] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0163] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0164] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0165] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0166] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0167] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0168] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for controlling the issuance of electronic vouchers, characterized in that: The method comprises: In response to an electronic voucher issuance request, a target electronic voucher is selected from a target electronic voucher queue in the M electronic voucher queues for issuance; the target electronic voucher queue is the selected electronic voucher queue, and the target electronic voucher is the first electronic voucher in each target electronic voucher queue; the electronic vouchers stored in the M electronic voucher queues are obtained by evenly distributing the first N electronic vouchers among the electronic vouchers to be issued; The electronic voucher to be issued is updated according to the target electronic voucher to obtain an updated electronic voucher to be issued; Evenly distribute the first N electronic coupons among the updated electronic coupons to be issued to the M electronic coupon queues to obtain the updated M electronic coupon queues; Selecting a target electronic voucher from the target electronic voucher queues in the updated M electronic voucher queues for issuance until the updated number of electronic vouchers to be issued is less than N; The updating of the electronic voucher to be issued according to the target electronic voucher to obtain an updated electronic voucher to be issued includes: Deleting the target electronic voucher from the electronic vouchers to be issued, and obtaining the deleted electronic voucher to be issued; The deleted electronic voucher to be issued is determined as the updated electronic voucher to be issued.
2. The method according to claim 1, characterized in that Before selecting a target electronic voucher from a target electronic voucher queue in the M electronic voucher queues for issuance in response to the electronic voucher issuance request, the method further includes: When the number of electronic coupons to be issued is greater than or equal to N, selecting the first N electronic coupons from the electronic coupons to be issued; The first N electronic coupons are evenly grouped to obtain M groups of electronic coupons; The M groups of electronic coupons are allocated to the M electronic coupon queues.
3. The method according to claim 1, characterized in that: The step of selecting a target electronic voucher for issuance from a target electronic voucher queue in the M electronic voucher queues in response to the electronic voucher issuance request includes: In response to the electronic voucher issuance request, determining a target electronic voucher queue from the M electronic voucher queues; Selecting the first electronic voucher from the target electronic voucher queue as the target electronic voucher; The target electronic voucher is issued to a terminal corresponding to the electronic voucher issuance request.
4. The method according to claim 1, characterized in that The evenly distributing the first N electronic coupons in the updated electronic coupons to be issued to the M electronic coupon queues to obtain the updated M electronic coupon queues includes: Selecting the first N electronic coupons again from the updated electronic coupons to be issued; The first N electronic coupons selected again are evenly grouped to obtain new M groups of electronic coupons; The new M groups of electronic vouchers are allocated to the M electronic voucher queues to obtain updated M electronic voucher queues.
5. The method according to any one of claims 1 to 4, characterized in that: The method further includes selecting a target electronic voucher from a target electronic voucher queue in the updated M electronic voucher queues for issuance until the updated number of electronic vouchers to be issued is less than N. When the number of the updated electronic coupons to be issued is less than N, arranging the updated electronic coupons to be issued to obtain arranged electronic coupons to be issued; The electronic vouchers are selected in sequence from the arranged electronic vouchers to be issued for issuance.
6. An electronic voucher issuance control device, characterized in that: The device comprises: A first selection module is used to select a target electronic voucher from a target electronic voucher queue in M electronic voucher queues for issuance in response to an electronic voucher issuance request; the target electronic voucher queue is the selected electronic voucher queue, and the target electronic voucher is the first electronic voucher in each target electronic voucher queue; the electronic vouchers stored in the M electronic voucher queues are obtained by evenly distributing the first N electronic vouchers among the electronic vouchers to be issued; A first updating module, configured to update the electronic voucher to be issued according to the target electronic voucher to obtain an updated electronic voucher to be issued; A second updating module, configured to evenly distribute the first N electronic coupons among the updated electronic coupons to be issued to the M electronic coupon queues to obtain the updated M electronic coupon queues; A second selection module is used to select a target electronic voucher from the target electronic voucher queues in the updated M electronic voucher queues for issuance until the updated number of electronic vouchers to be issued is less than N; The first updating module is further used to delete the target electronic voucher from the electronic vouchers to be issued to obtain the deleted electronic voucher to be issued; and determine the deleted electronic voucher to be issued as the updated electronic voucher to be issued.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
9. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Resource allocation method and device, resource acquisition method and device, storage medium and equipment
CN111949393A
Resource distribution method and device thereof, computer equipment and storage medium
CN113516330A