Clearing settlement method and device, computer equipment and storage medium
By pulling data from pre-configured data sources and depositing them into wide tables, extracting initial fields and configuring clearance strategies, the problems of complexity of clearance and settlement business and long development cycle in the enterprise credit field are solved, and an efficient clearance and settlement process is achieved.
Patent Information
- Application Number
- CN202411882354.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-05-13
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the field of corporate credit, the business complexity of the clearing and settlement business has increased due to the differences in different cooperation methods and scenarios. The traditional solution has a long development cycle and poor reusability. Business operators need high business capabilities to carry out manual work, which increases the coupling between business and technology.
Provide a clearing and settlement method, by pulling the to-processed data from a pre-configured data source and storing it into a wide table, extracting the initial field according to the pre-configured cleaning task, configuring the clearing strategy according to the initial field, and using the clearing strategy to perform clearing calculations to obtain the settlement result.
It improves the configuration efficiency of clearing and debit strategy, reduces the need for customized development of differentiated businesses, and reduces the complexity of business personnel converting business scenarios into computing processes after understanding the business, thereby improving the efficiency of clearing and debit settlement.
Smart Images

Figure CN119988371A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a clearing and settlement method, device, computer equipment and storage medium. Background Art
[0002] Clearing and settlement is a data processing and calculation operation carried out in the field of corporate credit for clearing business arising from cooperation with investors (which may involve matters such as the distribution and settlement of income and funds). It is used to process relevant data according to the needs of different cooperation modes and scenarios to complete specific clearing business logic processing such as income distribution.
[0003] Due to the differentiated cooperation methods between enterprises and investors in the current field of corporate credit, the clearing business is becoming increasingly complex. Different data sources need to be selected for processing in different scenarios, and a large number of operators are required to perform manual calculations. Therefore, how to improve the efficiency of clearing calculations is a problem that needs to be solved at present.
[0004] There are some solutions in the traditional scheme, but these solutions often have obvious weaknesses. On the one hand, traditional solutions are basically customized for differentiated business, with a long development cycle and poor reusability; on the other hand, they require high business capabilities of business operators. Business personnel need to understand the business and convert business scenarios into computing processes to increase the coupling between business and technology. Summary of the invention
[0005] Based on this, it is necessary to provide a clearing and settlement method, device, computer equipment and storage medium that can improve the clearing and settlement efficiency in response to the above technical problems.
[0006] In a first aspect, the present application provides a clearing and settlement method, comprising:
[0007] Pull the data to be processed from the pre-configured data source and store it in a wide table;
[0008] extracting at least one initial field from the wide table according to a preconfigured cleaning task;
[0009] Configure the clearing strategy of the current partner according to the target field in the initial field;
[0010] According to the clearing strategy, the corresponding data is obtained from the wide table for clearing calculation to obtain the corresponding settlement result of the current partner.
[0011] In one embodiment, the clearing and settlement method further includes:
[0012] Extract scene information based on pre-configured third-party cooperation agreements;
[0013] The cleaning task is configured according to the scene information, and the cleaning task includes the scene information and the corresponding initial fields.
[0014] In one embodiment, the cleaning task includes multiple cleaning tasks, and obtaining at least one initial field from multiple fields according to the pre-configured cleaning tasks includes:
[0015] According to the scene information in the cleaning task, the initial fields corresponding to each scene information are acquired from the wide table to obtain at least one initial field.
[0016] In one embodiment, the target field includes multiple fields, and the clearing strategy of the current partner is configured according to the target field in the initial field, including:
[0017] In response to a target field selection instruction, acquiring the target field;
[0018] In response to the configuration instruction of the clearing strategy, extracting the operation relationship between the target fields in the configuration instruction;
[0019] Configure the clearing strategy based on the target field and operation relationship.
[0020] In one embodiment, the clearing strategy is configured according to the target field and the operation relationship, including:
[0021] Construct an initial polynomial based on the operational relationship;
[0022] Map the target field to the variables in the initial polynomial to obtain the target polynomial;
[0023] Configure the clearing strategy based on the target polynomial.
[0024] In one embodiment, corresponding data is obtained from the wide table according to the clearing strategy to perform clearing calculations, and the corresponding settlement result of the current partner is obtained, including:
[0025] The target field and target polynomial in the clearing strategy are parsed through the formula parsing engine;
[0026] Get the corresponding data from the wide table according to the target field;
[0027] Perform clearing calculations based on the data obtained from the wide table and the target polynomial to obtain the settlement result corresponding to the current partner.
[0028] In one embodiment, the clearing and settlement method further includes:
[0029] In response to a configuration instruction from a new partner, selecting a new target field from the initial field;
[0030] Configure the clearing strategy corresponding to the new partner according to the new target field.
[0031] In a second aspect, the present application provides a clearing and settlement device, comprising:
[0032] The acquisition module is used to pull the data to be processed from the pre-configured data source and store the data to be processed into a wide table;
[0033] an extraction module, for extracting at least one initial field from the wide table according to a preconfigured cleaning task;
[0034] A configuration module is used to configure the clearing strategy of the current partner according to the target field in the initial field;
[0035] The settlement module is used to obtain the corresponding data from the wide table according to the clearing strategy, perform clearing calculations, and obtain the corresponding settlement results for the current partner.
[0036] In a third aspect, the present application provides a computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the clearing and settlement method provided in any one of the embodiments of the present application in the first aspect are implemented.
[0037] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the clearing and settlement method provided in any embodiment of the present application in the first aspect.
[0038] The above-mentioned clearing and settlement method, device, computer equipment and storage medium pull the data to be processed from a pre-configured data source, and store the data to be processed into a wide table, extract at least one initial field from the wide table according to the pre-configured cleaning task, configure the clearing strategy of the current partner according to the initial field, the clearing strategy includes the target field selected from the initial field and the corresponding calculation formula, obtain the corresponding data from the wide table according to the clearing strategy to perform clearing calculation, and obtain the corresponding settlement result of the current partner. By adopting this application, the data to be processed can be first obtained from the data source and stored in a wide table, and the data can be further cleaned to obtain the initial field, and the clearing strategy of the current partner can be configured using the initial field, and the clearing strategy can be further used for clearing and settlement, so that the clearing strategy of the partner can be configured by freely combining the fields, without the need for customized development for differentiated businesses, and without the need for business personnel to understand the business and convert the business scenario into a calculation process. Business personnel only need to configure the clearing strategy by checking and selecting in the interface, thereby improving the configuration efficiency of the clearing strategy and thus improving the efficiency of clearing and settlement. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 A schematic diagram of a flow chart of a clearing and settlement method in some embodiments;
[0040] Figure 2 It is a structural block diagram of a clearing and settlement device in some embodiments;
[0041] Figure 3 1 is a diagram of the internal structure of a computer device in some embodiments. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0043] In a first aspect, the present application provides a clearing and settlement method, such as Figure 1 As shown, the method is applied to a terminal as an example for description, and includes the following steps:
[0044] Step S11, pulling the data to be processed from the pre-configured data source and storing the data to be processed into a wide table.
[0045] The data sources may include:
[0046] Business transaction data: For example, the loan data source mentioned in the credit business will include the specific amount of each loan, loan time, loan object (customer information such as ID number, name, etc.), loan channel and other relevant transaction details; the repayment data source includes the amount of each repayment, repayment time, whether it is overdue, repayment method (such as online transfer, offline repayment, etc.) and other information.
[0047] Customer basic information data: such as the customer’s basic identity information (in addition to the name and ID number mentioned above, there may also be age, gender, occupation, etc.), contact information (mobile phone number, email address, etc.), credit assessment related information (credit score, credit rating, etc., which can be used for risk considerations in clearing calculations, etc.).
[0048] Product-related data: data on the characteristics of the credit business products themselves, such as the interest rate setting, loan term, repayment period (monthly, quarterly, etc.), product limit range, etc. These data are very important in determining profit distribution and interest calculation in the clearing calculation.
[0049] Among them, a wide table is a design pattern for a database table. Simply put, a wide table integrates data from multiple dimensions or multiple related data tables into one table. Its characteristic is that it contains a large number of fields. For example, in an e-commerce business scenario, a sales wide table may contain order information (such as order number, order time), customer information (such as customer ID, customer name, customer address), product information (such as product ID, product name, product price) and payment information (such as payment method, payment amount) and many other different dimensions of data.
[0050] This design is mainly for the convenience of data analysis and query. By integrating related data together, when performing data query and analysis, such as counting the sales of different products purchased by customers in different regions, data can be directly obtained from this wide table, reducing the complexity of querying by linking multiple tables and improving query efficiency.
[0051] Specifically, this application can configure the data source through the following steps:
[0052] First, you need to sort out all the data sources involved in clearing and settlement. For example, for credit business, you need to determine whether the loan data source is from the database of the bank's core system, the loan record file of the third-party payment platform, or the company's internal credit management system; the same applies to the repayment data source. If it is a database, you need to clarify the database type, server address, port number, database name, table name, field name and other information; if it is a file, you need to be clear about the file format, file storage location (local path or network path), etc.
[0053] Database connection: Use appropriate database connection technology and tools. You need to configure parameters such as database driver, database URL (including database type, server address, port number, database name, etc.), user name and password to establish a connection with the database where the loan data source or repayment data source is located.
[0054] File reading connection: If the data source is a file type, use the file reading function provided by the programming language. Taking Python as an example, for CSV files, you can use the csv module, open the file through the open() function, specify the file path and reading mode (such as r for read-only), and parse according to the file content.
[0055] After establishing the connection, extract the required data from the data source. In the database, use SQL query statements to extract data for specific fields such as loan amount and repayment time. For file data sources, use the corresponding parsing method to extract data based on the file format and content structure.
[0056] Since the data formats of different data sources may be different, data conversion is required. For example, the date field format in the database may be YYYY-MM-DD, but the date format required by the clearing strategy is MM / DD / YYYY, so the date format conversion is required. It may also involve data type conversion, such as converting string type amount data to numeric type for mathematical operations.
[0057] After extracting and converting the data, the data needs to be verified. Check whether the data is complete, for example, whether each loan record in the loan data source has corresponding customer information; check the accuracy of the data, such as whether the repayment amount is within a reasonable range and whether there are any outliers (such as a negative repayment amount).
[0058] Clean the problematic data found during the verification process. Invalid or erroneous data records can be deleted, or corrected according to certain rules. For example, if the repayment time record is found to be wrong, it can be calculated and corrected based on the repayment cycle and other valid records.
[0059] After the previous steps, the cleaned and converted data is mapped according to the requirements of the clearing strategy. Determine the role and position of each data field in the clearing and settlement. For example, map the loan amount to the part of the clearing strategy used to calculate the cost of funds, and map the repayment amount and time to the part of calculating the income and overdue fees. In this way, when the clearing strategy is run, these configured data sources can be used for accurate calculations.
[0060] Step S12: extracting at least one initial field from the wide table according to a preconfigured cleaning task.
[0061] Among them, the cleaning task refers to a series of processing operations on the accessed data, the purpose of which is to remove impurities in the data (such as unnecessary data, erroneous data, duplicate data, incomplete data, etc.), and extract accurate data useful for clearing and settlement according to specific business needs. For example, the data of the target field of loan amount used to calculate the loan amount can be extracted to ensure that it is accurate, clean and meets the requirements of subsequent clearing calculations.
[0062] Specifically, the step of extracting the initial field in this application may include:
[0063] First, according to the specific business scenario (such as calculating the loan split amount based on the loan amount), determine the fields required for the clearing strategy, which is the loan amount in this case.
[0064] Check the entire source data to see if the data records containing the loan amount field are complete. For example, check if there are corresponding loan amount values in a loan record. If there are any missing values, they may need to be marked for subsequent processing (such as supplementing data or deleting the incomplete record).
[0065] Confirm the accuracy of the loan amount data. For example, check whether the amount is within a reasonable range, whether there are obvious errors (such as negative amounts that do not conform to actual business conditions), and correct or eliminate inaccurate data.
[0066] Check whether there are duplicate records about the loan amount. If so, decide whether to keep one of the records or perform other processing (such as merging duplicate records) based on business rules to ensure the uniqueness of the data.
[0067] After the above-mentioned inspection, verification and processing, the data of the initial field of loan amount is accurately extracted from the source data, so that it forms a clean and accurate data set that can be directly used by the clearing strategy. For example, you can extract the data of this field by writing an SQL query statement (if the data is stored in a database) to select only the value of the loan amount field, or use the relevant data processing functions of the programming language (if the data is in other formats).
[0068] Step S13, configuring the clearing strategy of the current partner according to the target field in the initial field.
[0069] Among them, the initial field is the field extracted based on each scenario information, and the target field is the field selected from the initial field for configuring the clearing strategy. This application extracts a part of the initial field based on the scenario information, and then selects several from the initial field in the subsequent configuration of the clearing strategy, and configures the target field, without the need for customized development for differentiated businesses.
[0070] Among them, the clearing strategy is a plan used to clarify the distribution rules of funds, rights and interests, and responsibilities, and is widely used in scenarios such as financial transactions and cooperative sharing.
[0071] In this application, the clearing strategy may specifically include the following information: settlement cycle, target field, calculation formula, and allocation object, etc.
[0072] Specifically, select the fields related to the allocation rules from the initial fields. For example, in the merchant settlement of the e-commerce platform, the fields such as "product sales", "refund amount" and "platform commission ratio" will be selected as the target fields, because these data are closely related to the calculation of the merchant's final actual income.
[0073] The calculation formula is the core part of the clearing strategy, which is used to calculate the target field to determine the allocation result. Taking the e-commerce platform merchant settlement as an example, the calculation formula can be "actual income = product sales × (1-platform commission ratio)-refund amount".
[0074] The calculation formula may contain multiple operations, such as addition, subtraction, multiplication, and division, and may also involve complex function calculations, conditional judgments, etc. For example, if different commission ratios are used according to different ranges of transaction amounts, conditional judgment statements are required.
[0075] Furthermore, it is necessary to clarify the current partners, that is, the recipients of the allocation of funds, rights, etc., which may be different partners in the cooperation project, such as technology providers, content producers, etc. Taking the e-commerce platform as an example, the recipients of the allocation are the various merchants that have settled in.
[0076] Furthermore, the settlement period can be specified, such as daily, weekly, monthly or quarterly. For example, the settlement between food delivery platforms and riders may be weekly, while the settlement between large e-commerce platforms and merchants may be monthly.
[0077] Step S14, according to the clearing strategy, the corresponding data is obtained from the wide table to perform clearing calculations to obtain the corresponding settlement result of the current partner.
[0078] This application pre-clearly specifies the target fields specified in the clearing strategy (key data items used for calculation), the corresponding calculation formula (determines how to calculate the target fields), the allocation object (clearly specifies that settlement is for the current partner), and the settlement cycle.
[0079] Furthermore, the database system or storage location where the wide table is located is determined, and a connection to the wide table is established using a corresponding database connection tool or programming interface. For example, if the wide table is based on cloud storage, it may be operated according to a specific connection method provided by the cloud service provider.
[0080] Furthermore, according to the target field determined in the clearing strategy, write a database query statement to accurately extract the corresponding data column from the wide table. Ensure that the extracted data type matches the expected type in the clearing strategy. For example, if the target field is required to be numeric, the extracted data should also be in a suitable numeric format.
[0081] Furthermore, the target field data extracted from the wide table is substituted into the calculation formula in the clearing strategy for calculation. This may require the implementation of specific calculation logic in the programming environment, such as using the arithmetic operation function of the programming language to perform multiplication, division, addition, subtraction and other operations on the data in sequence according to the formula.
[0082] During the calculation process, you should pay attention to special situations that may arise, such as when the divisor is zero (if there is a division operation in the calculation formula). At this time, you need to pre-set the processing method according to the business logic, such as returning a specific value or making a special mark.
[0083] At the same time, there should be corresponding contingency plans for abnormal situations such as missing data and mismatched data types to ensure that the calculation process can proceed smoothly.
[0084] After the above calculation steps, the final value is the settlement result corresponding to the current partner. The result is recorded according to business needs, which can be stored in a specific table in the database for subsequent query and analysis, or output to relevant personnel in the form of reports.
[0085] Through the above steps, it is possible to more completely realize the requirements of obtaining data from the wide table according to the clearing strategy, performing clearing calculations, and obtaining the current partner's settlement results.
[0086] In one of the embodiments, the clearing and settlement method may further include: extracting scenario information according to a pre-configured third-party cooperation agreement, configuring a cleaning task according to the scenario information, wherein the cleaning task includes the scenario information and a corresponding initial field.
[0087] In the context of clearing and settlement, scenario information refers to the description of various specific situations and conditions related to credit business (such as loan scenarios, repayment scenarios and other related credit scenarios, etc.). It covers various elements that can distinguish different credit business operation scenarios and affect clearing and settlement rules and processes.
[0088] For example, in the loan scenario, scenario information may include loan type (such as housing loan, consumer loan, etc.), loan amount, loan term, loan interest rate, borrower's credit status, etc.; in the repayment scenario, it may involve repayment method (such as equal principal and interest, equal principal, one-time principal and interest repayment, etc.), whether the repayment time is on time, whether it is early repayment, whether it is overdue repayment, etc.; other credit scenarios will also have their own specific related information, such as the extension period and extension interest rate in the credit extension scenario. These scenario information is crucial for accurate clearing and settlement, because different situations often correspond to different rules for fund allocation, fee calculation, etc.
[0089] Among them, a third-party cooperation agreement refers to a legally binding written agreement signed by two or more entities (usually enterprises or organizations, etc.) in a business cooperation project involving the participation of a third party. For example, when the clearing and settlement business involves cooperation with other professional service providers (such as data processing companies, payment institutions, etc.), such an agreement will be signed. The content of the agreement generally covers the purpose and scope of the cooperation, the rights and obligations of the parties, the specific methods of cooperation, the method of fee settlement, the data use and protection regulations, confidentiality clauses, and the term of cooperation, so as to clarify the behavioral norms and responsibilities of the parties in the cooperation process.
[0090] In this application, the content of the pre-configured third-party cooperation agreement is analyzed, with a focus on the description of the credit business scenario, including the definition of different credit scenarios (loan scenarios, repayment scenarios, etc.), relevant conditions and requirements, and regulations related to clearing and settlement.
[0091] Furthermore, the scenario information corresponding to each credit scenario is carefully screened and sorted out from the agreement text. For example, for the loan scenario, relevant information such as loan type, amount, term, interest rate, and borrower's credit status is extracted; for the repayment scenario, information such as repayment method, whether repayment is on time, whether repayment is made in advance, and whether repayment is overdue is found out one by one.
[0092] Furthermore, the extracted scenario information is classified and recorded, for example, a special document or data structure can be created to store it, ensuring that the scenario information in each credit scenario is complete and easy to query.
[0093] Furthermore, for each extracted credit scenario information, the initial fields that match it are determined. These initial fields are data items that come from relevant data sources (such as columns in database tables, data input from external interfaces, etc.) and are closely related to the clearing and settlement business in this scenario.
[0094] For example, in a loan scenario, if the scenario information involves the loan amount, then the corresponding initial field may be the field in the database that stores the loan amount data; if the scenario information is the repayment method, the corresponding initial field may be the field that records the repayment method.
[0095] Combine the scene information with the corresponding initial fields to form a specific cleaning task configuration. You can store this cleaning task information by creating a configuration file or setting up a specific table in the database, in which you can clearly record the scene information content of each cleaning task and the list of initial fields involved, to ensure that the information is complete and convenient for subsequent operations.
[0096] Furthermore, data processing operations are performed according to the configured cleaning tasks. When business data enters the system, the corresponding cleaning task configuration is found according to the credit scenario corresponding to the data (judged through business logic, such as judging which repayment scenario it belongs to based on repayment records, etc.). Based on the initial fields in the cleaning task, the relevant data is extracted and cleaned (such as removing null values, format conversion, etc.) to ensure that the data can meet the requirements of subsequent clearing and settlement.
[0097] Furthermore, the implementation process and results are verified by comparing the data quality before and after cleaning and checking whether the clearing and settlement results meet expectations, to ensure that the configured cleaning tasks can effectively serve the clearing and settlement business. If problems are found, they are adjusted and repaired in a timely manner.
[0098] The beneficial effect of this design is that by extracting scenario information from third-party cooperation agreements, the details and requirements of various business scenarios (such as loans, repayments and other credit scenarios) can be accurately grasped. Configuring cleaning tasks according to these specific scenarios can ensure that the particularity of the business scenario is fully taken into account during the data cleaning stage, thereby providing an accurate data basis for subsequent clearing and settlement. For example, in a loan scenario, different loan types (housing loans, consumer loans, etc.) may have different data formats and key data points. Accurately configuring cleaning tasks can accurately handle these differences and avoid data confusion.
[0099] In one of the embodiments, the cleaning task includes multiple, and obtaining at least one initial field from multiple fields according to the preconfigured cleaning task includes: obtaining the initial fields corresponding to each scene information from the wide table according to the scene information in the cleaning task, and obtaining at least one initial field.
[0100] In this application, multiple configured cleaning tasks are traversed one by one. Each cleaning task contains specific scene information and the initial field information corresponding thereto (although the value of the initial field has not been obtained at this time, only the corresponding field name and other related information are known).
[0101] Furthermore, for each scenario information in the cleaning task being traversed, the initial field corresponding to the scenario information is obtained from the wide table. For example, if the scenario information is "loan issuance scenario" and the corresponding initial fields are known to be "loan amount", "loan interest rate", "borrower information", etc., then the data of the initial field corresponding to the scenario information is obtained from the wide table. These data are extracted and sorted according to the corresponding relationship of the cleaning tasks. For example, if there are multiple cleaning tasks, the initial field data obtained by each cleaning task should be sorted separately so that corresponding processing can be performed for different scenarios later.
[0102] The beneficial effect of this design is that it can ensure that the initial field data obtained is closely related to the specific scenario information. The data required in different scenarios is often different. By accurately obtaining the initial fields based on the scenario information, it can provide an accurate data basis for subsequent accurate scenario-based analysis and processing (such as clearing and settlement, etc.), avoiding the use of irrelevant or erroneous data for subsequent operations.
[0103] In addition, because the initial fields are obtained in a targeted manner according to the scenario, rather than obtaining all the data in the wide table at once and then filtering, unnecessary data transmission and processing can be reduced. Only key data related to the current scenario can be obtained, which can speed up data acquisition and thus improve the processing efficiency of the entire business process (such as data cleaning, clearing and settlement, etc.).
[0104] Moreover, as the business continues to develop and the scenarios continue to enrich, this approach makes data management and maintenance more convenient. When a new scenario is added or an existing scenario changes, you only need to adjust the cleaning task corresponding to the scenario and the corresponding query statement to obtain the initial field, without causing large-scale confusion in the entire data acquisition and processing process, which facilitates continuous optimization and adjustment of data-related businesses.
[0105] In one embodiment, the target field includes multiple ones, and the clearing strategy of the current partner is configured according to the target field in the initial field, including: responding to the selection instruction of the target field, obtaining the target field, responding to the configuration instruction of the clearing strategy, extracting the operation relationship between each target field in the configuration instruction, and configuring the clearing strategy according to the target field and the operation relationship.
[0106] Among them, the present application may set an interactive interface. On the relevant business operation interface, interactive elements such as check boxes, radio buttons, etc. are set for each target field in the initial field (determine whether it is a multiple-select or single-select target field according to business needs), so that users (such as relevant personnel of the partner) can easily perform selection operations.
[0107] Furthermore, the terminal can monitor the user's operations on these interactive elements. When the user clicks the corresponding button or checks the checkbox to issue a selection instruction, the trigger event sends the selection instruction to the background server. After receiving the selection instruction, the background server parses it and accurately extracts the target field information selected by the user. These target fields can be stored in variables or data structures on the server side for subsequent use.
[0108] Furthermore, a special interface or module is also set up in the background to receive the clearing policy configuration instructions sent by the current partner in a specific way (such as input on a special configuration page, uploading a configuration file, etc.). After receiving the configuration instructions, the background program parses them. If the configuration instructions are in text form, the operation relationship between the target fields is extracted through tools such as string processing functions. For example, the configuration instruction may be expressed as "calculate the clearing amount according to 'target field A+target field B*target field C'", then "target field A+target field B*target field C" is extracted as the operation relationship between the target fields.
[0109] Furthermore, the extracted target fields and the corresponding operation relationships are integrated. The specific role of each target field in the operation relationship is clarified, such as which target field corresponds to the addend in the addition operation and which corresponds to the factor in the multiplication operation, etc., to ensure that the two can be accurately matched for subsequent calculations.
[0110] Based on the above integration results, a complete clearing strategy for the current partner is generated. It can be stored in a specified location on the server in the form of a configuration file, or a special table can be set up in the database to record it for subsequent execution and query.
[0111] The beneficial effect of this embodiment is that by allowing users to directly select the target field on the interface and send clearing strategy configuration instructions to determine the calculation relationship according to their own needs, the participation of users (partners) is greatly improved. Different partners may have different business scenarios and computing requirements. This design allows them to flexibly customize clearing strategies to better adapt to their respective business situations.
[0112] During the entire configuration process, all operations (selecting target fields, extracting operation relationships, etc.) have corresponding records (such as stored in configuration files or database tables), which facilitates the traceability query of the clearing strategy in the future and understands the origin and basis of its configuration. At the same time, when the business changes and the clearing strategy needs to be modified, it is also easy to find relevant information and make adjustments, which improves the maintainability of the system.
[0113] In addition, this application configures the clearing strategy based on the target field selected by the user and the clear operation relationship, which can ensure that the clearing strategy closely fits the actual business needs of the current partner. The clearing results calculated in this way are more accurate and targeted, which helps to reasonably allocate funds, rights and interests, and ensure the smooth development of cooperative business.
[0114] In one embodiment, a clearing strategy is configured according to a target field and an operation relationship, including: constructing an initial polynomial according to the operation relationship, mapping the target field to a variable in the initial polynomial to obtain a target polynomial, and configuring a clearing strategy according to the target polynomial.
[0115] The polynomial here refers to a mathematical expression composed of multiple terms through addition, subtraction, multiplication, division and other operations. The terms can be constants, variables (here is the mapped target field) or expressions composed of variables and constants through operations.
[0116] For example, a common form is A+B*C / D, where A, B, C, and D can be variables representing the target field, and the entire formula is a polynomial. It calculates and processes related data by calculating these variables (target fields) in a predetermined order (multiplication and division followed by addition and subtraction, etc.) to meet the calculation requirements of specific business scenarios such as clearing strategies.
[0117] Specifically, the present application can analyze the operation relationship between the extracted target fields. For example, the operation relationship is "target field A+target field B*target field C", where the addition and multiplication operations constitute the basic operation framework.
[0118] According to the common mathematical expression writing standards, this operation relationship is converted into an initial polynomial form. For the above example, the initial polynomial can be written as: P = X + Y * Z, where X, Y, and Z are temporary variable placeholders, representing the target fields to be mapped later.
[0119] Furthermore, the role and function of each target field in the operation relationship are clarified, and then they are mapped one-to-one with the variables in the initial polynomial.
[0120] Continuing with the above example, if target field A corresponds to the first addend in the addition operation, then target field A is mapped to variable X in the initial polynomial; if target field B is the first factor in the multiplication operation, then target field B is mapped to variable Y; similarly, target field C is mapped to variable Z. After mapping, the target polynomial is obtained. For example, in this example, the target polynomial is: P = target field A + target field B * target field C.
[0121] Furthermore, taking the obtained target polynomial as the core, a complete clearing strategy is configured in combination with other business-related factors (such as data sources, data processing rules, settlement cycles, etc.).
[0122] Determine how to obtain the data of the target field from the data source, and calculate in the order and method specified by the target polynomial. For example, it is necessary to clarify which tables and columns of the database are used to obtain the value of the target field, and specify the time node for calculation (such as daily or monthly settlement), so as to form a complete set of clearing strategies for accurate calculation of the allocation of funds, equity, etc.
[0123] The beneficial effect of this embodiment is that by converting the operation relationship into a polynomial form, the complex operation logic can be made clearer and more intuitive. The core calculation part of the clearing strategy is presented in the form of a polynomial, which makes it easier for relevant personnel (such as business personnel, developers, etc.) to understand and grasp the order of operations and the relationship between various target fields, and reduce errors caused by confusion in operation logic.
[0124] In addition, this design method has good scalability. When the business changes, such as adding new target fields or adjusting the operation relationship, you only need to modify the corresponding variables or adjust the operation based on the polynomial. Moreover, the form of polynomials is universal in many mathematical calculations and programming environments, which facilitates the configuration and execution of clearing strategies on different systems or software platforms, reducing the difficulty of technical implementation.
[0125] In addition, the present application configures the clearing strategy based on the target polynomial to ensure the accuracy of the calculation. Data processing and calculation are performed according to clear polynomial operation rules to avoid the influence of human arbitrariness on the calculation results. At the same time, in the case of multi-person collaboration or multiple configurations of clearing strategies, the polynomial is used as the standard to ensure the consistency of the calculation process and results, so that clearing strategies configured by different personnel in different periods can be calculated according to the same specifications, which improves the credibility of the clearing results.
[0126] In one of the embodiments, corresponding data is obtained from a wide table according to a clearing strategy to perform clearing calculations to obtain a settlement result corresponding to the current partner, including: parsing a target field and a target polynomial in the clearing strategy through a formula parsing engine, obtaining corresponding data from a wide table according to the target field, performing clearing calculations based on the data obtained from the wide table and the target polynomial to obtain a settlement result corresponding to the current partner.
[0127] Among them, the application can select a suitable formula parsing engine. According to the technical environment used (such as programming language, etc.), select a formula parsing engine with strong parsing capabilities. Provide the relevant expression containing the clearing strategy (including the calculation logic of the target field and the target polynomial form) as input to the formula parsing engine.
[0128] Furthermore, the formula parsing engine first performs lexical analysis on the input content, breaking the expression into lexical units, such as operators (+, -, *, / , etc.), brackets, variables representing target fields, and possible constants.
[0129] Furthermore, a grammatical analysis is performed to check the legality of the combination of lexical units according to mathematical grammar rules, and the variables representing the target fields (i.e., the target fields) and the complete structure of the target polynomial composed of these variables are accurately identified. For example, a target polynomial like "A+B*C / D" and the target fields A, B, C, D, etc. are parsed.
[0130] Furthermore, determine the wide table connection and query method. Clarify the database system where the wide table is located and the corresponding connection method. Then obtain data from the wide table based on the name of the target field and other information. Perform query operations in the wide table to extract specific data values corresponding to the target field. For example, if the target field has "order amount" and "commission ratio", the specific order amount value and commission ratio value corresponding to each order are obtained from the wide table.
[0131] Furthermore, the data value corresponding to the target field obtained from the wide table is substituted into the parsed target polynomial. According to the operation order specified by the target polynomial (such as multiplication and division first, then addition and subtraction, etc.), the corresponding programming language or calculation tool is used for calculation. For example, for the target polynomial "A*B*(1-C)", the obtained order amount value is substituted into A, the commission ratio value is substituted into C, and then the calculation is performed.
[0132] After a series of calculation operations, the final value is the settlement result corresponding to the current partner. This result can be stored according to business needs (such as stored in a specific table in the database for subsequent query analysis) or directly output to relevant personnel for review.
[0133] The beneficial effect of this embodiment is that the target field and the target polynomial are accurately parsed through the formula parsing engine, which avoids possible errors in manual interpretation and ensures accurate extraction of the calculation logic. Then, data acquisition and calculation are automatically performed based on the parsing results, which reduces manual intervention, greatly improves the accuracy and efficiency of calculations, and makes the settlement results more reliable.
[0134] In addition, this design can adapt to different clearing strategies and business scenarios. No matter how complex the polynomial form in the clearing strategy is, as long as it can be parsed by the formula parsing engine, the corresponding data processing and calculation can be performed according to the parsing results. It is not limited to a specific calculation mode and can flexibly respond to various changes, such as adding new target fields, adjusting polynomial operation relationships, etc.
[0135] In one of the embodiments, the clearing and settlement method may further include: in response to a configuration instruction of a new partner, selecting a new target field from the initial field, and configuring a clearing strategy corresponding to the new partner according to the new target field.
[0136] Among them, the present application may set up a special interface or functional module for receiving configuration instructions sent by the new partner in a specific way (such as inputting in a special configuration page, uploading a configuration file, etc.). This configuration instruction should include the new partner's relevant requirements and setting information for the clearing strategy.
[0137] After receiving the configuration instruction, the background program is used to parse it. Specific requirements for selecting new target fields from the initial fields are extracted from the instruction, such as the need to select fields related to a specific business type, fields that meet a certain data value range, etc.
[0138] According to the parsed selection requirements, the known initial fields are filtered. For example, if the initial fields related to online sales business are required to be selected, and the data value range of these fields must be greater than zero, then find the fields that meet the conditions such as "online sales" and "online order quantity" from all the initial fields as new target fields.
[0139] Furthermore, based on the business characteristics and needs of the new partner, combined with the selected new target fields, determine the calculation relationship between them. This may require further communication with the new partner to understand how they want to calculate the settlement results through these target fields. For example, if the new target fields include "online sales" and "online order quantity", the calculation relationship may be "clearance amount = online sales × a certain ratio + online order quantity × another ratio".
[0140] Integrate the new target fields and the determined operation relationships to form a complete clearing strategy for the new partner. This can be stored in a specified location on the server in the form of a configuration file, or a special table can be set up in the database to record it for subsequent execution and query.
[0141] The beneficial effect of this embodiment is that it is customized to meet the needs of different partners. Specifically, different partners often have different business models and clearing demands. By responding to the configuration instructions of the new partner to select new target fields and configure exclusive clearing strategies, it can accurately meet the unique needs of each partner, ensure that the clearing results are in line with their actual business situation, and improve the satisfaction of cooperation.
[0142] As the business develops, new partners will continue to join. This implementation method allows the system to easily respond to new situations, and only needs to perform corresponding configuration operations according to the requirements of the new partners. It facilitates the expansion of the system and can quickly adapt to the needs of diversified business development.
[0143] In addition, each new partner's clearing strategy has a clear configuration process and records (such as stored in configuration files or database tables). When you need to query, modify or update a partner's clearing strategy in the future, you can easily find the relevant information and perform operations, which is conducive to the overall management and maintenance of the partner's clearing business.
[0144] In a second aspect, the present application provides a clearing and settlement device, such as Figure 2 As shown, the clearing and settlement device includes: an acquisition module 21, an extraction module 22, a configuration module 23 and a settlement module 24, wherein:
[0145] The acquisition module 21 is used to pull the data to be processed from the pre-configured data source and store the data to be processed into a wide table;
[0146] An extraction module 22, configured to extract at least one initial field from the wide table according to a preconfigured cleaning task;
[0147] Configuration module 23, used to configure the clearing strategy of the current partner according to the target field in the initial field;
[0148] The settlement module 24 is used to obtain corresponding data from the wide table according to the settlement strategy to perform settlement calculations and obtain the settlement result corresponding to the current partner.
[0149] In one embodiment, the acquisition module 21 may also extract scene information according to a pre-configured third-party cooperation agreement, and configure a cleaning task according to the scene information, wherein the cleaning task includes the scene information and a corresponding initial field.
[0150] In one embodiment, the cleaning task includes multiple ones, and the extraction module 22 can obtain the initial fields corresponding to each scene information from the wide table according to the scene information in the cleaning task, and obtain at least one initial field.
[0151] In one embodiment, the target field includes multiple ones, and the configuration module 23 can obtain the target field in response to the selection instruction of the target field, extract the operation relationship between the target fields in the configuration instruction in response to the configuration instruction of the clearing strategy, and configure the clearing strategy according to the target field and the operation relationship.
[0152] In one embodiment, the configuration module 23 may construct an initial polynomial according to the operation relationship, map the target field to the variable in the initial polynomial to obtain the target polynomial, and configure the clearing strategy according to the target polynomial.
[0153] In one embodiment, the settlement module 24 can parse the target field and target polynomial in the clearing strategy through the formula parsing engine, obtain the corresponding data from the wide table according to the target field, perform clearing calculations based on the data obtained from the wide table and the target polynomial, and obtain the settlement result corresponding to the current partner.
[0154] In one embodiment, the settlement module 24 may also select a new target field from the initial field in response to a configuration instruction of the new partner, and configure a clearing strategy corresponding to the new partner according to the new target field.
[0155] In a third aspect, the present application provides a computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the clearing and settlement method provided in any one of the embodiments of the present application in the first aspect are implemented.
[0156] In one embodiment, the computer device may be a server, and its internal structure diagram may be as follows: Figure 3 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the clearing and settlement method is implemented.
[0157] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the clearing and settlement method provided in any embodiment of the present application in the first aspect.
[0158] The computer readable storage medium may be Figure 3 A computer-readable storage medium in the computer device shown.
[0159] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing related hardware through a computer program, and the above-mentioned computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct RAMbus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.
[0160] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0161] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A clearing and settlement method, characterized in that: The method comprises: Pull the data to be processed from a pre-configured data source, and store the data to be processed into a wide table; extracting at least one initial field from the wide table according to a preconfigured cleaning task; Configure the clearing strategy of the current partner according to the target field in the initial field; According to the clearing strategy, corresponding data is obtained from the wide table to perform clearing calculations to obtain the settlement result corresponding to the current partner.
2. The method according to claim 1, characterized in that The method further comprises: Extract scene information based on pre-configured third-party cooperation agreements; The cleaning task is configured according to the scene information, and the cleaning task includes the scene information and a corresponding initial field.
3. The method according to claim 2, characterized in that The cleaning tasks include multiple fields, and obtaining at least one initial field from multiple fields according to the pre-configured cleaning tasks includes: According to the scene information in the cleaning task, the initial fields corresponding to each scene information are acquired from the wide table to obtain the at least one initial field.
4. The method according to claim 1, characterized in that: The target field includes a plurality of fields, and the clearing strategy of the current partner is configured according to the target field in the initial field, including: In response to a selection instruction of the target field, acquiring the target field; In response to the configuration instruction of the clearing strategy, extracting the operation relationship between each of the target fields in the configuration instruction; The clearing strategy is configured according to the target field and the operation relationship.
5. The method according to claim 4, characterized in that The configuring the clearing strategy according to the target field and the operation relationship includes: Constructing an initial polynomial according to the operation relationship; Mapping the target field to the variables in the initial polynomial to obtain a target polynomial; The clearing strategy is configured according to the target polynomial.
6. The method according to claim 5, characterized in that The obtaining corresponding data from the wide table according to the clearing strategy to perform clearing calculations to obtain the settlement result corresponding to the current partner includes: Parsing the target field and the target polynomial in the clearing strategy through a formula parsing engine; Acquire corresponding data from the wide table according to the target field; A clearing calculation is performed based on the data obtained from the wide table and the target polynomial to obtain a settlement result corresponding to the current partner.
7. The method according to claim 1, characterized in that The method further comprises: In response to a configuration instruction from a new partner, selecting a new target field from the initial field; The clearing strategy corresponding to the new partner is configured according to the new target field.
8. A clearing and settlement device, characterized in that: The device comprises: An acquisition module, used to pull the data to be processed from a pre-configured data source and store the data to be processed into a wide table; an extraction module, configured to extract at least one initial field from the wide table according to a preconfigured cleaning task; A configuration module, used to configure the clearing strategy of the current partner according to the target field in the initial field; The settlement module is used to obtain corresponding data from the wide table according to the settlement strategy to perform settlement calculations and obtain the settlement result corresponding to the current partner.
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, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Clearing and settling rule generating method and device
CN106682978A
Data management method and device, server and storage medium
CN111858608A
High-universality settlement method and device capable of configuring settlement strategy and electronic equipment
CN116823369A
Remuneration settlement method, device and equipment and storage medium
CN116957825A