Virtual card order processing method and device, electronic equipment and storage medium

By collecting real-time data from coupon suppliers and dynamically selecting target suppliers for order processing, the static and blind nature of supplier selection mechanisms in existing technologies is solved, thereby improving the efficiency and economy of the virtual coupon distribution system.

CN122312136APending Publication Date: 2026-06-30GUIYANG SHIJIHENGTONG TECH

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUIYANG SHIJIHENGTONG TECH
Filing Date
2026-04-20
Publication Date
2026-06-30

Smart Images

  • Figure CN122312136A_ABST
    Figure CN122312136A_ABST
Patent Text Reader

Abstract

This invention proposes a virtual coupon order processing method, apparatus, electronic device, and storage medium, relating to the field of virtual coupon distribution technology. The method involves collecting real-time operational data from each coupon supplier in parallel when a user submits a virtual coupon order; determining at least one candidate supplier from all suppliers based on the real-time operational data; obtaining the comprehensive expected profit for each candidate supplier for the virtual coupon order based on the user's actual payment amount and the real-time operational data of each candidate supplier; determining the target supplier based on the comprehensive expected profit and real-time operational data of each candidate supplier; and calling the target supplier's API to process the virtual coupon order. This ensures that each order routing is based on the most reliable supplier status and the most realistic cost structure, thereby eliminating the need for manual intervention and improving the platform's overall profit margin, recharge success rate, and system availability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of virtual coupon distribution technology, and more specifically, to a virtual coupon order processing method, apparatus, electronic device, and storage medium. Background Technology

[0002] The current supplier selection mechanism in virtual coupon distribution systems still employs a coarse-grained routing strategy based on static binding, serial calls, and stateless judgment. Upon receiving a user order, the system determines the preferred supplier solely based on a manually maintained static configuration table and directly initiates an API call. The "availability" judgment of the preferred supplier is typically limited to whether the service process is alive or the API endpoint is reachable. Once the preferred supplier call fails, the system passively switches to a pre-set retry process with alternative suppliers, resulting in significantly longer average user waiting times, a persistently high order card loss rate, and continuously rising hidden costs such as failure compensation and customer complaint handling. Summary of the Invention

[0003] In view of this, the purpose of the present invention is to provide a virtual card order processing method, apparatus, electronic device and storage medium.

[0004] To achieve the above objectives, the technical solutions adopted in the embodiments of the present invention are as follows: In a first aspect, the present invention provides a method for processing virtual coupon orders, the method comprising: When a user submits a virtual coupon order, real-time operational data from each coupon provider is collected in parallel. Based on the real-time operational data of each coupon supplier, at least one candidate supplier is identified from all coupon suppliers. Based on the actual amount paid by the user for the virtual coupon order and the real-time operating data of each candidate supplier, the comprehensive expected profit of each candidate supplier for the virtual coupon order is obtained; The target supplier is determined based on the comprehensive expected profit and real-time operating data of each candidate supplier. The API of the target supplier is invoked to place the virtual coupon order.

[0005] Optionally, the real-time operational data includes the current price, the actual card issuance success rate within the most recent first time period, the response time of the most recent N requests, error type distribution statistics, and the current number of concurrent requests. The step of determining at least one candidate supplier from all card suppliers based on the real-time operational data of each card supplier includes: For each of the card and coupon suppliers, based on the supplier's actual card issuance success rate in the most recent first time period, the response time of the most recent N requests, and the error type distribution statistics, it is determined whether the card and coupon supplier meets the preset circuit breaker conditions. If so, mark the coupon supplier as unavailable; If not, then the aforementioned coupon supplier will be designated as a supplier to be determined. Based on the current quote and current concurrent request count of each of the prospective suppliers, at least one of the candidate suppliers is determined from all the prospective suppliers.

[0006] Optionally, the step of determining whether the card / coupon supplier meets the preset circuit breaker conditions based on the actual card issuance success rate within the most recent first time period, the response delay of the most recent N requests, and the error type distribution statistics of the card / coupon supplier includes: If, based on the error type distribution statistics, the number of consecutively failed orders is greater than a first preset threshold, and / or based on the error type distribution statistics, the order processing error rate within the most recent second time period is greater than a second preset threshold, and / or the actual card issuance success rate within the most recent first time period is less than a third preset threshold, and / or the number of times the response time of the most recent N requests exceeds the third time period is greater than a fourth preset threshold, then the card supplier is determined to meet the preset circuit breaker conditions.

