Transaction data processing method, apparatus, device, and medium

CN122692091APending Publication Date: 2026-09-04SHANGHAI JIEYIN E-COMMERCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610926433.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-24
Publication Date
2026-09-04

AI Technical Summary

Technical Problem

相关技术中,存在着对交易数据的各种处理需求,然而,在对交易进行特定的数据处理时,每增加一种处理策略都需单独开发对应的数据处理逻辑,导致系统耦合度高,处理灵活性差

Benefits of technology

[0008] In the above-mentioned transaction data processing method, apparatus, equipment, and medium, the following steps are taken: receiving an input data processing request, which carries transaction description data of the transaction to be processed; matching a template filtering script corresponding to the transaction to be processed based on the transaction description data; querying processing reference information for the transaction to be processed based on the transaction description data; inputting the processing reference information into the template filtering script for script calculation to obtain a target template identifier corresponding to the transaction to be processed; and calling the target data processing template corresponding to the target template identifier for data processing to obtain the data processing result of the transaction to be processed. Therefore, this invention provides a novel processing architecture based on scripted dynamic matching and templated precise processing. In this architecture, data processing templates serve as mature and stable core processing units, while template filtering scripts act as flexible and configurable dynamic decision layers. During transaction data processing, after obtaining processing reference information for the transactions to be processed, lightweight script operations are performed through the template filtering script to quickly locate the most suitable target data processing template. The target data processing template then completes the transaction data processing. This allows for the efficient reuse of data processing templates during transaction data processing, ensuring that all rule changes converge to the template filtering script without modifying the underlying data processing template. It reuses long-proven template logic and enables flexible rule configuration through the template filtering script, thereby improving the flexibility of transaction data processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122692091A_ABST
    Figure CN122692091A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of financial technology, and provides a transaction data processing method, device, equipment and medium, wherein a data processing request is received, and the data processing request carries transaction description data of a transaction to be processed; a template filtering script corresponding to the transaction to be processed is matched according to the transaction description data; processing reference information of the transaction to be processed is queried according to the transaction description data; the processing reference information is input into the matched template filtering script for script operation to obtain a target template identifier corresponding to the transaction to be processed; a target data processing template corresponding to the target template identifier is called to perform data processing, and a data processing result of the transaction to be processed is obtained. The present application can be applied to data processing tasks related to a transaction system in the field of financial technology, and can improve the flexibility of transaction data processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of financial technology, and in particular to a transaction data processing method, a transaction data processing device, a computer device, and a computer-readable storage medium. Background Technology

[0002] With the continuous development of the social economy, transaction scenarios are becoming increasingly complex and diverse, and various types of transaction data need to be processed in transaction systems. Related technologies address various processing needs for transaction data; however, when performing specific data processing on transactions, each additional processing strategy requires the separate development of corresponding data processing logic, resulting in high system coupling and poor processing flexibility. Summary of the Invention

[0003] The present invention provides a transaction data processing method, a transaction data processing apparatus, a computer device, and a computer-readable storage medium, which can improve the flexibility of transaction data processing.

[0004] Firstly, a transaction data processing method is provided, including: Receive input data processing requests, which carry transaction description data of the transaction to be processed; Match the template filtering script corresponding to the transaction to be processed based on the transaction description data; Based on the transaction description data, query the processing reference information for the pending transactions; Input the processing reference information into the template filtering script for script calculation to obtain the target template identifier corresponding to the transaction to be processed; The target data processing template corresponding to the target template identifier is invoked to process the data and obtain the data processing result of the transaction to be processed.

[0005] Secondly, a transaction data processing apparatus is provided, comprising: The processing trigger module is used to receive input data processing requests, which carry transaction description data of the transaction to be processed. The script matching module is used to match template filtering scripts corresponding to the transactions to be processed based on the transaction description data; The information query module is used to query processing reference information for pending transactions based on transaction description data; The script execution module is used to input processing reference information into the template filtering script for script calculation to obtain the target template identifier corresponding to the transaction to be processed; The data processing module is used to call the target data processing template corresponding to the target template identifier to process the data and obtain the data processing result of the transaction to be processed.

[0006] Thirdly, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps in the above-described transaction data processing method.

[0007] Fourthly, a computer-readable storage medium is provided, which stores a computer program that, when executed by a processor, implements the steps in the transaction data processing method described above.

