A method for implementing CMDB multivariate data synchronization based on model mapping

CN114238505BActive Publication Date: 2024-08-23SHANGHAI SNC NET INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111538767.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-15
Publication Date
2024-08-23
Estimated Expiration
2041-12-15

Smart Images

  • Figure CN114238505B
    Figure CN114238505B
Patent Text Reader

Abstract

The present invention discloses a method for implementing CMDB multivariate data synchronization based on model mapping, comprising: step S1: establishing a data synchronization center; step S2: after the producer produces data, the producer writes the data into SFTP in file mode, and pushes the change information to kafka; step S3: the consumer monitors kafka and reads the data for storage; wherein the producer is the data provider, and the consumer is the data consumer. The method for implementing CMDB multivariate data synchronization based on model mapping disclosed by the present invention only needs to adjust the mapping relationship online to complete the adaptation, so that multiple CMDB platforms can be synchronized with each other seamlessly, can quickly adapt to information changes, and avoid secondary development.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a method for realizing data synchronization, and in particular to a method for realizing CMDB multivariate data synchronization based on model mapping. Background Art

[0002] As the IT architecture of enterprises becomes increasingly large, the management of all elements in the IT environment (including application systems, software information, hardware information, business services, personnel, etc.) has become increasingly important. Enterprises usually consider introducing a professional IT asset management platform - CMDB (Configuration Management Database) for management. CMDB is a storage warehouse used to centrally store and manage all entity elements in the IT environment. These elements are called configuration items (CI). In CMDB, each object is described by attributes, and there are various types of associations between objects. These CIs, attributes and relationships are used together to describe the enterprise IT architecture.

[0003] Then, with the business needs and operational requirements of enterprises, more and more platforms are built in the field of IT operation and maintenance, such as monitoring platforms, automated operation and maintenance, automated release, application performance monitoring, etc., and these platforms can be divided into more detailed platforms of different manufacturers and different IT levels, such as using Zabbix to monitor hosts, using Pinpoint to monitor middleware instances, using Solarwinds to monitor network equipment, using DCM (Data Center Management) to monitor servers, etc. In some cases, due to unclear management responsibilities and departmental differentiation, each department may build its own CMDB platform and monitoring platform, and then the actual management objects are overlapped and repeated. All of the above will cause the basic data management to be decentralized, the data lacks centralization and unification, and even the same host may be named inconsistently on platform A and platform B.

[0004] Currently, most CMDB vendors on the market use customized development methods to synchronize with other CMDBs. Through customized APIs or file interactions, they can meet synchronization requirements, but lack flexibility. When the model of either party changes, secondary development must be performed before it can be applied, which greatly increases maintenance costs and reduces maintenance benefits. Summary of the invention

[0005] The purpose of the present invention is to provide a method for realizing CMDB multivariate data synchronization based on model mapping, which can complete the adaptation only by adjusting the mapping relationship online, so that multiple CMDB platforms can be synchronized with each other seamlessly, can quickly adapt to information changes, and avoid secondary development.

[0006] The technical solution adopted by the present invention to solve the above technical problems is to provide a method for realizing CMDB multivariate data synchronization based on model mapping, including step S1: establishing a data synchronization center; step S2: after the producer produces data, the data is written into SFTP in the form of a file, and the change information is pushed to Kafka; step S3: the consumer listens to Kafka and reads the data for storage; wherein, the producer is the data provider and the consumer is the data consumer.

[0007] Furthermore, the step S1 includes: step S11: standardizing the configuration model query interface: each CMDB platform provides a unified configuration model interface to connect with the data synchronization center, and the configuration model interface includes a configuration item tree query interface and a single configuration item query interface; step S12: configuring the interface address of each CMDB platform in the data synchronization center; step S13: obtaining the information of producers and consumers in real time through the unified configuration model interface, and establishing a mapping relationship between producers and consumers online; so that the attributes of the producer correspond to the attributes of the consumer, and the association relationship of the producer corresponds to the association relationship of the consumer.

[0008] Furthermore, when the producer generates new data, step S2 generates a data message according to the mapping relationship established in step S1, and the attribute fields in the message are directly converted into the consumer's model message, and then the message is pushed to SFTP in the form of a file, and the file information is simultaneously pushed to Kafka; in step S3, the consumer determines whether there is new data push by listening to Kafka, and if so, parses the Kafka message, first obtains the data storage path and data file name from the message, and then retrieves the data from SFTP and parses it into the warehouse.

[0009] Furthermore, the unified configuration model interface provided by each CMDB platform is a standard API interface. Step S1 dynamically obtains the model information of each CMDB platform through the standard API interface. When the model information changes, the attribute synchronization and the association relationship synchronization are configured through the visualized model mapping relationship in the web page interface.