[0007] Optionally, the step of determining at least one candidate supplier from all the candidate suppliers based on the current quote and current concurrent request count of each candidate supplier includes: For each of the pending suppliers, if the current quotation of the pending supplier is not less than the amount actually paid by the user and the current concurrent request count of the pending supplier does not exceed a preset number of times the historical average concurrent request count of the pending supplier, then the pending supplier is determined as the candidate supplier.

[0008] Optionally, the real-time operating data includes the current price, the actual card issuance success rate within the most recent fourth time period, and error type distribution statistics. The step of obtaining the comprehensive expected profit of each candidate supplier for the virtual card order based on the user's actual payment amount corresponding to the virtual card order and the real-time operating data of each candidate supplier includes: Based on the preset average compensation amount for a single failure and the actual card issuance success rate of each candidate supplier within the most recent fifth time period, the estimated failure cost of each candidate supplier is obtained. Based on the error type distribution statistics of each candidate supplier, the order timeout rate of each candidate supplier in the most recent fourth time period is obtained, and the estimated customer complaint cost of each candidate supplier is obtained based on the preset average reassurance cost per timeout and the order timeout rate of each candidate supplier in the most recent fourth time period. Based on the user's actual payment amount, the current quote of each candidate supplier, the estimated failure cost, and the estimated customer complaint cost, the comprehensive expected profit of each candidate supplier is obtained.

[0009] Optionally, the real-time operational data includes the actual card issuance success rate within the most recent first time period, the response time of the most recent N requests, and the current number of concurrent requests. The step of determining the target supplier based on the comprehensive expected profit of each candidate supplier and the real-time operational data includes: Sort all candidate suppliers in descending order of their overall expected profit to obtain an initial supplier sequence. For each pair of adjacent candidate suppliers in the initial supplier sequence, if the difference in the comprehensive expected profit of the two adjacent candidate suppliers is less than the fifth preset threshold, the order of the two adjacent candidate suppliers is adjusted according to the actual card issuance success rate in the most recent first time period, the response time of the most recent N requests, and the current number of concurrent requests, to obtain the target supplier sequence. The first candidate supplier in the target supplier sequence is selected as the target supplier.

[0010] Optionally, the method further includes: If the API call to the target supplier fails, the step of determining the target supplier based on the comprehensive expected profit and real-time operating data of each candidate supplier is re-executed for the remaining candidate suppliers, and the number of retries is accumulated. If the number of retries is not less than a preset number, the virtual coupon order will be added to the manual processing queue and an alarm message will be generated.

[0011] In a second aspect, the present invention provides a virtual coupon order processing device, the device comprising: The data acquisition module is used to collect real-time operational data from various voucher suppliers in parallel when a user submits a virtual voucher order. The processing module is used to determine at least one candidate supplier from all coupon suppliers based on the real-time operating data of each coupon supplier; to obtain the comprehensive expected profit of each candidate supplier for the virtual coupon order based on the user's actual payment amount corresponding to the virtual coupon order and the real-time operating data of each candidate supplier; to determine the target supplier based on the comprehensive expected profit of each candidate supplier and the real-time operating data; and to call the API of the target supplier to place the virtual coupon order.

[0012] Thirdly, the present invention provides an electronic device including a processor and a memory, the memory storing machine-executable instructions executable by the processor, the processor executing the machine-executable instructions to implement the virtual coupon order processing method described in the first aspect above.

[0013] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the virtual card order processing method as described in the first aspect above.

[0014] The virtual coupon order processing method, apparatus, electronic device, and storage medium provided in this invention collect real-time operating data from each coupon supplier in parallel when a user submits a virtual coupon order. Based on the real-time operating data of each coupon supplier, at least one candidate supplier is determined from all coupon suppliers. Based on the user's actual payment amount corresponding to the virtual coupon order and the real-time operating data of each candidate supplier, the comprehensive expected profit of each candidate supplier for the virtual coupon order is obtained. Based on the comprehensive expected profit of each candidate supplier and the real-time operating data, a target supplier is determined. The API of the target supplier is called to process the virtual coupon order, so that each order routing is based on the current most reliable supplier status and the most realistic cost structure. This avoids service failures caused by over-reported inventory, price lag, and fault propagation, and also avoids the illusion of apparent profit caused by ignoring hidden costs. Thus, without manual intervention, the platform's overall profit margin, recharge success rate, and system availability are improved simultaneously.

[0015] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0016] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1 This figure shows a schematic block diagram of an electronic device provided by an embodiment of the present invention; Figure 2 This illustration shows a flowchart of a virtual coupon order processing method provided by an embodiment of the present invention. Figure 1 ; Figure 3 A flowchart illustrating an implementation of step S102 provided in an embodiment of the present invention is shown. Figure 4 The diagram shows a flowchart illustrating an implementation of step S103 according to an embodiment of the present invention. Figure 5 A flowchart illustrating an implementation of step S104 provided in an embodiment of the present invention is shown. Figure 6 This illustration shows a flowchart of a virtual coupon order processing method provided by an embodiment of the present invention. Figure 2 ; Figure 7 The diagram shows a functional block diagram of a virtual card order processing device provided in an embodiment of the present invention.

