A configuration item self-consistency detection method, system and medium based on relationship graph

Through the self-consistency detection method of configuration items based on relationship diagrams, the influence chain and influence domain of configuration items are calculated, which solves the problem of complex dependencies of configuration items in the Linux kernel configuration process, realizes rapid kernel customization and self-consistency detection, and improves improve allocation efficiency.

CN114791865BActive Publication Date: 2024-09-24NAT UNIV OF DEFENSE TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210346626.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-02
Publication Date
2024-09-24
Estimated Expiration
2042-04-02

AI Technical Summary

Technical Problem

During the Linux kernel configuration process, due to the complex dependencies and mutual exclusion relationships between configuration items, the selection of configuration items is cumbersome and complicated, making it difficult to quickly locate relevant configuration items, affecting configuration efficiency, and self-consistent configurations need to be processed during the system configuration process. Item collection is difficult to effectively support with existing technology.

Method used

Using the configuration item self-consistency detection method based on the relationship diagram, the influence chain and influence domain between the configuration items are calculated through the configuration item relationship diagram, and the self-consistency of the configuration item set is judged, and a configuration item self-consistency based on the relationship diagram is provided. The security detection method and system include determining the set of configuration items to be detected, calculating their influence domain and influence chain, generating a minimum self-consistent configuration set, and supporting rapid customization of the Linux kernel.

Benefits of technology

It improves the efficiency of Linux kernel configuration, can quickly detect the self-consistency of configuration item sets, meets the requirements for rapid kernel customization, and simplifies the kernel configuration process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114791865B
    Figure CN114791865B
Patent Text Reader

Abstract

The present invention discloses a configuration item self-consistency detection method, system and medium based on a relationship graph. The method of the present invention comprises determining a configuration item set {C} to be detected, traversing a configuration item C1 of the configuration item set {C}, and if the configuration item C1 is a non-leaf node, calculating the influence domain of the configuration item C1 according to a preset configuration item relationship graph, checking whether there is a conflicting item in the influence domain of the configuration item C1 in the configuration item set {C}, and if there is no conflicting item, continuing the traversal; otherwise, determining that the configuration item set {C} does not meet the self-consistency, outputting the conflicting item pair, terminating and exiting; and determining that the configuration item set {C} meets the self-consistency after the traversal is completed. Based on the configuration item relationship graph, the present invention can realize self-consistency detection for whether any configuration item set {C} to be detected is self-consistent, and can provide effective support for Linux kernel customization, meet the requirements of kernel rapid customization, and improve kernel configuration efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to an operating system kernel configuration assistance technology, and in particular to a configuration item self-consistency detection method, system and medium based on a relationship graph. Background Art

[0002] Since its birth in 1991, after nearly 30 years of development, Linux has occupied a place in information systems. There are about hundreds of Linux distributions in the world, running on various types of electronic devices ranging from sensors to supercomputers, from daily necessities such as smartphones, watches, and cars to spacecraft. In the process of deploying to various electronic devices, it is necessary to customize the kernel of the Linux operating system according to the hardware system and application requirements to support various hardware and meet system requirements such as real-time and reliability. This is an important link to ensure the correct operation of the system.

[0003] As one of the most popular open source communities, the Linux kernel community is very active, with thousands of developers participating in it and continuously submitting various types of mechanisms, features, and device support codes. Taking version 5.8 as an example, the kernel contains 69,325 files and 28,442,673 lines of code, which construct more than 15,000 kernel mechanisms and features. In order to meet the flexible support for multiple types of software and hardware requirements, kernel developers define the various features contained in the kernel in the form of configuration items. Kernel features such as device support and core mechanisms are represented as more than 15,000 configuration items. Kernel developers clearly define the configuration items in the kernel configuration metafile Kconfig. The configuration core program presents these configuration items to the kernel system customizer in the form of a configuration menu to select which configurations need to take effect, supporting system designers to construct kernel images and modules that support various software and hardware systems through the combination of configuration items. Kernel customization is concretized as the process of determining a set of configuration items.

[0004] As an organic whole, there are dependencies and mutual exclusions between the mechanisms and features in the kernel, which are manifested as dependencies and mutual exclusions between configuration items, or between non-combined items. When configuring the kernel, it is necessary to make trade-offs between configuration items based on the dependencies and mutual exclusions. Due to the huge number of configuration items and the dependencies and mutual exclusions between them, or between non-combined items, a complex relationship diagram is formed, making kernel configuration a rather tedious and complicated task. For example, because configuration item A is turned on, the mutually exclusive configuration item B is turned off, and configuration item B affects configuration item C, which in turn affects configuration item D; because the association arc between A and D is long, the configuration impact often requires several backtrackings to be confirmed, which seriously affects the configuration efficiency. Therefore, it is a practical need to quickly locate the related configuration items that affect the configuration items. In addition, in the process of system configuration, it is often necessary to support some specific features. Generating a self-consistent set of configuration items based on one or more specified feature configuration items is also a situation that often needs to be handled in the actual kernel customization process. Summary of the invention

[0005] Technical problem to be solved by the present invention: In view of the above-mentioned problems in the prior art, a method, system and medium for self-consistency detection of configuration items based on a relationship graph are provided. The present invention is based on a configuration item relationship graph (nodes represent Linux configuration items, and edges between nodes represent pre-dependencies between nodes), so that according to the pre-conditions such as and, or, and not existing between the configuration items of the kernel in the configuration item relationship graph, the relationship between the configuration items can be calculated through a graph calculation method, and the influence chain and direct and indirect influence domains of any configuration item can be determined, thereby realizing self-consistency detection of whether any set of configuration items {C} to be detected is self-consistent, which can provide effective support for Linux kernel customization, meet the requirements for rapid kernel customization, and improve kernel configuration efficiency.

[0006] In order to solve the above technical problems, the technical solution adopted by the present invention is:

[0007] A configuration item self-consistency detection method based on a relationship graph includes:

[0008] 1) Determine the set of configuration items to be tested {C};

[0009] 2) If all configuration items of the configuration item set {C} have been detected, jump to step 6), otherwise, take out the first configuration item C1 that has not been detected from the configuration item set {C}; otherwise, jump to the next step;

[0010] 3) Determine whether the configuration item C1 is a leaf node in the preset configuration item relationship graph. If it is a leaf node, jump to step 2); otherwise, jump to the next step; the nodes in the configuration item relationship graph represent Linux configuration items, and the edges between the nodes represent the pre-dependency relationship between the nodes;

[0011] 4) Calculate the impact domain of configuration item C1 according to the preset configuration item relationship diagram;

[0012] 5) Check whether the impact domain of configuration item C1 has conflicting items in the configuration item set {C}. If there are no conflicting items, jump to step 2); otherwise, determine that the configuration item set {C} does not meet the self-consistency, end and exit;

[0013] 6) Determine whether the configuration item set {C} is self-consistent.

[0014] Optionally, step 4) includes:

[0015] 4.1) Get the name of configuration item C1;

[0016] 4.2) According to the name of the configuration item C1, query the corresponding configuration item node c1 in the preset configuration item relationship diagram;