[0010] Furthermore, the configuration item tree query interface is used to query the objects managed in the configuration model and the hierarchical relationships between the objects.

[0011] Furthermore, the single configuration item query interface is used to query the attributes and associations of the single configuration item, and the attributes of the single configuration item include host name, IP, management IP, CPU model, resource description, host type, default gateway, operating system version, operating system type, kernel version, memory capacity, operating system disk space, data disk disk space and usage status.

[0012] Furthermore, when the configuration item management granularity of the producer and the consumer is inconsistent, the step S13 further includes filtering the data, and synchronizing the data that meets the filtering conditions.

[0013] Furthermore, step S2 and step S3 are independent steps, and the same CMDB platform can act as both a producer and a consumer, and can perform data production and consumption concurrently.

[0014] Furthermore, the CMDB platforms include: Zabbix: used to monitor hosts; Pinpoint: used to monitor middleware instances; Solarwinds: used to monitor network devices; DCM: used to monitor servers.

[0015] Compared with the prior art, the present invention has the following beneficial effects: the present invention provides a method for implementing CMDB multi-data synchronization based on model mapping, and online configuration of mappings of multiple configuration items, attributes, and management relationships. When the models of both parties change, only the mapping relationship needs to be adjusted online to complete the adaptation, thereby enabling multiple CMDB platforms to be seamlessly synchronized with each other, quickly adapting to information changes, and avoiding secondary development. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 A flow chart of a method for implementing CMDB multivariate data synchronization based on model mapping provided by the present invention;

[0017] Figure 2 Schematic diagram of the generation and flow of multivariate data on each CMDB platform of the present invention;

[0018] Figure 3 Schematic diagram of multivariate data configuration and program processing of each CMDB platform of the present invention. DETAILED DESCRIPTION

[0019] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.

[0020] See also Figure 1 and Figure 2 The present invention provides a method for implementing CMDB multivariate data synchronization based on model mapping, comprising:

[0021] Step S1: Establish a data synchronization center;

[0022] Step S11: Standardize the configuration model query interface: Each CMDB provides a unified configuration model interface to connect with the data synchronization center. The configuration model interface includes a configuration item tree query interface and a single configuration item query interface; the configuration item tree query interface is mainly used to query the hierarchical relationship between management objects in the configuration model. The single configuration item query interface is mainly used to query the attributes and associations of a single configuration item. The main attributes include: host name, IP, management IP, CPU model, resource description, host type, default gateway, operating system version, operating system type, kernel version, memory capacity, operating system disk space, data disk space and usage status, etc.

[0023] Step S12: configuring each CMDB platform interface address in the data synchronization center;

[0024] Step S13: Obtain information about producers and consumers through a standard API, and establish a mapping relationship between attributes and associations between producers and consumers.

[0025] Step S2: After the producer produces data, it writes the data into SFTP in the form of a file, that is, it saves the file to the server through the SFTP protocol and pushes the change information to Kafka;

[0026] Step S3: The consumer listens to Kafka and reads the data for storage;

[0027] Among them, the producer is the data provider, and the consumer is the data consumer.

[0028] The present invention discloses a method for implementing CMDB multivariate data synchronization based on model mapping. By establishing a mapping relationship, data of non-fixed formats generated by model changes between different CMDB platforms can be parsed. When the producer generates data, the configuration model automatically converts the data generated by the producer into the data format of the consumer model, so that the consumer can directly identify the data. In the present invention, there can be multiple producers and consumers in the data synchronization center; after the producer produces the data, the data is written to SFTP in the form of a file, and the change information is pushed to Kafka; the consumer listens to Kafka, receives the message after receiving the message, parses the address in the message, reads the data from SFTP, parses the data and completes the data storage. Since the model of the CMDB platform changes frequently, the format of the pushed data is not fixed. When pushing, it needs to be automatically converted to the consumer's model according to the model configuration, so that the consumer can directly identify the data.

[0029] Please continue to see Figure 3The multi-source data synchronization of the present invention specifically includes the following five processes: standard configuration of model query interface, online configuration of each platform interface address, online configuration of the mapping relationship between producers and consumers, producers push data to the synchronization center, and consumers read data; among them, ①②③ belong to basic configuration work, and ④⑤ belong to program processing.

[0030] ① Standardize the configuration model query interface

[0031] Each CMDB needs to provide a unified configuration model interface for consumption by the synchronization center, including two interfaces

[0032] Configuration item tree query interface: query which objects are managed in the configuration model and the hierarchical relationships between objects.

[0033] Single configuration item query interface, which queries the properties and relationships of a single configuration item.

[0034] ②Configure the interface addresses of each platform online

[0035] Through the page configuration function, configure the interface addresses of each CMDB platform.

[0036] ③ Online configuration of the mapping relationship between producers and consumers