[0018] Icons: 100 - Electronic device; 110 - Memory; 120 - Processor; 130 - Communication module; 200 - Virtual card order processing device; 201 - Acquisition module; 202 - Processing module. Detailed Implementation

[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.

[0020] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.

[0021] It should be noted that relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0022] Traditional supplier selection is a sequential, static, and feedback-free decision-making process. The entire process relies entirely on manually preset rules and has no dynamic adjustment capability. The execution steps are as follows: first, the system receives the user's order; then, it queries a static table configured several days or even weeks ago to obtain the default supplier ID; next, it only checks whether the supplier's interface is defined or the service is running; then, it directly calls the supplier's API and waits for a long time for a response (which can take 500 milliseconds to 10 seconds). If it fails, it can only retry or switch to the backup process, which doubles the user's waiting time. Moreover, at all stages, it is impossible to perceive the supplier's real inventory status, real-time price, historical success rate, and response latency. The fundamental limitation of this mechanism is that its configuration is lagging, its judgment is one-sided, and its invocation is blind. It cannot cope with the drastic price fluctuations caused by the high time sensitivity of virtual coupons, nor can it identify the huge discrepancy between the "in stock" flag returned by the supplier interface and the actual card issuance capacity. Furthermore, it cannot take into account the hidden costs such as failure compensation and customer complaint appeasement. Ultimately, this results in the platform making a profit on paper but actually incurring losses, frequent complaints from users about lost cards after deductions, and single-point failures spreading through polling strategies, causing large-scale order failures.

[0023] To overcome the shortcomings of the prior art, embodiments of the present invention provide a virtual card order processing method, apparatus, electronic device, and storage medium, which will be described in detail below.

[0024] Please refer to Figure 1 This is a block diagram of an electronic device 100. The electronic device 100 includes a memory 110, a processor 120, and a communication module 130. The memory 110, processor 120, and communication module 130 are electrically connected to each other directly or indirectly to realize data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines.

[0025] The memory 110 is used to store programs or data. The memory 110 may be, but is not limited to, random access memory (RAM), read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), etc.

[0026] The processor 120 is used to read / write data or programs stored in the memory 110 and to perform corresponding functions.

[0027] The communication module 130 is used to establish a communication connection between the electronic device 100 and other communication terminals through the network, and to send and receive data through the network.

[0028] It should be understood that, Figure 1 The structure shown is only a schematic diagram of the electronic device 100. The electronic device 100 may also include components that are larger than... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown. Figure 1 The components shown can be implemented using hardware, software, or a combination thereof.

[0029] Please refer to Figure 2 The virtual coupon order processing method provided in this embodiment of the invention includes steps S101 to S105.

[0030] S101 collects real-time operational data from each coupon supplier in parallel when a user submits a virtual coupon order.

[0031] In this embodiment of the invention, at the same moment a user submits a virtual coupon order, real-time operational data from each coupon supplier is collected in parallel. This includes: querying the current price (i.e., real-time price) of each supplier for goods of the same face value through a standard API interface and the "in stock / out of stock" flag returned by the interface (i.e., inventory status returned by the interface); simultaneously, based on local statistical calculations, obtaining the actual order success rate (i.e., actual card issuance success rate) of each supplier in the past 5 minutes, 1 hour, and 24 hours, the average response time and P95 latency (i.e., interface response latency) of the most recent N requests, the proportion of timeout errors / business errors (no card) / system errors, etc. (i.e., error type distribution statistics), and the number of requests being processed to that supplier (i.e., current concurrency); all collected data are accurately timestamped, uniformly stored in a local cache, with a 10-second expiration time set to ensure data freshness, and a sliding window statistical method is used to smooth the data, ensuring that a single abnormal request will not immediately distort the overall evaluation result.

[0032] Thus, in this embodiment of the invention, when a user submits a virtual coupon order, real-time operational data from each coupon supplier is collected in parallel, eliminating the reliance on manual configuration and historical snapshots. For the first time, it obtains real, synchronous, and time-sensitive status information of all suppliers in five dimensions—price, inventory reliability, stability, response efficiency, and load level—at the moment the order is generated. This provides an immutable data source for subsequent circuit breaker judgments, profit modeling, and multi-level sorting, fundamentally eliminating the problems of inaccurate decision-making, resource misallocation, and deteriorated user experience caused by information lag, missing dimensions, and sequential waiting.

