Method for expanding CMDB configuration classification as required and automatically establishing relationship
Technical Field
The invention relates to the management field of a configuration management database, in particular to a method for expanding CMDB configuration classification as required and automatically establishing a relationship.
Background
A cmdb (configuration Management database) is a set of logical databases for enterprise IT to record, manage and maintain various configuration items, life cycles and association relations inside the enterprise. Most of traditional CMDB databases can only record hardware information, such as servers, network equipment, firewalls, storage information and the like, and the upgraded CMDB can also record information of middleware, databases and the like, and manually establishes contact through the combination of the software and hardware information to realize a service TOPO topological graph.
With the coming of the cloud era in recent years, the micro-service architecture falls to the ground due to the container technology, the current IT architecture is more and more complex, and the development is faster and the change is faster in the future; the traditional CMDB can not meet the requirements of IT architecture, and if the CMDB is required to be upgraded every time a new technology comes out, the following problems can be caused:
1. the cost is high, the traditional CMDB can be customized and developed to classify the managed configuration items and add new configuration items, and the process usually takes a long time and much labor input;
2. if the method can not keep pace with the era forever, if the quick response cannot be realized, the new era comes when a new configuration item of the IT framework is upgraded, and the CMDB can only keep pace with the development of the era forever and cannot make progress with the era;
3. the relation is difficult to be combed, the relation is cloud-based, the relation between the hardware and the hardware is not simply direct connection after containerization, the service systems are operated on the cloud, the relation between the hardware and the service systems is difficult to be determined, and the traditional CMDB relation management cannot meet the requirements.
Therefore, a simple and easy-to-operate method for classifying chronological extensions and automatically establishing relationships of CMDB configurations is needed to solve the problems.
Disclosure of Invention
The present invention is directed to a method for expanding CMDB configuration classification as needed and automatically establishing relationships, so as to solve the problems in the background art.
In order to solve the technical problems, the invention provides the following technical scheme: a CMDB configuration classification on-demand expansion and automatic relationship establishment method comprises the following steps:
step S1, the CMDB provides a model management function for the user, adjusts the data model according to the self-demand of the user, carries out the self-establishment of the model, adds the attribute in the CMDB, and carries out the self-establishment classification, the attribute classification and the attribute definition;
step S2, obtaining the sub-classification through step S1, and judging whether the obtained sub-classification is the shared classification attribute in the CMDB, wherein all the sub-classifications inherit the attribute classification and the attribute definition on the parent classification;
step S3, obtaining the fixed classification or classification attribute through step S2, adding CODE for the fixed classification or classification attribute according to the self requirement of the user, transmitting the configured CODE to an interface, and returning the corresponding classification or attribute;
and step S4, when the sub-classification is modified, synchronously updating the modification information to the attributes corresponding to all the sub-classifications through the fixed CODE attribute, and automatically binding through the relationship to form a service TOPO topological graph.
Further, the step S1 includes the following steps:
step S11, adjusting a system data model according to the self demand of a user, and dividing the data model into a picture data model and a tree structure data model, wherein the picture data model is used for displaying pictures of corresponding classifications, each classification can be established as a sub-classification, and the hierarchy of the sub-classification is not limited;
in step S12, a classification is created from the data model in step S11 and classified into different data models.
Preferably, in step S11, the picture data model directly shows the pictures of the corresponding classification, each classification in the tree structure data model can create a sub-classification without hierarchical limitation, and at the same time, each classification can create an attribute and an attribute sub-classification, and the attributes are divided by attribute classification;
in the step S12, when classification is performed, the attribute is classified according to whether the attribute classified is the common classification, when the attribute is the common attribute classification, the step S22 is performed, and when the attribute does not belong to the common attribute classification, the step S23 is performed, and the attribute is classified according to the attribute classification, so that inconvenience in use due to too many attributes put together is avoided, and meanwhile, the attribute classification can more clearly display the attribute.
Further, the step S2 includes the following steps:
step S21, in the system data model, directly defining the attribute, defining the attribute as CI (config information), and selecting the attribute classification corresponding to CI;
step S22, according to the classification created in the step S12 and the attribute classification in the step S21, all the child classifications directly inherit all the attribute classifications and attributes on their parent classifications, and determine a classification operation;
in step S23, a new attribute classification is directly added to the sub-classification corresponding to the attribute.
Preferably, in step S21, when a CI is newly added, after the CI selects other CIs in the corresponding attribute classification, the selected CI automatically establishes a relationship with the newly added CI;
in step S22, when the child class inherits all the attribute classes of the parent class, only the related attributes can be inherited, and the deletion operation cannot be performed, and meanwhile, when the child class inherits, only some attributes of the parent class have modification rights, including an attribute alias, whether to fill in, whether to display, and whether to edit.
Further, the step S3 includes the following steps:
step S31, the user freely adds attribute classification according to the own requirement, when the program needs to directly obtain a classification, a fixed attribute CODE is set for processing, and the program obtains the required attribute or the attribute classification through the CODE;
step S32, judging whether the attribute or the attribute classification acquired in the step S31 has a sub classification, wherein the sub classification inherits the CODE of the attribute of the father classification;
step S33, the program acquires all the required attribute classifications or attributes through the CODE, and the program transmits the acquired attribute classifications or attributes to the return interface through the corresponding interface, and returns the corresponding classifications or attributes to the client.
Preferably, the step S32 includes the steps of:
step S321, the acquired attribute or attribute classification has a sub-classification, the CODE of the inheritance attribute of the sub-classification is modified to be the same as the CODE of the father classification, and the step S33 is entered;
in step S322, the acquired attribute or attribute classification has no sub-classification, and the process proceeds directly to step S33.
Further, the step S4 includes the following steps:
step S41, when the program executes steps S1-S3, the attribute or attribute classification in the father classification will be changed correspondingly, when the attribute in the father classification is changed, and the son classification inherits through the CODE, the modified content in the father classification is synchronized to the corresponding attribute of all the related son classifications;
and S42, automatically binding the current attribute and the selected attribute through the CI in the step S21, combining different attribute classifications to form a service TOPO topological graph, and combing the relationship through the attribute and the attribute classification by taking the direct relationship as the main relationship in the service TOPO topological graph to complete the configuration of the CMDB.
Compared with the prior art, the invention has the following beneficial effects:
1. the invention can expand various resources to be managed along with the development technology of the technology without subsequent development and development, and the user only needs to configure the resources by configuring the corresponding classification and attribute in the CMDB;
2. the service TOPO topological graph is automatically associated through CI attributes, when a new component is added into the service in a system program, only corresponding classification and attributes are required to be configured, meanwhile, the associated attributes are correspondingly configured, and the new service TOPO topological graph can be displayed only through automatic association, so that the whole process is simple and convenient, and a lot of configuration time is saved;
3. when partial attributes or classifications are found and need to be called by programs, only corresponding CODEs are needed to be configured, CMDB classifications and attributes are constructed according to the requirements of users, certain similarity exists among different user requirements, but the similarity is different, and the CMDB can be used in a ready-to-use mode.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the principles of the invention and not to limit the invention. In the drawings:
FIG. 1 is a flow chart of a method for expanding CMDB configuration classes on demand and automatically establishing relationships according to the present invention;
FIG. 2 is a schematic diagram of an attribute adding structure in an embodiment of a method for expanding CMDB configuration classification as needed and automatically establishing relationships according to the present invention;
FIG. 3 is a schematic diagram of a structure of a category setting or attribute CODE in an embodiment of a method for expanding CMDB configuration categories as needed and automatically establishing relationships according to the present invention;
figure 4 is a service TOPO topology generated in an embodiment of a method of the present invention for CMDB configuration class on-demand expansion and automatic relationship establishment.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Example (b):
referring to fig. 1-4, the present invention provides a method for expanding CMDB configuration classes as needed and automatically establishing relationships, comprising the following steps:
the method for expanding CMDB configuration classification as required and automatically establishing the relationship comprises the following steps:
step S1, the CMDB provides a model management function for the user, adjusts the data model according to the user' S own requirements, carries out the self-establishment of the model, adds the attributes in the CMDB, and carries out the self-establishment classification, the attribute classification and the attribute definition, which concretely comprises the following steps:
step S11, adjusting a system data model according to the self demand of a user, dividing the data model into a picture data model and a tree structure data model, wherein the picture data model is used for displaying the pictures of corresponding classification, the picture data model directly displays the pictures of corresponding classification, each classification in the tree structure data model can create sub-classifications without hierarchical limitation, meanwhile, attributes and attribute sub-classifications can be created under each classification, and the attributes are divided through attribute classification;
and step S12, creating classification according to the data model in the step S11, classifying the classification into different data models, classifying the classification according to whether the attribute of the attribute classification is the shared classification when the classification is performed, entering the step S22 when the attribute is the shared attribute classification, and entering the step S23 when the attribute does not belong to the shared attribute classification.
The CMDB classification researched from the client is combed with the attributes, more than 60% of the attributes commonly owned by the child classification are configured on the parent classification, so that the child classification inherits the attributes, and the classifications can be set not to be displayed for the child classification without the attributes.
Step S2, obtaining the sub-classification through step S1, judging whether the obtained sub-classification is the shared classification attribute in the CMDB, all the sub-classifications inherit the attribute classification and the attribute definition on the parent classification, including the following steps:
step S21, in the system data model, directly defining the attribute, defining the attribute as CI (Configinformation), selecting the attribute classification corresponding to the CI, and when the CI is newly added, automatically establishing the relationship between the selected CI and the newly added CI after the CI selects other CI in the corresponding attribute classification;
and step S22, according to the classification created in the step S12 and the attribute classification in the step S21, all the child classifications directly inherit all the attribute classifications and attributes on the parent classification, and determine classification operation, wherein when the classification inherits all the attribute classifications of the parent classification, only the related attributes can be inherited, and deletion operation cannot be carried out, and meanwhile, when the child classification inherits, only a few attributes of the parent classification have modification authority, including attribute alias, whether to fill in, whether to display or not, and whether to edit.
Step S23, adding new attribute classification directly on the sub-classification corresponding to the attribute;
step S3, obtaining the fixed classification or classification attribute through step S2, adding CODE to the fixed classification or classification attribute according to the user' S own requirement, transmitting the configured CODE to the interface, and returning the corresponding classification or attribute, including the following steps:
step S31, the user freely adds attribute classification according to the own requirement, when the program needs to directly obtain a classification, a fixed attribute CODE is set for processing, and the program obtains the required attribute or the attribute classification through the CODE;
step S32, determining whether the attribute or the attribute classification obtained in step S31 has a child classification, where the child classification inherits the CODE of the attribute of the parent classification, and includes:
step S321, the acquired attribute or attribute classification has a sub-classification, the CODE of the inheritance attribute of the sub-classification is modified to be the same as the CODE of the father classification, and the step S33 is entered;
step S322, the obtained attributes or attribute classifications have no sub-classifications, and the process directly enters step S33;
step S33, the program acquires all the required attribute classifications or attributes through the CODE, and the program transmits the acquired attribute classifications or attributes to the return interface through the corresponding interface, and returns the corresponding classifications or attributes to the client.
The classification and the attribute are self-established by a user, when a program needs to acquire a certain specific classification or attribute, the classification or attribute cannot be directly acquired, at this time, a CODE agreed with the program needs to be configured for the classification or attribute, and after the CODE is configured on the correct classification or attribute, the program can directly acquire the required classification or attribute through the CODE of the classification or attribute.
Step S4, when the sub-classification is modified, the modified information is synchronously updated to the attributes corresponding to all the sub-classifications through the fixed CODE attribute, and the modified information is automatically bound through the relationship to form a service TOPO topological graph, which includes the following steps:
step S41, when the program executes steps S1-S3, the attribute or attribute classification in the father classification will be changed correspondingly, when the attribute in the father classification is changed, and the son classification inherits through the CODE, the modified content in the father classification is synchronized to the corresponding attribute of all the related son classifications;
step S42, automatically binding the current attribute and the selected attribute through the CI in the step S21, combining different attribute classifications to form a service TOPO topological graph, wherein in the service TOPO topological graph, the direct relationship is taken as the main relationship, and the relationship is combed through the attribute and the attribute classification to complete the configuration of the CMDB;
taking the direct relation as a main relation, establishing the direct relation as 1: n, for example, a virtual machine and an entity machine, because there are multiple virtual machines on one entity machine, an attribute, called an attached entity machine, may be set on the virtual machine during the carding, and in this attribute, the entity machine to which the virtual machine is attached is filled, and the configuration may be completed; for example, a physical machine and a switch, there are multiple physical machines connected with it, so when the relationship is combed, an attribute called a connection network device can be set on the physical machine, and in this attribute, the network device connected with the physical machine is filled in, and the setting can be completed, and so on, a service TOPO topological diagram is formed, and the configuration of the CMDB is realized.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof. The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned.