Variable automatic binning method and device, computer equipment and storage medium

Generating SQL query templates through custom and isometric binning conditions solves the problem of inefficiency of traditional variable automatic binning methods, and realizes efficient, flexible and personalized variable binning processing, improving the accuracy and convenience of data processing.

CN120336353APending Publication Date: 2025-07-18SHANGHAI SHUHE INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510419379.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-03
Publication Date
2025-07-18

AI Technical Summary

Technical Problem

The traditional variable automatic binning method is inefficient, has low flexibility and lacks personalized settings, which cannot meet the needs of large-scale data processing.

Method used

It provides a variable automatic binning method. By receiving request information from the user terminal, loading configuration information and parsing it into custom or isometric binning conditions, generating SQL query templates for query processing, generating binning calculation results, and performing statistical analysis and reporting updates.

Benefits of technology

It improves the efficiency, flexibility and personalized setting of variable automatic binning, ensuring the accuracy and convenience of calculation results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120336353A_ABST
    Figure CN120336353A_ABST
Patent Text Reader

Abstract

The invention relates to an automatic variable binning method and device, computer equipment and a storage medium. The method comprises the following steps: in response to received variable binning request information sent by a user terminal, loading corresponding variable binning configuration information and corresponding configuration type information according to the variable binning request information; in response to the fact that the configuration type information is user-defined binning, performing analysis processing on the variable binning configuration information to obtain a user-defined binning condition, and performing format conversion processing on the user-defined binning condition to obtain an SQL (Structured Query Language) condition expression; according to the SQL condition expression, generating a first sub-box SQL query template of the corresponding first sub-box, and according to each first sub-box SQL query template, performing query processing in the business log database to obtain a first calculation result of the corresponding first sub-box. By adopting the method, the efficiency, the flexibility and the personalized setting degree can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of data processing, and particularly to a method and apparatus for automatically binning variables, a computer device, and a storage medium. Background Art

[0002] With the continuous progress of industrial technology, the amount of data accumulated in people's lives is increasing. Therefore, it is an increasingly important issue to solve various practical problems according to data modeling. In the process of big data modeling, there is often an indispensable step, that is, binning variables. Variable binning is a data preprocessing technique that divides continuous data into discrete intervals or "bins". This method is very common in data analysis, statistics, and machine learning, especially when dealing with large-scale data sets.

[0003] However, traditional methods for automatically binning variables have problems such as low efficiency, low flexibility, and lack of personalized settings. Summary of the Invention

[0004] Based on this, it is necessary to provide a method and apparatus for automatically binning variables, a computer device, and a storage medium that can improve efficiency, flexibility, and the degree of personalized settings for the above technical problems.

[0005] In a first aspect, a method for automatically binning variables is provided, and the method includes:

[0006] In response to receiving variable binning request information sent by a user terminal, load corresponding variable binning configuration information and corresponding configuration type information according to the variable binning request information;

[0007] In response to the configuration type information being custom binning, parse the variable binning configuration information to obtain custom binning conditions, and perform format conversion processing on the custom binning conditions to obtain an SQL conditional expression;

[0008] Generate a first binning SQL query template for the corresponding first binning according to the SQL conditional expression, and perform query processing in the business log database according to each first binning SQL query template to obtain a first calculation result for the corresponding first binning.

[0009] In one embodiment, the method further includes: in response to the configuration type being equidistant binning, obtaining the variable maximum value and the variable minimum value, and calculating the equidistant binning step size after calculation according to the variable maximum value, the variable minimum value, and the variable binning configuration information; generating boundary conditions of the corresponding second bin according to the equidistant binning step size, the variable maximum value, and the variable minimum value, generating a second bin SQL query template of the corresponding second bin according to the boundary conditions of each second bin, and obtaining a second calculation result of the corresponding second bin after query processing in the business log database according to each second bin SQL query template.

[0010] In one embodiment, the method further includes:

[0011] Calculating the first bin ratio of the corresponding first bin according to each first calculation result, and obtaining a first variable binning statistical report after statistical analysis according to each first calculation result and the first bin ratio of the corresponding first bin; or, calculating the second bin ratio of the corresponding second bin according to each second calculation result, and obtaining a second variable binning statistical report after statistical analysis according to each second calculation result and the second bin ratio of the corresponding second bin.

[0012] In one embodiment, the method further includes: in response to a configuration operation on the report update type, determining the report update type; the report update type includes regular report update or non - regular report update; in response to the report update type being regular report update, regularly updating the first variable binning statistical report or the second variable binning statistical report, and outputting the first variable binning statistical report or the second variable binning statistical report to the user terminal; in response to the report update type being non - regular report update, outputting the first variable binning statistical report or the second variable binning statistical report to the user terminal.

