Business rule mining method, device and equipment of order data and storage medium

CN117785989BActive Publication Date: 2026-10-16CHINA UNITED NETWORK COMM GRP CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202311819627.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-27
Publication Date
2026-10-16
Estimated Expiration
2043-12-27

AI Technical Summary

Technical Problem

[0005]本申请提供一种订单数据的业务规则挖掘方法、装置、设备和存储介质,用以解决现有数据挖掘方法,不能准确获取订单数据各个业务场景下业务规则的技术问题

Benefits of technology

[0041] This application provides a method, apparatus, device, and storage medium for mining business rules from order data. By analyzing business order data in JSON format, it mines business rules for each scenario dimension in the order business, thereby improving the accuracy of business rule mining in the order business.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117785989B_ABST
    Figure CN117785989B_ABST
Patent Text Reader

Abstract

The application provides a business rule mining method, device and equipment for order data and a storage medium, which can be used in the technical field of data processing. The method comprises the following steps: obtaining a plurality of sample data in JSON data format; wherein the sample data comprises a unique identifier, a dimension set and a data set, the data set comprises a plurality of key-value pair data, and the dimension set comprises a plurality of dimension fields, each of which corresponds to the key name of one key-value pair data in the data set; obtaining a dimension result set and a data result set based on the sample data; wherein the dimension result set comprises the dimension fields of each sample data, and the data result set comprises the data rules of the key values of each key-value pair data in the data set of each sample data; and performing rule mining based on the dimension result set and the data result set to obtain a rule set. The method of the application can mine the business rules under each scene dimension in the order business, thereby improving the accuracy of the business rule mining in the order business.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a method, apparatus, device, and storage medium for mining business rules from order data. Background Technology

[0002] Data mining is the process of extracting implicit, previously unknown, but potentially useful information and knowledge from large amounts of incomplete, noisy, fuzzy, and random real-world application data. Data mining is a decision support process that analyzes each data point to find patterns within large datasets. Data mining algorithms specifically extract frequent itemsets from massive datasets, identifying reliable frequent itemsets for further analysis.

[0003] Data mining algorithms mainly consist of four steps: data extraction, data cleaning, data mining, and results analysis and visualization. Data extraction refers to providing a large amount of data to be mined; data cleaning involves converting the raw extracted data into the data format required by our mining algorithms; data mining involves performing various algorithmic operations on the cleaned data, which may include cluster analysis, association analysis, etc., to obtain the desired patterns or rules; and results analysis and visualization involves visualizing the data mining results.

[0004] However, existing data mining algorithms treat all data as the same, performing cluster analysis only on frequent itemsets, ultimately outputting relationships between frequent itemsets. But in order processing, infrequent itemsets also represent a business scenario with their own specific rules. Therefore, using existing data mining algorithms for order data leads to inaccurate results and fails to reveal the business rules underlying various business scenarios within the order data. Summary of the Invention

[0005] This application provides a method, apparatus, device, and storage medium for mining business rules from order data, in order to solve the technical problem that existing data mining methods cannot accurately obtain business rules from order data under various business scenarios.

[0006] According to the first aspect disclosed in this application, this application provides a method for mining business rules from order data, including:

[0007] Obtain sample data in multiple JSON data formats; wherein, the sample data includes a unique identifier, a dimension set, and a dataset, the dataset includes multiple key-value pairs, the dimension set includes multiple dimension fields, and each dimension field corresponds to the key name of a key-value pair in the dataset;

[0008] Based on the sample data, a dimensional result set and a data result set are obtained; wherein, the dimensional result set includes the dimensional fields of each sample data, and the data result set includes the data rules of the key values ​​of each key-value pair in the data set of each sample data;

[0009] Rule mining is performed based on the dimensional result set and the data result set to obtain a rule set; wherein, the rule set includes multiple business rules.

[0010] In one feasible implementation, rule mining is performed based on the dimensional result set and the data result set to obtain a rule set, including:

[0011] Based on the hierarchical relationship of each dimension field in the dimensional result set, a dimensional multi-branch tree is generated;

[0012] Traverse the multi-way tree of the dimensions from bottom to top to obtain multiple scene dimensions; among them, the same tree node is divided into the same scene dimension.

[0013] For each scenario dimension, multiple data rules corresponding to the scenario dimension are obtained from the data result set, and the same rules in the data rules are divided into the same candidate rules. If the proportion of the candidate rule in the multiple data rules corresponding to the scenario dimension is greater than a preset threshold, the candidate rule is determined to be a business rule under the scenario dimension.

[0014] In one feasible implementation, the method further includes:

[0015] For each first target node, obtain the business rules of the lower-level child nodes of the first target node. If there are duplicate rules in the business rules of the child nodes, move the duplicate rules up and merge them with the business rules of the first target node; wherein, the first target node is one of the tree nodes of the dimensional multi-way tree.

[0016] In one feasible implementation, the method further includes:

[0017] Traverse the multi-way tree from bottom to top. For each second target node obtained during the traversal, obtain the business rules of the ancestor node of the second target node. If there are duplicate rules between the business rules of the second target node and the ancestor node, delete the duplicate rules in the business rules of the second target node. The second target node is one of the tree nodes in the multi-way tree.

[0018] In one feasible implementation, the method further includes:

[0019] Obtain the target value; wherein, the target value is the key value of one key-value pair in the dataset of the sample data;

[0020] Based on the data type of the target value, obtain the data rules for the target value.

[0021] In one feasible implementation, the data rules for obtaining the target value are based on its data type, including:

[0022] If the target value is an array, then the data rules for the target value include the data type being an array, the minimum number of elements in the array, and the key names of the objects included in the array;

[0023] If the target value is an object, then the data rules for the target value include whether the data type is an object and whether the object is empty;

[0024] If the target value is a string, then the data rules for the target value include the data type being string and the minimum string length.

[0025] If the target value is a number, then the data rules for the target value include the data type being number and the minimum value of the number.

[0026] If the target value is a date, then the data rules for the target value include the data type being date and the date format.

[0027] In one feasible implementation, sample data in multiple JSON data formats is obtained, including:

[0028] Obtain the original dataset; wherein, the original dataset includes multiple order data;

[0029] The data from each order is converted to JSON format to obtain multiple JSON-formatted sample data.

[0030] The sampled data is cleaned based on preset data cleaning rules to obtain the sample data; wherein, the data cleaning rules include identifier definition rules, dimension definition rules and data format definition rules.

[0031] According to a second aspect disclosed in this application, this application provides a business rule mining apparatus for order data, comprising:

[0032] The data acquisition module is used to acquire sample data in multiple JSON data formats; wherein, the sample data includes a unique identifier, a dimension set, and a dataset, the dataset includes multiple key-value pairs, the dimension set includes multiple dimension fields, and each dimension field corresponds to the key name of a key-value pair in the dataset;

[0033] The data processing module is used to obtain a dimension result set and a data result set based on the sample data; wherein, the dimension result set includes the dimension fields of each sample data, and the data result set includes the data rules of the key values ​​of each key-value pair in the data set of each sample data;

[0034] The rule mining module is used to perform rule mining based on the dimension result set and the data result set to obtain a rule set; wherein, the rule set includes multiple business rules.

[0035] According to a third aspect disclosed in this application, an electronic device is provided, including a processor and a memory communicatively connected to the processor;

[0036] The memory stores computer-executed instructions;

[0037] The processor executes computer execution instructions stored in the memory to implement the method described in any one of the first aspects.

[0038] According to a fourth aspect disclosed in this application, a computer-readable storage medium is provided, wherein computer-executable instructions are stored therein, which, when executed by a processor, are used to implement the method described in any one of the first aspects.

[0039] According to the fifth aspect disclosed in this application, a computer program product is provided, comprising a computer program that, when executed by a processor, is used to implement the method described in any one of the first aspects.

[0040] Compared with the prior art, this application has the following advantages:

[0041] This application provides a method, apparatus, device, and storage medium for mining business rules from order data. By analyzing business order data in JSON format, it mines business rules for each scenario dimension in the order business, thereby improving the accuracy of business rule mining in the order business. Attached Figure Description

[0042] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0043] Figure 1 A flowchart illustrating a business rule mining method for order data provided in an embodiment of this application;

[0044] Figure 2 A flowchart illustrating another business rule mining method for order data provided in this application embodiment;

[0045] Figure 3 This application provides a schematic diagram of the structure of a multi-way tree.

[0046] Figure 4 A schematic diagram of the structure of a business rule mining device for order data provided in an embodiment of this application;

[0047] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.

[0048] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0049] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0050] Data mining is the process of extracting implicit, previously unknown, but potentially useful information and knowledge from large amounts of incomplete, noisy, fuzzy, and random real-world application data. It is a hot research topic in the fields of artificial intelligence and databases. Data mining refers to the non-trivial process of revealing implicit, previously unknown, and potentially valuable information from large amounts of data in databases. As a decision support process, data mining is highly automated, based on artificial intelligence, machine learning, pattern recognition, statistics, databases, and visualization techniques. It analyzes enterprise data, makes inductive inferences, and uncovers potential patterns to help decision-makers adjust market strategies, reduce risks, and make correct decisions.