[0008] In the above-mentioned transaction data processing method, apparatus, equipment, and medium, the following steps are taken: receiving an input data processing request, which carries transaction description data of the transaction to be processed; matching a template filtering script corresponding to the transaction to be processed based on the transaction description data; querying processing reference information for the transaction to be processed based on the transaction description data; inputting the processing reference information into the template filtering script for script calculation to obtain a target template identifier corresponding to the transaction to be processed; and calling the target data processing template corresponding to the target template identifier for data processing to obtain the data processing result of the transaction to be processed. Therefore, this invention provides a novel processing architecture based on scripted dynamic matching and templated precise processing. In this architecture, data processing templates serve as mature and stable core processing units, while template filtering scripts act as flexible and configurable dynamic decision layers. During transaction data processing, after obtaining processing reference information for the transactions to be processed, lightweight script operations are performed through the template filtering script to quickly locate the most suitable target data processing template. The target data processing template then completes the transaction data processing. This allows for the efficient reuse of data processing templates during transaction data processing, ensuring that all rule changes converge to the template filtering script without modifying the underlying data processing template. It reuses long-proven template logic and enables flexible rule configuration through the template filtering script, thereby improving the flexibility of transaction data processing. Attached Figure Description

[0009] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention 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.

[0010] Figure 1 This is a schematic diagram of the application environment of the transaction data processing method in one embodiment of the present invention; Figure 2 This is a flowchart illustrating a transaction data processing method according to an embodiment of the present invention; Figure 3This is a schematic diagram of the process for identifying the billing method in one embodiment of the present invention; Figure 4 yes Figure 1 Detailed process diagram of S130; Figure 5 This is a schematic diagram of the process for obtaining cost reference information in one embodiment of the present invention; Figure 6 This is a schematic diagram of the processing flow when the query template filtering script indicates success or failure in one embodiment of the present invention; Figure 7 This is a schematic diagram of the structure of a transaction data processing device according to an embodiment of the present invention; Figure 8 This is a schematic diagram of the structure of a computer device according to an embodiment of the present invention. Detailed Implementation

[0011] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0012] The transaction data processing method provided in this embodiment of the invention can be applied to, for example... Figure 1 In the application environment shown, taking the data processing of transactions to determine the handling fee as an example, the client communicates with the server via the network. The server can be a billing server carrying the billing system, and the client can be a business server that directly connects to merchant transactions, such as the transaction system. After a merchant transaction is completed, the client can initiate a fee determination request to the server. This fee determination request carries the transaction description data of the transaction for which the fee is to be determined. After receiving the fee determination request from the client, the server matches the template filtering script corresponding to the transaction for which the fee is to be determined based on the transaction description data; it queries the fee reference information of the transaction for which the fee is to be determined based on the transaction description data; it inputs the fee reference information into the template filtering script for script calculation to obtain the target template identifier corresponding to the transaction for which the fee is to be determined; it calls the target fee determination template corresponding to the target template identifier to determine the handling fee of the transaction for which the fee is to be determined, obtaining the fee determination result of the transaction for which the fee is to be determined; finally, the fee determination result is returned to the client, completing the fee determination.

[0013] Please see Figure 2 As shown, Figure 2 A flowchart illustrating a transaction data processing method provided in an embodiment of the present invention includes the following steps: In S110, an input data processing request is received, which carries transaction description data of the transaction to be processed.

[0014] The following description uses the transaction data processing method provided by this invention as an example, which is executed on the server side and the data processing type is to determine the transaction fee. The server side can be a billing server that carries the billing system, an independently deployed physical server, a virtual server deployed on a cloud platform, or an elastic computing cluster composed of multiple containerized microservices, etc. No specific restrictions are made here.

[0015] A contract plugin is a lightweight, reusable rule-carrying unit within the billing system for the billing contracts signed with merchants. It encapsulates personalized billing-related clauses (such as merchant-specific rates, special offers, and settlement rules) into independent, pluggable plugin modules. This avoids coupling the personalized billing logic of different merchants with the main system flow, achieving the goal of "one plugin per type of contract clause, reusable across multiple merchants, and quickly configurable and effective." Each contract plugin has a unique plugin identifier to identify its unique identity within the billing system.

[0016] In this embodiment of the invention, the client can be a business server that directly connects to merchant transactions, such as a transaction system. The business server can be a standalone physical server, a virtual server deployed on a cloud platform, or an elastic computing cluster composed of multiple containerized microservices, etc., and no specific limitations are made here.

[0017] When the client triggers fee determination, it extracts transaction metadata from the transaction to be determined (i.e., the transaction to be processed), including the acquiring merchant number, platform merchant number, plugin product type, transaction amount / number of transactions, transaction date, transaction number, currency, and fee determination type. In addition, the client identifies the contract plugin bound to the merchant and obtains its plugin identifier. This, along with the obtained transaction metadata, is packaged into a fee determination request (i.e., a data processing request) and sent to the server. The triggering method for fee determination is not specifically limited here; it can be triggered in real-time after a single transaction is completed, or it can be triggered uniformly after daily / batch aggregation, or other methods not mentioned in this embodiment.

[0018] Accordingly, the server will receive a fee confirmation request from the client.

[0019] In S120, the template filtering script corresponding to the transaction to be processed is matched based on the transaction description data.