[0013] In one embodiment, loading the corresponding variable binning configuration information and the corresponding configuration type information according to the variable binning request information includes: parsing the variable binning request information to obtain the variable binning plan, the variable binning start time, and the component binning end time; performing a binning configuration validity check according to the variable binning plan to obtain a binning configuration validity check result; the binning configuration validity check result includes valid configuration or invalid configuration; in response to the binning configuration validity check result being valid configuration, loading the variable binning configuration information according to the variable binning plan, the variable binning start time, and the component binning end time.

[0014] In one embodiment, loading variable binning configuration information according to a variable binning plan, a variable binning start time, and a component binning end time includes: determining an execution date range according to the variable binning start time and the component binning end time; in response to the current time belonging to the execution date range, querying the business log database according to the current time to check if there is business log data for the current time; in response to the business log database having business log data, loading the variable binning configuration information according to the variable binning plan; in response to the business log database not having business log data, outputting a no-log-data report record to the user terminal; the no-log-data report record indicates that the business log database does not have business log data.

[0015] In one embodiment, loading corresponding variable binning configuration information and corresponding configuration type information according to variable binning request information includes: in response to the binning configuration validity check result being invalid configuration, feeding back invalid configuration information to the user terminal; wherein, the invalid configuration information is used to indicate that the variable binning configuration information corresponding to the variable binning request information is invalid.

[0016] In one embodiment, generating a first binning SQL query template for a corresponding first bin according to an SQL conditional expression includes generating a corresponding SQL conditional sub-expression for the first bin according to the SQL conditional expression; obtaining an initial binning SQL template, and filling each SQL conditional sub-expression into the initial binning SQL template to generate the first binning SQL query template for the corresponding first bin.

[0017] In one embodiment, the method further includes: generating a custom binning condition identification identifier for a corresponding first bin according to each SQL conditional sub-expression; associating each custom binning condition identification identifier with the corresponding SQL conditional sub-expression of the first bin and the corresponding first calculation result of the first bin.

[0018] In a second aspect, a variable automatic binning device is provided, and the device includes an information loading module, an information parsing module, and a result query module.

[0019] Among them, the information loading module is used to, in response to receiving variable binning request information sent by the user terminal, load corresponding variable binning configuration information and corresponding configuration type information; the information parsing module is used to, in response to the configuration type information being custom binning, perform parsing processing on the variable binning configuration information to obtain custom binning conditions, and perform format conversion processing on the custom binning conditions to obtain an SQL conditional expression; the result query module is used to generate a first binning SQL query template for a corresponding first bin according to the SQL conditional expression, and perform query processing in the business log database according to each first binning SQL query template to obtain the first calculation result of the corresponding first bin.

[0020] In a third aspect, a computer device is provided, which includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the steps of any one of the methods in the above method embodiments are implemented.

[0021] In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of any one of the methods in the above method embodiments are implemented.

[0022] The above variable automatic binning method, device, computer device and storage medium, in response to receiving variable binning request information sent by a user terminal, load corresponding variable binning configuration information and corresponding configuration type information according to the variable binning request information; then, in response to the configuration type information being custom binning, after parsing and processing the variable binning configuration information, custom binning conditions are obtained, and after format conversion processing of the custom binning conditions, an SQL conditional expression is obtained; then, according to the SQL conditional expression, a first binning SQL query template for the corresponding first binning is generated, and according to each first binning SQL query template, query processing is performed in the business log database to obtain the first calculation result of the corresponding first binning, which improves the efficiency and accuracy of variable automatic binning, and also improves the flexibility and personalization setting degree of binning. Description of the Drawings

[0023] Figure 1 It is an application environment diagram of the variable automatic binning method in an embodiment;

[0024] Figure 2 It is a first flow diagram of the variable automatic binning method in an embodiment;

[0025] Figure 3 It is a flow diagram of loading corresponding variable binning configuration information and corresponding configuration type information according to variable binning request information in an embodiment;

[0026] Figure 4 It is a flow diagram of loading variable binning configuration information according to a variable binning plan, a variable binning start time, and a component binning end time in an embodiment;

[0027] Figure 5 It is a flow diagram of generating a first binning SQL query template for the corresponding first binning according to an SQL conditional expression in an embodiment;

[0028] Figure 6 It is a second flow diagram of the variable automatic binning method in an embodiment;

[0029] Figure 7Structural block diagram of a variable automatic binning device in an embodiment;

[0030] Figure 8 Internal structure diagram of a computer device in an embodiment. Detailed implementation manners

[0031] In order to make the objectives, technical solutions and advantages of the present application clearer and more understandable, the present application will be 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.

[0032] To facilitate the understanding of the present application, the present application will be described more comprehensively below with reference to the relevant accompanying drawings. Embodiments of the present application are given in the drawings. However, the present application can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present application more thorough and comprehensive.

