Promotion activity quota management method and device, computer device, and storage medium

By using Redis serial single-threaded management of activity slots in high-concurrency scenarios, the problems of fund security and user experience caused by improper management of activity slots were solved, and the utilization of activity budgets was maximized while reducing system pressure.

CN114298785BActive Publication Date: 2025-11-04ZHEJIANG VIPSHOP PAYMENT SERVICES CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111570139.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-21
Publication Date
2025-11-04
Estimated Expiration
2041-12-21

AI Technical Summary

Technical Problem

In high-concurrency scenarios, existing promotional activity management systems cannot effectively manage activity quotas, leading to issues such as fund security, poor user experience, and underutilization of activity budgets.

Method used

By using Redis serial single-threaded execution, the activity quota is managed to ensure that the number of activities and the amount do not exceed the settings under high concurrency, and the reused quota is given priority to reduce duplicate locking and reduce system pressure.

Benefits of technology

It improved the user experience, ensured the safety of funds and maximized the use of the event budget, and reduced system pressure.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114298785B_ABST
    Figure CN114298785B_ABST
Patent Text Reader

Abstract

The application relates to a quota management method and device of a preferential activity, computer equipment and a storage medium. The method comprises the following steps: receiving a preferential calculation request, obtaining a preferential activity list according to the preferential calculation request; obtaining order information, calculating the preferential amount corresponding to each preferential activity in the preferential activity list according to the order information and preferential rules; obtaining a payment method, matching a preferential activity meeting a condition according to the payment method; when the preferential activity has a reusable quota, the reusable quota is selected and the preferential amount is displayed; wherein the reusable quota refers to an activity quota that has been locked by a current user and is still within a locking time limit; the activity quota refers to an activity budget and / or an activity number. By using the method, repeated locking can be reduced, and activity funds can be maximally utilized.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data processing, in particular to a quota management method and device for a preferential activity, a computer device and a storage medium. BACKGROUND

[0002] In recent years, with the development of the Internet, a large number of e-commerce platforms have emerged. In order to attract consumers, various e-commerce platforms and merchants have launched various promotional activities (such as full price reduction, red packets, coupons, etc.). In order to improve their competitiveness, third-party payment companies provide marketing tools such as full price reduction and red packets for merchants, banks and other partners. Payment full price reduction is very popular because it is convenient, does not require red packets or coupons to be pre-issued to user accounts, and supports multiple forms such as fixed, random, and by ratio.

[0003] However, as the scale of such promotional activities becomes larger and the number of participating merchants increases, high concurrency scenarios can cause many problems. For example, in a high concurrency scenario, funds are not limited in time, resulting in fund safety problems due to budget overruns, or in a high concurrency scenario, users are entitled to a discount, but ultimately the preset discount quota is occupied due to high concurrency, ultimately leading to user experience problems and the inability to maximize the use of activity funds due to the uncertainty of user final orders. SUMMARY

[0004] Therefore, it is necessary to provide a quota management method and device for a preferential activity, a computer device and a storage medium to solve the above technical problems.

[0005] The quota management method for a preferential activity comprises the following steps:

[0006] receiving a preferential calculation request, and obtaining a preferential activity list according to the preferential calculation request;

[0007] obtaining order information, and calculating a preferential amount corresponding to each preferential activity in the preferential activity list according to the order information and a preferential rule;

[0008] obtaining a payment method, and matching a preferential activity that meets the conditions according to the payment method; when the preferential activity has a reusable quota, the reusable quota is selected and a preferential amount is displayed;

[0009] The reusable quota refers to an activity quota that has been locked by the current user and is still within the locking time limit. The activity quota refers to an activity budget and / or an activity number.

[0010] A device for managing the number of promotional activity slots includes: a receiving module for receiving a discount calculation request and obtaining a list of discount activities based on the request; a first obtaining module for obtaining order information and calculating the discount amount corresponding to each promotional activity in the list according to the discount rules; a second obtaining module for obtaining payment methods and matching eligible promotional activities based on the payment methods; and when there are reusable slots for a promotional activity, selecting a reusable slot and displaying the discount amount; wherein, the reusable slot refers to a slot that the current user has previously locked and is still within the locking period; and the activity slots refer to the activity budget and / or the number of activity attempts.

