An API data interaction processing method of a cake electronic coupon API docking system
By dynamically evaluating key performance parameters of e-coupons and user behavior data, adjusting the monitoring frequency, and optimizing the master-slave database resource configuration, the lock contention problem of e-coupon status update requests in high-concurrency scenarios was solved, improving processing efficiency and system stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING LIFE MODEL NETWORK TECHNOLOGY CO LTD
- Filing Date
- 2025-11-07
- Publication Date
- 2026-05-29
AI Technical Summary
In high-concurrency scenarios, lock contention for electronic coupon status update requests is too intense, causing database connections and resources to be occupied for a long time, resulting in low processing efficiency.
By dynamically evaluating the key performance parameters of electronic coupons and user behavior data, the monitoring frequency is dynamically adjusted, and the automatic release time and connection timeout time are optimized based on the concurrent competition intensity of the main database. Combined with the dynamic update verification of the master and slave databases, the resource allocation and anomaly handling mechanisms are optimized.
It improved the processing efficiency of electronic coupon status update requests, reduced lock contention and deadlock risks, ensured data consistency and system stability, and optimized resource utilization and query load.
Smart Images

Figure CN121560897B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of API data interaction processing technology, and in particular to an API data interaction processing method for a cake e-coupon API docking system. Background Technology
[0002] The core of the cake e-coupon API data interaction is that merchants can achieve end-to-end digital management of e-coupons, from creation and distribution to redemption, by calling the application programming interfaces provided by large platforms (such as WeChat Pay). This solution allows merchants to seamlessly integrate e-coupon functionality into their own mini-programs, apps, or websites, aiming to build an efficient and automated e-coupon operation loop, thereby improving marketing efficiency and user experience.
[0003] The implementation follows a clear process: First, merchants create coupon batches by calling the coupon creation interface and configuring information such as face value and rules on the platform. Next, they use the coupon distribution interface to bind the coupon to the user's identity and distribute it to their wallet. Finally, in the redemption phase, the redemption interface verifies the coupon code's validity in real time and completes the deduction, while updating the status to "used" to prevent reuse. Furthermore, auxiliary functions such as status query, message notification, and redemption data download are also implemented through the API, collectively ensuring the security and efficiency of the entire interaction process.
[0004] For example, the invention patent announcement CN114595281B discloses a data display method, device, electronic device, and storage medium, which includes: a terminal sending a first request message carrying query configuration information and operation configuration information to a processing server; the processing server obtaining API data from an API data source based on the first request message; processing the API data based on the API fields and operation configuration information in the query configuration information; and returning the API data processing result to the terminal for display.
[0005] For example, the invention patent with publication number CN114510222A discloses a data processing method and apparatus for a custom API, which includes: obtaining custom API information; if the custom API information meets preset verification conditions, obtaining the initial SQL statement corresponding to the custom API information through the custom API interface; replacing the label of the initial SQL statement with preset input parameters to obtain a dynamic SQL statement; and interacting the dynamic SQL statement with the database.
[0006] However, in the process of implementing the inventive technical solution in the embodiments of this application, it was found that the above-mentioned technology has at least the following technical problems:
[0007] In existing technologies, under high-concurrency scenarios, the lock contention for the target data row accessed by the electronic voucher status update request is too intense, resulting in the database connection and resources being occupied for a long time, leading to low processing efficiency of the electronic voucher status update request. Summary of the Invention
[0008] This application provides an API data interaction processing method for a cake e-coupon API integration system. This method addresses the problem in existing technologies where, in high-concurrency scenarios, intense lock contention for the target data row accessed by the e-coupon status update request leads to prolonged database connection and resource occupation, resulting in low processing efficiency for the e-coupon status update request. By employing pessimistic locking to ensure data consistency at the API level, this method effectively alleviates lock contention pressure at the database level, thereby significantly improving the overall processing efficiency of e-coupon status update requests in high-concurrency business scenarios.
[0009] This application provides an API data interaction processing method for a cake e-coupon API integration system, comprising the following steps: dynamically evaluating and determining the initial monitoring frequency of various e-coupons based on the key performance parameters of various e-coupons in the cake e-coupon API integration system, wherein the initial monitoring frequency is the initial frequency value for monitoring the status of e-coupons determined by the dynamic evaluation of the key performance parameters of various e-coupons; dynamically adjusting the initial monitoring frequency based on user behavior data of various e-coupons to obtain the monitoring frequency of various e-coupons; receiving e-coupon status update requests and dynamically optimizing the configuration based on the concurrent competition intensity of the main database corresponding to the e-coupon status update request; after completing the dynamic configuration optimization, executing the e-coupon status update and dynamically updating and verifying the e-coupon status in the main database and the slave database after the e-coupon status update.
[0010] One or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages:
[0011] 1. By dynamically evaluating the key performance parameters of electronic coupons to determine the initial monitoring frequency, and dynamically adjusting the frequency based on user behavior data, the system optimizes the automatic release time and connection timeout configuration based on the concurrent contention intensity of the master database when receiving status update requests. After the status update, the system verifies the consistency of master and slave database data, thereby improving the system's concurrent access processing efficiency, effectively distributing query load, optimizing read performance, and reliably maintaining the data authority status.
[0012] 2. Based on the criticality quantification index obtained from the multi-dimensional key parameter evaluation, differentiated initial monitoring frequencies are intelligently matched for e-coupons of different criticality levels. Then, combined with user behavior data reflecting real-time popularity, the initial frequency is dynamically corrected a second time. This enables the accurate and adaptive allocation of monitoring resources according to the actual criticality and usage popularity of e-coupons, effectively improving monitoring efficiency and resource utilization.
[0013] 3. By evaluating the intensity of concurrent competition in the main database in real time and generating a quantitative index, the automatic release time and connection timeout time of the target data row are dynamically adjusted when competition pressure is detected. This effectively reduces lock contention, lowers the risk of deadlock, and improves the efficiency of database transaction processing in high-concurrency scenarios, and ultimately ensures the stability of the electronic voucher status update process and the overall system performance.
[0014] 4. By implementing multi-level verification and exception handling mechanisms during the master-slave database update process, including dynamic adjustment of the connection pool, retry strategies, and priority-based resource allocation, it is ensured that the master database can recover quickly when an update is abnormal and that high-priority slave databases can be repaired first when they fail. This achieves a comprehensive improvement in strong master-slave data consistency, high system availability, and query service reliability. Attached Figure Description
[0015] Figure 1 A flowchart illustrating an API data interaction processing method for a cake e-coupon API integration system provided in this application embodiment;
[0016] Figure 2 An electronic coupon list interface diagram of the cake electronic coupon API integration system provided in this application embodiment;
[0017] Figure 3 A flowchart illustrating the dynamic configuration optimization of the cake e-coupon API integration system provided in this application embodiment.
[0018] Figure 4 A flowchart illustrating the electronic coupon status update verification process of the cake electronic coupon API integration system provided in this application embodiment. Detailed Implementation
[0019] This application provides an API data interaction processing method for a cake e-coupon API integration system. This method addresses the problem in existing technologies where, in high-concurrency scenarios, intense lock contention for the target data row accessed by the e-coupon status update request leads to prolonged database connection and resource occupation, resulting in low processing efficiency for e-coupon status update requests. The overall approach is as follows:
[0020] First, the initial monitoring frequency is determined by dynamically evaluating the key performance parameters of various electronic coupons. Then, this initial frequency is dynamically adjusted based on user behavior data to obtain the final monitoring frequency. Upon receiving an electronic coupon status update request, the system dynamically optimizes its configuration based on the concurrency competition intensity of the main database, including dynamic adjustment of automatic release time and connection timeout time, to improve concurrent access processing efficiency. After optimization, the system executes the electronic coupon status update and dynamically verifies the updated electronic coupon status in both the main and slave databases to ensure data consistency.
[0021] To better understand the above technical solutions, the following will provide a detailed explanation of the technical solutions in conjunction with the accompanying drawings and specific implementation methods.
[0022] like Figure 1 The diagram shows a flowchart of an API data interaction processing method for a cake e-coupon API integration system provided in this application embodiment. The method includes the following steps: dynamically evaluating and determining the initial monitoring frequency for each type of e-coupon based on key performance parameters of various e-coupons in the cake e-coupon API integration system. The initial monitoring frequency is the initial frequency value for monitoring the e-coupon status determined based on the dynamic evaluation of the key performance parameters of various e-coupons; dynamically adjusting the initial monitoring frequency based on user behavior data of various e-coupons to obtain the monitoring frequency for each type of e-coupon; receiving e-coupon status update requests and dynamically configuring the monitoring frequency based on the concurrent contention intensity of the main database corresponding to the e-coupon status update request. The optimization involves a master database, which is the core database for receiving and executing e-voucher status update requests. Its key feature is handling data changes and maintaining data authority. Dynamic configuration optimization refers to dynamically adjusting the master database's automatic release time and connection timeout to improve concurrent access processing efficiency. After dynamic configuration optimization, e-voucher status updates are executed, and dynamic update verification is performed based on the updated e-voucher status in both the master and slave databases. The slave database is an auxiliary database that provides read-only query services by replicating data from the master database. Its key feature is sharing the query load and improving system read performance. The master database is a single node, while the slave database supports multiple deployments.
[0023] like Figure 2The diagram shown is an electronic coupon list interface of the cake electronic coupon API integration system provided in this application embodiment. Based on the cake electronic coupon API integration, the system determines the initial monitoring frequency by dynamically evaluating key performance parameters of various electronic coupons and adjusts the monitoring frequency based on user behavior data. When receiving an electronic coupon status update request, it dynamically optimizes the configuration based on the concurrency competition intensity of the main database. After completion, it executes the electronic coupon status update and dynamically verifies the electronic coupon status in the main and slave databases. This interface displays information such as the electronic coupon's name, manufacturer, specifications, manufacturer's suggested retail price, and recommended selling price. It also provides editing and uploading functions, making it an important functional module interface for achieving efficient management and dynamic optimization of the entire electronic coupon lifecycle.
[0024] In this embodiment, the cake e-coupon API integration system is a comprehensive business system centered on cake e-coupon API integration, achieving efficient management and real-time reliable synchronization of the entire e-coupon lifecycle. This invention dynamically evaluates the key performance parameters of various e-coupons, setting a scientifically reasonable initial state monitoring frequency for each type of e-coupon, thus establishing a differentiated resource allocation foundation from the very beginning of system operation. Furthermore, user behavior data is introduced to continuously and dynamically adjust the initial frequency, ensuring that the monitoring frequency accurately adapts to fluctuations in actual business activities. This effectively avoids resource waste or state update delays that may occur under a fixed-frequency strategy, significantly improving system resource utilization and the real-time nature of state awareness. In the core data writing stage, when a state update request is received, the system intelligently senses the concurrency competition intensity of the main database and dynamically optimizes key parameters such as the automatic release time and connection timeout time of the database connection accordingly. This mechanism greatly enhances the request processing capacity and throughput of the main database in high-concurrency scenarios, effectively mitigating competition bottlenecks and ensuring the efficiency of write operations and system stability. After the state update is executed, the system also initiates a dynamic state update verification process between the master database and multiple slave databases. This process ensures eventual data consistency, which not only guarantees the accuracy and reliability of the read-only query service provided by the slave databases, but also effectively distributes the query load of the master database through the read-write separation architecture, thereby improving the overall system read performance, data processing capacity and service reliability.
[0025] Furthermore, the steps for dynamically evaluating and determining the initial monitoring frequency of various electronic coupons based on the cake electronic coupon API integration system include: key performance parameters including status change frequency, sales ratio, and remaining validity time; obtaining key performance parameter reference data and key performance parameter weighting coefficients from the preset cake electronic coupon database; key performance parameter reference data including reference values for status change frequency, sales ratio, and remaining validity time; key performance parameter weighting coefficients including weighting coefficients for status change frequency, sales ratio, and remaining validity time; and comparing the status change frequency and sales ratio of various electronic coupons with their corresponding status change frequency reference values and sales ratios. The reference values are compared to obtain quantitative parameters for the frequency of status changes and the sales ratio of various electronic coupons. The remaining validity time reference value is compared with the remaining validity time of various electronic coupons to obtain quantitative parameters for the remaining validity time of various electronic coupons. The quantitative parameters for the frequency of status changes, the sales ratio, and the remaining validity time of various electronic coupons are weighted using the weighting coefficient of key performance parameters. The weighting results are then coupled (summed) to obtain the key quantitative index of various electronic coupons. The key quantitative index is a comprehensive quantitative indicator to measure the keyness of electronic coupon monitoring. The initial monitoring frequency of various electronic coupons is dynamically determined based on the key quantitative index of various electronic coupons.
[0026] Specifically, the key quantitative indices for various electronic coupons are obtained as follows:
[0027] ;
[0028] In the formula, This represents the key quantitative index for the i-th type of electronic coupon. , and These represent the weighting coefficients for the frequency of state changes, the sales ratio, and the remaining effective time, respectively. , and These represent the frequency of state changes, sales ratio, and remaining validity period of the i-th type of electronic coupon, respectively. , and These represent the reference values for change frequency, sales ratio, and remaining validity period, respectively, where i is the electronic coupon number, i=1,2,3,...,N, and N is the total number of electronic coupon types.
[0029] Specifically, the steps for dynamically determining the initial monitoring frequency of various electronic coupons based on their key quantitative indices include: obtaining key quantitative thresholds from a preset cake coupon database; if the key quantitative index of any type of electronic coupon is lower than the key quantitative threshold, then the preset basic monitoring frequency of that type of electronic coupon is directly marked as its initial monitoring frequency; the basic monitoring frequency refers to a default, benchmark state monitoring frequency value preset by the system for various types of electronic coupons. If the key quantitative index of any type of electronic coupon is not lower than the key quantitative threshold, then the difference between the corresponding key quantitative index and the key quantitative threshold is marked as a key quantitative deviation value; the key quantitative deviation value is matched with a preset monitoring frequency first adjustment value mapping table; and based on the obtained monitoring frequency first adjustment value, the basic monitoring frequency corresponding to that type of electronic coupon is summed to obtain the initial monitoring frequency corresponding to that type of electronic coupon; the monitoring frequency first adjustment value mapping table defines the correspondence between each key quantitative deviation range and the monitoring frequency adjustment value.
[0030] In this embodiment, the cake e-coupon database is the core data storage carrier preset in the cake e-coupon API interface system. It stores various parameters (such as priority quantification thresholds and concurrency competition intensity thresholds), business rules, basic e-coupon information, and status data supporting key processes such as e-coupon status updates, monitoring frequency determination, legality verification, and dynamic configuration optimization. This provides data support for various core system operations. The monitoring frequency first adjustment value mapping table, as a discrete mapping function, can map continuous or interval-based inputs to specific outputs. It achieves deterministic transformation from input to output through interval division and value binding, providing an efficient and clear decision-making basis for the dynamic adjustment of the initial monitoring frequency. Subsequent mapping tables follow the same principle. The status change frequency can be obtained by analyzing the historical status change logs of e-coupons and counting the number of status changes per unit time. The sales ratio is calculated based on the ratio of the sales quantity of various e-coupons in the sales database to the total issuance quantity. The remaining valid time is determined based on the difference between the e-coupon's validity period timestamp and the current system time. This invention evaluates three key performance parameters—frequency of status changes, sales ratio, and remaining effective time—to generate a comprehensive quantitative index that measures the criticality of e-coupon monitoring. This index objectively reflects the real-time business value and risk level of different e-coupons, avoiding the bias of single-parameter evaluation. Based on this index, a base frequency is used for e-coupons with lower criticality to save resources, while for e-coupons with higher criticality, the monitoring frequency is adjusted upwards by querying a first adjustment value mapping table. This ensures a positive correlation between monitoring intensity and e-coupon importance, thereby optimizing the initial allocation of computing and query resources at the system level. Furthermore, this invention dynamically correlates this initial monitoring frequency with subsequent user behavior data, enabling continuous self-optimization of the monitoring strategy. Based on a dynamic matching mechanism of indices and thresholds, the initial monitoring frequency can be configured differently according to the actual criticality of the e-vouchers. This ensures high-frequency monitoring of e-vouchers with high criticality (such as those with frequent status changes, high sales volume, and short remaining validity period) to ensure timely status monitoring, while maintaining a basic frequency for e-vouchers with low criticality to avoid ineffective consumption of system resources. Ultimately, this achieves refined and dynamic configuration of the initial monitoring frequency, optimizes the efficiency of system resource allocation, and enhances the scientific nature and adaptability of the cake e-voucher API interface system in the status monitoring stage.
[0031] Furthermore, the steps for dynamically adjusting the initial monitoring frequency based on user behavior data of various electronic coupons to obtain the monitoring frequency of each type of electronic coupon include: user behavior data including the proportion of browsing times and the proportion of operation times; obtaining the threshold values for the proportion of browsing times and the threshold values for operation times from a preset electronic coupon database; marking the ratio of the proportion of browsing times to the threshold values for the proportion of browsing times as the deviation of the proportion of browsing times; marking the ratio of the proportion of operation times to the threshold values for the proportion of operation times as the deviation of the proportion of operation times; for each type of electronic coupon, calculating its maximum deviation value, which is the maximum value between the deviation of the proportion of browsing times and the deviation of the proportion of operation times; if the maximum deviation value of any electronic coupon is greater than 1, then matching the maximum deviation value with a preset second adjustment value mapping table for monitoring frequency, and correcting the initial monitoring frequency of this type based on the obtained second adjustment value for monitoring frequency to obtain the monitoring frequency of each type of electronic coupon; the second adjustment value mapping table for monitoring frequency defines the correspondence between each maximum deviation range and the adjustment value for monitoring frequency.
[0032] In this embodiment, the browsing frequency ratio refers to the ratio of the number of times a certain type of e-coupon is viewed by users within a specific statistical period of the cake e-coupon API integration system, to the total number of views of all types of e-coupons in the system during the same period. Its core function is to quantify the degree of attention this type of e-coupon receives from users' browsing behavior. A higher ratio means that this type of e-coupon is more easily encountered and viewed by users during the browsing process, which can intuitively reflect its exposure attractiveness in the user's field of vision. The operation frequency ratio refers to the ratio of the total number of times a certain type of e-coupon is subject to effective user interaction operations (such as receiving, redeeming, querying coupon information, modifying user, etc., actions with actual functional orientation) within the same statistical period, to the total number of effective user operations for all e-coupons in the system. This ratio is mainly used to measure the activity of actual user interaction behavior triggered by this type of e-coupon. A higher ratio indicates that users have a stronger actual willingness to participate in this type of e-coupon and a stronger operation frequency, which can directly reflect its practical value and interaction popularity on the user side. Together, the two constitute key quantitative indicators for evaluating the user attention and interaction depth of e-coupons, providing data support for the system to dynamically adjust the monitoring frequency and optimize the operation strategy in the future. This invention significantly improves the responsiveness and resource utilization efficiency of system monitoring by adjusting the static initial monitoring frequency to a dynamic value closely related to the intensity of real-time user interaction. Based on the maximum deviation value reflecting the ratio of browsing frequency to operation frequency, it ensures that any abnormal or significantly active user behavior in any type of e-coupon triggers an adjustment to the monitoring strategy. This achieves sensitive detection of market trends and potential risks. When the deviation value exceeds the baseline, the invention queries a predefined second adjustment value mapping table for the monitoring frequency to obtain a precise frequency adjustment amount and corrects the initial monitoring frequency upwards. This ensures that for e-coupons with high user attention or frequent operations, the system can automatically and promptly increase the frequency of status monitoring, thereby detecting and responding to status changes more quickly and improving business security and user experience. For e-coupons with inactive user behavior, a lower monitoring frequency is maintained, effectively saving system computing and network resources. This dynamic monitoring system, capable of self-optimization based on actual user behavior patterns, achieves precise and intelligent monitoring strategies.
[0033] Furthermore, before dynamic configuration optimization, this invention performs legality verification based on the electronic voucher status update request. The electronic voucher status update request includes a request timestamp, a target identifier, and a target status. Legality verification includes request format verification, timeliness verification, business rule verification, and permission verification. Request format verification verifies the compliance of the basic data structure by parsing whether the request timestamp conforms to the standard format, whether the target identifier conforms to predefined encoding rules and length limits, and whether the target status belongs to the system status enumeration value set. Timeliness verification ensures the real-time nature and uniqueness of the request by calculating whether the difference between the request timestamp and the server's receiving time is within the configured tolerance time window and verifying whether the unique request identifier exists in the anti-replay cache. Business rule verification verifies the existence and validity period of the electronic voucher corresponding to the target identifier by querying the database and verifies whether the transition from the current state to the target state conforms to the preset business process rules based on the state transition matrix. Permission verification verifies the identity credentials and digital signature of the request source and queries the access control list to confirm whether the operating entity has the corresponding state change permission level for the target electronic voucher, thereby completing the operation authorization determination. When all legality verifications pass, the electronic voucher status update result is verified based on the concurrent competition intensity of the electronic voucher master database. When any legality verification fails, a request exception prompt is issued, and a request alarm mechanism is triggered. Specifically, the current status update transaction is terminated, the verification failure details are recorded in the security audit log, a response message containing the specific failure reason and error code is returned to the requester, and a decision is made on whether to temporarily lock the target electronic voucher to prevent repeated exception requests based on the exception type and business rules. At the same time, the system alarm mechanism is triggered to notify the operation and maintenance personnel to intervene manually.
[0034] like Figure 3 The diagram shows a dynamic configuration optimization flowchart for the cake e-coupon API integration system provided in this application embodiment. The steps for dynamic configuration optimization based on the concurrency competition intensity of the main database corresponding to the e-coupon status update request include: dynamically evaluating the concurrency competition intensity of the main database based on concurrency competition intensity parameters to obtain a concurrency competition intensity index. The concurrency competition intensity index is a comprehensive quantitative indicator of the real-time concurrency pressure level borne by the target data row corresponding to the e-coupon status update request in the e-coupon main database; obtaining a concurrency competition intensity threshold from a preset cake e-coupon database; if the concurrency competition intensity index exceeds the concurrency competition intensity threshold, the difference between the concurrency competition intensity index and the concurrency competition intensity threshold is marked as the concurrency competition pressure index, and dynamic configuration optimization is performed on the target data row based on the concurrency competition pressure index. The target data row represents the locked row in the main database corresponding to the e-coupon status request; if the concurrency competition intensity index does not exceed the concurrency competition intensity threshold, no additional processing is performed.
[0035] The concurrency contention intensity index is obtained as follows: Concurrency contention intensity parameters include deadlock frequency, lock waiting queue length, and average lock waiting time; reference data and weighting coefficients for concurrency contention intensity parameters are obtained from a pre-set cake e-coupon database; the reference data for concurrency contention intensity parameters includes: reference values for deadlock frequency, lock waiting queue length, and average lock waiting time; the weighting coefficients for concurrency contention intensity parameters include weighting coefficients for deadlock frequency, lock waiting queue length, and average lock waiting time; the concurrency contention intensity parameters are compared with their corresponding reference data, and then the comparison results are weighted using the weighting coefficients. Finally, the weighted results are coupled together, i.e., summed, to obtain the concurrency contention intensity index.
[0036] Specifically, the concurrency intensity index is obtained as follows:
[0037] ;
[0038] In the formula, This represents the index of concurrency competition intensity. , and These represent the deadlock frequency weighting factor, the lock wait queue length weighting factor, and the average lock wait time weighting factor, respectively. , and These represent the deadlock frequency, lock wait queue length, and average lock wait time, respectively. , and These represent the reference values for deadlock frequency, lock wait queue length, and average lock wait time, respectively.
[0039] In this embodiment, the lock wait sequence length is the number of transactions that enter a waiting state when updating the electronic voucher status because the target data row is occupied by a pessimistic lock requested by another client; the deadlock frequency is the number of times deadlock occurs in the electronic voucher status update requests per unit time due to client requests waiting for lock resources in a circular manner, reflecting the frequency of mutual blocking between transactions due to circular waiting for resources; the average lock wait time is the average time taken for a client request in the lock wait sequence from initiating a lock request to successfully acquiring the lock, reflecting the efficiency of the system in handling lock contention and the severity of the concurrency bottleneck. This invention establishes a comprehensive compliance verification system covering all aspects from basic data structure to operation authorization through four layers of legitimacy verification, encompassing request format, timeliness, business rules, and permissions. These four layers collaboratively construct a strict request access threshold, filtering out illegal and abnormal requests at the source. For scenarios where legitimacy verification fails, a closed-loop processing mechanism is implemented, involving transaction termination, recording security audit logs, returning a response with specific reasons and error codes, temporarily locking electronic vouchers, and triggering operational alarms. This achieves both immediate blocking and detailed tracing of abnormal requests, facilitating problem localization and review, reducing interference from repeated abnormal requests by temporarily locking electronic vouchers, and ensuring timely manual intervention through operational alarms, thus mitigating the risk of abnormal propagation. In the dynamic configuration optimization phase of the main database after successful verification, a comprehensive evaluation of concurrency is conducted by integrating deadlock frequency, lock wait queue length, and average lock wait time. The competition intensity index precisely quantifies the real-time concurrent pressure of the target data row. Based on a preset threshold, optimization is performed only on the target data row when the index exceeds the threshold. This avoids ineffective processing in low-concurrency scenarios to save system resources, while also specifically alleviating the competition pressure on the target data row in high-concurrency scenarios. It effectively reduces the probability of deadlocks, shortens lock waiting time, and improves the concurrency efficiency and stability of the main database in processing e-voucher status update requests. It prevents system performance bottlenecks caused by concurrency congestion and achieves end-to-end risk control and performance optimization from request admission to database processing. This ensures the security and compliance of e-voucher status update operations, improves the system's adaptability and stability in high-concurrency scenarios, and enhances the system's maintainability through a robust exception handling mechanism. It provides technical support for the reliable operation of the cake e-voucher API integration system.
[0040] Furthermore, the steps for dynamically configuring and optimizing the target data row based on the concurrency competition pressure index include: obtaining the first unit coefficient of concurrency competition pressure, the second unit coefficient of concurrency competition pressure, the deadlock frequency unit coefficient, the lock waiting time unit coefficient, and the automatic release time threshold from the preset cake e-coupon database; calculating the ratio of the concurrency competition pressure index to the first unit coefficient of concurrency competition pressure, and rounding it down to be marked as the release time adjustment coefficient; calculating the ratio of the deadlock frequency to the deadlock frequency unit coefficient, and rounding it down to be marked as the unit release time adjustment value; and adjusting the unit release time adjustment value and the release time adjustment coefficient. The product of the two values is used to dynamically reduce the automatic release time of the target data row. When the automatic release time reaches the preset automatic release time threshold, the ratio of the concurrency contention pressure index to the second unit coefficient of the concurrency contention pressure is calculated, rounded down, and marked as the timeout adjustment coefficient. The ratio of the average lock waiting time to the unit coefficient of the lock waiting time is calculated, rounded down, and marked as the unit timeout adjustment value. Based on the product of the timeout adjustment coefficient and the unit timeout adjustment value, the connection timeout time of the target data row is dynamically reduced. Dynamic configuration optimization is repeatedly executed until the concurrency contention intensity index does not exceed the concurrency contention intensity threshold.
[0041] In this embodiment, the automatic release time is the longest processing time for a single client request operation within the pessimistic lock; the connection timeout is the maximum time threshold for a client request to acquire a connection to the target data row in the lock waiting sequence within the target data row, used to control the maximum waiting time for a client request to acquire a connection to the target data row, preventing request threads from being blocked due to long-term connection waiting. This invention introduces preset parameters such as the first unit coefficient of concurrency competition pressure and the unit coefficient of deadlock frequency, transforming real-time pressure indicators such as the concurrency competition pressure index and deadlock frequency into calculable release time adjustment coefficients and unit release time adjustment values. This quantitatively correlates the reduction in automatic release time with the actual concurrency pressure intensity, ensuring that the adjustment range matches the pressure level and avoiding data consistency risks caused by over-adjustment or competition mitigation failure caused by insufficient adjustment. The dynamic reduction of the automatic release time can shorten the locking time of the target data row, reducing lock occupancy time from the source to lower the probability of contention. When the automatic release time has reached the threshold and cannot be further reduced, the connection timeout is reduced instead to accelerate the release of connection resources ineffectively occupied by long-term waiting, preventing connection pool exhaustion. The two-layer adjustment collaboratively covers various aspects. The optimization requirements of the same pressure stage improve the adaptability of the strategy; by using a ratio-rounding calculation method, it is ensured that the adjustment coefficient and adjustment value are integers and do not exceed the reasonable range corresponding to the actual pressure, avoiding system adaptation problems caused by decimal adjustments and enhancing the stability and executability of the adjustment; the repeated execution mechanism with the termination condition of the concurrency competition intensity index not exceeding the threshold forms a closed-loop feedback control, enabling the optimization process to continuously respond to real-time concurrency pressure changes until the pressure falls back to a reasonable range, effectively avoiding the risk of pressure rebound after a single adjustment, ensuring the continuous and efficient operation of the main database in high-concurrency scenarios, and ultimately significantly reducing the frequency of deadlocks, shortening lock waiting time, and improving connection resource utilization, providing a stable database support environment for the efficient processing of electronic coupon status update requests.
[0042] like Figure 4The diagram shows the electronic coupon status update verification flowchart of the cake electronic coupon API docking system provided in this application embodiment. The steps for dynamically updating and verifying the electronic coupon status in the main database and the slave database after the electronic coupon status is updated include: detecting whether the electronic coupon update request is successfully applied to the main database; if the electronic coupon update request is not successfully applied to the main database, it means that the electronic coupon update request has not been successfully applied to the main database, and determining whether the current available number of connections in the main database connection pool exceeds the number of requests to the main database. If so, a retry operation is performed on the electronic coupon update request; otherwise, the connection pool configuration is dynamically adjusted based on the characteristics of the main database architecture: when the system architecture supports dynamic adjustment of the connection pool, the theoretical upper limit of the connection pool capacity is calculated based on the maximum number of connections of the database server and the current system resource utilization rate, and then the connection pool size is gradually increased according to a preset step size until the current processing needs are met or the upper limit is reached; if the system architecture does not have dynamic expansion capabilities, an asynchronous processing mode is enabled. By assigning a globally unique identifier to each electronic coupon update request, the request data is persistently stored in the message queue, a request reception confirmation is synchronously returned to the client, and a dedicated status query interface is established so that the client can use the unique identifier to track the request processing status and the final execution result in real time. The system architecture is considered to have the ability to dynamically adjust the connection pool when the connection pool management component itself provides a dynamically configured application interface, the database driver supports hot creation and destruction of connection instances, the application service adopts a stateless design pattern to ensure that connection changes do not affect transaction consistency, there is an allocable margin between the maximum number of connections configured for the database server and the number of currently used connections, and the utilization rate of key resources such as the host server's CPU and memory is lower than the preset expansion threshold. Otherwise, the system architecture is considered not to have the ability to dynamically expand. When the number of retries for an electronic voucher update request reaches the preset threshold and still fails to be successfully applied to the main database, a main database update anomaly alarm is issued. Information includes the identification information of failed requests, analysis of the reasons for failure, timestamps of the failure, and suggested countermeasures. When an e-coupon update request is successfully applied to the master database, it is determined whether all e-coupon update requests have been successfully applied to the slave databases. If an e-coupon update request is not successfully applied to any slave database, it means that the master database update was successful, but there was a delay or failure in data synchronization to the slave database, resulting in inconsistency between master and slave data. The corresponding slave database is marked as an abnormal slave database, and the resource processing strategy is dynamically adjusted based on the priority parameters of the abnormal slave database. If the e-coupon status in the slave database is the target status, the e-coupon update status is marked as a successful update status.
[0043] The steps for dynamically adjusting resource processing strategies based on the priority parameters of the abnormal database include: priority parameters include the number of active connections, query frequency, and total number of connections; obtaining priority parameter reference data and priority parameter weighting coefficients from a preset e-coupon database; the priority parameter reference data includes reference values for the number of active connections, query frequency, and total number of connections; the priority parameter weighting coefficients include weighting coefficients for the number of active connections, query frequency, and total number of connections; comparing the priority parameters with their corresponding priority parameter reference data, then weighting the comparison results using the priority parameter weighting coefficients, and finally coupling the weighted results (i.e., summing) to obtain the priority quantification index of the abnormal database, which is a quantitative indicator for comprehensively evaluating the importance of the e-coupon database; and dynamically adjusting resource processing strategies based on the priority quantification index of the abnormal database.
[0044] Specifically, the exception is obtained from the database priority quantization index as follows:
[0045] ;
[0046] In the formula, This indicates the priority quantification index of the exception from the database. , and These are the weighting coefficients for active connections, query frequency, and total connections, respectively. , and These are active connections, query frequency, and total connections, respectively. , and These are the reference values for active connections, query frequency, and total connections, respectively.
[0047] In this embodiment, the number of active connections and the total number of connections are typically derived from the database's process list or connection statistics table. For example, this can be obtained by querying the information architecture, process list, or similar system tables, filtering and counting the connection status. The query frequency can be obtained by executing a global status display command and calculating the number of executions per unit time from the query-related statistical variables. When updating the electronic voucher status, this invention employs pessimistic locking to lock the target data row, thereby maintaining the accuracy of the electronic voucher status update request data. The lock waiting queue is managed and sorted according to the first-in, first-out principle. Regarding the application results of electronic coupon update requests in the main database, this invention first uses a retry mechanism to quickly resolve occasional failures caused by instantaneous network fluctuations and temporary resource shortages, reducing invalid exception judgments. When the available connections in the connection pool are insufficient, differentiated processing is applied based on system architecture characteristics. For architectures with dynamic adjustment capabilities, a reasonable upper limit is calculated based on the server's maximum number of connections and resource utilization, and the capacity is gradually expanded. This avoids resource waste caused by excessive expansion of the connection pool while ensuring that real-time processing requirements are met. For architectures without dynamic expansion capabilities, an asynchronous processing mode is constructed through globally unique identifiers, message queue persistence, and status query interfaces. This ensures that requests are not lost and synchronously feeds back the receiving status to the client, supporting real-time tracking and avoiding prolonged client blocking, significantly improving user experience and request processing reliability. Through retry threshold control and a detailed exception alarm mechanism, when the retry threshold is reached and failure still occurs, alarm information including request identifier, failure reason, timestamp, and countermeasures is output. This provides maintenance personnel with accurate location information, accelerates fault diagnosis and repair, and prevents the business impact from expanding due to prolonged fault retention. After the master database update is successful, the system accurately identifies abnormal slave databases with synchronization delays or failures by verifying the consistency of the slave database status. Based on priority parameters comprehensively evaluated by the number of active connections, query frequency, and total connections, the system dynamically adjusts resource strategies to prioritize the synchronization repair and resource supply of core slave databases with high activity and high query frequency. This reduces the impact of master-slave data inconsistency on high-frequency read-only services (such as user queries for e-coupon status) and avoids inefficient resource allocation that leads to waste. This ensures the overall service capability of the slave database cluster is stable, achieving end-to-end risk control and resource optimization from master database update to slave database synchronization. It not only strictly ensures the consistency of e-coupon status data between master and slave databases, but also improves the system's fault tolerance and resource utilization through differentiated fault handling and resource adaptation. At the same time, it enhances system maintainability and user experience through refined alarm and asynchronous processing mechanisms, providing key technical support for the stable operation and business continuity of the cake e-coupon API integration system.
[0048] Furthermore, the steps for dynamically adjusting resource processing strategies based on the priority quantification index of the abnormal slave database include: obtaining the priority quantification threshold from the preset e-coupon database; if the priority quantification index of the abnormal slave database exceeds the priority quantification threshold, then a deep diagnostic mechanism and a data synchronization mechanism are initiated. The deep diagnostic mechanism specifically checks the replication status, network connection, system resource utilization, and error logs of the slave database, and generates a detailed abnormal diagnostic report and issues an alarm notification based on the diagnostic results; the data synchronization mechanism specifically suspends the read service of the abnormal slave database, creates a data synchronization task based on the current state of the master database, performs full or incremental data synchronization, and resumes the read service after verifying data consistency; if the priority quantification index of the abnormal slave database does not exceed the priority quantification threshold, then the e-coupon is re-initiated after a preset retry interval. Update requests; if the number of re-initiated e-coupon update requests reaches the preset request threshold and the e-coupon update request still fails to be successfully applied to the slave database, the slave database will be marked as unavailable, and the slave database will be reassigned for the e-coupon update request. For slave databases in an unavailable state, the slave database will be removed from the load balancer pool, and an automatic repair process will be initiated to attempt to rebuild the slave database instance. If the automatic repair fails, it will be escalated to manual intervention, and the database administrator will be notified for handling. After the repair is completed, data synchronization will be performed again, and after verifying that the service is normal, it will be added back to the load balancer pool. The reassignment of slave databases is based on the reverse order of the priority quantification index of each idle slave database in the load balancer pool. After an idle slave database is selected, a connection channel to the target slave database will be established, and the e-coupon update request will be transmitted through the connection channel.
[0049] In this embodiment, the present invention relies on priority quantification thresholds to accurately define the importance of abnormal databases. For high-value databases with priority quantification indices exceeding the threshold, a deep diagnostic mechanism comprehensively covers all dimensions of checks, including replication status, network connectivity, system resource utilization, and error logs. This allows for rapid identification of the root cause of the fault and generation of a diagnostic report containing specific anomaly information, providing accurate data for maintenance and repair. Simultaneously, a data synchronization process is implemented to avoid inconsistencies during synchronization from misleading user queries. Furthermore, by selecting full or incremental synchronization as needed, resource consumption is reduced, data consistency is efficiently restored, and high-priority databases are ensured to quickly return to normal service status, guaranteeing the accuracy and continuity of core business data. For low-value databases with priority quantification indices not exceeding the threshold, update requests are initiated first at a preset retry interval, effectively filtering out occasional issues caused by momentary network fluctuations or temporary resource shortages. To prevent system resource waste caused by premature initiation of deep diagnostics and synchronization processes for anomalies caused by various factors, when retries fail after reaching a threshold, the affected node is marked as unavailable and removed from the load balancer pool. This allows for timely isolation of faulty nodes, preventing the fault from spreading to other business requests. Simultaneously, an automatic repair process is initiated to attempt to rebuild the instance. Manual intervention is only required if automatic repair fails, reducing the routine operational burden on maintenance personnel and ensuring the timeliness of faulty node repair, while minimizing the occupation of cluster resources by long-term unavailable nodes. When reallocating slave databases, priority is determined by the quantification index of idle nodes in the load balancer pool, prioritizing the allocation of update requests to slave databases with stronger service capabilities (such as a reasonable number of active connections and efficient query response). This avoids secondary anomalies caused by selecting low-quality nodes. At the same time, update requests are transmitted through a dedicated connection channel, ensuring the security and stability of data transmission and preventing data leakage or packet loss. This invention, while strictly ensuring the master-slave consistency of electronic coupon data, minimizes the impact of abnormal slave databases on the overall system service, optimizes the efficiency of cluster resource allocation, and improves the fault tolerance and operation and maintenance efficiency of the slave database cluster. It provides key technical support for the stable and efficient operation of read-only services (such as user querying coupon status, verification, etc.) of the cake electronic coupon API interface system.
[0050] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0051] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0052] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0053] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0054] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.
[0055] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. A method for API data interaction processing in a cake e-coupon API integration system, characterized in that, Includes the following steps: Based on the dynamic evaluation of key performance parameters of various electronic coupons in the cake electronic coupon API docking system, the initial monitoring frequency of various electronic coupons is determined. The initial monitoring frequency is the initial frequency value of monitoring the status of electronic coupons determined based on the dynamic evaluation of key performance parameters of various electronic coupons. The initial monitoring frequency is dynamically adjusted based on user behavior data of various electronic coupons to obtain the monitoring frequency of various electronic coupons. The system receives electronic voucher status update requests and performs dynamic configuration optimization based on the concurrent contention intensity of the main database corresponding to the electronic voucher status update request. The main database is the core database that receives and executes electronic voucher status update requests. The dynamic configuration optimization means dynamically adjusting the automatic release time and connection timeout time of the main database to improve the efficiency of concurrent access processing. After completing the dynamic configuration optimization, the electronic voucher status is updated, and dynamic update verification is performed based on the electronic voucher status in the main database and the slave database after the electronic voucher status update. The slave database is an auxiliary database that provides read-only query service by copying data from the main database.
2. The API data interaction processing method of the cake e-coupon API docking system as described in claim 1, characterized in that, The steps for dynamically evaluating the key performance parameters of various electronic coupons and determining the initial monitoring frequency for each type of electronic coupon in the cake electronic coupon API integration system include: The key performance parameters include the frequency of state changes, sales ratio, and remaining effective time. Retrieve reference data and weighting coefficients for key performance parameters from a pre-set electronic cake coupon database; The key performance parameter reference data includes reference values for state change frequency, sales ratio, and remaining effective time; The weighting coefficients for the key performance parameters include the weighting coefficients for state change frequency, sales ratio, and remaining effective time; The frequency of status changes and the sales ratio of various types of electronic coupons are compared with the corresponding reference values for frequency of status changes and sales ratios, respectively, to obtain quantitative parameters for the frequency of status changes and the sales ratios of various types of electronic coupons. By comparing the remaining validity time reference value with the remaining validity time of various electronic coupons, quantitative parameters of the remaining validity time of various electronic coupons are obtained. The frequency of status change, sales ratio, and remaining validity time of various electronic coupons are weighted using the weighting coefficients of key performance parameters. The weighting results are then coupled to obtain the key quantitative index of various electronic coupons. The key quantitative index is a comprehensive quantitative indicator for measuring the keyness of electronic coupon monitoring. The initial monitoring frequency for each type of electronic voucher is dynamically determined based on key quantitative indices.
3. The API data interaction processing method of the cake e-coupon API docking system as described in claim 2, characterized in that, The steps for dynamically determining the initial monitoring frequency of various electronic vouchers based on key quantitative indices include: Retrieve key quantitative thresholds from a pre-set electronic cake coupon database; If the critical quantitative index of any type of electronic voucher is lower than the critical quantitative threshold, the preset basic monitoring frequency of that type of electronic voucher will be directly marked as the initial monitoring frequency of that type of electronic voucher. If the key quantitative index of any type of electronic voucher is not lower than the key quantitative threshold, the difference between the corresponding key quantitative index and the key quantitative threshold is marked as the key quantitative deviation value. The key quantitative deviation value is matched with the preset monitoring frequency first adjustment value mapping table, and the basic monitoring frequency corresponding to the type of electronic voucher is corrected based on the obtained monitoring frequency first adjustment value to obtain the initial monitoring frequency corresponding to the type of electronic voucher. The first adjustment value mapping table of the monitoring frequency defines the correspondence between each key quantitative deviation range and the monitoring frequency adjustment value.
4. The API data interaction processing method of the cake e-coupon API docking system as described in claim 2, characterized in that, The step of dynamically adjusting the initial monitoring frequency based on user behavior data of various electronic coupons to obtain the monitoring frequency of various electronic coupons includes: The user behavior data includes the proportion of browsing times and the proportion of operation times; Retrieve the browsing frequency ratio threshold and the operation frequency ratio threshold from the preset cake e-coupon database; The ratio of the number of views to the threshold number of views is marked as the deviation of the number of views. The ratio of the number of operations to the threshold number of operations is marked as the deviation of the number of operations. For each type of electronic coupon, calculate its maximum proportional deviation value, which is the maximum of the proportional deviation of the number of views and the proportional deviation of the number of operations. If the maximum proportional deviation value of any type of electronic coupon is greater than 1, the maximum proportional deviation value is matched with the preset monitoring frequency second adjustment value mapping table, and the initial monitoring frequency of the electronic coupon is corrected based on the obtained monitoring frequency second adjustment value to obtain the monitoring frequency of each type of electronic coupon. The second adjustment value mapping table of the monitoring frequency defines the correspondence between each maximum proportional deviation range and the monitoring frequency adjustment value.
5. The API data interaction processing method of the cake e-coupon API docking system as described in claim 1, characterized in that, The steps for dynamically configuring and optimizing based on the concurrency contention intensity of the main database corresponding to the electronic voucher status update request include: The concurrency competition intensity of the main database is dynamically evaluated based on the concurrency competition intensity parameter to obtain the concurrency competition intensity index. The concurrency competition intensity index is a comprehensive quantitative indicator of the real-time concurrency pressure level borne by the target data row corresponding to the electronic voucher status update request in the electronic voucher main database. Obtain the concurrency competition intensity threshold from the preset cake e-coupon database; If the concurrency competition intensity index exceeds the concurrency competition intensity threshold, the difference between the concurrency competition intensity index and the concurrency competition intensity threshold is marked as the concurrency competition pressure index, and the target data row is dynamically configured and optimized based on the concurrency competition pressure index. The target data row represents the corresponding locked row in the main database when the electronic coupon status request is made. If the concurrency competition intensity index does not exceed the concurrency competition intensity threshold, no additional processing will be performed.
6. The API data interaction processing method of the cake e-coupon API docking system as described in claim 5, characterized in that, The concurrency competition intensity index is obtained as follows: The concurrent contention intensity parameters include deadlock frequency, lock wait queue length, and average lock wait time; Retrieve reference data and weighting coefficients of concurrent competition intensity parameters from the pre-set cake e-coupon database; The reference data for the concurrent contention intensity parameters include: deadlock frequency reference value, lock wait queue length reference value, and average lock wait time reference value; The weighting coefficients for the concurrency contention intensity parameters include deadlock frequency weighting coefficients, lock waiting queue length weighting coefficients, and average lock waiting time weighting coefficients. The concurrency contention strength parameters are compared with their corresponding reference data. The comparison results are then weighted using the weighting coefficients of the concurrency contention strength parameters. Finally, the weighted results are coupled to obtain the concurrency contention strength index.
7. The API data interaction processing method of the cake e-coupon API docking system as described in claim 5, characterized in that, The steps for dynamically configuring and optimizing the target data row based on the concurrency competition pressure index include: Obtain the first unit coefficient of concurrency competition pressure, the second unit coefficient of concurrency competition pressure, the unit coefficient of deadlock frequency, the unit coefficient of lock waiting time, and the automatic release time threshold from the preset cake e-coupon database; Calculate the ratio of the concurrency competition pressure index to the first unit coefficient of the concurrency competition pressure, and round it down to the nearest integer. This value is then marked as the release time adjustment coefficient. Calculate the ratio of deadlock frequency to deadlock frequency unit coefficient, round it down, and mark it as the unit release time adjustment value; Based on the calculation results of the unit release time adjustment value and the release time adjustment coefficient, the automatic release time of the target data row is dynamically adjusted. When the automatic release time reaches the preset automatic release time threshold, the ratio of the concurrent competition pressure index to the second unit coefficient of the concurrent competition pressure is calculated, and the ratio is rounded down and marked as the timeout adjustment coefficient. Calculate the ratio of the average lock waiting time to the lock waiting time unit coefficient, round it down, and mark it as the unit timeout adjustment value; Based on the calculation results of the timeout adjustment coefficient and the unit timeout adjustment value, the connection timeout of the target data row is dynamically adjusted. Repeat the dynamic configuration optimization until the concurrency contention intensity index does not exceed the concurrency contention intensity threshold.
8. The API data interaction processing method of the cake e-coupon API docking system as described in claim 1, characterized in that, The steps for dynamically updating and verifying the electronic voucher status in the master and slave databases after the electronic voucher status update include: Check whether the e-coupon update request has been successfully applied to the main database; When the electronic coupon update request fails to be applied to the main database, determine whether the current available number of connections in the main database connection pool exceeds the number of requests to the main database. If so, perform a retry operation on the electronic coupon update request. Otherwise, the connection pool configuration should be dynamically adjusted based on the characteristics of the main database architecture. When the number of retries for the electronic coupon update request reaches a preset threshold and still fails to be successfully applied to the main database, a main database update error alarm message is issued. When an electronic coupon update request is successfully applied to the master database, it is determined whether all electronic coupon update requests have been successfully applied to the slave databases. If an electronic coupon update request is not successfully applied to any slave database, the corresponding slave database is marked as an abnormal slave database, and the resource processing strategy is dynamically adjusted based on the priority parameter of the abnormal slave database. If all electronic coupons in the database are in the target state, then the electronic coupon update status will be marked as a successful update.
9. The API data interaction processing method of the cake e-coupon API docking system as described in claim 8, characterized in that, The steps for dynamically adjusting resource processing strategies based on priority parameters from the database based on anomalies include: The priority parameters include the number of active connections, query frequency, and total number of connections; Retrieve priority parameter reference data and priority parameter weighting coefficients from the pre-set cake e-coupon database; The priority parameter reference data includes active connection count reference value, query frequency reference value, and total connection count reference value; The priority parameter weighting coefficients include active connection number weighting coefficient, query frequency weighting coefficient, and total connection number weighting coefficient; The priority parameters are compared with the corresponding priority parameter reference data, and the comparison results are weighted using the priority parameter weighting coefficients. The weighted results are then coupled to obtain the priority quantification index of the abnormal database. The priority quantification index is a quantitative indicator for comprehensively evaluating the importance of the electronic voucher database. Based on anomalies, the resource processing strategy is dynamically adjusted using a priority quantification index from the database.
10. The API data interaction processing method of the cake e-coupon API docking system as described in claim 9, characterized in that, The steps for dynamically adjusting resource processing strategies based on anomalies and priority quantification indices from the database include: Obtain the priority quantification threshold from the preset cake e-coupon database; If the priority quantization index of the anomaly exceeds the priority quantization threshold, a deep diagnostic mechanism and a data synchronization mechanism will be activated. If the priority quantization index of the exception from the database does not exceed the priority quantization threshold, the electronic coupon update request will be re-initiated after the preset retry interval. If the number of times the electronic coupon update request is re-initiated reaches a preset request count threshold, and the electronic coupon update request still fails to be successfully applied to the slave database, then the slave database is marked as unavailable, and a new slave database is assigned for the electronic coupon update request.