[0051] Data mining is a decision support process that analyzes individual data points to find patterns within large datasets. Data mining algorithms extract frequent itemsets from massive datasets, identifying reliable frequent itemsets for further analysis. Existing data mining algorithms include the Apriori algorithm, FP-growth algorithm, ECLAT algorithm, and association rule generation algorithms.

[0052] Data mining algorithms mainly consist of four steps: data extraction, data cleaning, data mining, and results analysis and visualization. Data extraction refers to providing a large amount of data to be mined; data cleaning involves converting the raw extracted data into the data format required by our mining algorithms; data mining involves performing various algorithmic operations on the cleaned data, which may include cluster analysis, association analysis, etc., to obtain the desired patterns or rules; and results analysis and visualization involves visualizing the data mining results.

[0053] However, existing data mining algorithms treat all data as the same, performing only frequent item clustering analysis, ultimately outputting relationships between frequent itemsets. But in real-world business scenarios, there's the concept of business scenarios, which are determined by dimensions. Therefore, we need to cluster data according to predefined dimensions during the mining process, and then mine data within the same dimensions. Existing data mining algorithms all have a frequent itemset extraction step, but for our actual order business data, infrequent itemsets also constitute a business scenario, and specific rules should apply to this scenario as well.

[0054] For government and enterprise order business, the rules under each scenario dimension are actually effective business rules. However, due to insufficient business data for that scenario dimension, or in other words, insufficient order volume, the rules under that scenario may be classified as infrequent itemsets. This is inaccurate for that scenario and will prevent the discovery of the actually effective business rules within that scenario. Therefore, using existing data mining algorithms for order business data will lead to inaccurate data mining results and an inability to obtain the business rules for each business scenario within the order data.

[0055] To address the aforementioned technical issues, this application proposes a method for mining business rules from order data. By analyzing business order data in JSON format, the method mines business rules for each scenario dimension within the order business, thereby improving the accuracy of business rule mining in the order business.

[0056] The technical solution of the business rule mining method for order data provided in this application will be described in detail below through specific embodiments. It should be noted that the following embodiments may exist alone or in combination with each other, and the same or similar content may not be described again in different embodiments.

[0057] Figure 1 A flowchart illustrating a business rule mining method for order data provided in this application embodiment is shown below. Figure 1 In some embodiments, the process of the business rule mining method for order data includes the following steps:

[0058] S101, retrieve sample data in multiple JSON data formats; the sample data includes a unique identifier, a dimension set, and a dataset. The dataset includes multiple key-value pairs, and the dimension set includes multiple dimension fields, each dimension field corresponding to the key name of a key-value pair in the dataset.

[0059] Specifically, a unique identifier can be represented by the order number, serial number, work order number, etc. in the order data.

[0060] Specifically, the dataset is the specific content contained in the order data of the order business. Each piece of data is stored in the form of key-value pairs, such as "product code": "XXXXX", "business province": "XXX", "business operation type": "XX", etc.

[0061] Specifically, dimension fields are used to distinguish different business scenarios. For order business, the business scenarios are data dimensions such as product code, business province, and business operation type in the order data. Since these fields are also data in the sample data dataset, each dimension field corresponds to a key name in a key-value pair within the dataset. Each dimension field corresponds to a key name in a key-value pair, meaning each dimension field also has a corresponding key value. This allows the data characteristics of the key value to reflect the rules of the dimension field. Business operation types typically include order business operations such as product ordering, business changes, tariff changes, account transfer, and account cancellation.

[0062] S102, based on the sample data, obtain the dimension result set and the data result set; wherein, the dimension result set includes the dimension fields of each sample data, and the data result set includes the data rules of each key-value pair in the data set of each sample data.

[0063] The dimension result set includes the dimension fields of each sample data, and each dimension field is identified by a unique identifier to the sample data to which it belongs.

[0064] The data result set includes the data rules for the key values ​​of each key-value pair in each sample data, and each data rule is also marked by a unique identifier in the sample data.

[0065] S103, rule mining is performed based on the dimension result set and the data result set to obtain the rule set; the rule set includes multiple business rules.

[0066] In this process, by determining the direction of data mining through the dimensional result set, and then further mining based on the data rules of each data node initially collected in the data result set, the business rules of each scenario dimension in the order business can be obtained.

[0067] Specifically, business rules generally include whether a certain field in an order is mandatory, the required data format for a certain field, and whether the input value for a certain field needs to be greater than or less than a certain threshold, etc.

