Dynamic payment processing system integrating member level discounts

CN122948484APending Publication Date: 2026-10-20JIANGXI MALI DIGITAL TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611130548.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-28
Publication Date
2026-10-20

AI Technical Summary

Technical Problem

技术缺陷一:凭证处理渠道割裂

Benefits of technology

本发明提供的集成会员等级折扣的动态支付处理系统,通过支付请求接收模块、折扣凭证处理模块、策略计算引擎与支付执行模块的协同工作,实现了全渠道折扣凭证的统一处理与智能计算,这一创新性架构有效解决了当前支付结算系统中因多渠道优惠叠加、规则冲突导致的复杂计算问题。一方面,这种处理方法通过商品集分割算法与隔离计算标识机制,首次实现了单品级优惠与全局优惠的精确隔离计算,显著降低了因规则冲突和计算顺序依赖引发的金额计算错误风险,提高了支付结算的准确性与可靠性,从而避免了商户的资损风险和用户的客诉纠纷,同时减少了运营中的潜在成本损失。另一方面,通过统一的凭证获取接口、标准化的规则转换机制与并行的计算执行架构,使得系统能够高效整合线上线下全渠道优惠资源,支持复杂营销策略的实时处理与智能决策。这种智能化、差异化的计算机制不仅能有效避免因计算错误造成的资金损失和信任危机,还提升了整体系统的处理效率与扩展能力,确保系统在多样化商业场景下的适应性与稳定性,大大增强了在高并发、复杂优惠环境下的业务连续性与可靠性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure FT_1
    Figure FT_1
Patent Text Reader

Abstract

This invention discloses a dynamic payment processing system integrating membership level discounts, belonging to the field of electronic payment technology. The system includes: a payment request receiving module; a discount voucher processing module; a strategy calculation engine for performing differentiated calculations on order items based on the scope of rule instructions, wherein for rule instructions with a scope of a single item, their associated items employ an isolated calculation strategy; and a payment execution module for completing the transaction based on the final payment amount. The method includes: receiving a payment request; processing discount vouchers and converting them into rule instructions; performing differentiated calculations based on the scope of the rule instructions; outputting the final payment amount and executing the payment. This invention solves the problem of collaborative calculation of single-item discounts and global discounts through product set segmentation and parallel computing mechanisms, achieving accurate and intelligent pricing in complex discount scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of electronic payment technology and relates to a dynamic payment processing system that integrates membership level discounts. Background Technology

[0002] With the development of new retail formats and the deep integration of online and offline channels, consumers have increasingly diversified ways to obtain discounts. The following are the main types of discount vouchers currently available in the business environment: Third-party platform online coupons: such as electronic coupons provided by platforms like Meituan and Douyin; Merchant-operated channel coupons: Coupons issued by merchants through their own apps and mini-programs; Offline physical discount tickets: Discount vouchers issued in the form of paper or physical cards; Membership tier benefits: Systematic discounts based on consumer membership status; Payment tool discounts: Instant reductions, discounts, etc., that are tied to specific payment methods.

[0003] However, existing payment and settlement systems have the following technical shortcomings when handling these complex preferential scenarios: Technical Defect 1: Fragmented Voucher Processing Channels Discount vouchers from different sources need to be processed in different system interfaces. For example, cashiers need to: Scan the product barcode in the POS system; Verify the platform coupon on the third-party platform's verification interface; Check member discounts in the membership system; Process payment discounts at the payment terminal.

[0004] This multi-system switching leads to complex and inefficient operating procedures, and can easily cause congestion at the checkout, especially during peak hours.

[0005] Technical Defect 2: Conflict in Discount Calculation Logic When multiple offers coexist, existing systems lack intelligent conflict resolution mechanisms. A particularly prominent problem is: Conflict between single-item discounts and overall discounts: For example, if a product uses a "50% off single-item coupon", should it also enjoy the "20% off storewide" member discount? The logic for stacking discounts from different sources is confusing: the priority and stacking rules among discounts from Meituan, merchant-owned coupons, and bank payment discounts are unclear; Calculation order dependency problem: different calculation orders may lead to completely different final prices.

[0006] Technical defect three: lack of sophisticated, commercial-grade computing capabilities Most existing systems use order-level discount calculations, which cannot achieve the following: Precise discount control for specific products; Different products apply different discount rules; Isolation and parallel computing of preferential rules.