[0033] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which the present application belongs. The terms used in the description of the present application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application.

[0034] It can be understood that the terms "first", "second", etc. used in the present application may be used herein to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish one element from another. For example, without departing from the scope of the present application, the first resistor may be referred to as the second resistor, and similarly, the second resistor may be referred to as the first resistor. Both the first resistor and the second resistor are resistors, but they are not the same resistor.

[0035] It can be understood that in the following embodiments, "connection", if there is an electrical signal or data transfer between the connected circuits, modules, units, etc., should be understood as "electrical connection", "communication connection", etc.

[0036] As used herein, the singular forms "a", "an" and "the" may also include the plural forms unless the context clearly indicates otherwise. It should also be understood that the terms "comprise / include" or "have" etc. specify the presence of the stated features, wholes, steps, operations, components, parts or combinations thereof, but do not exclude the possibility of the presence or addition of one or more other features, wholes, steps, operations, components, parts or combinations thereof.

[0037] The variable automatic binning method provided by the present application can be applied to, for example Figure 1In the application environment shown. Among them, the user terminal 102 communicates with the server 104 through the network. Among them, the user terminal 102 can be, but is not limited to, various personal computers, laptop computers, smart phones, tablet computers, and portable wearable devices, and the server 104 can be implemented by an independent server or a server cluster composed of multiple servers.

[0038] In one embodiment, as Figure 2 shown, a variable automatic binning method is provided. Taking the method applied to Figure 1 the server 104 in it as an example for illustration, it includes the following steps 201 to step 203.

[0039] Step 201, in response to receiving the variable binning request information sent by the user terminal, load the corresponding variable binning configuration information and the corresponding configuration type information according to the variable binning request information.

[0040] Among them, the server 104, in response to receiving the variable binning request information sent by the user terminal, loads the corresponding variable binning configuration information and the corresponding configuration type information according to the variable binning request information.

[0041] In a specific example, the method further includes:

[0042] In response to a configuration operation on the configuration type information of the variable binning configuration information, determine the configuration type information of the variable binning configuration information; the configuration type information includes custom binning or equal-interval binning;

[0043] In response to a first configuration operation on the custom binning condition and the configuration type information being custom binning, determine the variable binning configuration information according to the result of the first configuration operation, and store the variable binning configuration information;

[0044] In response to a second configuration operation on the number of bins and the configuration type information being equal-interval binning, determine the variable binning configuration information according to the result of the second configuration operation, and store the variable binning configuration information. The above is only a specific example, and it is flexibly set according to user needs in actual applications, and is not limited here.

[0045] In a specific example, the custom binning conditions may but are not limited to include data types, interval boundary types, and conditional logic connection types; data types include numerical values, strings, and dates; numerical types support =, !=, >, >=, <, <=, or range, strings support startsWith, endsWith, contains, notContains, in, and notIn, etc., interval boundary types include open intervals or closed intervals, and conditional logic connection types include AND or OR. The above are only specific examples and are flexibly set according to user requirements in actual applications and are not restricted here.

[0046] In one embodiment, as Figure 3 shown, load the corresponding variable binning configuration information and the corresponding configuration type information according to the variable binning request information, including steps 301 to 303.

[0047] Step 301, perform parsing and processing on the variable binning request information to obtain a variable binning plan, a variable binning start time, and a component binning end time;

[0048] Step 302, perform a binning configuration validity check according to the variable binning plan to obtain a binning configuration validity check result;

[0049] Step 303, in response to the binning configuration validity check result being valid, load the variable binning configuration information according to the variable binning plan, the variable binning start time, and the component binning end time.

[0050] Among them, the binning configuration validity check result includes valid configuration or invalid configuration. Specifically, the server 104 performs parsing and processing on the variable binning request information to obtain a variable binning plan, a variable binning start time, and a component binning end time; then, performs a binning configuration validity check according to the variable binning plan to obtain a binning configuration validity check result; and then, in response to the binning configuration validity check result being valid, loads the variable binning configuration information according to the variable binning plan, the variable binning start time, and the component binning end time, improving the efficiency and rationality of loading the variable binning configuration information and avoiding invalid loading.

[0051] In one embodiment, as Figure 4 shown, load the variable binning configuration information according to the variable binning plan, the variable binning start time, and the component binning end time, including steps 401 to 404.

[0052] Step 401, determine the execution date range according to the variable binning start time and the component binning end time;

[0053] Step 402: In response to the current time belonging to the execution date range, query the business log database according to the current time to check if there is business log data for the current time;

[0054] Step 403: In response to the business log database having business log data, load the variable binning configuration information according to the variable binning plan;

