Commission settlement method, device and equipment and storage medium
By creating wide tables in the remuneration settlement system and using the Drools rule engine for data classification and settlement, the problem of duplicate data loading was solved, achieving efficient resource utilization and improved settlement speed.
Patent Information
- Application Number
- CN202211562116.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-07
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2042-12-07
AI Technical Summary
The existing remuneration settlement system suffers from data duplication during data processing, resulting in low resource utilization and slow settlement speed.
By creating wide tables, settlement operations are performed according to business types, reducing the number of data loading operations. Furthermore, by adopting centralized business management rules and utilizing the Drools rule engine to settle wide table data, settlement efficiency is improved.
This reduces redundant data loading, improves resource utilization and settlement speed, and enhances the efficiency of data settlement.
Smart Images

Figure CN116957825B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a method, apparatus, device and storage medium for payment settlement. Background Technology
[0002] After years of development, competition in the mobile communications industry has become increasingly fierce, and channel distributors have become a key point of competition. As a result, paying distributors commissions has emerged as a major incentive.
[0003] Existing remuneration settlement systems convert configured policy data into a data model for the settlement capability platform. However, this technology loads duplicate settlement base data for each task during the settlement process, resulting in low cluster resource utilization, reduced resources available for settlement, and slower settlement speed. Furthermore, the excessive number of data processing jobs and the need to restart and stop these jobs also waste settlement time. Summary of the Invention
[0004] This application provides a method, apparatus, device, and storage medium for remuneration settlement, which can solve the problem of excessive data processing and low settlement efficiency caused by repeated loading of settlement operation data during the remuneration settlement process.
[0005] In a first aspect, embodiments of this application provide a remuneration settlement method, the method comprising: receiving a settlement request sent by a user terminal, the settlement request including a settlement data identifier; obtaining corresponding configuration information from a big data management database associated with the user terminal according to the settlement data identifier, parsing all subsidiary tables corresponding to the business master table in the configuration information, and the association relationship between the business master table and each subsidiary table, obtaining corresponding wide table data from the big data management database according to the configuration information, the wide table data including all subsidiary table information corresponding to the business master table, and the association relationship between the business master table and each subsidiary table; obtaining corresponding settlement rule information from the big data management database associated with the user terminal according to the settlement data identifier, the settlement rule information including a two-dimensional table data model of settlement rules and rule settlement conditions, converting the two-dimensional table data model into a first rule using a rule adaptation program; and starting a settlement job from the task scheduling status table of the big data management database according to the first rule, the settlement job using the rule engine in the first rule to settle each piece of data in the wide table data, and outputting settlement result data.
[0006] In one feasible implementation, before retrieving the corresponding wide table data from the big data management database based on the configuration information, the method further includes: retrieving historical wide table data from the big data management database, whereby the historical wide table data includes information on all historical subsidiary tables corresponding to multiple historical business master tables, as well as the relationships between the multiple historical business master tables and each historical subsidiary table; if historical wide table data corresponding to the configuration information exists in the big data management database, and the historical business master tables and historical subsidiary table data in the historical wide table data have not changed, then the historical wide table data is used as the wide table data; if historical wide table data corresponding to the configuration information exists in the big data management database, and the historical business master tables and historical subsidiary table data in the historical wide table data have changed, or if historical wide table data corresponding to the configuration information does not exist in the big data management database, then a wide table creation task is initiated to create the wide table data; and the wide table data is updated in the big data management database.
[0007] In one feasible implementation, the process of initiating a wide table creation task to create wide table data includes: reading configuration information, parsing all subsidiary tables corresponding to the business master table in the configuration information, and the relationships between the business master table and each subsidiary table; obtaining the master table identifier of the business master table; obtaining the corresponding full set of subsidiary tables based on the master table identifier, the full set of subsidiary tables including condition subsidiary tables, object subsidiary tables, and cardinality subsidiary tables; obtaining the set of related table information based on the master table identifier, the set of related table information including the main configuration table, the account and main relationship table, the master-subsidiary table field relationship table, and the master-subsidiary table relationship table; obtaining the intersection of the full set of subsidiary tables and the set of related table information to obtain the valid subsidiary tables; dividing the valid subsidiary tables into groups of M, generating temporary SQL statement tables according to the division order, and writing them into the task queue; reading the wide table SQL table creation statements from the task queue according to the task execution thread of the wide table creation task, wherein the wide table creation task executes multiple temporary SQL statement tables sequentially to obtain wide table data; and updating the wide table data to the big data management database.
[0008] In one feasible implementation, a rule adaptation program is used to transform the two-dimensional table data model into a first rule. The first rule includes rule information and settlement output information. The rule information includes at least range conditions, remuneration conditions, and settlement conditions. The range conditions are used to filter the data corresponding to the first rule, and the remuneration conditions are used to determine whether to settle the data.
[0009] In one feasible implementation, the settlement job is initiated from the task scheduling status table of the big data management library according to the first rule, which also includes: reading the first rule and creating an executor; and loading the wide table data into the database of the settlement system.
[0010] In one feasible implementation, the settlement operation uses the rule engine in the first rule to settle each piece of data in the wide table data, including: outputting data with a one-to-one correspondence with settlement rules to obtain a settlement result data; splitting a piece of data into multiple sub-data according to the correspondence between a piece of data and multiple settlement rules, and outputting the sub-data with a one-to-one correspondence with settlement rules to obtain multiple settlement result data.
[0011] In one feasible implementation, the settlement rule information includes a two-dimensional table data model of settlement rules and rule settlement conditions. The two-dimensional table data model is transformed into a first rule using a rule adaptation program. Before that, each settlement rule is assigned a type identifier. The type identifier includes a normal settlement identifier and a special settlement identifier. The special settlement identifier includes: capping, advanced conditions, issuance rules, and segmentation.
[0012] In one feasible implementation, the settlement task uses the rule engine in the first rule to settle each piece of data in the wide table and outputs the settlement result data. The settlement result data includes unsettled data and settled data. After the step of outputting the settlement result data, there is also a step of processing the unsettled data and the settled data respectively. The processing steps include: obtaining the reason for the unsettled data, adding settlement standard information, and then outputting it to the settlement result table; if the settled data has a normal settlement identifier, then cleaning and structural mapping of the settled data, and outputting it to the settlement result table; if the settled data has a special settlement identifier, then using a settlement job to settle the settled data to obtain special settlement result data, cleaning and structural mapping of the special settlement result data, and outputting it to the settlement result table.
[0013] In one feasible implementation, the settlement task uses the rule engine in the first rule to settle each piece of data in the wide table data and outputs settlement result data. It also includes: obtaining settlement version information to distinguish settlement result data, wherein the settlement version information is generated during the settlement process; and synchronizing the settlement result data to the report library.
[0014] In one feasible implementation, outputting settlement result data also includes synchronizing the settlement result data to a report library.
[0015] Secondly, embodiments of this application provide a remuneration settlement device, which includes a data management module, a data preparation module, a rule adaptation module, and a remuneration settlement module. The data management module receives a settlement request sent by a user terminal, the settlement request including a settlement data identifier. The data preparation module retrieves corresponding configuration information and settlement rule information from a big data management database associated with the user terminal based on the settlement data identifier, parses all subsidiary tables corresponding to the main business table in the configuration information, and the relationships between the main business table and each subsidiary table, and retrieves corresponding wide table data from the big data management database based on the configuration information. The wide table data includes all subsidiary table information corresponding to the main business table, and the relationships between the main business table and each subsidiary table. The rule adaptation module retrieves corresponding settlement rule information from the big data management database associated with the user terminal based on the settlement data identifier. The settlement rule information includes a two-dimensional table data model of the settlement rule and the rule settlement conditions, and uses a rule adaptation program to convert the two-dimensional table data model into a first rule. The remuneration settlement module initiates a settlement operation from the task scheduling status table of the big data management database according to the first rule. The settlement operation uses the rule engine in the first rule to settle each piece of data in the wide table data and outputs the settlement result data.
[0016] In one feasible implementation, the device further includes: a data synchronization module for acquiring settlement version information and for distinguishing settlement result data, wherein the settlement version information is generated during the settlement process and the settlement result data is synchronized to the report database.
[0017] Thirdly, embodiments of this application provide a remuneration settlement device, the device including: a processor and a memory storing computer program instructions, wherein the processor executes the computer program instructions to implement the remuneration settlement method as described in the first aspect.
[0018] Fourthly, embodiments of this application provide a computer storage medium on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the remuneration settlement method as described in the first aspect is implemented.
[0019] The remuneration settlement method, apparatus, device, and storage medium of this application have at least the following beneficial effects: This application creates wide table data and classifies settlement data according to business type. One settlement operation is started for each business type, which reduces the number of data loadings and avoids the waste of a lot of memory resources by repeatedly loading data. At the same time, the centralized management rules of business are used as settlement rules, which improves the efficiency of data settlement. Attached Figure Description
[0020] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 This is a schematic diagram illustrating an application scenario of the remuneration settlement method provided in some embodiments of this application;
[0022] Figure 2 This is a flowchart illustrating a remuneration settlement method provided in some embodiments of this application;
[0023] Figure 3 yes Figure 2 A flowchart illustrating the specific implementation of the S200;
[0024] Figure 4 yes Figure 3 A flowchart illustrating the specific implementation of S230 in China;
[0025] Figure 5 yes Figure 2 A flowchart illustrating the specific implementation of the S400 in China;
[0026] Figure 6 This is a schematic diagram of the structure of a remuneration settlement device provided in some embodiments of this application;
[0027] Figure 7 This is a schematic diagram of the structure of a remuneration settlement device provided in some embodiments of this application. Detailed Implementation
[0028] The features and exemplary embodiments of various aspects of this application will be described in detail below. To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain this application and not to limit it. For those skilled in the art, this application can be implemented without some of these specific details. The following description of the embodiments is merely to provide a better understanding of this application by illustrating examples.
[0029] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element.
[0030] The Rete algorithm is an algorithm that matches facts with rules. Common pattern matching algorithms include RETE, LFA, TREAI, and LEAPS. The Rete algorithm is currently the most efficient deductive reasoning algorithm, and many rule engines are based on the Rete algorithm for reasoning calculations.
[0031] The Rete matching algorithm is an efficient method for comparing large sets of patterns and large sets of objects. It finds all objects and rules that match each pattern through network filtering. Its core idea is to dynamically construct a matching tree based on the content of the separated matches, thus significantly reducing computational cost. The Rete algorithm can be divided into two parts: rule compilation and runtime execution. Rule compilation refers to the process of generating an inference network based on the rule set, while runtime execution refers to the process of feeding data into the inference network for filtering.
[0032] A typical business table design will include a main business table and several related sub-business tables.
[0033] When the Rete algorithm makes fact assertions, it consists of three phases: matching, selection, and execution, known as the match-select-actcycle.
[0034] The generation process of the RETE inference network is as follows: One rule is selected from the rule set {Rule 1, Rule 2, ...} and, according to a specific algorithm, becomes a node in the RETE inference network. This process is repeated until all rules are processed, thus generating the RETE inference network. The RETE network mainly consists of two parts: the alpha network and the beta network.
[0035] Drools, a centralized business rule management engine, is an open-source business rule engine based on the Rete algorithm. Drools is divided into two main parts: compilation and runtime. Compilation involves parsing the rule description file according to the syntax of the open-source ANTLR3 language recognizer, checking the syntax for correctness, and then generating an intermediate structure called "descr." The descrut uses an Abstract Syntax (AST) to describe the rules. Currently, Drools supports four rule description file types: drl, xls, brl, and dsl. The most commonly used are drl and xls files, with xls files being easier to maintain, more intuitive, and more easily understood by business users. Runtime involves passing the AST to the PackageBuilder, which generates a RuleBase containing one or more Package objects.
[0036] The Rete algorithm in Drools is called ReteOO, which means that Drools enhances and optimizes the Rete algorithm for object-oriented systems.
[0037] In Drools, rules are stored in the Production Memory, while the facts that the inference engine needs to match are stored in the Working Memory. After the facts are inserted into the Working Memory, the rule engine matches the facts with the patterns in the Production Memory. For rules that match successfully, the Agenda is responsible for executing the conclusion part of the triggered rule in the inference algorithm. At the same time, the Agenda manages the execution order of these conflicting rules through conflict decision strategies. The rule conflict decision strategies in Drools are: (1) priority strategy; (2) complexity priority strategy; (3) simplicity priority strategy; (4) breadth strategy; (5) depth strategy; (6) loading sequence number strategy; (7) random strategy.
[0038] Facts: Relationships between objects and between object properties (POJO).
[0039] A rule is a reasoning statement consisting of a condition and a conclusion, generally expressed as if…then. The if part of a rule is called the left-hand element (LHS), and the then part is called the right-hand element (RHS).
[0040] The module refers to the condition in an if statement. An if condition might be a larger condition composed of several smaller conditions; the module is the smallest atomic condition that cannot be further subdivided.
[0041] Currently, existing remuneration settlement systems typically employ the Spark framework for settlement, converting configured policy data into a data model for the settlement capability platform. The inventors of this application have noted that using the Spark framework for remuneration settlement involves parsing and generating a Spark job for each policy, and each task repeatedly loads the settlement base data, leading to problems such as low cluster resource utilization, reduced resources available for settlement, and slow settlement speed.
[0042] To address the problems of the prior art, embodiments of this application provide a method, apparatus, device, and storage medium for calculating remuneration. The remuneration calculation method provided by these embodiments will be described in detail below with reference to the accompanying drawings, through specific examples and application scenarios.
[0043] Please see Figure 1 , Figure 1 This is a schematic diagram illustrating an application scenario of a remuneration settlement method provided in this application embodiment. The schematic diagram includes a user terminal 100, a settlement system 200, and a data analysis system 300. The user terminal 100, the settlement system 200, and the data analysis system 300 can communicate with each other via a communication network. Optionally, the communication network can be a wired network or a wireless network; this application does not impose any limitations on this.
[0044] In this embodiment, the user terminal 100 is an electronic device used by the user, which may be a personal computer, mobile phone, tablet computer, laptop, vehicle terminal, or other similar device. The settlement system 200 and the data analysis system 300 may be independent physical servers, server clusters or distributed systems composed of multiple physical servers, or cloud servers that provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.
[0045] Please see Figure 2 , Figure 2 This application provides a flowchart illustrating a method for settling remuneration, comprising steps S100 to S400:
[0046] S100: Receive a settlement request sent by the user terminal 100. The settlement request includes a settlement data identifier.
[0047] Among them, the settlement data identifier is a unique identifier for the type of settlement data. The settlement data can be real-time settlement data or offline monthly settlement data, without any restrictions.
[0048] S200: Based on the settlement data identifier, obtain the corresponding configuration information from the big data management database associated with the user terminal 100, parse all the subsidiary tables corresponding to the business master table in the configuration information, as well as the relationship between the business master table and each subsidiary table, and obtain the corresponding wide table data from the big data management database based on the configuration information. The wide table data includes all the subsidiary table information corresponding to the business master table, as well as the relationship between the business master table and each subsidiary table.
[0049] The wide table data is stored in the big data management database of the data analysis system 300. This database is a distributed big data warehouse built using big data technology and the data warehouse tool (Hive). Upon receiving a settlement request from the user terminal 100, the system retrieves the configuration information and settlement rules corresponding to the current settlement data from the big data management database using the settlement data identifier in the request. Specifically, the configuration information is parsed to obtain the corresponding main business table and all its subsidiary tables, as well as the relationships between the main business table and its subsidiary tables. Then, the corresponding wide table data is retrieved from the big data management database using this configuration information. This wide table data includes information on all subsidiary tables corresponding to the main business table, as well as the relationships between the main business table and its subsidiary tables.
[0050] A wide table refers to a database table that links together metrics, dimensions, and attributes related to a business theme. In this embodiment, the main business table and its subsidiary tables are categorized by their relationships, and settlement policies belonging to the same business category are grouped into a single wide table. During data settlement, the settlement operation is initiated based on the business category. This means that the number of policies is irrelevant; as long as the data belongs to the same business category, only one settlement operation needs to be initiated, and the data only needs to be loaded once. This avoids the problem of excessive memory consumption caused by repeated data loading.
[0051] S300: Obtain the corresponding settlement rule information from the big data management database associated with the user terminal 100 based on the settlement data identifier. The settlement rule information includes the settlement rule and a two-dimensional table data model of the rule settlement conditions. Use the rule adaptation program to transform the two-dimensional table data model into the first rule.
[0052] The rule adaptation program transforms the two-dimensional table data model in the big data management library into a first rule, which can be a Drools rule for centralized business management, thereby improving the efficiency of rule development.
[0053] S400. According to the first rule, start the settlement job from the task scheduling status table of the big data management database. The settlement job uses the rule engine in the first rule to settle each piece of data in the wide table data and outputs the settlement result data.
[0054] The settlement system 200 initiates the corresponding settlement job from the task scheduling status table in the big data management database based on the type of settlement data. For example, if the settlement data is stream processing settlement data, it retrieves the stream processing settlement rules from the big data management database and initiates the settlement job. This settlement job can be performed in real-time using a Flink job. If the settlement data is batch processing settlement data, it retrieves the batch processing settlement rules from the big data management database and initiates the settlement job. This settlement job can be performed offline using a Spark job. In other words, the settlement system in this embodiment adopts a Drools rule + N (Java / Spark / Flink) settlement mode, enabling the use of different settlement executors for computation based on data volume and scenario, meeting different settlement requirements for different scenarios, and supporting dynamic expansion.
[0055] Meanwhile, in this embodiment, the Spark settlement job utilizes the rule engine in Drools rules to process each piece of data in the wide table, reconstructing the underlying computation logic and minimizing data loading time, rule information reading time, and data computation process. By adopting the principle of matching data with computation rules, it reduces repeated data loading into memory, changing the problem of a linear increase in the number of rules and computation time, thereby improving computational efficiency.
[0056] The specific implementation methods of each of the above steps will be described in detail below.
[0057] In some embodiments, please refer to Figure 3 , Figure 3 yes Figure 2 The flowchart illustrates the specific implementation of S200. Before retrieving the corresponding wide table data from the big data management database based on the configuration information, S200 also includes the following steps:
[0058] S210. Obtain historical wide table data from the big data management database. The historical wide table data includes information on all historical subsidiary tables corresponding to multiple historical business main tables, as well as the relationships between multiple historical business main tables and each historical subsidiary table.
[0059] The historical wide table data is stored in the big data management database of the data analysis system 300. The historical wide table data includes all configuration information of historical settlement operations, specifically including all historical subsidiary table information corresponding to multiple historical business main tables, as well as the relationship between multiple historical business main tables and each historical subsidiary table.
[0060] S220. If there is historical wide table data in the big data management database that corresponds to the configuration information, and the historical business main table and historical subsidiary table data in the historical wide table data have not changed, then the historical wide table data will be used as the wide table data.
[0061] After receiving the settlement request sent by the user terminal 100, it is determined whether there is corresponding wide table data in all historical wide table data in the big data management database. If there is, and the historical business main table and historical auxiliary table data have not changed, the historical wide table data is used as the wide table data for this settlement, thus reducing the duplication of data loading.
[0062] S230. If historical wide table data corresponding to the configuration information exists in the big data management database, and the historical business main table and historical subsidiary table data in the historical wide table data have changed, or if historical wide table data corresponding to the configuration information does not exist in the big data management database, then the wide table creation task is started to create the wide table data.
[0063] S240. Update the wide table data to the big data management database.
[0064] The data analysis system 300 retrieves the newly created wide table data from the settlement system 200, cleans and filters the wide table data, and updates it to the historical wide table data.
[0065] In some embodiments, see Figure 4 , Figure 4 yes Figure 3 The flowchart illustrates the specific implementation of S230. The S230 step of initiating the wide table creation task to create wide table data specifically includes the following steps:
[0066] S231. Read the configuration information, parse all the subsidiary tables corresponding to the main business table of the configuration information, and the relationship between the main business table and each subsidiary table.
[0067] S232. Obtain the main table identifier of the business main table.
[0068] The main table identifier is a unique identity ID for the main table of this business.
[0069] S233. Obtain the corresponding full set of subsidiary tables based on the main table identifier. The full set of subsidiary tables includes condition subsidiary tables, object subsidiary tables, and cardinality subsidiary tables.
[0070] S234. Obtain the set of related table information based on the main table identifier. The set of related table information includes the main configuration table, the account and main relationship table, the main and auxiliary table field association table, and the main table and auxiliary table association table.
[0071] S235. Obtain the intersection of the full set of subsidiary tables and the set of related table information to obtain the valid subsidiary tables.
[0072] By intersecting the information sets of all subsidiary tables and related tables, valid subsidiary tables are obtained. This involves classifying the data in the main business table and all corresponding subsidiary tables, placing data belonging to a major business category into a single valid subsidiary table, thus achieving data processing and aggregation.
[0073] S236. Divide the valid subsidiary tables into groups of M, generate temporary SQL statement tables according to the division order, and write them into the task queue.
[0074] S237. The task execution thread of the wide table creation task reads the wide table SQL table creation statement from the task queue. The wide table creation task executes multiple temporary SQL statement tables sequentially to obtain the wide table data.
[0075] S238. Update the wide table data to the big data management database.
[0076] In some embodiments, in S300 above, the two-dimensional table data model is transformed into a first rule using a rule adaptation program. The first rule may specifically include rule information and settlement output information. The rule information includes at least range conditions, remuneration conditions, and settlement conditions. The range conditions are used to filter the data corresponding to the first rule, and the remuneration conditions are used to determine whether to settle the data.
[0077] In some embodiments, before initiating the settlement job from the task scheduling status table of the big data management database according to the first rule in S400 above, the following steps are also included:
[0078] S410, Read the first rule and create the executor.
[0079] The first rule, which may be, for example, a drools rule, is read from the database in the settlement system 200, and a stateless session, StatelessKieSession, is created.
[0080] S420. Load the wide table data into the database of the settlement system 200.
[0081] The wide table data is loaded into the database of the settlement system 200, and the rule engine of Drools rules is used to settle each piece of data, ensuring that no data is missed. At the same time, the goal of calculating rules by matching data is achieved, which reduces the repeated loading of data into memory, changes the problem of the linear increase in the number of rules and the calculation time, and thus improves the calculation efficiency.
[0082] In some embodiments, the settlement operation in S400 above uses the rule engine in the first rule to settle each piece of data in the wide table data, specifically including the following steps:
[0083] The data with a one-to-one correspondence and the settlement rules are output to obtain a settlement result data.
[0084] Based on the correspondence between a single data point and multiple settlement rules, the single data point is split into multiple sub-data points. The sub-data points with one-to-one correspondences and the settlement rules are output to obtain multiple settlement result data.
[0085] In the wide table data, one piece of data can correspond to one settlement rule or multiple settlement rules. For data with a one-to-one correspondence, the corresponding settlement rule is used directly for settlement, and the settlement result data is output. For data with a one-to-many correspondence, the data is split into multiple sub-data, where each sub-data corresponds to only one unique settlement rule. This unique settlement rule is used to settle the sub-data, and the settlement result data is output. This ensures that every piece of settlement data is settled, avoiding omissions in settlement data during the settlement operation and guaranteeing the correctness of the settlement result data.
[0086] In some embodiments, the above-mentioned S300 settlement rule information includes a two-dimensional table data model of settlement rules and rule settlement conditions. The two-dimensional table data model is transformed into a first rule using a rule adaptation program. Before that, the following steps are also included:
[0087] Assign a type identifier to each settlement rule.
[0088] Among them, the type identifiers include ordinary settlement identifiers and special settlement identifiers. Special settlement identifiers include: cap, advanced conditions, issuance rules, and segmentation.
[0089] By assigning type identifiers to settlement rules, the system categorizes these rules. These identifiers include general settlement identifiers and special settlement identifiers. Special settlement identifiers include: capping, advanced conditions, disbursement rules, and segmentation. This addresses the settlement operations for special settlement scenarios such as capping, advanced conditions, disbursement rules, and segmentation, enabling the application of different settlement rules to different scenarios and expanding the applicability of the settlement system.
[0090] In some embodiments, see Figure 5 , Figure 5 yes Figure 2 The flowchart illustrates the specific implementation of S400. In the step of the settlement task in the above S400, the settlement task uses the rule engine in the first rule to settle each piece of data in the wide table and outputs the settlement result data. The settlement result data includes unsettled data and settled data.
[0091] Following the step of outputting settlement result data, there are also steps for processing unsettled and settled data separately. These processing steps include:
[0092] Obtain the reasons for the unsettled data, add settlement standard information, and then output it to the settlement result table.
[0093] If the settled data has a common settlement identifier, then the settled data is cleaned, its structure mapped, and output to the settlement result table.
[0094] If the settled data has a special settlement identifier, the settlement operation is used to settle the settled data to obtain special settlement result data. The special settlement result data is then cleaned, structured, mapped, and output to the settlement result table.
[0095] Settlement result data includes unsettled data and settled data. These two types of data are processed separately and uniformly. Unsettled data refers to data that does not meet certain remuneration criteria. For unsettled data, the reasons for non-settlement are obtained, settlement standard information is added, and then the data is output to the settlement result table. The type identifier of settled data is confirmed. If the settled data has a common settlement identifier, it is cleaned, structurally mapped, and output to the settlement result table. If the settled data has a special settlement identifier, a settlement job (either Spark or Flink) is used to settle the data, resulting in special settlement result data. This special settlement result data is then cleaned, structurally mapped, and output to the settlement result table. This process handles different types of settlement result data, improving the accuracy of the settlement result data and effectively preventing erroneous and missed settlements.
[0096] In some embodiments, the settlement task uses the rule engine in the first rule to settle each piece of data in the wide table data and outputs the settlement result data, and specifically includes the following steps:
[0097] Obtain settlement version information to distinguish settlement result data. Settlement version information is generated during the settlement process and the settlement result data is synchronized to the report library.
[0098] By synchronizing settlement result data, the collection and storage of settlement result data can be achieved, which is beneficial for verifying and judging the settlement result data in the next transaction.
[0099] It should be noted that the various optional implementation methods described in the embodiments of this application can be combined with each other or implemented individually without conflict, and the embodiments of this application do not limit this.
[0100] Based on the remuneration settlement method provided in the above embodiments, this application also provides specific implementation methods of the remuneration settlement device. Please refer to the following embodiments.
[0101] Please refer to Figure 6 , Figure 6 This is a schematic diagram of the structure of the remuneration settlement device provided in this application embodiment. This application embodiment provides a remuneration settlement device, device A100 including a data management module A101, a data preparation module A102, a parsing module A103, a rule adaptation module A104, and a remuneration settlement module A105.
[0102] The data management module A101 receives settlement requests from the user terminal, including settlement data identifiers. The data preparation module A102 retrieves corresponding configuration information from the big data management database associated with the user terminal based on the settlement data identifiers. It parses all subsidiary tables corresponding to the main business table in the configuration information, as well as the relationships between the main business table and its subsidiary tables. Based on the configuration information, it retrieves corresponding wide table data from the big data management database. The wide table data includes information on all subsidiary tables corresponding to the main business table, as well as the relationships between the main business table and its subsidiary tables. The rule adaptation module A103 retrieves corresponding settlement rule information from the big data management database associated with the user terminal based on the settlement data identifiers. The settlement rule information includes a two-dimensional table data model of the settlement rules and their settlement conditions. The rule adaptation program transforms the two-dimensional table data model into a first rule. The reward settlement module A104 initiates a settlement job from the task scheduling status table of the big data management database based on the first rule. The settlement job uses the rule engine in the first rule to settle each piece of data in the wide table data and outputs the settlement result data.
[0103] In some embodiments, the device further includes a data synchronization module A105 for acquiring settlement version information and for distinguishing settlement result data, wherein the settlement version information is generated during the settlement process and the settlement result data is synchronized to the report database.
[0104] The payment settlement device provided in this application embodiment can realize Figure 2 The various steps in the method embodiments, and the corresponding technical effects achieved, will not be repeated here to avoid repetition.
[0105] Figure 7 A schematic diagram of the hardware structure for remuneration settlement provided in an embodiment of this application is shown.
[0106] The payment settlement device may include a processor 10 and a memory 20 storing computer program instructions.
[0107] Specifically, the processor 10 may include a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.
[0108] Memory 20 may include mass storage for data or instructions. For example, and not limitingly, memory 20 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 20 may include removable or non-removable (or fixed) media. Where appropriate, memory 20 may be internal or external to the integrated gateway disaster recovery device. In a particular embodiment, memory 20 is non-volatile solid-state memory.
[0109] Memory may include read-only memory (ROM), random access memory (RAM), disk storage media devices, optical storage media devices, flash memory devices, and electrical, optical, or other physical / tangible memory storage devices. Therefore, typically, memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to one aspect of this disclosure.
[0110] The processor 10 implements any of the remuneration settlement methods in the above embodiments by reading and executing computer program instructions stored in the memory 20.
[0111] In one example, the payment settlement device may also include a communication interface 30 and a bus 40. Wherein, such as Figure 7 As shown, the processor 10, memory 20, and communication interface 30 are connected via bus 40 and communicate with each other.
[0112] The communication interface 30 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.
[0113] Bus 40 includes hardware, software, or both, that couples components of a payment processing device together. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 40 may include one or more buses. Although specific buses are described and illustrated in embodiments of this application, this application contemplates any suitable bus or interconnect.
[0114] Furthermore, in conjunction with the remuneration settlement methods in the above embodiments, this application embodiment can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when these computer program instructions are executed by a processor, they implement any of the remuneration settlement methods in the above embodiments.
[0115] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.
[0116] The functional blocks shown in the above-described structural diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.
[0117] It should also be noted that the exemplary embodiments mentioned in this application describe methods or systems based on a series of steps or apparatus. However, this application is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.
[0118] The aspects of this disclosure have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It should be understood that each block in the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by special-purpose hardware performing the specified functions or actions, or can be implemented by a combination of special-purpose hardware and computer instructions.
[0119] The above are merely specific embodiments of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application.
Claims
1. A method for settling remuneration, characterized in that, The method includes: Receive a settlement request sent by the user terminal, wherein the settlement request includes a settlement data identifier; Based on the settlement data identifier, obtain the corresponding configuration information from the big data management database associated with the user terminal, parse all the subsidiary tables corresponding to the business main table of the configuration information, as well as the association relationship between the business main table and each of the subsidiary tables, and obtain the corresponding wide table data from the big data management database based on the configuration information. The wide table data includes all the subsidiary table information corresponding to the business main table, as well as the association relationship between the business main table and each of the subsidiary tables. According to the settlement data identifier, the corresponding settlement rule information is obtained from the big data management database associated with the user terminal. The settlement rule information includes a two-dimensional table data model of settlement rules and rule settlement conditions. The two-dimensional table data model is transformed into a first rule using a rule adaptation program. According to the first rule, a settlement job is started from the task scheduling status table of the big data management library. The settlement job uses the rule engine in the first rule to settle each piece of data in the wide table data and outputs the settlement result data. Before retrieving the corresponding wide table data from the big data management library based on the configuration information, the process also includes: Historical wide table data is obtained from the big data management library. The historical wide table data includes information on all historical subsidiary tables corresponding to multiple historical business main tables, as well as the relationship between the multiple historical business main tables and each of the historical subsidiary tables. If the big data management database contains historical wide table data corresponding to the configuration information, and the information of the historical business main table and the historical subsidiary table in the historical wide table data has changed, or if the big data management database does not contain historical wide table data corresponding to the configuration information, then a wide table creation task is initiated to create the wide table data. Initiate a wide table creation task to create the wide table data, including: Read the configuration information, parse all the subsidiary tables corresponding to the business main table of the configuration information, and the relationship between the business main table and each of the subsidiary tables; Obtain the main table identifier of the business main table; The corresponding set of full auxiliary tables is obtained based on the main table identifier. The set of full auxiliary tables includes conditional auxiliary tables, object auxiliary tables, and cardinality auxiliary tables. The associated table information set is obtained based on the main table identifier. The associated table information set includes the main configuration table, the account and main relationship table, the main and auxiliary table field association table, and the main table and auxiliary table association table. Obtain the intersection of the full set of dependent tables and the set of related table information to obtain the valid dependent tables; The valid subsidiary tables are divided into groups of M, and a temporary SQL statement table is generated according to the division order and written to the task queue. The task execution thread of the wide table creation task reads the wide table SQL table creation statement from the task queue, wherein the wide table creation task executes multiple temporary SQL statement tables sequentially to obtain the wide table data; Update the wide table data to the big data management library.
2. The remuneration settlement method according to claim 1, characterized in that, Before retrieving the corresponding wide table data from the big data management library based on the configuration information, the process also includes: If the historical wide table data corresponding to the configuration information exists in the big data management database, and the information of the historical business main table and the historical subsidiary table in the historical wide table data has not changed, then the historical wide table data will be used as the wide table data.
3. The remuneration settlement method according to claim 1, characterized in that, The two-dimensional table data model is transformed into a first rule using a rule adaptation program. The first rule includes rule information and settlement output information. The rule information includes range conditions, remuneration conditions, and settlement conditions. The range conditions are used to filter the data corresponding to the first rule, and the remuneration conditions are used to determine whether to settle the data.
4. The remuneration settlement method according to claim 1, characterized in that, According to the first rule, the settlement job is initiated from the task scheduling status table of the big data management database, which includes the following steps beforehand: Read the first rule and create an executor; The wide table data is loaded into the database of the settlement system.
5. The remuneration settlement method according to any one of claims 1-4, characterized in that, The settlement operation uses the rule engine in the first rule to settle each piece of data in the wide table data, including: The data with a one-to-one correspondence is output along with the settlement rules to obtain a settlement result data; Based on the correspondence between a single piece of data and multiple settlement rules, the single piece of data is split into multiple sub-data, and the sub-data with a one-to-one correspondence and the settlement rules are output to obtain multiple settlement result data.
6. The remuneration settlement method according to claim 5, characterized in that, The settlement rule information includes a two-dimensional table data model of settlement rules and rule settlement conditions. A rule adaptation program is used to transform the two-dimensional table data model into a first rule. Prior to this, the following steps are also included: Assign a type identifier to each of the aforementioned settlement rules; The type identifiers include ordinary settlement identifiers and special settlement identifiers. The special settlement identifiers include: cap, advanced conditions, distribution rules, and segmentation.
7. The remuneration settlement method according to claim 6, characterized in that, In the step of the settlement operation using the rule engine in the first rule to settle each piece of data in the wide table data and output the settlement result data, the settlement result data includes unsettled data and settled data; Following the step of outputting settlement result data, the method further includes processing steps for the unsettled data and the settled data respectively. These processing steps include: Obtain the reason for the unsettled data, add settlement standard information, and then output it to the settlement result table; If the settled data has a common settlement identifier, then the settled data is cleaned, structurally mapped, and output to the settlement result table; If the settled data has a special settlement identifier, the settlement operation is used to settle the settled data to obtain special settlement result data. The special settlement result data is then cleaned, structured, mapped, and output to the settlement result table.
8. The remuneration settlement method according to claim 5, characterized in that, The settlement operation uses the rule engine in the first rule to settle each piece of data in the wide table and outputs the settlement result data, and also includes: Obtain settlement version information to distinguish the settlement result data, wherein the settlement version information is generated during the settlement process, and synchronize the settlement result data to the report library.
9. A payment settlement device, characterized in that, The device includes: The data management module is used to receive settlement requests sent by the user terminal, wherein the settlement request includes a settlement data identifier; The data preparation module is used to obtain corresponding configuration information from the big data management database associated with the user terminal based on the settlement data identifier; parse all subsidiary tables corresponding to the business master table in the configuration information, as well as the association relationships between the business master table and each subsidiary table; obtain corresponding wide table data from the big data management database based on the configuration information, the wide table data including all subsidiary table information corresponding to the business master table, and the association relationships between the business master table and each subsidiary table; before obtaining the corresponding wide table data from the big data management database based on the configuration information, it is also used to: obtain historical wide table data from the big data management database, the historical wide table data including all historical subsidiary table information corresponding to multiple historical business master tables, and the association relationships between multiple historical business master tables and each historical subsidiary table; if historical wide table data corresponding to the configuration information exists in the big data management database, and the historical business master table and the historical subsidiary table data in the historical wide table data have changed, or if historical wide table data corresponding to the configuration information does not exist in the big data management database, then the process is initiated. The wide table creation task creates the wide table data; specifically, it is used for: reading the configuration information, parsing all the subsidiary tables corresponding to the business master table of the configuration information, and the association relationship between the business master table and each subsidiary table; obtaining the master table identifier of the business master table; obtaining the corresponding full set of subsidiary tables based on the master table identifier, the full set of subsidiary tables including condition subsidiary tables, object subsidiary tables, and cardinality subsidiary tables; obtaining the association table information set based on the master table identifier, the association table information set including the main configuration table, the subject and main relationship table, the master and subsidiary table field association table, and the master table and subsidiary table association table; obtaining the intersection of the full set of subsidiary tables and the association table information set to obtain the valid subsidiary tables; dividing the valid subsidiary tables into groups of M, generating temporary SQL statement tables according to the division order, and writing them into the task queue; reading the wide table SQL table creation statements from the task queue according to the task execution thread of the wide table creation task, wherein the wide table creation task executes multiple temporary SQL statement tables sequentially to obtain the wide table data; and updating the wide table data to the big data management database. The rule adaptation module is used to obtain the corresponding settlement rule information from the big data management database associated with the user terminal based on the settlement data identifier. The settlement rule information includes a two-dimensional table data model of settlement rules and rule settlement conditions. The rule adaptation program is used to convert the two-dimensional table data model into a first rule. The remuneration settlement module is used to initiate a settlement job from the task scheduling status table of the big data management database according to the first rule. The settlement job uses the rule engine in the first rule to settle each piece of data in the wide table data and outputs the settlement result data.
10. The payment settlement device according to claim 9, characterized in that, The device further includes: The data synchronization module is used to obtain settlement version information, to distinguish the settlement result data, wherein the settlement version information is generated during the settlement process, and to synchronize the settlement result data to the report library.
11. A payment settlement device, characterized in that, The device includes: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, it implements the remuneration settlement method as described in any one of claims 1-8.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer program instructions that, when executed by a processor, implement the remuneration settlement method as described in any one of claims 1-8.
Citation Information
Patent Citations
Data treatment method and system oriented to settlement for account
CN107491563A
Charging settlement method and device, computer system and medium
CN112785287A