[0007] Technical Defect 4: Insufficient Consistency Guarantee In high-concurrency scenarios (such as Singles' Day, major store promotions), existing systems face the following challenges: Risk of coupons being over-redeemed; Inconsistent price calculations; The payment status and the promotion status are out of sync.

[0008] Therefore, a dynamic payment processing system for membership level discounts needs to be integrated. Summary of the Invention

[0009] In view of the problems existing in the prior art, the present invention provides a dynamic payment processing system that integrates membership level discounts to solve the above-mentioned technical problems.

[0010] To achieve the above and other objectives, the technical solution adopted by the present invention is as follows: A dynamic payment processing system integrating membership tier discounts, including: The payment request receiving module is used to receive payment requests containing order product details; A discount voucher processing module is used to acquire at least one discount voucher related to the current payment and convert the discount voucher into at least one machine-executable rule instruction; The strategy calculation engine is communicatively connected to the discount voucher processing module, and the strategy calculation engine is configured as follows: Receive the rule instructions and the order product details; Based on the scope of the rule instruction, differentiated calculation processing is performed on the order products. Specifically, for rule instructions with a scope of single product, the calculation process of the associated products is different from that of rule instructions with a scope of order. Output the final payment amount obtained based on the aforementioned differential calculation process; The payment execution module is used to complete the payment transaction based on the final payment amount.

[0011] Preferably, the discount voucher processing module includes: The voucher acquisition unit is used to acquire discount voucher information through a unified interactive interface. The interactive interface supports at least one of the following methods: automatic display of bound electronic vouchers and scanning and recognizing offline physical vouchers. The rule conversion unit is used to analyze the discount logic and target objects contained in the discount voucher information and generate structured rule instructions. The rule instructions include at least rule type, discount level, and scope identifier, wherein the scope identifier is used to distinguish between order-level rules and single-item-level rules. The voucher acquisition unit is configured to: when the user identity associated with the current payment request is identified, automatically query the electronic discount voucher applicable to the current order from the user's corresponding account, and display it in a visual list on the interactive interface; The rule conversion unit is further configured to add an isolation calculation identifier to the generated rule instruction for discount vouchers applied to a specific product. The isolation calculation identifier is used to instruct the strategy calculation engine to adopt an isolation calculation strategy for the product associated with the rule instruction.

[0012] Preferably, the policy calculation engine includes: A rule base stores pre-configured calculation rules, which include at least one of membership level discount rules, product promotion rules, and payment tool discount rules; A rule executor is used to perform the differential calculation process based on the rule base and the rule instructions received from the discount voucher processing module; The rule executor includes a product set segmentation unit, which is used for: Identify single-item-level rule instructions with isolation calculation identifiers among all received rule instructions; Based on the product identifier associated with the single-item-level rule instruction, the products in the order product details are divided into a first product subset and a second product subset, wherein the first product subset contains all products associated with the single-item-level rule instruction, and the second product subset contains the remaining products in the order.

[0013] Preferably, the rule executor further includes a parallel computing unit, which is used for: For the first subset of products, only the single-item-level rule instructions associated with it are applied for calculation, and the membership level discount rules in the rule base are excluded from application. For the second subset of goods, the applicable calculation rules in the rule base are applied for calculation; The calculation results of the first and second product subsets are summed to obtain the first intermediate amount.

[0014] Preferably, the rule executor is further configured to: after obtaining the first intermediate amount, apply all rule instructions with a scope of order level to the first intermediate amount to calculate the final payment amount.

[0015] Preferably, it also includes a data consistency guarantee module, which is configured to apply a concurrency control lock to key operation objects in the payment processing flow to ensure the atomicity and consistency of the redemption status of discount vouchers and the calculation of payment amounts; the key operation objects include at least one of the following: user account, discount voucher, order; The data consistency guarantee module is also configured to atomically perform the following operations after a successful payment: Update the status of the order; Update the status of the discount voucher used for this payment to "verified"; According to the preset points rules, points are added to the associated user accounts; When the discount voucher originates from an external third-party platform, the data consistency guarantee module is further configured to: after updating the status of the discount voucher to "verified", notify the third-party platform of the verification result by calling the interface provided by the third-party platform.

[0016] A dynamic payment processing method integrating membership tier discounts includes the following steps: S100: Receive a payment request, wherein the payment request contains at least the product details of the order; S200: Process discount vouchers, obtain at least one discount voucher related to the current payment, and convert the discount voucher into at least one machine-executable rule instruction; S300: Execution strategy calculation: S310: Receive the rule instruction and the product details information; S320: Based on the scope of the rule instruction, perform differentiated calculation processing on the order products, wherein for the rule instruction whose scope is a single product, the calculation process of its associated products is different from that of the rule instruction whose scope is an order; S330: Output the final payment amount obtained based on the differential calculation process; S331: Apply all rule instructions with a scope of order level to the first intermediate amount to calculate the final payment amount; S400: Based on the final payment amount, invoke the payment service to complete the transaction.

[0017] Preferably, step S200 includes: S210: Obtain discount voucher information through a unified interactive interface, wherein the acquisition methods include: automatically displaying electronic vouchers that are bound to the user's account and applicable to the current order for selection, and / or scanning and recognizing offline physical vouchers; S220: Parse the discount voucher information and generate structured rule instructions, wherein the scope of the rule instructions is clearly defined as order level or single item level; For rule instructions whose scope is a single item, the rule instructions generated in step S220 also include an isolation calculation identifier.

[0018] Preferably, the differential calculation processing of the order products in step S320 specifically includes: S321: Identify all item-level rule instructions that contain isolated calculation identifiers and determine the associated items; S322: Based on the identification result of S321, the order products are divided into a first product subset and a second product subset, wherein the first product subset contains all products associated with the single-item level rule instruction; S323: For the first subset of products, only the single-item-level rule instruction associated with it is applied to calculate the price, and the application of membership level discounts is excluded in this calculation; S324: For the second subset of goods, apply applicable rules, including membership level discounts, to calculate the price; S325: Add the calculation results of S323 and S324 to obtain the first intermediate amount.

[0019] Preferably, after successful payment in step S400, a consistency post-processing step S500 is also included: S510: Atomically update the order status to paid; S520: Atomically update the status of all discount vouchers used in this payment to "verified"; S530: Based on the calculation rules for this payment, add points to the corresponding user account; When the discount voucher being verified originates from an external third-party platform, step S520 further includes: synchronizing the verification result to the third-party platform via an interface call.

[0020] As described above, the method for integrating rights transaction verification and payment in the One-Code-for-Payment scenario provided by the present invention has at least the following beneficial effects: This invention provides a dynamic payment processing system integrating membership level discounts. Through the collaborative work of a payment request receiving module, a discount voucher processing module, a strategy calculation engine, and a payment execution module, it achieves unified processing and intelligent calculation of discount vouchers across all channels. This innovative architecture effectively solves the complex calculation problems caused by the superposition of multi-channel discounts and rule conflicts in current payment settlement systems. On the one hand, this processing method, through a product set segmentation algorithm and an isolated calculation identification mechanism, achieves for the first time precise isolation calculation of single-item discounts and global discounts, significantly reducing the risk of calculation errors caused by rule conflicts and calculation order dependencies, improving the accuracy and reliability of payment settlement, thereby avoiding the risk of financial losses for merchants and customer complaints, while reducing potential cost losses in operation. On the other hand, through a unified voucher acquisition interface, a standardized rule conversion mechanism, and a parallel calculation execution architecture, the system can efficiently integrate online and offline omni-channel discount resources, supporting real-time processing and intelligent decision-making for complex marketing strategies. This intelligent and differentiated calculation mechanism not only effectively avoids financial losses and trust crises caused by calculation errors, but also improves the overall system's processing efficiency and scalability, ensuring the system's adaptability and stability in diverse business scenarios, and greatly enhancing business continuity and reliability in high-concurrency and complex preferential environments. Attached Figure Description

[0021] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0022] Figure 1 This is a schematic diagram showing the connections between the steps of the method of the present invention. Detailed Implementation

