Information acquisition method and related equipment

By storing the decision table as a target file with a specified data structure and converting it into a code segment executable by the rule engine, the matching results of the decision conditions are obtained, which solves the difficulty of tracing the root cause of the problem caused by the rule engine only returning the dimension results of the entire decision table. Improved problem troubleshooting efficiency.

CN118656136APending Publication Date: 2024-09-17MASHANG CONSUMER FINANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410318472.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-19
Publication Date
2024-09-17

AI Technical Summary

Technical Problem

In the existing technology, the rule engine only returns the decision results based on the dimensions of the entire decision table, making it difficult for business personnel to trace which specific business rule configuration has the problem, especially when the expected and actual decision results do not match, troubleshooting problems Time consuming and laborious.

Method used

By storing the decision table as a target file with a specified data structure, the nodes of each decision condition are obtained and converted into code segments executable by the rule engine. After execution, the matching results of each decision condition are obtained, and then the decision is presented in association Conditions and matching results.

Benefits of technology

It achieves the acquisition of matching results for decision condition dimensions, simplifies problem location, improves troubleshooting efficiency, and avoids online problems caused by incorrect configuration of decision tables.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118656136A
    Figure CN118656136A
Patent Text Reader

Abstract

The invention discloses an information acquisition method and related equipment, and aims to solve the problem that a rule engine only returns a decision result based on a whole decision table dimension, so that problem source tracing is difficult to carry out. The method comprises the steps of obtaining a target file, and determining at least one first node contained in the target file; the target file is obtained by storing a decision table configured with decision conditions and expected decision results according to a specified data structure; the single first node has the specified data structure and contains data corresponding to a single decision condition in the decision table; determining a code segment which corresponds to each first node and is allowed to be executed by a rule engine; based on business data, executing each code segment by adopting a rule engine to obtain a matching result corresponding to each code segment and aiming at the business data; and performing association presentation on the matching result corresponding to the first node and the decision condition corresponding to the first node in the decision table.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to an information acquisition method, apparatus, computing device, computer-readable storage medium, and computer program product. Background Art

[0002] A rule engine is a component that can be embedded in an application. Its main function is to separate business decisions from application code and write business decisions using predefined semantic modules. The rule engine can interpret business rules and make business decisions based on these business rules. The rule engine can separate complex and repetitive business rules from various business systems to improve the reuse of business logic and the efficiency of development changes.

[0003] In some current business systems, some business rules are maintained in the code, so when adjusting business rules, the business system code needs to be modified and released. For business rules that may change frequently, in order to simplify the difficulty of business rule configuration, the business system can provide business personnel with a configurable "decision table". After the business personnel configure the business rules based on the decision table, the configured decision table can be converted into an executable script to be executed by the rule engine, so that the rule engine can return the decision result based on the entire decision table to the business system.

[0004] The content configured in the decision table generally includes: decision conditions and decision results. A set of decision conditions and corresponding decision results constitute a decision rule. If the rule engine determines that the business data matches the set of decision conditions by, for example, traversing the entire decision table, then the decision rule is established, and the rule engine can return the decision result to the business system.

[0005] The execution of the decision table is a black box for the business system. The rule engine only returns the decision result based on the dimension of "the entire decision table" to the business system. In this way, the business system cannot know whether the decision conditions in the decision table are hit, that is, the business system cannot know the matching result based on the dimension of "decision condition".

[0006] In such a case, if there is a mismatch between the expected decision result and the actual decision result, it is difficult for business personnel to trace which business rule(s) have a configuration problem. Summary of the invention

[0007] Embodiments of the present application provide an information acquisition method, apparatus, computing device, computer-readable storage medium, and computer program product.

[0008] The present application embodiment adopts the following technical solutions:

[0009] A method for obtaining information, comprising:

[0010] Acquire a target file, and determine at least one first node contained in the target file; the target file is obtained by storing a decision table configured with decision conditions and expected decision results according to a specified data structure; a single first node has the specified data structure and contains data corresponding to a single decision condition in the decision table;

[0011] Determine a code segment corresponding to each of the first nodes that is allowed to be executed by the rule engine;

[0012] Based on the business data, each of the code segments is executed using a rule engine to obtain a matching result for the business data corresponding to each of the code segments;

[0013] The matching result corresponding to the first node and the decision condition corresponding to the first node in the decision table are associated and presented.

[0014] An information acquisition device, comprising:

[0015] A node determination unit is used to obtain a target file and determine at least one first node contained in the target file; the target file is obtained by storing a decision table configured with decision conditions and expected decision results according to a specified data structure; a single first node has the specified data structure and contains data corresponding to a single decision condition in the decision table;

[0016] A code determination unit, used to determine a code segment corresponding to each of the first nodes that is allowed to be executed by the rule engine;

[0017] An execution unit, configured to execute each of the code segments using a rule engine based on the business data to obtain a matching result for the business data corresponding to each of the code segments;

[0018] A presentation unit is used to associate and present the matching result corresponding to the first node with the decision condition corresponding to the first node in the decision table.

[0019] A computing device, comprising: a memory and a processor, wherein:

[0020] The memory is used to store computer programs;

[0021] The processor is coupled to the memory and is used to execute the computer program stored in the memory to perform the above method.

[0022] A computer-readable storage medium storing a computer program, wherein the computer program can implement the above method when executed by a computer.

[0023] A computer program product stores instructions, which, when executed by a computer, enable the computer to implement the above method.

[0024] At least one of the above technical solutions adopted in the embodiments of the present application can achieve the following beneficial effects:

[0025] Since the first node can be obtained from the target file with a specified data structure obtained by storing the decision table that has been configured with decision conditions and expected decision results, and based on the characteristic that "the first node contains data corresponding to the 'single decision condition' in the decision table", the first node is converted into a code segment and executed by the rule engine, so the matching result of the "single decision condition" dimension can be obtained.

[0026] Compared with the decision results based on the dimension of the entire decision table, the matching results based on the dimension of "single decision condition" are more likely to locate the problem of the decision table configuration. Therefore, the solution provided in the embodiment of the present application can solve the problem existing in the prior art that the rule engine only returns the decision results based on the dimension of the entire decision table, which makes it difficult to trace the root cause of the problem based on the decision result. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0028] Figure 1 A schematic diagram of a decision table provided in an embodiment of the present application;

[0029] Figure 2 A specific implementation flow chart of an information acquisition method provided in an embodiment of the present application;

[0030] Figure 3 A schematic diagram for associating and presenting the matching result corresponding to the first node and the corresponding decision condition in the decision table;

[0031] Figure 4 A schematic diagram for associating and presenting the matching result corresponding to the first node with the corresponding decision condition in the decision table in a table other than the decision table;

[0032] Figure 5 A flowchart of a specific implementation method of an information acquisition method provided in an embodiment of the present application in an actual scenario;

[0033] Figure 6 A schematic diagram of an interface displayed on the front end of the business system in an embodiment of the present application;

[0034] Figure 7 A schematic diagram of the specific structure of an information acquisition device provided in an embodiment of the present application;

[0035] Figure 8 A schematic diagram of the specific structure of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0036] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.

[0037] Those skilled in the art may appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0038] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, which is only to describe the distinction mode adopted by the objects of the same attributes when describing in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.

[0039] The embodiment of the present application provides an information acquisition method to solve the problem in the prior art that the rule engine only returns the decision result based on the entire decision table dimension, making it difficult to trace the root cause of the problem based on the decision result.

[0040] The executor of the method can be any computing device that can implement the method, such as a server, a mobile phone, a personal computer, an Internet of Things device, a smart wearable device, an intelligent robot, a neural network model, etc.

[0041] The different steps of the method may be implemented by the same execution subject or by different execution subjects. The embodiment of the present application does not limit the execution subject used to implement the method.

[0042] In addition, the execution order of different steps is not limited in the embodiment of the present application. When using the method provided in the embodiment of the present application, the execution order of different steps can be adjusted according to actual needs.

[0043] In order to help readers understand the conception and technical effects of this method, before introducing the specific implementation process of the method, the background of the method is introduced as follows:

[0044] Please refer to the instruction manual Figure 1 , which is a schematic diagram of a "decision table".

[0045] Figure 1 The decision table shown is a 2*4 decision table. 2*4 means: there are "2" decision conditions (such as Figure 1 Age-age and gender-gender) as shown in the table, and there are a total of "4" business rules related to these two decision conditions. Except for the first row (i.e., the header) in the table, the content of each row constitutes a business rule.

[0046] According to the prior art, after receiving the business data to be decided, the rule engine can generate and output the decision results of the decision table dimensions based on the entire decision table.

[0047] For example, when age=15, gender=male in the business data to be decided, the rule engine will find that the business data matches the executable script obtained by converting the decision table. Figure 1 As shown in the decision table, for each decision condition in the first business rule, after the script is executed, the field value "1" will be written to the specific field contained in the business data, that is, the decision result based on the entire decision table will be written: 1.

[0048] The specific field in which the decision result "1" is written can be fed back to the business system, so that after the business system obtains the decision result "1" from the specific field, it can perform subsequent processing based on the decision result.

[0049] However, if the business personnel expect that the business data to be decided can match Figure 1 As shown in the second business rule in the decision table (see the third row of the table), there is a situation where the expected decision result does not match the actual decision result.

[0050] If this happens, the R&D personnel / business personnel need to investigate the reason why the second business rule is not matched. At this time, the R&D personnel / business personnel need to find the original executable script that the rule engine executes to convert the decision table, and compare the source code of the script with the business data to be decided to find out the reason for this situation.

[0051] From the above, it can be seen that according to the prior art, since the rule engine only returns the decision result based on the entire decision table, it is difficult to trace the root cause of the problem based on the decision result. At the same time, even if the cause of the problem can be found by comparing the source code and business data, it is generally time-consuming and labor-intensive. Especially for some decision tables with more complex configurations, it will be more resource-consuming to trace the root cause of the problem in this way.

[0052] It can be seen that the prior art urgently needs a technical solution that can obtain the decision results of the rule engine for the business rules in the decision table from outside the rule engine.

[0053] In response to the above requirements, the inventors studied the characteristics of the decision table and found that:

[0054] Taking the background of the business system as an example, the content configured in the entire decision table is saved by the background in a string in the JavaScript Object Notation (JSON) format. Each grid in the decision table, or the data in each grid, corresponds to a node (JSON node) in the JSON format string. In other words, the content configured in each grid in the decision table will be written into the corresponding JSON node of the JSON format string when the decision table is saved as a JSON format string.

[0055] As Figure 1 Taking the decision table shown as an example, the configured data in the grid, including the decision conditions age "=15", "=16", "closed interval [17, 25]" and ">=25", and the decision conditions "=male", "=male", "=male" and "=male", when the decision table is saved as a JSON format string, will be written into the corresponding nodes of the JSON format string respectively, that is, a total of 8 JSON nodes.