[0068] In this embodiment, by analyzing business order data in JSON format, business rules under each scenario dimension in the order business are mined, thereby improving the accuracy of business rule mining in the order business.

[0069] exist Figure 1 Based on the embodiments shown, the following is combined with Figure 2 The technical solution for mining business rules from the aforementioned order data will be further introduced.

[0070] Figure 2 A flowchart illustrating another business rule mining method for order data provided in this application embodiment is shown below. Figure 2 In some embodiments, the process of the business rule mining method for order data includes the following steps:

[0071] S201, Obtain the original dataset; the original dataset includes multiple order data.

[0072] Order data refers to order data from the order business provided by the data source, which can be obtained through database queries or file parsing.

[0073] S202 converts the data of each order into JSON format to obtain multiple JSON format sample data.

[0074] The original order data may be in the form of database tables, files, etc. To facilitate subsequent data mining, the order data will be uniformly converted into JSON data format.

[0075] Here is an example of sampled data in JSON format:

[0076] Among them, sample data one is:

[0077]

[0078]

[0079] Specifically, "param3":"32" represents a key-value pair, where "param3" is the key name and "32" is the corresponding key value.

[0080] S203, Based on preset data cleaning rules, perform data cleaning on the sampled data to obtain sample data; wherein, the data cleaning rules include identifier definition rules, dimension definition rules and data format definition rules.

[0081] In addition to format conversion of order data, data cleaning of the sampled data is also required. Data cleaning includes defining unique identifiers for the sampled data based on identifier definition rules, defining dimension fields that indicate the direction of data mining based on dimension definition rules, and ensuring that the sampled data has complete and correct data fields and formats based on data format definition rules. The purpose of dimension definition rules is to indicate the direction of data mining. Specific dimension fields can be set through dimension definition rules to mine business rules for specific scenarios under those dimension fields.

[0082] For example, after data cleaning, the above sample data one and sample data two are shown in the following example:

[0083] Sample data one is as follows:

[0084]

[0085]

[0086]

[0087] Specifically, "dimensions" refers to the set of dimensions, "unique" refers to a unique identifier, and "model" refers to the dataset.

[0088] S204. Based on the sample data, obtain the dimension result set and the data result set; wherein, the dimension result set includes the dimension fields of each sample data, and the data result set includes the data rules of each key-value pair in the data set of each sample data.

[0089] Preferably, the acquisition of data rules includes: acquiring a target value; wherein the target value is a key value of a key-value pair in the dataset of the sample data; and acquiring the data rule of the target value based on the data type of the target value.

[0090] Among them, different data rules are obtained for the target value depending on the data type of the target value.

[0091] Specifically, the data rules for obtaining the target value can be determined by the data type of the key-value pair data. These rules include:

[0092] Step 1: If the target value is an array, the data rules for the target value include the data type being an array, the minimum number of elements in the array, and the key names of the objects included in the array.

[0093] For array-type data, the data rules include that the data type is array and the minimum number of elements that the array can contain. If the data contains objects, the data rules also include which objects need to be input.

[0094] For example, in sample data one, "param2" is an array, and its data rules include that the data type is an array, the minimum number of elements is 2, and the object key names include "param21" and "param22".

[0095] Step 2: If the target value is an object, the data rules for the target value include whether the data type is object and whether the object is empty.

[0096] For object-type data, the data rules include whether the data type is object and whether the object is empty.

[0097] For example, in sample data one, if "param1" is an object, then its data rules include that the data type is an object and that the object is not empty.

[0098] Step 3: If the target value is a string, the data rules for the target value include the data type being string and the minimum string length.

[0099] For string data, the data rules include the data type being string and the minimum string input length.

[0100] For example, in sample data one, "param111" is a string, so its data rules include the data type being string and the minimum length of the string input being 1.

[0101] Step 4: If the target value is a number, the data rules for the target value include the data type being number and the minimum value of the number.

[0102] For numeric data, the data rules include the data type being numeric and the minimum numeric input value.

[0103] Step 5: If the target value is a date, the data rules for the target value include the data type being date and the date format.

[0104] For date data, the data rules include the data type being date and the date input format. For example, the date format is "XXXX-XX-XX" or "XXXX.XX.XX".

[0105] S205 generates a multi-way tree of dimensions based on the hierarchical relationship of each dimension field in the dimension result set.

[0106] For dimensional multi-way trees, leaf paths at corresponding levels are constructed based on the hierarchical relationship of the dimension fields in the dimension results. If multiple values ​​exist for the same dimension, they are split into individual dimensions to construct the dimensional multi-way tree.