[0017] 4.3) Initialize the influence domain node array list of configuration item node c1 to be empty;

[0018] 4.4) Determine whether the configuration item node c1 is a leaf node in the preset configuration item relationship diagram. If it is a leaf node, directly jump to step 4.9); otherwise, jump to the next step;

[0019] 4.5) All i nodes in the export relationship array of the configuration item node c1 form an influence domain array; the export relationship array records all configuration items that depend on the corresponding configuration item node. If any configuration item B is in the dependency array of configuration item A, the export relationship array of configuration item B contains configuration item A;

[0020] 4.6) If all the configuration item nodes in the impact domain array have been scanned, jump to step 4.9), otherwise take out the first unscanned configuration item node cc1 in the impact domain array;

[0021] 4.7) For the nodes in the export relationship array of the configuration item node cc1, remove the redundant nodes that already exist in the impact domain array and append them to the end of the impact domain node array linked list;

[0022] 4.8) Set the status of the configuration item node cc1 to scanned; jump to step 4.6);

[0023] 4.9) Output the influence domain node array linked list of the configuration item node c1 as the influence domain of the configuration item C1.

[0024] Optionally, step 6) includes the step of generating a minimum self-consistent configuration set for the configuration item set {C} to be detected.

[0025] Optionally, the step of generating a minimum self-consistent configuration set for the configuration item set {C} to be detected includes:

[0026] A1) Initialize the new configuration set of configuration item set {C} to be empty;

[0027] A2) If all configuration items in the configuration item set {C} have been processed, jump to step A6), otherwise, take out the first unprocessed configuration item C1 from the configuration item set {C};

[0028] A3) Determine whether the configuration item C1 is a root node in the preset configuration item relationship diagram. If it is a root node, jump to step 2); otherwise, jump to the next step;

[0029] A4) Calculate the impact chain of configuration item C1 according to the preset configuration item relationship diagram;

[0030] A5) removing redundancy from the configuration items in the impact chain of the configuration item C1 and adding them to the new configuration set, and jumping to step A2);

[0031] A6) Output the new configuration set as the minimum self-consistent configuration set of the configuration item set {C}.

[0032] Optionally, step A4) includes:

[0033] A4.1) Obtain the name of configuration item C1;

[0034] A4.2) According to the name of the configuration item C1, query the corresponding configuration item node c1 in the preset configuration item relationship diagram;

[0035] A4.3) Initialize the influence chain node array list of configuration item node c1 to be empty;

[0036] A4.4) Determine whether the configuration item node c1 is a root node in the preset configuration item relationship diagram. If it is a root node, directly jump to step A4.9); otherwise, jump to the next step;

[0037] A4.5) forming an influence chain array with all i nodes in the dependency array of the configuration item node c1, where the dependency array refers to the set of configuration items that the configuration item node c1 depends on;

[0038] A4.6) If the end of the impact chain array has been reached, jump to step A4.9), otherwise take out the first unscanned configuration item node cc1 in the impact chain array;

[0039] A4.7) For the nodes in the dependency array of the configuration item node cc1, remove the redundant nodes that already exist in the influence chain array and append them to the end of the influence chain node array linked list;

[0040] A4.8) Set the status of the configuration item node cc1 to scanned; jump to step A4.6);

[0041] A4.9) Output the influence chain node array list of configuration item node c1 as the influence chain of configuration item C1.

[0042] Optionally, before step 3), the step of pre-generating a configuration item relationship diagram is also included:

[0043] B1) Scan and read the Linux kernel configuration control file Kconfig, establish corresponding configuration item nodes CNode for the configuration item keywords "config", "menuconfig", "menu" and "choice" in the kernel configuration control file Kconfig, and for each configuration item node CNode, for the configuration item node CNode corresponding to the configuration item keyword "config", add a configuration item node to the configuration item represented by the relationship description keyword specified under the configuration item keyword "config", and establish a directed connection edge corresponding to the dependency relationship according to the dependency or mutual exclusion relationship between the configuration items expressed by the relationship description keyword through AND, OR, or non-expression, and add the configuration items that each configuration item node depends on to the dependency array of the configuration item node; for the configuration item nodes CNode corresponding to the configuration item keywords "menuconfig", "menu" and "choice", establish configuration item nodes for the configuration items under the corresponding configuration item keywords step by step, and establish directed connection edges corresponding to the dependency relationship between the configuration item nodes at all levels and their subordinate configuration item nodes;

[0044] B2) According to all configuration item nodes, according to whether there are connecting edges and the directions of the connecting edges, each kernel configuration item node is divided into a root node, a stem node and a leaf node, wherein the in-degree of the root node is 0, the out-degree and in-degree of the stem node are not 0, and the out-degree of the leaf node is 0, thereby obtaining a configuration item relationship graph; according to the dependency array of each configuration item node in the configuration item relationship graph, a corresponding export relationship array is generated, so that if any configuration item B is in the dependency array of configuration item A, then configuration item A is added to the export relationship array of configuration item B.

[0045] Optionally, the relationship description keywords specified under the configuration item keyword “config” in step B1) include “dependon”, “select”, “visible if”, “choice” and “imply”.

[0046] Optionally, A, B, Bi and C are different arbitrary configuration items, Bi is one of an arbitrary group of n configuration items, A2 is a composite configuration item containing a single configuration item A or a composite configuration item of configuration item A, and the composite configuration item of configuration item A is a negation operation of configuration item A, an OR operation of configuration item A and any configuration item B, or an AND operation of configuration item A and any configuration item B; in step B1), according to the dependency or mutually exclusive relationship between the configuration items expressed by the relationship description keywords through AND, OR, and NOT expression, a directed connection edge of the corresponding dependency relationship is established, and the configuration items on which each configuration item node depends are added to the dependency array of the configuration item node, including:

[0047] If the relationship description keyword "depend on" corresponds to the relationship description "B depend on A", the dependency relationship between the configuration items expressed is that configuration item B depends on configuration item A. The directed connection edge corresponding to the dependency relationship is established from configuration item B to configuration item A, and configuration item A is added to the dependency array of configuration item B.

[0048] If the relationship description keyword "depend on" corresponds to the relationship description "B depend on~A", the dependency relationship between the configuration items expressed is that configuration item B depends on configuration item~A, and a directed connection edge corresponding to the dependency relationship is established from configuration item B to configuration item A, and configuration item~A is added to the dependency array of configuration item B;

[0049] If the relationship description keyword "depend on" corresponds to the relationship description "B depend on A^A2", the dependency relationship between the configuration items expressed is that configuration item B depends on A and A2. A directed connection edge corresponding to the dependency relationship is established from configuration item B to configuration item A and A2, and configuration item A is added to the dependency array of configuration item B.

[0050] If the relationship description keyword "depend on" corresponds to the relationship description "B depend on AvA2", the dependency relationship between the configuration items expressed is that configuration item B depends on A or A2, and the directed connection edge corresponding to the dependency relationship is established from configuration item B to configuration item A and A2, and configuration item A is added to the dependency array of configuration item B;