[0023] The following description, in conjunction with the implementation of the present invention, is merely an example and illustration of the concept of the present invention. Those skilled in the art can make various modifications or additions to the specific embodiments described, or use similar methods to replace them, as long as they do not deviate from the concept of the invention or exceed the scope defined in the claims, all of which should fall within the protection scope of the present invention. Example 1

[0024] This embodiment integrates a dynamic payment processing system for membership level discounts, including: The payment request receiving module is used to receive payment requests containing order product details; The discount voucher processing module is used to obtain at least one discount voucher related to the current payment and convert the discount voucher into at least one machine-executable rule instruction; The strategy calculation engine, which communicates with the discount voucher processing module, is configured as follows: Receive rule instructions and order product details; Based on the scope of the rule instruction, differentiated calculations are performed on the order products. Specifically, for rule instructions with a scope of single product, the calculation process for their associated products is different from that of rule instructions with a scope of order. Output the final payment amount obtained based on differential calculation processing; The payment execution module is used to complete the payment transaction based on the final payment amount.

[0025] Specifically, the payment request receiving module receives payment request data streams from the POS terminal through a unified data interface. This data stream is encoded in JSON format and includes fields for order identifier, timestamp, user identifier, product details, and the original order total amount. The payment request receiving module performs protocol parsing and format validation on the input data stream to ensure the integrity and standardization of the data structure, and then converts it into the system's internal standard data model.

[0026] The discount voucher processing module initiates an asynchronous query request to the member database based on the user identifier in the payment request, retrieving metadata for all valid discount vouchers associated with that user account. The system-maintained voucher metadata storage structure includes key fields such as voucher code, voucher type enumeration value, applicable product identifier list, discount calculation rule descriptor, and valid time interval. The discount voucher processing module performs an applicability filtering algorithm on the query results. This algorithm performs a set intersection operation between the current order's product identifier set and the voucher's applicable product identifier list, filtering out a set of available vouchers that meet the criteria.

[0027] For the selected set of available vouchers, the rule conversion unit performs structured parsing processing. The system-defined rule instruction data structure includes the following core fields: a unique rule identifier, a rule type enumeration value (including discount type, full reduction type, instant reduction type, gift type, etc.), a numerical representation of the discount amount, a scope identifier (order level or single item level), a list of associated product identifiers, and a boolean value for the isolation calculation identifier. When the rule conversion unit recognizes that the list of applicable product identifiers in the voucher metadata contains only a single product identifier, it automatically sets the isolation calculation identifier to true.

[0028] The strategy calculation engine receives a standardized order data model and a set of rule instructions. It first performs rule instruction preprocessing, classifying and grouping the rules according to their scope identifiers. For rule instructions with a single-item scope identifier, the strategy calculation engine establishes a mapping table between product identifiers and rule instructions. This mapping table uses a hash data structure and supports O(1) time complexity query operations. Based on the mapping table, the strategy calculation engine executes a product set partitioning algorithm, dividing the order product details set into two mutually exclusive subsets: the first subset contains all product items mapped to single-item level rule instructions, and the second subset contains the remaining product items in the order.

[0029] The payment execution module constructs a payment instruction data packet based on the final payment amount output by the strategy calculation engine. This data packet uses a standard payment protocol format and includes fields such as merchant identifier, transaction serial number, payment amount, payment channel code, and cryptographic signature. The payment execution module transmits the payment instruction data packet to the third-party payment platform via the payment gateway interface and listens for payment result callback notifications. Example 2

[0030] The discount voucher processing module includes: The voucher acquisition unit is used to obtain discount voucher information through a unified interactive interface. The interactive interface supports at least one of the following methods: automatic display of bound electronic vouchers, user selection, and scanning and recognizing offline physical vouchers. The rule conversion unit is used to analyze the discount logic and target objects contained in the discount voucher information and generate structured rule instructions. The rule instructions include at least the rule type, discount level, and scope identifier, where the scope identifier is used to distinguish between order-level rules and single-item-level rules. The voucher acquisition unit is configured to automatically retrieve electronic discount vouchers applicable to the current order from the user's account when the user's identity is identified as associated with the current payment request, and display them in a visual list on the interactive interface. The rule conversion unit is further configured to add an isolation calculation identifier to the generated rule instruction for discount vouchers that apply to a specific item. The isolation calculation identifier is used to instruct the strategy calculation engine to adopt an isolation calculation strategy for the item associated with the rule instruction.

[0031] Specifically, the voucher acquisition unit constructs a unified interactive interface component through a user interface framework. This component integrates two voucher acquisition modes: automatic display mode and QR code recognition mode. In automatic display mode, the system performs an asynchronous voucher query operation based on the user's identity identifier in the current payment session. The query algorithm adopts a multi-condition combined query strategy, with query conditions including exact matching of user identifiers, voucher status being unused, voucher validity time interval including the current timestamp, and overlap between the voucher's applicable products and the order's products. The query result set is rendered in the interactive interface as a visual card list, with each card component containing visual elements such as a voucher thumbnail icon, discount description text, applicable product tags, and a countdown timer for the validity period.

