Variable processing method, device, computer equipment and storage medium
By configuring the interface in the local business system to call variable data from other business systems in real time, the problem of low risk control efficiency caused by the dispersion of variable data is solved, and efficient variable data acquisition and risk control efficiency improvement are achieved.
Patent Information
- Application Number
- CN202111295857.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-04
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2041-11-04
AI Technical Summary
In the field of risk control, variable data is dispersed due to the splitting of system clusters and microservice transformation, which increases the burden of reading variable data from a unified database and affects risk control efficiency.
By configuring the variable configuration interface in the local business system, the configuration information entered by the user is obtained, and the variable data of other business systems other than the local business system are called in real time, compiled into custom functions and data acquisition expressions for calculation, avoiding directly obtaining data from the unified database.
It improves the efficiency of variable data acquisition, enhances risk control efficiency, reduces the computational burden of local business systems, and utilizes the calculated variable data of other business systems to improve the efficiency of variable data acquisition of local business systems.
Smart Images

Figure CN114116761B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a variable processing method, apparatus, computer equipment and storage medium. Background Art
[0002] With the rapid development of internet finance, financial service models are also diversifying. In the field of risk control, it is often necessary to process user information, user behavior, environmental information, device information, and external credit information to generate a label or value for risk management. The aforementioned data is variable data, which serves as the foundation for risk control. Risk control strategies are the specific products generated based on variable data. With the cluster splitting and microservice transformation of systems, much data is dispersed across various business systems as domains are split, which hinders the processing of variable data.
[0003] In related technologies, data from various business systems is typically synchronized to a unified database, and variable processing is performed based on this unified database. Since all data must be read from the unified database, a large number of variables increases the data reading burden, resulting in slower reading and reduced computing efficiency, which in turn affects the overall risk control efficiency. Summary of the Invention
[0004] Based on this, it is necessary to provide a variable processing method, device, computer equipment and storage medium that can improve risk control efficiency in response to the above technical problems.
[0005] A variable processing method, the method comprising:
[0006] If a variable configuration request is detected in the local business system, the variable configuration interface is displayed and the configuration information entered by the user in the variable configuration interface is obtained. The configuration information includes configuration parameters, calculation logic templates and filter conditions. The configuration information is used to calculate the target variable data;
[0007] In response to the compilation instruction, the calculation logic template is compiled into a custom function, and the configuration parameters and filter conditions are compiled into a data acquisition expression based on a preset data source, where the preset data source at least includes variable data called in real time from other business systems other than the local business system;
[0008] If a calculation request for target variable data is detected, the variable data that the target variable data depends on for calculation is obtained through a data acquisition expression, and the obtained variable data is calculated based on a custom function to obtain the target variable data.
[0009] In one embodiment, the preset data source also includes locally stored data of the local business system and message data obtained from a unified database.
[0010] In one embodiment, obtaining variable data relied upon when calculating target variable data through a data acquisition expression includes:
[0011] Parse the data acquisition expression to obtain a list of variables that the target variable data depends on and that need to be calculated;
[0012] Based on the variable list, calculate the variable data that the target variable data depends on.
[0013] In one embodiment, calculating the variable data on which the target variable data depends based on the variable list includes:
[0014] Determine variable dependencies in a variable list;
[0015] Based on the variable dependency, the variables in the variable list are calculated in sequence to obtain the variable data on which the target variable data depends.
[0016] In one embodiment, based on the variable dependency, the variables in the variable list are calculated sequentially, including:
[0017] The variables in the variable list are divided into two categories, namely the first category variables and the second category variables. The calculation process of the second category variables depends on the calculation results of the first category variables.
[0018] Calculate the first type of variables, and based on the calculation results of the first type of variables, calculate the second type of variables.
[0019] In one embodiment, calculating the first type of variables includes:
[0020] The first category of variables is divided into three sub-categories: variables calculated based on local storage data of the local business system, variables calculated based on variable data called in real time by other business systems, and variables calculated based on context data of the calculation request;
[0021] Based on the variable dependencies, each variable under the three subcategories is calculated in parallel.
[0022] In one embodiment, the variable data on which the target variable data depends is calculated based on the variable list, including:
[0023] If there are variables that meet the preset conditions in the variable list, then when the preset time point corresponding to the preset conditions is reached, the variables that meet the preset conditions are calculated to obtain the variable data on which the target variable data depends. The preset conditions are used to indicate the variables that need to be calculated when the preset time point is reached.
[0024] A variable processing device, comprising:
[0025] The first acquisition module is used to display the variable configuration interface when a variable configuration request is detected in the local business system, and obtain the configuration information entered by the user in the variable configuration interface. The configuration information includes configuration parameters, calculation logic templates and filtering conditions. The configuration information is used to calculate the target variable data;
[0026] A compilation module, configured to compile the calculation logic template into a custom function in response to a compilation instruction, and compile the configuration parameters and filter conditions into a data acquisition expression based on a preset data source, wherein the preset data source at least includes variable data called in real time from other business systems other than the local business system;
[0027] The second acquisition module is used to obtain the variable data that the target variable data depends on when calculating the target variable data through a data acquisition expression when a calculation request for the target variable data is detected, and calculate the obtained variable data based on a custom function to obtain the target variable data.
[0028] A computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are performed:
[0029] If a variable configuration request is detected in the local business system, the variable configuration interface is displayed and the configuration information entered by the user in the variable configuration interface is obtained. The configuration information includes configuration parameters, calculation logic templates and filter conditions. The configuration information is used to calculate the target variable data;
[0030] In response to the compilation instruction, the calculation logic template is compiled into a custom function, and the configuration parameters and filter conditions are compiled into a data acquisition expression based on a preset data source, where the preset data source at least includes variable data called in real time from other business systems other than the local business system;
[0031] If a calculation request for target variable data is detected, the variable data that the target variable data depends on for calculation is obtained through a data acquisition expression, and the obtained variable data is calculated based on a custom function to obtain the target variable data.
[0032] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:
[0033] If a variable configuration request is detected in the local business system, the variable configuration interface is displayed and the configuration information entered by the user in the variable configuration interface is obtained. The configuration information includes configuration parameters, calculation logic templates and filter conditions. The configuration information is used to calculate the target variable data;
[0034] In response to the compilation instruction, the calculation logic template is compiled into a custom function, and the configuration parameters and filter conditions are compiled into a data acquisition expression based on a preset data source, where the preset data source at least includes variable data called in real time from other business systems other than the local business system;
[0035] If a calculation request for target variable data is detected, the variable data that the target variable data depends on for calculation is obtained through a data acquisition expression, and the obtained variable data is calculated based on a custom function to obtain the target variable data.
[0036] The above-mentioned variable processing method, device, computer equipment and storage medium, because the preset data source is no longer limited to a unified database used by all business systems, but different business systems can call their own variable data in real time, thereby avoiding the burden of obtaining data from the unified database, and thus improving the efficiency of obtaining variable data. As a result, the efficiency of risk control can be improved. In addition, since variable data can call variable data of other business systems in real time, these variable data can be calculated by other business systems in advance, or can be calculated and provided by other business systems in real time, without the need for local business systems to calculate them themselves, thereby improving the efficiency of local business systems in obtaining variable data, and thus improving risk control efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 Schematic diagram of an implementation scenario of a variable processing process in one embodiment;
[0038] Figure 2 Schematic diagram of a process for variable processing in one embodiment;
[0039] Figure 3 A schematic diagram of a configuration interface in one embodiment;
[0040] Figure 4 A schematic flow chart of a variable processing method according to another embodiment;
[0041] Figure 5 is a flow chart of a variable calculation process in another embodiment;
[0042] Figure 6 is a structural block diagram of a variable processing device in one embodiment;
[0043] Figure 7 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0045] It is understood that the terms "first," "second," and the like used herein may be used to describe various professional terms, but unless otherwise specified, these professional terms are not limited by these terms. These terms are merely used to distinguish one professional term from another. For example, the third preset threshold and the fourth preset threshold may be the same or different without departing from the scope of this application.
[0046] With the rapid development of internet finance, financial service models are also diversifying. In the field of risk control, it is often necessary to process user information, user behavior, environmental information, device information, and external credit information to generate a label or value for risk management. The aforementioned data is variable data, which serves as the foundation for risk control. Risk control strategies are the specific products generated based on variable data. With the cluster splitting and microservice transformation of systems, much data is dispersed across various business systems as domains are split, which hinders the processing of variable data.
[0047] In related technologies, data from various business systems is typically synchronized to a unified database, and variable processing is performed based on this unified database. Since all data must be read from the unified database, a large number of variable data increases the data reading burden, resulting in slower reading and reduced computing efficiency, which in turn affects the overall risk control efficiency.
[0048] In view of the above problems, the present invention provides a variable processing method, which can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 displays the variable configuration interface locally, provides an input device, and connects to the local business system. The server 104 corresponds to other business systems except the local business system, and the terminal 102 communicates with the server 104 through the network. Take the terminal 102 and the server 104 for collaborating to execute the variable processing method provided in the embodiment of the present application as an example for explanation. If the terminal 102 detects a variable configuration request locally, the variable configuration interface is displayed for the user to configure the target variable. After the target variable is configured, if the user-configured target variable is needed, the variable data can be called from other business systems in real time based on the configuration information to calculate the user-configured target variable and obtain the target variable data.
[0049] The server can be a stand-alone physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The server can have a separate data storage system to store data. The terminal can be a smartphone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, a vehicle terminal, a smart television, and the like, but is not limited thereto. The terminal and the server can be directly or indirectly connected through wired or wireless communication, which is not limited in the present application.
[0050] In some embodiments, referring to Figure 2 , a variable processing method is provided. The method is applied to the terminal 102 in Figure 1 for example, and includes the following steps:
[0051] 202. If a variable configuration request is detected in the local business system, a variable configuration interface is displayed, and configuration information input by a user in the variable configuration interface is obtained. The configuration information includes configuration parameters, a calculation logic template, and filtering conditions. The configuration information is used to calculate target variable data.
[0052] In the above steps, the local business system can refer to a local server connected to the terminal 102, or directly refer to the terminal 102, which is not limited in the embodiments of the present application. In fact, in the field of risk control, the basic business data of the local business system can also be used when calculating variable data, and the local business system is usually set on a local server. The variable configuration request can be initiated by a user (such as a business personnel), and the variable configuration interface is a visual interface that can include text boxes and selection boxes for user input, which can be displayed by the terminal 102. For specific examples, refer to Figure 3 , and the arrangement and content of the variable configuration interface are not limited in the embodiments of the present application.
[0053] The calculation logic template can be used to specify what kind of calculation is performed, the configuration parameters are specific constant parameters used when performing the calculation, and the filtering conditions are used as a filtering basis for subsequent variable data that depends on the target variable data. In Figure 3 , the user can select the type of calculation logic template, such as summation calculation, through a drop-down option. The user can also configure parameters, such as a time slice of 30 days in Figure 3 . It should be noted that in addition to the lookup item (such as in Figure 3 , the amount of the order payment success is the lookup item), the filtering condition can also include the data type of the lookup item, such as the string type in Figure 3 . After the user inputs the configuration information, the terminal 102 can obtain the above configuration information.
[0054] 204. In response to the compilation instruction, based on a preset data source, the configuration parameters and the filter conditions are compiled into a data acquisition expression, and the calculation logic template is compiled into a custom function. The preset data source at least includes variable data called in real time from other business systems other than the local business system.
[0055] The compilation instruction can be triggered by the user. For example, after the user completes the configuration in the variable configuration interface, the compilation instruction can be triggered through the compilation instruction trigger element in the variable configuration interface. After detecting the compilation instruction, the terminal 102 can respond to it. The preset data source can be provided by other business systems. It is understandable that other business systems besides the local business system also have variable data. When the local business system performs variable calculations, it may need to rely on variable data already calculated by other business systems, or other business systems may calculate the corresponding variable data in real time based on the configured variables for use by the local business system.
[0056] The data acquisition expression can be a SQL (Structured Query Language) expression. The custom function can refer to processing logic that performs further calculations on the data acquired by the data acquisition expression, such as statistical logic for the number of recent consecutive times or calculation logic for distance based on longitude and latitude, which is not specifically limited in this embodiment of the application. The custom function can be included in the data acquisition expression, which is not specifically limited in this embodiment of the application.
[0057] 206. If a calculation request for target variable data is detected, the variable data relied upon for calculating the target variable data is obtained through a data acquisition expression, and the obtained variable data is calculated based on a custom function to obtain the target variable data.
[0058] Among them, the calculation request can be triggered by the user through the terminal 102. If the local business system needs to use the target variable during the business processing, the calculation request can also be triggered. In addition, if other business systems need to use the target variable, the calculation request can also be triggered. The embodiment of the present application does not make specific restrictions on this. It is understandable that, no matter which of the above situations, the calculation request can be triggered and transmitted by the corresponding interface. The variable data relied on when calculating the target variable data can be used as the data basis of the calculation process, and the custom function can be used as the processing logic to calculate the target variable data.
[0059] The method provided by the embodiment of the present application is that the preset data source is no longer limited to a unified database used by all business systems, but different business systems can call their own variable data in real time, thereby avoiding the burden of obtaining data from the unified database, and thus improving the efficiency of obtaining variable data. As a result, the efficiency of risk control can be improved. In addition, since variable data can call variable data of other business systems in real time, these variable data can be calculated by other business systems in advance, or can be calculated and provided by other business systems in real time without the need for local business systems to calculate them themselves, thereby improving the efficiency of local business systems in obtaining variable data, and thus improving risk control efficiency.
[0060] In some embodiments, see Figure 4 , provides a variable processing method. This method is applied to Figure 1 Taking the terminal 102 in FIG. 1 as an example, the method includes the following steps:
[0061] 402. If a variable configuration request is detected in the local business system, the variable configuration interface is displayed, and the configuration information entered by the user in the variable configuration interface is obtained. The configuration information includes configuration parameters, calculation logic templates, and filter conditions. The configuration information is used to calculate the target variable data.
[0062] The process can be referred to the description of the above embodiment and will not be described again here.
[0063] 404. In response to the compilation instruction, the calculation logic template is compiled into a custom function. Based on the preset data source, the reserved parameters in the data acquisition template are replaced with configuration parameters. The preset data source, the filter conditions and the replaced data acquisition template are combined to obtain a data acquisition expression. The preset data source at least includes variable data called in real time from other business systems other than the local business system.
[0064] It's understandable that data acquisition templates often have some reserved parameters. For example, in the SQL template "select xxx from service," the "xxx" is a reserved parameter. In actual implementation, these reserved parameters can be replaced with configuration parameters. The preset data source corresponds to the "service" in the SQL template. "Service" can represent variable data called in real time from other business systems.
[0065] 406. If a calculation request for target variable data is detected, the variable data relied upon for calculating the target variable data is obtained through a data acquisition expression, and the obtained variable data is calculated based on a custom function to obtain the target variable data.
[0066] The process can be referred to the description of the above embodiment and will not be described again here.
[0067] The method provided in the embodiment of the present application, since the business logic is newly abstracted and templated during the variable processing process, the user only needs to configure parameters, calculation logic templates and filtering conditions based on their own needs, and then they can combine them into variables and realize variable processing. There is no need for R&D personnel to re-develop the corresponding product based on needs through a series of processes such as coding, verification and product release, thereby improving the efficiency of variable processing.
[0068] In some embodiments, the preset data source also includes locally stored data of the local business system and message data obtained from a unified database. The locally stored data of the local business system is historical data saved from previous variable processing processes, while the message data obtained from the unified database is variable data generated by the local business system based on demand self-inspection.
[0069] The method provided in the embodiments of the present application can utilize multiple data sources, thereby avoiding the burden of acquiring data from a unified database, thereby improving the efficiency of acquiring variable data. This can improve risk control efficiency. Furthermore, since variable data can be acquired from locally stored data, previous processing results can be reused, avoiding duplicate processing. This can also improve the efficiency of local business systems in acquiring variable data, thereby improving risk control efficiency.
[0070] In some embodiments, the embodiments of the present application do not specifically limit the method of obtaining the variable data that the target variable data depends on when calculating the target variable data through the data acquisition expression, including but not limited to: parsing the data acquisition expression to obtain a list of variables that the target variable data depends on and to be calculated; based on the variable list, calculating the variable data that the target variable data depends on.
[0071] Since data acquisition expressions can represent the variable data to be requested, such as the "xxx" in "select xxx fromservice" being the requested variable data, the data acquisition expression can be used to determine the variable data requested when calculating the target variable data. Thus, a variable list can be formed from these requested variable data. It should be noted that the variable list here can be composed of the variable names of the requested variable data, and the "list" in the variable list can be a collection of variable names. After determining the variable list, the variable data in these variable lists can be calculated first, and then the target variable data can be calculated.
[0072] The method provided in the embodiment of the present application can automatically parse out the parameters selected when configuring the parameters based on the data acquisition expression, thereby improving the efficiency of obtaining variable data.
[0073] In some embodiments, the embodiments of the present application do not specifically limit the method of calculating the variable data on which the target variable data depends based on the variable list, including but not limited to: determining the variable dependency relationship in the variable list; based on the variable dependency relationship, calculating the variables in the variable list in sequence to obtain the variable data on which the target variable data depends.
[0074] It is understandable that some variables cannot be processed until the processing of certain previous variables is completed. In other words, the variable data obtained by the processing of these previous variables can be processed before it can be processed. Therefore, when calculating the variable data on which the target variable data depends, the dependency relationship of these variable data can be determined first, and then the variable data on which the target variable data depends can be calculated in sequence.
[0075] The method provided in the embodiments of the present application can sequentially calculate variable data based on dependency relationships, making the data source of each variable data clearer. This makes it easier to identify the error link in subsequent calculations. Furthermore, due to the dependency relationships, previously calculated variable data can be reused, thereby improving variable data processing efficiency.
[0076] In some embodiments, the embodiments of the present application do not specifically limit the method of calculating the variables in the variable list in sequence based on the variable dependency relationship, including but not limited to: recording the variables in the variable list into two categories, namely first-category variables and second-category variables, and the calculation process of the second-category variables depends on the calculation results of the first-category variables; calculating the first-category variables, and calculating the second-category variables based on the calculation results of the first-category variables.
[0077] Among them, the first category of variables refers to variables that can be directly obtained or directly calculated based on directly obtainable variable data, while the second category of variables refers to variables that need to be calculated after certain variables in the first category are calculated. In addition, the calculation process of the first category of variables and the second category of variables can correspond to different processing logics according to needs, such as the statistical logic of the most recent consecutive times mentioned above or the calculation logic of obtaining distance based on longitude and latitude, etc., which are not specifically limited in this application.
[0078] The method provided in the embodiments of the present application can sequentially calculate variable data based on dependency relationships, making the data source of each variable data clearer. This makes it easier to identify the error link in subsequent calculations. Furthermore, due to the dependency relationships, previously calculated variable data can be reused, thereby improving variable data processing efficiency.
[0079] In some embodiments, the embodiments of the present application do not specifically limit the method of calculating the first category of variables, including but not limited to: dividing the first category of variables into three subcategory variables; the three subcategory variables are variables calculated based on the local storage data of the local business system, variables calculated based on the variable data called in real time by other business systems, and variables calculated based on the context data of the calculation request; based on the variable dependency relationship, each variable under the three subcategories is calculated in parallel and in sequence.
[0080] Among them, the variables calculated based on the locally stored data of the local business system are variables that need to be calculated based on the historical data saved by the previous variable processing process of the local business system. It is understandable that since the historical data stored locally can be directly obtained, these variables can naturally be calculated without relying on other variable data. The variables calculated based on the variable data called in real time by other business systems are variables that need to be calculated based on the historical data saved by the previous variable processing process of other business systems or the variable data obtained by real-time variable processing of other business systems. It is understandable that the historical data stored in other business systems can be directly obtained. Even if other business systems require real-time variable processing, they can be executed synchronously after receiving the request, which will not affect the acquisition efficiency of this type of subclass variables.
[0081] Since the variable processing process is usually not an independent process, a certain business processing process generally involves the processing of multiple variables. Therefore, for a certain variable, it may only correspond to a certain variable processing process in the business processing process. Therefore, the business processing process may request the processing of multiple variables, and there may be more than one calculation request for processing variables. For a certain calculation request and the variables requested to be processed by the calculation request, the context data of the calculation request is the context variable processing process corresponding to the processing process of the variable in the business processing process. It can be understood that these context variable processing processes usually also have some variable data that can be used to calculate the variable, and these variable data can usually also be directly obtained from the context variable processing process.
[0082] The method provided in the embodiment of the present application can calculate variable data sequentially based on dependency relationships, thereby making the data source of each variable data relatively clear, and it is also convenient to index the link where the calculation error occurs later. In addition, due to the existence of dependency relationships, the variable data previously calculated can also be reused, thereby improving the processing efficiency of the variable data. Furthermore, since the variable data can be carefully classified, the variable data that can be directly obtained is determined to avoid repeated processing, thereby improving the processing efficiency of the variable data.
[0083] In some embodiments, the embodiments of the present application do not specifically limit the method of calculating the variable data on which the target variable data depends based on the variable list, including but not limited to: if there are variables that meet the preset conditions in the variable list, then when the preset time point corresponding to the preset conditions is reached, the variables that meet the preset conditions are calculated to obtain the variable data on which the target variable data depends, and the preset conditions are used to indicate the variables that need to be calculated when the preset time point is reached.
[0084] It is understandable that, under certain triggering conditions, some variables can be calculated in advance. For example, if it is determined that a certain user will check all of his or her own expenses for the past month, then when it is detected that the user has completed login, all of the user's expenses for the past month can be prepared in advance. Therefore, in an embodiment of the present application, a preset time point can be set in advance. Usually in the user's business operation process, there may be some triggering operations before a certain variable data is needed, and these triggering operations correspond to the above-mentioned preset time points. For example, in the above example, it is detected that the user has completed login, which can be a preset time point. When the preset time point is triggered, which variables need to be calculated can also be determined in advance. For example, it can be determined based on the user's operating habits, or based on the logic of the business operation process (such as certain variable data will inevitably be used in the subsequent process of certain business operation processes).
[0085] Based on the above description, if the variable list contains variables that need to be calculated when a preset time point is reached, these variables can be calculated in advance when the preset time point is reached to prepare for the subsequent variable processing process. It should be noted that since these variables are also variables, the calculation of these variables triggered by the preset time point can also refer to the method flow described in the above embodiment, and will not be repeated here.
[0086] The method provided in the embodiment of the present application can pre-set a preset time point, and during the variable processing process, when the preset time point is triggered, the variable data required for the subsequent variable processing process is prepared in advance, thereby improving the processing efficiency of the variable data.
[0087] Based on the relevant description of the above embodiment, for ease of understanding, the variable processing process is now explained by taking the variable logic defined in the actual interface as an example. Specifically:
[0088] (1) First, the commonly used variable data calculation methods are abstracted into calculation logic templates. The templates reserve some adjustable parameters for user configuration. For example, the total amount of historical user transactions can be abstracted into a historical statistics template, and the statistical days, the amount field, and the filtering conditions (such as success, channel, or merchant, etc.) can be reserved.
[0089] (2) User configures parameters in the interface, such as selecting the amount of successful transactions in 30 days, and selects filtering conditions to define the variable.
[0090] (3) If the user's configuration information is manually reviewed and passed, the user can select to compile, thereby compiling the configuration information into a SQL expression (which can include custom functions) and publishing and running.
[0091] (4) When the interface calls for the variable, the business system parses the SQL expression and automatically prepares the dependent data according to the definition of the SQL expression.
[0092] (5) The SQL expression is executed according to the prepared dependent data, and the calculation result is output.
[0093] The above process is the main process of variable processing. In actual implementation, the process of compiling configuration information into a SQL expression is as follows:
[0094] (1) First, a fixed template SQL, i.e., a data acquisition expression, is predefined, and the interface parameters are replaced with the parameters in the SQL during compilation.
[0095] (2) The compiled SQL expression can be different for different data sources. For example, the compiled SQL for calculation based on a request message is select xxx from current, the compiled SQL for calculation based on historical data is select xxx from history, and the compiled SQL for calculation based on service query of other system data is select xxx from service.
[0096] (3) The SQL expression supports standard SQL syntax, and also implements some complex logic, which can be encapsulated as custom functions, thereby enabling the implementation of logic that was not supported by the SQL expression before. For example, the lastRepeat function can implement the logic of counting the number of consecutive times, and the distance function can implement the logic of calculating the distance based on latitude and longitude.
[0097] In addition, the data preparation and execution of the variable are implemented as shown in Figure 5 , and the specific process is as follows:
[0098] (1) Convert the request into a standard context object for easy calculation;
[0099] (2) A list of variables that need to be calculated for the parsing request, including the variables specified by the interface and the variables that should be calculated at the current time point configured in advance. When obtaining variables, they can be obtained by variable classification, such as obtaining all variables under a certain classification; or they can be obtained by variable set, such as obtaining variables in a specific variable set; or they can be obtained by variable type, such as obtaining variables of a specific variable type; it should be noted that the variables that should be calculated at the current time point configured in advance also correspond to the preset time point in the above embodiment, and this process can be asynchronous processing;
[0100] (3) Based on the variable template and the parameters selected when defining the variable, the variables that the variables to be calculated in the previous step depend on are automatically parsed.
[0101] (4) Based on the data sources and dependencies of the variables, the variables are divided into four categories. The first category is variables calculated based on historical data, the second category is variables that need to obtain external system data based on service calls, the third category is variables based on request context data and does not depend on the first two categories of variables, and the fourth category is variables that depend on the first three categories of variables. Among them, the above dependencies are reflected in the order of calculation and processing, and the dependent variables will be processed first. Based on the dependency relationship, the data source is relatively clear, and data reuse can be achieved.
[0102] (5) Multiple threads are launched in parallel to calculate the three types of variables mentioned above. The first step in the calculation is to prepare the data, such as querying historical data or calling external services. The second step is to sort the variables according to their dependencies. The third step is to execute the variable calculations in order using the prepared data.
[0103] (6) After the calculation of the first three types of variables is completed, the calculation of the fourth type of variables begins.
[0104] It should be understood that although Figure 1 、 Figure 2 and Figure 3 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. In addition, Figure 1 、 Figure 2 and Figure 3 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The order of execution of these steps or stages is not necessarily one by one, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.
[0105] It should be noted that the technical solutions described above can be implemented as independent embodiments in the actual implementation process, or they can be combined with each other and implemented as combined embodiments. In addition, when describing the contents of the above-mentioned embodiments of the present invention, different embodiments are described in a corresponding order based on the idea of convenient description, such as according to the order of data flow, rather than limiting the execution order between different embodiments. Accordingly, in the actual implementation process, if it is necessary to implement multiple embodiments provided by the present invention, it is not necessarily necessary to follow the execution order provided when describing the embodiments of the present invention, but the execution order between different embodiments can be arranged according to needs.
[0106] In combination with the contents of the above embodiments, in one embodiment, Figure 6 As shown, a variable processing device is provided, including: a first acquisition module 602, a compilation module 604 and a second acquisition module 606, wherein:
[0107] The first acquisition module 602 is configured to, upon detecting a variable configuration request in the local business system, display a variable configuration interface and obtain configuration information entered by the user in the variable configuration interface. The configuration information includes configuration parameters, calculation logic templates, and filter conditions. The configuration information is used to calculate target variable data.
[0108] Compilation module 604, configured to compile the calculation logic template into a custom function in response to a compilation instruction, and compile the configuration parameters and filter conditions into a data acquisition expression based on a preset data source, where the preset data source at least includes variable data called in real time from other business systems other than the local business system;
[0109] The second acquisition module 606 is used to obtain the variable data that the target variable data depends on when calculating the target variable data through a data acquisition expression when a calculation request for the target variable data is detected, and calculate the obtained variable data based on a custom function to obtain the target variable data.
[0110] In one embodiment, the preset data source also includes locally stored data of the local business system and message data obtained from the unified database.
[0111] In one embodiment, the second acquisition module 606 includes:
[0112] A parsing unit, used to parse the data acquisition expression to obtain a list of variables to be calculated that the target variable data depends on;
[0113] A calculation unit is configured to calculate variable data on which the target variable data depends based on the variable list. In one embodiment, the calculation unit includes:
[0114] Determine subunits for determining variable dependencies in a variable list;
[0115] The calculation subunit is used to calculate the variables in the variable list in sequence based on the variable dependency relationship to obtain the variable data on which the target variable data depends.
[0116] In one embodiment, the calculation subunit is used to record the variables in the variable list into two categories, namely first-category variables and second-category variables, and the calculation process of the second-category variables depends on the calculation results of the first-category variables; the first-category variables are calculated, and the second-category variables are calculated based on the calculation results of the first-category variables.
[0117] In one embodiment, the computing subunit is used to divide the first category of variables into three subcategory variables; the three subcategory variables are variables calculated based on the local storage data of the local business system, variables calculated based on the variable data called in real time by other business systems, and variables calculated based on the context data of the calculation request; based on the variable dependency, each variable under the three subcategories is calculated in parallel and in sequence.
[0118] In one embodiment, the calculation unit is used to calculate the variables that meet the preset conditions when there are variables that meet the preset conditions in the variable list, and obtain the variable data on which the target variable data depends when the preset time point corresponding to the preset conditions is reached. The preset conditions are used to indicate the variables that need to be calculated when the preset time point is reached.
[0119] The device provided by the embodiment of the present invention is no longer limited to a unified database used by all business systems as the preset data source, but different business systems can call their own variable data in real time, thereby avoiding the burden of obtaining data from the unified database, thereby improving the efficiency of obtaining variable data. As a result, the efficiency of risk control can be improved. In addition, since variable data can call variable data of other business systems in real time, these variable data can be calculated by other business systems in advance, or can be calculated and provided by other business systems in real time without the need for local business systems to calculate them themselves, thereby improving the efficiency of local business systems in obtaining variable data, thereby improving risk control efficiency.
[0120] The specific definition of the variable processing device can be found in the definition of the variable processing method above and will not be repeated here. Each module in the above-mentioned variable processing device can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software so that the processor can call and execute the operations corresponding to each of the above modules.
[0121] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 7 As shown. The computer device includes a processor, a memory, and a network interface connected via a system bus. 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, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store preset thresholds. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a variable processing method is implemented.
[0122] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0123] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0124] If a variable configuration request is detected in the local business system, the variable configuration interface is displayed and the configuration information entered by the user in the variable configuration interface is obtained. The configuration information includes configuration parameters, calculation logic templates and filter conditions. The configuration information is used to calculate the target variable data;
[0125] In response to the compilation instruction, the calculation logic template is compiled into a custom function, and the configuration parameters and filter conditions are compiled into a data acquisition expression based on a preset data source, where the preset data source at least includes variable data called in real time from other business systems other than the local business system;
[0126] If a calculation request for target variable data is detected, the variable data that the target variable data depends on for calculation is obtained through a data acquisition expression, and the obtained variable data is calculated based on a custom function to obtain the target variable data.
[0127] In one embodiment, when the processor executes the computer program, the preset data source further includes locally stored data of the local business system and message data obtained from the unified database.
[0128] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0129] Parse the data acquisition expression to obtain a list of variables that the target variable data depends on and that need to be calculated;
[0130] Based on the variable list, calculate the variable data that the target variable data depends on.
[0131] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0132] Determine variable dependencies in a variable list;
[0133] Based on the variable dependency, the variables in the variable list are calculated in sequence to obtain the variable data on which the target variable data depends.
[0134] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0135] The variables in the variable list are divided into two categories, namely the first category variables and the second category variables. The calculation process of the second category variables depends on the calculation results of the first category variables.
[0136] Calculate the first type of variables, and based on the calculation results of the first type of variables, calculate the second type of variables.
[0137] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0138] The first category of variables is divided into three sub-categories: variables calculated based on local storage data of the local business system, variables calculated based on variable data called in real time by other business systems, and variables calculated based on context data of the calculation request.
[0139] Based on the variable dependencies, each variable under the three subcategories is calculated in parallel.
[0140] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0141] If there are variables that meet the preset conditions in the variable list, then when the preset time point corresponding to the preset conditions is reached, the variables that meet the preset conditions are calculated to obtain the variable data on which the target variable data depends. The preset conditions are used to indicate the variables that need to be calculated when the preset time point is reached.
[0142] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0143] If a variable configuration request is detected in the local business system, the variable configuration interface is displayed and the configuration information entered by the user in the variable configuration interface is obtained. The configuration information includes configuration parameters, calculation logic templates and filter conditions. The configuration information is used to calculate the target variable data;
[0144] In response to the compilation instruction, the calculation logic template is compiled into a custom function, and the configuration parameters and filter conditions are compiled into a data acquisition expression based on a preset data source, where the preset data source at least includes variable data called in real time from other business systems other than the local business system;
[0145] If a calculation request for target variable data is detected, the variable data that the target variable data depends on for calculation is obtained through a data acquisition expression, and the obtained variable data is calculated based on a custom function to obtain the target variable data.
[0146] In one embodiment, when the computer program is executed by the processor, the preset data source further includes local storage data of the local business system and message data obtained from the unified database.
[0147] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0148] Parse the data acquisition expression to obtain a list of variables that the target variable data depends on and that need to be calculated;
[0149] Based on the variable list, calculate the variable data that the target variable data depends on.
[0150] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0151] Determine variable dependencies in a variable list;
[0152] Based on the variable dependency, the variables in the variable list are calculated in sequence to obtain the variable data on which the target variable data depends.
[0153] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0154] The variables in the variable list are divided into two categories, namely the first category variables and the second category variables. The calculation process of the second category variables depends on the calculation results of the first category variables.
[0155] Calculate the first type of variables, and based on the calculation results of the first type of variables, calculate the second type of variables.
[0156] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0157] The first category of variables is divided into three sub-categories: variables calculated based on local storage data of the local business system, variables calculated based on variable data called in real time by other business systems, and variables calculated based on context data of the calculation request;
[0158] Based on the variable dependencies, each variable under the three subcategories is calculated in parallel.
[0159] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0160] If there are variables that meet the preset conditions in the variable list, then when the preset time point corresponding to the preset conditions is reached, the variables that meet the preset conditions are calculated to obtain the variable data on which the target variable data depends. The preset conditions are used to indicate the variables that need to be calculated when the preset time point is reached.
[0161] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0162] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the 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 at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0163] The technical features of the above embodiments can 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.
[0164] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art could make various modifications and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.
Claims
1. A variable processing method, characterized in that: The method comprises: If a variable configuration request is detected in the local business system, the variable configuration interface is displayed, and configuration information entered by the user in the variable configuration interface is obtained. The configuration information includes configuration parameters, calculation logic templates, and filter conditions. The configuration information is used to calculate the target variable data; In response to the compilation instruction, the calculation logic template is compiled into a custom function, and based on a preset data source, the configuration parameters and the filter conditions are compiled into a data acquisition expression, wherein the preset data source at least includes variable data called in real time from other business systems other than the local business system; the preset data source also includes locally stored data of the local business system and message data obtained from a unified database; If a calculation request for the target variable data is detected, the data acquisition expression is parsed to obtain a list of variables that the target variable data depends on and is to be calculated; based on the variable list, the variable data that the target variable data depends on is calculated, and the obtained variable data is calculated based on the custom function to obtain the target variable data; the variable list consists of first-category variables and second-category variables, and the first-category variables are directly obtained or based on directly obtained variable data; the calculation method of the first-category variables includes: dividing the first-category variables into three sub-category variables; the three sub-category variables are variables calculated based on the locally stored data of the local business system, variables calculated based on the variable data called in real time by the other business systems, and variables calculated based on the context data of the calculation request; based on the variable dependency relationship, each variable under the three sub-categories is calculated in parallel and in sequence.
2. The method according to claim 1, characterized in that The step of calculating the variable data on which the target variable data depends based on the variable list includes: Determining variable dependencies in the variable list; Based on the variable dependency, the variables in the variable list are calculated in sequence to obtain the variable data on which the target variable data depends.
3. The method according to claim 2, characterized in that The step of sequentially calculating the variables in the variable list based on the variable dependency relationship includes: The variables in the variable list are divided into two categories, namely first category variables and second category variables, and the calculation process of the second category variables depends on the calculation results of the first category variables; The first type of variables are calculated, and based on the calculation results of the first type of variables, the second type of variables are calculated.
4. The method according to claim 1, wherein The step of calculating the variable data on which the target variable data depends based on the variable list includes: If there are variables that meet the preset conditions in the variable list, then when the preset time point corresponding to the preset conditions is reached, the variables that meet the preset conditions are calculated to obtain the variable data on which the target variable data depends. The preset conditions are used to indicate the variables that need to be calculated when the preset time point is reached.
5. A variable processing device, characterized in that: The device comprises: A first acquisition module is configured to, upon detecting a variable configuration request in a local business system, display a variable configuration interface and acquire configuration information entered by a user in the variable configuration interface, wherein the configuration information includes configuration parameters, calculation logic templates, and filter conditions, and the configuration information is used to calculate target variable data; a compiling module, configured to compile the calculation logic template into a custom function in response to a compiling instruction, and compile the configuration parameters and the filtering conditions into a data acquisition expression based on a preset data source, wherein the preset data source at least includes variable data called in real time from other business systems other than the local business system; the preset data source also includes locally stored data of the local business system and message data acquired from a unified database; The second acquisition module is used to parse the data acquisition expression when a calculation request for the target variable data is detected, and obtain a list of variables that the target variable data depends on and is to be calculated; based on the variable list, calculate the variable data that the target variable data depends on, and calculate the acquired variable data based on the custom function to obtain the target variable data; the variable list consists of first-category variables and second-category variables, and the first-category variables are directly acquired or based on directly acquired variable data; the calculation method of the first-category variables includes: dividing the first-category variables into three sub-category variables; the three sub-category variables are variables calculated based on the local storage data of the local business system, variables calculated based on the variable data called in real time by the other business systems, and variables calculated based on the context data of the calculation request; based on the variable dependency relationship, each variable under the three sub-categories is calculated in parallel and in sequence.
6. The device according to claim 5, characterized in that The second acquisition module is further configured to: The variables in the variable list are divided into two categories, namely first category variables and second category variables, and the calculation process of the second category variables depends on the calculation results of the first category variables; The first type of variables are calculated, and the second type of variables are calculated based on the calculation results of the first type of variables.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 4 are implemented.
8. 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 4 are implemented.
Citation Information
Patent Citations
Real-time risk control variable calculation method based on a distributed flow calculation engine
CN109799976A
Database variable production method and system, computer equipment and storage medium
CN111858643A
Spreadsheet data processing method and device, equipment and storage medium
CN113420537A