[0011] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, performs the following steps:

[0012] Receive a discount calculation request and obtain a list of discount activities based on the discount calculation request;

[0013] Obtain order information, and calculate the discount amount for each promotional activity in the promotional activity list according to the discount rules based on the order information;

[0014] Obtain the payment method and match eligible promotional activities based on the payment method; if there are reusable slots for the promotional activities, select the reusable slots and display the discount amount;

[0015] The term "reusable quota" refers to a quota that the current user has previously locked in and is still within the lockout period; the term "activity quota" refers to the activity budget and / or the number of activities.

[0016] A computer-readable storage medium having a computer program stored thereon, the computer program performing the following steps when executed by a processor:

[0017] Receive a discount calculation request and obtain a list of discount activities based on the discount calculation request;

[0018] Obtain order information, and calculate the discount amount for each promotional activity in the promotional activity list according to the discount rules based on the order information;

[0019] Obtain the payment method and match eligible promotional activities based on the payment method; if there are reusable slots for the promotional activities, select the reusable slots and display the discount amount;

[0020] The term "reusable quota" refers to a quota that the current user has previously locked in and is still within the lockout period; the term "activity quota" refers to the activity budget and / or the number of activities.

[0021] The above application ensures that the number of activities and the amount do not exceed the activity settings under high concurrency scenarios by using Redis serial single-threaded execution. Through activity quota management, it ensures that users can use the activity quota as soon as they see it when it is locked, which can guarantee real-time performance and the accuracy of budget deduction, thereby improving user experience and ensuring fund security. At the same time, when there are reusable quotas for promotional activities, the preferred use can reduce duplicate locking, reduce system pressure, and maximize the utilization of the activity budget. Attached Figure Description

[0022] Figure 1 , One A schematic diagram of the structure of the quota management device for the preferential activities of the hardware operating environment involved in one embodiment;

[0023] Figure 2 , One A detailed flowchart illustrating the steps of the quota management method for promotional activities in one embodiment;

[0024] Figure 3 , One A flowchart illustrating the process of creating a promotional activity in one embodiment;

[0025] Figure 4 , One A flowchart illustrating the process of modifying promotional activities in one embodiment;

[0026] Figure 5 , One A schematic diagram of the promotional activity process calculated based on a single payment method in one embodiment;

[0027] Figure 6 , One A schematic diagram illustrating the process of consuming and releasing activity slots in one embodiment. Detailed Implementation

[0028] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0029] It is understood that the term "or / and" used in this application describes the relationship between related objects, indicating that three relationships can exist. For example, A or / and B can represent: A existing alone, A and B existing simultaneously, or B existing alone. The character " / " generally indicates that the related objects before and after it have an "or" relationship.

[0030] Reference Figure 1 , Figure 1 This is a schematic diagram of the structure of the quota management device for the preferential activities of the hardware operating environment involved in the embodiments of this application.

[0031] like Figure 1 As shown, the quota management device may include: a processor 1001, such as a CPU; a communication bus 1002; an administrator interface 1003; a network interface 1004; and a memory 1005. The communication bus 1002 is used to enable communication between these components. The administrator interface 1003 may connect to a display screen or an input unit such as a keyboard; optionally, the administrator interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be high-speed RAM or non-volatile memory, such as a disk drive. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0032] Those skilled in the art will understand that Figure 1 The structure of the quota management device for promotional activities shown does not constitute a limitation on the quota management device for promotional activities. It may include more or fewer components than shown, or combine certain components, or have different component arrangements. The quota management device can be used in an application server.

[0033] like Figure 1 As shown, the memory 1005, which serves as a computer storage medium, may include an operating system, a network communication module, an administrator interface module, and a payment program. Figure 1 In the application server shown, network interface 1004 is mainly used to receive data sent by the client and also for data communication with the backend database; administrator interface 1003 is mainly used to interact with server management and maintenance personnel; the processor 1001 and memory 1005 in the application server of this application can be set in the quota management device for promotional activities. The quota management device for promotional activities calls the quota management program for promotional activities stored in memory 1005 through processor 1001 and performs the following operations:

[0034] Receive a discount calculation request and obtain a list of discount activities based on the discount calculation request;

[0035] Obtain order information, and calculate the discount amount for each promotional activity in the promotional activity list according to the discount rules based on the order information;

[0036] Obtain payment methods and match eligible promotional activities based on those methods;

[0037] When there are reusable slots available for the promotional activity, select the reusable slots and display the discount amount;

[0038] The term "reusable quota" refers to a quota that the current user has previously locked in and is still within the lockout period; the term "activity quota" refers to the activity budget and / or the number of activities.

[0039] This application ensures that the number of activities and the amount of money involved do not exceed the activity settings under high-concurrency scenarios through serial single-threaded execution via Redis. By managing activity quotas, it ensures that users can use the activity as soon as they see it when it is locked, guaranteeing real-time performance and the accuracy of budget deduction. This improves user experience and ensures fund security. At the same time, when there are reusable quotas for promotional activities, prioritizing their use can reduce duplicate locking, alleviate system pressure, and maximize the utilization of the activity budget.

[0040] In one embodiment, such as Figure 2 As shown, a method for managing the quota of promotional activities is provided, which can be applied to... Figure 1 Taking the application server in the example, the following steps are included:

[0041] S201. Receive a discount calculation request and obtain a list of discount activities based on the discount calculation request;

[0042] In this embodiment, it should be noted that when a user submits an order on the terminal, the terminal device sends the order request to the server, and the server loads and retrieves the list of currently available promotional activities from the database (i.e., the activity database hereinafter referred to as the activity database) based on the order request.

[0043] Since creating promotional activities is necessary before obtaining the list of promotional activities, this application provides a possible implementation method for creating payment promotional activities, see reference. Figure 3 , Figure 4 As shown, S201 may include, for example, S1-S4 of the following steps:

[0044] S1. Create a payment discount activity; Since this solution is controlled by code, and the program code is in the service layer, the application server is used as the execution subject of this embodiment; the application server itself is a distributed architecture and can be horizontally scaled; the application server is located in the service layer; the backend database and Redis cache are located in the data layer; among them, the Redis cache is set on the cache server; the relational database MySQL is used as the backend database for description. The activity database and user account database will be pre-created in MySQL, and the example of a discount activity corresponding to a certain brand A organization when the activity ID=1 will be used for illustration.