[0020] The fee determination template is a standardized carrier of fee determination rules in the billing system. It stores and encapsulates scattered fee determination rules (such as fee rate values, calculation methods, upper and lower limit constraints, etc.) in a structured manner. It includes, but is not limited to, basic attribute fields such as template identifier, template effective start time, and template expiration time; calculation rule configuration fields such as fee determination basis, fee determination type, and fee rate mode; fee rate value configuration fields such as handling fee value under fixed amount billing, fee rate ratio under fixed fee rate billing, and tier configuration under tiered billing; and boundary constraint configuration fields such as minimum handling fee per transaction and maximum handling fee per transaction.

[0021] For example, the following is a template for determining a fixed-amount per-transaction fee in JSON format: { "feeId": "FEE2001", "templateName": "Automatic deduction service is charged at 2 yuan per transaction", "billingBase": 2, / / Billing by number of transactions "rateMode": 1, / / Fixed amount "fixedAmount": 200, "minFee": 200, "maxFee": 200, "effectiveTime": "2024-01-01 00:00:00", "expireTime": "2099-12-31 23:59:59" } This means that the template for determining this fee is identified as FEE2001, which is specifically used for direct debit services. A fixed fee of 2 yuan is charged for each transaction, with no room for fluctuation. The minimum and maximum fee are both 2 yuan, and it is valid indefinitely from January 1, 2024.

[0022] The template filtering script is an editable and hot-loadable coded carrier of dynamic cost determination rules. It is the core unit of this invention, carrying multi-dimensional and personalized rate matching logic. It consists of three parts: script variables, conditional judgment logic, and output results. The script variables provide the input parameters upon which the conditional judgment logic depends. The conditional judgment logic implements multi-level, multi-scenario template matching strategies. The output results explicitly return the identifier of the successfully matched template. This allows technical personnel to quickly adjust cost determination rules by writing and modifying the template filtering script without modifying system code or restarting the service.

[0023] After receiving the fee confirmation request, the server first parses out the transaction description data carried in the request and verifies the completeness, format validity, and key field validity of the transaction description data according to the configured verification rules. If the verification fails, a verification failure message is returned and the billing process is terminated. If the verification passes, the server further matches the template filtering script corresponding to the transaction with the fee to be determined based on the transaction description data.

[0024] In S130, based on the transaction description data, query the processing reference information for the transaction to be processed.

[0025] In addition, the server dynamically extracts the corresponding field values ​​from the transaction description data based on the script variables defined in the matching template filtering script, and queries the fee reference information (i.e. processing reference information) of the transaction to be determined based on the field value. This fee reference information is used as a script variable.

[0026] For example, if the script variable is "merchant level," the server extracts the platform merchant number from the transaction description data and uses it to query the merchant level database to obtain the merchant's current level. If the script variable is "transaction date," the server directly retrieves the transaction date field value already present in the transaction description data. If the script variable is the issuing bank, the server extracts the transaction order number from the transaction description data and uses it to query the issuing bank database to obtain the issuing bank code corresponding to the transaction, and so on. It should be noted that this example only uses a single script variable. In practical applications, script variables are not limited to a single field; often, multiple variables need to be combined for judgment, such as "merchant level + transaction date + issuing bank," etc.

[0027] In S140, the processing reference information is input into the template filtering script for script calculation to obtain the target template identifier corresponding to the transaction to be processed.

[0028] Accordingly, after obtaining the cost reference information, the server passes this cost reference information as a script variable to the script engine. The script engine then executes the conditional judgment logic in the matching template filtering script, and finally outputs the identifier of the successfully matched template, which is recorded as the target template identifier. It should be noted that in this embodiment of the invention, the selection of the script engine is not limited, and can be flexibly selected according to the syntax characteristics and execution efficiency of the matching template filtering script.

[0029] In S150, the target data processing template corresponding to the target template identifier is called to process the data and obtain the data processing result of the transaction to be processed.

[0030] Please refer to Figure 3After obtaining the target template identifier corresponding to the transaction with the fee to be determined, the server first determines the fee determination template associated with the target template identifier, which is denoted as the target fee determination template, and verifies the validity of the target fee determination template, including but not limited to existence verification, validity period verification, legality verification of the basis for fee determination, and matching verification of fee determination type.

[0031] The validation checks include: Existence Check: This checks whether the target cost determination template associated with the target template identifier exists. If it does not exist, the default general cost determination template is returned, and an alarm is triggered to notify relevant technical personnel to investigate invalid template identifier issues. Validity Check: This checks whether the transaction time of the transaction for which the cost to be determined is within the effective period of the template cost determination template. Expired templates are directly intercepted, and a template of the same type is returned for replacement, preventing the misuse of historical expiration rules. Cost Determination Basis Legality Check: This checks whether the cost determination basis (transaction amount / number of transactions) configured in the target cost determination template matches the transaction description data passed in this cost determination request. For example, a cost determination template that determines costs by the number of transactions must pass the number of transactions to avoid calculation errors due to missing parameters. Cost Determination Type Matching Check: This checks whether the cost determination type (single-transaction billing / periodic billing) of the target cost determination template matches the transaction description data passed in this cost determination request. For example, a single-transaction billing template only supports single-transaction billing scenarios and cannot be used for periodic batch transaction billing to avoid cost determination type mismatch.