[0032] In QR code scanning mode, the system activates the QR code scanning function of the image acquisition device and decodes the input graphic code data. The decoding algorithm supports multiple QR code encoding standards, including QR Code, Data Matrix, and PDF417 formats. After the decoded string data undergoes format verification, the system extracts the credential code field and sends a verification request to the credential verification service interface via network request. The verification response data includes metadata such as credential details, validity status, and usage restrictions.

[0033] The rule conversion unit receives a set of voucher metadata from the voucher acquisition unit and performs rule extraction and structured conversion. The system-maintained rule type mapping table defines the correspondence between various discount description texts and standard rule types. The rule conversion unit uses natural language processing technology to perform semantic analysis on the discount description text, extracting numerical parameters and logical relationships. For discount descriptions containing specific product identifiers, the system automatically identifies their scope as single-product level and sets the corresponding scope identifier in the generated rule instruction structure.

[0034] When the rule conversion unit processes discount vouchers applicable to a specific item, the system executes additional identifier setting logic. This logic is based on the semantic analysis results of the voucher's applicability. When it is identified that the voucher is only applicable to a single item or a specific combination of items, the system sets the isolation calculation identifier field in the rule instruction data structure to true. The setting decision of the isolation calculation identifier is based on a preset threshold rule: when the number of items applicable to the voucher is less than or equal to the single-item threshold configured by the system, the isolation calculation mechanism is automatically enabled. Example 3

[0035] The strategy computation engine includes: The rule base stores pre-configured calculation rules, which include at least one of the following: membership level discount rules, product promotion rules, and payment tool discount rules. The rule executor is used to perform differential calculation processing based on the rule base and the rule instructions received from the discount voucher processing module; The rule executor includes a product set splitting unit, which is used for: Identify single-item-level rule instructions with isolation calculation identifiers among all received rule instructions; Based on the product identifier associated with the single-item-level rule instruction, the products in the order product details are divided into a first product subset and a second product subset. The first product subset contains all products associated with the single-item-level rule instruction, and the second product subset contains the remaining products in the order.

[0036] Specifically, the rule base maintained by the strategy calculation engine adopts a layered storage architecture, including a memory caching layer, a database persistence layer, and a configuration file layer. The memory caching layer stores frequently accessed rule data and uses an LRU eviction policy to manage cache space. The database persistence layer uses a relational database to store rule metadata, with table structures including columns for rule identifier primary key, rule type field, applicable condition expression, calculation logic description, priority value, and valid time interval. The configuration file layer supports dynamic rule updates; the system detects configuration file changes through a file monitoring mechanism and loads new rule definitions in real time.

[0037] The pre-configured calculation rules stored in the rule base are defined using a unified rule description language. The definition of membership level discount rules includes parameters such as membership level enumeration values, base discount rate, applicable product category list, and excluded product list. Product promotion rules are defined using a condition-action pattern, with the condition part supporting combinations of logical operators such as product attribute matching, time interval judgment, and quantity threshold comparison. Payment tool discount rules define the mapping relationship between payment channel identifiers and discount parameters, supporting various discount forms such as fixed amount reduction, percentage discount, and full-amount discount.

[0038] The rule executor receives a stream of rule instructions from the discount voucher processing module and first performs instruction verification and conflict detection. The verification algorithm checks the format, parameter validity, and time validity of the rule instructions. The conflict detection algorithm identifies combinations of rule instructions that may have computational conflicts based on rule priority values ​​and mutual exclusion relationships, and resolves them according to a preset conflict resolution strategy.

[0039] The product set segmentation unit implements a product classification algorithm based on isolation calculation identifiers. The algorithm takes an order product detail set and a rule instruction set as input, and outputs two mutually exclusive product subsets. The algorithm first constructs a rule instruction index. By traversing the rule instruction set, it extracts all single-item-level rule instructions with isolation calculation identifiers set to true, establishing a reverse index mapping from product identifiers to rule instructions. Then, based on this index mapping, it performs a classification operation on the order product details: for each product item, it queries the reverse index mapping table; if a related isolation rule instruction exists, the product item is assigned to the first product subset; otherwise, it is assigned to the second product subset.

[0040] The product set segmentation algorithm supports batch processing optimization and employs a multi-threaded parallel execution strategy to improve classification efficiency. The system allocates an independent execution thread for each product classification task and manages concurrent execution resources through a thread pool. Classification results are aggregated using a thread-safe data structure to ensure data consistency and integrity. Example 4

[0041] The rule executor also includes a parallel computing unit, which is used for: For the first subset of products, only the single-item-level rule instructions associated with it are applied for calculation, and the membership level discount rules in the rule base are excluded. For the second subset of goods, apply the applicable calculation rules from the rule base to perform the calculation; The first intermediate amount is obtained by summing the calculation results of the first and second product subsets.

[0042] Specifically, the parallel computing unit adopts an asynchronous computing architecture design, processing the computational tasks of product subsets based on an event-driven model. The system creates independent task queues for the first and second product subsets, with each task queue bound to a dedicated computational worker thread. The task scheduler dynamically allocates computing resources based on the data size and computational complexity of the product subsets, ensuring balanced execution of computational tasks.

[0043] For the computation and processing of the first subset of products, the system implements a strict rule isolation mechanism. The computation engine creates an independent computation context environment for each product item, which only loads single-item-level rule instructions directly associated with that product item. The rule loading process adopts a lazy loading strategy, retrieving relevant rule data from the rule cache only when computation is needed. During computation, the system explicitly excludes the application of global rules through environment variable settings to ensure the purity of the computation logic.

