A method, system and related equipment for determining data with multi-level structure
By using multi-layer data definition tables and judgment function rule tables, the problem that the single-layer data judgment method in the existing technology cannot meet the needs of multi-layer structured data is solved, and efficient processing of complex hierarchical relationship data and improvement of system expansion capabilities are achieved.
Patent Information
- Application Number
- CN202310722365.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-16
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2043-06-16
AI Technical Summary
The existing single-level data judgment method cannot meet the business needs of increasingly complex multi-level structured data, resulting in poor system scalability, bloated data structure, and reduced readability and maintainability.
Adopting multi-layer data definition table and judgment function rule table, by expanding atomic data values, filtering judgment items in sequence to determine the final judgment result, pre-setting multi-layer data items and judgment rule table to process data with complex hierarchical relationships.
It achieves efficient processing of multi-level structured data, meets the growing business needs, and improves the system's scalability and maintainability.
Smart Images

Figure CN116894050B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a method, system and related equipment for determining multi-level structured data. Background Art
[0002] Right or wrong judgment is a common form of judgment. Because right or wrong judgment is black or white, it usually plays an important control node role in the entire business process.
[0003] Currently, the more common yes / no determination methods can only process data items at a single level. In other words, the data items processed by these methods are independent of each other. However, as business continues to evolve, data items have gradually developed complex hierarchical relationships, and existing yes / no determination methods can no longer meet the growing business needs. Summary of the Invention
[0004] In view of this, embodiments of the present invention provide a method, system and related devices for determining data with a multi-level structure, so as to solve the problem that the existing yes / no determination method cannot meet the growing business needs.
[0005] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:
[0006] A first aspect of an embodiment of the present invention discloses a method for determining data in a multi-level structure, the method comprising:
[0007] When detecting that a user calls a target determination rule, obtaining a plurality of atomic data values input by the user for determination;
[0008] Expanding the atomic data value to obtain a corresponding input data set according to a multi-level data definition table corresponding to the atomic data value, each atomic data value corresponding to one input data set, the multi-level data definition table being pre-configured according to multi-level data items;
[0009] Filtering the determination entries in the determination function rule table corresponding to the target determination rule in sequence according to the input data set corresponding to each of the atomic data values to obtain the target determination entry, wherein the determination function rule table is pre-set according to multiple levels of data items;
[0010] A final determination result is determined according to the target determination item.
[0011] Preferably, the multi-layer data definition table includes data items of multiple levels;
[0012] According to the multi-layer data definition table corresponding to the atomic data value, the atomic data value is expanded to obtain a corresponding input data set, including:
[0013] For each atomic data value, construct an initial set corresponding to the atomic data value, the initial set comprising: the atomic data value and the data item associated with the highest level in the multi-layer data definition table corresponding to the atomic data value;
[0014] determining a level in the multi-layer data definition table associated with the atomic data value;
[0015] Starting from the level associated with the atomic data value, recursive traversal is performed in the multi-layer data definition table in turn toward the higher level, and the data items associated with the levels involved in the recursive traversal process are added to the initial set to obtain the input data set corresponding to the atomic data value, wherein the recursive traversal is terminated when the highest level or the level associated with the empty set is encountered during the recursive traversal process.
[0016] Preferably, each row in the determination function rule table corresponding to the target determination rule corresponds to a determination entry, and each column in the function rule table corresponds to a determination field;
[0017] Filtering the determination entries in the determination function rule table corresponding to the target determination rule according to the input data set corresponding to each of the atomic data values in sequence to obtain the target determination entry, including:
[0018] According to the input data set corresponding to the first atomic data value, the judgment entries in the judgment function rule table corresponding to the target judgment rule are filtered to obtain a first group of filtering results, wherein the first group of filtering results includes: the rows of the judgment data item values under the first column of the judgment function rule table in the input data set corresponding to the first atomic data value; the data type of each judgment data item value under the first column is the data type set for the judgment field corresponding to the first column;
[0019] According to the input data set corresponding to the Nth atomic data value, the judgment items in the N-1th group of filtering results are filtered to obtain the Nth group of filtering results, wherein the initial value of N is 2, and the Nth group of filtering results includes: rows in the input data set corresponding to the Nth atomic data value under the Nth column of the N-1th group of filtering results, wherein the data type of each judgment data item value under the Nth column is the data type set for the judgment field corresponding to the Nth column;
[0020] If N is less than the total number of the atomic data values, N is incremented by 1, and the process returns to the step of filtering the decision items in the N-1th group of filtering results according to the input data set corresponding to the Nth atomic data value to obtain the Nth group of filtering results;
[0021] If N is equal to the total number of the atomic data values, the determination item corresponding to the Nth group of filtering results is determined as the target determination item.
[0022] Preferably, the target determination items at least include default determination items;
[0023] Determining a final determination result according to the target determination item includes:
[0024] If the number of the target determination items is 1, determining the preset determination result corresponding to the default determination item as the final determination result;
[0025] If the number of the target determination items is 2, determining the preset determination results corresponding to the target determination items other than the default determination item as the final determination results;
[0026] If the number of the target determination items is greater than 2, an error message is output.
[0027] A second aspect of an embodiment of the present invention discloses a determination system for multi-level structured data, the system comprising:
[0028] an acquiring unit, configured to acquire a plurality of atomic data values input by the user for making a determination when detecting that the user has called a target determination rule;
[0029] an expansion unit, configured to expand the atomic data value to obtain a corresponding input data set according to a multi-layer data definition table corresponding to the atomic data value, each atomic data value corresponding to one input data set, the multi-layer data definition table being pre-set according to multi-level data items;
[0030] a filtering unit, configured to filter, in sequence according to the input data sets corresponding to the respective atomic data values, the determination entries in the determination function rule table corresponding to the target determination rule to obtain the target determination entry, wherein the determination function rule table is pre-set according to the multi-level data items;
[0031] A determination unit is configured to determine a final determination result according to the target determination item.
[0032] Preferably, the multi-layer data definition table includes data items of multiple levels; the expansion unit includes:
[0033] A construction module is used to construct, for each atomic data value, an initial set corresponding to the atomic data value, the initial set comprising: the atomic data value and data items associated with the highest level in the multi-layer data definition table corresponding to the atomic data value;
[0034] A determination module, configured to determine a level in the multi-layer data definition table associated with the atomic data value;
[0035] A traversal module is used to start from the level associated with the atomic data value, recursively traverse to the higher level in the multi-layer data definition table, and add the data items associated with the levels involved in the recursive traversal process to the initial set to obtain the input data set corresponding to the atomic data value, wherein the recursive traversal is terminated when the highest level or the level associated with the empty set is encountered during the recursive traversal process.
[0036] Preferably, each row in the determination function rule table corresponding to the target determination rule corresponds to a determination entry, and each column in the function rule table corresponds to a determination field; the filtering unit includes:
[0037] A first filtering module is configured to filter, based on the input data set corresponding to the first atomic data value, the determination entries in the determination function rule table corresponding to the target determination rule to obtain a first set of filtering results, wherein the first set of filtering results includes: rows in the input data set corresponding to the first atomic data value for the determination data item values under the first column of the determination function rule table; and the data type of each determination data item value under the first column is the data type set for the determination field corresponding to the first column;
[0038] a second filtering module, configured to filter the judgment items in the N-1th group of filtering results according to the input data set corresponding to the Nth atomic data value to obtain an Nth group of filtering results, wherein an initial value of N is 2, and the Nth group of filtering results comprises: rows in the N-1th group of filtering results in which the judgment data item values under the Nth column are in the input data set corresponding to the Nth atomic data value; and the data type of each judgment data item value under the Nth column is the data type set by the judgment field corresponding to the Nth column;
[0039] The processing module is used to add 1 to N if N is less than the total number of the atomic data values and return to execute the second filtering module; if N is equal to the total number of the atomic data values, determine that the judgment item corresponding to the Nth group of filtering results is the target judgment item.
[0040] Preferably, the target judgment entries include at least a default judgment entry; the determination unit is specifically used to: if the number of the target judgment entries is 1, determine that the preset judgment result corresponding to the default judgment entry is the final judgment result; if the number of the target judgment entries is 2, determine that the preset judgment results corresponding to the other target judgment entries except the default judgment entry are the final judgment results; if the number of the target judgment entries is greater than 2, output an error message.
[0041] The third aspect of an embodiment of the present invention discloses an electronic device, comprising: a processor and a memory, wherein the processor and the memory are connected via a communication bus; wherein the processor is used to call and execute a program stored in the memory; and the memory is used to store a program, wherein the program is used to implement the method for determining multi-layer structured data disclosed in the first aspect of the embodiment of the present invention.
[0042] A fourth aspect of an embodiment of the present invention discloses a computer-readable storage medium, in which computer-executable instructions are stored. The computer-executable instructions are used to execute the method for determining multi-layered structured data disclosed in the first aspect of the embodiment of the present invention.
[0043] Based on the above-mentioned embodiments of the present invention, a method, system, and related devices for determining data with a multi-level structure are provided. The method comprises the following steps: upon detecting that a user has invoked a target determination rule, multiple atomic data values input by the user for determination are obtained; the atomic data values are expanded according to the multi-level data definition table corresponding to the atomic data values to obtain corresponding input data sets; the determination entries in the determination function rule table corresponding to the target determination rule are filtered sequentially according to the input data sets corresponding to each atomic data value to obtain target determination entries; and a final determination result is determined based on the target determination entries. In this solution, a multi-level data definition table and a determination function rule table are pre-set. After obtaining the atomic data values input by the user, the atomic data values are expanded according to the multi-level data definition table to obtain corresponding input data sets. The determination entries in the determination function rule table corresponding to the target determination rule are filtered sequentially according to the input data sets corresponding to each atomic data value to obtain target determination entries, and a final determination result is determined based on the target determination entries. This solution can process data with complex hierarchical relationships using the pre-set multi-level data definition table and determination function rule table, thereby meeting ever-growing business needs. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0045] Figure 1 A schematic diagram of a three-layer structure provided by an embodiment of the present invention;
[0046] Figure 2 A schematic diagram of a four-layer structure provided by an embodiment of the present invention;
[0047] Figure 3A flowchart of a method for determining multi-level structured data provided by an embodiment of the present invention;
[0048] Figure 4 A flowchart of extending atomic data values provided by an embodiment of the present invention;
[0049] Figure 5 A flowchart of determining a target determination item provided by an embodiment of the present invention;
[0050] Figure 6 A schematic diagram of a passenger access determination function provided by an embodiment of the present invention;
[0051] Figure 7 A schematic diagram of the architecture of a yes / no determination system provided by an embodiment of the present invention;
[0052] Figure 8 A schematic diagram of an application of a method for determining multi-level structured data provided by an embodiment of the present invention;
[0053] Figure 9 A schematic diagram of the architecture of a determination rule expansion device provided by an embodiment of the present invention;
[0054] Figure 10 A structural block diagram of a determination system for multi-level structured data provided by an embodiment of the present invention;
[0055] Figure 11 A schematic structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0056] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0057] In this application, the terms "comprises," "comprising," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus that includes a list of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not preclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element.
[0058] It should be noted that the method, system and related equipment for determining multi-level structured data provided by this solution can be applied to a yes / no determination system. Since this solution involves many terms, the terms involved in this solution are explained below.
[0059] A "Yes / No" decision system is a functional unit entity specifically designed to make "yes" or "no" decisions based on various input conditions. For example, within a departing passenger service product in the civil aviation sector, this decision module is used to determine whether each user access operation is legitimate and whether to authorize the access.
[0060] Access control: User access rights determination is the most typical right-or-no determination system. For various core user-oriented products, such as reservation sales, passenger services, etc., user access control is the first checkpoint.
[0061] Multi-level structure: This proposal proposes a new definition for decision information data items. It combines similar data items with inclusion / combination relationships into a single composite data item, describing and expressing this data item through multiple levels, from highest to lowest. For example, "Airline" and "Airline Group" can be combined into a single composite data item, "Extended Airlines." This composite data item has multiple levels: the top level can represent all airlines, the middle level can represent airline groups, and the bottom level can represent specific airlines. Using a single "Extended Airlines" field, the entire composite relationship of related airlines can be expressed.
[0062] Decision rules (also known as yes / no rules): The decision rule system consists of a set of yes / no rules, each corresponding to a specific decision function. Each yes / no rule has multiple pre-defined decision items, which record authorization and control information. These specific decision items are used to analyze and check input data, and then make a judgment based on the results.
[0063] Access control rules: Access control rules are a typical example of yes / no judgment rules. Core business systems, based on considerations such as sensitive data protection, access flow control, and system security, usually need to judge and filter user access. Based on the static and dynamic information carried by the user access and preset rules, it is determined whether the current user access is accepted or rejected.
[0064] After research, the inventors discovered that the right and wrong judgment system is a system composed of multiple judgment rules, which can realize right and wrong judgments for multiple functions. Generally speaking, each judgment rule in the right and wrong judgment system corresponds to a judgment function, and each judgment rule defines many specific judgment items, and the actual authorization and control information is recorded in these judgment items. In the core products for users, the access control module for users is a typical right and wrong judgment system. The access control module has multiple access control rules, which can realize access control for multiple functional scenarios such as data reading, data updating, and data creation. Each access control rule can determine whether the user's access operation is reasonable based on the information entered by the user in the corresponding scenario, and decide whether the access is allowed.
[0065] Because of their black-and-white nature, right-or-wrong decisions often serve as crucial control nodes throughout the entire business process. For example, user access control decisions determine whether users can access and manipulate target data. The results are directly related to operational security, data security, and system security, making them extremely important. Therefore, each core product prioritizes user access control systems and offers their own implementations. However, in practical applications, existing right-or-wrong decision-making methods encounter the following two major issues:
[0066] Problem 1: The lack of a unified data standard definition increases the complexity of product interactions, requiring external systems and users to adapt and customize different products differently.
[0067] Problem 2: Poor scalability. Most products are designed and implemented to meet existing business needs. This results in insufficient scalability to accommodate new scenarios during rapid business expansion. This often requires architectural refactoring to support new functionality. However, due to a lack of unified standard guidance during refactoring, achieving an optimal structure in one go is impossible, leading to repeated refactoring.
[0068] The two problems mentioned above are common in existing right-or-wrong judgment systems, especially the problem of "poor scalability". For example, the access control judgment system for departing passenger service products has input information including user account, office group, flight route, airline, access function, etc. However, as the business continues to expand, this information has gradually developed a complex hierarchical relationship. The complex hierarchical relationship is as follows: when Airline A and Airline B merge, Airline A and Airline B will still be two independent airlines, but will be regarded as a logical whole; special control rules will be used within the group airline; from traditional departure terminal control to route control (involving several terminals), and then to regional control (for example, a regional control center involving multiple terminals), etc.; from traditional terminal operation channels, it will be expanded to a combination of terminals and self-service counters, and then to terminals, self-service counters, and online processing, etc.
[0069] In order to identify and support the "complex hierarchical relationships" developed above, the expansion method adopted by the existing access control judgment system is: adding new field definitions, adding new judgment rules, and adding new usage logic to support new needs. However, the aforementioned expansion method is very cumbersome, inefficient, and costly. Data items of the same category but different levels are defined separately (for example, airlines and airline groups, airports and routes, and regions), making the data structure increasingly bloated and the data usage logic increasingly complex, resulting in a significant decrease in the readability and maintainability of the entire system. In addition, the aforementioned method also has the following potential problems: when different products expand the right and wrong judgment system according to their respective needs, due to different needs, the actual expansion methods adopted are also different. This will lead to differences in field definitions, rule settings, and usage logic, making the functional gap between different products increasingly larger.
[0070] The inventors have summarized and found that the main reasons for the above problems are the following two points:
[0071] Reason 1: The reason for the definition structure of information data items; the existing yes / no decision system usually uses a single-level data definition method to define input decision information data items. Single-level data definition is a natural data definition method, which means that each data field corresponds to a single, clear data item. For example, the "airline" field corresponds to a separate airline data item. To represent the new requirement of "group airline", it is necessary to add a new "group airline" field to correspond to the group airline data item. This essentially leads to repeated definitions and redundancy of data fields in the same category (for example, all airline-related data definitions) but at different levels (for example, group airlines are essentially a collection of several airlines).
[0072] Reason 2: The freedom and arbitrariness of the yes / no decision algorithm. This is a secondary problem caused by the definition structure of information data items. Due to the repeated and redundant definitions of data items, the logical algorithms that use these data items for yes / no decisions also become repeated and redundant. There is no unified standard on how to use these repeatedly defined data items, which leads to a widening gap in data definitions for different products after multiple demand expansions, and a serious problem of personalization of the decision algorithm.
[0073] In response to the above problems, this solution proposes a judgment method, system and related equipment for multi-level structured data, and pre-sets a multi-level data definition table and a judgment function rule table. After obtaining the atomic data value input by the user, the atomic data value is expanded according to the multi-level data definition table to obtain the corresponding input data set. According to the input data set corresponding to each atomic data value, the judgment entries in the judgment function rule table corresponding to the target judgment rule are filtered in sequence to obtain the target judgment entry, and the final judgment result is determined according to the target judgment entry. This solution can process data with complex hierarchical relationships through the pre-set multi-level data definition table and judgment function rule table, thereby meeting the ever-growing business needs.
[0074] It should be noted that in the process of implementing this solution, it is necessary to pre-set multi-layer data definition tables and judgment rules. The setting process mainly includes the following three steps:
[0075] Based on business characteristics, clarify how many levels are required for multi-level data items;
[0076] Complete the definition of all multi-level data items;
[0077] Complete the definition of multi-level judgment rules.
[0078] To make this solution easier to understand, the multi-layer data definition table and judgment rules used in this solution are explained below.
[0079] 1. Description of multi-level data definition table:
[0080] When setting up a multi-level data item, you first need to determine the number of levels (that is, the specific number of levels required for the multi-level data item). The multi-level data item should meet the following requirements:
[0081] Requirement 1: All multi-level data items in the same yes / no decision system should have the same number of levels.
[0082] Requirement 2: Each multi-level data item must have at least two levels: the top level (highest level) and the bottom level (lowest level); the top level represents all data in the multi-level data item category (indicated by "*"), and the bottom level represents the atomic data in the multi-level data item category. Atomic data cannot be further split.
[0083] Requirement 3: The data names of each level in each multi-level data item must be unique, and duplicate names are not allowed.
[0084] Requirement 4: Each level should be a collection of data from the lower levels.
[0085] Requirement 5: In order to maintain the consistency of the number of layers in the entire system, a certain level of a multi-level data item can be set to empty (no data).
[0086] On the basis of meeting the above requirements, the specific number of layers is determined by the following:
[0087] The number of layers should be as few as possible while still meeting requirements. Therefore, we first consider whether a three-layer structure ("individual - first-level collection - full data") can meet all requirements. Theoretically, a three-layer structure can meet all requirements. However, if a large number of combinations occur within the middle layer (the "first-level collection") of multi-level data items, we should consider whether a four-layer structure ("individual - first-level collection - second-level collection - full data") should be used to express the hierarchical relationships of the multi-level data items.
[0088] For example Figure 1 In the schematic diagram of the three-layer structure shown, the bottom layer has eight types of atomic data AH, the top layer is "*", and "*" represents the full set of the eight types of atomic data AH; there are three combination sets X, Y and Z in the middle layer, among which set Z can actually be composed of set X and set Y.
[0089] When the number of similar "Z=X+Y" combinations increases within the same level (also called the same layer), the number of layers should be expanded, and the number of layers of the entire system should be expanded from three to four; Figure 2 The schematic diagram of the four-layer structure shown here elevates the level of set Z to the "secondary set" level, and sets Z equal to the sets of X and Y at the next level.
[0090] Repeat the above process until no new layers are needed. The number of layers at this point is the number of layers in the entire system. After the number of layers is determined, the multi-level data items are defined as follows:
[0091] The number of layers of the entire system is denoted as n; a multi-level data definition table is established for each multi-level data item. The multi-level data definition table is used to record the data values of each level in the multi-level data item and the relationship between them. The number of columns in the multi-level data definition table is "number of layers + 2" (in addition to each layer occupying one field, the "data name" column and the "level" column are added). The fields of the multi-level data definition table are shown in Table 1.
[0092] Table 1:
[0093]
[0094]
[0095] The meanings of the fields in Table 1 above are as follows:
[0096] Data name: the name of specific data / data set. "Data" refers to atomic data, and "data set" refers to aggregate data.
[0097] LV1: This field is a collection, listing which fields of the LV1 level reference the current data / data collection.
[0098] LV2: This field is a collection, listing which fields of the LV2 level reference the current data / data collection.
[0099] LVn: This field is a collection that lists which fields of the LVn level reference the current data / data collection.
[0100] by Figure 2 Taking the four-layer structure shown as an example, assuming that the multi-level data item of the four-layer structure is named "Extended Airlines", the multi-level data definition table corresponding to the multi-level data item is shown in Table 2.
[0101] Table 2:
[0102]
[0103] From Tables 1 and 2 above, it can be seen that for a specific data item, the meaning of the LVn definition of the data item actually describes which "direct" reference relationships exist between the current data item and the data item of the corresponding LVn. For example: Airline A is a LV1-level data. Among all the data in the LV1 level, Airline A is only related to itself, so there is only Airline A in the LV1 set of Airline A. Among all the data (X, Y) in the LV2 level, data X directly references A, so there is only X in the LV2-level set of Airline A. For LV3 data Z, although Z is ultimately related to A, this relationship is not "direct", but is "indirectly" passed to LV1 A through X in LV2. Therefore, for A, there is no "directly" referenced data in A's LV3 level, so A's LV 3 set is empty.
[0104] In summary, except for the highest level which is fixed as "{*}", in the multi-level data definition table, only the "M-1" level, "M" level and "M+1" level may have defined data, and the other levels should be empty sets.
[0105] As can be seen from Table 2 above, Table 2 describes a bidirectional relationship. From a given high-level data such as Z, we can go down the level (that is, to the lower level) step by step to find {X, Y}, and then further down through {X, Y} to find {A, B, C, D}; at the same time, from a given low-level data such as A, we can go up the level (that is, to the higher level) step by step to find the reference {X} of the previous level, and then further through {X} to find the reference {Z} of the next higher level until we find the reference {*} of the highest level.
[0106] After setting up the multi-layer data definition table, you can add data to the multi-layer data definition table, or modify or delete the data in the multi-layer data definition table.
[0107] When adding new data to the multi-level data definition table, the data is added to the multi-level data definition table through the multi-level data addition algorithm shown in processes A1-A6.
[0108] Suppose a new data Z is added to a multi-layer data definition table. The level of data Z is L and the number of system layers is n.
[0109] A1 checks whether the newly added data Z already exists in the multi-layer data definition table. If so, an error message is returned. Duplicate data cannot exist in the same multi-layer data definition table. If not, execute A2.
[0110] A2. Add a new row and write the new data Z into the row, setting the level to L.
[0111] A3. Directly set the LV L layer of data Z to {Z} and the LV n layer of data Z to {*}.
[0112] A4. Fill in the lower level of the LVL layer (forward link): Since multi-level data only aggregates the data of the next lower level, the downward scanning operation only needs to be performed on the LVL-1 level. Check whether data Z at the LVL-1 level contains the data items of that level (LVL-1 level). If it does, add the included data items to the LVL-1 level collection and fill in the data. If not, add an empty collection {}. Other levels below the LVL-1 level are directly filled with empty collections {}.
[0113] A5. Filling in the lower level of the LV L layer (reverse linking): During step A4, each time you add a data item (e.g., X), you must reverse-add the newly added data item Z to the corresponding LV L set in the existing row of data X. This is because if Z references X, the reference to X by Z must also be recorded in row X.
[0114] A6. Fill in the upper layer of LVL layer (reverse link): Since the newly added data Z cannot be included in any existing data, the LVL+1 layer to LVn-1 layer of data Z are all filled with empty sets {}.
[0115] By using the multi-level data joining algorithm given in processes A1-A6, new data can be added to the multi-level data definition table.
[0116] When modifying data in a multi-layer data definition table, the data in the multi-layer data definition table is modified using the multi-layer data modification algorithm shown in processes B1 and B2.
[0117] Suppose that data Z in a multi-layer data definition table is modified. The level of data Z is L and the number of system levels is n.
[0118] B1. Use the multi-level data deletion algorithm to delete data Z from the multi-level data definition table. For details of the multi-level data deletion algorithm, see steps C1 to C4.
[0119] B2. Use the multi-level data joining algorithm shown in the above processes A1 to A6 to re-add the modified data Z to the multi-level data definition table.
[0120] Suppose that data Z in a multi-layer data definition table is deleted. The level of data Z is L and the number of system levels is n.
[0121] C1. Determine whether the data Z to be deleted already exists in the multi-layer data definition table; if not, return an error; if so, execute C2.
[0122] C2. Unlink to the lower level of the LVL (remove the reverse link): Since multi-level data only aggregates the data at the next lower level, unlinking to the lower level only requires the LVL-1 level. Check whether data Z at the LVL-1 level contains the data items at that level. If so, for example, if Z records {X, Y} at the LVL-1 level, delete data Z from the LVL-level aggregations of data rows X and Y, respectively, to remove the reverse link references from X and Y to data Z.
[0123] C3. Unlink to the upper level of the LVL (delink forward): Since multi-level data only aggregates the data in the next lower level, unlinking to the upper level only needs to be performed on the LVL+1 level. Check whether data Z is referenced by other data in the LVL+1 level. Assume that the aggregate of data Z in the LVL+1 level is {Q}. Delete data Z from the LVL-level aggregate of data row Q to remove the inclusion relationship between data Q and data Z.
[0124] C4. Delete the Z data row.
[0125] Data Z can be deleted through the multi-level data deletion algorithm shown in processes C1 to C4.
[0126] The above content is the relevant explanation of the multi-level data definition table.
[0127] II. Explanation of the Determination Rules:
[0128] The judgment rules provided by this solution are set based on the multi-level data items mentioned above. Therefore, in this solution, each judgment data item is a multi-level data item. In the judgment entry of the judgment rule, the value of the judgment data item can be the value of any level of the multi-level data item.
[0129] It should be noted that the judgment data item specifically refers to the known information on which the judgment is based; for example: a judgment rule is to determine whether the user has the authority to perform data update operations based on the user's login identity role. In this judgment rule, the user's login identity role is the judgment data item.
[0130] Define a new decision rule (decision function) as follows:
[0131] First, a corresponding judgment function rule table is established for the new judgment rule. In the judgment system, each judgment rule corresponds to a judgment function rule table.
[0132] All judgment entries required for the judgment rules are defined in the judgment function rule table; it is worth noting that when adding a new judgment entry, it is necessary to determine whether the newly added judgment entry conflicts with the existing judgment entry, and it is prohibited to add conflicting judgment entries to the judgment function rule table at the same time.
[0133] The format and content of the judgment function rule table can be found in Table 3. In Table 3, ID is the serial number of the judgment entry, judgment field 1 to judgment field n are information items used by the judgment rule to make judgments (that is, the judgment data items mentioned above), and the data type of each information item is a defined multi-level data item; the judgment result is the preset judgment result corresponding to each judgment entry, and the preset judgment result is yes or no.
[0134] Table 3:
[0135]
[0136] It should be noted that the value filled in each judgment field is the valid value of a certain level in the multi-level data item.
[0137] For example, in the user access control module of the departing passenger service product, a whitelist model is adopted to protect user data security. That is, unauthorized access is prohibited; authorized access requires setting judgment rules to authorize access. In this example, the following two judgment entries need to be created to implement user access control:
[0138] Decision Item 1: Set a default decision item to deny access to passenger data to all airlines. This default decision item sets the entire decision rule to whitelist mode.
[0139] Decision Item 2: Set an authorization decision item to allow users of airline group X to access the passenger data of all airlines under airline alliance Z (see Table 2 for details).
[0140] Based on the above determination item 1 and determination item 2, a determination function rule table is established and the above determination item 1 and determination item 2 are filled in the determination function rule table. The obtained determination function rule table is shown in Table 4.
[0141] Table 4:
[0142]
[0143] As can be seen from Table 4, the values of all the judgment fields (initiating airline, target airline) of judgment item 1 are all "*", and judgment item 1 is called the default judgment item.
[0144] Default judgment entries have the following characteristics: Default judgment entries are generally used to determine the mode of the judgment rule (i.e., whitelist mode or blacklist mode). The default judgment result is generally blacklist mode if it is passed, and the default judgment result is generally whitelist mode if it is failed. Each judgment function rule table should have a default judgment entry to ensure that each match can at least match the default judgment entry and give a clear judgment result. The default judgment entry has the lowest priority in the overall judgment, that is, the default judgment entry is only used when the input data does not match other judgment entries in the judgment function rule table.
[0145] After setting the judgment function rule table, you can add judgment entries to the judgment function rule table, or modify or delete judgment entries in the judgment function rule table.
[0146] When adding a new judgment entry to the judgment function rule table, the judgment entry is added to the judgment function rule table through the judgment entry adding algorithm shown in processes D1-D5; it should be noted that the judgment entry adding algorithm also includes the content of detecting whether the newly added judgment entry conflicts with the existing judgment entry.
[0147] Suppose a new decision entry P is added to the decision function rule table. In addition to the decision result field, the decision entry P also has m decision fields.
[0148] D1. For each value K of the judgment field of the newly added judgment entry P, a corresponding association set is established. The initial value of the association set is K plus "*", that is, the association set is {K, *}. It is worth noting that K may be an atomic value at level 1, or a non-atomic value at a certain level. Let the level of K be N. Access the multi-level data definition table corresponding to the judgment field, find the corresponding row of K, and recursively traverse the upper layer (towards the upper level) in turn, adding all related data items to the above-mentioned association set; then recursively traverse the lower layer (towards the lower level) in turn, adding all related data items to the above-mentioned association set. The specific process is as follows:
[0149] Recursively traverse upward: access the LVN+1 layer above the data K, and add the data items associated with the LVN+1 layer to the associated set; for example: suppose the current associated set is {K,*}, and the data item associated with the LVN+1 layer of K is {P}, add the data item P to the associated set, and the associated set becomes {K,P,*}; since the data item P is found in the LVN+1 layer, continue to recursively access the LVN+2 layer above the data item P until the top level {*} or the set is an empty set {} is encountered, and the recursion terminates.
[0150] Recursively traverse to the next layer: access the next layer LVN-1 of data K, and add the data items associated with the LVN-1 layer to the associated set; for example: suppose the current associated set is {K, P, *}, and the data item associated with the LVN-1 layer of K is {Q}, add data item Q to the associated set, and the associated set becomes {K, P, Q, *}; since data item Q is found in the LVN-1 layer, continue to recursively access the next layer LVN-2 of data item Q until the LV1 layer is recursively accessed, and the recursion terminates.
[0151] It should be noted that, since the multi-level data items and the multi-level data definition table have a one-to-one relationship, the corresponding multi-level data definition table can be obtained by determining the type of the field.
[0152] D2. After generating association sets for all m decision fields of the newly added decision entry P according to the method of the above process D1, the newly added decision entry P has m association sets, each of which actually records all data values that have an association relationship with the value of the decision field corresponding to the decision entry P.
[0153] D3. Traverse all existing judgment entries except the default judgment entry in the judgment function rule table to check whether there is a specific judgment entry: the value of each judgment field of the existing judgment entry falls within the associated set of the newly added judgment entry P.
[0154] D4. If the specific judgment item mentioned in step D3 exists among the existing judgment items other than the default judgment item, this means that the specific judgment item conflicts with the newly added judgment item P. In this case, an error is reported and the addition of judgment item P to the judgment function rule table is prohibited. It should be noted that if the specific judgment item mentioned in D3 exists, it means that in certain input scenarios, the specific judgment item and the newly added judgment item P may be matched at the same time, resulting in an ambiguous error.
[0155] D5. If the specific judgment entry mentioned in process D3 does not exist in the existing judgment entries other than the default judgment entry, it means that the newly added judgment entry P does not conflict with the existing judgment entries. At this time, the judgment entry P can be added to the judgment function rule table.
[0156] Through the processes D1-D5, a new decision entry can be added to the decision function rule table.
[0157] When modifying the decision entry in the decision function rule table, the decision entry in the decision function rule table is modified by the decision entry modification algorithm shown in processes E1 and E2.
[0158] Assume that the decision entry P in the decision function rule table needs to be modified.
[0159] E1. Use the decision entry deletion algorithm to delete the decision entry P from the decision function rule table.
[0160] E2. Use the decision entry adding algorithm shown in the above processes D1 to D5 to add the modified decision entry P back into the decision function rule table.
[0161] The algorithm for deleting a decision entry is to directly delete the decision entry to be deleted from the decision function rule table.
[0162] The above is the relevant explanation of the judgment rules.
[0163] Based on the above "1. Description of multi-level data definition table" and "2. Description of judgment rules", see Figure 3 , which shows a flow chart of a method for determining multi-level structured data provided by an embodiment of the present invention, the determination method includes:
[0164] Step S301: when it is detected that the user calls the target determination rule, a plurality of atomic data values input by the user for determination are obtained.
[0165] It's important to note that each decision rule can be considered an independent code segment, each with a unique entry and exit point. When a business or function requires the execution of a decision rule, it is called, with the atomic data value input at the entry point and the final decision result output at the exit point. Therefore, the target decision rule is the one called by the user.
[0166] In the specific implementation process of step S301, when the user calls the target judgment rule for judgment, the user needs to input multiple atomic data values for judgment; at this time, the data values of all judgment data items required for the target judgment rule are obtained from the user input, and the data values of the obtained judgment data items are the atomic data values input by the user.
[0167] It should be noted that since all data in actual business (such as specific access) will be specific to the lowest-level atomic entity value, the data value entered by the user is the atomic data value of the LV1 level; the atomic data value entered by the user is the atomic data used as the basis for judgment.
[0168] Step S302: According to the multi-layer data definition table corresponding to the atomic data value, the atomic data value is expanded to obtain a corresponding input data set.
[0169] It should be noted that each atomic data value corresponds to an input data set, and the multi-layer data definition table is pre-set according to the multi-level data items. The specific content of the multi-layer data definition table is detailed in the above "1. Description of the multi-level data definition table" and will not be repeated here.
[0170] Since each atomic data value corresponds to a multi-level data item, in the specific implementation of step S302, the multi-level data item corresponding to the atomic data value is determined, and then the multi-level data definition table corresponding to the atomic data value is determined.
[0171] For each atomic data value input by the user, the atomic data value is expanded according to the multi-layer data definition table corresponding to the atomic data value to obtain a corresponding input data set.
[0172] Step S303: filtering the decision entries in the decision function rule table corresponding to the target decision rule according to the input data sets corresponding to the respective atomic data values in order to obtain the target decision entry.
[0173] It should be noted that the determination function rule table is pre-set according to the multi-level data items. The specific content of the determination function rule table is detailed in the above "II. Description of the determination rules" and will not be repeated here.
[0174] In the specific implementation of step S303, after the atomic data values are expanded to obtain the corresponding input data sets, the judgment entries in the judgment function rule table corresponding to the target judgment rule are filtered in sequence according to the input data sets corresponding to each atomic data value, thereby obtaining the target judgment entry.
[0175] Step S304: Determine the final determination result according to the target determination item.
[0176] Since the target judgment entries include at least the default judgment entry, the number of the target judgment entries is at least one.
[0177] In the specific implementation of step S304 , if the number of target determination items is 1, it indicates that the target determination items only include a default determination item. In this case, the preset determination result corresponding to the default determination item is determined as the final determination result.
[0178] If the number of target judgment entries is 2, it indicates that other judgment entries other than the default judgment entry are matched. At this time, the preset judgment results corresponding to the other target judgment entries other than the default judgment entry are determined as the final judgment results, that is, the preset judgment results of the other target judgment entries other than the default judgment entry are used as the final judgment results.
[0179] If the number of target decision items exceeds two, a decision item conflict exception has occurred. An error message will be output, prompting the system administrator to adjust the decision items to eliminate the conflict. It should be understood that the aforementioned "decision item addition algorithm" already checks whether newly added decision items conflict with existing ones, and under normal circumstances, this abnormal situation of decision item conflict does not occur.
[0180] In an embodiment of the present invention, a multi-layer data definition table and a judgment function rule table are pre-set. After obtaining the atomic data value input by the user, the atomic data value is expanded according to the multi-layer data definition table to obtain the corresponding input data set. The judgment entries in the judgment function rule table corresponding to the target judgment rule are filtered sequentially based on the input data set corresponding to each atomic data value to obtain the target judgment entry, and the final judgment result is determined based on the target judgment entry. This solution can process data with complex hierarchical relationships through the pre-set multi-layer data definition table and judgment function rule table, thereby meeting the ever-expanding business needs.
[0181] The above embodiments of the present invention Figure 3For details on expanding the atomic data value mentioned in step S302, see Figure 4 , which shows a flow chart of extending atomic data values provided by an embodiment of the present invention, Figure 4 The following steps are involved:
[0182] Step S401: For each atomic data value, construct an initial set corresponding to the atomic data value.
[0183] It should be noted that the multi-level data definition table includes data items at multiple levels. For details, please refer to the above "I. Description of the Multi-Level Data Definition Table" and will not be repeated here.
[0184] In the specific implementation of step S401, for each atomic data value input by the user, an initial set corresponding to the atomic data value is constructed, and the initial set includes: the atomic data value and the data items associated with the highest level in the multi-layer data definition table corresponding to the atomic data value.
[0185] For example: for the atomic data value K, an initial set corresponding to the atomic data value K is constructed, and the initial set corresponding to the atomic data value K is {K,*}.
[0186] Step S402: Determine the level associated with the atomic data value in the multi-layer data definition table.
[0187] In the specific implementation of step S402, the multi-level data definition table corresponding to the atomic data value is accessed to determine the level associated with the atomic data value in the multi-level data definition table; or in other words, the row of the atomic data value is found from the multi-level data definition table.
[0188] For example: access the multi-level data definition table corresponding to the atomic data value K, and find the row of the atomic data value K from the multi-level data definition table.
[0189] Step S403: Starting from the level associated with the atomic data value, recursively traverse the multi-layer data definition table to the higher level in turn, and add the data items associated with the levels involved in the recursive traversal process to the initial set to obtain the input data set corresponding to the atomic data value.
[0190] In the process of specifically implementing step S403, starting from the level associated with the atomic data value, recursive traversal is performed in turn toward the higher level in the multi-layer data definition table corresponding to the atomic data value, and the data items associated with the levels involved in the recursive traversal are added to the initial set of the atomic data value, thereby obtaining the input data set corresponding to the atomic data value; the recursive traversal is terminated when the highest level {*} or the level associated with the empty set {} is encountered during the recursive traversal.
[0191] For example, suppose the atomic data value K is at level 1, and the initial set corresponding to the atomic data value K is {K, *}. During the recursive traversal, first access level 2 of the atomic data value K, and add the data items associated with level 2 to the initial set {K, *}. Suppose the data items associated with level 2 of the atomic data value K are {P, Q}, then add P and Q to the initial set {K, *}, and the initial set becomes {K, P, Q, *}.
[0192] Since {P,Q} is found in the LV2 layer, we continue to recursively access the upper layer (one level higher) of P and Q, that is, continue to recursively access the LV3 layer of P and Q, and add the data items associated with the LV3 layer of P and Q to the initial set {K,P,Q,*}; suppose that the LV3 layer of P is associated with {W}, and the LV3 layer of Q is associated with the empty set {}, then add W to the initial set {K,P,Q,*}, and the initial set becomes {K,P,Q,W,*}.
[0193] Since an empty set is found in the LV3 layer of Q, there is no need to recursively access the LV4 layer of Q; since {W} is found in the LV3 layer of P, we continue to recursively access the upper layer of W, that is, continue to recursively access the LV4 layer of W, and add the data items associated with the LV4 layer of W to the initial set {K, P, Q, W, *}; assuming that the level of the entire system is 4, the data items associated with the LV4 layer of W must be {*}, then the input data set obtained by expanding the atomic data value K is {K, P, Q, W, *}, and the recursive traversal terminates.
[0194] Through the method shown in the above steps S401 to S403, each atomic data value input by the user is expanded, thereby obtaining an input data set corresponding to each atomic data value.
[0195] The above embodiments of the present invention Figure 3 For the content of the target determination item obtained in step S303, see Figure 5 , which shows a flow chart of determining a target determination entry provided by an embodiment of the present invention, Figure 5 The following steps are involved:
[0196] Step S501: filtering the decision entries in the decision function rule table corresponding to the target decision rule according to the input data set corresponding to the first atomic data value to obtain a first set of filtering results.
[0197] It should be noted that, as shown in Tables 3 and 4, each row in the decision function rule table corresponding to the target decision rule corresponds to a decision entry, and each column in the function rule table corresponds to a decision field. A decision data item in the decision function rule table can have multiple values (a decision data item has a value in each row, which is called a decision data item value).
[0198] In the process of specifically implementing step S501, the judgment entries in the judgment function rule table corresponding to the target judgment rule are filtered for the first round according to the input data set corresponding to the first atomic data value, so as to obtain the first group of filtering results; specifically, the rows under the first column of the judgment function rule table are filtered according to the input data set corresponding to the first atomic data value, so as to obtain the first group of filtering results.
[0199] The first set of filtered results includes the rows in the input data set corresponding to the first atomic data value for the decision data item value in column 1 of the decision function rule table (each row in the decision function rule table corresponds to a decision entry). The data type of each decision data item value in column 1 is the data type set for the decision field corresponding to column 1.
[0200] Step S502: filtering the determination items in the N-1th group of filtering results according to the input data set corresponding to the Nth atomic data value to obtain the Nth group of filtering results.
[0201] It should be noted that the initial value of N is 2.
[0202] In the process of specifically implementing step S502, the judgment entries in the N-1th group of filter results are filtered according to the input data set corresponding to the Nth atomic data value to obtain the Nth group of filter results; specifically, according to the input data set corresponding to the Nth atomic data value, the rows under the Nth column in the N-1th group of filter results are filtered to obtain the Nth group of filter results.
[0203] The Nth group of filtering results includes: the row in the input data set corresponding to the Nth atomic data value of the judgment data item value under the Nth column in the N-1th group of filtering results; the data type of each judgment data item value under the Nth column is the data type set by the judgment field corresponding to the Nth column.
[0204] Step S503: Determine whether N is equal to the total number of atomic data values. If N is less than the total number of atomic data values, execute step S504; if N is equal to the total number of atomic data values, execute step S505.
[0205] In the specific implementation of step S503, it is determined whether N is equal to the total number of atomic data values input by the user. If N is less than the total number of atomic data values input by the user, step S504 is executed; if N is equal to the total number of atomic data values input by the user, step S505 is executed.
[0206] Step S504: N is increased by 1, and the process returns to step S502.
[0207] In the specific implementation of step S504 , if N is less than the total number of atomic data values input by the user, N=N+1, and the process returns to step S502 .
[0208] Step S505: Determine the determination item corresponding to the Nth group of filtering results as the target determination item.
[0209] In the specific implementation of step S505, if N is equal to the total number of atomic data values input by the user, since each row in the judgment function rule table corresponds to a judgment entry, the judgment entry corresponding to the row in the Nth group of filtering results can be determined as the target judgment entry.
[0210] From the above content, it can be seen that each filtering process only cleans one determination field of the determination function rule table, and the number of filtering times is equal to the total number of atomic data values.
[0211] To better understand the contents of steps S501 to S505 above, the following example is provided: assuming that a determination function rule table includes determination field A, determination field B, and determination field C (the determination function rule table has three determination fields); the user inputs, in order: a specific atomic data value a in determination field A, a specific atomic data value b in determination field B, and an atomic data value c in determination field C. Atomic data value a is expanded to obtain the input data set {X}, atomic data value b is expanded to obtain the input data set {Y}, and atomic data value c is expanded to obtain the input data set {Z}.
[0212] The number of filtrations is 3 (equivalent to 3 washes), and the filtering process begins at this time: in the first wash, for the judgment field A, in all rows of the judgment function rule table, the rows whose judgment data item values under the judgment field A (equivalent to the judgment data item values under the first column) are in the input data set {X} are filtered out, and the filtered rows are recorded as the first group of filtering results WASH-1.
[0213] Then the second cleaning process begins. Among all the rows of WASH-1, the rows whose judgment data item values under the judgment field B (equivalent to the judgment data item values under the second column, N=2 at this time) are in the input data set {Y} are filtered out. The filtered rows are recorded as the second group of filtering results WASH-2; since N is less than 3, N=N+1=3.
[0214] Then the third cleaning process begins. Among all the rows of WASH-2, the rows whose judgment data item values under the judgment field C (equivalent to the judgment data item values under the third column, at this time N=3) are in the input data set {Z} are filtered out. The filtered rows are recorded as the third group of filter results WASH-3; since N is equal to 3, the third group of filter results WASH-3 is recorded as the final filter result, and the target judgment entry is the judgment entry corresponding to the row in the third group of filter results WASH-3.
[0215] As can be seen from the above example, each cleaning will remove some rows based on the filtering results obtained by the previous cleaning, so that the rows of each filtering result are continuously reduced, and only one judgment field is cleaned each time.
[0216] Since default judgment entries are set in the judgment function rule table, the number of rows of WASH-3 is at least 1 (ie, the target judgment entries at least include the default judgment entry).
[0217] After obtaining WASH-3, if the number of rows of WASH-3 is 1 (or if the number of target judgment entries is 1), that is, the target judgment entry only includes the default judgment entry, the preset judgment result corresponding to the default judgment entry is used as the final judgment result.
[0218] If the number of rows of WASH-3 is 2, that is, the target judgment entry includes the default judgment entry and other judgment entries, since the default judgment entry has the lowest priority, the preset judgment results corresponding to other target judgment entries except the default judgment entry are used as the final judgment result.
[0219] If the number of rows in WASH-3 is 3, it indicates that a judgment entry conflict exception has occurred. In this case, an error message is output to remind the system administrator to adjust the judgment entry to eliminate the judgment entry conflict.
[0220] above Figure 4 and Figure 5 Instructions for expanding atomic data values and determining target determination entries;
[0221] In order to better explain the judgment method of this solution for multi-level structure data, we take the passenger access judgment function as an example and combine it with Figure 6 Give an example.
[0222] like Figure 6 As shown, Figure 6 A schematic diagram of a passenger access determination function provided by an embodiment of the present invention. Figure 6It includes the relevant contents of the multi-layer data definition table (extended airline multi-layer data definition table), judgment rules (passenger data access judgment rules), and judgment function rule table (passenger access judgment function rule table). Among them, entry 1 of the passenger access judgment function rule table is the default judgment rule.
[0223] exist Figure 6 On this basis, the user requests to input airline A (initiating airline) to request access to the passenger data of airline D (target airline). At this time, the atomic data value of the initiating airline (hereinafter referred to as A) and the atomic data value of the target airline (hereinafter referred to as D) are obtained from the user input.
[0224] For the initiating airline, the extended airline multi-layer data definition table is accessed. The corresponding row for A is found in the extended airline multi-layer data definition table. A's initial set is {A, *}. Then, starting from level 2, the traversal is performed upwards: {X} is found on level 2 of A. X is added to {A, *}, and the initial set becomes {A, X, *}. {Z} is found on level 3 of X. Z is added to {A, X, *}, and the initial set becomes {A, X, Z, *}. {*} is found on level 4 of Z. Traversal terminates, so the input data set obtained by expanding A is {A, X, Z, *}.
[0225] For the target airline, access the extended airline multi-layer data definition table and find the corresponding row for D. The initial set of D is {D, *}. Then, traverse upward from level 2: Find {Y} on level 2 of D. Add X to {D, *}, and the initial set becomes {D, Y, *}. Find {Z} on level 3 of Y. Add Z to {D, Y, *}, and the initial set becomes {D, Y, Z, *}. Find {*} on level 4 of Z. Traversal terminates, so the input data set obtained by expanding D is {D, Y, Z, *}.
[0226] At this time, the input data set obtained by expanding A is {A, X, Z, *}, and the input data set obtained by expanding D is {D, Y, Z, *}.
[0227] Access the passenger access judgment function rule table, using the above Figure 5 The given method is used to filter the judgment entries; specifically, {A, X, Z, *} is used to filter the rows in the passenger access judgment function rule table to obtain WASH-1, and the number of rows of WASH-1 is 2.
[0228] Use {D, Y, Z, *} to filter the rows in WASH-1 to obtain WASH-2. The number of rows in WASH-2 remains 2.
[0229] Since WASH-2 has two rows, the target decision entries include entries 1 and 2 in the Passenger Access Determination Function Rule Table. Since entry 1 is the default decision entry and has the lowest priority, the final decision result is the default decision result for entry 2. Entry 2 is {X, Z, Access Allowed}, resulting in a final decision result of "Access Allowed."
[0230] In practical applications of this solution, a judgment rule expansion device is also provided. The judgment rule expansion device includes a multi-level data structure conversion device and a multi-level judgment rule expansion device. The multi-level data structure conversion device converts the single-level data items of the existing judgment system into multi-level data items based on the content of "I. Explanation of the Multi-Level Data Definition Table" above. The multi-level judgment rule expansion device expands the single-level judgment rules of the existing judgment system into multi-level judgment rules based on the content of "II. Explanation of the Judgment Rules" above.
[0231] The specific process of the multi-level data structure conversion device converting the single-level data items of the existing judgment system into multi-level data items is as follows:
[0232] 1. Collect the existing single-level data items in the existing judgment system to form a data summary table.
[0233] 2. Group the data in the data summary table by major data categories, and group the data items that describe the same major category and have a hierarchical relationship. After step 2, several groups are generated, and each group contains several data items of the same major category. The data items contained in each group need to be recorded here, which will be used when expanding the judgment rules later.
[0234] 3. Define each group generated in the previous step as a new multi-level data item according to the above "1. Explanation of the multi-level data definition table".
[0235] Through the above content, existing single-level data items can be converted into multi-level data items; it is worth noting that in actual applications, unified and standard multi-level data items can be defined between multiple right and wrong judgment systems within the same organization, that is, all existing single-level data items under multiple right and wrong judgment systems within the same organization are brought together to uniformly collect data, group data, analyze data, determine the number of layers, and define new multi-level data items.
[0236] The specific process of the multi-level determination rule expansion device expanding the single-level determination rules of the existing determination system into multi-level determination rules is as follows:
[0237] 1. For each existing single-level judgment rule, create a corresponding judgment function rule table according to the content of "II. Explanation of Judgment Rules" above.
[0238] 2. Based on the groups recorded during the multi-level data item conversion process and the old data items contained in each group, each single-level judgment field in the existing single-level judgment rule is expanded into a corresponding multi-level judgment field, and the multi-level judgment field is defined in the newly created judgment function rule table.
[0239] 3. Transfer all the contents of the current old judgment rules (detailed judgment items) to the new judgment function rule table. The transfer process is a parallel transfer.
[0240] 4. Make the following adjustments to all decision entries in the new decision function rule table: If a default decision entry does not exist in the decision function rule table, add one. Merge entries: If the values of a decision field in multiple decision entries can be combined into a higher-level value, and the values of other decision fields are equal, these decision entries can be merged into one entry. The value of the decision field is set to the combined higher-level value, while the values of other decision fields remain unchanged.
[0241] Based on the above method, the old judgment system can be modified, and the modified judgment system can perform judgment on data with a multi-level structure.
[0242] Through the above Figures 1 to 6 As can be seen from the content shown, the multi-level data item proposed in this solution is a new definition form for the judgment information data item. It is to merge "similar" data items with inclusion / combination relationships into a single "composite" data item (multi-level data item), and divide it into multiple levels from high to low (or from top to bottom) to describe and express the data item.
[0243] The architecture of the yes / no judgment system established by this solution is as follows: Figure 7 As shown, Figure 7 In the data structure, "Airline" and "Airline Group" can be combined into a single composite data item "Extended Airlines". This composite data item has multiple levels. The top level can represent all airlines, the middle level can represent airline groups, and the bottom level can represent specific airlines. The "Extended Airlines" field can be used to express all combinations of related airlines.
[0244] pass Figure 7As can be seen, each multi-level data item is a multi-level structure, with the bottom layer corresponding to the atomic data item and the top layer corresponding to the full data item. The middle layer can be divided into multiple levels, each level representing a collection of partial data items in the level below it. In a data item with a multi-level structure, each item itself represents all the future expansion possibilities for that broad category of data items. Through a reasonable hierarchical definition, each multi-level data item can flexibly describe all possible combinations of that broad category of data. Therefore, a right-or-wrong determination system based on multi-level data items naturally possesses maximum self-scaling capabilities for all existing data items.
[0245] After defining multiple levels of data items, a new right-or-wrong judgment system can be constructed based on these multiple levels of data items. The right-or-wrong judgment system consists of multiple judgment rules, each of which represents a judgment function to achieve a specific control objective. For example, the passenger access restriction judgment rule represents the control function for passenger access. To achieve this judgment function, each judgment rule must also define several judgment items. These items specifically describe information such as "who can do what" and "who cannot do what." When the right-or-wrong judgment system executes each judgment rule, the specific judgment items within these rules ultimately determine the judgment result.
[0246] The judgment rules provided by this solution are based on multi-level data items and are determined through the above Figures 3 to 5 The method given is used to make the judgment.
[0247] like Figure 8 As shown in the application diagram of the method for determining multi-level structured data provided by the embodiment of the present invention, this solution can enable the new multi-level determination rules to obtain, analyze, associate and use multi-level data items, complete the parsing and matching between multi-level data items and atomic data values input by the user, and then complete the determination of the entire determination rule. In this way, the entire new right and wrong determination system has standardized multi-level data definitions and standardized determination rules using these multi-level data items; all defined multi-level data items of this new right and wrong determination system naturally have maximum scalability, and adding new functions in the future only requires defining and adding new multi-level data items.
[0248] All right-or-wrong decision systems within an organization can use unified, standardized, multi-level data items. This allows for consistency and compatibility between multiple right-or-wrong decision systems within the organization, based on the same standardized, multi-level data items and decision rules.
[0249] In order to transform the data items and judgment rules in the old yes / no judgment system into new judgment rules based on multi-level data items, this solution also proposes the following Figure 9The decision rule expansion device shown; through Figure 9 The decision rule expansion device shown can quickly complete the expansion conversion of old data items and old decision rules.
[0250] The decision rule expansion device can complete the definition conversion of single-level data items to multi-level data items through a series of standardized actions, and convert the non-standard use of data items by old decision rules into the standard use of multi-level data items by new decision rules through a series of standardized actions.
[0251] After the conversion, the yes / no judgment system will be based on the definition structure of multi-level data items and use standardized data usage methods. While maximizing the expansion of all existing fields, it will provide new standard data interfaces and judgment services to the outside world.
[0252] The above content is the relevant description of the judgment method for multi-level structured data proposed in this solution. This solution has the following advantages:
[0253] The multi-level data item structure has achieved maximum self-expansion for each field. This means that the yes / no judgment system using this structure will only need to add new multi-level fields based on new business needs in the future. There is no need to consider the expansion of existing fields, which fundamentally solves the expansion problem that restricts the development of the current system.
[0254] This solution can use the judgment rule expansion device to quickly complete the expansion and upgrade of the old judgment rules of the existing yes / no judgment system, and has good scalability and implementability.
[0255] This solution has good versatility and universality, and is applicable to all right and wrong judgment systems. Its scope of use is not limited to the field of limit control judgment.
[0256] This solution provides standardized service capabilities for right-or-wrong decision systems. By using consistent, multi-level data items within an organization, new right-or-wrong decision systems will adhere to consistent data standards and service capabilities, offering greater compatibility and manageability.
[0257] This solution has good flexibility. Users can freely choose to use it globally for their own yes / no judgment system or limit it to local use. They can also mix the original single-level data items with the new multi-level data items according to their own characteristics and needs.
[0258] Corresponding to the determination method for multi-level structured data provided by the above embodiment of the present invention, see Figure 10, the embodiment of the present invention also provides a structural block diagram of a determination system for multi-level structured data, the determination system includes: an acquisition unit 1001, an expansion unit 1002, a filtering unit 1003, and a determination unit 1004;
[0259] The acquisition unit 1001 is configured to acquire multiple atomic data values input by the user for making a determination when it is detected that the user calls a target determination rule.
[0260] The expansion unit 1002 is used to expand the atomic data value to obtain the corresponding input data set according to the multi-layer data definition table corresponding to the atomic data value. Each atomic data value corresponds to an input data set. The multi-layer data definition table is pre-set according to the multi-level data items.
[0261] The filtering unit 1003 is used to filter the determination entries in the determination function rule table corresponding to the target determination rule in sequence according to the input data set corresponding to each atomic data value to obtain the target determination entry. The determination function rule table is pre-set according to multi-level data items.
[0262] The determining unit 1004 is configured to determine a final determination result according to the target determination item.
[0263] In a specific implementation, the target judgment entry includes at least a default judgment entry; the determination unit 1004 is specifically used to: if the number of target judgment entries is 1, determine that the preset judgment result corresponding to the default judgment entry is the final judgment result; if the number of target judgment entries is 2, determine that the preset judgment results corresponding to other target judgment entries except the default judgment entry are the final judgment results; if the number of target judgment entries is greater than 2, output an error message.
[0264] In an embodiment of the present invention, a multi-layer data definition table and a judgment function rule table are pre-set. After obtaining the atomic data value input by the user, the atomic data value is expanded according to the multi-layer data definition table to obtain the corresponding input data set. The judgment entries in the judgment function rule table corresponding to the target judgment rule are filtered sequentially based on the input data set corresponding to each atomic data value to obtain the target judgment entry, and the final judgment result is determined based on the target judgment entry. This solution can process data with complex hierarchical relationships through the pre-set multi-layer data definition table and judgment function rule table, thereby meeting the ever-expanding business needs.
[0265] Preferably, combined Figure 10 The content shown in the figure shows that the multi-layer data definition table includes data items of multiple levels; the expansion unit 1002 includes: a construction module, a determination module, and a traversal module; the execution principle of each module is as follows:
[0266] The construction module is used to construct an initial set corresponding to each atomic data value, wherein the initial set includes: the atomic data value and the data items associated with the highest level in the multi-layer data definition table corresponding to the atomic data value.
[0267] A determination module is used to determine the level associated with the atomic data value in the multi-layer data definition table.
[0268] The traversal module is used to start from the level associated with the atomic data value, and recursively traverse the multi-layer data definition table to the higher level in sequence, and add the data items associated with the levels involved in the recursive traversal process to the initial set to obtain the input data set corresponding to the atomic data value, wherein the recursive traversal is terminated when the highest level or the level associated with the empty set is encountered during the recursive traversal process.
[0269] Preferably, combined Figure 10 As shown in the figure, each row in the determination function rule table corresponding to the target determination rule corresponds to a determination entry, and each column in the function rule table corresponds to a determination field; the filtering unit 1003 includes: a first filtering module, a second filtering module, and a processing module; the execution principle of each module is as follows:
[0270] The first filtering module is used to filter the judgment entries in the judgment function rule table corresponding to the target judgment rule according to the input data set corresponding to the first atomic data value, and obtain the first group of filtering results, wherein the first group of filtering results includes: the rows of the judgment data item values under the first column of the judgment function rule table in the input data set corresponding to the first atomic data value; the data type of each judgment data item value under the first column is the data type set of the judgment field corresponding to the first column.
[0271] The second filtering module is used to filter the judgment items in the N-1th group of filtering results according to the input data set corresponding to the Nth atomic data value to obtain the Nth group of filtering results, wherein the initial value of N is 2, and the Nth group of filtering results includes: the row of the judgment data item value under the Nth column in the input data set corresponding to the Nth atomic data value in the N-1th group of filtering results; the data type of each judgment data item value under the Nth column is the data type set of the judgment field corresponding to the Nth column.
[0272] The processing module is used to add 1 to N if N is less than the total number of atomic data values and return to execute the second filtering module; if N is equal to the total number of atomic data values, determine that the judgment item corresponding to the Nth group of filtering results is the target judgment item.
[0273] An embodiment of the present invention also provides an electronic device, which includes: a processor and a memory, which are connected via a communication bus; wherein the processor is used to call and execute a program stored in the memory; and the memory is used to store a program, which is used to implement a method for determining data with a multi-level structure.
[0274] Reference below Figure 11 , which shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure. The electronic devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 11 The electronic device shown is only an example and should not limit the functions and scope of use of the embodiments of the present disclosure.
[0275] like Figure 11 As shown, the electronic device may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 1101, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1102 or a program loaded from a storage device 1108 into a random access memory (RAM) 1103. Various programs and data required for the operation of the electronic device are also stored in the RAM 1103. The processing device 1101, the ROM 1102, and the RAM 1103 are connected to each other via a bus 1104. An input / output (I / O) interface 1105 is also connected to the bus 1104.
[0276] Typically, the following devices may be connected to the I / O interface 1105: an input device 1106 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 1107 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 1108 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1109. The communication device 1109 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although Figure 11 The electronic device is shown with various devices, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead.
[0277] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 1109, or installed from the storage device 1108, or installed from the ROM 1102. When the computer program is executed by the processing device 1101, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.
[0278] Furthermore, an embodiment of the present invention also provides a computer-readable storage medium, in which computer-executable instructions are stored. The computer-executable instructions are used to execute a determination method for multi-level structured data.
[0279] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device: when detecting that the user calls the target judgment rule, obtains multiple atomic data values input by the user for judgment; according to the multi-layer data definition table corresponding to the atomic data value, expands the atomic data value to obtain the corresponding input data set; filters the judgment entries in the judgment function rule table corresponding to the target judgment rule in sequence according to the input data set corresponding to each atomic data value to obtain the target judgment entry; and determines the final judgment result according to the target judgment entry.
[0280] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of machine-readable storage media would include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0281] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0282] Each embodiment in this specification is described in a progressive manner. The same or similar parts between the embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments. In particular, for system or system embodiments, since they are basically similar to method embodiments, the description is relatively simple. For relevant parts, refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, 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 can be selected according to actual needs to achieve the purpose of the solution of this embodiment. A person of ordinary skill in the art can understand and implement it without expending creative work.
[0283] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.
[0284] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the scope of the present invention. Therefore, the present invention is not limited to the embodiments shown herein, but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for determining multi-level structured data, characterized in that: The method comprises: When detecting that a user calls a target determination rule, obtaining a plurality of atomic data values input by the user for determination; Expanding the atomic data value to obtain a corresponding input data set according to a multi-level data definition table corresponding to the atomic data value, each atomic data value corresponding to one input data set, the multi-level data definition table being pre-configured according to multi-level data items; Filtering the determination entries in the determination function rule table corresponding to the target determination rule in sequence according to the input data set corresponding to each of the atomic data values to obtain the target determination entry, wherein the determination function rule table is pre-set according to multiple levels of data items; Determine the final determination result according to the target determination item; Wherein, the multi-layer data definition table includes data items of multiple levels; According to the multi-layer data definition table corresponding to the atomic data value, the atomic data value is expanded to obtain a corresponding input data set, including: For each atomic data value, construct an initial set corresponding to the atomic data value, the initial set comprising: the atomic data value and the data item associated with the highest level in the multi-layer data definition table corresponding to the atomic data value; determining a level in the multi-layer data definition table associated with the atomic data value; Starting from the level associated with the atomic data value, recursive traversal is performed in the multi-layer data definition table in turn toward the higher level, and the data items associated with the levels involved in the recursive traversal process are added to the initial set to obtain the input data set corresponding to the atomic data value, wherein the recursive traversal is terminated when the highest level or the level associated with the empty set is encountered during the recursive traversal process.
2. The method according to claim 1, characterized in that Each row in the determination function rule table corresponding to the target determination rule corresponds to a determination entry, and each column in the function rule table corresponds to a determination field; Filtering the determination entries in the determination function rule table corresponding to the target determination rule according to the input data set corresponding to each of the atomic data values in sequence to obtain the target determination entry, including: According to the input data set corresponding to the first atomic data value, the judgment entries in the judgment function rule table corresponding to the target judgment rule are filtered to obtain a first group of filtering results, wherein the first group of filtering results includes: the rows of the judgment data item values under the first column of the judgment function rule table in the input data set corresponding to the first atomic data value; the data type of each judgment data item value under the first column is the data type set for the judgment field corresponding to the first column; According to the input data set corresponding to the Nth atomic data value, the judgment items in the N-1th group of filtering results are filtered to obtain the Nth group of filtering results, wherein the initial value of N is 2, and the Nth group of filtering results includes: rows in the input data set corresponding to the Nth atomic data value under the Nth column of the N-1th group of filtering results, wherein the data type of each judgment data item value under the Nth column is the data type set for the judgment field corresponding to the Nth column; If N is less than the total number of the atomic data values, N is incremented by 1, and the process returns to the step of filtering the decision items in the N-1th group of filtering results according to the input data set corresponding to the Nth atomic data value to obtain the Nth group of filtering results; If N is equal to the total number of the atomic data values, the determination item corresponding to the Nth group of filtering results is determined as the target determination item.
3. The method according to any one of claims 1-2, characterized in that The target determination items at least include default determination items; Determining a final determination result according to the target determination item includes: If the number of the target determination items is 1, determining the preset determination result corresponding to the default determination item as the final determination result; If the number of the target determination items is 2, determining the preset determination results corresponding to the target determination items other than the default determination item as the final determination results; If the number of the target determination items is greater than 2, an error message is output.
4. A determination system for multi-level structured data, characterized in that: The system comprises: an acquiring unit, configured to acquire a plurality of atomic data values input by the user for making a determination when detecting that the user has called a target determination rule; an expansion unit, configured to expand the atomic data value to obtain a corresponding input data set according to a multi-layer data definition table corresponding to the atomic data value, each atomic data value corresponding to one input data set, the multi-layer data definition table being pre-set according to multi-level data items; a filtering unit, configured to filter, in sequence according to the input data sets corresponding to the respective atomic data values, the determination entries in the determination function rule table corresponding to the target determination rule to obtain the target determination entry, wherein the determination function rule table is pre-set according to the multi-level data items; a determination unit, configured to determine a final determination result according to the target determination item; The multi-layer data definition table includes data items of multiple levels; the expansion unit includes: A construction module is used to construct, for each atomic data value, an initial set corresponding to the atomic data value, the initial set comprising: the atomic data value and data items associated with the highest level in the multi-layer data definition table corresponding to the atomic data value; A determination module, configured to determine a level in the multi-layer data definition table associated with the atomic data value; A traversal module is used to start from the level associated with the atomic data value, recursively traverse to the higher level in the multi-layer data definition table, and add the data items associated with the levels involved in the recursive traversal process to the initial set to obtain the input data set corresponding to the atomic data value, wherein the recursive traversal is terminated when the highest level or the level associated with the empty set is encountered during the recursive traversal process.
5. The system according to claim 4, characterized in that Each row in the determination function rule table corresponding to the target determination rule corresponds to a determination entry, and each column in the function rule table corresponds to a determination field; The filtering unit comprises: A first filtering module is configured to filter, based on the input data set corresponding to the first atomic data value, the determination entries in the determination function rule table corresponding to the target determination rule to obtain a first set of filtering results, wherein the first set of filtering results includes: rows in the input data set corresponding to the first atomic data value for the determination data item values under the first column of the determination function rule table; and the data type of each determination data item value under the first column is the data type set for the determination field corresponding to the first column; a second filtering module, configured to filter the judgment items in the N-1th group of filtering results according to the input data set corresponding to the Nth atomic data value to obtain an Nth group of filtering results, wherein an initial value of N is 2, and the Nth group of filtering results comprises: rows in the N-1th group of filtering results in which the judgment data item values under the Nth column are in the input data set corresponding to the Nth atomic data value; and the data type of each judgment data item value under the Nth column is the data type set by the judgment field corresponding to the Nth column; The processing module is used to add 1 to N if N is less than the total number of the atomic data values and return to execute the second filtering module; if N is equal to the total number of the atomic data values, determine that the judgment item corresponding to the Nth group of filtering results is the target judgment item.
6. The system according to any one of claims 4-5, characterized in that: The target determination items at least include a default determination item; the determining unit is specifically configured to: if the number of the target determination items is 1, determine the preset determination result corresponding to the default determination item as the final determination result; if the number of the target determination items is 2, determine the preset determination results corresponding to the target determination items other than the default determination item as the final determination result; If the number of the target determination items is greater than 2, an error message is output.
7. An electronic device, characterized in that: include: A processor and a memory, wherein the processor and the memory are connected via a communication bus; wherein the processor is configured to call and execute a program stored in the memory; The memory is used to store a program, and the program is used to implement the determination method for multi-level structured data as described in any one of claims 1 to 3.
8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to execute the method for determining multi-layer structured data according to any one of claims 1 to 3.
Citation Information
Patent Citations
Multi-parameter constraint data retrieval man-machine interaction method and device
CN112965992A
Process control method and device, computer equipment and computer readable storage medium
CN115293655A