[0032] After all validity checks pass, the server further identifies the basis for determining the cost of the target cost template, including two categories: transaction amount-based billing and transaction count-based billing. Transaction amount-based billing is applicable to most common transaction scenarios, with the cost determination parameter being the transaction amount of the billed transaction. Transaction count-based billing is applicable to scenarios where costs are calculated per transaction, such as direct debit and bulk transfers. Regardless of the amount of a single transaction, a fixed fee is charged per transaction, with the calculation parameter being the number of transactions for which the cost is to be determined.

[0033] When the target fee determination template adopts the transaction count billing method, the number of transactions of the transaction to be determined is further extracted from the transaction description data and substituted into the target fee determination template to determine the fee amount.

[0034] When determining the target fee determination template using transaction amount as the billing method, the specific fee rate model is further identified, including three categories: fixed amount billing, fixed rate billing, and tiered billing. Fixed amount billing refers to charging a fixed fee regardless of the transaction amount. The fee determination parameter can be the transaction amount of the transaction for which the fee is to be determined, or it can be null, as it only serves as a placeholder in the parsing process of the target fee determination template and does not participate in the actual amount calculation. This is suitable for low-amount, high-frequency trading scenarios. Fixed rate billing calculates the fee based on the transaction amount multiplied by the rate. The fee determination parameter is the transaction amount of the transaction for which the fee is to be determined. This is suitable for most regular trading scenarios. Tiered billing first determines the rate tier to which the transaction amount belongs, and then matches the corresponding rate tier for calculation. This can be either full progressive (the entire transaction amount is calculated according to the corresponding rate tier) or excess progressive (only the portion exceeding the lower threshold is calculated according to the higher rate tier). This is suitable for large transactions or transaction scenarios requiring differentiated pricing.

[0035] As can be seen from the above, regardless of the transaction amount billing method used in the target fee determination template, the server can extract the transaction amount of the transaction for which the fee to be determined is from the transaction description data, use it as a fee determination parameter, and substitute it into the target fee determination template to determine the fee amount.

[0036] As described above, after determining the transaction fee amount for the transaction to be determined, the server further verifies the validity of the obtained fee amount, including but not limited to non-negative verification, upper and lower limit verification, and parameter consistency verification. Among them, non-negative verification ensures that the fee amount is not lower than zero, upper and lower limit verification ensures that the fee amount is between the minimum and maximum fee amounts preset in the target fee determination template, and parameter consistency verification, for the transaction count billing method, ensures that the number of transactions is completely consistent with the number extracted from the fee determination parameters, avoiding billing deviations due to abnormal parameters.

[0037] After the validity of the handling fee amount is verified, the server generates a fee determination result (i.e., data processing result) that includes at least the handling fee amount. Additionally, the fee determination result may include key billing metadata such as the target template identifier and fee determination parameters. Furthermore, in the event of billing failure, the server can generate a fee determination result that includes at least an error code and error message. The error code identifies the type of exception that occurred during the billing process, while the error message describes the specific reason for the exception, such as "fee determination template not matched," "parameter missing," or "verification failed," etc.

[0038] As can be seen from the above, the transaction data processing method provided by the present invention involves receiving an input data processing request, which carries transaction description data of the transaction to be processed; matching a template filtering script corresponding to the transaction to be processed based on the transaction description data; querying processing reference information of the transaction to be processed based on the transaction description data; inputting the processing reference information into the template filtering script for script calculation to obtain a target template identifier corresponding to the transaction to be processed; and calling the target data processing template corresponding to the target template identifier for data processing to obtain the data processing result of the transaction to be processed. Therefore, this invention provides a novel processing architecture based on scripted dynamic matching and templated precise processing. In this architecture, data processing templates serve as mature and stable core processing units, while template filtering scripts act as flexible and configurable dynamic decision layers. During transaction data processing, after obtaining processing reference information for the transaction to be processed, lightweight script calculations are performed through the template filtering script to quickly locate the most suitable target data processing template. The target data processing template then completes the transaction data processing. This allows for the efficient reuse of data processing templates during transaction data processing, ensuring that all rule changes converge to the template filtering script without modifying the underlying data processing template. It reuses long-proven template logic and achieves flexible rule configuration through the template filtering script, thereby enhancing the flexibility of transaction data processing.

[0039] Optionally, in one embodiment, processing reference information is input into a template filtering script for script calculation to obtain a target template identifier corresponding to the transaction to be processed, including: The script engine parses the multi-condition branch rules of the matching template filtering script, and uses the processing reference information as a script variable to successively substitute into each condition branch of the multi-condition branch rule for rule judgment until the first condition branch that meets the conditions is matched, and the template identifier corresponding to the first condition branch that meets the conditions is used as the target template identifier.