[0033] S102, Based on the real-time operating data of each coupon supplier, determine at least one candidate supplier from all coupon suppliers.

[0034] In possible implementations, please refer to Figure 3 The implementation process of step S102 may include sub-steps S102-1 to S102-4.

[0035] S102-1, For each card supplier, based on the supplier's actual card issuance success rate in the most recent first time period, the response time of the most recent N requests, and the error type distribution statistics, determine whether the card supplier meets the preset circuit breaker conditions.

[0036] In this embodiment of the invention, the implementation process of step S102-1 may be as follows: if the number of consecutively failed orders is determined to be greater than a first preset threshold according to the error type distribution statistics, and / or the order processing error rate within the most recent second time period is determined to be greater than a second preset threshold according to the error type distribution statistics, and / or the actual card issuance success rate within the most recent first time period is less than a third preset threshold, and / or the number of times the response time of the most recent N requests exceeds the third time period is greater than a fourth preset threshold, then it is determined that the card supplier meets the preset circuit breaker conditions.

[0037] If the coupon supplier meets the preset circuit breaker conditions, then proceed to step S102-2; if the coupon supplier does not meet the preset circuit breaker conditions, then proceed to step S102-3.

[0038] S102-2, mark the coupon supplier as unavailable.

[0039] S102-3, designate the coupon supplier as a pending supplier.

[0040] S102-4, Based on the current quotes and current concurrent requests of each pending supplier, determine at least one candidate supplier from all pending suppliers.

[0041] In this embodiment of the invention, the implementation process of step S102-4 may be as follows: for each candidate supplier, if the current quotation of the candidate supplier is not less than the amount actually paid by the user and the current concurrent request number of the candidate supplier does not exceed a preset number of times the historical average concurrent number of the candidate supplier, then the candidate supplier is determined as a candidate supplier.

[0042] In other words, this embodiment of the invention first determines whether a card supplier meets the preset circuit breaker conditions for each supplier based on the supplier's actual card issuance success rate within the most recent first time period, the response time of the most recent N requests, and error type distribution statistics. Specifically, if the error type distribution statistics determine that the number of consecutively failed orders is greater than a first preset threshold (e.g., 5 consecutive failed orders), and / or the error type distribution statistics determine that the order processing error rate within the most recent second time period is greater than a second preset threshold (e.g., the error rate exceeds 20% within the most recent minute), and / or the actual card issuance success rate within the most recent first time period is less than a third preset threshold (e.g., the actual card issuance success rate is less than 50% within the most recent 5 minutes),... If the response time of the most recent N requests exceeds the third time limit more than the fourth preset threshold (e.g., 5 out of the most recent 10 requests have a response time exceeding 3 seconds), then the coupon supplier is determined to meet the preset circuit breaker conditions. Secondly, if the coupon supplier meets the preset circuit breaker conditions, it is marked as unavailable; otherwise, it is designated as a pending supplier. Finally, for each pending supplier, if the current price quoted by the pending supplier is not less than the actual amount paid by the user (i.e., the gross profit is not negative), and the current number of concurrent requests of the pending supplier does not exceed a preset number of times the historical average number of concurrent requests of the pending supplier (e.g., not exceeding 1.8 times its historical average number of concurrent requests), then the pending supplier is determined as a candidate supplier.

[0043] Thus, this embodiment of the invention determines at least one candidate supplier from all coupon suppliers based on the real-time operating data of each coupon supplier, achieving initial screening of the health and commercial feasibility of all suppliers within milliseconds. This avoids assigning orders to fake inventory suppliers that are "online" but have a "real success rate of less than 50%", and also avoids making invalid calls to overloaded suppliers with "P95 latency as high as 2500 milliseconds" or "current concurrency has reached the processing limit". Furthermore, it eliminates hidden losses caused by "supplier quoting 93 yuan but user actually paying only 95 yuan, gross profit of only 2 yuan but still having to bear failure compensation". The resulting set of candidate suppliers is no longer an arbitrary object manually designated or polled, but simultaneously meets the three conditions of "technically stable", "business reliable", and "economically reasonable".

[0044] Furthermore, if a coupon provider that has not been marked as unavailable has a real card issuance success rate between 50% and 80% in the past 5 minutes, or a P95 response latency exceeding 2 seconds, or a current number of concurrent requests exceeding 80% of its historical average concurrency, then that coupon provider will be marked as demoted. For coupon providers marked as unavailable, one test request will be allowed to the provider every 10 seconds; if two consecutive test requests are successful, the coupon provider will be restored to an available state.