[0107] For example, the multi-way tree structure constructed from sample data one and sample data two is as follows: Figure 3 As shown.

[0108] S206, traverse the multi-way tree from bottom to top to obtain multiple scene dimensions; among them, the same tree nodes are divided into the same scene dimension.

[0109] In this process, the multi-branch tree is traversed from bottom to top, and the tree nodes obtained during the traversal are pushed onto the stack. During the stacking process, the same tree nodes are divided into the same scene dimension.

[0110] For example, the tree node “$.param1.param11.param111” generated by sample data one is the same as the tree node “$.param1.param11.param111” generated by sample data two, belonging to the same scene dimension.

[0111] S207: For each scenario dimension, obtain multiple data rules corresponding to the scenario dimension from the data result set, and classify the same rules in the data rules into the same candidate rule. If the proportion of the candidate rule in the multiple data rules corresponding to the scenario dimension is greater than the preset threshold, then the candidate rule is determined to be the business rule under the scenario dimension.

[0112] Within the same scenario dimension, there are multiple tree nodes. The unique identifier of each tree node is used to retrieve the corresponding data rules from the data result set.

[0113] For example, the scenario dimension "$.param1.param11.param111" has a key value of "1" in the key-value pair data of sample data one, and the corresponding data rules are "data type is string" and "minimum string input length is 1". In sample data two, its corresponding key-value pair data has a key value of "1-2", and the corresponding data rules are "data type is string" and "minimum string input length is 3". Further classification of the data rules yields three candidate rules: "data type is string", "minimum string input length is 1", and "minimum string input length is 3". The candidate rule "data type is string" accounts for 100% of the data rules, while the candidate rules "minimum string input length is 1" and "minimum string input length is 3" each account for 50%. If the preset threshold is 95%, then the proportion of "data type is string" in the data rules is greater than the preset threshold, and it is determined as the business rule for the tree node "$.param1.param11.param111".

[0114] S208. For each first target node, obtain the business rules of the lower-level child nodes of the first target node. If there are duplicate rules in the business rules of the child nodes, move the duplicate rules up and merge them with the business rules of the first target node. Here, the first target node is one of the tree nodes in the multi-way tree.

[0115] Specifically, the tree nodes pushed onto the stack in step 206 are popped. During the popping process, the repeated rules of sibling nodes with the same parent in the multi-dimensional tree are merged and moved upward, which can make the rules of the same tree path converge.

[0116] For example, if the child nodes "$.param2.param21" and "$.param2.param22" under the node "$.param2" both contain the repeating rule "data type is object", then this repeating rule can be moved up and merged into the business rule of the node "$.param2".

[0117] S209, traverse the multi-way tree from bottom to top. For each second target node obtained during the traversal, obtain the business rules of the ancestor node above the second target node. If there are duplicate rules between the business rules of the second target node and the ancestor node, delete the duplicate rules in the business rules of the second target node. Here, the second target node is one of the tree nodes in the multi-way tree.

[0118] Specifically, by deleting rules in a multi-way tree where the current tree node is identical to all its ancestor nodes, rules along the same ancestor path converge, and scene and rule data are generated.

[0119] For example, suppose the node “$.param1.param11.param111” has the rule “data type is string”, and its ancestor nodes “$.param1.param11” and “$.param1” also contain the rule “data type is string”, then “$.param1.param11.param111” will delete its duplicate rule “data type is string”.

[0120] Finally, the business rule analysis results obtained based on sample data one and sample data two are as follows:

[0121]

[0122]

[0123]

[0124]

[0125] Specifically, the parameters in the results have the following meanings:

[0126] Layer: Represents a hierarchy. The number of layers is consistent with the number of dimensions, and the hierarchical relationship is consistent with the order of dimensions.

[0127] Data: Represents the dimensional data for this level.

[0128] Rules: Represents the rule data mined at this level.

[0129] validateDataPath: Represents the JSON path of this rule.

[0130] validateDataType: Represents the data format of this JSON path, such as object, string, date, number, etc.

[0131] validateDataValueMethod: Represents the data type of the JSON path, such as OBJECT (object node), PROPERTY (property node), DICTIONARY (dictionary), etc.

[0132] rule: Represents the operator for this rule. There are many operators, such as NOT NULL, greater than, less than, equal to, length greater than, length equal to, regular expression matching, etc.