[0055] Step 404: In response to the business log database not having business log data, output a no-log-data report record to the user terminal; the no-log-data report record indicates that the business log database does not have business log data.

[0056] Among them, the no-log-data report record indicates that the business log database does not have business log data. Specifically, Server 104 determines the execution date range according to the variable binning start time and the component binning end time; then, in response to the current time belonging to the execution date range, queries the business log database according to the current time to check if there is business log data for the current time; then, in response to the business log database having business log data, loads the variable binning configuration information according to the variable binning plan; finally, in response to the business log database not having business log data, outputs a no-log-data report record to the user terminal, improving the efficiency and convenience of loading the variable binning configuration information.

[0057] In this embodiment, the execution date range is determined according to the variable binning start time and the component binning end time; then, in response to the current time belonging to the execution date range, the business log database is queried according to the current time to check if there is business log data for the current time; then, in response to the business log database having business log data, the variable binning configuration information is loaded according to the variable binning plan; finally, in response to the business log database not having business log data, a no-log-data report record is output to the user terminal, improving the efficiency and convenience of loading the variable binning configuration information.

[0058] In this embodiment, the variable binning request information is parsed and processed to obtain the variable binning plan, the variable binning start time, and the component binning end time; then, a binning configuration validity check is performed according to the variable binning plan to obtain the binning configuration validity check result; then, in response to the binning configuration validity check result being valid, the variable binning configuration information is loaded according to the variable binning plan, the variable binning start time, and the component binning end time, improving the efficiency and rationality of loading the variable binning configuration information and avoiding invalid loading.

[0059] In one of the embodiments, as Figure 3 shown, load the corresponding variable binning configuration information and the corresponding configuration type information according to the variable binning request information, including Step 304.

[0060] Step 304: In response to the result of the binning configuration validity check being invalid configuration, feedback the invalid configuration information to the user terminal.

[0061] Among them, the invalid configuration information is used to characterize that the variable binning configuration information corresponding to the variable binning request information is invalid. Specifically, the server 104, in response to the result of the binning configuration validity check being invalid configuration, feeds back the invalid configuration information to the user terminal, thus avoiding invalid loading.

[0062] In this embodiment, in response to the result of the binning configuration validity check being invalid configuration, feedback the invalid configuration information to the user terminal, thus avoiding invalid loading.

[0063] Step 202: In response to the configuration type information being custom binning, parse the variable binning configuration information to obtain custom binning conditions, and perform format conversion processing on the custom binning conditions to obtain an SQL conditional expression.

[0064] Specifically, the server 104, in response to the configuration type information being custom binning, parses the variable binning configuration information to obtain custom binning conditions, and performs format conversion processing on the custom binning conditions to obtain an SQL conditional expression.

[0065] Step 203: Generate a first binning SQL query template for the corresponding first binning according to the SQL conditional expression, and perform query processing in the business log database according to each first binning SQL query template to obtain the first calculation result of the corresponding first binning.

[0066] Specifically, the server 104 generates a first binning SQL query template for the corresponding first binning according to the SQL conditional expression, and performs query processing in the business log database according to each first binning SQL query template to obtain the first calculation result of the corresponding first binning, which improves the efficiency and accuracy of variable automatic binning, and also improves the flexibility and personalization degree of binning.

[0067] In one of the embodiments, as Figure 5 shown, generating a first binning SQL query template for the corresponding first binning according to the SQL conditional expression includes Step 501 to Step 502.

[0068] Step 501: Generate an SQL conditional sub-expression for the corresponding first binning according to the SQL conditional expression;

[0069] Step 502: Obtain an initial binning SQL template, and fill each SQL conditional sub-expression into the initial binning SQL template to generate a first binning SQL query template for the corresponding first binning.

[0070] Specifically, the server 104 generates corresponding SQL conditional sub-expressions for the first bin according to the SQL conditional expression; then, it obtains the initial binning SQL template, fills each SQL conditional sub-expression into the initial binning SQL template to generate the first binning SQL query template for the corresponding first bin, improving the accuracy and convenience of generating the first binning SQL query templates for each first bin.

[0071] In a specific example, based on the FreeMarker template engine, each SQL conditional sub-expression is filled into the initial binning SQL template to dynamically generate the first binning SQL query template for the corresponding first bin. At the same time, it also supports automatic variable type conversion (CAST) and automatic processing of variable path extraction (JSON). The above is only a specific example, and it is flexibly set according to user needs in actual applications and will not be limited here.

[0072] In this embodiment, corresponding SQL conditional sub-expressions for the first bin are generated according to the SQL conditional expression; then, the initial binning SQL template is obtained, and each SQL conditional sub-expression is filled into the initial binning SQL template to generate the first binning SQL query template for the corresponding first bin, improving the accuracy and convenience of generating the first binning SQL query templates for each first bin.