[0044] The calculation algorithm for the first subset of products supports the combined application of multiple discount types. The system-defined calculation priority rules determine the execution order of different discount types: price discount rules take precedence over amount reduction rules, and fixed-amount discounts take precedence over percentage discounts. When multiple discount rules are associated with the same product item, the system determines the rule execution sequence according to the priority rules, ensuring the determinism and repeatability of the calculation results.

[0045] For the calculation and processing of the second subset of products, the system executes a full rule application strategy. The calculation engine loads all applicable calculation rules from the rule base, including global rules such as membership level discount rules and product promotion rules. The rule application process uses an optimized matching algorithm, which quickly retrieves the applicable rule set through a pre-compiled rule index, reducing the time overhead of rule matching.

[0046] The parallel computing unit implements an efficient aggregation mechanism for computation results. The system sets synchronization barriers for the computation tasks of two product subsets, ensuring that the result aggregation operation is performed only after all subtasks have completed their computations. The aggregation algorithm employs an incremental accumulation strategy, updating intermediate computation results in real time and supporting real-time monitoring and progress tracking of the computation process.

[0047] The aggregation process performs data integrity verification, and the system verifies the accuracy of the calculation results through a checksum mechanism. The calculation result for each product item includes detailed data such as the original amount, discount amount, and final amount. The aggregation algorithm performs arithmetic verification on these detailed data to ensure the correctness of the calculation logic. Example 5

[0048] The rule executor is further configured to: after obtaining the first intermediate amount, apply all rule instructions with the scope of order level to the first intermediate amount to calculate the final payment amount.

[0049] Specifically: After completing parallel computation of a subset of goods, the strategy calculation engine obtains the first intermediate amount value. Based on this intermediate amount, the system constructs the input context for order-level rule application. The context data structure includes dimensional information such as original order information, applied rule records, intermediate calculation results, and user attribute data.

[0050] The order-level rule application engine performs rule filtering and sorting. The system extracts all rule instructions with the scope identifier of "order" from the rule instruction set and sorts them in descending order based on their rule priority values. Rule instructions with higher priority values ​​are applied first in the calculation process to ensure the correct execution of key discount rules.

[0051] The system implements a conditional validation mechanism for order-level rules. Each order-level rule contains an applicable conditional expression, and the system performs conditional validation before the rule is applied. The validation algorithm parses the conditional expression, extracts the variable parameters (such as order amount, product quantity, user level, etc.), and calculates the truth value of the expression based on the current context data. Only when the conditional expression evaluates to truth is the corresponding rule instruction applied to the calculation process.

[0052] The application and execution of order-level rules adopts a pipelined processing architecture. The system decomposes the rule application process into multiple processing stages, each corresponding to the computation of a specific type of rule. The pipeline design supports parallel optimization of the computation process, and different stages can be executed overlappingly to improve overall computational efficiency.

[0053] The system implements an atomicity guarantee mechanism for rule application. Each order-level rule application operation is encapsulated as an atomic transaction, ensuring the integrity and consistency of rule application. When an exception occurs during rule application, the system performs a transaction rollback operation, restoring the system to the state before rule application, thus ensuring the reliability of the calculation process.

[0054] The final payment amount is calculated using an iterative update strategy. The system uses a first intermediate amount as the initial value and applies order-level rules sequentially according to priority. After each rule is applied, the system updates the intermediate amount and records the rule application log. The log data includes detailed information such as the rule identifier, the amount before application, the amount after application, and the discount amount, supporting auditing and traceability of the calculation process. Example 6

[0055] The dynamic payment processing system integrating membership level discounts also includes a data consistency guarantee module. This module is configured to apply concurrency control locks to key operation objects during the payment processing flow to ensure the atomicity and consistency of the discount voucher's verification status and payment amount calculation. Key operation objects include at least one of the following: user account, discount voucher, or order. The data consistency guarantee module is also configured to atomically perform the following operations after a successful payment: Update the order status; Update the status of the discount voucher used for this payment to "verified"; According to the preset points rules, points are added to the associated user accounts; When the discount voucher originates from an external third-party platform, the data consistency guarantee module is also configured to: after updating the discount voucher status to "verified", notify the third-party platform of the verification result by calling the interface provided by the third-party platform.

[0056] Specifically, the data consistency assurance module employs a distributed lock mechanism for concurrency control. The system builds a distributed lock service based on a Redis cluster, supporting multiple lock granularity configurations: user-level locks protect concurrent operations for a single user account, order-level locks protect the complete transaction of a single order, and voucher-level locks protect the exclusive use of a single discount voucher.

[0057] The lock service implements a deadlock prevention strategy based on a timeout mechanism. The system sets a reasonable timeout period for each lock instance. When the lock holding time exceeds a preset threshold, a lock release operation is automatically triggered. The timeout threshold is dynamically adjusted based on the operation type: a shorter timeout period (e.g., 5 seconds) is set for payment operations, and a longer timeout period (e.g., 30 seconds) is set for resource pre-locking operations.

[0058] Atomic operations are executed based on a distributed transaction protocol. The system employs a two-phase commit protocol to coordinate atomic updates across multiple data sources: in the preparation phase, operation instructions are sent to all participants and responses are collected; in the commit phase, a commit instruction is sent after all participants confirm that the operation is executable. The transaction manager maintains a global transaction state machine and manages the lifecycle state transitions of transactions.

[0059] Order status update operations employ an optimistic locking mechanism to ensure data consistency. The system maintains a version number field in the order data records. Before each update operation, the current version number is read, and version number consistency is checked during the update operation. When a version conflict is detected, the system automatically retryes the update operation to ensure eventual consistency of the data updates.