[0040] In this embodiment of the invention, the condition judgment logic of the template filtering script adopts a multi-condition branch structure design to ensure the accuracy and maintainability of rule matching in complex business scenarios.

[0041] For example, the following is a template filtering script: #if($pcFlag == "01"&&$cardType == "01") 1001 #elseif($pcFlag == "01"&&$cardType == "02") 1002 #elseif($pcFlag == "02") 1003 #else 1004#end The meaning of this template filtering script is as follows: when the public-to-private identifier (pcFlag) is "01" and the card type (cardType) is "01", it matches template identifier 1001; when the public-to-private identifier (pcFlag) is "01" and the card type (cardType) is "02", it matches template identifier 1002; when the public-to-private identifier (pcFlag) is "02", it matches template identifier 1003; in all other cases, it matches the default template identifier 1004.

[0042] Accordingly, when performing script operations, the server first parses the multi-condition branch rules of the matching template filtering script through the script engine, and substitutes the obtained cost reference information as script variables into each condition branch layer by layer for rule judgment until the first condition branch that meets the conditions is matched, and the template identifier corresponding to the condition branch is used as the target template identifier.

[0043] For example, in the template filtering script shown above, when the public-to-private identifier is "01" and the card type is "02" in the fee reference information, the server first parses the multi-condition branch rules of the template filtering script through the script engine, assigns "01" to the variable $pcFlag and "02" to the variable $cardType, and then executes the condition judgment in sequence: the first branch is skipped because $cardType is not "01", the second branch is successfully matched because $pcFlag is "01" and $cardType is "02", and returns the template identifier 1002 corresponding to the branch. The template identifier 1002 is then used as the target template identifier for accurate matching and fee calculation of the subsequent fee determination template.

[0044] Optionally, in one embodiment, the transaction data processing method provided by the present invention further includes: Receive the input script update request, and update the multi-condition branching rules of the specified template filtering script according to the script update request.

[0045] In this embodiment of the invention, the multi-condition branch rules of the template filtering script can be updated, including adding, deleting or modifying condition branches at any level, thereby realizing the dynamic adjustment of the rate strategy.

[0046] For example, when adding new activity-related rules, such as holiday promotions, new merchant discounts, or subsidies for specific channels, simply add conditional branches for activity validity period, merchant scope, and channel scope to the template filtering script, pointing to the corresponding fee determination template. When adding personalized merchant rules, such as exclusive rates negotiated with top merchants or customized fee determination rules for merchants in special industries, simply add conditional branches for merchant number and merchant level to the template filtering script, pointing to the corresponding fee determination template. When adding channel rules, such as new bank channel discounts or new card type fee determination rules, simply add conditional branches for issuing bank and card type to the script.

[0047] Accordingly, when the server receives an input script update request, it first identifies the template filtering script specified in the update request, denoted as the template filtering script to be updated. Then, it parses the existing multi-condition branching rules and updates the corresponding level of condition branches based on the add, delete, or modify instructions in the script update request, ultimately obtaining the updated template filtering script. The script update request can be initiated by relevant technical personnel through the management backend, or it can be automatically triggered by the server according to preset strategies, and so on.

[0048] Alternatively, in one embodiment, please refer to Figure 4 Based on the transaction description data, query the processing reference information for the pending transactions, including: In S1310, based on the transaction description data, the flexible billing extension information of the pending transaction is queried from the transaction middleware; the flexible billing extension information is obtained by the transaction middleware aggregating relevant transaction context information according to business needs; In S1320, if the query for flexible billing extension information is successful, the queried flexible billing extension information will be used as processing reference information. In S1330, if the query for flexible billing extension information fails, the transaction channel information of the transaction to be processed is queried from the transaction channel gateway based on the transaction description data, and the queried transaction channel information is used as the processing reference information.

[0049] This invention provides an optional method for obtaining cost reference information.

[0050] The transaction middleware is a context aggregation layer independent of the core billing logic. Located between the transaction core and the billing service, it connects upstream to multiple transaction link nodes such as the transaction channel gateway, merchant management system, marketing system, and risk control system, and downstream to the billing system. It is responsible for collecting, standardizing, and caching transaction context information at the time of a transaction, including but not limited to: channel-level information from the transaction channel gateway (product type, corporate / individual identification, issuing bank, card type, transaction amount, transaction time, channel identification, etc.); merchant-level information from the merchant management system (merchant level, merchant industry, merchant contract package, plugin identification of bound contract plugins, cumulative transaction amount, etc.); marketing-level information from the marketing system (activity identification, discount tier, remaining discount amount, etc.); and risk-control-level information from the risk control system (risk level, whitelist identification, abnormal transaction identification, etc.). This multi-source, heterogeneous context information is uniformly cleaned, tagged, and serialized by the transaction middleware, and then aggregated into structured, scalable, and flexible billing extension information according to business needs, and bound to the transaction number for querying.

