Coupon optimal matching calculation method and system
By flexibly combining and automatically allocating coupons with multiple attributes, platforms, and categories, the problems of complex mutual exclusion and low computational efficiency of multiple coupons in traditional coupon matching methods are solved, resulting in a significant improvement in coupon usage efficiency and computation speed.
Patent Information
- Application Number
- CN202511069968.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-31
- Publication Date
- 2025-11-21
AI Technical Summary
Traditional coupon matching methods cannot efficiently handle the complex mutual exclusion between multiple coupons, lack dynamic optimization, have low computational efficiency, and are difficult to support high-concurrency scenarios.
By flexibly combining and automatically allocating coupons with multiple attributes, platforms, and categories, conflicting coupons are automatically excluded based on mutual exclusion logic and priority rules. The binding relationship is adjusted in real time using a many-to-many observer pattern and dynamic programming algorithm.
It improves the efficiency of coupon usage, reduces the calculation speed from seconds to milliseconds, supports multi-scenario and multi-platform expansion, and maximizes the user's discount amount.
Smart Images

Figure CN120996871A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of electronic commerce and intelligent recommendation, in particular to a coupon optimal matching calculation method and system. BACKGROUND
[0002] In the electronic commerce transaction activities, as a core tool to improve user purchase conversion rate and platform activation, coupons have been widely used. It stimulates the user's purchase desire by providing certain price concessions to the user, increases the user's purchase frequency and purchase amount, and thus improves the platform's sales and user activity. However, with the continuous development of electronic commerce and the intensification of market competition, the use scenarios and types of coupons are becoming more and more complex, and the traditional coupon matching method has been difficult to meet the needs of users and platforms, mainly having the following deficiencies:
[0003] Insufficient combination complexity: the traditional method only supports single coupon or simple superposition, and cannot efficiently handle complex mutual exclusion among multiple coupons (such as conflict between discount and discount coupons).
[0004] Lack of dynamic optimization: the existing scheme cannot respond to real-time changes of order goods, and cannot dynamically adjust the optimal combination of coupons.
[0005] Low computational efficiency: when facing large-scale orders and multiple coupon combinations, the traditional exhaustive method consumes a lot of computing resources and has slow response speed, which is difficult to support high-concurrency scenarios. SUMMARY
[0006] Based on this, the embodiments of the present application provide a coupon optimal matching calculation method and system. The present application maximizes the user's discount amount through flexible combination and automatic distribution of multi-attribute, multi-platform, and multi-category coupons. In addition, based on the mutual exclusion logic and priority rules, conflicting coupons are automatically excluded to improve the computational efficiency and result accuracy.
[0007] In a first aspect, a coupon optimal matching calculation method is provided, which comprises:
[0008] Filter all coupons through a preset strategy to select available coupons that meet the current order conditions; wherein the preset strategy at least includes filtering all coupons by product type and platform information;
[0009] Create a data center object, and for each available coupon selected, establish an association between the available coupon and the data center object; wherein the data center object includes order basic information, product detailed information, coupon information, and the association between the coupon and the order or product;
[0010] The processed available coupons are determined to have a binding relationship with the order or the goods, the data center object is updated, and after the processing is completed, the binding information is summarized, the final payable amount and the total discount amount are calculated, and the results are output to the user.
[0011] The processed available coupons are determined to have a binding relationship with the order or the goods, the data center object is updated, and after the processing is completed, the binding information is summarized, the final payable amount and the total discount amount are calculated, and the results are output to the user.
[0012] Each coupon is processed in order from large to small according to the discount amount, and for the currently processed coupon, it is checked whether it meets the use conditions and is available;
[0013] If the conditions are met and available, the binding operation is performed to determine the binding relationship between the coupon and the order or the goods, and the binding information is updated to the data center;
[0014] If the current coupon does not meet the conditions or is not available, it is removed from the subscription list of the data center.
[0015] Optionally, all coupons are filtered by a preset strategy to filter out available coupons that meet the current order conditions, including:
[0016] Collect the type of goods, platform information, total order amount, number of goods, and price order characteristic information of the current order;
[0017] Iterate through all the coupons and check the applicable scope, applicable platform, discount type, and use condition attributes of each coupon one by one;
[0018] For each coupon, it is determined whether its applicable scope contains the type of goods in the current order, and whether its applicable platform matches the platform information of the current order;
[0019] For the coupons whose applicable scope and applicable platform are matched, it is further checked whether their use conditions meet the characteristic information of the current order, including whether the total order amount reaches the minimum use threshold of the coupon, whether the number of goods and the price meet the restriction conditions of the coupon;
[0020] The coupons that meet all the conditions are filtered out as the available coupon set.
[0021] Optionally, a data center object is created, and for each available coupon filtered out, an association relationship between the available coupon and the data center object is established, including:
[0022] The data center object is initialized, and its storage structure containing order basic information, goods detailed information, coupon information, and the association relationship between the coupon and the order or the goods is set;
[0023] storing the total amount of the current order, the list of commodities and their detailed information to the corresponding locations of the data center object;
[0024] traversing the set of available coupons, for each available coupon, extracting its coupon information and storing it to the coupon information area of the data center object; wherein the coupon information includes the coupon type, the discount amount, and the usage condition;
[0025] creating an associated record in the data center object for each available coupon, which is initially not bound to any order or commodity, for recording the binding relationship between the coupon and the order or commodity in the future; and establishing a mapping table to map each available coupon to the associated record in the data center object, so as to quickly locate and update the binding information of the coupon in the subsequent processing.
[0026] Optionally, each coupon is processed in turn according to the order of the discount amount from large to small, including:
[0027] sorting the set of available coupons in descending order according to the discount amount to generate a queue of coupons to be processed;
[0028] taking a coupon from the head of the queue of coupons to be processed as the currently processed coupon;
[0029] checking whether the currently processed coupon meets the usage condition and is available, including checking whether the total amount of the order reaches the minimum usage threshold of the coupon, and whether the number and price of the commodities meet the restriction condition of the coupon;
[0030] if the current coupon meets the condition and is available, performing a binding operation to determine the binding relationship between the coupon and the order or commodity, and updating the binding information in the data center, including updating the associated record in the data center object, binding the coupon to the corresponding order or commodity, and recording the specific information of the binding, such as the binding time and the identifier of the bound order or commodity;
[0031] if the current coupon does not meet the condition or is not available, removing it from the queue of coupons to be processed, and deleting the related information of the coupon from the associated record in the data center object;
[0032] processing the next coupon in the queue of coupons to be processed in turn until the queue is empty, and completing the processing of all available coupons.
[0033] Optionally, after the processing is completed, the binding information is summarized, the final payable amount and the total discount amount are calculated, and the results are output to the user, including:
[0034] Traverse all the associated records in the data center object, collect information of all the bound coupons, including the type of the coupon, the discount amount, the bound order or the commodity identifier;
[0035] According to the information of the bound coupon, calculate the discount amount of each coupon, and accumulate to obtain the total discount amount; subtract the total discount amount from the total order amount to obtain the final payable amount;
[0036] Organize the final payable amount, the total discount amount, and the specific use information of each coupon into a result data structure;
[0037] Convert the result data structure into a user-readable format, and then output the readable format to the user; wherein the readable format includes text, table or graphical interface.
[0038] In a second aspect, a coupon optimal matching calculation system is provided, which comprises:
[0039] A screening module is configured to filter all coupons by a preset strategy to screen out available coupons meeting the current order conditions; wherein the preset strategy at least includes filtering all coupons by commodity type and platform information;
[0040] An association module is configured to create a data center object, and for each available coupon screened out, establish an association between the available coupon and the data center object; wherein the data center object includes order basic information, commodity detailed information, coupon information, and the association between the coupon and the order or the commodity;
[0041] An output module is configured to process the screened available coupons, determine the binding relationship between the coupon and the order or the commodity, update the data center object, after the processing is completed, summarize the binding information, calculate the final payable amount and the total discount amount, and output the result to the user.
[0042] In a third aspect, an electronic device is provided, which comprises a memory and a processor, the memory stores a computer program, and the processor implements the coupon optimal matching calculation method of any one of the first aspect when executing the computer program.
[0043] In a fourth aspect, a computer readable storage medium is provided, which stores a computer program, and the computer program is executed by a processor to implement the coupon optimal matching calculation method of any one of the first aspect.
[0044] In a fifth aspect, a computer program product is provided, which stores a computer program, and the computer program is executed by a processor to implement the coupon optimal matching calculation method of any one of the first aspect.
[0045] The technical scheme provided by the embodiment of the application has at least the beneficial effects that the binding relationship of the coupons is dynamically detected and adjusted, the applicable state and the binding relationship of all the coupons are automatically linked after each coupon selection or order change, the maximum discount amount that can be enjoyed by the user is ensured, and the use efficiency of the coupons is improved.
[0046] In addition, the average calculation time is significantly lower than the traditional method, which is reduced from seconds to milliseconds. The method supports multi-scenario, multi-platform, and multi-service custom rule extension. BRIEF DESCRIPTION OF DRAWINGS
[0047] In order to more clearly illustrate the technical scheme in the embodiments of the present application or the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced. Obviously, the drawings in the following description are only exemplary, and other drawings can be obtained by the provided drawings without creative labor for those skilled in the art.
[0048] Figure 1 The step flow chart of the coupon optimal matching calculation method provided by the embodiment of the present application is shown in the figure.
[0049] Figure 2 The system architecture diagram of the coupon optimal matching calculation system provided by the embodiment of the present application is shown in the figure.
[0050] Figure 3 The schematic diagram of the electronic device provided by the embodiment of the present application is shown in the figure. DETAILED DESCRIPTION
[0051] In order to make the purpose, technical scheme and advantages of the present application more clear, the present application will be further described in detail below in combination with the 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.
[0052] In the description of the present application, the terms "include", "have" and any variants thereof are intended to cover the non-exclusive inclusion, for example, the process, method, system, product or device including a series of steps or units does not have to be limited to the steps or units explicitly listed, but can also include other steps or units inherent to the process, method, product or device, or steps or units added based on the further optimization scheme of the concept of the present application.
[0053] In order to facilitate the understanding of the present embodiment, first, the coupon attribute and use rule in the coupon optimal matching calculation method disclosed by the embodiment of the present application are introduced:
[0054] Applicable scope: distinguish full categories (order level) and limited categories (such as specified goods, brands, product types, machines, etc., product level);
[0055] Applicable platform: multi-terminal compatible such as client App, WeChat applet, etc. Coupon type: covering full-reduction coupons, discount coupons.
[0056] Coupon use restrictions include:
[0057] Each product can use at most one limited category coupon;
[0058] Each order can use at most one full category coupon;
[0059] If the product does not support coupons, it cannot participate in any preferential distribution.
[0060] Please refer to Figure 1 , which shows a flowchart of a coupon optimal matching calculation method provided by the embodiments of the present application. The method can include the following steps:
[0061] S1, filter all coupons through a preset strategy to screen out available coupons that meet the current order conditions.
[0062] Among them, the preset strategy at least includes filtering all coupons according to product type and platform information.
[0063] Specifically, collect the product type, platform information, order total amount, product quantity and price order characteristic information of the current order;
[0064] Iterate through all coupons and check the applicable scope, applicable platform, discount type and use condition attributes of each coupon one by one;
[0065] For each coupon, determine whether its applicable scope contains the product type in the current order, and whether its applicable platform matches the platform information of the current order;
[0066] For the coupons whose applicable scope and applicable platform are matched, further check whether their use conditions meet the characteristic information of the current order, including whether the order total amount reaches the minimum use threshold of the coupon, whether the product quantity and price meet the limited conditions of the coupon;
[0067] Screen out the coupons that meet all conditions as the available coupon set.
[0068] S2, create a data center object, and for each available coupon screened out, establish an association between the available coupon and the data center object.
[0069] The data center object includes order basic information, commodity detailed information, coupon information, and an association relationship between the coupon and the order or the commodity.
[0070] Specifically, the data center object is initialized, and a storage structure containing order basic information, commodity detailed information, coupon information, and an association relationship between the coupon and the order or the commodity is set.
[0071] The total amount of the current order, the commodity list, and the detailed information thereof are stored in the corresponding positions of the data center object.
[0072] The set of available coupons is traversed, and for each available coupon, the coupon information thereof is extracted and stored in the coupon information area of the data center object. The coupon information includes a coupon type, a discount quota, and a use condition.
[0073] An association record is created in the data center object for each available coupon. The record is not bound to any order or commodity initially and is used to record the binding relationship between the coupon and the order or the commodity subsequently. A mapping table is established to map each available coupon to the association record in the data center object, so that the binding information of the coupon can be quickly located and updated in subsequent processing.
[0074] In the embodiment of the present application, the set of available coupons is sorted in descending order according to the discount quota to generate a to-be-processed coupon queue.
[0075] A coupon at the head of the to-be-processed coupon queue is taken out as a currently processed coupon.
[0076] It is checked whether the currently processed coupon meets the use condition and is available. Specifically, it is checked whether the total amount of the order reaches the minimum use threshold of the coupon, and whether the number and price of the commodities meet the restriction condition of the coupon.
[0077] If the current coupon meets the condition and is available, a binding operation is performed to determine the binding relationship between the coupon and the order or the commodity, and the binding information is updated in the data center, including updating the association record in the data center object, binding the coupon to the corresponding order or commodity, and recording the specific information of the binding, such as the binding time and the order or commodity identifier.
[0078] If the current coupon does not meet the condition or is not available, the coupon is removed from the to-be-processed coupon queue, and the related information of the coupon is deleted from the association record of the data center object.
[0079] The next coupon in the to-be-processed coupon queue is processed in turn until the queue is empty, and the processing of all available coupons is completed.
[0080] S3, processing the screened available coupons, determining the binding relationship between the coupons and the order or the goods, updating the data center object, after the processing is completed, summarizing the binding information, calculating the final payable amount and the total discount amount, and outputting the result to the user.
[0081] Among them, each coupon is processed in order from large to small according to the discount amount, and for the currently processed coupon, it is checked whether it meets the use condition and whether it is available;
[0082] If the condition is met and available, the binding operation is performed, the binding relationship between the coupon and the order or the goods is determined, and the binding information is updated to the data center;
[0083] If the current coupon does not meet the condition or is not available, it is removed from the subscription list in the data center.
[0084] Specifically, all associated records in the data center object are traversed, and information of all bound coupons is collected, including the type of the coupon, the discount amount, and the bound order or goods identifier;
[0085] According to the information of the bound coupon, the discount amount of each coupon is calculated, and the total discount amount is accumulated; the total discount amount is subtracted from the order total amount to obtain the final payable amount;
[0086] The final payable amount, the total discount amount, and the specific use condition information of each coupon are arranged into a result data structure;
[0087] The result data structure is converted into a readable format for the user, and then the readable format is output to the user; wherein the readable format includes text, table or graphical interface.
[0088] As can be seen from the above, the present application includes:
[0089] The data association layer: a many-to-many observer mode is adopted, the order is the main body, the coupon is the observer, the order goods attribute (category, price, quantity, etc.) change is listened to in real time, and the dynamic association of coupon-goods and coupon-order is maintained.
[0090] The algorithm layer: a combined optimization algorithm of dynamic programming and greedy strategy is adopted, matrix traversal and pruning are performed on all possible coupon combinations, and a mutual exclusion logic engine is combined to quickly screen the maximum discount solution.
[0091] The cache layer: the optimal calculation result of the historical high-frequency coupon combination is cached, and a subscription-notification mechanism is used for automatic updating, thereby improving the real-time performance and throughput of the system.
[0092] In the optional embodiment of the present application, the above process specifically further includes:
[0093] I. Calculation content:
[0094] 1. Calculate whether the currently selected coupon by the user can be used;
[0095] 2. Calculate how much the currently selected coupon by the user can discount;
[0096] 3. Calculate whether the currently selected coupon by the user is a full-category or a limited-category, and if it is a limited-category, calculate which specific product it is used for;
[0097] 4. Calculate whether the currently selected coupon by the user excludes the previously selected coupon, which can be in the following cases:
[0098] (1) When the order price is 10 yuan, the user first selects a full-category coupon that reduces 2 yuan for orders over 10 yuan. Then if the user selects a limited-category coupon that reduces 1 yuan for orders over 5 yuan, after calculating the discount of the limited-category coupon, the order price changes from 10 yuan to 9 yuan, causing the previously selected full-category coupon to not meet the 10 yuan order threshold, thus making the full-category coupon unusable.
[0099] (2) When the order price is 10 yuan, the user's order contains two products A and B, and the user has a limited-category coupon that can be used for A and B. This limited-category coupon can discount 2 yuan when used for A and 3 yuan when used for B. At this time, after calculation, the optimal use of this coupon is to use it on product B.
[0100] (3) The user's order contains two products A and B, and the user has two coupons Z and X. Coupon Z can discount 2 yuan for product A and 3 yuan for product B. Coupon X can only be used on product B and can discount 2 yuan. At this time, if the user first selects coupon Z, then according to the previous logic, Z is applied to product B. When the user selects coupon X next, the previous calculation of Z applied to B needs to be replaced with Z applied to A, and X applied to B, because using two coupons can discount 4 yuan, which exceeds the 3 yuan discount of using a single coupon.
[0101] II. Implementation:
[0102] 1. Use the observer pattern;
[0103] 2. Create a data center object, which contains the total amount of goods, the object of the relationship between coupons and discountable targets, and the discountable targets refer to the order level and specific products;
[0104] Object of the relationship between coupons and discountable targets:
[0105] This object records the relationship between the coupon and the target of the coupon, and the relationship is 1 to n; the target of the coupon includes an order and a product; this object has two main methods:
[0106] (1) Get which products the current coupon can be used for;
[0107] (2) If one of the products in the order is matched by another coupon, the object of the relationship between the current coupon and the target of the coupon needs to be updated, and the product is removed from it;
[0108] 3. When the user checks the coupon, the observer mode is enabled, and the best match is selected from all the relationships, and other relationships are updated.
[0109] In addition, the key technical implementation details in this application include:
[0110] Coupon filtering and strategy distribution: The system filters available coupons by product type and platform information through the strategy mode, ensuring that only coupons that meet business rules enter the calculation link.
[0111] Data center and observer mode: The DataCenter maintains the order amount, product availability and coupon target relationship, and all coupons (Observer) automatically subscribe to related changes to achieve real-time linkage and optimal matching.
[0112] Automatic conflict detection and optimal adjustment: If the user selects multiple coupons or the product changes, causing part of the coupon threshold to no longer meet, the system automatically unsubscribes the invalid coupons and dynamically adjusts the distribution of the remaining coupons.
[0113] The following gives a typical scenario example:
[0114] First use the full-category discount coupon, then use the limited-category coupon to cause the threshold to be invalid, and automatically switch to the optimal distribution;
[0115] The same coupon can act on multiple products, and the system automatically matches the maximum target of the coupon;
[0116] In the multi-coupon and multi-product scenario, dynamic rearrangement maximizes the total discount (for example, Z coupon can act on B product with a discount of 3 yuan, X coupon can only act on B product with a discount of 2 yuan, the system automatically assigns Z coupon to act on A product and X coupon to act on B product, to achieve the maximum discount).
[0117] Please refer to Figure 2 , which shows a block diagram of a coupon optimal matching calculation system provided by an embodiment of the application. The system can include:
[0118] A filtering module for filtering all coupons through a preset strategy to filter out available coupons that meet the current order conditions; wherein the preset strategy at least includes filtering all coupons by product type and platform information;
[0119] The association module is configured to create a data center object, and establish an association between the available coupon and the data center object for each of the screened available coupons; wherein the data center object comprises order basic information, commodity detailed information, coupon information, and an association between the coupon and the order or the commodity.
[0120] The output module is configured to process the screened available coupons, determine a binding relationship between the coupon and the order or the commodity, update the data center object, aggregate the binding information after the processing is completed, calculate a final payable amount and a total discount amount, and output the results to the user.
[0121] The specific limitations of the coupon optimal matching calculation system can be seen from the limitations of the coupon optimal matching calculation method in the foregoing, and will not be described here. Each module in the above-mentioned coupon optimal matching calculation system can be realized by software, hardware, or a combination thereof, in whole or in part. The above-mentioned modules can be embedded in or independent of the processor in the computer device in hardware form, or can be stored in the memory in the computer device in software form, so as to be called and executed by the processor to perform the operations corresponding to each of the above-mentioned modules.
[0122] In one embodiment, an electronic device, which can be a computer, can have an internal structure diagram as shown in Figure 3 The electronic device includes a processor, a memory, and a network interface connected by a system bus. The processor of the device is configured to provide computing and control capabilities. The memory of the 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 operating system and the computer program in the non-volatile storage medium to run. The database of the computer device is used for coupon optimal matching calculation data. The network interface of the computer device is used for communication connection with external terminals through a network. The computer program is executed by the processor to implement a coupon optimal matching calculation method.
[0123] Those skilled in the art can understand that the structure shown in Figure 3 is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0124] In one embodiment of the present application, a computer readable storage medium is provided, which stores a computer program. The computer program is executed by the processor to implement the steps of the above-mentioned coupon optimal matching calculation method.
[0125] In one embodiment of the present application, a computer program product is provided, comprising computer programs / instructions, which, when executed by a processor, implement the steps of the above-mentioned coupon optimal matching calculation method.
[0126] The computer-readable storage medium and the computer program product provided in the embodiments have similar implementation principles and technical effects to the above-mentioned method embodiments, and will not be described here.
[0127] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, the processes of the above-mentioned embodiments can be included. Any reference to memory, storage, database or other medium used in the embodiments provided by the present 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. As an illustration but not limitation, RAM is available in M forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (SyMchliMk) DRAM (SLDRAM), memory bus (RaMbus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM) and memory bus dynamic RAM (RDRAM).
[0128] Each technical feature of the above-mentioned embodiments can be combined arbitrarily. In order to make the description simple, all possible combinations of each technical feature in the above-mentioned embodiments are not described, however, as long as the combination of these technical features does not exist, it should be considered as the scope of the present application.
[0129] The above-mentioned embodiments only express several implementation manners of the present application, and the description is more specific and detailed, but it should not be understood as a limitation on the patent scope of the present application. It should be noted that, for those skilled in the art, without departing from the concept of the present application, some modifications and improvements can be made, which are all within the protection scope of the present application. Therefore, the patent protection scope of the present application should be subject to the appended claims.
Claims
1. A coupon optimal matching calculation method, characterized by, The method comprises: Filtering all coupons by a preset strategy to screen out available coupons meeting current order conditions, wherein the preset strategy at least comprises filtering all coupons by commodity type and platform information; Creating a data center object, and establishing an association between each of the screened available coupons and the data center object, wherein the data center object comprises order basic information, commodity detailed information, coupon information, and an association between the coupon and the order or commodity; Processing the screened available coupons, determining the binding relationship between the coupon and the order or commodity, updating the data center object, and after the processing is completed, summarizing the binding information, calculating the final payable amount and total discount amount, and outputting the results to the user.
2. The coupon optimal matching calculation method according to claim 1, characterized by, Processing the screened available coupons, determining the binding relationship between the coupon and the order or commodity, updating the data center object, and specifically comprising: Processing each coupon in order from large to small according to the discount amount, and for the currently processed coupon, checking whether it meets the use conditions and is available; If the conditions are met and the coupon is available, performing a binding operation to determine the binding relationship between the coupon and the order or commodity, and updating the binding information to the data center; If the current coupon does not meet the conditions or is not available, removing it from the subscription list of the data center.
3. The coupon optimal matching calculation method of claim 1, wherein, Filtering all coupons by a preset strategy to screen out available coupons meeting current order conditions, comprising: Collecting the commodity type, platform information, order total amount, commodity quantity, and price order characteristic information of the current order; Iterating through all coupons to check the applicable range, applicable platform, discount type, and use condition attribute of each coupon one by one; For each coupon, determining whether its applicable range contains the commodity type in the current order, and determining whether its applicable platform matches the platform information of the current order; For the coupon whose applicable range and applicable platform are matched, further checking whether its use conditions meet the characteristic information of the current order, including whether the order total amount reaches the minimum use threshold of the coupon, and whether the commodity quantity and price meet the restriction conditions of the coupon; Screening out the coupons meeting all conditions as the available coupon set.
4. The coupon optimal matching computation method of claim 1, wherein, Creating a data center object, and establishing an association between each of the screened available coupons and the data center object, comprising: Initializing the data center object, and setting its storage structure containing order basic information, commodity detailed information, coupon information, and an association between the coupon and the order or commodity; Storing the total amount of the current order, the commodity list and its detailed information to the corresponding position of the data center object; Iterating through the available coupon set, and for each available coupon, extracting its coupon information and storing it in the coupon information area of the data center object; wherein the coupon information comprises coupon type, discount amount, and use condition. An associated record is created in the data center object for each available coupon, which is initially not bound to any order or item and is used to record the binding relationship between the coupon and the order or item in the future; a mapping table is established to map each available coupon to the associated record in the data center object, so that the binding information of the coupon can be quickly located and updated in the subsequent processing.
5. The coupon optimal matching computation method of claim 2, wherein, Each coupon is processed in turn according to the order of the discount amount from large to small, including: The available coupon set is sorted in descending order according to the discount amount to generate a to-be-processed coupon queue; A coupon is taken from the head of the to-be-processed coupon queue as the currently processed coupon; It is checked whether the currently processed coupon meets the use conditions and is available, including checking whether the total order amount meets the minimum use threshold of the coupon, and whether the number and price of the goods meet the restriction conditions of the coupon; If the current coupon meets the conditions and is available, the binding operation is performed to determine the binding relationship between the coupon and the order or item, and the binding information is updated in the data center, including updating the associated record in the data center object, binding the coupon to the corresponding order or item, and recording the specific binding information, such as the binding time and the order or item identifier; If the current coupon does not meet the conditions or is not available, it is removed from the to-be-processed coupon queue, and the related information of the coupon is deleted from the associated record of the data center object; The next coupon in the to-be-processed coupon queue is processed in turn until the queue is empty, and the processing of all available coupons is completed.
6. The coupon optimal matching computation method of claim 1, wherein, After the processing is completed, the binding information is summarized, the final payable amount and the total discount amount are calculated, and the results are output to the user, including: All associated records in the data center object are traversed to collect information of all bound coupons, including the type, discount amount, and bound order or item identifier of the coupon; According to the information of the bound coupon, the discount amount of each coupon is calculated, and the total discount amount is accumulated; the final payable amount is obtained by subtracting the total discount amount from the total order amount; The final payable amount, the total discount amount, and the specific use information of each coupon are arranged into a result data structure; The result data structure is converted into a user-readable format, and then the readable format is output to the user; the readable format includes text, table, or graphical interface.
7. A coupon optimal matching computing system, characterized by, The system includes: A screening module for filtering all coupons by a preset strategy to screen out available coupons that meet the current order conditions; wherein the preset strategy at least includes filtering all coupons by the type of goods and platform information; An association module for creating a data center object and establishing an association relationship between the available coupon and the data center object for each available coupon screened out; wherein the data center object includes order basic information, item detailed information, coupon information, and the association relationship between the coupon and the order or item; An output module is configured to process the screened available coupons, determine the binding relationship between the coupons and the orders or the commodities, update the data center objects, aggregate the binding information after the processing is completed, calculate the final payable amount and the total discount amount, and output the results to the user.
8. An electronic device, comprising: The computer program is stored in the memory and is executed by the processor to implement the coupon optimal matching calculation method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer program is stored in the memory and is executed by the processor to implement the coupon optimal matching calculation method according to any one of claims 1 to 6.
10. A computer program product comprising computer programs / instructions, characterized in that, The computer program / instruction is executed by the processor to implement the coupon optimal matching calculation method according to any one of claims 1 to 6.