[0060] Discount voucher status updates are guaranteed to be idempotent. The system generates a unique operation identifier for each voucher update operation and checks whether this identifier has already been processed before execution. Duplicate operation requests are automatically identified and ignored to prevent duplicate voucher resale. The operation identifier is generated based on elements such as timestamp, user identifier, and voucher identifier to ensure global uniqueness.

[0061] A third-party platform implements an asynchronous message queue architecture using a synchronous mechanism. The system publishes reimbursement notification messages to the message queue, where independent consumer processes asynchronously process message sending. The message queue uses persistent storage to ensure message reliability and supports message retry and dead-letter handling mechanisms. Synchronous interface calls implement timeout control and circuit breaker protection, automatically degrading processing when external interface responses are abnormal. Example 7

[0062] The payment processing method of a dynamic payment processing system integrating membership tier discounts includes the following steps: S100: Receive payment request, which must contain at least the order's product details; S200: Process discount vouchers, obtain at least one discount voucher associated with the current payment, and convert the discount voucher into at least one machine-executable rule instruction; S300: Execution strategy calculation: S310: Receives rule instructions and product details information; S320: Based on the scope of the rule instruction, perform differentiated calculation processing on the order products. For rule instructions with a scope of single product, the calculation process of the associated products is different from that of rule instructions with a scope of order. S330: Output the final payment amount based on the differential calculation processing; S331: For the first intermediate amount, apply all rule instructions with the scope of order level to calculate the final payment amount; S400: Based on the final payment amount, invoke the payment service to complete the transaction.

[0063] Specifically, the payment processing method defines a standardized processing pipeline, which includes four sequential execution phases: request reception, document processing, strategy calculation, and payment execution. Each phase defines clear input / output interface specifications, supporting modular combination and expansion of the processing flow.

[0064] The request receiving phase implements protocol adaptation and data conversion functions. The method supports request receiving using multiple communication protocols, including HTTP RESTful interfaces, WebSocket real-time connections, and asynchronous message queue consumption. The protocol adapter converts request data in different protocol formats into a unified internal data model, eliminating the impact of protocol differences on the processing logic.

[0065] The voucher processing phase integrates multi-channel voucher retrieval capabilities. A unified voucher retrieval interface specification is defined, allowing different voucher sources (such as membership systems, third-party platforms, and physical tickets) to access the system by implementing this interface specification. The interface specification includes standard operation methods for voucher querying, voucher verification, and rule conversion, ensuring consistent processing across different voucher sources.

[0066] The strategy computation phase enables intelligent decision-making based on a rule engine. The method abstracts the discount calculation process into a rule execution problem, defining the computation logic through a configurable rule set. The rule engine supports dynamic rule loading and hot updates, allowing modification of computation rules without restarting the system, thus improving system flexibility and maintainability.

[0067] The payment execution phase encapsulates a unified interface for multiple payment channels. Methods define standard payment operation interfaces, including core functions such as payment initiation, payment inquiry, payment cancellation, and refund processing. Different payment channels integrate into the system by implementing this interface specification, eliminating the need for business logic to concern itself with the specific implementation details of each payment channel.

[0068] The processing method implements an exception handling and recovery mechanism. Each processing stage defines a clear exception type and handling strategy, including retry mechanisms, degradation processing, transaction rollback, and other recovery methods. The system uses an exception propagation mechanism to pass exceptions during processing to higher layers, ensuring the correct handling of exceptions and the integrity of the system state. Example 8

[0069] Step S200 includes: S210: Obtain discount voucher information through a unified interactive interface. The methods of obtaining the voucher include: automatically displaying electronic vouchers that are bound to the user's account and applicable to the current order for selection, and / or scanning and recognizing offline physical vouchers. S220: Parse discount voucher information and generate structured rule instructions, specifying whether the scope of the rule instructions is order-level or item-level; For rule instructions whose scope is a single item, the rule instructions generated in step S220 also include an isolation calculation identifier.

[0070] Specifically, step S210, which acquires the unified interactive interface, is based on responsive design principles. The system constructs adaptively laid-out interface components, dynamically adjusting the interface layout and interaction methods according to the terminal device type (such as POS machine, mobile terminal, self-service device). The interface components are synchronized with the backend service in real time through a data binding mechanism to ensure immediate updates to the interface state.

[0071] The automatic display function enables intelligent recommendations based on user profiles. The system maintains users' historical records of discount usage, analyzing their discount preferences and usage patterns. Based on the analysis results, the system prioritizes recommending discount options that match user preferences from the available voucher set, improving user experience and discount usage efficiency.

[0072] The electronic voucher selection mechanism optimizes batch processing. The system supports the simultaneous selection and combination of multiple vouchers, recommending the optimal discount combination through a combination optimization algorithm. The algorithm considers multiple factors such as discount amount, usage conditions, and validity period to calculate the expected benefits of different combinations, providing decision support for users.

[0073] This system implements a streamlined image processing pipeline for scanning and recognizing offline physical credentials. The system constructs a multi-stage image processing workflow: the preprocessing stage performs image enhancement and noise reduction; the recognition stage performs QR code / barcode decoding; and the verification stage performs online authenticity verification. Each processing stage implements an independent fault-tolerance mechanism to ensure the robustness of the recognition process.

[0074] Step S220 implements a structured conversion algorithm by parsing and generating rule instructions. The system defines the syntax of the rule description language, supporting mixed input of natural language and structured descriptions. The parser uses syntax analysis techniques to extract key information from the description text, including semantic elements such as discount type, discount amount, applicable conditions, and validity period.

[0075] For rule instructions with a single-item scope, the system performs semantic enhancement processing during the generation process. The parser identifies product qualifiers (such as "only," "specific," "designated," etc.) in the description text and determines the scope of the rule based on these qualifiers. When it is confirmed that the rule only applies to a specific product, the system sets an isolation calculation flag in the rule instruction data structure and associates it with the corresponding product flag list. Example 9