[0051] It should be noted that, compared to transaction channel information, which is an inherent attribute of transactions, flexible billing extended information is an extended business feature related to transactions. Transaction channel information is used to support the determination of basic fee rules and is a necessary basic field for all transaction billing, while flexible billing extended information is used to support the determination of various personalized and refined fee rules and is an extended field for achieving differentiated rates and flexible operation.

[0052] Please refer to the reference. Figure 5 In this embodiment of the invention, the server first extracts the transaction number of the transaction with the pending fee from the transaction description data and initiates a query by calling the query interface of the transaction middleware. If a flexible billing extension information matching the pending fee is successfully found, the found flexible billing extension information is used as the fee reference information to realize differentiated billing logic. If no flexible billing extension information matching the pending fee is found, the server initiates a query by calling the query interface of the transaction channel gateway based on the transaction number of the pending fee to obtain the transaction channel information of the pending fee as the fee reference information to realize the basic billing logic as a fallback.

[0053] For example, the following is a template filtering script: #if($ext.merchantLevel=="A") ##Exclusive Fee Rates for Grade A Merchants #set($feeId="FEE1001") #elseif($ext.monthTradeAmount>1000000) ## Discount rate for monthly cumulative spending of 100,000 or more #set($feeId="FEE1002") #elseif($ext.activityId=="ACT202606") ##Discount Rates During June Promotions #set($feeId="FEE1003") #elseif($channel.productType=="SCAN_PAY") #set($feeId="FEE2001")## Standard QR code payment fee rate #else #set($feeId="FEE9999")##General guarantee fee rate #end The meaning of the above template filtering script is as follows: when the merchant level is A, template identifier FEE1001 is matched; if it is not A but the monthly transaction volume exceeds one million, template identifier FEE1002 is matched; if it does not reach one million but participates in the June special event, template identifier FEE1003 is matched; if it does not participate in the event but the payment method is QR code payment, template identifier FEE2001 is matched; all other uncovered cases are uniformly matched with the fallback template identifier FEE9999. This template filtering script also supports the combined judgment of flexible billing extended information such as merchant level, monthly transaction volume, and event period, as well as transaction channel information such as transaction channel type. Even if flexible billing extended information cannot be found, fallback billing can still be completed through channel type, ensuring that each transaction has a clear fee rate, thereby realizing differentiated billing logic based on flexible billing extended information and basic billing logic based on transaction channel information.

[0054] The above two-tiered billing strategy, which prioritizes extended information in flexible billing and uses transaction channel information as a fallback, ensures both the flexibility and robustness of the billing strategy while avoiding billing interruptions due to missing extended information.

[0055] Alternatively, in one embodiment, please refer to Figure 6 The script matches the corresponding template based on the transaction description data, including: In S1210, the template filtering script identifier corresponding to the transaction description data is queried from the preset relationship configuration; In S1220, if a template filter script identifier is found, the template filter script indicated by the template filter script identifier is used as the matching template filter script. In S1230, if no template filtering script identifier is found, but a template identifier corresponding to the transaction description data is found, the template identifier corresponding to the transaction description data is used as the target template identifier, and the process proceeds to S150.

[0056] In this embodiment of the invention, the server is pre-configured with a relationship configuration. This relationship configuration uses key fields in the transaction description data as index keys and maps them to the corresponding template filtering script identifier or template identifier. The selection of key fields is not limited here. For example, it can be a combination of dimensions such as merchant number (acquiring merchant number / platform merchant number), product type, and plugin identifier.

[0057] Accordingly, in this embodiment of the invention, the server first extracts key fields from the transaction description data, and then uses these key fields as index keys to query the relation configuration for matching template filtering script identifiers or template identifiers. If a matching template filtering script identifier is found, it is used as the matching template filtering script identifier, and the template filtering script indicated by the matching template filtering script identifier is used as the matching template filtering script. Based on the transaction description data, the server queries the fee reference information for the transaction to be determined. The fee reference information is then input into the matching template filtering script for script calculation to obtain the target template identifier corresponding to the transaction to be determined. Finally, the server calls the target fee determination template corresponding to the target template identifier for billing calculation to obtain the fee determination result for the transaction to be determined. The detailed process of how the matching template filtering script ultimately obtains the fee determination result for the transaction to be determined is not described here; please refer to the relevant descriptions in the above embodiments for details.

[0058] Furthermore, if no matching template filtering script identifier is found, but a template identifier corresponding to the transaction description data is found, the server directly uses this template identifier as the target template identifier and calls its corresponding target fee to determine the template for billing and accounting. Similarly, the process of using the target fee to determine the template for billing and accounting will not be described in detail here; please refer to the relevant descriptions in the above embodiments for details.