[0051] If the relationship description keyword "depend on" corresponds to the relationship description "B depend on~A^A2", the dependency relationship between the configuration items expressed is that configuration item B depends on~A and A2, and a directed connection edge corresponding to the dependency relationship is established from configuration item B to configuration items A and A2, and configuration items~A and A2 are added to the dependency array of configuration item B;

[0052] If the relationship description keyword "depend on" corresponds to the relationship description "B depend on~AvA2", the dependency relationship between the configuration items expressed is that configuration item B depends on~A or A2, and the directed connection edge corresponding to the dependency relationship is established from configuration item B to configuration items A and A2, and configuration items~A and A2 are added to the dependency array of configuration item B;

[0053] If the relationship description keyword "choice" corresponds to the relationship description "choice AB", the mutually exclusive relationship between the configuration items expressed is to select configuration item A or configuration item B, and the directed connection edge that establishes the corresponding dependency relationship is the mutual reference between configuration item A and configuration item B;

[0054] If the relationship description keyword "choice" corresponds to the relationship description "choice ABC", the mutually exclusive relationship between the configuration items expressed is to select configuration item A, B or C, and the directed connection edge that establishes the corresponding dependency relationship is the mutual reference between configuration items A, B and C;

[0055] If the relationship description keyword "choice" corresponds to the relationship description "choice{Bi} n ", then the mutually exclusive relationship between the configuration items expressed is to select one of the n configuration items Bi, and the directed connection edge that establishes the corresponding dependency relationship is the mutual reference between the n configuration items Bi;

[0056] If the relationship description keyword "select" corresponds to the relationship description "A select B", the dependency relationship between the configuration items expressed is that configuration item B depends on configuration item A, and the directed connection edge of the corresponding dependency relationship is that configuration item B points to configuration item A2, and configuration item A is added to the dependency data of configuration item B;

[0057] If the relationship description corresponding to the relationship description keyword "select" is "A select B if A2", the dependency relationship between the configuration items expressed is that configuration item B depends on configuration item A and configuration item A2, and the directed connection edge of the corresponding dependency relationship is established from configuration item B to configuration item A and configuration item A2, and configuration item A and configuration item A2 are added to the dependency data of configuration item B;

[0058] If the relationship description keyword "visible if" corresponds to the relationship description "B visible if A", the dependency relationship between the configuration items expressed is that configuration item B depends on configuration item A, and the directed connection edge of the corresponding dependency relationship is that configuration item B points to configuration item A, and configuration item A is added to the dependency data of configuration item B;

[0059] If the relationship description keyword "visible if" corresponds to the relationship description "B visible if~A", the dependency relationship between the configuration items expressed is that configuration item B depends on configuration item~A, and the directed connection edge of the corresponding dependency relationship is that configuration item B points to configuration item A, and configuration item A is added to the dependency data of configuration item B;

[0060] If the relationship description keyword "imply" corresponds to the relationship description "A imply B", the dependency relationship between the configuration items expressed is that configuration item B depends on configuration item A, and the directed connection edge of the corresponding dependency relationship is that configuration item B points to configuration item A, and configuration item A is added to the dependency data of configuration item B;

[0061] If the relationship description keyword "imply" corresponds to the relationship description "A imply B if A2", the dependency relationship between the configuration items expressed is that configuration item B depends on configuration item A and configuration item A2. The directed connection edge of the corresponding dependency relationship is established from configuration item B to configuration item A and configuration item A2, and configuration item A and configuration item A2 are added to the dependency data of configuration item B.

[0062] Among them, “~” represents a negation operation, “^” represents an AND operation, and “v” represents an OR operation.

[0063] In addition, the present invention also provides a configuration item self-consistency detection system based on a relationship graph, comprising a microprocessor and a memory connected to each other, wherein the microprocessor is programmed or configured to execute the steps of the configuration item self-consistency detection method based on a relationship graph.

[0064] In addition, the present invention also provides a computer-readable storage medium, in which a computer program is stored. The computer program is used to be executed by a microprocessor to implement the steps of the configuration item self-consistency detection method based on the relationship diagram.

[0065] Compared with the prior art, the present invention mainly has the following advantages: the present invention is based on a configuration item relationship graph (nodes represent Linux configuration items, and edges between nodes represent pre-dependencies between nodes), so that according to the pre-conditions such as and, or, and not existing between the kernel configuration items in the configuration item relationship graph, the relationship between configuration items can be calculated through a graph calculation method, and the influence chain and direct and indirect influence domains of any configuration item can be determined, thereby realizing self-consistency detection of whether any configuration item set {C} to be detected is self-consistent, which can provide effective support for Linux kernel customization, meet the requirements of rapid kernel customization, and improve kernel configuration efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] Figure 1 The figure is a basic flow chart of a method according to a first embodiment of the present invention.

[0067] Figure 2 The figure is a schematic diagram of the process of calculating the influence domain in the first embodiment of the present invention.

[0068] Figure 3 The figure is a schematic diagram of a process of generating a minimum self-consistent configuration set in the first embodiment of the present invention.

[0069] Figure 4 The figure is a schematic diagram of the process of calculating the influence chain in the first embodiment of the present invention.

[0070] Figure 5 The figure is a schematic diagram of the process of generating a configuration item relationship diagram in the second embodiment of the present invention. DETAILED DESCRIPTION

[0071] Embodiment 1:

[0072] like Figure 1 As shown, the configuration item self-consistency detection method based on the relationship diagram of this embodiment includes:

[0073] 1) Determine the set of configuration items to be tested {C};

[0074] 2) If all configuration items of the configuration item set {C} have been detected, jump to step 6), otherwise, take out the first configuration item C1 that has not been detected from the configuration item set {C}; otherwise, jump to the next step;

[0075] 3) Determine whether the configuration item C1 is a leaf node in the preset configuration item relationship graph. If it is a leaf node, jump to step 2); otherwise, jump to the next step; the nodes in the configuration item relationship graph represent Linux configuration items, and the edges between the nodes represent the pre-dependency relationship between the nodes;

[0076] 4) Calculate the impact domain of configuration item C1 according to the preset configuration item relationship diagram;

[0077] 5) Check whether there are conflicting items in the influence domain of configuration item C1 in the configuration item set {C}. If there are no conflicting items, jump to step 2); otherwise, determine that the configuration item set {C} does not meet the self-consistency, end and exit; in this embodiment, after determining that the configuration item set {C} does not meet the self-consistency, it also includes outputting the conflicting item pair consisting of the configuration item C1 and the conflicting items in the influence domain of the configuration item C1 in the configuration item set {C}, so as to understand the conflict information of the configuration item set {C} to be detected.

[0078] 6) Determine whether the configuration item set {C} is self-consistent.

[0079] During the kernel configuration process, only some configuration items will be included. The set formed by these configuration items is a subset of the configuration items included in the configuration item relationship diagram. If the configuration item set contains configuration item A and any conflicting configuration item B in its impact domain and conditional conflicting configuration item B at the same time, the configuration item set is said to be inconsistent. List all configuration items {Ai} that cause the conflict and their impact domain conflicting configuration items {{Bij}}; if there is a conditional conflicting configuration item, check whether the condition is met.