[0076] Step S320 involves performing differential calculations on the order items, specifically including: S321: Identify all item-level rule instructions that contain isolated calculation identifiers and determine the associated items; S322: Based on the identification result of S321, the order products are divided into a first product subset and a second product subset. The first product subset contains all products associated with the single-item level rule instruction. S323: For the first subset of products, only the item-level rule instructions associated with it are applied to calculate the price, and membership level discounts are excluded from this calculation; S324: For the second subset of goods, apply applicable rules, including membership level discounts, to calculate the price; S325: Add the calculation results of S323 and S324 to obtain the first intermediate amount.

[0077] Specifically, step S321's recognition processing implements feature vector-based pattern matching. The system constructs a feature vector representation for each rule instruction, with vector dimensions including rule type, scope identifier, isolation identifier, and number of associated products. The recognition algorithm calculates the similarity between the feature vector and a preset pattern; when the similarity exceeds a threshold, the rule instruction is determined to meet the isolation calculation conditions.

[0078] Step S322 implements a graph-based clustering algorithm for product segmentation. The system constructs a product-rule association graph, where nodes represent product items and rule instructions, and edges represent association relationships. The segmentation algorithm performs community detection based on the association graph structure, grouping closely related products and rules into the same subset to ensure the semantic rationality of the segmentation results.

[0079] The price calculation for the first subset of products is implemented using a rule-based pipelined process. The system constructs an independent rule execution chain for each product item, with rules arranged in priority order. The execution engine applies each rule in the chain sequentially, updating the product price status after each rule is applied, ensuring the correctness and traceability of the calculation process.

[0080] The exclusion mechanism for membership level discounts implements rule filtering based on context markers. The system sets an isolation calculation marker in the calculation context, and the rule matcher checks the status of this marker when retrieving applicable rules. When the marker is active, the matcher automatically filters membership level discount rules to ensure that the calculation logic meets the isolation requirements.

[0081] The rule application for the second subset of products implements optimized matching based on a decision table. The system constructs a multi-dimensional decision table structure, with dimensions including product attributes, user attributes, and time attributes. The matching algorithm quickly locates the applicable rule set based on the decision table, reducing the time complexity of rule retrieval and improving computational efficiency.

[0082] The addition of results in step S325 performs precision-based numerical calculations. The system uses a high-precision numerical calculation library to handle monetary operations, supporting decimal operations of arbitrary precision. The addition algorithm performs overflow detection and rounding control to ensure that the numerical precision of the calculation results meets financial calculation standards. Example 10

[0083] After successful payment in step S400, the process also includes a consistency post-processing step S500: S510: Atomically update the order status to paid; S520: Atomically update the status of all discount vouchers used in this payment to "verified"; S530: Based on the calculation rules for this payment, add points to the corresponding user account; When the discount voucher being verified originates from an external third-party platform, step S520 further includes: synchronizing the verification result to the third-party platform via an interface call.

[0084] Specifically: Step S510's atomic update implements optimistic concurrency based on version control. The system maintains a version number field in the order data record, and the update operation adopts a "read-modify-write" pattern. During the modification phase, the system checks the consistency between the current version number and the version number read to prevent data inconsistency caused by concurrent updates.

[0085] The order status update operation implements a state machine-driven workflow. The system defines an order state transition graph, where nodes represent order status and edges represent state transition conditions. The update engine determines the valid state transition path based on the current state and operation type, ensuring the logical correctness of the state update.

[0086] Step S520, updating the discount voucher status, is optimized for batch processing. The system supports simultaneous updates of multiple vouchers, using transaction grouping technology to group and commit related update operations, reducing database transaction overhead. The batch update algorithm implements an exception isolation mechanism, ensuring that the failure of updating a single voucher does not affect the normal updates of other vouchers.

[0087] Atomicity operations achieve eventual consistency based on compensating transactions. The system defines a corresponding compensating operation for each update operation, which is automatically executed when the main operation fails. The compensating transaction mechanism ensures that the system can recover to a consistent state under abnormal circumstances, guaranteeing data integrity.

[0088] Third-party platforms synchronously implement state reconstruction based on event sourcing. The system records the complete event sequence of each synchronization operation, including key events such as request sending, response receiving, and exception handling. Based on the event logs, the system supports state reconstruction and replay, facilitating problem diagnosis and system recovery.

[0089] The points calculation in step S530 is implemented based on dynamic configuration using a rules engine. The system abstracts the points calculation rules into configurable expressions, supporting points calculation based on multiple dimensions such as transaction amount, product type, and payment method. The rules engine parses the calculation expressions in real time and dynamically generates the points calculation logic, improving the system's flexibility and configurability.

[0090] The points accumulation operation implements balance management based on an account model. The system maintains a complete transaction record of the user's points account, recording detailed information for each points change operation, including the reason for the change, the time of the change, and the operation identifier. The account model supports complete operations such as points query, adjustment, and freezing, ensuring the accuracy and auditability of points management.

[0091] It should be understood that in the various embodiments of this application, the order of the above-mentioned processes does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0092] It should be understood that determining B based on A does not mean determining B solely based on A; it also means determining B based on A and / or other information.

[0093] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0094] In conclusion, the above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A dynamic payment processing system integrating membership level discounts, characterized in that, include: The payment request receiving module is used to receive payment requests containing order product details; A discount voucher processing module is used to acquire at least one discount voucher related to the current payment and convert the discount voucher into at least one machine-executable rule instruction; The strategy calculation engine is communicatively connected to the discount voucher processing module, and the strategy calculation engine is configured as follows: Receive the rule instructions and the order product details; Based on the scope of the rule instruction, differentiated calculation processing is performed on the order products. Specifically, for rule instructions with a scope of single product, the calculation process of the associated products is different from that of rule instructions with a scope of order. Output the final payment amount obtained based on the aforementioned differential calculation process; The payment execution module is used to complete the payment transaction based on the final payment amount.