[0045] S103. Based on the actual amount paid by the user for the virtual coupon order and the real-time operating data of each candidate supplier, obtain the comprehensive expected profit of each candidate supplier for the virtual coupon order.

[0046] In possible implementations, please refer to Figure 4 Step S103 may include sub-steps S103-1 to S103-3.

[0047] S103-1, based on the preset average compensation amount for a single failure and the actual card issuance success rate of each candidate supplier within the most recent fifth time period, the estimated failure cost of each candidate supplier is obtained.

[0048] S103-2, based on the error type distribution statistics of each candidate supplier, obtain the order timeout rate of each candidate supplier in the most recent fourth time period, and based on the preset average reassurance cost per timeout and the order timeout rate of each candidate supplier in the most recent fourth time period, obtain the estimated customer complaint cost of each candidate supplier. S103-3, based on the user's actual payment amount, the current quotation of each candidate supplier, the estimated failure cost, and the estimated customer complaint cost, obtain the comprehensive expected profit of each candidate supplier.

[0049] In other words, traditional systems completely disregard the actual economic losses incurred by order failures when selecting suppliers. Their decision-making logic is based solely on static configuration or simple polling, treating supplier quotes as the only cost variable and mechanically selecting the lowest bidder. Even if a supplier has a 30% failure rate and a 25% timeout rate within an hour, it will still continue to assign orders because its price is 0.5 yuan lower. This practice leads to situations where the platform shows a profit on paper, but in reality, users frequently find themselves without cards after payment, forcing additional expenses on reissuing coupons, providing customer service, and handling complaints, ultimately resulting in a "earn 1 yuan, lose 3 yuan" inverted situation. More seriously, due to the lack of quantitative utilization of statistical data on the distribution of error types such as failure rates and timeout rates, it fails to identify the superior characteristics of some suppliers who, despite slightly higher prices, have near-100% success rates and near-zero timeout rates, missing the opportunity to sacrifice a small profit margin for extremely high fulfillment certainty and user satisfaction.

[0050] To address this, this embodiment of the invention first calculates the estimated failure cost for each candidate supplier based on a preset average compensation amount per failure and the actual card issuance success rate of each candidate supplier within the most recent fifth time period. The preset average compensation amount per failure is derived from historical data statistics and includes actual expenditures such as the value of reissued coupons and customer service labor costs. The actual card issuance success rate within the most recent fifth time period refers to the proportion of orders successfully placed and issued by the supplier within the past hour out of its total number of calls. Multiplying these two figures yields the expected economic loss for the candidate supplier due to failure. Secondly, based on the error type distribution statistics for each candidate supplier, the order timeout rate for each candidate supplier within the most recent fourth time period is obtained. Based on the preset average cost of pacifying a single timeout and the order timeout rate of each candidate supplier in the most recent fourth hour, the estimated customer complaint cost for each candidate supplier is obtained. Among them, the error type distribution statistics cover the statistical results of timeout errors, business errors (such as card failure), system errors, etc. From these, the percentage of orders judged as failed due to response timeout in the most recent hour of that supplier can be directly extracted, i.e., the order timeout rate. Multiplying this by the preset average cost of pacifying a single timeout (also derived from the statistical average of historical customer service work orders and compensation records) can quantify its potential customer complaint burden. Finally, based on the user's actual payment amount, the current quotation of each candidate supplier, the estimated failure cost, and the estimated customer complaint cost, the comprehensive expected profit of each candidate supplier is obtained.

[0051] The formula for calculating the overall expected profit is: Overall Expected Profit = Actual Amount Paid by User - Current Quote - Estimated Failure Cost - Estimated Customer Complaint Cost, where, Estimated Failure Cost = Order Failure Rate of the Candidate Supplier in the Last Five Hours. Average compensation per failure, estimated customer complaint cost = order timeout rate of the candidate supplier in the most recent fourth time period Average cost of appeasing someone if the timeout occurs.

[0052] All cost coefficients are derived from dynamic statistical results of local historical data, rather than being set by human experience. The calculation results are updated in real time, with a caching time of no more than 5 seconds, ensuring that the profit value used for each order reflects the supplier's current and most accurate operating status.