[0080] The domain of influence of any configuration item C refers to all configuration items that will be affected by the existence of configuration item C. In this embodiment, it is expressed by an influence domain node array linked list, which records all configuration items that will be affected. Figure 2 As shown, step 4) in this embodiment includes:

[0081] 4.1) Get the name of configuration item C1;

[0082] 4.2) According to the name of the configuration item C1, query the corresponding configuration item node c1 in the preset configuration item relationship diagram;

[0083] 4.3) Initialize the influence domain node array list of configuration item node c1 to be empty;

[0084] 4.4) Determine whether the configuration item node c1 is a leaf node in the preset configuration item relationship diagram. If it is a leaf node, directly jump to step 4.9); otherwise, jump to the next step;

[0085] 4.5) All i nodes in the export relationship array of the configuration item node c1 form an impact domain array; the export relationship array records all configuration items that depend on the corresponding configuration item node. If any configuration item B is in the dependency array of configuration item A, the export relationship array of configuration item B contains configuration item A;

[0086] 4.6) If all the configuration item nodes in the impact domain array have been scanned, jump to step 4.9), otherwise take out the first unscanned configuration item node cc1 in the impact domain array;

[0087] 4.7) For the nodes in the export relationship array of the configuration item node cc1, remove the redundant nodes that already exist in the impact domain array and append them to the end of the impact domain node array linked list;

[0088] 4.8) Set the status of the configuration item node cc1 to scanned; jump to step 4.6);

[0089] 4.9) Output the influence domain node array linked list of the configuration item node c1 as the influence domain of the configuration item C1.

[0090] The export relationship array records all configuration items that depend on the corresponding configuration item node. If any configuration item B is in the dependency array of configuration item A, the export relationship array of configuration item B contains configuration item A. The export relationship array is the export domain of the configuration item. The configuration items directly exported by the configuration item represent the configuration items directly affected by the configuration item.

[0091] For any configuration item A, the derived domain of A under initial conditions is {A} DD Is empty, that is: {A} DD ={};

[0092] If B=>A, the derived domain of A is {A} DD ={B}|{A} DD ;

[0093] If B=>~A, the derived domain of A is {A} DD ={~B}|{A} DD ;

[0094] If B=>A^A2, then the derived domain of A is {A} DD ={B}|{A} DD ;

[0095] If B=>AvA2, then the derived domain of A is {A} DD ={B{~A2}}|{A} DD , represents the export domain under condition {~A2};

[0096] If B=>~A^A2, then the derived domain of A is {A} DD ={~B}|{A} DD ;

[0097] If B=>~AvA2, then the derived domain of A is {A} DD ={~B{~A2}}|{A} DD , represents the export domain under condition {~A2};

[0098] Among them, “=>” means dependence on, “|” means set merging, “~” means negation operation, “^” means and operation, and “v” means or operation. ID The calculation method is as follows:

[0099] Step 1: For any configuration item C, if the configuration item C is a leaf node and the impact domain is {}, return; otherwise, continue;

[0100] Step 2: For configuration item C, the influence domain of C under initial conditions {C} ID Defined as an export domainDD , that is: ID= {C} DD ; For any configuration item A in the export domain of C, calculate its impact domain {A} ID :

[0101] If B=>A, then the influence domain of B is {B} ID Add A's influence domain {A} ID ={A} ID |{B} ID ;

[0102] If B=>~A, then the influence domain of B is {B} ID Add A's influence domain {A} ID ={A} ID |{B} ID ;

[0103] If B=>A^A2, and A2 is a composite configuration item, then the impact domain of B is {B} ID Add to A's influence domain {A} ID ={A} ID |{B} DD ;

[0104] If B=>AV A2, A2 is a composite configuration item, then the impact domain of B {B} DD Under condition {~A2}, add the influence domain of A, expressed as {A} ID ={A} ID |{B {~A2}} DD .

[0105] If B=>~A^A2, A2 is a composite configuration item, then the impact domain of B {B} DD Add to A's influence domain {A} ID ={A} ID |{B} DD ;

[0106] If B=>~AV A2, A2 is a composite configuration item, then the impact domain of B {B} DD Under condition {~A2}, add the influence domain of A, expressed as {A} ID ={A} ID |{B {~A2}} DD .

[0107] Step 3: Summarize the impact domains of all configuration items in the export domain to obtain the configuration impact domain of C.

[0108] Among them, “=>” means dependence on, “|” means set merging, “~” means negation operation, “^” means and operation, and “v” means or operation.

[0109] As an optional implementation, this embodiment includes a step of generating a minimum self-consistent configuration set for the configuration item set {C} to be detected after step 6). Figure 3 As shown, the step of generating a minimum self-consistent configuration set for the configuration item set {C} to be detected in this embodiment includes:

[0110] A1) Initialize the new configuration set of configuration item set {C} to be empty;

[0111] A2) If all configuration items in the configuration item set {C} have been processed, jump to step A6), otherwise, take out the first unprocessed configuration item C1 from the configuration item set {C};

[0112] A3) Determine whether the configuration item C1 is a root node in the preset configuration item relationship diagram. If it is a root node, jump to step 2); otherwise, jump to the next step;

[0113] A4) Calculate the impact chain of configuration item C1 according to the preset configuration item relationship diagram;

[0114] A5) Remove redundancy from the configuration items in the impact chain of configuration item C1 and add them to the new configuration set, and jump to step A2);

[0115] A6) Output the new configuration set as the minimum self-consistent configuration set of the configuration item set {C}.

[0116] Considering that generating the minimum self-consistent configuration set for the configuration item set {C} to be tested can be executed independently and does not necessarily depend on the execution after step 6), it is necessary to perform a self-consistency analysis on the specified configuration item set {Ai} before step A1). If there is a configuration item conflict pair set, return and report an error that the configuration set is not self-consistent.

[0117] Step A5) is used to remove the redundancy of the configuration items in the influence chain of the configuration item C1 and add them to the new configuration set, and then add all the configuration items in its configuration influence chain that are not in the configuration set to the new configuration set. For any configuration item Ai in the configuration set, all the configuration items {Bij} in its configuration influence chain that are not in the configuration set are added to the newly added configuration set. The rules for adding configuration items to the newly added configuration set according to the configuration influence chain are as follows: If B2 has an influence chain {A} IC ->B1, then {A} IC The configuration items in the chain are added to the configuration set; if B2 has conditions that affect the chain <{A1} IC > {~A2} ->B1, judge whether condition A2 is true, if not, {A1}IC The configuration items in the chain are added to the configuration set. Repeat the above operation until no new configuration items are added, and finally output the new configuration set as the minimum self-consistent configuration set of the configuration item set {C}. In this embodiment, generating a minimum self-consistent configuration set for the configuration item set {C} to be detected requires a self-consistency analysis of the configuration item set {C} in advance. If there is no conflict, a self-consistent set is obtained. If there is a conflict, all configuration items {Ai} that cause the conflict and their impact domain configuration items {{Bij}} are listed, and the configuration items that cause the conflict are deleted according to user requirements. The self-consistency test is submitted until a self-consistent set is obtained.