[0073] In one of the embodiments, the method further includes:

[0074] Generating corresponding custom binning condition identification identifiers for the first bin according to each SQL conditional sub-expression;

[0075] Associating each custom binning condition identification identifier with the corresponding SQL conditional sub-expression of the first bin and the first calculation result of the corresponding first bin.

[0076] Specifically, the server 104 generates corresponding custom binning condition identification identifiers for the first bin according to each SQL conditional sub-expression; then, it associates the custom binning condition identification identifier with the corresponding SQL conditional sub-expression of the first bin and the first calculation result of the corresponding first bin, improving the accuracy of the binning condition and avoiding the problems of too long variable paths or duplicate names.

[0077] In this embodiment, corresponding custom binning condition identification identifiers for the first bin are generated according to each SQL conditional sub-expression; then, the custom binning condition identification identifier is associated with the corresponding SQL conditional sub-expression of the first bin and the first calculation result of the corresponding first bin, improving the accuracy of the binning condition and avoiding the problems of too long variable paths or duplicate names.

[0078] Based on this, the above variable automatic binning method, in response to receiving the variable binning request information sent by the user terminal, loads the corresponding variable binning configuration information and the corresponding configuration type information according to the variable binning request information; then, in response to the configuration type information being custom binning, parses and processes the variable binning configuration information to obtain custom binning conditions, and performs format conversion processing on the custom binning conditions to obtain an SQL conditional expression; then, generates a first binning SQL query template for the corresponding first binning according to the SQL conditional expression, and performs query processing in the business log database according to each first binning SQL query template to obtain the first calculation result of the corresponding first binning, which improves the efficiency and accuracy of variable automatic binning, and also improves the flexibility and personalized setting degree of binning.

[0079] In one embodiment, as Figure 6 shown, the method further includes steps 601 to 602.

[0080] Step 601, in response to the configuration type being equal-width binning, obtains the variable maximum value and the variable minimum value, and calculates the equal-width binning step size according to the variable maximum value, the variable minimum value, and the variable binning configuration information;

[0081] Step 602, generates boundary conditions for the corresponding second binning according to the equal-width binning step size, the variable maximum value, and the variable minimum value, generates a second binning SQL query template for the corresponding second binning according to the boundary conditions of each second binning, and performs query processing in the business log database according to each second binning SQL query template to obtain the second calculation result of the corresponding second binning.

[0082] Specifically, the server 104, in response to the configuration type being equal-width binning, obtains the variable maximum value and the variable minimum value, calculates the equal-width binning step size according to the variable maximum value, the variable minimum value, and the variable binning configuration information; then, generates boundary conditions for the corresponding second binning according to the equal-width binning step size, the variable maximum value, and the variable minimum value, generates a second binning SQL query template for the corresponding second binning according to the boundary conditions of each second binning, and performs query processing in the business log database according to each second binning SQL query template to obtain the second calculation result of the corresponding second binning, which improves the adaptability, flexibility, and personalized setting degree of variable automatic binning.

[0083] In a specific example, generating a second binning SQL query template for the corresponding second binning according to the boundary conditions of each second binning includes:

[0084] Obtain the initial binning SQL template, and fill the boundary conditions of each second bin into the initial binning SQL template to generate the second binning SQL query template corresponding to the second bin. The above is only a specific example, and in actual applications, it is flexibly set according to user requirements and is not limited here.

[0085] In a specific example, the method further includes:

[0086] Generate the equidistant binning condition identification identifier corresponding to the second bin according to the boundary conditions of each second bin;

[0087] Associate the equidistant binning condition identification identifier of each second bin with the boundary condition of the corresponding second bin and the second calculation result of the corresponding second bin. The above is only a specific example, and in actual applications, it is flexibly set according to user requirements and is not limited here.

[0088] In this embodiment, in response to the configuration type being equidistant binning, obtain the variable maximum value and the variable minimum value, and calculate the equidistant binning step size after calculation according to the variable maximum value, the variable minimum value, and the variable binning configuration information; then, generate the boundary conditions of the corresponding second bin according to the equidistant binning step size, the variable maximum value, and the variable minimum value, generate the second binning SQL query template corresponding to each second bin, and obtain the second calculation result of the corresponding second bin after query processing in the business log database, improving the adaptability, flexibility, and personalized setting degree of variable automatic binning.

[0089] In one of the embodiments, the method further includes:

[0090] Calculate the first binning ratio of the corresponding first bin according to each first calculation result, and obtain the first variable binning statistical report after statistical analysis according to each first calculation result and the first binning ratio of the corresponding first bin;

[0091] Or, calculate the second binning ratio of the corresponding second bin according to each second calculation result, and obtain the second variable binning statistical report after statistical analysis according to each second calculation result and the second binning ratio of the corresponding second bin.