[0053] Thus, this embodiment of the invention obtains the comprehensive expected profit of each candidate supplier for virtual coupon orders based on the actual amount paid by the user for the virtual coupon order and the real-time operating data of each candidate supplier. This achieves a breakthrough from the short-sighted logic of "price-only" in traditional methods, simultaneously weighing the seemingly contradictory yet unified factors of "how much money can be saved now" and "how much money might be lost later" in each order decision. For example, when supplier A quotes 92.5 yuan with a failure rate of only 1% and a timeout rate of 0.5% in the past hour, while supplier B quotes 91.0 yuan with a failure rate of 10% and a timeout rate of 20% in the past hour, even if B's ​​gross profit is 1 yuan higher... The expected profit of a bid of 5 yuan may actually be lower than that of bid A due to the added costs of failure compensation and customer complaint settlement. This difference can only be accurately revealed by incorporating the actual card issuance success rate, error type distribution statistics, average compensation amount per failure (and customer relationship management costs), and average settlement cost per timeout into a unified mathematical framework. The resulting expected profit is no longer an abstract financial concept, but an engineered decision-making indicator that can directly drive routing actions, can be compared horizontally, can be backtracked and verified, and can be audited and held accountable. This fundamentally breaks the vicious cycle of "winning bids at low prices, high compensation after handling, reputation collapse, and traffic loss".

[0054] S104. Based on the comprehensive expected profit and real-time operating data of each candidate supplier, the target supplier is determined.

[0055] In possible implementations, please refer to Figure 5 Step S104 may include sub-steps S104-1 to S104-3.

[0056] S104-1 Sort all candidate suppliers in descending order according to their comprehensive expected profit to obtain the initial supplier sequence.

[0057] S104-2, for every two adjacent candidate suppliers in the initial supplier sequence, if the difference in the comprehensive expected profit of the two adjacent candidate suppliers is less than the fifth preset threshold, then the order of the two adjacent candidate suppliers is adjusted according to the actual card issuance success rate in the most recent first time period, the response time of the most recent N requests, and the current number of concurrent requests, to obtain the target supplier sequence.

[0058] S104-3, the first candidate supplier in the target supplier sequence is selected as the target supplier.

[0059] In other words, traditional systems completely lack a holistic consideration of the stability of the order execution process and the overall capacity of the system when selecting suppliers. Either a single default supplier is manually designated, and if the supplier's interface is slow to respond or occasionally fails, all orders are forced to wait or even fail; or a simple polling strategy is used, which mechanically allocates traffic without assessing the actual service capabilities of each supplier. This results in high-quality suppliers with fast response times and high success rates having their resources diluted, while low-quality suppliers with slow response times and many errors continue to receive calls, further exacerbating system instability and user complaints.

[0060] To address this, this embodiment of the invention first sorts all candidate suppliers in descending order of their comprehensive expected profit to obtain an initial supplier sequence. Second, for every two adjacent candidate suppliers in the initial supplier sequence, if the difference in their comprehensive expected profit is less than a fifth preset threshold (e.g., 0.5 yuan), the order of the two adjacent candidate suppliers is adjusted based on their actual card issuance success rate within the most recent first time period, the response time of the most recent N requests, and the current number of concurrent requests, to obtain a target supplier sequence. Specifically, when comprehensive expected profits are similar, the actual card issuance success rate within the most recent first time period (i.e., inventory confidence) is compared, with the supplier having a higher success rate ranking higher. If the success rates are also similar, the response time of the most recent N requests (especially P95 latency) is further compared, with the supplier having a lower latency ranking higher. If the response latency is still similar, the current number of concurrent requests is finally compared, with the supplier having fewer concurrent requests ranking higher. Finally, the first candidate supplier in the target supplier sequence is selected as the target supplier.

[0061] Thus, this embodiment of the invention determines the target supplier based on the comprehensive expected profit of each candidate supplier and real-time operating data, achieving the simultaneous embedding of rigid constraints on performance reliability, service timeliness, and system stability while ensuring economic efficiency. For example, if supplier A's comprehensive expected profit is 2.47 yuan, supplier B's is 2.10 yuan, and supplier C's is 2.00 yuan, although the profit difference between A and B is 0.37 yuan (less than the 0.5 yuan threshold), the system will not directly determine that A is better than B. Instead, it will initiate a secondary comparison: it will find that A's actual card issuance success rate in the past 5 minutes is 99%, while B's is only 70%. Based on this, it will be confirmed that A has an overwhelming advantage in inventory confidence, thus maintaining A's ranking. If the profit difference between A and another supplier D is also less than 0.5 yuan and the success rates are comparable, then the P95 latency will be compared. A's latency is 800 milliseconds, and D's is 500 milliseconds, so D wins. If the latency is still close, then the current concurrency will be compared to select the supplier with the lighter load to prevent local overheating. This mechanism is not a denial of profit, but a "weighted calibration" of profit, ensuring that the recipient of each order is not only the most profitable choice at the moment, but also the most reliable, fastest, and most sustainable service provider at this moment. It fundamentally eliminates structural contradictions such as "high profit, low fulfillment", "low delay, high failure", and "low price, high complaint" caused by a single sorting logic.