[0118] The influence chain of a configuration item is a chain formed by all configuration items that affect the enabling of the configuration item. Figure 4 As shown, step A4) includes:

[0119] A4.1) Obtain the name of configuration item C1;

[0120] A4.2) According to the name of the configuration item C1, query the corresponding configuration item node c1 in the preset configuration item relationship diagram;

[0121] A4.3) Initialize the influence chain node array list of configuration item node c1 to be empty, which can be represented as {c1} IC =->;

[0122] A4.4) Determine whether the configuration item node c1 is a root node in the preset configuration item relationship diagram. If it is a root node, directly jump to step A4.9); otherwise, jump to the next step;

[0123] A4.5) forming an influence chain array with all i nodes in the dependency array of the configuration item node c1, where the dependency array refers to the set of configuration items that the configuration item node c1 depends on;

[0124] A4.6) If the end of the impact chain array has been reached, jump to step A4.9), otherwise take out the first unscanned configuration item node cc1 in the impact chain array;

[0125] A4.7) For the nodes in the dependency array of the configuration item node cc1, remove the redundant nodes that already exist in the influence chain array and append them to the end of the influence chain node array linked list;

[0126] A4.8) Set the status of the configuration item node cc1 to scanned; jump to step A4.6);

[0127] A4.9) Output the influence chain node array list of configuration item node c1 as the influence chain of configuration item C1.

[0128] In this embodiment, by introducing the influence chain of configuration items, it is possible to support rapid query of related item information of kernel configuration items; by introducing the influence domain, it is possible to support self-consistency detection of kernel configuration sets; by introducing the influence chain and influence domain, it is possible to support the generation of minimum self-consistency detection of specified kernel configuration sets.

[0129] Considering that the configuration item node c1 contains two characters, for the sake of simplicity, here we take any configuration item B as an example, the influence chain {B} for any configuration item B IC Let's take an example:

[0130] Step 1: If configuration item B is the root node, the impact chain {B} IC If it is empty, return; otherwise continue;

[0131] Step 2: Under initial conditions, the influence chain {B} of any configuration item B IC =->;

[0132] If B=>A, then {A} IC ->B forms an influence chain of B, represented by {B} IC ={A} IC ->B

[0133] If B=>~A, then {~A} IC ->B forms an influence chain of B, represented by {B} IC ={~A} IC ->B

[0134] If B=>A^A2, then <{A} IC >->B forms an influence chain of B, represented by {B} IC ={A} IC ->B

[0135] If B=>AvA2, then {A1} IC ->B forms a conditional influence chain of B, denoted as {B} IC =<{A {~A2}} IC >->B;

[0136] If B=>~A^A2, then <{~A} IC >->B forms an influence chain of B, represented by {B} IC ={~A} IC ->B

[0137] If B=>~AvA2, then {~A1} IC ->B forms a conditional influence chain of B, denoted as {B} IC =<{~A {~A2}}IC >->B;

[0138] Among them, the superscript {~A2} Indicates the case under condition {~A2}.

[0139] In addition, this embodiment also provides a configuration item self-consistency detection system based on a relationship graph, including a microprocessor and a memory connected to each other, and the microprocessor is programmed or configured to execute the steps of the aforementioned configuration item self-consistency detection method based on a relationship graph.

[0140] In addition, this embodiment further provides a computer-readable storage medium, in which a computer program is stored. The computer program is used to be executed by a microprocessor to implement the steps of the aforementioned configuration item self-consistency detection method based on a relationship diagram.

[0141] Embodiment 2:

[0142] This embodiment is basically the same as the first embodiment, the main difference being that it also includes a step of pre-generating a configuration item relationship diagram.

[0143] The configuration item keywords in Kconfig include config, menuconfig, menu, source, and choice. The config and menuconfig keywords represent the actual configuration items in the kernel. The remaining configuration item keywords such as source, menu, and choice are mainly used for structure control and relationship auxiliary description. The types of configuration item keywords and the properties they contain are detailed in Table 1.

[0144] Table 1: Information table of configuration item keyword list.

[0145]

[0146] In this embodiment, a configuration item node CNode is established for the configuration item keyword in the kernel configuration control file Kconfig to obtain a kernel configuration node set. Since the configuration item keyword source contains a nested configuration item file name, the nested configuration item file is also a type of Linux kernel configuration control file Kconfig, the configuration item keyword source is ignored in this embodiment.

[0147] like Figure 4 As shown, in this embodiment, before step 3), the step of pre-generating a configuration item relationship diagram is also included:

[0148] B1) Scan and read the Linux kernel configuration control file Kconfig, establish corresponding configuration item nodes CNode for the configuration item keywords "config", "menuconfig", "menu" and "choice" in the kernel configuration control file Kconfig, and for each configuration item node CNode, for the configuration item node CNode corresponding to the configuration item keyword "config", add a configuration item node to the configuration item represented by the relationship description keyword specified under the configuration item keyword "config", and establish a directed connection edge corresponding to the dependency relationship according to the dependency or mutual exclusion relationship between the configuration items expressed by the relationship description keyword through AND, OR, or non-expression, and add the configuration items that each configuration item node depends on to the dependency array of the configuration item node; for the configuration item nodes CNode corresponding to the configuration item keywords "menuconfig", "menu" and "choice", establish configuration item nodes for the configuration items under the corresponding configuration item keywords step by step, and establish directed connection edges corresponding to the dependency relationship between the configuration item nodes at all levels and their subordinate configuration item nodes;

[0149] B2) According to all configuration item nodes, according to whether there are connecting edges and the directions of the connecting edges, each kernel configuration item node is divided into a root node, a stem node and a leaf node, wherein the in-degree of the root node is 0, the out-degree and in-degree of the stem node are not 0, and the out-degree of the leaf node is 0, thereby obtaining a configuration item relationship graph; according to the dependency array of each configuration item node in the configuration item relationship graph, a corresponding export relationship array is generated, so that if any configuration item B is in the dependency array of configuration item A, then configuration item A is added to the export relationship array of configuration item B.

[0150] The kernel configuration control file Kconfig contains attribute keywords such as depend and select that are related to the dependency relationship of kernel configuration items, as well as relationship description keywords of auxiliary classes such as choice, menu, and menuconfig. These keywords indicate the dependency and mutual exclusion relationship between kernel configuration items. The relationship description keywords included and the relationship types they define are shown in Table 2.

[0151] Table 2: Definition table of relationship description keywords.

[0152] Relationship Type Remark depend on Indicates that there is a dependency relationship between configuration items select Simply select, without distinguishing whether there is an if, indicates that there is a weak reverse dependency between configuration items visible if Same as depend on imply Same as select, a weak reverse dependency choice There is a mutual exclusion relationship between the subordinate node configuration items of choice menu Subordinate nodes of menu menuconfig Subordinate nodes of menuconfig