[0133] param1: Represents the right-hand side of the expression. The expression is the formula used in the actual operation of the rule. For example, defining "A>2" is an expression. The specific business rule is that the node field A is greater than 2. Therefore, the left-hand side of the expression is "field A", the operator of the expression is "greater than", and the right-hand side of the expression is the condition "2".

[0134] param1DataType: Represents the data format of the rvalue.

[0135] param1DataType: Represents the data type of the rvalue.

[0136] `leaves` represents child nodes, which are the child nodes in the multi-way tree of dimensions. Because when defining dimension fields, by default, the dimension listed earlier takes precedence among multiple dimension fields, the dimension tree is constructed by treating the earlier dimensions as parent nodes and the later dimensions as leaf nodes, consistent with the definition of the `layer` field.

[0137] Specifically, regarding the above business rule analysis results, for the multi-way tree of dimensions, layer=1 indicates the first level. The first level is the entire scenario, which is defined as independent of dimensions; all dimensions satisfy the rule. Therefore, when obtaining rules, we should first look at the dimension level. Since the dimension level is the first level, it means that the rule is satisfied across the entire scenario. Thus, we can derive the rules for "$.param1.param11.param111" being non-empty and "$.param1.param11.param111" being a string in the entire scenario.

[0138] Correspondingly, layer=2 indicates the second level, which is the first dimension field "$.param1.param11.param111" defined during data cleaning. If rules has data, then in the scenario of "$.param1.param11.param111=1-2", the rules in rules must be satisfied.

[0139] Correspondingly, layer=3 represents the third level, which is our second dimension "$.param2.param21". If rules has data, then we can see that in the scenarios of "$.param1.param11.param111 = 1-2" and "$.param2.param21 = 211-2", the rules in rules must be satisfied. The validity of the rules becomes more restricted as the level deepens.

[0140] Furthermore, because the sample data 1 and sample data 2 used as data sources are simple, the resulting rule dimension tree is relatively simple, and all rules can converge to the root node, meaning these rules are applicable to all scenarios. In actual data mining, each layer may have specific rules, representing that each scenario has its own separate rules.

[0141] In this embodiment, the mining algorithm is based on constructing a multi-way tree and performing a double-level traversal to make the rule set converge towards the top level, thereby achieving the effect of convergence of subdivided scene rules to general scene rules.

[0142] Figure 4 This is a schematic diagram of the structure of a business rule mining device for order data provided in an embodiment of this application. (See attached diagram.) Figure 4 The business rule mining device for order data includes various functional modules for implementing the aforementioned business rule mining method for order data. Any functional module can be implemented by software and / or hardware.

[0143] In some embodiments, the business rule mining device 400 for order data includes a data acquisition module 401, a data processing module 402, and a rule mining module 403. Wherein:

[0144] The data acquisition module 401 is used to acquire sample data in multiple JSON data formats. The sample data includes a unique identifier, a dimension set, and a dataset. The dataset includes multiple key-value pairs, and the dimension set includes multiple dimension fields. Each dimension field corresponds to the key name of a key-value pair in the dataset.

[0145] Data processing module 402 is used to obtain dimensional result sets and data result sets based on sample data; wherein, the dimensional result set includes the dimensional fields of each sample data, and the data result set includes the data rules of each key-value pair in the data set of each sample data;

[0146] The rule mining module 403 is used to perform rule mining based on the dimension result set and the data result set to obtain a rule set; the rule set includes multiple business rules.

[0147] In some embodiments, the rule mining module 403 is specifically used for:

[0148] Based on the hierarchical relationship of each dimension field in the dimension result set, a dimension multi-way tree is generated;

[0149] Traverse the multi-way tree from bottom to top to obtain multiple scene dimensions; among them, the same tree node is divided into the same scene dimension.

[0150] For each scenario dimension, obtain multiple data rules corresponding to the scenario dimension from the data result set, and classify the same rules in the data rules into the same candidate rule. If the proportion of the candidate rule in the multiple data rules corresponding to the scenario dimension is greater than a preset threshold, then the candidate rule is determined to be the business rule under the scenario dimension.

[0151] In some embodiments, the rule mining module 403 is further configured to:

[0152] For each first target node, obtain the business rules of the child nodes under the first target node. If there are duplicate rules in the business rules of the child nodes, move the duplicate rules up and merge them with the business rules of the first target node. The first target node is one of the tree nodes in the multi-way tree.

[0153] In some embodiments, the rule mining module 403 is further configured to:

[0154] Traverse the multi-way tree from bottom to top. For each second target node obtained during the traversal, obtain the business rules of the ancestor node above the second target node. If there are duplicate rules between the business rules of the second target node and the ancestor node, delete the duplicate rules in the business rules of the second target node. Here, the second target node is one of the tree nodes in the multi-way tree.