[0056] Specifically, taking "=15" in the 0th column and the 0th row as an example, it can be saved as the following JSON format string, which is a JSON node.

[0057]

[0058] Similarly, other configured data in the grid, including the decision levels "1", "2", "3" and "4" in the third column, and the decision result names "decision result 1", "decision result 2", "decision result 3" and "decision result 4" in the fourth column, will also be written into the corresponding nodes of the JSON format string when the decision table is saved as a JSON format string, corresponding to a total of 8 nodes.

[0059] What needs to be explained is:

[0060] JSON is a lightweight data exchange format based on a subset of ECMAScript (the JS specification developed by the European Computer Manufacturers Association). It uses a text format that is completely independent of the programming language to store and represent data. JSON is a string representation of a JS object. It uses text to represent the information of a JS object, which is essentially a string.

[0061] In terms of data structure, JSON format strings are composed of two basic data structures: objects and arrays. In JSON format strings, objects start with "{" and end with "}", while arrays start with "[" and end with "]".

[0062] A JSON format string containing an object, for example, may be: '{"name":"Jack","age":18}', or, for similar examples, refer to the JSON format string corresponding to "=15" in column 0 above.

[0063] A JSON format string containing an array, for example: '[{"name":"Jack","age":18},{"name":"Jack","age":18}]'.

[0064] It can be seen that in the JSON format string, the JSON node is used to describe the data structure, including but not limited to describing the key, value and the relationship between them. In other words, a single JSON node refers to a piece of data with an "object" or "array" data structure.

[0065] Specifically, for JSON nodes used to describe the data structure "object", each JSON node contains a key and a value.

[0066] More commonly, an object can be described by multiple JSON nodes, which are arranged in a certain hierarchy to form a complete data structure. For example:

[0067]

[0068] In the above example, "name":"John", "age":30", "address":{"city":"New York","state":"NY"}, and "phoneNumbers":["123-456-7890","987-654-3210"] are four pieces of data with "object" data structure in the JSON format string, which can be used as four JSON nodes. Each JSON node has a key and a value, such as "name":"John", where "name" is the key and "John" is the value. At the same time, "address" and "phoneNumbers" are nested objects, which can also be described by multiple JSON nodes.

[0069] For JSON nodes used to describe the data structure "array", each JSON node contains an array. For example:

[0070] ```json

[0071] {

[0072] "fruits":["apple","banana","cherry"]

[0073] }

[0074] ```

[0075] In the above example, "fruits" is an array containing three elements, which can be described by a JSON node. In other words, the array can be used as a JSON node.

[0076] Based on the above-mentioned characteristics of the decision table in terms of preservation, and the characteristic that a single JSON node can be separately compiled into a code executable by the rule engine, the embodiment of the present application considers parsing the decision conditions in each grid and executing them separately - that is, parsing each JSON node in the JSON format string and executing them separately, and presenting the matching results of the decision conditions in each grid - for example, the matching results can be returned to the front end of the business system, and the front end can intuitively display the matching results of the business data to be decided based on each decision condition in, for example, the decision table.

[0077] In this way, each decision condition can generate and present corresponding matching results. In this way, business personnel can not only obtain the decision results based on the entire decision table dimension, but also obtain fine-grained matching results based on the decision condition dimension. Furthermore, when the expected decision result does not match the actual decision result, business personnel can easily and quickly locate the root cause of the problem based on the matching results obtained based on the decision condition dimension.

[0078] Based on the above background, for the convenience of description, the method provided in the embodiment of the present application is described in detail below by taking a business system as the execution subject of the method as an example.

[0079] The specific implementation process of the information acquisition method provided in the embodiment of the present application is as follows: Figure 2 As shown, the following steps are included:

[0080] Step 21: The business system obtains a target file and determines at least one first node included in the target file;

[0081] The target file is a file obtained by storing the decision table configured with the decision conditions and expected decision results according to the specified data structure. Therefore, the target file is a file with the specified data structure.

[0082] In an optional implementation, the business system may obtain the target file in the following manner:

[0083] The business system receives the target file input into the business system by the business personnel; or,

[0084] After receiving the decision table content input by the business personnel based on the decision table template, the decision table is obtained by combining the decision table template and the decision table content, and then converted into a target file with a specified data structure for storage; or,

[0085] The business system receives the decision table input by the business personnel; according to the specified data structure, the decision table is converted into a target file with the specified data structure for storage.

[0086] The embodiments of the present application do not limit the means by which the business system obtains the target file.

[0087] In an optional implementation, the specified data structure refers to any data structure that can support "splitting / parsing the data in the file into first nodes according to the data structure". A single first node has a specified data structure and contains data corresponding to a single decision condition in the decision table.

[0088] Exemplarily, the specified data structure may include, but is not limited to, at least one of an object and an array. In addition, the specified data structure may also include, but is not limited to, a linked list, a tree, and a graph.

[0089] When the target file is a file stored according to an object and / or array data structure, the format of the target file may include but is not limited to at least one of the following formats:

[0090] Standard general markup language format, such as JSON format or Extensible Markup Language (XML) format;