[0153] For each dependency relationship represented by the above-mentioned relationship description keywords in the kernel configuration file Kconfig, a combined pre-relation connection of AND, OR, NOT, etc. is established between the kernel configuration items. According to the relationship description keywords related to the dependency relationship of the kernel configuration items such as depend, choice, select, etc. in the kernel configuration control file Kconfig, the relationship between nodes can be established according to the semantics of the above-mentioned relationship description keywords. Among the relationship types, "depend on", "select", "visibleif", "choice" and "imply" determine the dependency and mutually exclusive relationship between the config configuration items. Therefore, the relationship description keywords specified under the configuration item keyword "config" in step B1) of this embodiment include "depend on", "select", "visible if", "choice" and "imply".

[0154] In this embodiment, A, B, Bi and C are different arbitrary configuration items, Bi is one of an arbitrary group of n configuration items, A2 is a composite configuration item including a single configuration item A or a composite configuration item of configuration item A, and the composite configuration item of configuration item A is a negation operation of configuration item A, an OR operation of configuration item A and any configuration item B, or an AND operation of configuration item A and any configuration item B; in step B1), according to the dependency or mutually exclusive relationship between the configuration items expressed by the relationship description keywords through AND, OR, and NOT expression, a directed connection edge of the corresponding dependency relationship is established, and the configuration items on which each configuration item node depends are added to the dependency array of the configuration item node, including:

[0155] If the relationship description keyword "depend on" corresponds to the relationship description "B depend on A", the dependency relationship between the configuration items expressed is that configuration item B depends on configuration item A. The directed connection edge corresponding to the dependency relationship is established from configuration item B to configuration item A, and configuration item A is added to the dependency array of configuration item B.

[0156] If the relationship description keyword "depend on" corresponds to the relationship description "B depend on~A", the dependency relationship between the configuration items expressed is that configuration item B depends on configuration item~A, and a directed connection edge corresponding to the dependency relationship is established from configuration item B to configuration item A, and configuration item~A is added to the dependency array of configuration item B;

[0157] If the relationship description keyword "depend on" corresponds to the relationship description "B depend on A^A2", the dependency relationship between the configuration items expressed is that configuration item B depends on A and A2. A directed connection edge corresponding to the dependency relationship is established from configuration item B to configuration item A and A2, and configuration item A is added to the dependency array of configuration item B.

[0158] If the relationship description keyword "depend on" corresponds to the relationship description "B depend on AvA2", the dependency relationship between the configuration items expressed is that configuration item B depends on A or A2, and the directed connection edge corresponding to the dependency relationship is established from configuration item B to configuration item A and A2, and configuration item A is added to the dependency array of configuration item B;

[0159] If the relationship description keyword "depend on" corresponds to the relationship description "B depend on~A^A2", the dependency relationship between the configuration items expressed is that configuration item B depends on~A and A2, and a directed connection edge corresponding to the dependency relationship is established from configuration item B to configuration items A and A2, and configuration items~A and A2 are added to the dependency array of configuration item B;

[0160] If the relationship description keyword "depend on" corresponds to the relationship description "B depend on~AvA2", the dependency relationship between the configuration items expressed is that configuration item B depends on~A or A2, and the directed connection edge corresponding to the dependency relationship is established from configuration item B to configuration items A and A2, and configuration items~A and A2 are added to the dependency array of configuration item B;

[0161] The definition methods of the relationship descriptions corresponding to the above-mentioned relationship description keywords “depend on” are shown in Table 3.

[0162] Table 3: Definitions corresponding to the relationship description of “depend on”.

[0163]

[0164]

[0165] If the relationship description keyword "choice" corresponds to the relationship description "choice AB", the mutually exclusive relationship between the configuration items expressed is to select configuration item A or configuration item B, and the directed connection edge that establishes the corresponding dependency relationship is the mutual reference between configuration item A and configuration item B;

[0166] If the relationship description keyword "choice" corresponds to the relationship description "choice ABC", the mutually exclusive relationship between the configuration items expressed is to select configuration item A, B or C, and the directed connection edge that establishes the corresponding dependency relationship is the mutual reference between configuration items A, B and C;

[0167] If the relationship description keyword "choice" corresponds to the relationship description "choice{Bi} n", then the mutually exclusive relationship between the configuration items expressed is to select one of the n configuration items Bi, and the directed connection edge that establishes the corresponding dependency relationship is the mutual reference between the n configuration items Bi;

[0168] The definition methods of the relationship descriptions corresponding to the above-mentioned relationship description keywords “choice” are shown in Table 4.

[0169] Table 4: Definitions corresponding to the relationship description of “choice”.

[0170]

[0171] If the relationship description keyword "select" corresponds to the relationship description "A select B", the dependency relationship between the configuration items expressed is that configuration item B depends on configuration item A, and the directed connection edge of the corresponding dependency relationship is that configuration item B points to configuration item A2, and configuration item A is added to the dependency data of configuration item B;

[0172] If the relationship description corresponding to the relationship description keyword "select" is "A select B if A2", the dependency relationship between the configuration items expressed is that configuration item B depends on configuration item A and configuration item A2, and the directed connection edge of the corresponding dependency relationship is established from configuration item B to configuration item A and configuration item A2, and configuration item A and configuration item A2 are added to the dependency data of configuration item B;

[0173] The definition methods of the relationship descriptions corresponding to the above-mentioned relationship description keywords "select" are shown in Table 5.

[0174] Table 5: Definitions corresponding to the relationship description of “select”.

[0175]

[0176] If the relationship description keyword "visible if" corresponds to the relationship description "B visible if A", the dependency relationship between the configuration items expressed is that configuration item B depends on configuration item A, and the directed connection edge of the corresponding dependency relationship is that configuration item B points to configuration item A, and configuration item A is added to the dependency data of configuration item B;

[0177] If the relationship description keyword "visible if" corresponds to the relationship description "B visible if~A", the dependency relationship between the configuration items expressed is that configuration item B depends on configuration item~A, and the directed connection edge of the corresponding dependency relationship is that configuration item B points to configuration item A, and configuration item A is added to the dependency data of configuration item B;

[0178] The definition methods of the relationship descriptions corresponding to the above-mentioned relationship description keywords “visible if” are shown in Table 6.

[0179] Table 6: Definitions of the relationships corresponding to “visible if”.

[0180]

[0181] If the relationship description keyword "imply" corresponds to the relationship description "Aimply B", the dependency relationship between the configuration items expressed is that configuration item B depends on configuration item A, and the directed connection edge of the corresponding dependency relationship is that configuration item B points to configuration item A, and configuration item A is added to the dependency data of configuration item B;

[0182] If the relationship description keyword "imply" corresponds to the relationship description "A imply B if A2", the dependency relationship between the configuration items expressed is that configuration item B depends on configuration item A and configuration item A2. The directed connection edge of the corresponding dependency relationship is established from configuration item B to configuration item A and configuration item A2, and configuration item A and configuration item A2 are added to the dependency data of configuration item B.

[0183] The definition methods of the relationship descriptions corresponding to the above-mentioned relationship description keywords “imply” are shown in Table 7.