[0155] In some embodiments, the data processing module 402 is further configured to:

[0156] Obtain the target value; where the target value is the key of a key-value pair in the sample data set;

[0157] Based on the data type of the target value, obtain the data rules for the target value.

[0158] In some embodiments, the data processing module 402 is further configured to:

[0159] If the target value is an array, then the data rules for the target value include the data type being an array, the minimum number of elements in the array, and the key names of the objects included in the array;

[0160] If the target value is an object, then the data rules for the target value include whether the data type is object and whether the object is empty;

[0161] If the target value is a string, then the data rules for the target value include the data type being string and the minimum string length;

[0162] If the target value is a number, then the data rules for the target value include the data type being number, and the minimum value of the number.

[0163] If the target value is a date, then the data rules for the target value include the data type being date and the date format.

[0164] In some embodiments, the data acquisition module 401 is specifically used for:

[0165] Obtain the original dataset; the original dataset includes multiple order data.

[0166] The data from each order is converted to JSON format to obtain multiple JSON-formatted sample data.

[0167] The sampled data is cleaned based on preset data cleaning rules to obtain sample data; the data cleaning rules include identifier definition rules, dimension definition rules and data format definition rules.

[0168] The business rule mining device 400 for order data provided in this application embodiment is used to execute the technical solution provided in the aforementioned business rule mining method embodiment for order data. Its implementation principle and technical effects are similar to those in the aforementioned method embodiment, and will not be repeated here.

[0169] It should be noted that the division of the various modules in the above device is merely a logical functional division. In actual implementation, they can be fully or partially integrated into a single physical entity, or they can be physically separated. Furthermore, these modules can be implemented entirely in software via processing elements, entirely in hardware, or partially in software via processing elements and partially in hardware. For example, the data acquisition module 401 can be a separate processing element, or it can be integrated into a chip in the above device. Alternatively, it can be stored as program code in the memory of the above device, and its functions can be called and executed by a processing element. The implementation of other modules is similar. Moreover, these modules can be fully or partially integrated together, or they can be implemented independently. The processing element here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each of the above modules can be completed through integrated logic circuits in the hardware of the processor element or through software instructions.

[0170] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. (See attached diagram.) Figure 5 The electronic device 500 includes: a processor 501, and a memory 502 communicatively connected to the processor 501;

[0171] Memory 502 stores instructions executed by the computer;

[0172] The processor 501 executes computer execution instructions stored in the memory 502 to implement the technical solution of the aforementioned business rule mining method for order data.

[0173] In the aforementioned electronic device 500, the memory 502 and the processor 501 are electrically connected directly or indirectly to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines, such as bus connections. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be classified as address buses, data buses, control buses, etc., but this does not mean that there is only one bus or one type of bus. The memory 502 stores computer execution instructions for implementing the aforementioned business rule mining method for order data, including at least one software functional module that can be stored in the memory 502 in the form of software or firmware. The processor 501 executes various functional applications and data processing by running the software program and module stored in the memory 502.

[0174] The memory 502 includes at least one type of readable storage medium, not limited to Random Access Memory (RAM), Read Only Memory (ROM), Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), etc. The memory 502 stores programs, and the processor 501 executes the programs after receiving execution instructions. Furthermore, the software programs and modules within the memory 502 may also include an operating system, which may include various software components and / or drivers for managing system tasks (e.g., memory management, storage device control, power management, etc.) and can communicate with various hardware or software components to provide an operating environment for other software components.

[0175] Processor 501 can be an integrated circuit chip with signal processing capabilities. The aforementioned processor 501 can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), etc. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor, or processor 501 can be any conventional processor.

[0176] The electronic device 500 is used to execute the technical solution provided in the aforementioned business rule mining method embodiment for order data. Its implementation principle and technical effect are similar to those in the aforementioned method embodiment, and will not be repeated here.

[0177] This application also provides a computer-readable storage medium storing computer-executable instructions. When a processor executes the computer-executable instructions, it implements the technical solution of the aforementioned business rule mining method for order data.

[0178] The aforementioned computer-readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The computer-readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.

[0179] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Alternatively, the readable storage medium can be an integral part of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components within the control unit of a business rule mining device for order data.

[0180] This application also provides a computer program product, including a computer program that, when executed by a processor, is used to implement the technical solution of the business rule mining method for order data as described above.

[0181] In the above embodiments, those skilled in the art will understand that the above method embodiments can be implemented entirely or partially by software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented entirely or partially in the form of a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of the present invention is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless network, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).

