CN109710676A - Data capture method, device and the electronic equipment of CMDB model - Google Patents

Data capture method, device and the electronic equipment of CMDB model Download PDF

Info

Publication number
CN109710676A
CN109710676A CN201811606744.2A CN201811606744A CN109710676A CN 109710676 A CN109710676 A CN 109710676A CN 201811606744 A CN201811606744 A CN 201811606744A CN 109710676 A CN109710676 A CN 109710676A
Authority
CN
China
Prior art keywords
rest
field
data
configuration
target
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.)
Granted
Application number
CN201811606744.2A
Other languages
Chinese (zh)
Other versions
CN109710676B (en
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.)
New H3C Technologies Co Ltd
Original Assignee
New H3C Technologies Co Ltd
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 New H3C Technologies Co Ltd filed Critical New H3C Technologies Co Ltd
Priority to CN201811606744.2A priority Critical patent/CN109710676B/en
Publication of CN109710676A publication Critical patent/CN109710676A/en
Application granted granted Critical
Publication of CN109710676B publication Critical patent/CN109710676B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

Present disclose provides data capture method, device and the electronic equipments of a kind of CMDB model, are related to O&M technical field, this method comprises: obtaining the configuration file of target CMDB model;Wherein, configuration file includes that data provide the corresponding relationship of the REST interface message at end and the configuration field of target CMDB model and REST field;It is provided according to REST interface message from data and obtains the corresponding REST data of REST field in end;According to corresponding relationship, the corresponding configuration field for being stored in target CMDB model of the REST data that will acquire.The disclosure can effectively promote the allocative efficiency of CMDB model.

Description

