CN114791865A - Method, system and medium for detecting self-consistency of configuration items based on relational graph - Google Patents

Method, system and medium for detecting self-consistency of configuration items based on relational graph Download PDF

Info

Publication number
CN114791865A
CN114791865A CN202210346626.2A CN202210346626A CN114791865A CN 114791865 A CN114791865 A CN 114791865A CN 202210346626 A CN202210346626 A CN 202210346626A CN 114791865 A CN114791865 A CN 114791865A
Authority
CN
China
Prior art keywords
configuration item
configuration
relation
dependency
item
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210346626.2A
Other languages
Chinese (zh)
Inventor
秦莹
张瑞民
张韧锐
郝宇涵
郝晓博
蔡华松
伍林
阳娅婧
周聪
王楠
田治东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
National University of Defense Technology
Original Assignee
National University of Defense Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by National University of Defense Technology filed Critical National University of Defense Technology
Priority to CN202210346626.2A priority Critical patent/CN114791865A/en
Publication of CN114791865A publication Critical patent/CN114791865A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/142Reconfiguring to eliminate the error
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2273Test methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2284Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing by power-on test, e.g. power-on self test [POST]

Abstract

The invention discloses a method, a system and a medium for detecting the self-consistency of configuration items based on a relational graph, wherein the method comprises the steps of determining the configuration item set { C } to be detected and the configuration item C1 of a traversed configuration item set { C }, 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 relational graph, checking whether a conflict item exists in the configuration item set { C } by the influence domain of the configuration item C1, and if the conflict item does not exist, continuing traversing; otherwise, judging that the configuration item set { C } is not in accordance with self-consistency, outputting the conflict item pair, ending and exiting; and judging that the configuration item set { C } accords with self consistency after traversing is finished. The method can realize self-consistency detection for whether any configuration item set { C } to be detected is self-consistent or not based on the configuration item relation diagram, can provide effective support for Linux kernel customization, meets the requirement of fast kernel customization, and improves kernel configuration efficiency.

Description