2. The dynamic payment processing system integrating membership level discounts according to claim 1, characterized in that, The discount voucher processing module includes: The voucher acquisition unit is used to acquire discount voucher information through a unified interactive interface. The interactive interface supports at least one of the following methods: automatic display of bound electronic vouchers and scanning and recognizing offline physical vouchers. The rule conversion unit is used to analyze the discount logic and target objects contained in the discount voucher information and generate structured rule instructions. The rule instructions include at least the rule type, discount level, and scope identifier, wherein the scope identifier is used to distinguish between order-level rules and single-item-level rules. The voucher acquisition unit is configured to: when the user identity associated with the current payment request is identified, automatically query the electronic discount voucher applicable to the current order from the user's corresponding account, and display it in a visual list on the interactive interface; The rule conversion unit is further configured to add an isolation calculation identifier to the generated rule instruction for discount vouchers applied to a specific product. The isolation calculation identifier is used to instruct the strategy calculation engine to adopt an isolation calculation strategy for the product associated with the rule instruction.

3. The dynamic payment processing system integrating membership level discounts according to claim 1, characterized in that, The policy calculation engine includes: A rule base stores pre-configured calculation rules, which include at least one of membership level discount rules, product promotion rules, and payment tool discount rules; A rule executor is used to perform the differential calculation process based on the rule base and the rule instructions received from the discount voucher processing module; The rule executor includes a product set segmentation unit, which is used for: Identify single-item-level rule instructions with isolation calculation identifiers among all received rule instructions; Based on the product identifier associated with the single-item-level rule instruction, the products in the order product details are divided into a first product subset and a second product subset, wherein the first product subset contains all products associated with the single-item-level rule instruction, and the second product subset contains the remaining products in the order.

4. The dynamic payment processing system integrating membership level discounts according to claim 3, characterized in that, The rule executor further includes a parallel computing unit, which is used for: For the first subset of products, only the single-item-level rule instructions associated with it are applied for calculation, and the membership level discount rules in the rule base are excluded from application. For the second subset of goods, the applicable calculation rules in the rule base are applied for calculation; The calculation results of the first and second product subsets are summed to obtain the first intermediate amount.

5. The dynamic payment processing system integrating membership level discounts according to claim 4, characterized in that, The rule executor is further configured to: after obtaining the first intermediate amount, apply all rule instructions with a scope of order level to the first intermediate amount to calculate the final payment amount.

6. The dynamic payment processing system integrating membership level discounts according to claim 1, characterized in that, It also includes a data consistency guarantee module, which is configured to apply concurrency control locks to key operation objects in the payment processing flow to ensure the atomicity and consistency of the discount voucher's verification status and payment amount calculation; the key operation objects include at least one of the following: user account, discount voucher, order; The data consistency guarantee module is also configured to atomically perform the following operations after a successful payment: Update the status of the order; Update the status of the discount voucher used for this payment to "verified"; According to the preset points rules, points are added to the associated user accounts; When the discount voucher originates from an external third-party platform, the data consistency guarantee module is further configured to: after updating the status of the discount voucher to "verified", notify the third-party platform of the verification result by calling the interface provided by the third-party platform.

7. A payment processing method based on the dynamic payment processing system integrating membership level discounts as described in any one of claims 1 to 6, characterized in that, Including the following steps: S100: Receive a payment request, wherein the payment request contains at least the product details of the order; S200: Process discount vouchers, obtain at least one discount voucher related to the current payment, and convert the discount voucher into at least one machine-executable rule instruction; S300: Execution strategy calculation: S310: Receive the rule instruction and the product details information; S320: Based on the scope of the rule instruction, perform differentiated calculation processing on the order products, wherein for the rule instruction whose scope is a single product, the calculation process of its associated products is different from that of the rule instruction whose scope is an order; S330: Output the final payment amount obtained based on the differential calculation process; S331: Apply all rule instructions with a scope of order level to the first intermediate amount to calculate the final payment amount; S400: Based on the final payment amount, invoke the payment service to complete the transaction.

8. The payment processing method according to claim 7, characterized in that, Step S200 includes: S210: Obtain discount voucher information through a unified interactive interface, wherein the acquisition methods include: automatically displaying electronic vouchers that are bound to the user's account and applicable to the current order for selection, and / or scanning and recognizing offline physical vouchers; S220: Parse the discount voucher information and generate structured rule instructions, wherein the scope of the rule instructions is clearly defined as order level or single item level; For rule instructions whose scope is a single item, the rule instructions generated in step S220 also include an isolation calculation identifier.

9. The payment processing method according to claim 7, characterized in that, The step S320, which involves performing differential calculations on the order items, specifically includes: S321: Identify all item-level rule instructions that contain isolated calculation identifiers and determine the associated items; S322: Based on the identification result of S321, the order products are divided into a first product subset and a second product subset, wherein the first product subset contains all products associated with the single-item level rule instruction; S323: For the first subset of products, only the single-item-level rule instruction associated with it is applied to calculate the price, and the application of membership level discounts is excluded in this calculation; S324: For the second subset of goods, apply applicable rules, including membership level discounts, to calculate the price; S325: Add the calculation results of S323 and S324 to obtain the first intermediate amount.

10. The payment processing method according to claim 7, characterized in that, After successful payment in step S400, the process also includes a consistency post-processing step S500: S510: Atomically update the order status to paid; S520: Atomically update the status of all discount vouchers used in this payment to "verified"; S530: Based on the calculation rules for this payment, add points to the corresponding user account; When the discount voucher being verified originates from an external third-party platform, step S520 further includes: synchronizing the verification result to the third-party platform via an interface call.