[0045] Understandably, to support the traffic of promotional activity requests, i.e., the MySQL database needs to support high-concurrency CRUD operations, this embodiment will pre-create two types of databases: an activity database and a user account database. The activity database will pre-create an "Activity Information Table," which includes information related to the discount activity, such as the total budget, total number of times the activity is held, the start time, the end time, and the promotional text, corresponding to the activity ID (e.g., if the activity is organized by brand A, then brand A's ID = 1). The promotional text can be at least one of the following types: discount for purchases over a certain amount, full discount for purchases over a certain amount, fixed price, random discount, rounding down, and normal random discount.

[0046] The user account database will pre-build a "discount lock record table". The "discount lock record table" includes the user ID (a unique identifier for a user's device account), the amount spent in this event, the number of times the event was purchased, and other records related to the discount event quota corresponding to the user ID.

[0047] S2. Approval: Approve the configuration information of the promotional activity after it has been successfully created, check whether the activity configuration is normal, and proceed to the next step if the review is normal.

[0048] S3. Save activity information to the activity database; Store promotional activities containing configuration information in the activity database. When the server accesses an activity for the first time, it reads it from the activity database and loads it into the local cache for execution. In order to reduce the storage pressure on the server's local cache, the local cache is set to a 30-second expiration refresh policy, and the local cache is refreshed every 30 seconds. Thus, every time the server reads from the activity database and loads it into the local cache for execution, the promotional activity is currently valid.

[0049] S4. Initialize the used amount and cache expiration period of the promotion; Redis (Remote DIctionary Server) is used for data recording and caching. Redis is a single-threaded, non-relational database mainly used for data caching, which can protect the database and improve query efficiency. In this embodiment, the used amount of the promotion is stored in Redis cache. Utilizing the serial single-threaded execution and atomic increment operation of the Redis background service, it ensures that the budget is not exceeded under concurrent conditions and that a single promotion can support 50,000 TPS. The used amount includes the number of times the promotion has been used and the amount of the promotion has been used. Therefore, in the initial Redis, the total number of promotions issued and the amount of the promotion issued are both zero, and the cache expiration time is the promotion end time + 1 day.

[0050] In this embodiment, it should also be noted that the configuration information for the promotional activity may need to be changed to adapt to the implementation of the activity. The specific modification steps include the following:

[0051] S11. Modify the configuration information of the promotional activity; the main modifications to the configuration information include: modifying the start time, end time, promotion type, and increasing the activity budget, etc.

[0052] S12, Approval; The modified promotional activity configuration information will be approved. If the approval is successful, proceed to the next step.

[0053] S13. Update the database activity configuration information; it is understood that when the additional budget for the activity of Brand A is approved, the total activity budget in the "Activity Information Table" of the remote activity database will be updated, and the "Activity Information" in the Redis cache will be updated.

[0054] S14. Determine if the activity needs to be postponed. In this step, it is necessary to determine the configuration information of the updated promotional activity. If the activity end time is longer than the activity end time before the modification, it is determined that the activity needs to be postponed, and then the next step needs to be performed.

[0055] S15. Update the total number of times the activity has been distributed and the amount distributed in the activity, and update the validity period of the cache. The expiration time for updating the total number of times the activity has been distributed and the amount distributed in the activity is the activity end time + 1 day.

[0056] In some embodiments, the activity's usage count and amount support back-to-origin statistics. If the activity count and amount count are lost in the Redis cache, a distributed lock is used to prevent concurrent back-to-origin operations, ensuring that only one job executes the back-to-origin statistics and writes back to the cache for a single discount activity. The use of a distributed lock guarantees data consistency and accuracy. When multiple threads need to access shared resources, we typically use a thread-locking mechanism so that at any given time, only one thread can operate on the resource, while other threads must wait for the lock to be released.

[0057] S202. Obtain order information, and calculate the discount amount corresponding to each promotional activity in the promotional activity list according to the discount rules based on the order information;

[0058] In this embodiment, it should be noted that the order information submitted by the user is obtained, including the order amount. Based on the obtained order amount, the discount amount for each promotional activity is calculated according to preset discount rules. The preset discount rules include configuring different discount ranges based on the order amount. For example, activity A reduces the discount by 1 yuan in the range of 100-200 yuan, activity B reduces the discount by 2 yuan in the range of 100-200 yuan, and so on. The discount amount for each activity is different, and the specific discount is set according to the activity.

[0059] In this embodiment, it should also be noted that the promotional activities in the list are sorted according to preset rules. This ensures that users do not reuse promotional offers and maximizes their benefits. The preset rules include sorting by priority of use or by the amount of discount available, in descending order. That is, promotional activities are arranged from highest priority downwards, forming a promotional activity list. Users can then filter through these activities in order to enjoy discounts. Alternatively, since each promotional activity has a different amount of discount available, they can also be sorted by the amount available, from largest to smallest, allowing users to start filtering from the highest discount amount. There are also two other scenarios: when promotional activities have the same amount of discount available, they are sorted by priority of use; when both the amount of discount available and the priority of use are the same, they are sorted by the latest update time, in descending order. Both methods maximize the benefits a user can enjoy.

[0060] S203. Obtain the payment method and match eligible promotional activities based on the payment method; when there are reusable slots for the promotional activity, select the reusable slots and display the discount amount; wherein, the reusable slots refer to the activity slots that the current user has previously locked and are still within the locking period; the activity slots refer to the activity budget and the number of activity sessions.

[0061] In this embodiment, it should be noted that the payment method includes the payment bank, card type, bank card BIN, etc. After placing an order, the user enters the cashier page and checks the payment discount according to the payment method. When confirming the payment method, the user is matched with the applicable discount activities. When paying with this payment method, the user can enjoy the discount amount brought by the corresponding discount activities.

[0062] In one example, after querying for discounts based on a single payment method, it's necessary to determine if other payment methods are available. Some users may have more than one payment method. In cases with multiple payment methods, the system needs to calculate the discount for each. Specifically, if no other payment methods are found (i.e., only one payment method is available), a matching discount is applied to that payment method. If a match is successful, the corresponding discount slot is locked, and no further matching is attempted. If no match is found, the process ends. If other payment methods are found, the system retrieves the next available payment method, essentially polling for the user's available payment methods and matching them with matching discounts again, until all payment methods are polled.

[0063] Therefore, when a user has multiple payment methods, each payment method can be matched with eligible promotional activities. The user can then choose the promotional activity that offers the greatest benefit, thereby maximizing their interests.

[0064] Please see Figure 5 , Figure 5 The specific implementation flow of step S203 provided in the embodiment of this application is shown below:

[0065] S2031. Perform general rule verification on the order request information submitted by the user;

[0066] In this embodiment, it should be noted that the general activity rule refers to checking whether the order information submitted by the user meets the shortlisted options. The shortlisted options include at least one of the following: payment order number, user ID, order amount, payment method, bank used, card type, bank card BIN, transaction merchant, transaction terminal, transaction time, etc. Only when the general activity rule is met can the user match the promotional activity and enjoy the discount. The promotional activity list is filtered sequentially to determine whether the order information submitted by the user passes the verification of the general activity rule. If the rule verification fails, the promotional activity list in local memory is polled. In the specific implementation, the load balancer of the service layer uses a round-robin strategy to search for promotional activities that meet the general rule in local memory. After obtaining a promotional activity that passes the verification of the general activity rule, the current cursor (currently used promotional activity) is updated to point to the next promotional activity. The local memory records which promotional activity was used last time. The next request will start searching from the next promotional activity. If the promotional activity list has been polled, a message indicating no discount information is returned is returned and the process ends. When the general activity rule is passed, the process proceeds to the next step S2032.

[0067] S2032. Verify the total number of daily and monthly activity parameters from the user's perspective;

[0068] In this embodiment, it should also be noted that, from the user perspective, daily / monthly / total participation limits for promotional activities are configured. Specifically, within a preset time period, it is determined whether the user's cumulative participation in the activity exceeds a preset threshold. If the user's cumulative participation in the activity does not exceed the preset threshold, the process proceeds to the next step S2033. If the user's cumulative participation in the activity exceeds the preset threshold, the list of promotional activities in local memory is polled. The cumulative participation in the activity within the preset time period can refer to the user's cumulative participation in the activity in one day, the cumulative participation in the activity in one month, or the cumulative total participation within the validity period of the promotional activity.

[0069] S2033. Verify the reuse of quotas for the aforementioned promotional activities;

[0070] In this embodiment, it should be noted that the reuse of quotas includes two scenarios. The first scenario assumes two cards correspond to the same activity quota; in this case, one activity quota will be selected, and when the user chooses to pay with a bank card, the previously locked quota will be reused. The second scenario is that the user has already locked an activity quota, and upon exiting and re-entering, the previously locked quota will be reused. Further explanation of these two types of quota reuse is provided: when the user's daily / monthly / total number of uses does not exceed a preset threshold, a quota reuse verification procedure will be initiated. This procedure checks the Redis cache for reusable quotas by matching the user ID, activity ID, and order amount to the starting range of the activity order amount. If a reusable quota is found in the Redis cache, it will be reused directly, and the discount information will be returned. Here, a reused quota refers to an activity quota that the user has previously locked and is still within the locked period; the activity quota refers to the budget and number of times the user can enjoy the discount activity. If no reusable quota is found in the Redis cache, it is determined whether the activity quota needs to be locked. If the activity quota does not need to be locked, the quota is checked but not locked. If the determination is yes, it means that the activity quota needs to be locked, and the process will proceed to the next step S2034.

[0071] S2034. Lock in the number of slots for the promotional activities;

[0072] In this embodiment, it should be noted that during the process of locking the activity quota, it is necessary to further determine whether the activity quota is within a preset range. When the activity quota is within the preset range, it indicates that the activity quota has been successfully locked, and discount information is returned. The preset range refers to the preset total number of activities and total budget limit. That is to say, during the locking process, it is necessary to compare the accumulated number of activities used, the budget, and the preset total number of activities and total budget limit. Each time an activity is locked, the activity's used days, months, total number of activities, and the amount of activity used are accumulated in Redis. When the accumulated amount of activity used and the number of activities used in the Redis cache are compared with the preset total number of activities and total budget limit, if the number of activities and the budget are not exceeded, a discount ID is generated, the discount record is recorded in the discount record log table, and the discount ID and discount amount are cached in the Redis cache. The locking is successful, and discount information is returned to end the process. If the activity quota has been exceeded, that is, the number of activities or the amount of activity used exceeds the activity limit, the locking fails. At this time, the accumulated operations are rolled back, and the process returns to retrieve the next discount activity.

[0073] Reference Figure 6 As shown, S401 consumes the locked activity slots;

[0074] In this embodiment, it should be noted that after successfully locking the activity quota, the quota is also consumed. In one example, when a user completes the payment for the discount after successfully locking the activity quota, the user's payment parameters are verified. This primarily verifies whether the user's payment method, bank, card type, etc., can use the locked quota. For example, if an activity quota is locked using an ICBC debit card, and the user later uses an ICBC credit card to pay, if the activity supports credit cards, the payment can proceed. Otherwise, the locked quota cannot be used. Upon successful verification, the successfully locked activity quota is synchronously cleared from Redis to prevent reuse. Furthermore, the discount consumption log is recorded and updated in real time.

[0075] S402. Release the locked activity slots;

[0076] In this embodiment, it should be noted that some users may not necessarily use their locked activity slots; some may release them. Release can be active or passive. Active release refers to the cancellation of an order with a locked activity slot before payment is completed. The order system notifies the discount system to release the locked activity slot. Active release includes releasing the activity budget and number of attempts. When an activity slot is locked, an RMQ (RabbitMQ) delay message is sent, with a delay time set to 30 minutes. If payment is not received within 30 minutes, the activity slot is released. If a paid order receives a full refund, the used slots and budget are also released simultaneously. In the event of a refund, the refund parameters are validated, primarily verifying the legality of the refunded order. For example, a paid order must exist, and the refund amount cannot exceed the payment amount. If the validation passes, the refund transaction is recorded, the activity budget is returned, and the activity slots are released.

[0077] Passive release refers to the situation where orders with locked activity slots expire but payment is not completed. This is mitigated by using an RMQ delayed message (30 minutes) and a scheduled job (executed before 31 minutes) to ensure the release of expired locked activity slots (number of times and budget). Specifically, the system periodically updates the activity database based on the accumulated budget and number of times allocated in the Redis cache. In the implementation, a scheduled job updates the activity database every minute, scanning the full-reduction lock record table for records that have not been used or released for more than 31 minutes, updating selected locked records to a released state, and simultaneously releasing the slots and budget of locked records that meet the conditions.

[0078] In one example, if a refund occurs after the discount payment, the activity budget and quota will be returned. A full refund will return both the activity quota and the budget, while a partial refund will only return the budget for the refunded portion.

[0079] In one embodiment, a device for managing the quota of promotional activities is provided, comprising: a receiving module for receiving a discount calculation request and obtaining a list of discount activities based on the discount calculation request; a first obtaining module for obtaining order information and calculating the discount amount corresponding to each promotional activity in the list according to the order information and discount rules; a second obtaining module for obtaining a payment method and matching eligible promotional activities based on the payment method; and when there are reusable quotas for the promotional activities, selecting the reusable quotas and displaying the discount amount; wherein, the reusable quotas refer to the activity quotas that the current user has previously locked and are still within the locking period; and the activity quotas refer to the activity budget and / or the number of activity attempts.

[0080] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the quota management method for preferential activities in any of the above embodiments.

[0081] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the quota management method for the preferential activities of any of the above embodiments.

[0082] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0083] The technical features of the above embodiments can be combined in any way. For the sake of brevity, 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.

[0084] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A method for managing quotas for promotional activities, characterized in that, The method includes: Receive a discount calculation request and obtain a list of discount activities based on the discount calculation request; Obtain order information, and calculate the discount amount for each promotional activity in the promotional activity list according to the discount rules based on the order information; Obtain payment methods and match eligible promotional activities based on those methods; When there are reusable slots available for the promotional activity, select the reusable slots and display the discount amount; The term "reused quota" refers to a quota that the current user has previously locked in and is still within the lockout period; "activity quota" refers to the activity budget and / or the number of activities. The process of obtaining payment methods and matching eligible promotional activities based on payment methods includes: verifying the order information submitted by the user according to preset general rules for the activity; when the verification passes, verifying the number of times each user has participated in the activity; wherein, the general rules for the activity refer to whether the order information submitted by the user meets the shortlisted options; wherein, the shortlisted options include: payment order number, user ID, order amount, payment method, bank used, card type, bank card BIN, merchant, transaction terminal, and transaction time; The verification of the number of times each user participates in the activity includes: checking whether the user's cumulative number of participations in the activity within a preset time period exceeds a preset threshold; if the user's cumulative number of participations in the activity does not exceed the preset threshold, then a reuse quota verification is performed; wherein the preset time period refers to the daily and monthly time requirements within the validity period of the promotional activity. The reuse quota verification includes: in the quota reuse verification, by matching the user ID, activity ID, and order amount to the starting range of the activity order amount, checking whether there are reusable quotas in the Redis cache. When a reusable quota is found in the Redis cache, the reusable quota will be directly selected and the discount information will be returned. When no reusable quota is found in the Redis cache, the activity quota will be locked. When the activity quota is successfully locked, the discount information will be returned. Redis is used for data recording and caching.

2. The method according to claim 1, characterized in that, Before obtaining the payment method and matching eligible promotional activities based on the payment method, the process further includes: sorting the promotional activities in the list of promotional activities according to preset rules.

3. The method according to claim 2, characterized in that, Sort the promotional activities in the list of promotional activities according to preset rules, including: sorting by priority level of the promotional activities or by the amount of discount available for each promotional activity; and, When the discount amount is the same, the promotions are sorted by their priority level; or when both the discount amount and the priority level are the same, the promotions are sorted by their latest update time.

4. The method according to claim 1, characterized in that, Checking whether the activity slots have been successfully locked includes: determining whether the activity slots are within a preset range. If the activity slots are within the preset range, it means that the activity slots have been successfully locked, and the discount information is returned; wherein the preset range refers to the preset total number of activities and / or total budget limit value.

5. A device for managing the number of slots for a promotional activity, characterized in that, include: A receiving module is used to receive discount calculation requests and obtain a list of full-reduction activities based on the discount calculation requests; The first acquisition module is used to acquire order information and calculate the discount amount corresponding to each discount activity in the discount activity list according to the discount rules based on the order information. The second acquisition module is used to acquire payment methods and match eligible promotional activities based on the payment methods. When there are reusable slots for the promotional activities, the reusable slots are selected and the discount amount is displayed. The reusable slots refer to slots that the current user has previously locked and are still within the locked period. The activity slots refer to the activity budget and / or the number of activity attempts. Acquiring payment methods and matching eligible promotional activities based on payment methods includes: verifying the user-submitted order request information according to preset general activity rules; when the verification passes, verifying the number of times each user has participated in the activity. The general activity rules refer to whether the user-submitted order request information meets the selection criteria. The selection criteria include: payment order number, user ID, order amount, payment method, bank used, card type, bank card BIN, merchant, transaction terminal, and transaction time. The verification of the number of times each user participates in the activity includes: checking whether the user's cumulative number of participations in the activity within a preset time period exceeds a preset threshold; if the user's cumulative number of participations in the activity does not exceed the preset threshold, then a reuse quota verification is performed; wherein the preset time period refers to the daily and monthly time requirements within the validity period of the promotional activity. The reuse quota verification includes: in the quota reuse verification, by matching the user ID, activity ID, and order amount to the starting range of the activity order amount, checking whether there are reusable quotas in the Redis cache. When a reusable quota is found in the Redis cache, the reusable quota will be directly selected and the discount information will be returned. When no reusable quota is found in the Redis cache, the activity quota will be locked. When the activity quota is successfully locked, the discount information will be returned. Redis is used for data recording and caching.

6. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 4.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Method and apparatus for determining discount amount

    WO2020134663A1