[0037] Through the page configuration function, define the mapping relationship between producers and consumers, and perform mapping configuration for attributes and associations respectively.

[0038] The mapping process supports filtering by filtering conditions, and only data that meets the filtering conditions is synchronized. This is designed to support the situation where the configuration item management granularity of producers and consumers is inconsistent. For example, when producer A is synchronized to consumer B, there are only host configuration items in the A platform, and the B platform is divided into three configuration items of Linux / AIX / Windows according to the operating system type. Then, the data can be distributed to the three configuration items of B through the attribute conditions of A.

[0039] ④Producers push data

[0040] When the producer generates new data, it will produce a message based on the mapping relationship in step ③. The attribute fields in the message are directly converted into the consumer's model message, and the message is pushed to SFTP in the form of a file, and the file information is pushed to Kafka simultaneously.

[0041] ⑤Consumers monitor Kafka and read data for storage

[0042] The consumer monitors Kafka to determine whether there is new data push. If so, it parses the Kafka message, obtains the data storage path and data file name from the message, retrieves the data from SFTP, and parses and stores it in the database.

[0043] The method for implementing CMDB multivariate data synchronization based on model mapping provided by the present invention can achieve the following effects:

[0044] 1) Multiple CMDB platforms can flexibly synchronize data, including synchronization of attributes and relationships; the same CMDB platform can be both a producer and a consumer;

[0045] 2) When any CMDB model changes, the change information can be dynamically obtained through the interface, and the connection can be changed through page configuration to quickly adapt to the change and avoid secondary development;

[0046] 3) Multi-source CMDB uses a unified model query interface, which configures attribute synchronization and relationship synchronization through model mapping relationships on the page, which is intuitive and convenient;

[0047] 4) Dynamically obtain information on each CMDB model through the standard API interface. When the model changes, it can be directly adjusted through page configuration to reduce operation and maintenance costs and improve operation quality.

[0048] Although the present invention has been disclosed as above with preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art may make some modifications and improvements without departing from the spirit and scope of the present invention. Therefore, the scope of protection of the present invention shall be based on the definition of the claims.

Claims

1. A method for implementing CMDB multivariate data synchronization based on model mapping, characterized in that: include: Step S1: Establish a data synchronization center; Step S2: After the producer produces data, it writes the data into SFTP in the form of a file and pushes the change information to Kafka; Step S3: The consumer listens to Kafka and reads the data for storage; The producer is the data provider, and the consumer is the data consumer; The step S1 comprises: Step S11: Standardizing the configuration model query interface: Each CMDB platform provides a unified configuration model interface to connect with the data synchronization center. The configuration model interface includes a configuration item tree query interface and a single configuration item query interface; Step S12: configuring each CMDB platform interface address in the data synchronization center; Step S13: Acquire information of producers and consumers in real time through a unified configuration model interface, and establish a mapping relationship between producers and consumers online, so that the attributes of producers correspond to the attributes of consumers, and the association relationship of producers corresponds to the association relationship of consumers; When the producer generates new data, step S2 generates a data message according to the mapping relationship established in step S1, and the attribute fields in the message are directly converted into the model message of the consumer, and then the message is pushed to SFTP in the form of a file, and the file information is pushed to Kafka simultaneously; in step S3, the consumer determines whether there is new data push by listening to Kafka, and if so, parses the Kafka message, first obtains the data storage path and data file name from the message, and then retrieves the data from SFTP and parses it into the warehouse; The unified configuration model interface provided by each CMDB platform is a standard API interface. Step S1 dynamically obtains the model information of each CMDB platform through the standard API interface. When the model information changes, the attribute synchronization and the association relationship synchronization are configured through the visualized model mapping relationship in the web page interface. The configuration item tree query interface is used to query the objects managed in the configuration model and the hierarchical relationships between the objects; The single configuration item query interface is used to query the attributes and associations of the single configuration item. The attributes of the single configuration item include host name, IP, management IP, CPU model, resource description, host type, default gateway, operating system version, operating system type, kernel version, memory capacity, operating system disk space, data disk disk space and usage status.

2. The method for implementing CMDB multivariate data synchronization based on model mapping according to claim 1, characterized in that: When the configuration item management granularity of the producer and the consumer is inconsistent, the step S13 further includes filtering the data, and synchronizing the data that meets the filtering conditions.

3. The method for implementing CMDB multivariate data synchronization based on model mapping as claimed in claim 1, characterized in that: The steps S2 and S3 are independent of each other. The same CMDB platform can act as both a producer and a consumer, and can perform data production and consumption simultaneously.

4. The method for implementing CMDB multivariate data synchronization based on model mapping as claimed in claim 1, characterized in that: Each CMDB platform includes: Zabbix: used to monitor the host; Pinpoint: used to monitor middleware instances; Solarwinds: used to monitor network devices; DCM: used to monitor the server.