Method, system and medium for detecting self-consistency of configuration items based on relational graph
Technical Field
The invention relates to an operating system kernel configuration auxiliary technology, in particular to a method, a system and a medium for detecting self consistency of configuration items based on a relational graph.
Background
Since its birth in 1991 to date, due to the development of nearly 30 years, Linux has occupied a place in information systems, and there are about hundreds of Linux distribution versions in the world, which operate in sensors as small as, and supercomputers as large as, from daily necessities such as smart phones, watches, and automobiles to various types of electronic devices such as spacecrafts. In the process of deploying various electronic devices, the kernel of the Linux operating system needs to be customized according to the hardware system and the application requirements so as to support various hardware, meet the system requirements of real time, reliability and the like, and be an important link for ensuring the correct operation of the system.
As one of the open source communities of great interest, the Linux kernel community is very active, where thousands of developers participate, and various types of mechanisms, features, and device support code are submitted continuously. Taking version 5.8 as an example, the kernel contains 69,325 files and 28,442,673 lines of code that construct the 15000+ kernel mechanism and properties. In order to meet flexible support for multiple types of software and hardware requirements, a kernel developer defines various characteristics contained in a kernel in a configuration item mode, and kernel characteristics such as device support, a core mechanism and the like are represented as 15000 configuration items. The kernel developer clearly defines the configuration items in a kernel configuration metafile Kconfig, and the configuration kernel program presents the configuration items to a kernel system customizer in the form of a configuration menu for selecting which configurations need to be effective, so as to support a system designer to construct a kernel image and a module supporting various software and hardware systems through the combination of the configuration items. Customization of the kernel is embodied as the process of determining a set of configuration items.
As an organic whole, dependency and mutual exclusion relationships exist between mechanisms and characteristics in the kernel, which are expressed as dependency, mutual exclusion and other relationships between configuration items and/or between non-combination items, and the kernel needs to make a trade-off between the configuration items according to the dependency and mutual exclusion relationships when in configuration. The kernel configuration becomes a very complicated and complicated matter because a complex relationship diagram is formed by a huge number of configuration items and the dependent and exclusive relationships between the configuration items and/or the non-combination of the configuration items. For example, when the configuration item a is opened, the configuration item B mutually exclusive to the configuration item a is closed, and the configuration item B affects the configuration item C and further affects the configuration item D; because the association arc between a and D is long, the configuration influence often needs several backtrails to be confirmed, and the configuration efficiency is seriously influenced, so that it is a real need to quickly locate the relevant configuration items influencing the configuration items. In addition, in the system configuration process, some specific characteristics are often required to be supported, and the generation of a self-consistent configuration item set based on one or more specified characteristic configuration items is also a situation that needs to be handled frequently in the actual kernel customization process.
Disclosure of Invention
The technical problems to be solved by the invention are as follows: the invention provides a method, a system and a medium for detecting the self-consistency of configuration items based on a relational graph, aiming at the problems in the prior art, and the method, the system and the medium are based on the relational graph of the configuration items (nodes represent the configuration items of Linux, edges between the nodes represent the pre-dependency between the nodes), so that the relation calculation between the configuration items can be realized by a graph calculation method according to the and, or, non-equal precondition existing between the configuration items of a kernel in the relational graph of the configuration items, the influence chain and the direct and indirect influence domain of any configuration item can be determined, the self-consistency detection of whether any configuration item set { C } to be detected is self-consistent can be realized, the effective support can be provided for Linux kernel customization, the requirement of fast kernel customization can be met, and the kernel configuration efficiency can be improved.
In order to solve the technical problems, the technical scheme adopted by the invention is as follows:
a method for detecting self-consistency of configuration items based on a relation graph comprises the following steps:
1) determining a configuration item set { C } to be detected;
2) if all the configuration items in the configuration item set { C } are detected, jumping to step 6), otherwise, taking out the first configuration item C1 which is not detected yet from the configuration item set { C }; otherwise, skipping to the next step;
3) judging whether the configuration item C1 is a leaf node in a preset configuration item relation graph, and if the configuration item C1 is the leaf node, jumping to the step 2); otherwise, skipping to the next step; nodes in the configuration item relation graph represent configuration items of Linux, and edges among the nodes represent a front dependency relation among the nodes;
4) calculating the influence domain of the configuration item C1 according to a preset configuration item relation diagram;
5) checking whether the influence domain of the configuration item C1 has a conflict item in the configuration item set { C }, and if not, jumping to the step 2); otherwise, judging that the configuration item set { C } is not consistent with self-consistency, ending and exiting;
6) the set of decision configuration items C is self consistent.
Optionally, step 4) comprises:
4.1) obtaining the name of the configuration item C1;
4.2) inquiring a corresponding configuration item node C1 in a preset configuration item relation graph according to the name of the configuration item C1;
4.3) initializing the influence domain node array linked list of the configuration item node c1 to be null;
4.4) judging whether the configuration item node c1 is a leaf node in the preset configuration item relation graph, and if so, directly jumping to the step 4.9); otherwise, skipping to the next step;
4.5) forming an influence domain array by all i nodes in the derivation relation array of the configuration item node c 1; the export relation array records all configuration items depending on the corresponding configuration item nodes, and if any configuration item B is in the dependency array of the configuration item A, the export relation array of the configuration item B contains the configuration item A;
4.6) if all the configuration item nodes of the influence domain array are scanned completely, skipping to the step 4.9), otherwise, taking out the first un-scanned configuration item node cc1 in the influence domain array;
4.7) for nodes in the export relation array of the configuration item node cc1, removing redundant nodes existing in the influence domain array and adding the redundant nodes to the tail of the influence domain node array linked list;
4.8) setting the status of the configuration item node cc1 as scanned; skipping step 4.6);
4.9) the influence domain node array linked list of the configuration item node C1 is output as the influence domain of the configuration item C1.
Optionally, step 6) is followed by the step of generating a minimal self-consistent configuration set for the set of configuration items { C } to be detected.
Optionally, the step of generating a minimum self-consistent configuration set for the set of configuration items { C } to be detected includes:
A1) initializing a new configuration set of the configuration item set { C } as null;
A2) if all the configuration items in the configuration item set { C } are processed, jumping to the step A6), otherwise, taking out the first unprocessed configuration item C1 from the configuration item set { C };
A3) judging whether the configuration item C1 is a root node in a preset configuration item relation graph, and if so, jumping to the step 2); otherwise, skipping to the next step;
A4) calculating an influence chain of the configuration item C1 according to a preset configuration item relation diagram;
A5) removing redundancy of the configuration items in the influence chain of the configuration item C1, adding the configuration items into the new configuration set, and jumping to the step A2);
A6) and outputting the new configuration set as a minimum self-consistent configuration set of the configuration item set { C }.
Optionally, step a4) comprises:
a4.1) obtaining the name of the configuration item C1;
a4.2) inquiring a corresponding configuration item node C1 in a preset configuration item relation graph according to the name of the configuration item C1;
a4.3) initializing the influence chain node array linked list of the configuration item node c1 to be null;
a4.4) judging whether the configuration item node c1 is a root node in a preset configuration item relation graph, and if so, directly jumping to the step A4.9); otherwise, skipping to the next step;
a4.5) forming an influence chain array by all i nodes in a dependency array of the configuration item node c1, wherein the dependency array refers to a set of configuration items depended on by the configuration item node c 1;
a4.6) jumping to step A4.9) if the end of the influence chain array has been reached, otherwise fetching the first unscanned configuration item node cc1 in the influence chain array;
a4.7) for nodes in the dependent array of the configuration item node cc1, removing redundant nodes existing in the influence chain array and adding the redundant nodes to the tail of the influence chain node array linked list;
a4.8) setting the status of the configuration item node cc1 as scanned; skipping to step A4.6);
a4.9) outputs the influence chain node array linked list of the configuration item node C1 as the influence chain of the configuration item C1.
Optionally, before step 3), a step of generating a configuration item relationship diagram in advance is further included:
B1) scanning and reading a kernel configuration control file Kconfig of Linux, respectively establishing corresponding configuration item nodes CNode aiming at configuration item keywords 'config', 'menucoconfig', 'menu' and 'choice' in the kernel configuration control file Kconfig, adding configuration item nodes to configuration items expressed by a relation description keyword under the configuration item keyword 'config' aiming at the configuration item nodes CNode corresponding to the configuration item keyword 'config' aiming at each configuration item node CNode, establishing directed connecting edges corresponding to dependency relations through dependency or mutual exclusion relations with or without expression between the configuration items expressed by the relation description keyword, and adding the configuration items depended by each configuration item node to a dependency array of the configuration item node; aiming at configuration item nodes CNode corresponding to configuration item keywords 'menuconfig', 'menu' and 'choice', configuration item nodes are established for configuration items under the corresponding configuration item keywords step by step, and directed connection edges corresponding to the dependency relationship between each level of configuration item nodes and subordinate configuration item nodes thereof are established;
B2) dividing each core configuration item node into a root node, a stem node and a leaf node according to the existence of a connecting edge and the direction of the existing connecting edge of all the configuration item nodes, wherein the degree of entry of the root node is 0, the degree of exit and the degree of entry of the stem node are not 0, and the degree of exit of the leaf node is 0, so as to obtain a configuration item relation graph; and generating a corresponding export relation array according to the dependency array of each configuration item node in the configuration item relation diagram, so that if any configuration item B is in the dependency array of the configuration item A, the configuration item A is added into the export relation array of the configuration item B.
Optionally, the relationship description keyword specified under the configuration item keyword "config" in step B1) includes "depend on", "select", "visible if", "choice", and "import".
Optionally, A, B, Bi and C are respectively different arbitrary configuration items, Bi is one of an arbitrary set 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 non-operation of the configuration item a, an or operation of the configuration item a and the arbitrary configuration item B, or an and operation of the configuration item a and the arbitrary configuration item B; in step B1), establishing a directed connection edge corresponding to the dependency relationship according to the and, or, unexpressed dependency or mutual exclusion relationship between the configuration items expressed by the relationship description keyword, and adding the configuration items depended on by each configuration item node to the dependency array of the configuration item node includes:
if the relation corresponding to the relation description keyword 'depended on' is described as 'B depended on A', the expressed dependency between the configuration items is that the configuration item B depends on the configuration item A, a directed connection edge corresponding to the dependency is established to point to the configuration item A for the configuration item B, and the configuration item A is added into a dependency array of the configuration item B;
if the relation corresponding to the relation description keyword 'depended on' is described as 'B depended on-A', the expressed dependency between the configuration items is that the configuration item B depends on the configuration item-A, a directed connection edge corresponding to the dependency is established to point to the configuration item A for the configuration item B, and the configuration item-A is added into a dependency array of the configuration item B;
if the relation corresponding to the relation description keyword 'depended on' is described as 'B depended on A ^ A2', the expressed dependency relationship between the configuration items is that the configuration item B depends on A and A2, a directed connection edge corresponding to the dependency relationship is established to point the configuration item B to the configuration item A and A2, and the configuration item A is added into a dependency array of the configuration item B;
if the relation corresponding to the relation description keyword 'depended on' is described as 'B depended on AvA 2', the expressed dependency between the configuration items is that the configuration item B depends on A or A2, a directed connection edge corresponding to the dependency is established to point to the configuration items A and A2 for the configuration item B, and the configuration item A is added into a dependency array of the configuration item B;
if the relation corresponding to the relation description keyword 'depended on' is described as 'B depended on-A ^ A2', the expressed dependency relationship between the configuration items is that the configuration item B depends on-A and A2, a directed connection edge corresponding to the dependency relationship is established to point to the configuration items A and A2 for the configuration item B, and the configuration items-A and A2 are added into a dependency array of the configuration item B;
if the relation corresponding to the relation description keyword 'depended on' is described as 'B depended on-AvA 2', the expressed dependency between the configuration items is that the configuration item B depends on-A or A2, a directed connection edge corresponding to the dependency is established to point to the configuration items A and A2 for the configuration item B, and the configuration items-A and A2 are added into a dependency array of the configuration item B;
if the relation corresponding to the relation description keyword 'choice' is described as 'choice AB', the expressed mutual exclusion relation between the configuration items is to select a configuration item A or a configuration item B, and a directed connection edge corresponding to the dependency relation is established as a mutual index between the configuration item A and the configuration item B;
if the relation corresponding to the relation description keyword "choice" is described as "choice ABC", the mutual exclusion relation between the expressed configuration items is the selection configuration item A, B or C, and the directed connecting edge establishing the corresponding dependency relation is the mutual index between the configuration items A, B and C;
if the corresponding relation of the relation description keyword ' choice ' is described as ' choice { Bi } n ", the mutual exclusion relation between the expressed configuration items is to select one of the n configuration items Bi, and the directed connection edge establishing the corresponding dependency relation is the mutual indication between the n configuration items Bi;
if the relation corresponding to the relation description keyword 'select' is described as 'A select B', the expressed dependency between the configuration items is that the configuration item B depends on the configuration item A, a directed connection edge corresponding to the dependency is established to point to the configuration item A2 for the configuration item B, and the configuration item A is added into the dependency data of the configuration item B;
if the relation corresponding to the relation description keyword "select" is described as "A select B if A2", the expressed dependency relationship between the configuration items is that the configuration item B depends on the configuration item A and the configuration item A2, a directed connection edge corresponding to the dependency relationship is established to point the configuration item B to the configuration item A and the configuration item A2, and the configuration item A2 are added into the dependency data of the configuration item B;
if the relation corresponding to the relation description keyword 'visible if' is described as 'B visible if A', the expressed dependency relationship between the configuration items is that the configuration item B depends on the configuration item A, a directed connection edge corresponding to the dependency relationship is established to point to the configuration item A for the configuration item B, and the configuration item A is added into the dependency data of the configuration item B;
if the relation corresponding to the relation description keyword 'visible if' is described as 'B visible if-A', the expressed dependency relationship between the configuration items is that the configuration item B depends on the configuration item-A, a directed connection edge corresponding to the dependency relationship is established to point to the configuration item A for the configuration item B, and the configuration item A is added into the dependency data of the configuration item B;
if the relation corresponding to the relation description keyword "import" is described as "A import B", the expressed dependency between the configuration items is that the configuration item B depends on the configuration item A, a directed connection edge corresponding to the dependency is established to point to the configuration item A for the configuration item B, and the configuration item A is added into the dependency data of the configuration item B;
if the relation corresponding to the relation description keyword "import" is described as "a import B if a 2", the expressed dependency between the configuration items is that the configuration item B depends on the configuration item a and the configuration item a2, a directed connection edge corresponding to the dependency is established to point to the configuration item a and the configuration item a2 for the configuration item B, and the configuration item a2 are added to the dependency data of the configuration item B;
here, "-" indicates not operation, "^" indicates AND operation, and "v" indicates OR operation.
In addition, the invention also provides a configuration item self-consistency detection system based on the relational graph, which comprises a microprocessor and a memory which are connected with each other, wherein the microprocessor is programmed or configured to execute the steps of the configuration item self-consistency detection method based on the relational graph.
In addition, the invention also provides a computer readable storage medium, in which a computer program is stored, the computer program is used for being executed by a microprocessor to implement the steps of the configuration item self-consistency detection method based on the relation diagram.
Compared with the prior art, the invention mainly has the following advantages: the invention is based on the configuration item relation diagram (the nodes represent the configuration items of Linux, the edges between the nodes represent the preposed dependency relationship between the nodes), thereby realizing the relation calculation between the configuration items by a diagram calculation method according to the and/or unequal preposed conditions existing between the configuration items of the kernel in the configuration item relation diagram, determining the influence chain and the direct and indirect influence domains of any configuration item, further realizing the self-consistency detection of whether any configuration item set { C } to be detected is self-consistent, providing effective support for Linux kernel customization, meeting the requirement of fast kernel customization and improving the kernel configuration efficiency.
Drawings
FIG. 1 is a schematic diagram of a basic process of an embodiment of the present invention.
Fig. 2 is a flowchart illustrating a process of calculating an impact domain according to a first embodiment of the present invention.
Fig. 3 is a schematic flow chart of generating a minimum self-consistent configuration set according to a first embodiment of the present invention.
Fig. 4 is a flowchart illustrating a process of calculating an impact chain according to a first embodiment of the present invention.
Fig. 5 is a flowchart illustrating a process of generating a configuration item relationship diagram according to a second embodiment of the present invention.
Detailed Description
The first embodiment is as follows:
as shown in fig. 1, the method for detecting self-consistency of configuration items based on a relationship diagram in this embodiment includes:
1) determining a configuration item set { C } to be detected;
2) if all the configuration items in the configuration item set { C } are detected completely, jumping to step 6), otherwise, taking out the first configuration item C1 which is not detected yet from the configuration item set { C }; otherwise, skipping to the next step;
3) judging whether the configuration item C1 is a leaf node in a preset configuration item relation graph, and if so, jumping to the step 2); otherwise, skipping to the next step; nodes in the configuration item relation graph represent configuration items of Linux, and edges among the nodes represent a front dependency relation among the nodes;
4) calculating the influence domain of the configuration item C1 according to a preset configuration item relation diagram;
5) checking whether the influence domain of the configuration item C1 has a conflict item in the configuration item set { C }, and if not, jumping to the step 2); otherwise, judging that the configuration item set { C } is not consistent with self-consistency, ending and exiting; after the configuration item set { C } is judged not to be self-consistent, the method further comprises the step of outputting conflict item pairs formed by conflict items of influence domains of the configuration items C1 and C1 in the configuration item set { C } so as to facilitate understanding of conflict information of the configuration item set { C } to be detected.
6) The set of decision configuration items C is self consistent.
In the process of kernel configuration, only part of configuration items are contained, and the set formed by the configuration items is a subset of the configuration items contained in the configuration item relation diagram. If the configuration item A and any conflict configuration item B and condition conflict configuration item B in the influence domain thereof exist in the configuration item set at the same time, the configuration item set is called to be not self-consistent, and { Ai } of all configuration items causing contradiction and { Bij } of the conflict configuration items in the influence domain thereof are listed; if the condition conflicts with the configuration item, whether the condition is met is detected.
The Domain of Influence (Domain of intelligence) of any configuration item C refers to all configuration items that are influenced by the determination of the existence of the configuration item C, and is expressed by an Influence Domain node array linked list in this embodiment, and all configuration items that are influenced by the determination are recorded in the Influence Domain node array linked list. As shown in fig. 2, step 4) in this embodiment includes:
4.1) obtaining the name of the configuration item C1;
4.2) inquiring a corresponding configuration item node C1 in a preset configuration item relation graph according to the name of the configuration item C1;
4.3) initializing the influence domain node array linked list of the configuration item node c1 to be null;
4.4) judging whether the configuration item node c1 is a leaf node in the preset configuration item relation graph, and if so, directly jumping to the step 4.9); otherwise, skipping to the next step;
4.5) forming an influence domain array by all i nodes in the derivation relation array of the configuration item node c 1; the export relation array records all configuration items depending on the corresponding configuration item nodes, and if any configuration item B is in the dependency array of the configuration item A, the export relation array of the configuration item B contains the configuration item A;
4.6) if all the configuration item nodes of the influence domain array are scanned completely, jumping to the step 4.9), otherwise, taking out the first unscanned configuration item node cc1 in the influence domain array;
4.7) for nodes in the export relation array of the configuration item node cc1, removing redundant nodes existing in the influence domain array and adding the redundant nodes to the tail of the influence domain node array linked list;
4.8) setting the status of the configuration item node cc1 as scanned; skipping step 4.6);
4.9) the influence domain node array linked list of the configuration item node C1 is output as the influence domain of the configuration item C1.
The export relation array records all configuration items depending on the corresponding configuration item nodes, and if any configuration item B is in the dependency array of the configuration item A, the export relation array of the configuration item B contains the configuration item A; the export relation array is an export Domain (Domain of reduce) of the configuration item, and the configuration item directly exported by the configuration item represents the configuration item directly influenced by the configuration item.
For any configuration item A, the derived field of A in the initial condition { A } DD Empty, i.e.: { A } DD ={};
If B is equal to>A, the derived field of A { A } DD ={B}|{A} DD
If B is equal to>A, the derived field of A { A } DD ={~B}|{A} DD
If B is ═>A ^ A2, then A's derived field { A } DD ={B}|{A} DD
If B is equal to>AvA2, the derived field of A { A } DD ={B{~A2}}|{A} DD An export domain under the condition { -A2 };
if B is ═>A2, the derived field of A { A } DD ={~B}|{A} DD
If B is equal to>AvA2, the derived field of A { A } DD ={~B{~A2}}|{A} DD An export domain under the condition { -A2 };
wherein ═ is>"indicates dependence on," | "indicates set merging," - "indicates non-operation," ^ "indicates AND operation, and" v "indicates OR operation. Influence Domain of configuration item C (Domain of Influence) { C } ID The calculation method of (2) is as follows:
step 1, for any configuration item C, if the configuration item C is a leaf node, the influence domain is { }, and returning; otherwise, continuing;
step 2, for configuration item C, the influence domain { C } of C under initial condition ID Defined as the derived field { C } DD Namely: { C } ID= {C} DD (ii) a For any configuration item A in the derived domain of C, its influence domain { A } is computed ID
If B is ═>A, the influence of B is covered by { B } ID Add the influence field of A { A } ID ={A} ID |{B} ID
If B is ═>A, the influence domain of B is { B } ID Add the influence Domain of A { A } ID ={A} ID |{B} ID
If B is equal to>A ^ A2, A2 is a composite configuration item, then the influence of B is covered by { B } ID Influence field added to A { A } ID ={A} ID |{B} DD
If B is equal to>AV A2, A2 is a composite configuration item, the influence field of B is { B } DD The influence field of A is added under the condition of A2, and is expressed as A ID ={A} ID |{B {~A2} } DD
If B is ═>A2, A2 is the composite configuration item, then the influence field of B is { B } DD Influence field added to A { A } ID ={A} ID |{B} DD
If B is ═>AV A2, A2 is a composite configuration item, the influence field of B is { B } DD The influence domain of A is added under the condition of A2, and is expressed as A ID ={A} ID |{B {~A2} } DD
And 3, summarizing the influence domains with more configuration items in the export domain, namely the configuration influence domain of the C.
Here, "═ represents dependency," | "represents set merge," - "represents non-operation," ^ "represents AND operation, and" v "represents OR operation.
As an optional implementation manner, in this embodiment, step 6) is followed by a step of generating a minimum self-consistent configuration set for the set { C } of configuration items to be detected. As shown in fig. 3, the step of generating a minimum self-consistent configuration set for the set of configuration items { C } to be detected in this embodiment includes:
A1) initializing a new configuration set of the set of configuration items { C } as null;
A2) if all the configuration items in the configuration item set { C } are processed, jumping to the step A6), otherwise, taking out the first unprocessed configuration item C1 from the configuration item set { C };
A3) judging whether the configuration item C1 is a root node in a preset configuration item relation graph, and if so, jumping to the step 2); otherwise, skipping to the next step;
A4) calculating an influence chain of the configuration item C1 according to a preset configuration item relation diagram;
A5) removing redundancy of the configuration items in the influence chain of the configuration item C1, adding the configuration items into a new configuration set, and jumping to the step A2);
A6) and outputting the new configuration set as a minimum self-consistent configuration set of the configuration item set { C }.
Considering that generating the minimum self-consistent configuration set for the set { C } of configuration items to be detected can be independently executed without depending on the execution after step 6), the self-consistent analysis needs to be carried out on the specified set { Ai } of configuration items before step A1), and if the set of configuration item conflict pairs exists, returning is carried out, and the configuration set is reported to be not self-consistent in error.
Step A5) is used for adding the configuration items in the influence chain of the configuration item C1 into the new configuration set after removing redundancy, and then adding all the configuration items in the configuration influence chain which are not in the configuration set into the new configuration set. Adding all configuration items { Bij } in the configuration influence chain, which are not in the configuration set, into the newly added configuration set aiming at any configuration item Ai in the configuration set, wherein the rule for adding the configuration items to the newly added configuration set according to the configuration influence chain is as follows: if B2 has an influence chain { A } IC ->B1, then { A } IC Adding the configuration items in the chain into the configuration set; if B2 conditionally affects the chain<{A1} IC > {~A2} ->B1, judging whether the condition A2 is satisfied, if not, then { A1} IC The configuration items in the chain are added to the configuration set. And repeating the operation until no new configuration item is added, and finally outputting the new configuration set as the minimum self-consistent configuration set of the configuration item set { C }. In this embodiment, generating the minimum self-consistent configuration set for the configuration item set { C } to be detected requires performing self-consistent analysis on the configuration item set { C } in advance, and if there is no conflict, obtaining the self-consistent set. If the conflict exists, listing { Ai } of all configuration items causing the conflict and the configuration items of the influence domains thereof { { Bij } }, deleting the configuration items causing the conflict according to the requirement of a user, and submitting self-consistency detection until a self-consistency set is obtained.
An Influence Chain (infiluence Chain) of configuration items is a Chain formed by all configuration items that Influence the enabling of configuration items. As shown in fig. 4, step a4) includes:
a4.1) obtaining the name of the configuration item C1;
a4.2) inquiring a corresponding configuration item node C1 in a preset configuration item relation graph according to the name of the configuration item C1;
a4.3) initializing the influence chain node array linked list of the configuration item node c1 to null, which can be expressed as { c1} IC =->;
A4.4) judging whether the configuration item node c1 is a root node in a preset configuration item relation graph, and if so, directly jumping to the step A4.9); otherwise, skipping to the next step;
a4.5) forming an influence chain array by all i nodes in a dependency array of the configuration item node c1, wherein the dependency array refers to a set of configuration items depended on by the configuration item node c 1;
a4.6) if the end of the influence chain array has been reached, jumping to step A4.9), otherwise fetching the first unscanned configuration item node cc1 in the influence chain array;
a4.7) removing redundant nodes existing in the influence chain array from being added to the tail end of the influence chain node array linked list for nodes in the dependency array of the configuration item node cc 1;
a4.8) sets the status of the configuration item node cc1 to scanned; skipping to step a 4.6);
a4.9) outputs the influence chain node array linked list of the configuration item node C1 as the influence chain of the configuration item C1.
In the embodiment, by introducing an Influence Chain (Influence Chain) of a configuration item, quick query of related item information of a kernel configuration item can be supported; by introducing an influence domain, self-consistency detection of a kernel configuration set can be supported; by introducing chains of influence and domains of influence, minimal self-consistency detection to generate a specified set of kernel configurations may be supported.
Considering that the configuration item node c1 contains two characters, for the sake of simplicity, the chain of influence { B } of any configuration item B is here taken as an example IC For illustration purposes:
step 1, if the configuration itemB is the root node, the influence chain { B } IC If the value is empty, returning; otherwise, continuing;
step 2, under the initial condition, configuring the influence chain { B } of the item B arbitrarily IC =->;
If B is equal to>A, then { A } IC ->B constitutes a chain of influence of B, denoted as { B } IC ={A} IC ->B
If B is ═>A, then { -A } IC ->B constitutes a chain of influence of B, denoted { B } IC ={~A} IC ->B
If B is ═>A ^ A2, then<{A} IC >->B constitutes a chain of influence of B, denoted as { B } IC ={A} IC ->B
If B is equal to>AvA2, then { A1} IC ->B constitutes a conditional influence chain of B, denoted as { B } IC =<{A {~A2} } IC >->B;
If B is ═>A ^ A2, then<{~A} IC >->B constitutes a chain of influence of B, denoted { B } IC ={~A} IC ->B
If B is ═>AvA2, then A1 IC ->B constitutes a conditional influence chain of B, denoted as { B } IC =<{~A {~A2} } IC >->B;
Wherein, the upper label {~A2} This indicates that the condition is {. A2 }.
In addition, the present embodiment also provides a system for detecting self-consistency of configuration items based on a relational graph, which includes a microprocessor and a memory connected to each other, where the microprocessor is programmed or configured to execute the steps of the method for detecting self-consistency of configuration items based on a relational graph.
In addition, the present embodiment also provides a computer-readable storage medium, in which a computer program is stored, where the computer program is used to be executed by a microprocessor to implement the steps of the foregoing method for detecting self-consistency of configuration items based on a relational graph.
Example two:
the present embodiment is basically the same as the first embodiment, and the main difference is that the present embodiment further includes a step of generating a configuration item relationship diagram in advance.
The configuration item keywords in Kconfig include config, menucofig, menu, source, and choice, where the config and menucofig keywords represent the actual configuration items in the kernel, the rest of the configuration item keywords such as source, menu, and choice are mainly used for structure control and relationship auxiliary description, and the types of the configuration item keywords and the contained attribute details are as in table 1.
Table 1: and configuring an information table of the item keyword list.
Figure BDA0003580935940000101
In this embodiment, a configuration item node CNode is established for a configuration item keyword in a kernel configuration control file Kconfig, so as to obtain a kernel configuration node set. Since the configuration item keyword source includes the name of the nested configuration item file, and the nested configuration item file is also one of the kernel configuration control files Kconfig of Linux, the configuration item keyword source is omitted in this embodiment.
As shown in fig. 4, in this embodiment, before step 3), a step of generating a configuration item relationship diagram in advance is further included:
B1) scanning and reading a kernel configuration control file Kconfig of Linux, respectively establishing corresponding configuration item nodes CNode aiming at configuration item keywords 'config', 'menucoconfig', 'menu' and 'choice' in the kernel configuration control file Kconfig, adding configuration item nodes aiming at configuration item nodes CNode corresponding to the configuration item keywords 'config', configuration item addition configuration item nodes expressed by a relation description keyword specified under the configuration item keywords 'config', establishing directed connection edges corresponding to dependency relations through dependency or mutual exclusion relations with or without expression between configuration items expressed by the relation description keyword, and adding configuration items depended by each configuration item node to a dependency array of the configuration item node; aiming at configuration item nodes CNode corresponding to configuration item keywords 'menuconfig', 'menu' and 'choice', establishing configuration item nodes for configuration items under the corresponding configuration item keywords step by step, and establishing directed connection edges corresponding to the dependency relationship between each level of configuration item nodes and the lower level of configuration item nodes;
B2) dividing each kernel configuration item node into a root node, a stem node and a leaf node according to the existence of a connecting edge and the direction of the connecting edge of all the configuration item nodes, wherein the degree of entry of the root node is 0, the degree of exit and the degree of entry of the stem node are not 0, and the degree of exit of the leaf node is 0, so as to obtain a configuration item relation graph; and generating a corresponding export relation array according to the dependency array of each configuration item node in the configuration item relation diagram, so that if any configuration item B is in the dependency array of the configuration item A, the configuration item A is added into the export relation array of the configuration item B.
Attribute keywords such as depend, select and the like related to the dependency relationship of the kernel configuration items and relationship description keywords such as choice, menu, menuconfig and the like auxiliary classes exist in the kernel configuration control file Kconfig, the keywords indicate the dependency and mutual exclusion relationship among the kernel configuration items, and the included relationship description keywords and the defined relationship types are shown in table 2.
Table 2: the relationship describes a keyword definition table.
Type of relationship Remarks to note
depend on Representing dependency relationships between configuration items
select Select is only used, if is not present and is not distinguished, and weak inverse dependency relationship exists between configuration items
visible if Same dependent on
imply Same select belonging to weak inverse dependence
choice Mutual exclusion relation exists between subordinate node configuration items of choice
menu Menu's subordinate node
menuconfig Subordinate node of menuconfig
And establishing the pre-relation connection of the combination with, or, unequal combination between the kernel configuration items for each dependency relation expressed by the relation description key words in the kernel configuration file Kconfig. And describing keywords according to the relation of depend, choice, select and the like related to the dependency relation of the kernel configuration item in the kernel configuration control file Kconfig, and establishing the relation between the nodes according to the semantics of the keywords described by the relation. In the relationship type, "depend on," select, "" visible if, "" choice, "and" import "determine the relationship between the config configuration items that is dependent and mutually exclusive, so the relationship description keyword specified under the configuration item keyword" config "in step B1) of this embodiment includes" depend on, "" select, "" visible if, "" choice, "and" import.
In this embodiment, A, B, Bi and C are respectively different arbitrary configuration items, Bi is one of an arbitrary set of n configuration items, a2 is a composite configuration item including a single configuration item a or a configuration item a, and the composite configuration item of the configuration item a is a non-operation of the configuration item a, an or operation of the configuration item a and the arbitrary configuration item B, or an and operation of the configuration item a and the arbitrary configuration item B; in step B1), establishing a directed connection edge corresponding to the dependency relationship according to the and, or, unexpressed dependency or mutual exclusion relationship between the configuration items expressed by the relationship description keyword, and adding the configuration items depended on by each configuration item node to the dependency array of the configuration item node includes:
if the relation corresponding to the relation description keyword 'depended on' is described as 'B depended on A', the expressed dependency between the configuration items is that the configuration item B depends on the configuration item A, a directed connection edge corresponding to the dependency is established to point to the configuration item A for the configuration item B, and the configuration item A is added into a dependency array of the configuration item B;
if the relation corresponding to the relation description keyword 'depended on' is described as 'B depended on-A', the expressed dependency between the configuration items is that the configuration item B depends on the configuration item-A, a directed connection edge corresponding to the dependency is established to point to the configuration item A for the configuration item B, and the configuration item-A is added into a dependency array of the configuration item B;
if the relation corresponding to the relation description keyword 'depended on' is described as 'B depended on A ^ A2', the expressed dependency relationship between the configuration items is that the configuration item B depends on A and A2, a directed connection edge corresponding to the dependency relationship is established to point the configuration item B to the configuration item A and A2, and the configuration item A is added into a dependency array of the configuration item B;
if the relation corresponding to the relation description keyword 'depended on' is described as 'B depended on AvA 2', the expressed dependency among the configuration items is that the configuration item B depends on A or A2, a directed connection edge corresponding to the dependency is established to point to the configuration items A and A2 for the configuration item B, and the configuration item A is added into a dependency array of the configuration item B;
if the relation corresponding to the relation description keyword 'depended on' is described as 'B depended on-A ^ A2', the expressed dependency between the configuration items is that the configuration item B depends on-A and A2, a directed connection edge corresponding to the dependency is established to point to the configuration items A and A2 for the configuration item B, and the configuration items-A and A2 are added into a dependency array of the configuration item B;
if the relation corresponding to the relation description keyword 'depended on' is described as 'B depended on-AvA 2', the expressed dependency between the configuration items is that the configuration item B depends on-A or A2, a directed connection edge corresponding to the dependency is established to point to the configuration items A and A2 for the configuration item B, and the configuration items-A and A2 are added into a dependency array of the configuration item B;
a definition method corresponding to the relationship description corresponding to each relationship description keyword "depend on" is shown in table 3.
Table 3: the corresponding relation of "dependent on" describes the corresponding definition.
Figure BDA0003580935940000121
Figure BDA0003580935940000131
If the relation corresponding to the relation description keyword 'choice' is described as 'choice AB', the expressed mutual exclusion relation between the configuration items is to select a configuration item A or a configuration item B, and a directed connection edge corresponding to the dependency relation is established as a mutual index between the configuration item A and the configuration item B;
if the relation corresponding to the relation description keyword "choice" is described as "choice ABC", the mutual exclusion relation between the expressed configuration items is to select the configuration item A, B or C, and the directed connection edge establishing the corresponding dependency relation is the mutual indication between the configuration item A, B and C;
if the corresponding relation of the relation description keyword ' choice ' is described as ' choice { Bi } n ", the mutual exclusion relation between the expressed configuration items is to select one of the n configuration items Bi, and the directed connection edge establishing the corresponding dependency relation is the mutual indication between the n configuration items Bi;
a definition method corresponding to the relationship description corresponding to each relationship description keyword "choice" is shown in table 4.
Table 4: the corresponding relationship of "choice" describes the corresponding definition.
Figure BDA0003580935940000132
If the relation corresponding to the relation description keyword 'select' is described as 'A select B', the expressed dependency between the configuration items is that the configuration item B depends on the configuration item A, a directed connection edge corresponding to the dependency is established to point to the configuration item A2 for the configuration item B, and the configuration item A is added into the dependency data of the configuration item B;
if the relation corresponding to the relation description keyword "select" is described as "a select B if a 2", the expressed dependency among the configuration items is that the configuration item B depends on the configuration item a and the configuration item a2, a directed connection edge corresponding to the dependency is established to point the configuration item B to the configuration item a and the configuration item a2, and the configuration item a2 are added to the dependency data of the configuration item B;
the definition method corresponding to the relationship description of each relationship description keyword "select" is shown in table 5.
Table 5: the corresponding relationship of "select" describes the corresponding definition.
Figure BDA0003580935940000141
If the relation corresponding to the relation description keyword 'visible if' is described as 'B visible if A', the expressed dependency relationship between the configuration items is that the configuration item B depends on the configuration item A, a directed connection edge corresponding to the dependency relationship is established to point to the configuration item A for the configuration item B, and the configuration item A is added into the dependency data of the configuration item B;
if the relation corresponding to the relation description keyword 'visible if' is described as 'B visible if-A', the expressed dependency between the configuration items is that the configuration item B depends on the configuration item-A, a directed connection edge corresponding to the dependency is established as the configuration item B points to the configuration item A, and the configuration item A is added into the dependency data of the configuration item B;
table 6 shows a method for defining the relationship description corresponding to each of the relationship description keywords "visible if".
Table 6: the relationship corresponding to "visible if" describes the corresponding definition.
Figure BDA0003580935940000142
If the relation corresponding to the relation description keyword "import" is described as "Aimply B", the expressed dependency relationship between the configuration items is that the configuration item B depends on the configuration item A, a directed connection edge corresponding to the dependency relationship is established to point to the configuration item A for the configuration item B, and the configuration item A is added into the dependency data of the configuration item B;
if the relation corresponding to the relation description keyword "import" is described as "a import B if a 2", the expressed dependency between the configuration items is that the configuration item B depends on the configuration item a and the configuration item a2, a directed connection edge corresponding to the dependency is established to point to the configuration item a and the configuration item a2 for the configuration item B, and the configuration item a2 are added to the dependency data of the configuration item B;
table 7 shows a method for defining a relationship description corresponding to each relationship description keyword "import".
Table 7: the relationship corresponding to "import" describes the corresponding definition.
Figure BDA0003580935940000143
Figure BDA0003580935940000151
Wherein "represents a not operation," [ lambda ] represents an and operation, and "v" represents an or operation.
Finally, according to the existence and the direction of connection in the configuration item nodes, the configuration item nodes are divided into three types of configuration nodes, namely root nodes (the degree of entry is 0), stem nodes (the degree of entry is not 0) and leaf nodes (the degree of exit is 0). The in-degree refers to the number of edges introduced by the node, and the out-degree refers to the number of edges introduced by the node. In this embodiment, according to the definition corresponding to the relationship description keyword "choice", the configuration item sets thereof are independent into a group and the degree of entrance and exit is not 0, so that such stem node differentiation is defined as a group stem node. And executing the operations on all the configuration items in the same kernel version to obtain a configuration item relation graph Gcdep, wherein a preposed relation formed by combining with, or, unequal and the like exists between the kernel configuration item nodes. The configuration item relation graph takes the configuration items as nodes in the graph, and if a pre-dependency relationship exists between any configuration item A and any configuration item B, a signed directed edge is connected between the configuration item A and the configuration item B, which indicates that the configuration item A depends on the configuration item B due to the pre-dependency relationship.
In addition, the present embodiment also provides a system for detecting self-consistency of configuration items based on a relational graph, which includes a microprocessor and a memory connected to each other, where the microprocessor is programmed or configured to execute the steps of the foregoing method for detecting self-consistency of configuration items based on a relational graph.
In addition, the present embodiment also provides a computer-readable storage medium, in which a computer program is stored, where the computer program is used for being executed by a microprocessor to implement the steps of the foregoing configuration item self-consistency detection method based on the relational graph.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-readable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein. The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks. These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks. These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above description is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments, and all technical solutions belonging to the idea of the present invention belong to the protection scope of the present invention. It should be noted that modifications and embellishments within the scope of the invention may occur to those skilled in the art without departing from the principle of the invention, and are considered to be within the scope of the invention.