[0059] In other embodiments, if no matching template filtering script identifier is found, nor is a template identifier corresponding to the transaction description data found, the default fee rate rule is triggered. That is, a preset global default fee determination template is used for billing calculation to ensure the robustness of the billing process and business continuity. The specific configuration of the global default fee determination template is not limited here and can be flexibly configured according to the business scenario; for example, it can be set to a fixed fee rate.

[0060] Through the above dual-path billing mechanism, when facing complex transaction scenarios, it can accurately match personalized fee logic and ensure uninterrupted billing, thus balancing the flexibility and stability of billing.

[0061] In one embodiment, the present invention provides a transaction data processing apparatus, which corresponds one-to-one with the transaction data processing methods described in the above embodiments. For example... Figure 7 As shown, the transaction data processing device includes a processing trigger module 210, a script matching module 220, an information query module 230, a script execution module 240, and a data processing module 250. Detailed descriptions of each functional module are as follows: The processing trigger module 210 is used to receive input data processing requests, which carry transaction description data of the transaction to be processed. The script matching module 220 is used to match template filtering scripts corresponding to the transactions to be processed based on the transaction description data; The information query module 230 is used to query the processing reference information of the pending transaction based on the transaction description data; The script execution module 240 is used to input the processing reference information into the template filtering script for script calculation to obtain the target template identifier corresponding to the transaction to be processed. The data processing module 250 is used to call the target data processing template corresponding to the target template identifier to perform billing calculation and obtain the data processing result of the transaction to be processed.

[0062] Optionally, in one embodiment, the information query module 230 is used to query the flexible billing extension information of the transaction to be processed from the transaction middleware according to the transaction description data; the flexible billing extension information is obtained by the transaction middleware aggregating relevant transaction context information according to business needs; and the queried flexible billing extension information is used as processing reference information.

[0063] Optionally, in one embodiment, the information query module 230 is further configured to query the transaction channel information of the transaction to be processed from the transaction channel gateway based on the transaction description data when the query for flexible billing extension information fails; and to use the queried transaction channel information as processing reference information.

[0064] Optionally, in one embodiment, the script execution module 240 is used to parse the multi-condition branch rules of the template filtering script through the script engine, and use the processing reference information as script variables to sequentially substitute into each condition branch of the multi-condition branch rules for rule judgment until the first condition branch that meets the conditions is matched, and use the template identifier corresponding to the first condition branch that meets the conditions as the target template identifier.

[0065] Optionally, in one embodiment, the transaction data processing apparatus provided by the present invention further includes a script update module, which is used to receive an input script update request and update the multi-condition branching rules of the specified template filtering script to be updated according to the script update request.

[0066] Optionally, in one embodiment, the script matching module 220 is used to query the template filtering script identifier corresponding to the transaction description data from the preset relationship configuration; and to use the template filtering script indicated by the template filtering script identifier as the template filtering script.

[0067] Optionally, in one embodiment, the data processing module 250 is further configured to, when no template filtering script identifier is found, but a template identifier corresponding to the transaction description data is found, use the template identifier corresponding to the transaction description data as the target template identifier, and call the target data processing template corresponding to the target template identifier to perform data processing, so as to obtain the data processing result of the transaction to be processed.

[0068] As described above, the transaction data processing device provided by this invention receives input data processing requests through a processing trigger module 210, which carries transaction description data of the transaction to be processed; a script matching module 220 matches a template filtering script corresponding to the transaction to be processed based on the transaction description data; an information query module 230 queries processing reference information for the transaction to be processed based on the transaction description data; a script execution module 240 inputs the processing reference information into the template filtering script for script calculation to obtain a target template identifier corresponding to the transaction to be processed; and a data processing module 250 calls the target data processing template corresponding to the target template identifier to perform data processing and obtain the data processing result of the transaction to be processed. Therefore, this invention provides a new processing architecture based on scripted dynamic matching and templated precise processing. The data processing template is used as a mature and stable core processing unit, and the template filtering script is used as a flexible and configurable dynamic decision layer. This allows all rule changes to converge completely to the template filtering script without modifying the underlying data processing template. It reuses the long-proven template logic and achieves flexible rule configuration through the template filtering script, thereby improving the flexibility of transaction data processing.

[0069] Specific limitations regarding the transaction data processing device can be found in the limitations of the transaction data processing method described above, and will not be repeated here. Each module in the aforementioned transaction data processing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0070] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 8As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile and / or volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface is used to communicate with external clients via a network connection. When the computer program is executed by the processor, it implements the steps of the transaction data processing method described in the above embodiments.

[0071] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the transaction data processing method described in the above embodiment, such as: Receive input data processing requests, which carry transaction description data of the transaction to be processed; Match the template filtering script corresponding to the transaction to be processed based on the transaction description data; Based on the transaction description data, query the processing reference information for the pending transactions; Input the processing reference information into the template filtering script for script calculation to obtain the target template identifier corresponding to the transaction to be processed; The target data processing template corresponding to the target template identifier is invoked to process the data and obtain the data processing result of the transaction to be processed.