[0182] In the above embodiments, the descriptions of each embodiment have their own emphasis. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments. The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as the combination of these technical features does not contradict each other, it should be considered within the scope of this specification.

[0183] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.

[0184] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.

Claims

1. A method for mining business rules from order data, characterized in that, include: Obtain sample data in multiple JSON data formats; wherein, the sample data includes a unique identifier, a dimension set, and a dataset, the dataset includes multiple key-value pairs, the dimension set includes multiple dimension fields, and each dimension field corresponds to the key name of a key-value pair in the dataset; Based on the sample data, a dimensional result set and a data result set are obtained; wherein, the dimensional result set includes the dimensional fields of each sample data, and the data result set includes the data rules of the key values ​​of each key-value pair in the data set of each sample data; Based on the dimensional result set and the data result set, rule mining is performed to obtain a rule set; wherein, the rule set includes multiple business rules; Obtain the target value; wherein, the target value is the key value of one key-value pair in the dataset of the sample data; If the target value is an array, then the data rules for the target value include the data type being an array, the minimum number of elements in the array, and the key names of the objects included in the array; If the target value is an object, then the data rules for the target value include whether the data type is an object and whether the object is empty; If the target value is a string, then the data rules for the target value include the data type being string and the minimum string length. If the target value is a number, then the data rules for the target value include the data type being number and the minimum value of the number. If the target value is a date, then the data rules for the target value include the data type being date and the date format.

2. The method according to claim 1, characterized in that, Based on the dimensional result set and the data result set, rule mining is performed to obtain a rule set, including: Based on the hierarchical relationship of each dimension field in the dimensional result set, a dimensional multi-branch tree is generated; Traverse the multi-way tree of the dimensions from bottom to top to obtain multiple scene dimensions; among them, the same tree node is divided into the same scene dimension. For each scenario dimension, multiple data rules corresponding to the scenario dimension are obtained from the data result set, and the same rules in the data rules are divided into the same candidate rules. If the proportion of the candidate rule in the multiple data rules corresponding to the scenario dimension is greater than a preset threshold, the candidate rule is determined to be a business rule under the scenario dimension.

3. The method according to claim 2, characterized in that, The method further includes: For each first target node, obtain the business rules of the lower-level child nodes of the first target node. If there are duplicate rules in the business rules of the child nodes, move the duplicate rules up and merge them with the business rules of the first target node; wherein, the first target node is one of the tree nodes of the dimensional multi-way tree.

4. The method according to claim 2, characterized in that, The method further includes: Traverse the multi-way tree from bottom to top. For each second target node obtained during the traversal, obtain the business rules of the ancestor node of the second target node. If there are duplicate rules between the business rules of the second target node and the ancestor node, delete the duplicate rules in the business rules of the second target node. The second target node is one of the tree nodes in the multi-way tree.

5. The method according to claim 1, characterized in that, Obtain sample data in multiple JSON data formats, including: Obtain the original dataset; wherein, the original dataset includes multiple order data; The data from each order is converted to JSON format to obtain multiple JSON-formatted sample data. The sampled data is cleaned based on preset data cleaning rules to obtain the sample data; wherein, the data cleaning rules include identifier definition rules, dimension definition rules and data format definition rules.

6. A business rule mining device for order data, characterized in that, include: The data acquisition module is used to acquire sample data in multiple JSON data formats; wherein, the sample data includes a unique identifier, a dimension set, and a dataset, the dataset includes multiple key-value pairs, the dimension set includes multiple dimension fields, and each dimension field corresponds to the key name of a key-value pair in the dataset; The data processing module is used to obtain a dimension result set and a data result set based on the sample data; wherein, the dimension result set includes the dimension fields of each sample data, and the data result set includes the data rules of the key values ​​of each key-value pair in the data set of each sample data; The rule mining module is used to perform rule mining based on the dimension result set and the data result set to obtain a rule set; wherein, the rule set includes multiple business rules; The data processing module is further configured to obtain a target value; wherein the target value is a key value of a key-value pair in the dataset of the sample data; If the target value is an array, then the data rules for the target value include the data type being an array, the minimum number of elements in the array, and the key names of the objects included in the array; If the target value is an object, then the data rules for the target value include whether the data type is an object and whether the object is empty; If the target value is a string, then the data rules for the target value include the data type being string and the minimum string length. If the target value is a number, then the data rules for the target value include the data type being number and the minimum value of the number. If the target value is a date, then the data rules for the target value include the data type being date and the date format.

7. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Big data mining method and device and data mining server

    CN110442623A