Claims (10)

1. A method for detecting self-consistency of configuration items based on a relational graph is characterized by comprising the following steps:
1) determining a configuration item set { C } to be detected;
2) if all the configuration items in the configuration item set { C } are detected, jumping to step 6), otherwise, taking out the first configuration item C1 which is not detected yet from the configuration item set { C }; otherwise, skipping to the next step;
3) judging whether the configuration item C1 is a leaf node in a preset configuration item relation graph, and if so, jumping to the step 2); otherwise, skipping to the next step; the nodes in the configuration item relation graph represent configuration items of Linux, and edges among the nodes represent a front dependency relation among the nodes;
4) calculating the influence domain of the configuration item C1 according to a preset configuration item relation diagram;
5) checking whether the influence domain of the configuration item C1 has a conflict item in the configuration item set { C }, and if not, jumping to the step 2); otherwise, judging that the configuration item set { C } does not accord with self-consistency, ending and exiting;
6) the set of decision configuration items C is self consistent.
2. The method for detecting the self-consistency of the configuration items based on the relational graph according to claim 1, wherein the step 4) comprises the following steps:
4.1) obtaining the name of the configuration item C1;
4.2) inquiring a corresponding configuration item node C1 in a preset configuration item relation graph according to the name of the configuration item C1;
4.3) initializing the influence domain node array linked list of the configuration item node c1 to be null;
4.4) judging whether the configuration item node c1 is a leaf node in the preset configuration item relation graph, and if so, directly jumping to the step 4.9); otherwise, skipping to the next step;
4.5) forming an influence domain array by all i nodes in the derivation relation array of the configuration item node c 1; the export relation array records all configuration items depending on the corresponding configuration item nodes, and if any configuration item B is in the dependency array of the configuration item A, the export relation array of the configuration item B contains the configuration item A;
4.6) if all the configuration item nodes of the influence domain array are scanned completely, skipping to the step 4.9), otherwise, taking out the first un-scanned configuration item node cc1 in the influence domain array;
4.7) for the nodes in the export relation array of the configuration item node cc1, removing the redundant nodes existing in the influence domain array and adding the redundant nodes to the tail of the influence domain node array linked list;
4.8) setting the status of the configuration item node cc1 as scanned; skipping step 4.6);
4.9) the influence domain node array linked list of the configuration item node C1 is output as the influence domain of the configuration item C1.
3. The method for detecting the self-consistency of configuration items based on the relational graph according to claim 1, wherein step 6) is followed by a step of generating a minimum self-consistency configuration set for the set { C } of configuration items to be detected.
4. The method according to claim 3, wherein the step of generating a minimum self-consistent configuration set for the set of configuration items { C } to be detected comprises:
A1) initializing a new configuration set of the set of configuration items { C } as null;
A2) if all the configuration items in the configuration item set { C } are processed, jumping to step A6), otherwise, taking out the first unprocessed configuration item C1 from the configuration item set { C };
A3) judging whether the configuration item C1 is a root node in a preset configuration item relation graph, and if so, jumping to the step 2); otherwise, skipping to the next step;
A4) calculating an influence chain of the configuration item C1 according to a preset configuration item relation diagram;
A5) removing redundancy of the configuration items in the influence chain of the configuration item C1, adding the configuration items into the new configuration set, and jumping to the step A2);
A6) and outputting the new configuration set as a minimum self-consistent configuration set of the configuration item set { C }.
5. The relationship graph-based configuration item self-consistency detection method according to claim 4, wherein the step A4) comprises:
a4.1) obtaining the name of the configuration item C1;
a4.2) inquiring a corresponding configuration item node C1 in a preset configuration item relation graph according to the name of the configuration item C1;
a4.3) initializing the influence chain node array linked list of the configuration item node c1 to be null;
a4.4) judging whether the configuration item node c1 is a root node in a preset configuration item relation graph, and if so, directly jumping to the step A4.9); otherwise, skipping to the next step;
a4.5) forming an influence chain array by all i nodes in a dependency array of the configuration item node c1, wherein the dependency array refers to a set of configuration items depended on by the configuration item node c 1;
a4.6) if the end of the influence chain array has been reached, jumping to step A4.9), otherwise fetching the first unscanned configuration item node cc1 in the influence chain array;
a4.7) removing redundant nodes existing in the influence chain array from being added to the tail end of the influence chain node array linked list for nodes in the dependency array of the configuration item node cc 1;
a4.8) sets the status of the configuration item node cc1 to scanned; skipping to step a 4.6);
a4.9) outputs the influence chain node array linked list of the configuration item node C1 as the influence chain of the configuration item C1.
6. The method for detecting the self-consistency of the configuration items based on the relational graph according to claim 1, wherein the step 3) is preceded by a step of generating the relational graph of the configuration items in advance:
B1) scanning and reading a kernel configuration control file Kconfig of Linux, respectively establishing corresponding configuration item nodes CNode aiming at configuration item keywords 'config', 'menucoconfig', 'menu' and 'choice' in the kernel configuration control file Kconfig, adding configuration item nodes aiming at configuration item nodes CNode corresponding to the configuration item keywords 'config', configuration item addition configuration item nodes expressed by a relation description keyword specified under the configuration item keywords 'config', establishing directed connection edges corresponding to dependency relations through dependency or mutual exclusion relations with or without expression between configuration items expressed by the relation description keyword, and adding configuration items depended by each configuration item node to a dependency array of the configuration item node; aiming at configuration item nodes CNode corresponding to configuration item keywords 'menuconfig', 'menu' and 'choice', configuration item nodes are established for configuration items under the corresponding configuration item keywords step by step, and directed connection edges corresponding to the dependency relationship between each level of configuration item nodes and subordinate configuration item nodes thereof are established;
B2) dividing each kernel configuration item node into a root node, a stem node and a leaf node according to the existence of a connecting edge and the direction of the connecting edge of all the configuration item nodes, wherein the degree of entry of the root node is 0, the degree of exit and the degree of entry of the stem node are not 0, and the degree of exit of the leaf node is 0, so as to obtain a configuration item relation graph; and generating a corresponding export relation array according to the dependency array of each configuration item node in the configuration item relation diagram, so that if any configuration item B is in the dependency array of the configuration item A, the configuration item A is added into the export relation array of the configuration item B.
7. The method for detecting self-consistency of configuration items based on relationship graphs as claimed in claim 6, wherein the relationship description keywords specified under the configuration item keyword "config" in step B1) include "depend on", "select", "visible if", "choice" and "import".
8. The method according to claim 7, wherein A, B, Bi and C are different arbitrary configuration items, Bi is one of an arbitrary set of n configuration items, A2 is a composite configuration item containing a single configuration item A or configuration item A, the composite configuration item of configuration item A is a non-operation of configuration item A, an OR operation of configuration item A and arbitrary configuration item B, or an AND operation of configuration item A and arbitrary configuration item B; in step B1), establishing a directed connection edge corresponding to the dependency relationship according to the and, or, unexpressed dependency or mutual exclusion relationship between the configuration items expressed by the relationship description keyword, and adding the configuration items depended on by each configuration item node to the dependency array of the configuration item node includes:
if the relation corresponding to the relation description keyword 'depended on' is described as 'B depended on A', the expressed dependency between the configuration items is that the configuration item B depends on the configuration item A, a directed connection edge corresponding to the dependency is established to point to the configuration item A for the configuration item B, and the configuration item A is added into a dependency array of the configuration item B;
if the relation corresponding to the relation description keyword 'depended on' is described as 'B depended on-A', the expressed dependency between the configuration items is that the configuration item B depends on the configuration item-A, a directed connection edge corresponding to the dependency is established to point to the configuration item A for the configuration item B, and the configuration item-A is added into a dependency array of the configuration item B;
if the relation corresponding to the relation description keyword 'depended on' is described as 'B depended on A ^ A2', the expressed dependency relationship between the configuration items is that the configuration item B depends on A and A2, a directed connection edge corresponding to the dependency relationship is established to point the configuration item B to the configuration item A and A2, and the configuration item A is added into a dependency array of the configuration item B;
if the relation corresponding to the relation description keyword 'depended on' is described as 'B depended on AvA 2', the expressed dependency between the configuration items is that the configuration item B depends on A or A2, a directed connection edge corresponding to the dependency is established to point to the configuration items A and A2 for the configuration item B, and the configuration item A is added into a dependency array of the configuration item B;
if the relation corresponding to the relation description keyword 'depended on' is described as 'B depended on-A ^ A2', the expressed dependency between the configuration items is that the configuration item B depends on-A and A2, a directed connection edge corresponding to the dependency is established to point to the configuration items A and A2 for the configuration item B, and the configuration items-A and A2 are added into a dependency array of the configuration item B;
if the relation corresponding to the relation description keyword 'depended on' is described as 'B depended on-AvA 2', the expressed dependency among the configuration items is that the configuration item B depends on-A or A2, a directed connection edge corresponding to the dependency is established to point to the configuration items A and A2 for the configuration item B, and the configuration items-A and A2 are added into a dependency array of the configuration item B;
if the relation corresponding to the relation description keyword 'choice' is described as 'choice AB', the expressed mutual exclusion relation between the configuration items is to select the configuration item A or the configuration item B, and the directed connection edge corresponding to the dependency relation is established as the mutual indication between the configuration item A and the configuration item B;
if the relation corresponding to the relation description keyword "choice" is described as "choice ABC", the mutual exclusion relation between the expressed configuration items is to select the configuration item A, B or C, and the directed connection edge establishing the corresponding dependency relation is the mutual indication between the configuration item A, B and C;
if the relation corresponding to the relation description keyword "choice" is described as "choice { Bi } n If the expressed mutual exclusion relation among the configuration items is that one of the n configuration items Bi is selected, and the directed connection edge establishing the corresponding dependency relation is mutual indication among the n configuration items Bi;
if the relation corresponding to the relation description keyword "select" is described as "A select B", the expressed dependency between the configuration items is that the configuration item B depends on the configuration item A, a directed connection edge corresponding to the dependency is established to point to the configuration item A2 for the configuration item B, and the configuration item A is added into the dependency data of the configuration item B;
if the relation corresponding to the relation description keyword "select" is described as "A select B if A2", the expressed dependency relationship between the configuration items is that the configuration item B depends on the configuration item A and the configuration item A2, a directed connection edge corresponding to the dependency relationship is established to point the configuration item B to the configuration item A and the configuration item A2, and the configuration item A2 are added into the dependency data of the configuration item B;
if the relation corresponding to the relation description keyword 'visible if' is described as 'B visible if A', the expressed dependency relationship between the configuration items is that the configuration item B depends on the configuration item A, a directed connection edge corresponding to the dependency relationship is established to point to the configuration item A for the configuration item B, and the configuration item A is added into the dependency data of the configuration item B;
if the relation corresponding to the relation description keyword 'visible if' is described as 'B visible if-A', the expressed dependency between the configuration items is that the configuration item B depends on the configuration item-A, a directed connection edge corresponding to the dependency is established as the configuration item B points to the configuration item A, and the configuration item A is added into the dependency data of the configuration item B;
if the relation corresponding to the relation description keyword "import" is described as "A import B", the expressed dependency between the configuration items is that the configuration item B depends on the configuration item A, a directed connection edge corresponding to the dependency is established to point to the configuration item A for the configuration item B, and the configuration item A is added into the dependency data of the configuration item B;
if the relation corresponding to the relation description keyword "import" is described as "a import B if a 2", the expressed dependency between the configuration items is that the configuration item B depends on the configuration item a and the configuration item a2, a directed connection edge corresponding to the dependency is established to point to the configuration item a and the configuration item a2 for the configuration item B, and the configuration item a2 are added to the dependency data of the configuration item B;
here, "-" indicates not operation, "^" indicates AND operation, and "v" indicates OR operation.
9. A relational graph-based configuration item self-consistency detection system, comprising a microprocessor and a memory which are connected with each other, wherein the microprocessor is programmed or configured to execute the steps of the relational graph-based configuration item self-consistency detection method according to any one of claims 1 to 8.
10. A computer-readable storage medium, in which a computer program is stored, wherein the computer program is adapted to be executed by a microprocessor to perform the steps of the method for detecting self-consistency of a configuration item based on a relational graph according to any one of claims 1 to 8.
CN202210346626.2A 2022-04-02 2022-04-02 Method, system and medium for detecting self-consistency of configuration items based on relational graph Pending CN114791865A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210346626.2A CN114791865A (en) 2022-04-02 2022-04-02 Method, system and medium for detecting self-consistency of configuration items based on relational graph

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210346626.2A CN114791865A (en) 2022-04-02 2022-04-02 Method, system and medium for detecting self-consistency of configuration items based on relational graph