[0072] In one embodiment, a computer-readable storage medium is provided, which stores a computer program that, when executed by a processor, implements the steps of the transaction data processing method described in the above embodiments, such as: Receive input data processing requests, which carry transaction description data of the transaction to be processed; Match the template filtering script corresponding to the transaction to be processed based on the transaction description data; Based on the transaction description data, query the processing reference information for the pending transactions; Input the processing reference information into the template filtering script for script calculation to obtain the target template identifier corresponding to the transaction to be processed; The target data processing template corresponding to the target template identifier is invoked to process the data and obtain the data processing result of the transaction to be processed.

[0073] It should be noted that the functions or steps that can be implemented by the computer-readable storage medium or computer device described above can be referred to the relevant descriptions on the server side and client side in the foregoing method embodiments. To avoid repetition, they will not be described one by one here.

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

[0075] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0076] It should be noted that if any AI models, software tools, or components not belonging to this company appear in the embodiments of this invention, they are merely illustrative examples and do not represent actual use. All user personal information involved in the embodiments of this invention is authorized (with the knowledge and consent) by the relevant parties or fully authorized by all parties, and the executing entity may obtain it through various legal and compliant means. The collection, storage, use, processing, transmission, provision, and disclosure of the information, data, and signals involved all comply with relevant laws and regulations and do not violate public order and good morals.

[0077] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.

Claims

1. A method for processing transaction data, characterized in that, include: Receive an input data processing request, the data processing request carrying transaction description data of the transaction to be processed; Match the template filtering script corresponding to the transaction to be processed based on the transaction description data; Based on the transaction description data, query the processing reference information for the pending transaction; The processing reference information is input into the template filtering script for script operation to obtain the target template identifier corresponding to the transaction to be processed. The target data processing template corresponding to the target template identifier is invoked to process the data, and the data processing result of the transaction to be processed is obtained.

2. The transaction data processing method according to claim 1, characterized in that, Based on the transaction description data, query the processing reference information for the pending transaction, including: Based on the transaction description data, the flexible billing extension information of the pending transaction is queried from the transaction middleware; the flexible billing extension information is obtained by the transaction middleware by aggregating relevant transaction context information according to business needs; The retrieved flexible billing extension information will be used as the processing reference information.

3. The transaction data processing method according to claim 2, characterized in that, After querying the flexible billing extension information of the pending transaction from the transaction middleware based on the transaction description data, the process further includes: If the query for the flexible billing extension information fails, the transaction channel information of the pending transaction is queried from the transaction channel gateway based on the transaction description data. The transaction channel information obtained from the query will be used as the processing reference information.

4. The transaction data processing method according to claim 1, characterized in that, The step of inputting the processing reference information into the template filtering script for script operation to obtain the target template identifier corresponding to the transaction to be processed includes: The script engine parses the multi-condition branch rules of the template filtering script, and uses the processing reference information as a script variable to sequentially substitute into each condition branch of the multi-condition branch rule for rule judgment until the first condition branch that meets the conditions is matched, and the template identifier corresponding to the first condition branch that meets the conditions is used as the target template identifier.

5. The transaction data processing method according to claim 4, characterized in that, Also includes: Receive the input script update request, and update the multi-condition branching rules of the specified template filtering script according to the script update request.

6. The transaction data processing method according to claim 1, characterized in that, The step of matching the corresponding template filtering script based on the transaction description data includes: Query the template filtering script identifier corresponding to the transaction description data from the preset relationship configuration; The template filtering script indicated by the template filtering script identifier shall be used as the template filtering script.

7. The transaction data processing method according to claim 6, characterized in that, After querying the template filtering script identifier corresponding to the transaction description data from the preset relationship configuration, the method further includes: If the template filtering script identifier is not found, but a template identifier corresponding to the transaction description data is found, then the template identifier corresponding to the transaction description data is used as the target template identifier, and the process proceeds to the step of calling the target data processing template corresponding to the target template identifier to process the data and obtain the data processing result of the transaction to be processed.

8. A data processing apparatus, characterized in that, include: The processing trigger module is used to receive input data processing requests, which carry transaction description data of the transaction to be processed; The script matching module is used to match a template filtering script corresponding to the transaction to be processed based on the transaction description data; The information query module is used to query the processing reference information of the pending transaction based on the transaction description data; The script execution module is used to input the processing reference information into the template filtering script to perform script calculations and obtain the target template identifier corresponding to the transaction to be processed. The data processing module is used to call the target data processing template corresponding to the target template identifier to perform data processing and obtain the data processing result of the transaction to be processed.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the transaction data processing method as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the transaction data processing method as described in any one of claims 1 to 7.