[0092] Specifically, the server 104 calculates the first binning ratio of the corresponding first bin according to each first calculation result, and obtains the first variable binning statistical report after statistical analysis according to each first calculation result and the first binning ratio of the corresponding first bin; or, calculates the second binning ratio of the corresponding second bin according to each second calculation result, and obtains the second variable binning statistical report after statistical analysis according to each second calculation result and the second binning ratio of the corresponding second bin, improving the convenience of variable automatic binning.

[0093] In this embodiment, the first bin ratio of the corresponding first bin is calculated according to each first calculation result, and a first variable binning statistical report is obtained after statistical analysis based on each first calculation result and the first bin ratio of the corresponding first bin; or, the second bin ratio of the corresponding second bin is calculated according to each second calculation result, and a second variable binning statistical report is obtained after statistical analysis based on each second calculation result and the second bin ratio of the corresponding second bin, which improves the convenience of automatic variable binning.

[0094] In one of the embodiments, the method further includes:

[0095] In response to a configuration operation on the report update type, determine the report update type; the report update type includes regular report update or non - regular report update;

[0096] In response to the report update type being regular report update, regularly update the first variable binning statistical report or the second variable binning statistical report, and output the first variable binning statistical report or the second variable binning statistical report to the user terminal;

[0097] In response to the report update type being non - regular report update, output the first variable binning statistical report or the second variable binning statistical report to the user terminal.

[0098] Specifically, the server 104 determines the report update type in response to a configuration operation on the report update type; the report update type includes regular report update or non - regular report update; then, in response to the report update type being regular report update, regularly update the first variable binning statistical report or the second variable binning statistical report, and output the first variable binning statistical report or the second variable binning statistical report to the user terminal; then, in response to the report update type being non - regular report update, output the first variable binning statistical report or the second variable binning statistical report to the user terminal, which improves the convenience and visibility of automatic variable binning.

[0099] In this embodiment, in response to a configuration operation on the report update type, determine the report update type; the report update type includes regular report update or non - regular report update; then, in response to the report update type being regular report update, regularly update the first variable binning statistical report or the second variable binning statistical report, and output the first variable binning statistical report or the second variable binning statistical report to the user terminal; then, in response to the report update type being non - regular report update, output the first variable binning statistical report or the second variable binning statistical report to the user terminal, which improves the convenience and visibility of automatic variable binning.

[0100] In this embodiment, in response to the configuration type being equidistant binning, the variable maximum value and the variable minimum value are obtained, and the equidistant binning step size is obtained through calculation based on the variable maximum value, the variable minimum value, and the variable binning configuration information; then, the boundary conditions of the corresponding second bin are generated according to the equidistant binning step size, the variable maximum value, and the variable minimum value, and the second bin SQL query template of the corresponding second bin is generated according to the boundary conditions of each second bin. After query processing is performed on the business log database according to each second bin SQL query template, the second calculation result of the corresponding second bin is obtained, which improves the adaptability, flexibility, and personalized setting degree of variable automatic binning.

[0101] It should be understood that although Figure 2-6 the steps in the flowchart are shown in sequence according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise clearly stated in this article, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2-6 at least a part of the steps in

[0102] In one embodiment, as Figure 7 shown, a variable automatic binning device is provided, and the device includes an information loading module 710, an information parsing module 720, and a result query module 730.

[0103] Among them, the information loading module 710 is configured to, in response to receiving the variable binning request information sent by the user terminal, load the corresponding variable binning configuration information and the corresponding configuration type information according to the variable binning request information; the information parsing module 720 is configured to, in response to the configuration type information being custom binning, parse the variable binning configuration information to obtain custom binning conditions, and perform format conversion processing on the custom binning conditions to obtain SQL conditional expressions; the result query module 730 is configured to generate the first bin SQL query template of the corresponding first bin according to the SQL conditional expressions, and obtain the first calculation result of the corresponding first bin after query processing is performed on the business log database according to each first bin SQL query template.

[0104] In one of the embodiments, the device further includes an equidistant binning module.

[0105] Among them, the equal-interval binning module is used to obtain the variable maximum value and the variable minimum value in response to the configuration type being equal-interval binning, and calculate the equal-interval binning step size after calculation based on the variable maximum value, the variable minimum value, and the variable binning configuration information; the equal-interval binning module is used to generate the boundary conditions of the corresponding second binning according to the equal-interval binning step size, the variable maximum value, and the variable minimum value, generate the second binning SQL query template of the corresponding second binning according to the boundary conditions of each second binning, and obtain the second calculation result of the corresponding second binning after query processing in the business log database according to each second binning SQL query template.