Publications (1)

Publication Number Publication Date
CN114791865A true CN114791865A (en) 2022-07-26

Family

ID=82462873

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210346626.2A Pending CN114791865A (en) 2022-04-02 2022-04-02 Method, system and medium for detecting self-consistency of configuration items based on relational graph

Country Status (1)

Country Link
CN (1) CN114791865A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115562719A (en) * 2022-12-06 2023-01-03 中国人民解放军国防科技大学 Interface-aware compiling configuration item completion method, system and medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115562719A (en) * 2022-12-06 2023-01-03 中国人民解放军国防科技大学 Interface-aware compiling configuration item completion method, system and medium
CN115562719B (en) * 2022-12-06 2023-04-07 中国人民解放军国防科技大学 Interface-aware compiling configuration item completion method, system and medium

Similar Documents

Publication Publication Date Title
Bergmann et al. Incremental pattern matching in the VIATRA model transformation system
US5691925A (en) Deriving tractable sub-system for model of larger system
JP5444208B2 (en) Method, computer program, and system for editing and compiling business rules
US8997065B2 (en) Automatic modularization of source code
US10394694B2 (en) Unexplored branch search in hybrid fuzz testing of software binaries
US7386836B2 (en) Maintaining multiple valid concurrent serialized object versions
Ráth et al. Live model transformations driven by incremental pattern matching
US9740505B2 (en) Accurate static dependency analysis via execution-context type prediction
JPH08512152A (en) Incremental generation system
JP5567682B2 (en) Normalized version of reuse candidates in graphical state transition diagram model
US20210149857A1 (en) Data pipeline branching
WO2016183109A1 (en) Making a prediction regarding development of a software product
CN112860312A (en) Method and device for detecting item dependency relationship change
Pârțachi et al. Flexeme: Untangling commits using lexical flows
CN114791865A (en) Method, system and medium for detecting self-consistency of configuration items based on relational graph
Bock A literature review of spreadsheet technology
CN112395199B (en) Distributed software instance testing method based on cloud computing and software development platform
US11442845B2 (en) Systems and methods for automatic test generation
JP2019133534A (en) Merging method, merging device, and merging program
CN111026776B (en) Query method and device in relational database
Tukaram Design and development of software tool for code clone search, detection, and analysis
US11494469B2 (en) Ownership assignment for a communication system component
US20220207438A1 (en) Automatic creation and execution of a test harness for workflows
US20230359442A1 (en) Code context assembly
US20230308351A1 (en) Self instantiating alpha network

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination