Business data processing method and device, equipment, storage medium and program product
By calculating the measurement value and number of combinations of dimension fields, the filtering conditions are determined to filter the business data, which solves the problem of wasted storage space caused by the sparse distribution of cubic units in the data cube, and realizes intelligent filtering of the data cube and optimization of storage space. .
Patent Information
- Application Number
- CN202410622706.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-17
- Publication Date
- 2024-09-17
AI Technical Summary
Due to the sparse distribution of cube units in the data cube, a large amount of space is occupied by cube units with low metric values, resulting in a waste of storage space.
By determining the dimension fields and measurement values of business data in multiple dimensions, calculating the measurement values and number of combinations of dimension fields, determining the data filtering conditions, and then filtering the business data to reduce the number of cube units stored in the data cube.
It realizes intelligent filtering of data cubes, reduces the storage space occupied by unnecessary cube units, and improves the efficiency of data storage.
Smart Images

Figure CN118656549A
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a business data processing method, device, equipment, storage medium, and program product. Background Art
[0002] A large amount of cube space in a data cube may be occupied by cube cells with low metric values, because the distribution of cube cells in multidimensional space is often sparse. For example, a customer buys a small number of items in a store at a time, and such an event will generate a small number of cube cells with non-null values, while most of the remaining cube cells in the data cube are null values. Summary of the invention
[0003] The present disclosure provides a business data processing method, apparatus, device, storage medium, and program product, which are used to filter business data to reduce the number of cube units in a data cube.
[0004] In a first aspect, the present disclosure provides a business data processing method, comprising:
[0005] Determine the dimension fields of the business data under M dimensions and the field values corresponding to the dimension fields, where M is an integer greater than 1;
[0006] For a dimension combination including at least two dimensions, determining a metric value of a dimension field combination in the dimension combination, and determining the number of dimension field combinations corresponding to the metric value;
[0007] Determining a data filtering condition according to the metric value of the dimension field combination and the number of dimension field combinations corresponding to the metric value;
[0008] The business data is filtered according to the data filtering condition, and the filtered business data is stored in a data cube.
[0009] In a second aspect, the present disclosure provides a business data processing device, including:
[0010] The first processing module is used to determine the dimension fields of the business data under M dimensions, and the field values corresponding to the dimension fields, where M is an integer greater than 1;
[0011] A second processing module is used to determine, for a dimension combination including at least two dimensions, a metric value of a dimension field combination in the dimension combination, and determine the number of dimension field combinations corresponding to the metric value;
[0012] A third processing module is used to determine a data filtering condition according to the metric value of the dimension field combination and the number of dimension field combinations corresponding to the metric value;
[0013] The fourth processing module is used to filter the business data according to the data filtering condition and store the filtered business data in the data cube.
[0014] In a third aspect, the present disclosure provides an electronic device, including:
[0015] at least one processor; and
[0016] a memory communicatively connected to the at least one processor; wherein,
[0017] The memory stores one or more computer programs that can be executed by the at least one processor, and the one or more computer programs are executed by the at least one processor so that the at least one processor can execute the business data processing method as described in the first aspect.
[0018] In a fourth aspect, the present disclosure provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the above-mentioned business data processing method when executed by a processor / processing core.
[0019] In a fifth aspect, the present disclosure provides a computer program product, including a computer-readable code, or a non-volatile computer-readable storage medium carrying a computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above-mentioned business data processing method.
[0020] It can be seen that the embodiment provided by the present disclosure determines data filtering conditions by counting the dimension fields of business data under M dimensions and the field values corresponding to the dimension fields, and for dimension combinations, by counting the metric values of the dimension field combinations in the dimension combinations and the number of dimension field combinations corresponding to the metric values, and filters the business data according to the data filtering conditions to reduce the number of cube units required to save the business data to the data cube. The data filtering conditions can be determined intelligently, and the determined data filtering conditions can adapt to the actual situation of the business data with a high degree of adaptability, and then the business data can be filtered according to the data filtering conditions, and the filtered business data can be stored in the data cube, thereby realizing intelligent filtering of the data cube and reducing the storage space occupied by unnecessary cube units.
[0021] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The accompanying drawings are used to provide a further understanding of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the present disclosure and do not constitute a limitation of the present disclosure. The above and other features and advantages will become more apparent to those skilled in the art by describing detailed example embodiments with reference to the accompanying drawings, in which:
[0023] Figure 1 It is a schematic diagram of the structure of a 3-D cube;
[0024] Figure 2 is a schematic diagram of a data cube;
[0025] Figure 3 A flowchart of a business data processing method provided by an embodiment of the present disclosure;
[0026] Figure 4 A schematic diagram of data display in a plane coordinate system provided by an embodiment of the present disclosure;
[0027] Figure 5a A schematic diagram of the positional relationship between a straight line from a coordinate origin to a second coordinate and a circular area boundary provided in an embodiment of the present disclosure;
[0028] Figure 5b A schematic diagram of the positional relationship between another straight line from the coordinate origin to the second coordinate and the circular area boundary provided in an embodiment of the present disclosure;
[0029] Figure 6 A schematic diagram of a filtering area provided in an embodiment of the present disclosure;
[0030] Figure 7 A schematic diagram of a tangent line of a circular boundary of a distribution area through a coordinate origin provided in an embodiment of the present disclosure;
[0031] Figure 8 A block diagram of a business data processing device provided by an embodiment of the present disclosure;
[0032] Fig. 9 A block diagram of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0033] In order to enable those skilled in the art to better understand the technical solutions of the present disclosure, the exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0034] In the absence of conflict, the various embodiments of the present disclosure and the various features therein may be combined with each other.
[0035] As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items.
[0036] The terms used herein are only used to describe specific embodiments and are not intended to limit the present disclosure. As used herein, the singular forms "a" and "the" are also intended to include plural forms, unless the context clearly indicates otherwise. It will also be understood that when the terms "including" and / or "made of" are used in this specification, the presence of the features, wholes, steps, operations, elements and / or components is specified, but the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof is not excluded. "Connected" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect.
[0037] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by those of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and the present disclosure, and will not be interpreted as having an idealized or overly formal meaning unless explicitly defined as such herein.
[0038] First, the technical terms involved in the embodiments of the present disclosure are explained as follows:
[0039] Dimension refers to the field of statistical measurement value, such as time, region, product, etc.
[0040] A dimension combination includes at least one dimension used to count measurement values. For example, there are three dimensions for counting sales in a data cube, namely time, region, and product. The dimension combination includes at least one of the three dimensions.
[0041] Dimension fields refer to the specific values of dimensions. For example, the time dimension includes dimension fields: 2021, 2022, 2023...; the region dimension includes dimension fields: city A, city B, city C, etc.; the commodity dimension includes dimension fields: real estate, electronic products, daily necessities, etc.
[0042] Dimension field combination, a combination of dimension fields of at least two dimensions, for example, the dimension combination of region + product includes city A + real estate, and city C + real estate.
[0043] A metric value refers to a field of statistical data results, such as sales volume, number of transactions, etc. The sales volume of real estate in city A+ is a metric value, and the sales volume of real estate in city C+ is a metric value.
[0044] A data cube is a multidimensional data model used to store and analyze multidimensional data sets. A data cube consists of multiple dimensions and measures, where dimensions describe the characteristics or attributes of data, such as time, location, product, customer, etc., and measures quantify or measure the data, such as sales, quantity, profit, etc. For example, if sales are counted by quarter, city, and product type, a 3-D cube is obtained, such as Figure 1 Shown is a schematic diagram of the structure of the 3-D cube.
[0045] A cube cell is a basic unit in a data cube, used to store and represent data. It is the intersection of all dimensions in a data cube and contains the metric values corresponding to a specific combination of latitude values.
[0046] In the calculation process of the data cube, assuming that there are n dimensions, the cube unit of the bottom layer is calculated first, and the dimension combination includes all n dimensions; then the cube unit of the upper layer is calculated, and the dimension combination is n-1 dimensions extracted from n dimensions, and the cube unit of the upper layer includes the permutations and combinations of the dimension fields under the n-1 dimensions; after the calculation of the cube unit of this layer is completed, the cube unit of the upper layer is calculated, and the dimension combination is n-2 dimensions extracted from n-1 dimensions, and the cube unit of the upper layer includes the permutations and combinations of the dimension fields under the n-2 dimensions; and so on, until the top 0-D cube unit is calculated.
[0047] Assume that the three dimensions of the data cube whose metric values are sales are year, city, and item. Figure 2 The figure shows a schematic diagram of the data cube, and each cube unit in the data cube is described as follows:
[0048] All dimensions are aggregated to obtain 3-D cube units, represented as (year, city, product type, sales);
[0049] On the basis of the 3-D cube unit, three 2-D cube units are obtained by further statistics, namely: (year, city, sales), (year, product type, sales), (city, product type, sales);
[0050] Based on the 2-D cube unit, three 1-D cube units are obtained by further statistics, namely: (year, sales), (product type, sales), (city, sales);
[0051] On the basis of the 1-D cube unit, we continue to count and get a 0-D cube unit, which is: (total sales);
[0052] A data cube composed of the above 3-D, 2-D, 1-D, and 0-D cube units is called a complete cube.
[0053] Assume that the number of dimensions to be counted is n, and the number of cube units generated is 2 n In addition, the size of the cube unit depends on the cardinality of each dimension. Calculating the complete cube may require massive storage space, which in many cases exceeds the storage capacity.
[0054] There may be a large number of cube units in the complete cube that are not needed in the data analysis process. If these cube units that are not needed in the analysis process can be effectively filtered out, the storage space occupied will be greatly reduced.
[0055] Based on this analysis, the embodiment of the present disclosure provides a business data processing method, through which business data is filtered to reduce the number of cube units occupied by the business data stored in the data cube, thereby reducing unnecessary cube units and reducing the storage space occupied by the data cube. The method can be applied to any electronic device.
[0056] In the application scenario, when the data in the data source business data needs to be stored in the form of a data cube for data analysis, the dimension field combination of any dimension combination that needs to be stored in the data cube is extracted from the data source, and the metric value of the dimension field combination is obtained based on the extracted dimension field combination, as well as the number of dimension field combinations corresponding to each metric value in the dimension combination. Therefore, for the data corresponding to each dimension field combination that needs to be stored in the data cube, the metric value is obtained according to the metric value. Figure 3 The business data processing method provided by the embodiment of the present disclosure shown filters the business data before storing it in a data cube, thereby greatly reducing the storage space required for the data cube, and providing a basis for subsequent data analysis based on the data cube, reducing the interference of unnecessary cube unit data on subsequent data analysis.
[0057] Figure 3 The figure is a flow chart of the business data processing method provided by the embodiment of the present disclosure. The business data processing method provided by the embodiment of the present disclosure mainly includes the following steps:
[0058] Step 301, determine the dimension fields of the business data under M dimensions, and the field values corresponding to the dimension fields, where M is an integer greater than 1.
[0059] For example, combined with Figure 1The data cube shown in the figure has business data corresponding to three dimensions, namely, city, quarter and type. City includes four dimension fields, namely, city A, B, C and D. Quarter includes four dimension fields, namely, Q1, Q2, Q3 and Q4. Type includes four dimension fields, namely, home entertainment, computer, telephone and security. The business data includes the field value corresponding to each dimension field, such as the sales of city A, the sales of Q1, the sales of home entertainment, etc.
[0060] Step 302: for a dimension combination including at least two dimensions, determine a metric value of a dimension field combination in the dimension combination, and determine the number of dimension field combinations corresponding to the metric value.
[0061] Each dimension includes multiple dimension fields. The dimensions of at least two dimensions can be combined to form multiple dimension field combinations. For example, the dimension combination is year, item, and city. The dimension combination fields can be 2021 + City A + Real Estate, 2022 + City A + Real Estate, 2023 + City A + Real Estate, 2021 + City C + Real Estate, 2022 + City C + Real Estate, 2023 + City C + Real Estate. The measure value of the dimension field combination can be used to represent the sales of real estate in City A in 2021. Since different dimension field combinations may have the same measure value (the sales obtained after the combination are the same), it is possible to further determine how many dimension field combinations correspond to the same measure value.
[0062] In some embodiments, for each dimension combination in the business data, the metric value of the dimension field combination in the dimension combination is determined, and the number of dimension field combinations corresponding to the metric value is determined, so that the data filtering conditions corresponding to each dimension combination can be determined respectively, and each dimension combination in the business data is filtered according to the corresponding data filtering conditions to minimize unnecessary cube units and reduce occupied storage space.
[0063] In an exemplary embodiment, before storing each dimension field combination corresponding to any dimension combination of a data cube, firstly count the metric value (value) corresponding to each dimension field combination in the dimension combination, and count the number of data items (count) corresponding to each metric value. For example, if the current dimension combination is: year (year), item (item), city (city), and the metric value is sales (sale), then SQL is used to express it as follows:
[0064] select year,item,city,count(*)as count,sum(sale)as value
[0065] from table
[0066] group by year,item,city
[0067] The statistical data are shown in Table 1.
[0068] Table 1 Statistical data
[0069] Number of data items (count) Metric value 3 1000 4 800 1 0 3 0 10 20000 ... ... 5 20
[0070] The number of data items is the number of dimension field combinations with the same metric value. For example, the number of data items with a metric value of 1000 is 3, which means that the number of dimension field combinations with a metric value of 1000 is 3.
[0071] Step 303: Determine data filtering conditions based on the metric value of the dimension field combination and the number of dimension field combinations corresponding to the metric value.
[0072] The data cube stores dimensional field information of multiple dimensions and the measurement values of dimensional field combinations. Determining the measurement value of each dimensional field combination and the fact that the measurement value of the same value corresponds to multiple dimensional field combinations can provide a basis for data filtering.
[0073] In some embodiments, the data filtering condition includes a number threshold and a metric value threshold. The determining of the data filtering condition based on the metric value of the dimension field combination and the number of dimension field combinations corresponding to the metric value includes: determining a first average value based on the number of dimension field combinations corresponding to each metric value and the number of metric values; determining a second average value based on the metric value corresponding to each dimension field combination and the number of dimension field combinations; determining a number threshold and a metric value threshold based on the first average value and the second average value; and determining the data filtering condition based on the number threshold and the metric value threshold.
[0074] Specifically, the number of dimension field combinations corresponding to each metric value is summed, and the sum is divided by the number of metric values to obtain a first average value. Each metric value corresponds to a numerical value, and different metric values correspond to different numerical values. Each metric value in this application refers to a metric value with a fixed unique numerical value. After summing the number of dimension field combinations corresponding to each metric value, the sum is divided by the number of metric values to obtain the first average value. It can be understood that the first average value can be used to evaluate how many dimension field combinations each metric value has.
[0075] Specifically, the metric values corresponding to each dimension field combination are summed, and the sum is divided by the number of dimension field combinations to obtain the second average value. Each dimension field combination has a metric value. After summing the metric values of all dimension field combinations and dividing by the number of dimension field combinations, the second average value can be obtained. It can be understood that the second average value can evaluate the approximate metric value of each dimension field combination.
[0076] By counting the first average value and the second average value, the distribution information of the dimension field combination corresponding to the dimension combination is obtained, and the number threshold and measurement value threshold for filtering the dimension field combination are determined based on the distribution information, so that the determined number threshold and measurement value threshold can be highly adapted to the distribution of the dimension field combination of the dimension combination, thereby improving the accuracy of the data filtering conditions.
[0077] In some embodiments, determining the number threshold and the metric value threshold based on the first average value and the second average value includes: determining a first coordinate based on the number of dimension field combinations corresponding to each metric value, the horizontal coordinate of the first coordinate being the number of dimension field combinations, and the vertical coordinate being the metric value; determining a second coordinate, the horizontal coordinate of the second coordinate being the first average value, and the vertical coordinate being the second average value; determining a third average value based on the distance value from each first coordinate to the second coordinate; determining the distribution area of the dimension field combination based on the third average value and the second coordinate, and determining the number threshold and the metric value threshold based on the distribution area.
[0078] Specifically, each metric value has a first coordinate, the abscissa of the first coordinate is the number of dimension field combinations of each metric value, the ordinate is the metric value, the number of the second coordinate is one, the abscissa of the second coordinate is the first average value, and the ordinate is the second average value. The average value of the distance value from each first coordinate to the second coordinate is calculated to obtain the third average value.
[0079] Among them, the distribution area of the dimension field combination is determined in the plane coordinate system by the third average value and the second coordinate. The distribution area can be a concentrated distribution area. The dimension field combinations within the distribution area are retained, and the dimension field combinations outside the distribution area are selectively filtered. For example, the dimension field combinations corresponding to the metric values with a small number of dimension field combinations outside the distribution area are filtered out, and the dimension field combinations with small metric values outside the distribution area are filtered out.
[0080] The points in the distribution area are the main data used in the data analysis stage. The points outside the distribution area with a small number of dimension field combinations but large metric values are valuable in the data analysis stage and need to be retained, although the number of dimension field combinations corresponding to the metric values is small. Similarly, the points outside the distribution area with small metric values but a large number of dimension field combinations corresponding to the metric values are also valuable in the data analysis stage and need to be retained. The points outside the distribution area with a small number of dimension field combinations and small metric values have no value in the data analysis stage and need to be filtered out. After filtering, it will not affect the business intelligence decision analysis and can save the space occupied by the data cube storage.
[0081] By defining the distribution area of dimensional field combinations, a basis can be provided for efficient filtering of dimensional field combinations based on the distribution area, thereby improving filtering effectiveness.
[0082] In some embodiments, determining the distribution area of the dimension field combination based on the third average value and the second coordinate includes: determining a circular area with the second coordinate as the center and the third average value as the radius, and determining the circular area as the distribution area of the dimension field combination.
[0083] In the exemplary embodiment, the number of dimension field combinations count is used as the x-axis, and the metric value value is used as the y-axis, and the average value of count and value is calculated:
[0084]
[0085]
[0086] Get a second coordinate In the coordinate system, it is represented by (a, b). Assume that the data is shown as follows Figure 4 As shown in the figure, the marked points are the second coordinates, and the rest are the first coordinates of each dimension field combination mapped to the plane coordinate system. The Euclidean distance from each first coordinate to the second coordinate is calculated, and the average of each Euclidean distance is calculated to obtain the third average value r. A circle is drawn with the second coordinate as the center and the third average value r as the radius to obtain a circular area. The circular area is the distribution area of the dimension field combination.
[0087] It should be noted that the distribution area may also be an area of other shapes besides a circular area, for example, a rectangular area with the second coordinate as the center point and the third average value r as half of the side length. The specific shape of the distribution area is not limited here.
[0088] In some embodiments, determining the number threshold and the measurement value threshold based on the distribution area includes: determining a connecting straight line between the second coordinate and the coordinate origin; determining the intersection coordinates close to the coordinate origin from the intersection of the connecting straight line and the distribution area boundary; determining the number threshold according to the horizontal coordinate value of the intersection coordinates, and determining the measurement value threshold according to the vertical coordinate value of the intersection coordinates.
[0089] In the exemplary embodiment, continuing with the above example, taking the distribution area as a circular area as an example, assuming that the second coordinate is (a, b), the straight line from the origin of the coordinate to the second coordinate is:
[0090]
[0091] Points less than the number threshold and points less than the metric threshold are all outside the circular area and in the area near the coordinate origin at the lower left. The intersection of the straight line and the circular area near the coordinate origin is the point closest to the coordinate origin among all the points on the circle. Therefore, a straight line from the coordinate origin to the second coordinate is selected, such as Figure 5a and Figure 5b The figure shows the positional relationship between the straight line from the coordinate origin to the second coordinate and the boundary of the circular area.
[0092] The straight line is represented by the function:
[0093]
[0094] The circle with the second coordinate as the center and the third average value r as the radius is expressed by the function:
[0095] (x) 2 +(yb) 2 =r 2
[0096] Solving the equation, we get the coordinates of the intersection point at the lower left corner as (c, d).
[0097] In an exemplary embodiment, the number threshold is determined according to the abscissa of the intersection coordinates, and the metric value threshold is determined according to the ordinate of the intersection coordinates, including multiple implementations, which are listed as follows:
[0098] Method 1: The horizontal coordinate value of the intersection coordinate is used as the number threshold, and the vertical coordinate value of the intersection coordinate is used as the measurement value threshold.
[0099] like Figure 6The figure shows a schematic diagram of the filtering area. In the figure, the rectangular area framed by the intersection coordinates and the coordinate origin is the filtering area, that is, the horizontal coordinate value of the intersection coordinates is used as the number threshold, and the vertical coordinate value is used as the measurement value threshold. The dimension field combination whose number threshold (count) is less than or equal to the horizontal coordinate value of the intersection coordinates and whose measurement value (value) is less than or equal to the vertical coordinate value of the intersection coordinates is deleted.
[0100] In the exemplary embodiment, assuming that the coordinates of the intersection point are (c, d), the cells to be stored in the final data cube are expressed in SQL as follows:
[0101] select year,item,city,count(*)as count,sum(sale)as value
[0102] from table
[0103] group by year,item,city
[0104] having count(*)>c and sum(sale)>d.
[0105] Method 2: The horizontal coordinate value of the intersection coordinate is used as the first reference value, and any value in the alternative interval centered on the first reference value is used as the number threshold; the vertical coordinate value of the intersection coordinate is used as the second reference value, and any value in the alternative interval centered on the second reference value is used as the measurement value threshold.
[0106] The size of the candidate interval centered on the first reference value and the size of the candidate interval centered on the second reference value are set according to requirements.
[0107] In some embodiments, determining the number threshold and the measurement value threshold based on the distribution area includes: determining a first tangent and a second tangent of a circular boundary of the distribution area, the first tangent and the second tangent respectively passing through the coordinate origin; obtaining a first intersection point between the first tangent and the circular boundary, and a second intersection point between the second tangent and the circular boundary; obtaining an arc on the circular boundary close to the coordinate origin through the first intersection point and the second intersection point; determining the number threshold as the horizontal coordinate value of any point on the arc, and determining the measurement value threshold as the vertical coordinate value of any point on the arc.
[0108] like Figure 7The figure shows a schematic diagram of the tangent line passing through the coordinate origin of the circular boundary of the distribution area. Assume that the first tangent line is tangent to the circular boundary at the first tangent point A, and the second tangent line is tangent to the circular boundary at the second tangent point B. Then, the coordinates of any point on the arc C, which is close to the coordinate origin and is divided by A and B, are used to determine the count threshold and the measurement value threshold.
[0109] For example, any point on the arc is used as the target point. The abscissa value in the coordinates of the target point is used as the count threshold, and the ordinate value in the target point is used as the measurement value threshold.
[0110] In some embodiments, the method further includes: obtaining the total number of different measurement values in the measurement values of the dimension field combinations in the dimension combination; determining whether the total number of different measurement values is less than a preset threshold value; and when it is not less than the preset threshold value, performing the step of determining the data filtering condition according to the measurement values of each dimension field combination and the number of dimension field combinations corresponding to the measurement values.
[0111] Among them, when the total number of different measurement values is less than the preset threshold value, the subsequent filtering steps are no longer executed.
[0112] When the total number of different measurement values is not less than the preset threshold value, the dimension field combinations of the dimension combination are filtered by determining the count threshold and the measurement value threshold, so as to ensure that the total number of dimension field combinations for data analysis can meet the requirements of data analysis, and to avoid filtering out the dimension field combinations corresponding to several measurement values of the dimension combination when the total number of different measurement values in the dimension combination is less than the preset threshold value, resulting in too few measurement values for data analysis and affecting the data analysis result.
[0113] Among them, the preset threshold value can be pre-configured according to the data analysis requirements.
[0114] In an exemplary embodiment, assume that the dimension field combinations of a certain dimension combination are counted according to different measurement values, and a total of n rows of data are obtained. One row of data includes the number of dimension field combinations corresponding to a measurement value. A minimum number of rows min is set as the preset threshold value. For example, n = 1000. The number of dimensions included in the dimension combination is positively correlated with the number of rows of data used for analysis of the dimension combination, that is, the fewer the number of dimensions included in the dimension combination, the fewer the number of rows of data required for data analysis of the dimension combination, and the closer to the top layer of the data cube. The fewer the number of dimensions included in the dimension combination, the fewer the number of different measurement values. If n < min, then no processing is performed, and all the data of the dimension field combinations are stored; if n > min, then one-step filtering is performed by determining the count threshold and the measurement value threshold.
[0115] In some embodiments, before determining whether the total number of the dimension field combinations is less than a preset threshold value, the method further includes: removing dimension field combinations whose metric values are zero from the dimension field combinations of the dimension combinations.
[0116] For example, the data obtained by statistics in Table 1 is filtered to remove the dimension field combinations with zero metric values, and the data shown in Table 2 is obtained.
[0117] Table 2 filters out rows with a metric value of 0
[0118] Number of data items (count) Metric value 3 1000 4 800 10 20000 ... ... 5 20
[0119] Step 304: Filter the business data according to the data filtering condition, and store the filtered business data in a data cube.
[0120] In some embodiments, filtering the business data according to the data filtering condition includes: determining a target dimension field combination according to the data filtering condition, wherein the target dimension field combination satisfies: the metric value is less than or equal to the metric value threshold, and the number of dimension field combinations corresponding to the metric value is less than or equal to the number threshold; filtering out data corresponding to the target dimension field combination from the business data.
[0121] In a specific embodiment, taking the advertising statistics of the company's credit business as an example, it is assumed that the relevant dimensions are: mobile phone brand (phone_brand), number of loans on multiple platforms (loan_count), delivery time period (event_time), base station longitude and latitude area (area), and third-party cooperation platform (parter); the measurement value is the amount of advertising delivery (hit_count).
[0122] If each dimension field combination of the dimension combination stores the measurement value results in the data cube, a billion-level device will be needed, which will result in too much storage space. The goal of data analysis is to find out the distribution pattern of advertising and analyze the trend of subsequent advertising. This means that the measurement value (i.e., the amount of advertising) must be above a threshold. If the measurement value is a very small value such as 0 or 1, it will not help the analysis; similarly, a value with a small number of dimension field combinations will not help the analysis. Therefore, two filtering thresholds need to be determined. The process is as follows:
[0123] The first step is to count the metric values (value) of the dimension field combinations of all dimension combinations, as well as the number of dimension field combinations corresponding to each metric value, that is, the number of data items (count), and filter out rows with metric values of 0, which can be expressed in SQL as follows:
[0124] select
[0125] phone_brand,
[0126] loan_count,
[0127] event_time,
[0128] area,
[0129] parter,
[0130] count(*)as count,
[0131] sum(hit_count)as value
[0132] from table
[0133] group by phone_brand,loan_count,event_time,
[0134] area,parter
[0135] having sum(hit_count)>0
[0136] The statistical data are shown in Table 3:
[0137] Table 3 Statistical data
[0138] Number of data items (count) Metric value 55 3569 67 9627 17 1767 17 1961 51 6445 57 7269 10 7055 89 841 67 2629 ...... ...... 76 3329 75 728 16 2665
[0139] The second step is to find the average of count and value:
[0140]
[0141]
[0142] Get the average point (48.47,4539.95) in a plane coordinate system.
[0143] The third step is to map the data in Table 3 to the plane coordinate system, calculate the Euclidean distances of all points mapped from the data in Table 3 to the average point (a, b) in the plane coordinate system, and obtain the distance value from each point to the average point;
[0144] Step 4: Calculate the average value of the distance r = 2475.35;
[0145] Step 5: Determine the circle with the average point as the center and the average value of the distance as the radius, as well as the straight line connecting the origin and the average point, and solve the equation:
[0146] The straight line is represented by the function:
[0147] The circle is represented by the function: (x-48.47) 2 +(y-4539.95) 2 =2475.35 2
[0148] Solving the equations yields the coordinates of the two intersection points of the line and the circle, which are:
[0149] (74.9,7015.52)
[0150] (27.04,2532.7)
[0151] Step 6: Filter the dimension field combinations in the business data according to the calculated threshold value, store the filtered business data in the data cube, and obtain the iceberg cube, as follows:
[0152] Take the coordinates of the lower left corner intersection (27.04, 2532.7) as the number threshold and 2532.7 as the measurement threshold. The final unit to be stored in the iceberg cube is expressed in SQL as follows:
[0153] select phone_brand,loan_count,event_time,area,parter,count(*)ascount,sum(hit_count)as value from table group by phone_brand,loan_count,event_time,area,parter having count(*)>=27.04or sum(sale)>=2532.7.
[0154] In the data collection of client users, not all users can be served ads, so most of the data has no ads, or only a small amount of ads are served under a certain dimension value. Ads are analyzed based on the collected data using data cube technology. Sparse cube units occupy more than 80% of the entire data cube. By filtering sparse cube units, 80% of storage space can be saved.
[0155] The embodiments provided by the present disclosure determine data filtering conditions by counting the dimension fields of business data under M dimensions and the field values corresponding to the dimension fields, and for dimension combinations, by counting the metric values of the dimension field combinations in the dimension combinations and the number of dimension field combinations corresponding to the metric values, and filter the business data according to the data filtering conditions to reduce the number of cube units required to save the business data to the data cube. The data filtering conditions can be determined intelligently, and the determined data filtering conditions can adapt to the actual situation of the business data with a high degree of adaptability. Therefore, the business data can be filtered according to the data filtering conditions, and the filtered business data can be stored in the data cube, thereby realizing intelligent filtering of the data cube and reducing the storage space occupied by unnecessary cube units.
[0156] The data method provided by the embodiment of the present disclosure can filter out sparse units of the data cube, solving the problem of the traditional method of filtering data cubes relying on the experience of business experts, thereby achieving the effect of reducing the storage volume of the data cube without affecting the data cube analysis.
[0157] The application scenario of the data cube in the disclosed embodiment is mainly data processing before multi-dimensional data analysis. In addition to the multi-dimensional advertising delivery analysis scenario mentioned in the above specific embodiments, it can also be applied to multi-dimensional credit lending analysis, multi-dimensional black industry anti-fraud analysis, multi-dimensional device fingerprint collection analysis, etc. The application scenario of the data cube can be used on the big data platform.
[0158] It can be understood that the above-mentioned various method embodiments mentioned in the present disclosure can be combined with each other to form a combined embodiment without violating the principle logic. Due to space limitations, the present disclosure will not repeat them. It can be understood by those skilled in the art that in the above-mentioned method of the specific implementation method, the specific execution order of each step should be determined according to its function and possible internal logic.
[0159] In addition, the present disclosure also provides a data processing device, an electronic device, and a computer-readable storage medium, all of which can be used to implement any business data processing method provided by the present disclosure. The corresponding technical solutions and descriptions are referred to in the corresponding records of the method part and will not be repeated here.
[0160] Figure 8 This is a block diagram of a business data processing device provided by an embodiment of the present disclosure, which is applied to a synchronization component. The specific implementation of the data processing device can refer to the relevant description of the above method embodiment, which will not be repeated here. The device includes:
[0161] The first processing module 801 is used to determine the dimension fields of the business data under M dimensions, and the field values corresponding to the dimension fields, where M is an integer greater than 1;
[0162] The second processing module 802 is used to determine, for a dimension combination including at least two dimensions, a metric value of a dimension field combination in the dimension combination, and determine the number of dimension field combinations corresponding to the metric value;
[0163] The third processing module 803 is used to determine a data filtering condition according to the metric value of the dimension field combination and the number of dimension field combinations corresponding to the metric value;
[0164] The fourth processing module 804 is used to filter the business data according to the data filtering condition, and store the filtered business data in a data cube.
[0165] It can be seen that the embodiment of the present application determines the data filtering condition by counting the dimension fields of the business data under M dimensions and the field values corresponding to the dimension fields, and for the dimension combination, by counting the metric values of the dimension field combination in the dimension combination and the number of dimension field combinations corresponding to the metric values, and filters the business data according to the data filtering condition to reduce the number of cube units required to save the business data to the data cube. The data filtering condition can be determined intelligently, and the determined data filtering condition can adapt to the actual situation of the business data with a high degree of adaptability, and then the business data can be filtered according to the data filtering condition, and the filtered business data can be stored in the data cube, thereby realizing intelligent filtering of the data cube and reducing the storage space occupied by unnecessary cube units.
[0166] Fig. 9 A block diagram of an electronic device provided in an embodiment of the present disclosure. An embodiment of the present disclosure provides an electronic device, which includes: at least one processor 901; at least one memory 902, and one or more I / O interfaces 903 connected between the processor 901 and the memory 902; wherein the memory 902 stores one or more computer programs that can be executed by the at least one processor 901, and the one or more computer programs are executed by the at least one processor 901 so that the at least one processor 901 can execute the above-mentioned business data processing method.
[0167] The present disclosure also provides a computer-readable storage medium on which a computer program is stored, wherein the computer program implements the above-mentioned business data processing method when executed by a processor / processing core. The computer-readable storage medium may be a volatile or non-volatile computer-readable storage medium.
[0168] The embodiments of the present disclosure also provide a computer program product, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above-mentioned business data processing method.
[0169] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In a hardware implementation, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or may be implemented as hardware, or may be implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable storage medium, which may include a computer storage medium (or a non-transitory medium) and a communication medium (or a temporary medium).
[0170] As is known to those of ordinary skill in the art, the term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable program instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), static random access memory (SRAM), flash memory or other memory technology, portable compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. In addition, it is known to those of ordinary skill in the art that communication media typically contain computer-readable program instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and may include any information delivery medium.
[0171] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0172] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be customized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.
[0173] The computer program product described herein may be implemented in hardware, software, or a combination thereof. In one optional embodiment, the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (SDK), etc.
[0174] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.
[0175] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0176] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0177] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.
[0178] Example embodiments have been disclosed herein, and although specific terms are employed, they are used and should be interpreted only in a general illustrative sense and not for limiting purposes. In some instances, it will be apparent to those skilled in the art that, unless otherwise expressly noted, features, characteristics, and / or elements described in conjunction with a particular embodiment may be used alone or in combination with features, characteristics, and / or elements described in conjunction with other embodiments. Therefore, those skilled in the art will appreciate that various changes in form and detail may be made without departing from the scope of the present disclosure as set forth in the appended claims.
Claims
1. A business data processing method, characterized in that: include: Determine the dimension fields of the business data under M dimensions and the field values corresponding to the dimension fields, where M is an integer greater than 1; For a dimension combination including at least two dimensions, determining a metric value of a dimension field combination in the dimension combination, and determining the number of dimension field combinations corresponding to the metric value; Determining a data filtering condition according to the metric value of the dimension field combination and the number of dimension field combinations corresponding to the metric value; The business data is filtered according to the data filtering condition, and the filtered business data is stored in a data cube.
2. The method according to claim 1, characterized in that The data filtering condition includes a number threshold and a metric value threshold; the data filtering condition is determined according to the metric value of the dimension field combination and the number of dimension field combinations corresponding to the metric value, including: Determine a first average value according to the number of dimension field combinations corresponding to each metric value and the number of metric values; Determine a second average value according to the metric value corresponding to each dimension field combination and the number of dimension field combinations; Determine a number threshold and a metric value threshold according to the first average value and the second average value; The data filtering condition is determined according to the number threshold and the metric value threshold.
3. The method according to claim 2, characterized in that The determining of the number threshold and the metric value threshold according to the first average value and the second average value includes: Determine a first coordinate according to the number of dimension field combinations corresponding to each metric value, wherein the abscissa of the first coordinate is the number of dimension field combinations, and the ordinate is the metric value; Determine a second coordinate, wherein the abscissa of the second coordinate is the first average value, and the ordinate is the second average value; Determine a third average value according to each distance value from the first coordinate to the second coordinate; The distribution area of the dimension field combination is determined according to the third average value and the second coordinate, and the number threshold and the metric value threshold are determined based on the distribution area.
4. The method according to claim 3, characterized in that The determining the distribution area of the dimension field combination according to the third average value and the second coordinate includes: A circular area is determined with the second coordinate as the center and the third average value as the radius, and the circular area is determined as the distribution area of the dimension field combination.
5. The method according to claim 4, characterized in that The determining the number threshold and the metric value threshold based on the distribution area includes: Determine a straight line connecting the second coordinate and the coordinate origin; Determine the coordinates of the intersection points close to the coordinate origin from the intersection points of the connecting straight line and the distribution area boundary; The number threshold is determined according to the abscissa value of the intersection coordinates, and the metric value threshold is determined according to the ordinate value of the intersection coordinates.
6. The method according to claim 4, characterized in that Determining the number threshold and the metric value threshold based on the distribution area includes: Determine a first tangent line and a second tangent line of a circular boundary of the distribution area, wherein the first tangent line and the second tangent line pass through a coordinate origin; Obtaining a first intersection point between the first tangent line and the circular boundary, and a second intersection point between the second tangent line and the circular boundary; Obtaining a circular arc on the circular boundary close to the coordinate origin through the first intersection point and the second intersection point; The number threshold is determined as the horizontal coordinate value of any point on the arc, and the measurement value threshold is determined as the vertical coordinate value of any point on the arc.
7. The method according to claim 1, characterized in that The method further comprises: Obtaining the total number of different metric values in the metric values of the dimension field combination in the dimension combination; Determining whether the total number of the different metric values is less than a preset threshold; When the value is not less than the preset threshold value, the step of determining the data filtering condition according to the metric value of the dimensional field combination and the number of dimensional field combinations corresponding to the metric value is performed.
8. The method according to claim 7, characterized in that Before determining whether the total number of different metric values in the dimension combination is less than a preset threshold value, the method further includes: From the dimension field combinations of the dimension combination, remove the dimension field combinations whose measure values are zero.
9. The method according to claim 1, characterized in that: The filtering of the business data according to the data filtering condition includes: Determine a target dimension field combination according to the data filtering condition, wherein the target dimension field combination satisfies: the metric value is less than or equal to the metric value threshold, and the number of dimension field combinations corresponding to the metric value is less than or equal to the number threshold; Data corresponding to the target dimension field combination is filtered out from the business data.
10. A business data processing device, characterized in that: include: The first processing module is used to determine the dimension fields of the business data under M dimensions, and the field values corresponding to the dimension fields, where M is an integer greater than 1; A second processing module is used to determine, for a dimension combination including at least two dimensions, a metric value of a dimension field combination in the dimension combination, and determine the number of dimension field combinations corresponding to the metric value; A third processing module is used to determine a data filtering condition according to the metric value of the dimension field combination and the number of dimension field combinations corresponding to the metric value; The fourth processing module is used to filter the business data according to the data filtering condition and store the filtered business data in the data cube.
11. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores one or more computer programs that can be executed by the at least one processor, and the one or more computer programs are executed by the at least one processor to enable the at least one processor to execute the business data processing method according to any one of claims 1 to 9.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the computer program implements the business data processing method according to any one of claims 1 to 9.
13. A computer program product, characterized in that It includes a computer-readable code, or a non-volatile computer-readable storage medium carrying a computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the business data processing method as described in any one of claims 1 to 9.
Citation Information
Patent Citations
Big data intelligent analysis system and method across business domains
CN108829707A
Method and device for collaborative analysis of data and computer readable storage medium
CN116955458A
Data cube storage method and device, computer equipment and storage medium
CN117971986A
Distributed Iceberg Cubing over Ordered Dimensions
US20160275164A1
Data cube generation
US20170046370A1