[0062] S105 calls the target supplier's API to process the virtual coupon order.

[0063] Further, please refer to Figure 6 The virtual coupon order processing method provided in this embodiment of the invention further includes step S106.

[0064] S106, If calling the target supplier's API fails, the steps to determine the target supplier based on the comprehensive expected profit and real-time operating data of each candidate supplier are re-executed for the remaining candidate suppliers, and the number of retries is accumulated.

[0065] S107: If the number of retries is not less than the preset number, add the virtual card order to the manual processing queue and generate an alarm message.

[0066] In this embodiment of the invention, the API of the target supplier is called to process the virtual coupon order. Further, if the call to the target supplier's API fails, the steps of determining the target supplier based on the comprehensive expected profit and real-time operating data of each candidate supplier are re-executed for the remaining candidate suppliers, and the number of retries is accumulated. If the number of retries is not less than the preset number (e.g., 2 times), the virtual coupon order is added to the manual processing queue and an alarm message is generated.

[0067] In this embodiment of the invention, after each failed call, the system does not simply jump to the next supplier. Instead, it removes the failed target supplier from the current candidate supplier set. Based on its latest real-time operating data (including the error type distribution statistics for this failure, and the updated success rate and latency statistics), the remaining candidate suppliers are reordered in descending order of comprehensive expected profit. When profits are similar, the actual card issuance success rate, P95 response latency, and current concurrency are compared sequentially to ensure that the retry target is always the best alternative in the current state. If all retries are completed and the system is still unsuccessful, it will not blindly loop but will transfer the virtual card order to the manual processing queue, triggering an alarm message to notify the operations and maintenance personnel to intervene and analyze the data. The alarm includes: the user's actual payment amount, the original price and comprehensive expected profit of each candidate supplier, the error type distribution of the failed supplier (e.g., timeout error in this case, with an error rate of 22% in the last minute), its historical success rate curve before being circuit-broken, and the precise timestamp and response details of this call, so that manual handling is based on evidence.

[0068] To perform the corresponding steps in the above embodiments and various possible methods, an implementation of a virtual coupon order processing device 200 is given below. Further, please refer to... Figure 7 , Figure 7 This is a functional block diagram of a virtual coupon order processing device 200 provided in an embodiment of the present invention. It should be noted that the basic principle and technical effects of the virtual coupon order processing device 200 provided in this embodiment are the same as those in the above embodiments. For the sake of brevity, any parts not mentioned in this embodiment can be referred to the corresponding content in the above embodiments. The virtual coupon order processing device 200 includes: The data acquisition module 201 is used to collect real-time operating data from each coupon supplier in parallel when a user submits a virtual coupon order.

[0069] The processing module 202 is used to determine at least one candidate supplier from all coupon suppliers based on the real-time operating data of each coupon supplier; to obtain the comprehensive expected profit of each candidate supplier for the virtual coupon order based on the actual amount paid by the user corresponding to the virtual coupon order and the real-time operating data of each candidate supplier; to determine the target supplier based on the comprehensive expected profit of each candidate supplier and the real-time operating data; and to call the API of the target supplier to process the virtual coupon order.

[0070] Optionally, the above modules can be stored in the form of software or firmware. Figure 1 The memory 110 shown is either stored in or embedded in the operating system (OS) of the electronic device 100, and can be used by... Figure 1The processor 120 executes the program. Meanwhile, the data and program code required to execute the above modules can be stored in the memory 110.

[0071] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative; for example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0072] In addition, the functional modules in the various embodiments of the present invention can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.

[0073] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0074] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for processing virtual coupon orders, characterized in that, The method includes: When a user submits a virtual coupon order, real-time operational data from each coupon provider is collected in parallel. Based on the real-time operational data of each coupon supplier, at least one candidate supplier is identified from all coupon suppliers. Based on the actual amount paid by the user for the virtual coupon order and the real-time operating data of each candidate supplier, the comprehensive expected profit of each candidate supplier for the virtual coupon order is obtained; The target supplier is determined based on the comprehensive expected profit and real-time operating data of each candidate supplier. The API of the target supplier is invoked to place the virtual coupon order.

2. The virtual coupon order processing method as described in claim 1, characterized in that, The real-time operational data includes the current price, the actual card issuance success rate within the most recent first time period, the response time of the most recent N requests, error type distribution statistics, and the current number of concurrent requests. The step of determining at least one candidate supplier from all card suppliers based on the real-time operational data of each card supplier includes: For each of the card and coupon suppliers, based on the supplier's actual card issuance success rate in the most recent first time period, the response time of the most recent N requests, and the error type distribution statistics, it is determined whether the card and coupon supplier meets the preset circuit breaker conditions. If so, mark the coupon supplier as unavailable; If not, then the aforementioned coupon supplier will be designated as a supplier to be determined. Based on the current quote and current concurrent request count of each of the prospective suppliers, at least one of the candidate suppliers is determined from all the prospective suppliers.