Data capture method, device and the electronic equipment of CMDB model
Technical field
This disclosure relates to O&M technical field, more particularly, to data capture method, device and the electricity of a kind of CMDB model Sub- equipment.
Background technique
CMDB (Configuration Management Database configuration management database) is the core of operational system The heart lays particular emphasis on management and (such as, acquires, integrates, record, maintenance, examining, update etc.) data, can receive the various of pipe operational system Assets and on-line off-line equipment etc..
Typically, CMDB include there are many CMDB model, the incidence relation between different CMDB models and each The rule etc. of model.Wherein, CMDB model is a series of combination of configuration fields, and different configuration fields has not for storing With the data of practical significance.CMDB model may include CMDB manufacturer CMDB model preset before CMDB factory, can also wrap Self-definition model containing client.Self-definition model can be client and be adjusted according to actual needs to preset CMDB model (such as, increasing and decreasing configuration field) resulting CMDB model or the complete self-built CMDB model of client.For preset CMDB mould Type can obtain automatically the corresponding data of configuration field by preset program.And for self-definition model, it usually needs people Work searches the data stored needed for configuration field, the inefficiency of this data acquiring mode.
Disclosure
In view of this, data capture method, device and the electronics for being designed to provide a kind of CMDB model of the disclosure are set It is standby, it can effectively promote the data acquisition efficiency of CMDB model.
To achieve the goals above, the embodiment of the present disclosure the technical solution adopted is as follows:
In a first aspect, the embodiment of the present disclosure provides a kind of data capture method of CMDB model, this method is applied to fortune Maintain system, comprising: obtain the configuration file of target CMDB model;Wherein, configuration file includes that data provide the REST interface at end The corresponding relationship of the configuration field and REST field of information and target CMDB model;It is mentioned according to REST interface message from data For obtaining the corresponding REST data of REST field in end;According to corresponding relationship, the corresponding storage of the REST data that will acquire is to target The configuration field of CMDB model.
Second aspect, the embodiment of the present disclosure also provide a kind of configuration device of CMDB model, which is applied to O&M system System, comprising: file acquisition module, for obtaining the configuration file of target CMDB model;Wherein, configuration file includes that data provide The corresponding relationship of the REST interface message at end and the configuration field of target CMDB model and REST field;Data acquisition module, The corresponding REST data of REST field are obtained in end for providing according to REST interface message from data;Configuration module is used for root According to corresponding relationship, the corresponding configuration field for being stored in target CMDB model of the REST data that will acquire.
The third aspect, the embodiment of the present disclosure provide a kind of electronic equipment, including processor and machine readable storage medium, Machine readable storage medium is stored with the machine-executable instruction that can be executed by processor, and processor executes the executable finger of machine Enable the method to realize first aspect.
Fourth aspect, the embodiment of the present disclosure provide a kind of machine readable storage medium, machine readable storage medium storage There is machine-executable instruction, when being called and being executed by processor, machine-executable instruction promotes to handle machine-executable instruction The method of device realization first aspect.
The embodiment of the present disclosure provides configuration method, device and the electronic equipment of a kind of CMDB model, first acquisition target The configuration file of CMDB model, and provide end acquisition REST field from data according to the REST interface message in configuration file and correspond to REST data, and according to the configuration field of model in configuration file and the corresponding relationship of REST field, the REST that will acquire The corresponding configuration field for being stored in target CMDB model of data.This mode can obtain automatically CMDB model according to configuration file Required REST data, and by the corresponding configuration field for being stored in CMDB model of REST data, it is artificial compared to time-consuming and laborious The mode for obtaining data, can effectively promote the data acquisition efficiency of CMDB model.
Other feature and advantage of the embodiment of the present disclosure will illustrate in the following description, alternatively, Partial Feature and excellent Point can deduce from specification or unambiguously determine, or the above-mentioned technology by implementing the embodiment of the present disclosure can obtain Know.
To enable the above objects, features, and advantages of the disclosure to be clearer and more comprehensible, preferred embodiment is cited below particularly, and cooperate Appended attached drawing, is described in detail below.
Detailed description of the invention
It, below will be to specific in order to illustrate more clearly of disclosure specific embodiment or technical solution in the prior art Embodiment or attached drawing needed to be used in the description of the prior art be briefly described, it should be apparent that, it is described below Attached drawing is some embodiments of the disclosure, for those of ordinary skill in the art, before not making the creative labor It puts, is also possible to obtain other drawings based on these drawings.
Fig. 1 shows a kind of data capture method flow chart of CMDB model provided by the embodiment of the present disclosure;
Fig. 2 shows a kind of generation method flow charts of configuration file provided by the embodiment of the present disclosure;
Fig. 3 shows a kind of data acquisition schematic diagram of self-definition model provided by the embodiment of the present disclosure;
Fig. 4 shows the data capture method flow chart of another kind CMDB model provided by the embodiment of the present disclosure;
Fig. 5 shows a kind of structural block diagram of the data acquisition facility of CMDB model provided by the embodiment of the present disclosure;
Fig. 6 shows the structural block diagram of the data acquisition facility of another kind CMDB model provided by the embodiment of the present disclosure;
Fig. 7 shows the structural schematic diagram of a kind of electronic equipment provided by the embodiment of the present disclosure.
Specific embodiment
To keep the purposes, technical schemes and advantages of the embodiment of the present disclosure clearer, below in conjunction with attached drawing to the disclosure Technical solution be clearly and completely described, it is clear that described embodiment is disclosure a part of the embodiment, rather than Whole embodiments.Based on the embodiment in the disclosure, those of ordinary skill in the art are not making creative work premise Under every other embodiment obtained, belong to the disclosure protection range.
Only fixed configurations have CMDB model (and can be described as preset CMDB model), operation maintenance personnel to traditional operational system mostly Data acquiring mode would generally be pre-set to such CMDB model, realize that the fixed configurations of CMDB model such as enable CMDB Model directly obtains data from presetting database.If client becomes existing CMDB model according to self-demand More, such as, required configuration field is increased newly in existing CMDB model, then need manually to go to search the CMDB mould after changing again Data needed for type then need to reacquire again since data may irregularly change, thus maintenance workload compared with Greatly, the manual type inefficiency of data is obtained for CMDB model.
To improve the above problem, data capture method, device and the electricity of a kind of CMDB model that the embodiment of the present disclosure provides Sub- equipment, this method can make CMDB model obtain required data automatically, can also effectively be promoted while saving human cost Data acquisition efficiency, below describes to the embodiment of the present disclosure in detail.
A kind of data capture method flow chart of CMDB model shown in Figure 1, this method are applied to operational system, packet Include following steps:
Step S102 obtains the configuration file of target CMDB model;Wherein, which includes that data provide end The corresponding relationship of the configuration field and REST field of REST interface message and target CMDB model.
In the specific implementation, it can be searched from the designated position in operational system and the configuration of target CMDB Model Matching File, the configuration file can be the user demand previously according to target CMDB model and be arranged.May include in configuration file There are data to provide REST (RE presentational State Transfer, the transfer of the performance layer state) interface message at end, Data, which provide end, can be operational system itself, be also possible to third party system or designated equipment.
REST interface message may include the interface identifier and the corresponding REST field of REST interface of REST interface, configuration File, which can wrap, needs the automatic configuration field for obtaining data, and REST word corresponding with configuration field containing CMDB model Section.In the present embodiment, configuration field is the field of CMDB model setting, and REST field provides the field of end setting for data. It is understood that the field name for storing same data of different defaults may be different, such as, for A equipment Mark " A1 " for, the configuration field in CMDB model for storing " A1 " is " device id ", and data provide end for depositing The REST field for storing up " A1 " is " id ".
In the present embodiment, the configuration field and REST field for storing same data have corresponding relationship.
For ease of understanding, reference can be made to the corresponding relationship of configuration field shown in table 1 and REST field:
Table 1
Configuration field Device id IP address Device mask Model Series ……
REST field id ip mask typeName symbolName ……
As shown in table 1, the first row indicates configuration field (being referred to as configuration item attribute), and the second row indicates REST field (alternatively referred to as interface attributes);Such as, the configuration field of target CMDB is " device id ", and corresponding REST field is " id "; The configuration field of target CMDB model is " model ", and corresponding REST field is " typeName ".
Step S104 is provided from data according to above-mentioned REST interface message and is obtained the corresponding REST number of REST field in end According to.Wherein, the data being stored in REST field may be simply referred to as REST data.
Can interface identifier according to the REST interface in REST interface message and its corresponding REST field, needed for determining The REST interface of calling and its corresponding data of REST field (that is, REST data) that can be obtained from data offer end. In practical applications, it can wrap the interface identifier containing multiple REST interfaces in configuration file, different REST interfaces can correspond to Different REST fields, and the data of REST interface docking provide end difference, such as, some REST interfaces directly dock local fortune System is maintained, data can be obtained from operational system;Some REST interfaces directly dock the third party system of client's deployment, can be from the Data are obtained in three method, systems.Wherein, operational system and third party system can be regarded as data and provide end.Operational system passes through REST interface from data provide end in obtain data when, can be by REST interface from data provide end in designated position (such as position of specified database or other storage information) obtains data.
Therefore, REST interface and the corresponding REST field of REST interface can be determined according to REST interface message first; Then the REST data that end obtains the corresponding REST field of the REST interface are provided from data by the REST interface after determining.Its In, REST interface and REST field are one-one relationship or many-one relationship.
Step S106, according to above-mentioned corresponding relationship, the REST data correspondence that will acquire is stored in matching for target CMDB model Set field.Such as, getting the corresponding REST data of REST field " id " by REST interface is " 2 ", then by " 2 " corresponding storage In the configuration field " device id " of target CMDB model.The corresponding REST data of REST field " ip " are got by REST interface For " 172.24.5.103 ", then " 172.24.5.103 " is corresponded to the configuration field " IP address " for being stored in target CMDB model.
The data capture method for the above-mentioned CMDB model that the embodiment of the present disclosure provides, can obtain target CMDB model first Configuration file, and provide end from data according to the REST interface message in configuration file and obtain the corresponding REST number of REST field According to, and according to the configuration field of model in configuration file and the corresponding relationship of REST field, the REST data that will acquire are corresponding It is stored in the configuration field of target CMDB model.Needed for this mode can obtain automatically CMDB model according to configuration file REST data, and by the corresponding configuration field for being stored in CMDB model of REST data, improve the data acquisition effect of CMDB model Rate.
In practical applications, the step of obtaining the configuration file of target CMDB model, if may include: to meet triggering item Part searches the corresponding configuration file of model name of target CMDB model from designated position.In the designated position of operational system In can store in advance give each CMDB model foundation configuration file.
This gives the illustrative trigger conditions of following two:
Trigger condition 1: data acquisition instruction is received.Data acquisition instruction can be to be initiated by user, practical application In, user can instruct to the data acquisition that operational system initiates target CDMB model according to demand.
Trigger condition 2: reach preset data obtaining time.It is understood that data obtaining time can be set in advance Fixed, such as, presetting data obtaining time is weekly a whole morning 10:00;Or preset data obtaining time be Monday, Wednesday, Friday sometime etc., specifically can flexible setting according to actual needs, be not limited herein.
If meeting trigger condition and the model name for finding target CMDB model in designated position corresponding being matched File is set, then configuration file obtains successfully.It is understood that the configuration file of CMDB model is all to deposit in advance in the present embodiment Storage is in the designated position of operational system.CMDB model is to data needed for obtaining, it is necessary first to search its corresponding configuration text Part, the mode of data needed for determining acquisition so as to the REST interface message that the data according to recorded in configuration file provide end, And required data are stored according to the corresponding relationship of the configuration field and REST field that are recorded in configuration file and are matched accordingly It sets in field.
In following embodiments of the application, a kind of implementation specifically generated to configuration file is illustrated.Such as Fig. 2 institute Show, the generation step of configuration file can refer to following steps execution:
Step S202 obtains the customized information of target CMDB model, wherein include in customized information The demand configuration field of target CMDB model.User can configuration field needed for self-setting model according to actual needs.
Step S204 filters out the corresponding relationship of pre-set configuration field Yu REST field from demand configuration field In include configuration field, using the corresponding REST field of the configuration field filtered out as target REST field.
It is understood that user's demand configuration field of self-setting model, but the need of some users according to demand Asking configuration field that may not have corresponding REST field namely such demand configuration field in data offer end is O&M What system was difficult to obtain, it is therefore desirable to the configuration field that model can obtain automatically is combed out from demand configuration field.Usually For, operational system is previously provided with the corresponding relationship of retrievable configuration field Yu REST field, therefore can configure from demand The configuration field that corresponding relationship is included is filtered out in field, the configuration field filtered out is that operational system can be carried out to model The field of configuration.
For ease of understanding, exemplary illustration is as follows: operational system is previously provided with pair of 5 groups of configuration fields and REST field It should be related to, respectively shown in the following table 2:
Table 2
Configuration field A1 A2 A3 A4 A5
REST field B1 B2 B3 B4 B5
As shown in table 2, configuration field A1 corresponds to REST field B1;Configuration field A2 corresponds to REST field B2;Configuration field A3 corresponds to REST field B3;Configuration field A4 corresponds to REST field B4;And configuration field A5 corresponds to REST field B5.
For configuration field (A1~A5) in the above correspondence relationship, show that operational system has determined that and these configurations The corresponding REST field of field, operational system are possible to get what REST field corresponding with these configuration fields was stored REST data, and for configuration field (assuming that A7) not in the above correspondence relationship, then show that operational system is difficult to really at present Fixed REST field corresponding with configuration field A7, it is even more impossible to obtain the REST data that can be stored in configuration field A7.Such as, false If user is that the demand configuration field of CMDB model setting is A1, A2, A3 and A7, operational system pre-set is matched according to above-mentioned The corresponding relationship of field Yu REST field is set, configuration field A1, A2 and A3 can be filtered out from demand configuration field and is used as has The target configuration field of data may be got, and using REST field B1, B2 and B3 as target REST field;And directly will The configuration field A7 that determination can not get data is deleted.
Step S206 searches the corresponding target REST of target REST field from the existing REST interface of operational system and connects Mouthful.
Operational system may there are many REST interfaces, every kind of REST interface to be corresponding with one or more REST fields, therefore Target REST interface corresponding with target REST field can be searched from existing REST interface, as target CMDB model Corresponding target REST interface.If target REST field does not find REST interface, illustrate to mention for Interface limits, data It can not be obtained for reasons, target REST fields such as end limitations.Such as, S204 matches from the demand of user setting through the above steps Setting and filtering out target configuration field in field is A1, A2 and A3, determines that target REST field is B1, B2 and B3;But in step The corresponding target REST interface C1 of target REST field B1, the corresponding target of target REST field B2 have been looked only in S206 REST interface C2 does not find the corresponding REST interface of target REST field B3, then shows that target can not be obtained by interface The data of REST field B3, namely the data stored needed for configuration field A3 can not be got.At this time then by need set by user The configuration field A3 in configuration field is asked to delete.
Configuration field corresponding to the corresponding REST field of target REST interface is determined as target CMDB by step S208 The configuration field of model.The configuration field of target CMDB model as through the above steps S204 and S206 is to demand configuration field Carry out the configuration field that data can be got automatically by interface obtained after Double Selection.Such as, although the demand of user Configuration field is A1, A2, A3 and A7;But the screening of S204 and S206 through the above steps, determine that operational system is only capable of automatically The corresponding data of configuration field A1 and A2 are found, therefore configuration field A1 and A2 are determined as to the configuration words of target CMDB model Section, and configuration field A3 and A7 are directly deleted.Step S210, configuration field and REST field based on target CMDB model Corresponding relationship and target REST interface generate the configuration file of target CMDB model.The configuration file includes that data provide Pair of the REST interface message (information of target REST interface) at end and the configuration field of target CMDB model and REST field It should be related to.Such as, include in the configuration file corresponding relationship of configuration field A1 and REST field B1, configuration field A2 and The corresponding relationship and target REST interface C1 of REST field B2 and interface identifier, the interface of target REST interface C2 are corresponding Data provide the interface messages such as end.
After the configuration file for generating target CMDB model through the above way, configuration file can be stored in specific bit It sets, obtains data whenever target CMDB model needs are automatic, corresponding configuration file can be searched from designated position, and Based on data needed for information automated lookup included in configuration file.
Above-mentioned configuration file can be the configuration file of non-markup languages YAML format.Wherein, YAML is " YAML Ain't The characteristics of recurrence of a Markup Language " (YAML is not markup language) a kind of is abridged, YAML language is storage organization Clearly, occupied space is few;Configuration file is more succinct efficient using YAML language construction.It certainly, in practical applications can also be with Configuration file is constituted using other Languages (such as expandable mark language XML), is not limited herein.
This gives a kind of specific examples that CMDB model is configured by YAML configuration file, wherein should YAML configuration file is stored under particular category in advance.In the configuration file, REST data have preset with configuration field Corresponding relationship, and record has REST interface message.
Wherein, REST interface is identified as/imcrs/plat/res/device/ in the present embodiment, which is mainly used for Obtain the data information of interchanger.Corresponding relationship can refer to shown in table 1, in addition to this it is possible to there is following corresponding relationship, Such as, configuration field is " alarm status ", and corresponding REST field is " status ";Configuration field is " ci_common_ Name " (indicates adopted name), and corresponding REST field is " symbolName " etc..It is understood that the above is only piece Example is lifted, is not construed as limiting.It in practical applications, can also include related text description in REST interface message, By taking alarm status as an example, reference can be made to shown in table 3:
Table 3
-1 0 1 2 3 4 5
It does not manage It is unknown Normally Warning It is secondary It is important Seriously
The REST data that the first behavior configuration field " alarm status " in table 3 may be stored, the second row characterize each REST The corresponding practical significance of data.Such as, if the REST data that REST interface returns to configuration field " alarm status " are " -1 ", The practical significance for the data characterization that then configuration field " alarm status " is stored is " not managing ";If returning to configuration field The data of " alarm status " are " 1 ", then the practical significance for the data characterization that configuration field " alarm status " is stored is " normal "; If the data for returning to configuration field " alarm status " are " 5 ", the data characterization that configuration field " alarm status " is stored Practical significance be " serious ".
Configuration field may include " CiTypeName: my interchanger ", corresponding REST interface in YAML configuration file Type be " ConnectType:1 ", the type characterization REST interface temporarily open to the outside world at present.Further can also include The following information of REST interface: if the IP of REST interface is the machine 127.0.0.1 or localhost (local host), CMDB model can obtain the information such as communication protocol and communication port numbers automatically.
Can record configuration field needed for having self-definition model in YAML configuration file, configuration field can with it is multiple REST interface is corresponding, and the main REST interface in multiple REST interfaces can configure QueryAllData (inquiring all data), to Ensure that CMDB model can obtain automatically data by main REST interface synchronization, remaining REST interface can not configure QueryAllData." QueryAllData " in the present embodiment is the keyword in REST interface, can pass through keyword QueryAllData positions the URL (Uniform Resource Locator, resource identifier) of REST interface, typically, The URL of REST interface can be behind keyword QueryAllData.Once finding keyword QueryAllData The URL of REST interface is found, obtains data so as to provide end from data by the URL of REST interface.
CMDB model in operational system, can be by above-mentioned when providing end acquisition data from data by REST interface The URL of REST interface obtains required REST data, and operational system can also further compare CMDB model and obtain in different moments The difference between data got, and comparison result is showed into user.Such as, it is current can to compare CMDB model for operational system Difference between the data of acquisition and the last historical data obtained, to judge whether the corresponding data of configuration field become Change, and the changed configuration field of data is supplied to user.In practical applications, operational system can be every time to CMDB The data and the last historical data obtained that model currently obtains carry out comparison in difference, are also possible to receiving user's sending Audit instruction when, the data and the last historical data obtained just currently obtained to CMDB model carry out comparison in difference.
Data needed for CMDB model in the present embodiment can obtain automatically according to configuration file and by REST interface, it is real Existing data are synchronous, can also compare the otherness of the data of different times acquisition, help to make operation maintenance personnel is clearer to know Data situation.
The present embodiment additionally provides a kind of data acquisition schematic diagram of self-definition model as shown in Figure 3, illustrates certainly The data source of the CMDB model of definition mainly has: the data source in customized source and preset model.Wherein, the present embodiment will be The data that CMDB model provides data provide end and are known as data source, as shown in figure 3, data source may include customized source and preset The data source of model;Wherein, customized source is that the data of data needed for being capable of providing self-definition model provide end, preset model Data source is that the data of data needed for being capable of providing preset model provide end.Due to that may include that part is pre- in self-definition model The configuration field of model is set, therefore is also required to obtain data from the data source of preset model.Customized CMDB mould in Fig. 3 Type can be what client obtain after customized change to preset model according to demand, which can lead to The YAML configuration file for crossing embodiment of the present disclosure offer obtains data from customized source, can also use preset program (code) Data are obtained from data source bound in pre-manufactured model before changing.In addition to this, CMDB model is further illustrated in Fig. 3 can also Data are obtained by manual maintenance mode.
In the specific implementation, data instance is obtained by configuration file with customized CMDB model, referring to as shown in Figure 4 CMDB model data capture method flow chart, this method be applied to operational system, comprising the following steps:
Step S402 judges whether to configure current YAML configuration file to target CMDB model.If so, executing step S404;If not, terminating.When it is implemented, according to the title of CMDB model and the current of designated position can be stored in The type of YAML configuration file judges whether CMDB model matches with current YAML configuration file.If it does, then mesh can be given It marks CMDB model and carries out file configuration, if it does not match, terminating current process.Only finding and target CMDB model After the configuration file matched, then it is initially configured target CMDB model.It is understood that being stored with various configurations text in designated position Part can search configuration file corresponding with target CMDB model when being configured to target CMDB model one by one.
Step S404 is provided in end from data according to YAML configuration file and is obtained required REST data.Specifically, should REST service request namely lookup REST interface obtain data.It wherein, include REST interface message in YAML configuration file.
Step S406 judges that data provide whether end within a specified time returns to required REST data.If so, executing Step S408;If not, terminating.
In a kind of implementation, it can be determined that at the appointed time whether REST interface provide in end in range from data and obtain To required REST data.Specified time can set according to the normal used time empirical value for obtaining data, when specifying more than this Between, then illustrate that data acquisition fails.
Step S408 provides the REST data that end returns to data and arranges.Specifically can according to configuration field and The corresponding relationship of REST field determines configuration field corresponding to REST data.
Step S410, judges whether REST data meet preset format.If so, executing step S412;If not, knot Beam.
Specifically, preset format includes presets format and preset content format.Such as, for characterizing the time The presets format of REST data is " Year/Month/Day ";And if the format of the REST data returned is " moon--year ", Presets format is not met;Again such as, preset content format is successively adjacent " REST data A-REST data B-REST number According to C ", and if the data returned are " REST data A-REST data C ", REST data B is lacked, then explanation is not met default Content format.The above is only simple examples, it is not construed as limiting.It is understood that if REST data do not meet it is pre- If format, then operational system is difficult to parse REST data, therefore needs to screen REST data in this step Differentiate, so that the undesirable invalid data or hash that will acquire filter out.
Step S412 judges whether to be stored in REST data to target CMDB model.If so, executing step S414;Such as Fruit is no, terminates.Specifically, namely judging whether configuration field by REST data configuration to target CMDB model.It can manage Solution, REST interface can obtain a variety of REST data, and part REST data may be not that user is current desired, therefore It can be judged whether to give REST data configuration to target CMDB model according to user to set information;It include current in set information The REST data for needing to store.
Step S414, by the corresponding configuration field for being stored in target CMDB model of REST data.
The above method provided through this embodiment, REST needed for CMDB model capable of being obtained automatically according to configuration file Data, and by the corresponding configuration field for being stored in CMDB model of REST data, compared to time-consuming and laborious artificial acquisition data Mode can effectively promote the data acquisition efficiency of CMDB model.
Corresponding to the data capture method for the CMDB model that the embodiment of the present disclosure provides, the present embodiment additionally provides one kind The data acquisition facility of CMDB model, which is applied to operational system, as shown in figure 5, the device includes following module:
File acquisition module 502, for obtaining the configuration file of target CMDB model;Wherein, configuration file includes data The corresponding relationship of the REST interface message at end and the configuration field of target CMDB model and REST field is provided;Data acquisition Module 504 obtains the corresponding REST data of REST field for providing according to REST interface message from data in end;
Configuration module 506, the REST data correspondence for will acquire according to corresponding relationship are stored in target CMDB model Configuration field.
The data acquisition facility of above-mentioned CMDB model provided in this embodiment, can obtain automatically CMDB according to configuration file REST data needed for model, and REST data are stored in the configuration field of CMDB model, it is artificial compared to time-consuming and laborious The mode for obtaining data, can effectively promote the data acquisition efficiency of CMDB model.
In one embodiment, file acquisition module 502 is used for: if meeting trigger condition, being searched from designated position The corresponding configuration file of model name of target CMDB model;Wherein, trigger condition includes: to receive data acquisition instruction And/or reach preset data obtaining time.
In one embodiment, data acquisition module 504 is used for: according to REST interface message determine REST interface and The corresponding REST field of REST interface;Wherein, REST interface and REST field are one-one relationship or many-one relationship;By true REST interface after fixed obtains the REST data of the corresponding REST field of the REST interface.
On the basis of Fig. 5, the present embodiment additionally provides the knot of the configuration device of another kind CMDB model as shown in FIG. 6 Structure block diagram, specifically includes following module:
Self-defined information obtains module 602, for obtaining the customized information of target CMDB model, wherein user It include the demand configuration field of target CMDB model in self-defined information;
Screening module 604, for filtering out pre-set configuration field and REST field from demand configuration field The configuration field for including in corresponding relationship, using the corresponding REST field of the configuration field filtered out as target REST field;
Searching module 606, for searching the corresponding target of target REST field from the existing REST interface of operational system REST interface;
Determining module 608, for being determined as mesh for configuration field corresponding to the corresponding REST field of target REST interface Mark the configuration field of CMDB model;
File generating module 610, for the corresponding relationship of configuration field and REST field based on target CMDB model, with And target REST interface, generate the configuration file of target CMDB model.
Above-mentioned configuration file is the configuration file using non-markup languages YAML format.
The technical effect of device provided by the present embodiment, realization principle and generation is identical with previous embodiment, for letter It describes, Installation practice part does not refer to place, can refer to corresponding contents in preceding method embodiment.
Embodiment further provides a kind of electronic equipment, including processor and machine readable storage medium, machines for the disclosure Readable storage medium storing program for executing is stored with the machine-executable instruction that can be executed by processor, processor execute machine-executable instruction with Realize the data capture method method for the configuration management database CMDB model that disclosure embodiment provides.
The structural schematic diagram of a kind of electronic equipment shown in Figure 7, the electronic equipment include: processor 70, memory 71, bus 72 and communication interface 73, the processor 70, communication interface 73 and memory 71 are connected by bus 72;Processor 70 for executing the executable module stored in memory 71, such as computer program.
Wherein, memory 71 may include high-speed random access memory (RAM, Random Access Memory), It may further include non-labile memory (non-volatile memory), for example, at least a magnetic disk storage.By extremely A few communication interface 73 (can be wired or wireless) is realized logical between the system network element and at least one other network element Letter connection, can be used internet, wide area network, local network, Metropolitan Area Network (MAN) etc..
Bus 72 can be isa bus, pci bus or eisa bus etc..The bus can be divided into address bus, data Bus, control bus etc..Only to be indicated with a four-headed arrow convenient for indicating, in Fig. 7, it is not intended that an only bus or A type of bus.
Wherein, memory 71 is for storing program, and the processor 70 executes the journey after receiving and executing instruction Sequence, method performed by the device that the stream process that aforementioned the application any embodiment discloses defines can be applied to processor 70 In, or realized by processor 70.
Processor 70 may be a kind of IC chip, the processing capacity with signal.During realization, above-mentioned side Each step of method can be completed by the integrated logic circuit of the hardware in processor 70 or the instruction of software form.Above-mentioned Processor 70 can be general processor, including central processing unit (Central Processing Unit, abbreviation CPU), network Processor (Network Processor, abbreviation NP) etc.;It can also be digital signal processor (Digital Signal Processor, abbreviation DSP), specific integrated circuit (Application Specific Integrated Circuit, referred to as ASIC), field programmable gate array (Field-Programmable Gate Array, abbreviation FPGA) or other are programmable Logical device, discrete gate or transistor logic, discrete hardware components.It may be implemented or execute the disclosure in the application Each method, step and logic diagram.General processor can be microprocessor or the processor is also possible to any routine Processor etc..It can be embodied directly in hardware decoding processor in conjunction with the step of method disclosed in the present application and execute completion, Or in decoding processor hardware and software module combination execute completion.Software module can be located at random access memory, dodge It deposits, read-only memory, this fields such as programmable read only memory or electrically erasable programmable memory, register are mature to deposit In storage media.The storage medium is located at memory 71, and processor 70 reads the information in memory 71, completes in conjunction with its hardware The step of stating method.
For the disclosure embodiment further provides a kind of machine readable storage medium, machine readable storage medium storage is organic Device executable instruction, for machine-executable instruction when being called and being executed by processor, machine-executable instruction promotes processor real The data capture method for the above-mentioned configuration management database CMDB model that the existing embodiment of the present disclosure provides.
In open provided several embodiments, it should be understood that disclosed device and method can also pass through Other modes are realized.Device embodiments described above are only schematical, for example, flow chart and frame in attached drawing Figure shows the system frame in the cards of the device of multiple embodiments according to the disclosure, method and computer program product Structure, function and operation.In this regard, each box in flowchart or block diagram can represent a module, section or code A part, a part of the module, section or code includes one or more for implementing the specified logical function Executable instruction.It should also be noted that function marked in the box can also be with not in some implementations as replacement It is same as the sequence marked in attached drawing generation.For example, two continuous boxes can actually be basically executed in parallel, they have When can also execute in the opposite order, this depends on the function involved.It is also noted that in block diagram and or flow chart Each box and the box in block diagram and or flow chart combination, can function or movement as defined in executing it is dedicated Hardware based system realize, or can realize using a combination of dedicated hardware and computer instructions.
In addition, each functional module or unit in each embodiment of the disclosure, which can integrate, forms one solely together Vertical part is also possible to modules individualism, can also be integrated to form with two or more modules one it is independent Part.
It, can be with if the function is realized in the form of SFU software functional unit and when sold or used as an independent product It is stored in a computer readable storage medium.Based on this understanding, the technical solution of the disclosure is substantially in other words The part of the part that contributes to existing technology or the technical solution can be embodied in the form of software products, the meter Calculation machine software product is stored in a storage medium, including some instructions are used so that a computer equipment (can be a People's computer, server or network equipment etc.) execute all or part of step of each embodiment the method for the disclosure Suddenly.And storage medium above-mentioned includes: USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), deposits at random The various media that can store program code such as access to memory (RAM, Random Access Memory), magnetic or disk.
Finally, it should be noted that embodiment described above, the only specific embodiment of the disclosure, to illustrate this public affairs The technical solution opened, rather than its limitations, the protection scope of the disclosure are not limited thereto, although referring to aforementioned embodiments pair The disclosure is described in detail, those skilled in the art should understand that: any technology for being familiar with the art Personnel can still modify to technical solution documented by aforementioned embodiments in the technical scope that the disclosure discloses Or variation or equivalent replacement of some of the technical features can be readily occurred in;And these modifications, variation or replacement, The spirit and scope for disclosure embodiment technical solution that it does not separate the essence of the corresponding technical solution, should all cover in this public affairs Within the protection scope opened.Therefore, the protection scope of the disclosure shall be subject to the protection scope of the claim.

Claims (11)

1. a kind of data capture method of configuration management database CMDB model, which is characterized in that the method is applied to O&M System, comprising:
Obtain the configuration file of target CMDB model;Wherein, the configuration file includes that data provide the REST interface message at end, And the target CMDB model configuration field and REST field corresponding relationship;
It is provided according to the REST interface message from the data and obtains the corresponding REST data of REST field in end;
According to the corresponding relationship, the corresponding configuration words for being stored in the target CMDB model of the REST data that will acquire Section.
2. the method according to claim 1, wherein the step of obtaining the configuration file of target CMDB model, packet It includes:
If meeting trigger condition, the corresponding configuration file of model name of target CMDB model is searched from designated position;Its In, the trigger condition includes: to receive data acquisition instruction and/or reach preset data obtaining time.
3. the method according to claim 1, wherein it is corresponding to obtain REST field according to the REST interface message REST data the step of, comprising:
REST interface and the corresponding REST field of the REST interface are determined according to the REST interface message;Wherein, described REST interface and the REST field are one-one relationship or many-one relationship;
The REST data of the corresponding REST field of the REST interface are obtained by the REST interface after determination.
4. the method according to claim 1, wherein the method also includes:
Obtain the customized information of the target CMDB model, wherein include described in the customized information The demand configuration field of target CMDB model;
Include from the corresponding relationship for filtering out pre-set configuration field and REST field in the demand configuration field Configuration field, using the corresponding REST field of the configuration field filtered out as target REST field;
The corresponding target REST interface of the target REST field is searched from the existing REST interface of the operational system;
By configuration field corresponding to the corresponding REST field of the target REST interface, it is determined as the target CMDB model Configuration field;
The corresponding relationship and the target REST interface of configuration field and REST field based on the target CMDB model, Generate the configuration file of the target CMDB model.
5. the method according to claim 1, wherein the configuration file is using non-markup languages YAML format Configuration file.
6. a kind of data acquisition facility of configuration management database CMDB model, which is characterized in that described device is applied to O&M System, comprising:
File acquisition module, for obtaining the configuration file of target CMDB model;Wherein, the configuration file includes that data provide The corresponding relationship of the configuration field and REST field of the REST interface message at end and the target CMDB model;
Data acquisition module, it is corresponding for providing acquisition REST field in end from the data according to the REST interface message REST data;
Configuration module, the REST data correspondence for will acquire according to the corresponding relationship are stored in the target CMDB The configuration field of model.
7. device according to claim 6, which is characterized in that the file acquisition module is used for:
If meeting trigger condition, the corresponding configuration file of model name of target CMDB model is searched from designated position;Its In, the trigger condition includes: to receive data acquisition instruction and/or reach preset data obtaining time.
8. device according to claim 6, which is characterized in that the data acquisition module is used for:
REST interface and the corresponding REST field of the REST interface are determined according to the REST interface message;Wherein, described REST interface and the REST field are one-one relationship or many-one relationship;
The REST data of the corresponding REST field of the REST interface are obtained by the REST interface after determination.
9. device according to claim 6, which is characterized in that described device further include:
Self-defined information obtains module, for obtaining the customized information of the target CMDB model, wherein the user It include the demand configuration field of the target CMDB model in self-defined information;
Screening module, it is corresponding with REST field for filtering out pre-set configuration field from the demand configuration field The configuration field for including in relationship, using the corresponding REST field of the configuration field filtered out as target REST field;
Searching module, for searching the corresponding target of the target REST field from the existing REST interface of the operational system REST interface;
Determining module, it is described for being determined as configuration field corresponding to the corresponding REST field of the target REST interface The configuration field of target CMDB model;
File generating module, for the corresponding relationship of configuration field and REST field based on the target CMDB model, and The target REST interface generates the configuration file of the target CMDB model.
10. a kind of electronic equipment, which is characterized in that including processor and machine readable storage medium, the machine readable storage Media storage has the machine-executable instruction that can be executed by the processor, and the processor executes the executable finger of the machine It enables to realize method described in any one of claim 1 to 5.
11. a kind of machine readable storage medium, which is characterized in that the machine readable storage medium is stored with the executable finger of machine It enables, for the machine-executable instruction when being called and being executed by processor, the machine-executable instruction promotes the processor Realize method described in any one of claim 1 to 5.
CN201811606744.2A 2018-12-26 2018-12-26 Data acquisition method and device of CMDB model and electronic equipment Active CN109710676B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811606744.2A CN109710676B (en) 2018-12-26 2018-12-26 Data acquisition method and device of CMDB model and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811606744.2A CN109710676B (en) 2018-12-26 2018-12-26 Data acquisition method and device of CMDB model and electronic equipment

Publications (2)

Publication Number Publication Date
CN109710676A true CN109710676A (en) 2019-05-03
CN109710676B CN109710676B (en) 2021-07-06

Family

ID=66257824

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811606744.2A Active CN109710676B (en) 2018-12-26 2018-12-26 Data acquisition method and device of CMDB model and electronic equipment

Country Status (1)

Country Link
CN (1) CN109710676B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110610069A (en) * 2019-09-09 2019-12-24 苏州浪潮智能科技有限公司 Method and device for calling REST interface in web system
CN115617819A (en) * 2022-12-19 2023-01-17 思创数码科技股份有限公司 Data storage method, system, computer device and storage medium
CN116401319A (en) * 2023-06-09 2023-07-07 建信金融科技有限责任公司 Data synchronization method and device, electronic equipment and computer readable storage medium
CN117992115A (en) * 2024-04-02 2024-05-07 建信金融科技有限责任公司 System configuration processing method, device, equipment, medium and program product

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090106459A1 (en) * 2007-10-17 2009-04-23 Dell Products, Lp Configuration identification tool and methods
US20100115100A1 (en) * 2008-10-30 2010-05-06 Olga Tubman Federated configuration data management
US20100306275A1 (en) * 2009-05-26 2010-12-02 Computer Associates Think, Inc. Configuration management visualization
CN105354239A (en) * 2015-10-10 2016-02-24 中国科学院计算机网络信息中心 Configuration data processing model based processing center data stream processing method
CN105939227A (en) * 2016-07-13 2016-09-14 浪潮(北京)电子信息产业有限公司 Service configuration method and system based on CMDB and server
CN107239601A (en) * 2017-05-19 2017-10-10 国电南瑞科技股份有限公司 A kind of distribution terminal flexible configuration method based on configuration technology
CN107273104A (en) * 2016-04-08 2017-10-20 阿里巴巴集团控股有限公司 A kind of processing method and processing device of configuration data structure
CN108076125A (en) * 2016-11-11 2018-05-25 北京京东尚科信息技术有限公司 Interface allocation method and system
CN108132815A (en) * 2017-12-25 2018-06-08 郑州云海信息技术有限公司 A kind of method, apparatus and storage medium of configuration file dynamic load
CN108768728A (en) * 2018-05-31 2018-11-06 康键信息技术(深圳)有限公司 O&M task processing method, device, computer equipment and storage medium
CN108959430A (en) * 2018-06-11 2018-12-07 北京金山安全软件有限公司 Advertisement promotion data acquisition method, device and equipment

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090106459A1 (en) * 2007-10-17 2009-04-23 Dell Products, Lp Configuration identification tool and methods
US20100115100A1 (en) * 2008-10-30 2010-05-06 Olga Tubman Federated configuration data management
US20100306275A1 (en) * 2009-05-26 2010-12-02 Computer Associates Think, Inc. Configuration management visualization
CN105354239A (en) * 2015-10-10 2016-02-24 中国科学院计算机网络信息中心 Configuration data processing model based processing center data stream processing method
CN107273104A (en) * 2016-04-08 2017-10-20 阿里巴巴集团控股有限公司 A kind of processing method and processing device of configuration data structure
CN105939227A (en) * 2016-07-13 2016-09-14 浪潮(北京)电子信息产业有限公司 Service configuration method and system based on CMDB and server
CN108076125A (en) * 2016-11-11 2018-05-25 北京京东尚科信息技术有限公司 Interface allocation method and system
CN107239601A (en) * 2017-05-19 2017-10-10 国电南瑞科技股份有限公司 A kind of distribution terminal flexible configuration method based on configuration technology
CN108132815A (en) * 2017-12-25 2018-06-08 郑州云海信息技术有限公司 A kind of method, apparatus and storage medium of configuration file dynamic load
CN108768728A (en) * 2018-05-31 2018-11-06 康键信息技术(深圳)有限公司 O&M task processing method, device, computer equipment and storage medium
CN108959430A (en) * 2018-06-11 2018-12-07 北京金山安全软件有限公司 Advertisement promotion data acquisition method, device and equipment

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
HEIKO LUDWIG等: "《REST-based management of loosely coupled services》", 《ACM》 *
王刚: "《CMDB配置管理***研究及设计》", 《CMDB配置管理***研究及设计》 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110610069A (en) * 2019-09-09 2019-12-24 苏州浪潮智能科技有限公司 Method and device for calling REST interface in web system
CN115617819A (en) * 2022-12-19 2023-01-17 思创数码科技股份有限公司 Data storage method, system, computer device and storage medium
CN116401319A (en) * 2023-06-09 2023-07-07 建信金融科技有限责任公司 Data synchronization method and device, electronic equipment and computer readable storage medium
CN116401319B (en) * 2023-06-09 2023-09-12 建信金融科技有限责任公司 Data synchronization method and device, electronic equipment and computer readable storage medium
CN117992115A (en) * 2024-04-02 2024-05-07 建信金融科技有限责任公司 System configuration processing method, device, equipment, medium and program product

Also Published As

Publication number Publication date
CN109710676B (en) 2021-07-06

Similar Documents

Publication Publication Date Title
CN109710676A (en) Data capture method, device and the electronic equipment of CMDB model
CA2434241C (en) System and method for configuration, management and monitoring of network resources
CN103795580B (en) A kind of data monitoring method, system and relevant device
CN111130825B (en) Network slice template generation method, device, equipment and storage medium
CN107547262A (en) Generation method, device and the Network Management Equipment of alarm level
CA2434239A1 (en) Method for generating a network management database record
CN101369933A (en) Automatic test method and system
CN108259215A (en) A kind of device management method and device
CN104363107A (en) Inspection method and equipment for security baseline
CN104811501A (en) Server positioning method and server positioning device
CN107239502A (en) Database error daily record monitoring system based on salt
CN112187512A (en) Port automatic expansion method, device and equipment based on flow monitoring
CN111224797A (en) Equipment access method and device and electronic equipment
CN110928984A (en) Knowledge graph construction method and device, terminal and storage medium
CN104468207A (en) Terminal management method, device and system
CN106326280B (en) Data processing method, device and system
CN103684841A (en) Network management server and link discovery comparison method
CN109471837A (en) The distributed storage method of power infrastructures data
CN105160011A (en) Log management system and method
CN108037948A (en) Script management method, apparatus and system
CN105607983B (en) Data exception monitoring method and device
CN101873228A (en) Management system and method for material information of network equipment
CN108196962B (en) Method and device for realizing calling of interfaces of different versions
CN113055213A (en) Alarm information management method, alarm information management system and server
CN101610281B (en) Method and device for storing data fingerprints

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
GR01 Patent grant
GR01 Patent grant