[0106] In one embodiment, the device further includes a report generation module.

[0107] Among them, the report generation module is used to calculate the first binning ratio of the corresponding first binning according to each first calculation result, and obtain the first variable binning statistical report after statistical analysis according to each first calculation result and the first binning ratio of the corresponding first binning; or, the report generation module is used to calculate the second binning ratio of the corresponding second binning according to each second calculation result, and obtain the second variable binning statistical report after statistical analysis according to each second calculation result and the second binning ratio of the corresponding second binning.

[0108] In one embodiment, the method further includes a report update module.

[0109] Among them, the report update module is used to determine the report update type in response to a configuration operation on the report update type; the report update type includes regular report update or regular report non-update; the report update module is used to update the first variable binning statistical report or the second variable binning statistical report regularly in response to the report update type being regular report update, and output the first variable binning statistical report or the second variable binning statistical report to the user terminal; the report update module is used to output the first variable binning statistical report or the second variable binning statistical report to the user terminal in response to the report update type being regular report non-update.

[0110] In one embodiment, the information loading module 710 includes an information loading unit.

[0111] Among them, the information loading unit is used to parse and process the variable binning request information to obtain the variable binning plan, the variable binning start time, and the component binning end time; the information loading unit is used to perform a validity check on the binning configuration according to the variable binning plan to obtain the binning configuration validity check result; the binning configuration validity check result includes valid configuration or invalid configuration; the information loading unit is used to load the variable binning configuration information according to the variable binning plan, the variable binning start time, and the component binning end time in response to the binning configuration validity check result being valid configuration.

[0112] In one embodiment, the information loading unit includes an information loader.

[0113] Among them, the information loader is used to determine the execution date range according to the variable binning start time and the component binning end time; the information loader is used to query the business log database to check if there is business log data for the current time in response to the current time belonging to the execution date range; the information loader is used to load the variable binning configuration information according to the variable binning plan in response to the business log database having business log data; the information loader is used to output a no-log-data report record to the user terminal in response to the business log database not having business log data; the no-log-data report record indicates that the business log database does not have business log data.

[0114] In one embodiment, the information loading unit is used to feedback configuration invalidation information to the user terminal in response to the binning configuration validity check result being configuration invalid; among them, the configuration invalidation information is used to indicate that the variable binning configuration information corresponding to the variable binning request information is configured invalid.

[0115] In one embodiment, the result query module 730 includes a template generation unit.

[0116] Among them, the template generation unit is used to generate a corresponding SQL conditional sub-expression for the first binning according to the SQL conditional expression; the template generation unit is used to obtain the initial binning SQL template and fill each SQL conditional sub-expression into the initial binning SQL template to generate the first binning SQL query template corresponding to the first binning.

[0117] In one embodiment, the device further includes an identification association module.

[0118] Among them, the identification association module is used to generate a corresponding custom binning condition identification for the first binning according to each SQL conditional sub-expression; the identification association module is used to associate each custom binning condition identification with the corresponding SQL conditional sub-expression of the first binning and the corresponding first calculation result of the first binning.

[0119] For the specific limitations of the variable automatic binning device, reference can be made to the limitations of the variable automatic binning method in the above text, which will not be elaborated here. Each module in the above variable automatic binning device can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor of the computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to the above modules.

[0120] In one embodiment, a computer device is provided. This computer device can be a server, and its internal structure diagram can be asFigure 8 As shown in the figure. 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, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store variable binning request information. 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, it implements a method for automatic variable binning.

[0121] Those skilled in the art can understand that Figure 8 the structure shown in the figure is only a block diagram of some structures 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 those shown in the figure, or combine some components, or have a different component layout.

[0122] In a third aspect, a computer device is provided. The computer device includes a memory and a processor. The memory stores a computer program. When the processor executes the computer program, it implements the steps of any one of the methods in the above method embodiments.

[0123] In a fourth aspect, a computer-readable storage medium is provided. The computer-readable storage medium stores a computer program. When the computer program is executed by the processor, it implements the steps of any one of the methods in the above method embodiments.

[0124] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. 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 methods. Among them, any reference to a memory, storage, database, or other medium used in the embodiments provided in the present application can include non-volatile and / or volatile memories. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and Rambus dynamic RAM (RDRAM), etc.

[0125] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, 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, it should be considered as the scope described in this specification.

[0126] The above-described embodiments merely represent several implementation manners of the present application. The description is relatively specific and detailed, but it should not be construed as a limitation on the scope of the invention patent. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application should be subject to the appended claims.

Claims