[0184] Table 7: Definitions of the relationships corresponding to “imply”.

[0185]

[0186]

[0187] Among them, “~” represents a negation operation, “^” represents an AND operation, and “v” represents an OR operation.

[0188] Finally, according to whether there is a connection in the configuration item node and the direction of the connection, the configuration item node is divided into three types of configuration nodes: root node (in-degree is 0), stem node (in-degree and out-degree are not 0), and leaf node (out-degree is 0). Among them, in-degree refers to the number of edges introduced by the node, and out-degree refers to the number of edges led out of the node. In this embodiment, according to the definition corresponding to the relationship description corresponding to the relationship description keyword "choice", its configuration item set is independently clustered and the in-degree and out-degree are not 0, so this type of stem node is differentiated and defined as a cluster stem node. The above operation is performed on all configuration items in the same kernel version to obtain a configuration item relationship graph Gcdep, in which there is a pre-relationship formed by combinations of and, or, and non between kernel configuration item nodes. The configuration item relationship graph takes the configuration item as a node in the graph. If there is a pre-dependency relationship between any configuration item A and configuration item B, a signed directed edge is connected between configuration item A and configuration item B, indicating that configuration item A depends on configuration item B due to the pre-relationship.

[0189] In addition, this embodiment also provides a configuration item self-consistency detection system based on a relationship graph, including a microprocessor and a memory connected to each other, and the microprocessor is programmed or configured to execute the steps of the aforementioned configuration item self-consistency detection method based on a relationship graph.

[0190] In addition, this embodiment further provides a computer-readable storage medium, in which a computer program is stored. The computer program is used to be executed by a microprocessor to implement the steps of the aforementioned configuration item self-consistency detection method based on a relationship diagram.

[0191] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may take the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes. The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, may be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the functions in the process. Figure 1 A process or multiple processes and / or boxes Figure 1These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0192] The above is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.

Claims

1. A method for detecting self-consistency of configuration items based on a relationship diagram, characterized in that: include: 1) Determine the set of configuration items to be tested {C}; 2) If all configuration items of the configuration item set {C} have been detected, jump to step 6), otherwise, take out the first configuration item C1 that has not been detected from the configuration item set {C}; otherwise, jump to the next step; 3) Determine whether the configuration item C1 is a leaf node in the preset configuration item relationship graph. If it is a leaf node, jump to step 2); otherwise, jump to the next step; the nodes in the configuration item relationship graph represent Linux configuration items, and the edges between the nodes represent the pre-dependency relationship between the nodes; 4) Calculate the impact domain of configuration item C1 according to the preset configuration item relationship diagram; 5) Check whether the impact domain of configuration item C1 has conflicting items in the configuration item set {C}. If there are no conflicting items, jump to step 2); otherwise, determine that the configuration item set {C} does not meet the self-consistency, end and exit; 6) Determine whether the configuration item set {C} is self-consistent.

2. The method for detecting self-consistency of configuration items based on a relationship graph according to claim 1, characterized in that: Step 4) includes: 4.1) Get the name of configuration item C1; 4.2) According to the name of the configuration item C1, query the corresponding configuration item node c1 in the preset configuration item relationship diagram; 4.3) Initialize the influence domain node array list of configuration item node c1 to be empty; 4.4) Determine whether the configuration item node c1 is a leaf node in the preset configuration item relationship diagram. If it is a leaf node, directly jump to step 4.9); otherwise, jump to the next step; 4.5) All i nodes in the export relationship array of the configuration item node c1 form an influence domain array; the export relationship array records all configuration items that depend on the corresponding configuration item node. If any configuration item B is in the dependency array of configuration item A, the export relationship array of configuration item B contains configuration item A; 4.6) If all the configuration item nodes in the impact domain array have been scanned, jump to step 4.9), otherwise take out the first unscanned configuration item node cc1 in the impact domain array; 4.7) For the nodes in the export relationship array of the configuration item node cc1, remove the redundant nodes that already exist in the impact domain array and append them to the end of the impact domain node array linked list; 4.8) Set the status of the configuration item node cc1 to scanned; jump to step 4.6); 4.9) Output the influence domain node array linked list of the configuration item node c1 as the influence domain of the configuration item C1.

3. The method for detecting self-consistency of configuration items based on a relationship graph according to claim 1, characterized in that: Step 6) includes the step of generating a minimum self-consistent configuration set for the configuration item set {C} to be detected.

4. The method for detecting self-consistency of configuration items based on a relationship graph according to claim 3, characterized in that: The step of generating a minimum self-consistent configuration set for the configuration item set {C} to be detected comprises: A1) Initialize the new configuration set of configuration item set {C} to be empty; A2) If all configuration items in the configuration item set {C} have been processed, jump to step A6), otherwise, take out the first unprocessed configuration item C1 from the configuration item set {C}; A3) Determine whether the configuration item C1 is a root node in the preset configuration item relationship diagram. If it is a root node, jump to step 2); otherwise, jump to the next step; A4) Calculate the impact chain of configuration item C1 according to the preset configuration item relationship diagram; A5) removing redundancy from the configuration items in the impact chain of the configuration item C1 and adding them to the new configuration set, and jumping to step A2); A6) Output the new configuration set as the minimum self-consistent configuration set of the configuration item set {C}.

5. The method for detecting self-consistency of configuration items based on relationship graph according to claim 4, characterized in that: Step A4) comprises: A4.1) Obtain the name of configuration item C1; A4.2) According to the name of the configuration item C1, query the corresponding configuration item node c1 in the preset configuration item relationship diagram; A4.3) Initialize the influence chain node array list of configuration item node c1 to be empty; A4.4) Determine whether the configuration item node c1 is a root node in the preset configuration item relationship diagram. If it is a root node, directly jump to step A4.9); otherwise, jump to the next step; A4.5) forming an influence chain array with all i nodes in the dependency array of the configuration item node c1, where the dependency array refers to the set of configuration items that the configuration item node c1 depends on; A4.6) If the end of the impact chain array has been reached, jump to step A4.9), otherwise take out the first unscanned configuration item node cc1 in the impact chain array; A4.7) For the nodes in the dependency array of the configuration item node cc1, remove the redundant nodes that already exist in the influence chain array and append them to the end of the influence chain node array linked list; A4.8) Set the status of the configuration item node cc1 to scanned; jump to step A4.6); A4.9) Output the influence chain node array list of configuration item node c1 as the influence chain of configuration item C1.