3. The virtual coupon order processing method as described in claim 2, characterized in that, The step of determining whether the card supplier meets the preset circuit breaker conditions based on the card supplier's actual card issuance success rate in the most recent first time period, the response delay of the most recent N requests, and the error type distribution statistics includes: If, based on the error type distribution statistics, the number of consecutively failed orders is greater than a first preset threshold, and / or based on the error type distribution statistics, the order processing error rate within the most recent second time period is greater than a second preset threshold, and / or the actual card issuance success rate within the most recent first time period is less than a third preset threshold, and / or the number of times the response time of the most recent N requests exceeds the third time period is greater than a fourth preset threshold, then the card supplier is determined to meet the preset circuit breaker conditions.

4. The virtual coupon order processing method as described in claim 2, characterized in that, The step of determining at least one candidate supplier from all the candidate suppliers based on the current quote and current concurrent request count of each candidate supplier includes: For each of the pending suppliers, if the current quotation of the pending supplier is not less than the amount actually paid by the user and the current concurrent request count of the pending supplier does not exceed a preset number of times the historical average concurrent request count of the pending supplier, then the pending supplier is determined as the candidate supplier.

5. The virtual coupon order processing method as described in claim 1, characterized in that, The real-time operational data includes the current price, the actual card issuance success rate within the most recent fourth time period, and error type distribution statistics. The step of obtaining the comprehensive expected profit of each candidate supplier for the virtual card order based on the user's actual payment amount corresponding to the virtual card order and the real-time operational data of each candidate supplier includes: Based on the preset average compensation amount for a single failure and the actual card issuance success rate of each candidate supplier within the most recent fifth time period, the estimated failure cost of each candidate supplier is obtained. Based on the error type distribution statistics of each candidate supplier, the order timeout rate of each candidate supplier in the most recent fourth time period is obtained, and the estimated customer complaint cost of each candidate supplier is obtained based on the preset average reassurance cost per timeout and the order timeout rate of each candidate supplier in the most recent fourth time period. Based on the user's actual payment amount, the current quote of each candidate supplier, the estimated failure cost, and the estimated customer complaint cost, the comprehensive expected profit of each candidate supplier is obtained.

6. The virtual coupon order processing method as described in claim 1, characterized in that, The real-time operational data includes the actual card issuance success rate within the most recent first time period, the response time of the most recent N requests, and the current number of concurrent requests. The step of determining the target supplier based on the comprehensive expected profit of each candidate supplier and the real-time operational data includes: Sort all candidate suppliers in descending order of their overall expected profit to obtain an initial supplier sequence. For each pair of adjacent candidate suppliers in the initial supplier sequence, if the difference in the comprehensive expected profit of the two adjacent candidate suppliers is less than the fifth preset threshold, the order of the two adjacent candidate suppliers is adjusted according to the actual card issuance success rate in the most recent first time period, the response time of the most recent N requests, and the current number of concurrent requests, to obtain the target supplier sequence. The first candidate supplier in the target supplier sequence is selected as the target supplier.

7. The virtual coupon order processing method as described in claim 1, characterized in that, The method further includes: If the API call to the target supplier fails, the step of determining the target supplier based on the comprehensive expected profit and real-time operating data of each candidate supplier is re-executed for the remaining candidate suppliers, and the number of retries is accumulated. If the number of retries is not less than a preset number, the virtual coupon order will be added to the manual processing queue and an alarm message will be generated.

8. A virtual coupon order processing device, characterized in that, The device includes: The data acquisition module is used to collect real-time operational data from various voucher suppliers in parallel when a user submits a virtual voucher order. The processing module is used to determine at least one candidate supplier from all coupon suppliers based on the real-time operating data of each coupon supplier; to obtain the comprehensive expected profit of each candidate supplier for the virtual coupon order based on the user's actual payment amount corresponding to the virtual coupon order and the real-time operating data of each candidate supplier; to determine the target supplier based on the comprehensive expected profit of each candidate supplier and the real-time operating data; and to call the API of the target supplier to place the virtual coupon order.

9. An electronic device, characterized in that, The device includes a processor and a memory, the memory storing machine-executable instructions that can be executed by the processor to implement the virtual coupon order processing method according to any one of claims 1-7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the virtual card order processing method as described in any one of claims 1-7.