1. A method for automatic variable binning, the method comprising: In response to receiving variable binning request information sent by a user terminal, loading corresponding variable binning configuration information and configuration type information of the corresponding variable binning configuration information according to the variable binning request information; In response to the configuration type information being custom binning, parsing the variable binning configuration information to obtain custom binning conditions, and performing format conversion processing on the custom binning conditions to obtain an SQL condition expression; Generating a first binning SQL query template for a corresponding first binning according to the SQL condition expression, and performing query processing in a business log database according to each first binning SQL query template to obtain a first calculation result of the corresponding first binning.

2. The method according to claim 1, wherein The method further comprises: In response to the configuration type being equal-interval binning, obtaining a variable maximum value and a variable minimum value, and calculating an equal-interval binning step size according to the variable maximum value, the variable minimum value, and the variable binning configuration information; Generating boundary conditions for a corresponding second binning according to the equal-interval binning step size, the variable maximum value, and the variable minimum value, generating a second binning SQL query template for the corresponding second binning according to the boundary conditions of each second binning, and performing query processing in the business log database according to each second binning SQL query template to obtain a second calculation result of the corresponding second binning.

3. The method according to claim 2, wherein, The method further comprises: Calculating a first binning ratio of the corresponding first binning according to each first calculation result, and performing statistical analysis according to each first calculation result and the first binning ratio of the corresponding first binning to obtain a first variable binning statistical report; Or, calculating a second binning ratio of the corresponding second binning according to each second calculation result, and performing statistical analysis according to each second calculation result and the second binning ratio of the corresponding second binning to obtain a second variable binning statistical report.

4. The method according to claim 3, characterized in that, The method further comprises: In response to a configuration operation on a report update type, determining the report update type; the report update type includes regular report update or regular report non-update; In response to the report update type being regular report update, regularly updating the first variable binning statistical report or the second variable binning statistical report, and outputting the first variable binning statistical report or the second variable binning statistical report to the user terminal; In response to the report update type being regular report non-update, outputting the first variable binning statistical report or the second variable binning statistical report to the user terminal.

5. The method according to claim 1, characterized in that The loading of the corresponding variable binning configuration information and the corresponding configuration type information according to the variable binning request information includes: Parsing the variable binning request information to obtain a variable binning plan, a variable binning start time, and a component binning end time; Performing a validity check on the binning configuration according to the variable binning plan to obtain a binning configuration validity check result; the binning configuration validity check result includes valid configuration or invalid configuration; In response to the result of the binning configuration validity check indicating that the configuration is valid, load the variable binning configuration information according to the variable binning plan, the variable binning start time, and the component binning end time.

6. The method according to claim 5, wherein The loading of the variable binning configuration information according to the variable binning plan, the variable binning start time, and the component binning end time includes: Determine the execution date range according to the variable binning start time and the component binning end time; In response to the current time belonging to the execution date range, query whether there is business log data for the current time in the business log database according to the current time; In response to the existence of the business log data in the business log database, load the variable binning configuration information according to the variable binning plan; In response to the non-existence of the business log data in the business log database, output a no-log-data report record to the user terminal; the no-log-data report record indicates that there is no business log data in the business log database.

7. The method according to claim 5, wherein The loading of the corresponding variable binning configuration information and the corresponding configuration type information according to the variable binning request information includes: In response to the result of the binning configuration validity check indicating that the configuration is invalid, feedback configuration invalid information to the user terminal; wherein, the configuration invalid information is used to indicate that the variable binning configuration information corresponding to the variable binning request information is invalid.

8. The method according to claim 1, wherein The generation of the first binning SQL query template for the corresponding first binning according to the SQL conditional expression includes: Generate the SQL conditional sub-expression for the corresponding first binning according to the SQL conditional expression; Obtain the initial binning SQL template, and fill each SQL conditional sub-expression into the initial binning SQL template to generate the first binning SQL query template for the corresponding first binning.

9. The method according to claim 8, wherein The method further includes: Generate the custom binning condition identification identifier for the corresponding first binning according to each SQL conditional sub-expression; Associate each custom binning condition identification identifier with the corresponding SQL conditional sub-expression of the first binning and the corresponding first calculation result of the first binning.

10. An automatic variable binning device, characterized in that, The device includes: An information loading module, configured to, in response to receiving variable binning request information sent by a user terminal, load the corresponding variable binning configuration information and the configuration type information of the corresponding variable binning configuration information according to the variable binning request information; An information parsing module, configured to, in response to the configuration type information being custom binning, parse and process the variable binning configuration information to obtain custom binning conditions, and perform format conversion processing on the custom binning conditions to obtain an SQL conditional expression; A result query module, configured to generate the first binning SQL query template for the corresponding first binning according to the SQL conditional expression, and perform query processing in the business log database according to each first binning SQL query template to obtain the first calculation result of the corresponding first binning.

11. A computer device, comprising a memory, a processor, and a computer program stored on 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 9 are implemented.

12. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 9 are implemented.