6. The method for detecting self-consistency of configuration items based on relationship graph according to claim 1, characterized in that: Before step 3), there is also a step of pre-generating a configuration item relationship diagram: B1) Scan and read the Linux kernel configuration control file Kconfig, and establish corresponding configuration item nodes CNode for the configuration item keywords "config", "menuconfig", "menu" and "choice" in the kernel configuration control file Kconfig respectively; for each configuration item node CNode, for the configuration item node CNode corresponding to the configuration item keyword "config", add a configuration item node to the configuration item represented by the relationship description keyword specified under the configuration item keyword "config", and establish a directed connection edge of the corresponding dependency relationship according to the dependency or mutual exclusion relationship between the configuration items expressed by the relationship description keyword through AND, OR, or non-expression, and add the configuration items that each configuration item node depends on to the dependency array of the configuration item node; for the configuration item nodes CNode corresponding to the configuration item keywords "menuconfig", "menu" and "choice", establish configuration item nodes for the configuration items under the corresponding configuration item keywords step by step, and establish directed connection edges corresponding to the dependency relationship between the configuration item nodes at all levels and their subordinate configuration item nodes; B2) According to all configuration item nodes, each kernel configuration item node is divided into a root node, a stem node and a leaf node according to whether there is a connection edge and the direction of the connection edge, wherein the in-degree of the root node is 0, the out-degree and in-degree of the stem node are not 0, and the out-degree of the leaf node is 0, thereby obtaining a configuration item relationship graph; according to the dependency array of each configuration item node in the configuration item relationship graph, a corresponding export relationship array is generated, so that if any configuration item B is in the dependency array of configuration item A, then configuration item A is added to the export relationship array of configuration item B.

7. The method for detecting self-consistency of configuration items based on a relationship graph according to claim 6, characterized in that: The relationship description keywords specified under the configuration item keyword "config" in step B1) include "depend on", "select", "visibleif", "choice" and "imply".

8. The method for detecting self-consistency of configuration items based on a relationship graph according to claim 7, characterized in that: A, B, Bi and C are different arbitrary configuration items, Bi is one of an arbitrary group of n configuration items, A2 is a composite configuration item containing a single configuration item A or a configuration item A, and the composite configuration item of the configuration item A is a negation operation of the configuration item A, an or operation of the configuration item A and any configuration item B, or an and operation of the configuration item A and any configuration item B; in step B1), according to the dependency or mutually exclusive relationship between the configuration items expressed by the relationship description keywords through and, or, or not, a directed connection edge corresponding to the dependency relationship is established, and the configuration items on which each configuration item node depends are added to the dependency array of the configuration item node, including: If the relationship description keyword "depend on" corresponds to the relationship description "B depend on A", the dependency relationship between the configuration items expressed is that configuration item B depends on configuration item A, and a directed connection edge corresponding to the dependency relationship is established from configuration item B to configuration item A, and configuration item A is added to the dependency array of configuration item B; If the relationship description keyword "depend on" corresponds to the relationship description "B depend on~A", the dependency relationship between the configuration items expressed is that configuration item B depends on configuration item~A, and a directed connection edge corresponding to the dependency relationship is established from configuration item B to configuration item A, and configuration item~A is added to the dependency array of configuration item B; If the relationship description keyword "depend on" corresponds to the relationship description "B depend on A^A2", the dependency relationship between the configuration items expressed is that configuration item B depends on A and A2, and a directed connection edge corresponding to the dependency relationship is established from configuration item B to configuration item A and A2, and configuration item A is added to the dependency array of configuration item B; If the relationship description keyword "depend on" corresponds to the relationship description "B depend on AvA2", the dependency relationship between the configuration items expressed is that configuration item B depends on A or A2, and the directed connection edge corresponding to the dependency relationship is established from configuration item B to configuration item A and A2, and configuration item A is added to the dependency array of configuration item B; If the relationship description keyword "depend on" corresponds to the relationship description "B depend on~A^A2", the dependency relationship between the configuration items expressed is that configuration item B depends on~A and A2, and a directed connection edge corresponding to the dependency relationship is established from configuration item B to configuration items A and A2, and configuration items~A and A2 are added to the dependency array of configuration item B; If the relationship description keyword "depend on" corresponds to the relationship description "B depend on~AvA2", the dependency relationship between the configuration items expressed is that configuration item B depends on~A or A2, and the directed connection edge corresponding to the dependency relationship is established from configuration item B to configuration items A and A2, and configuration items~A and A2 are added to the dependency array of configuration item B; If the relationship description keyword "choice" corresponds to the relationship description "choice AB", the mutually exclusive relationship between the configuration items expressed is to select configuration item A or configuration item B, and the directed connection edge that establishes the corresponding dependency relationship is the mutual reference between configuration item A and configuration item B; If the relationship description keyword "choice" corresponds to the relationship description "choice ABC", the mutually exclusive relationship between the configuration items expressed is to select configuration item A, B or C, and the directed connection edge that establishes the corresponding dependency relationship is the mutual reference between configuration items A, B and C; If the relationship description keyword "choice" corresponds to the relationship description "choice{Bi} n ", then the mutually exclusive relationship between the configuration items expressed is to select one of the n configuration items Bi, and the directed connection edge that establishes the corresponding dependency relationship is the mutual reference between the n configuration items Bi; If the relationship description keyword "select" corresponds to the relationship description "A select B", the dependency relationship between the configuration items expressed is that configuration item B depends on configuration item A, and the directed connection edge of the corresponding dependency relationship is from configuration item B to configuration item A2, and configuration item A is added to the dependency data of configuration item B; If the relationship description keyword "select" corresponds to the relationship description "A select B if A2", the dependency relationship between the configuration items expressed is that configuration item B depends on configuration item A and configuration item A2. The directed connection edge of the corresponding dependency relationship is established from configuration item B to configuration item A and configuration item A2, and configuration item A and configuration item A2 are added to the dependency data of configuration item B. If the relationship description keyword "visible if" corresponds to the relationship description "B visible if A", the dependency relationship between the configuration items expressed is that configuration item B depends on configuration item A, and the directed connection edge of the corresponding dependency relationship is that configuration item B points to configuration item A, and configuration item A is added to the dependency data of configuration item B; If the relationship description keyword "visible if" corresponds to the relationship description "B visible if~A", the dependency relationship between the configuration items expressed is that configuration item B depends on configuration item~A, and the directed connection edge of the corresponding dependency relationship is that configuration item B points to configuration item A, and configuration item A is added to the dependency data of configuration item B; If the relationship description keyword "imply" corresponds to the relationship description "A imply B", the dependency relationship between the configuration items expressed is that configuration item B depends on configuration item A, and the directed connection edge of the corresponding dependency relationship is that configuration item B points to configuration item A, and configuration item A is added to the dependency data of configuration item B; If the relationship description keyword "imply" corresponds to the relationship description "A imply B if A2", the dependency relationship between the configuration items expressed is that configuration item B depends on configuration item A and configuration item A2. The directed connection edge of the corresponding dependency relationship is established from configuration item B to configuration item A and configuration item A2, and configuration item A and configuration item A2 are added to the dependency data of configuration item B; Among them, "~" represents a negation operation, "^" represents an AND operation, and "v" represents an OR operation.

9. A configuration item self-consistency detection system based on a relationship diagram, comprising a microprocessor and a memory connected to each other, characterized in that: The microprocessor is programmed or configured to execute the steps of the configuration item self-consistency detection method based on the relationship graph as described in any one of claims 1 to 8.

10. A computer-readable storage medium storing a computer program, characterized in that: The computer program is used to be executed by a microprocessor to implement the steps of the configuration item self-consistency detection method based on a relationship graph as described in any one of claims 1 to 8.