[0091] Common data serialization formats, such as YAML (YAML Ain't Markup Language) format;

[0092] Template engine FTL (FreeMarker Template Language) format.

[0093] The embodiment of the present application does not limit the format of the target file.

[0094] Use as Figure 1 The example of the decision table shown in the figure is a decision condition. When the decision table is saved as a JSON string in a file in JSON format, the file is the target file.

[0095] In this case, each JSON node in the target file has a specified data structure and contains data corresponding to each decision condition in the decision table.

[0096] In the embodiment of the present application, the business system can determine at least one first node included in the target file by parsing the target file.

[0097] In an optional implementation, the specific implementation process of determining at least one first node included in the target file by parsing the target file may include:

[0098] The business system parses the target file according to the characteristics of the specified data structure, thereby parsing at least one node from the target file.

[0099] For example, taking the target file as a file containing a JSON format string obtained by conversion based on a decision table, and the corresponding specified data structure as an object and an array, the characteristics of the object and the array can be: the object starts with "{" and ends with "}", and the array starts with "[" and ends with "]".

[0100] Based on this feature, when the business system parses the target file, it can parse the data (specifically a string) that starts with "{" and ends with "}" as a node; in addition, it can also parse the data that starts with "[" and ends with "]" as a node.

[0101] Step 22: The business system determines a code segment corresponding to each first node in the at least one first node and allowed to be executed by the rule engine;

[0102] As mentioned above, each first node has a specified data structure and contains data corresponding to a single decision condition in the decision table.

[0103] Still Figure 1 Taking "=15" in column 0 of the decision table as an example, the corresponding JSON format string, that is, the JSON node, contains data corresponding to the decision condition "=15". Specifically, the data can be seen in the "value":"==" and "value":"15" in the JSON format string above, which represent the single decision condition "=15".

[0104] A single decision condition can be used to match the business data input into the rule engine to obtain the corresponding matching results.

[0105] In an optional implementation, when at least one node determined from the target file is a code that can be directly executed by the rule engine, a specific implementation of step 22 may include:

[0106] The at least one node is determined as each code segment corresponding to the at least one first node and allowed to be executed by the rule engine.

[0107] In an optional implementation, when at least one node determined from the target file cannot be directly executed by the rule engine, a specific implementation of step 22 may include:

[0108] Perform data conversion on each first node of the at least one first node to obtain a code segment corresponding to each first node that is allowed to be executed by the rule engine.

[0109] In an optional implementation, for each first node, data conversion is performed on each first node of the at least one first node to obtain a code segment corresponding to each first node that is allowed to be executed by the rule engine. The specific implementation process may include the following steps:

[0110] From the first node, obtain data corresponding to the decision condition in the decision table;

[0111] By adding the first code and the second code to the acquired data, a code segment corresponding to the first node and allowed to be executed by the rule engine is obtained.

[0112] The first code is a code that allows logical branch judgment to be executed by the rule engine.

[0113] The second code is a code for instructing the rule engine to return the corresponding matching result to the specified target after executing the logic branch judgment code.

[0114] Still Figure 1 Taking the decision condition "=15" in the decision table shown as an example, after obtaining the data "value":"==" and "value":"15" corresponding to the decision condition from the first node, you can further obtain the decision condition type of the decision condition "=15" as "age" from the decision condition type node containing the decision condition type.

[0115] The decision condition type node is data in the target file corresponding to the decision condition type in the decision table.

[0116] by Figure 1 For example, for the decision condition type "age" in the decision table shown, the decision condition type nodes containing "age" are as follows:

[0117]

[0118]

[0119] In an optional implementation, the business system may determine, based on "columnType":"inPut" in the above character string, that the character string contains a decision condition type, and further determine that the character string is a decision condition type node.

[0120] In an optional implementation, the business system can determine that the decision condition "=15" and the decision condition type "age" belong to the same column based on the information "colIndex":0" in the first node containing the decision condition "=15" and the column to which the decision belongs in the decision table, and "colIndex":0 contained in the decision condition type node, that is, determine that the decision condition type of the decision condition "=15" is "age".

[0121] After obtaining the decision condition "=15" and its corresponding decision condition type "age", an expression can be constructed based on the decision condition and the decision condition type: age==15.

[0122] However, the expression is not a complete code segment that can be executed by a rule engine (such as QLExpress) and cannot be directly executed in the rule engine.

[0123] Therefore, in an optional implementation, this expression may be supplemented and improved so that the expression age==15 is converted into the following expression:

[0124]

[0125] The supplement and improvement mentioned above include:

[0126] 1. Based on the original expression age==15, add the if logic branch judgment code if...else to the expression - that is, add the first code to the expression;

[0127] 2. Based on the original expression age == 15, add the codes return true and return false to the expression to instruct the rule engine to return the corresponding matching results to the specified target after executing the logical branch judgment (the above expression indicates returning to the default specified target, which is generally the party providing business data, such as a business system) - that is, add a second code to the expression.

[0128] Of course, the second code can also be used to instruct the rule engine to return the matching results to other specified targets besides the business system. The technicians can configure such a second code for the business system by configuring the business system, so that when the business system converts the first node, it can use such a second code to convert the first node.

[0129] Through the above operations, the converted expression obtained can be used as the code segment allowed to be executed by the rule engine as described in the embodiments of the present application.

[0130] In the embodiment of the present application, for each node in at least one node, if step 22 is executed separately, code segments corresponding to each node can be obtained, and they can all be executed by the rule engine, that is, allowed to be executed by the rule engine.

[0131] Step 23: The business system uses a rule engine to execute each code segment based on the business data to obtain a matching result for each code segment corresponding to the business data;

[0132] The business data mentioned refers to the business data for which a decision is to be made, that is, the business data for which a decision result is to be obtained.

[0133] For the attached Figure 1For the decision table shown, a specific example of business data may be, for example, "age=15, gender=male", or "age=42, gender=female". Of course, business data may also be "address=** community, Haidian District, Beijing, Number=13800013800", and so on.

[0134] In an optional implementation scheme, the business system can implement step 23 by calling a rule engine.

[0135] In an optional implementation, in addition to inputting business data into the rule engine, the business system can also input each code segment into the same rule engine in sequence, so that the rule engine executes each code segment one by one based on the business data, thereby obtaining a matching result for the business data corresponding to each code segment.

[0136] Alternatively, in another optional implementation, the specific implementation of step 23 may include:

[0137] Based on the business data, different rule engines are used to execute each code segment respectively to obtain the matching results for the business data corresponding to each code segment.

[0138] Compared with the method of using the same rule engine to execute each code segment one by one based on business data, using different rule engines to execute code segments separately can support the synchronous execution of code segments, thus having certain advantages in execution efficiency.

[0139] Step 24: The business system associates and presents the matching result corresponding to the first node with the “decision condition corresponding to the first node in the decision table”.

[0140] In an optional implementation, a specific implementation of step 24 may include:

[0141] In the decision table, the matching result corresponding to the first node is associated with the “decision condition corresponding to the first node in the decision table” and presented.

[0142] The manner of association presentation may include, but is not limited to: association display. For example, the matching result is displayed in the grid, row or column of the decision table where the decision condition is located.

[0143] In a specific example, the matching result corresponding to the first node and the “decision condition corresponding to the first node in the decision table” are presented in association with each other as follows: Figure 3 shown.

[0144] Figure 3 The method provided by the embodiment of the present application is adopted, assuming that the decision table is as follows Figure 1As shown in the figure, assuming that the business data is "age = 15, gender = male", the matching results of each decision condition are obtained, and Figure 1 The decision table shown in FIG. 1 is a schematic diagram for associating and presenting the matching results and decision conditions. Figure 3 In the symbol Indicates a match result of "no match".

[0145] In another optional implementation, the specific implementation of step 24 may include:

[0146] In other tables different from the decision table, the matching result corresponding to the first node is associated with the “decision condition corresponding to the first node in the decision table” and presented.

[0147] The manner of presenting the association may include, but is not limited to: displaying the matching result corresponding to the first node and the corresponding decision condition in the decision table in the same grid, the same row or the same column of the other table.

[0148] A specific example is Figure 4 shown. Figure 4 The method provided by the embodiment of the present application is adopted, assuming that the decision table is as follows Figure 1 As shown, assuming that the business data is "age=15, gender=male", the matching results for the decision conditions "age=15" and "age=16" are obtained, and a new table is used to associate the matching results with the decision conditions "age=15" and "age=16". Figure 3 In the figure, the symbol “√” indicates a matching result of “match”; and “×” indicates a matching result of “no match”.

[0149] In order to realize the association presentation of the matching result corresponding to the first node and the “decision condition corresponding to the first node in the decision table”, in an optional implementation manner, step 24 may specifically include:

[0150] Acquire position data; the position data represents the position of the decision condition corresponding to the first node in the decision table;

[0151] According to the acquired position data, a matching result corresponding to the first node is presented at the position represented by the position data in the decision table.

[0152] In one example, the position data may be, for example, the row number and column number of the decision condition in the decision table, such as: the 0th column and the 0th row.

[0153] Assuming that a decision condition is located in the grid of the 0th column and the 0th row of the decision table, then the matching result corresponding to the decision condition can be presented in the grid.

[0154] In an optional implementation, the location data may be obtained from the first node.

[0155] Taking the JSON format string (first node) regarding the decision condition "=15" in the 0th column and the 0th row as an example, the first node contains the position data "colIndex":0 and "rowIndex":0 representing the position of the decision condition in the decision table, so that the business system can obtain the position data from the first node.

[0156] In the embodiment of the present application, by presenting the matching result in association with the "decision condition corresponding to the first node in the decision table", it is convenient for technical personnel to know what kind of matching result is obtained based on the business data and the decision condition.

[0157] In an optional implementation, the “presentation” may also refer to voice broadcast, etc.

[0158] By adopting the above method provided in the embodiment of the present application, since the first node can be obtained from the target file with a specified data structure obtained by storing a decision table that has been configured with decision conditions and expected decision results, and based on the characteristic that "the first node contains data corresponding to the 'single decision condition' in the decision table", the first node is converted into a code segment and executed by the rule engine, so that the matching result of the "single decision condition" dimension can be obtained.

[0159] Compared with the decision results based on the dimension of the entire decision table, the matching results based on the dimension of "single decision condition" are more likely to locate the problem of the decision table configuration. Therefore, the solution provided in the embodiment of the present application can solve the problem existing in the prior art that the rule engine only returns the decision results based on the dimension of the entire decision table, which makes it difficult to trace the root cause of the problem based on the decision result.

[0160] From the perspective of practical application, by adopting the solution provided in the embodiment of the present application, when business configuration personnel configure the decision table, they can timely check whether the matching results obtained based on the decision conditions in the decision table are consistent with expectations when the business data to be determined passes through the decision table, thereby judging whether the decision table configuration is correct, thereby avoiding online problems caused by decision errors that may be caused by going online directly after the decision table configuration.

[0161] In addition, by adopting the solution provided in the embodiment of the present application, when the decision conditions and matching results are associated and presented in the interface, for R&D personnel, when troubleshooting problems, they can directly see on the interface which decision condition has a configuration error that causes the actual decision result to not match the expected decision result, thereby greatly improving the efficiency of R&D personnel in troubleshooting problems.

[0162] The following introduces a specific implementation method of applying the information acquisition method provided in the embodiment of the present application to an actual scenario.

[0163] In this actual scenario, the configuration has been completed. Figure 1 The decision table shown is sent from the front end of the business system to the back end of the business system in the form of a JSON format string, and is saved in the database by the back end.

[0164] When the front end needs to display the decision table, the back end converts the decision table in the form of a JSON format string into an interface display element and sends it to the front end for display.

[0165] In an optional implementation, the Figure 1 After converting the entire decision table shown in the figure into the resulting JSON format string, Figure 1 The JSON format string generated by the decision table, in the process of the business system making decisions based on business data, if according to relevant technologies, taking the rule engine QLExpress as an example, after the backend receives the business data, it can convert the above JSON format string into a QLExpress executable script, and then call QLExpress to execute the script, thereby obtaining a decision result based on the decision table dimension.

[0166] Specifically, the following is a schematic diagram of part of the content of the QLExpress executable script obtained based on the above method according to the relevant technology:

[0167]

[0168] From the above content, it can be seen that according to the relevant technology, a script executable by QLExpress will be generated based on a decision table.

[0169] The business system inputs business data and the script to the rule engine, and the rule engine obtains a decision result and puts the decision result into a map and returns it to the business system. In this way, the execution process of the decision table is a black box for the business system, so there will be problems introduced in the background technology.

[0170] To solve the above problems, the implementation goal of the specific implementation method to be introduced in the embodiment of the present application is to enable the back end of the business system to obtain Figure 1 The matching results of the decision conditions in each grid in the decision table are shown and returned to the front end of the business system by the rule engine, so that the front end can intuitively display in the decision table what kind of matching results are obtained based on the business data and each decision condition.

[0171] The implementation flow diagram of this specific implementation method is as follows Figure 5 As shown, the following steps are included:

[0172] Step 51: The backend of the business system obtains the information sent by the front end of the business system. Figure 1 The JSON format string corresponding to the decision table shown;

[0173] The JSON format string can be found above and will not be described here.

[0174] Step 52: The backend of the business system parses the JSON format string corresponding to the decision table to obtain each JSON node contained in the JSON format string, and then constructs a judgment expression corresponding to each JSON node containing the decision condition, which is executable by the rule engine and is allowed based on the JSON node; in addition, the backend parses the position data representing the position of the decision condition in the decision table from each JSON node containing the decision condition;

[0175] In step 52, still with Figure 1 Taking the decision condition "=15" in the decision table as an example, the backend can parse out the JSON node from the entire JSON format string corresponding to the decision table; further, the JSON node can be parsed separately to parse out the expression: age==15.

[0176] However, this is not a complete expression that can be executed by QLExpress, so the backend can make some supplements to this expression.

[0177] As mentioned above, if Figure 1 The 2*4 decision table shown in the figure can be viewed as 4 decision rules, each of which has 2 decision conditions (grids). Figure 1 The JSON format string corresponding to the decision table shown can be parsed by the backend to obtain 2*4=8 separate judgment expressions.

[0178] It should be noted that in order to accurately display the matching results based on the decision condition dimension to the front end, the back end can parse the mth row and nth column of the decision condition in the decision table, that is, rowIndex and colIndex, from the JSON node while parsing the expression.

[0179] For example, the JSON node corresponding to the decision condition "=15" includes rowIndex=0, colIndex=0, so rowIndex=0, colIndex=0 can be parsed as position data representing the position of the decision condition "=15" in the decision table.

[0180] Based on the parsed location data, the backend can construct the final judgment expression. For example, the 8 final judgment expressions are as follows:

[0181] [{"colIndex":0,"rowIndex":0,"express":"age==15"}…]

[0182] Step 53: After receiving the business data to be input into the business system, the backend of the business system calls the rule engine to traverse and execute each judgment expression (the final judgment expression) to obtain the matching results returned by the rule engine based on the business data and each judgment expression;

[0183] Taking the business data for which the decision result is to be obtained as "age=15, gender=male" as an example, the backend can execute each of the above 8 judgment expressions in turn based on the business data to obtain the matching result of each judgment expression.

[0184] Specifically, the matching results corresponding to the eight judgment expressions can be fed back to the backend by the rule engine in the following form:

[0185] [{"colIndex":0,"rowIndex":0,"result":true}……]

[0186] Step 54: The backend of the business system determines the position data representing “the position where each matching result corresponding to each judgment expression should be presented in the decision table” according to the position data contained in each JSON node containing the decision condition;

[0187] In step 54, the backend may determine the position data contained in each JSON node containing the decision condition as the position data representing the position where the corresponding matching result should be presented in the decision table.

[0188] Step 55: The backend of the business system returns each matching result and the location data determined by executing step 54 to the frontend of the business system;

[0189] Step 56: The front end of the business system displays each matching result in the position (grid) represented by the corresponding position data in the decision table according to the received position data.

[0190] For specific display results, please refer to the manual. Figure 3 .

[0191] for Figure 3 For the relevant explanations, please refer to the previous description, which will not be repeated here.

[0192] It should be noted that the method provided in the embodiment of the present application can be applied to at least two practical scenarios: a decision table configuration correctness verification scenario and a historical data decision detail viewing scenario.

[0193] For the correctness verification scenario of decision table configuration, the business configuration personnel completes the decision table configuration (assuming that the configured decision table is as follows Figure 1 After that, it can be displayed on the front end of the business system as shown Figure 6 In the interface shown, manually enter the business data for which the decision result is to be obtained.

[0194] like Figure 6 In the example, the 20 and female values ​​entered in the input boxes corresponding to the decision fields "age" and "gender" are the business data manually entered by the business configuration personnel to obtain the decision results. In the scenario of correctness verification of decision table configuration, this business data can be used to verify whether the decision conditions configured in the decision table are correct. In this scenario, the business configuration personnel click Figure 6 The "Start Verification" button displayed on the page can trigger the following process:

[0195] The front end transmits the business data to be obtained and the configured decision table to the back end of the business system;

[0196] After the backend saves the decision table as a JSON format string, according to the scheme provided in the embodiment of the present application, the matching result of each decision condition in the decision table is obtained and fed back to the front end, and the front end displays it on the interface. The display effect can be as follows: Figure 6 shown.

[0197] For the scenario of viewing historical data decision details, this scenario often has two characteristics:

[0198] First, the decision table has version management;

[0199] Secondly, under the condition that the decision table has version management, various business data used to verify the decision tables of various versions and the ID and version number of the verified decision tables, as well as the matching results corresponding to the decision conditions contained in each decision table, such as JSON format strings converted based on each decision table, can all be saved in the database accordingly.

[0200] It should be noted that the reason why decision tables need version management is that when you need to obtain the matching results corresponding to the decision conditions, the configuration data in the decision table may have changed once or even multiple times compared to the initial version of the decision table. Since different versions of decision tables may have configuration errors, in order to facilitate viewing the relevant data of different versions of decision tables for problem tracing, version management can be performed on the decision table.

[0201] The version management may generally include, but is not limited to: assigning version numbers to the decision table of the initial version and to each decision table iteratively updated based on the initial version.

[0202] Based on version management, in actual scenarios, you may need to view the historical data decision details of different versions of decision tables, including but not limited to viewing: business data, and / or, matching results corresponding to the decision conditions contained in each decision table.

[0203] In such a demand context, various business data used to verify various versions of decision tables, the IDs and version numbers of the verified decision tables, as well as the matching results corresponding to the decision conditions contained in each decision table, such as JSON format strings converted from each decision table, can all be saved in the database accordingly.

[0204] Based on this, the business system can query the database according to the ID and version number of one or some decision tables, so as to obtain the expected business data and / or the matching results corresponding to the decision conditions contained in each decision table. The obtained business data and matching results can be displayed on the front end of the business system.

[0205] From the perspective of practical application, by adopting the solution provided in the embodiment of the present application, when business configuration personnel configure the decision table, they can timely check whether the matching results obtained based on the decision conditions in the decision table are consistent with expectations when the business data to be determined passes through the decision table, thereby judging whether the decision table configuration is correct, thereby avoiding online problems caused by decision errors that may be caused by going online directly after the decision table configuration.

[0206] In addition, by adopting the solution provided in the embodiment of the present application, when the decision conditions and matching results are associated and presented in the interface, for R&D personnel, when troubleshooting problems, they can directly see on the interface which decision condition has a configuration error that causes the actual decision result to not match the expected decision result, thereby greatly improving the efficiency of R&D personnel in troubleshooting problems.

[0207] In order to solve the problem in the prior art that the rule engine only returns the decision results based on the entire decision table dimension, making it difficult to trace the root cause of the problem based on the decision results, based on the same inventive concept as the above-mentioned embodiments of the present application, an embodiment of the present application also provides an information acquisition device.

[0208] The specific structural diagram of the device is shown in Figure 7 As shown, it includes the following functional units:

[0209] A node determination unit 71 is used to obtain a target file and determine at least one first node included in the target file;

[0210] The target file is obtained by storing a decision table configured with decision conditions and expected decision results according to a specified data structure.

[0211] The single first node has the specified data structure and contains data corresponding to a single decision condition in the decision table.

[0212] A code determination unit 72, configured to determine a code segment corresponding to each of the first nodes that is allowed to be executed by the rule engine;

[0213] An execution unit 73 is used to execute each of the code segments using a rule engine based on the business data to obtain a matching result for the business data corresponding to each of the code segments;

[0214] The presenting unit 74 is used to associate and present the matching result corresponding to the first node with “the decision condition corresponding to the first node in the decision table”.

[0215] In an optional implementation, the code determination unit 72 may be specifically configured to: perform data conversion on each of the first nodes to obtain a code segment corresponding to each of the first nodes that is allowed to be executed by the rule engine.

[0216] In an optional implementation, the code determination unit 72 may be specifically configured to:

[0217] For each of the first nodes, obtaining data corresponding to the decision condition in the decision table from the first node;

[0218] By adding the first code and the second code to the acquired data, a code segment corresponding to the first node and allowed to be executed by the rule engine is obtained.

[0219] The first code is a code that allows logical branch judgment to be executed by the rule engine;

[0220] The second code is a code that instructs the rule engine to return the corresponding matching result to the specified target after executing the logic branch judgment.

[0221] In an optional implementation, the presenting unit 74 may be specifically configured to:

[0222] Acquire position data, where the position data represents a position of the decision condition corresponding to the first node in the decision table;

[0223] According to the position data, the matching result corresponding to the first node is presented at the position in the decision table.

[0224] In an optional implementation, the location data is acquired from the first node.

[0225] In an optional implementation, the execution unit 73 may be specifically configured to: based on the business data, use different rule engines to respectively execute each of the code segments to obtain a matching result for the business data corresponding to each of the code segments.

[0226] By using the above-mentioned device provided in the embodiment of the present application, since the first node can be obtained from the target file with a specified data structure obtained by storing a decision table that has been configured with decision conditions and expected decision results, and based on the characteristic that "the first node contains data corresponding to the 'single decision condition' in the decision table", the first node is converted into a code segment and executed by the rule engine, so that the matching result of the "single decision condition" dimension can be obtained.

[0227] Compared with the decision results based on the dimension of the entire decision table, the matching results based on the dimension of "single decision condition" are more likely to locate the problem of the decision table configuration. Therefore, the solution provided in the embodiment of the present application can solve the problem existing in the prior art that the rule engine only returns the decision results based on the dimension of the entire decision table, which makes it difficult to trace the root cause of the problem based on the decision result.

[0228] Based on the same inventive concept as the aforementioned embodiments of the present application, the embodiments of the present application also provide a computing device to solve the problem in the prior art that the rule engine only returns the decision result based on the entire decision table dimension, making it difficult to trace the root cause of the problem based on the decision result.

[0229] like Figure 8As shown, the computing device includes: a memory 81 and a processor 82. The memory 81 can be configured to store various other data to support operations on the electronic device. Examples of these data include instructions for any application or method for operating on the electronic device. The memory 81 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as a static random access memory (SRAM), an electrically erasable programmable read-only memory (EEPROM), an erasable programmable read-only memory (EPROM), a programmable read-only memory (PROM), a read-only memory (ROM), a magnetic memory, a flash memory, a magnetic disk or an optical disk.

[0230] The processor 82 is coupled to the memory 81 and is used to execute the computer program stored in the memory 81 to execute the methods provided in the above embodiments.

[0231] When the processor 82 executes the computer program in the memory 81, in addition to the above functions, it can also realize other functions, and the details can be found in the description of the previous embodiments.

[0232] Further, such as Figure 8 As shown, the computing device also includes: a display 84, a communication component 83, a power component 85, an audio component 86 and other components. Figure 8 Only some components are shown schematically, and it does not mean that the computing device only includes Figure 8 Components shown.

[0233] Accordingly, an embodiment of the present application further provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a computer, the methods provided in the above embodiments can be implemented.

[0234] Accordingly, an embodiment of the present application further provides a computer program product, which stores instructions, and when the instructions are executed by a computer, the computer implements the methods provided in the above embodiments.

[0235] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative work.

[0236] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0237] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for obtaining information, characterized in that: include: Acquire a target file, and determine at least one first node contained in the target file; The target file is obtained by storing a decision table configured with decision conditions and expected decision results according to a specified data structure; a single first node has the specified data structure and contains data corresponding to a single decision condition in the decision table; Determine a code segment corresponding to each of the first nodes that is allowed to be executed by the rule engine; Based on the business data, each of the code segments is executed using a rule engine to obtain a matching result for the business data corresponding to each of the code segments; The matching result corresponding to the first node and the decision condition corresponding to the first node in the decision table are associated and presented.

2. The method according to claim 1, characterized in that The determining of the code segment corresponding to each of the first nodes and allowed to be executed by the rule engine includes: Data conversion is performed on each of the first nodes to obtain a code segment corresponding to each of the first nodes that is allowed to be executed by the rule engine.

3. The method according to claim 2, characterized in that For each of the first nodes, performing data conversion on the first node to obtain a code segment corresponding to the first node that is allowed to be executed by the rule engine includes: Acquire, from the first node, data corresponding to the decision condition in the decision table; By adding the first code and the second code to the acquired data, a code segment corresponding to the first node and allowed to be executed by the rule engine is obtained; The first code is a code that allows logical branch judgment to be executed by the rule engine; The second code is a code for instructing the rule engine to return the corresponding matching result to the specified target after executing the code for the logic branch judgment.

4. The method according to claim 1, characterized in that The associating and presenting the matching result corresponding to the first node with the decision condition corresponding to the decision table of the first node includes: Acquire position data, where the position data represents a position of the decision condition corresponding to the first node in the decision table; According to the position data, the matching result corresponding to the first node is presented at the position in the decision table.

5. The method according to claim 4, characterized in that The location data is obtained from the first node.

6. The method according to claim 1, characterized in that The method of executing each of the code segments based on the business data using a rule engine to obtain a matching result for the business data corresponding to each of the code segments includes: Based on the business data, different rule engines are used to execute each of the code segments respectively to obtain a matching result for the business data corresponding to each of the code segments.

7. An information acquisition device, characterized in that: include: A node determination unit, configured to obtain a target file and determine at least one first node contained in the target file; The target file is obtained by storing a decision table configured with decision conditions and expected decision results according to a specified data structure; a single first node has the specified data structure and contains data corresponding to a single decision condition in the decision table; A code determination unit, used to determine a code segment corresponding to each of the first nodes that is allowed to be executed by the rule engine; An execution unit, configured to execute each of the code segments using a rule engine based on the business data to obtain a matching result for the business data corresponding to each of the code segments; A presentation unit is used to associate and present the matching result corresponding to the first node with the decision condition corresponding to the first node in the decision table.

8. A computing device, characterized in that include: Memory and processor, wherein: The memory is used to store computer programs; The processor is coupled to the memory and is used to execute the computer program stored in the memory to execute the method according to any one of claims 1 to 6.

9. A computer-readable storage medium storing a computer program, wherein the computer program can implement the method according to any one of claims 1 to 6 when executed by a computer.

10. A computer program product, characterized in that The computer program product stores instructions, and when the instructions are executed by a computer, the computer implements the method according to any one of claims 1 to 6.