Movatterモバイル変換


[0]ホーム

URL:


CN105100211A - Configuration file obtaining method and device - Google Patents

Configuration file obtaining method and device
Download PDF

Info

Publication number
CN105100211A
CN105100211ACN201510363871.4ACN201510363871ACN105100211ACN 105100211 ACN105100211 ACN 105100211ACN 201510363871 ACN201510363871 ACN 201510363871ACN 105100211 ACN105100211 ACN 105100211A
Authority
CN
China
Prior art keywords
configuration file
attribute information
controlled plant
controlled device
plant attribute
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201510363871.4A
Other languages
Chinese (zh)
Inventor
王浩宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing 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 Beijing Qihoo Technology Co Ltd, Qizhi Software Beijing Co LtdfiledCriticalBeijing Qihoo Technology Co Ltd
Priority to CN201510363871.4ApriorityCriticalpatent/CN105100211A/en
Publication of CN105100211ApublicationCriticalpatent/CN105100211A/en
Pendinglegal-statusCriticalCurrent

Links

Classifications

Landscapes

Abstract

Translated fromChinese

本发明提供了一种获取配置文件的方法,其中:受控设备提取受控设备属性信息;基于受控设备属性信息,生成配置文件获取请求;发送配置文件获取请求至主控设备;主控设备接收来自受控设备的配置文件获取请求,其中,配置文件获取请求包括受控设备属性信息;基于从配置文件获取请求中提取到的受控设备属性信息,获取与受控设备属性信息相匹配的配置文件。本发明实现了对受控设备进行差异化及个性化的配置同步更新,满足数据业务快速发展的需求。

The present invention provides a method for obtaining a configuration file, wherein: the controlled device extracts the attribute information of the controlled device; generates a configuration file acquisition request based on the controlled device attribute information; sends the configuration file acquisition request to the master control device; the master control device Receive a configuration file acquisition request from the controlled device, wherein the configuration file acquisition request includes the attribute information of the controlled device; based on the controlled device attribute information extracted from the configuration file acquisition request, obtain the information that matches the controlled device attribute information configuration file. The present invention realizes synchronous updating of differentiated and individualized configurations for the controlled equipment, and satisfies the requirement of rapid development of data services.

Description

Translated fromChinese
获取配置文件的方法及装置Method and device for obtaining configuration files

技术领域technical field

本发明涉及计算机技术领域,具体而言,本发明涉及一种获取配置文件的方法及装置。The present invention relates to the field of computer technology, and in particular, the present invention relates to a method and device for acquiring configuration files.

背景技术Background technique

Puppet是一种Linux、Unix、windows平台的集中配置管理系统,使用自有的Puppet描述语言,可管理配置文件、用户、cron任务、软件包、系统服务等。Puppet采用C/S星状的结构,至少一个主控设备Master与至少两个受控设备Agent进行交互。每个Agent周期性地向Master发送请求,获得与其最新的配置文件,以保证和Master端的配置文件同步。Puppet is a centralized configuration management system for Linux, Unix, and Windows platforms. It uses its own Puppet description language to manage configuration files, users, cron tasks, software packages, and system services. Puppet adopts a C/S star structure, at least one master control device Master interacts with at least two controlled device Agents. Each Agent periodically sends a request to the Master to obtain its latest configuration file to ensure synchronization with the configuration file on the Master side.

现有技术中,对于包括多个Agent的Puppet配置管理系统,Master一般基于同一数据业务为多个Agent生成统一的配置文件。多个Agent分别周期性地向Master请求最新的配置文件,响应于来自Agent的请求,Master向多个Agent下发统一的配置文件,多个Agent分别接受到该配置文件后,严格按照配置文件来进行配置。但是,现有的配置方式无法基于每个Agent的属性来进行差异化及个性化的配置同步更新,无法满足数据业务快速发展的需求。In the prior art, for a Puppet configuration management system including multiple Agents, the Master generally generates a unified configuration file for the multiple Agents based on the same data service. Multiple Agents periodically request the latest configuration file from the Master. In response to the request from the Agent, the Master issues a unified configuration file to the multiple Agents. After receiving the configuration file, the multiple Agents strictly follow the configuration file. to configure. However, the existing configuration methods cannot perform differentiated and personalized configuration synchronous updates based on the attributes of each Agent, and cannot meet the needs of rapid development of data services.

发明内容Contents of the invention

为克服上述技术问题或者至少部分地解决上述技术问题,特提出以下技术方案:In order to overcome the above-mentioned technical problems or at least partially solve the above-mentioned technical problems, the following technical solutions are proposed:

本发明提供了一种获取配置文件的方法,应用于主控设备以用于生成与受控设备属性信息相匹配的配置文件,所述主控设备与至少两个受控设备连接,包括:The present invention provides a method for obtaining a configuration file, which is applied to a master control device to generate a configuration file that matches the attribute information of a controlled device. The master control device is connected to at least two controlled devices, including:

接收来自受控设备的配置文件获取请求,其中,所述配置文件获取请求包括受控设备属性信息;receiving a configuration file acquisition request from a controlled device, wherein the configuration file acquisition request includes controlled device attribute information;

基于从所述配置文件获取请求中提取到的受控设备属性信息,获取与所述受控设备属性信息相匹配的配置文件。Based on the controlled device attribute information extracted from the configuration file acquisition request, a configuration file matching the controlled device attribute information is acquired.

本发明还提供了一种获取配置文件的方法,应用于受控设备以辅助用于获取与受控设备属性信息相匹配的配置文件,所述受控设备与主控设备连接,其特征在于,包括:The present invention also provides a method for obtaining a configuration file, which is applied to a controlled device to assist in obtaining a configuration file that matches the attribute information of the controlled device, and the controlled device is connected to the master device, wherein, include:

提取受控设备属性信息,其中,所述受控设备属性信息用于在所述主控设备中获取与其相匹配的配置文件;extracting attribute information of the controlled device, wherein the attribute information of the controlled device is used to obtain a configuration file matching it in the master device;

基于所述受控设备属性信息,生成配置文件获取请求;Generate a configuration file acquisition request based on the controlled device attribute information;

发送所述配置文件获取请求至所述主控设备。Sending the configuration file acquisition request to the master control device.

本发明还提供了一种获取配置文件的装置,该装置在主控设备用于生成与受控设备属性信息相匹配的配置文件,所述主控设备与至少两个受控设备连接,包括:The present invention also provides a device for acquiring a configuration file. The device is used in a master device to generate a configuration file that matches the attribute information of the controlled device. The master device is connected to at least two controlled devices, including:

请求接收模块,用于接收来自受控设备的配置文件获取请求,其中,所述配置文件获取请求包括受控设备属性信息;A request receiving module, configured to receive a configuration file acquisition request from a controlled device, wherein the configuration file acquisition request includes controlled device attribute information;

配置文件获取模块,用于基于从所述配置文件获取请求中提取到的受控设备属性信息,获取与所述受控设备属性信息相匹配的配置文件。The configuration file obtaining module is configured to obtain a configuration file matching the controlled device attribute information based on the controlled device attribute information extracted from the configuration file obtaining request.

本发明还提供了一种获取配置文件的装置,该装置在受控设备中辅助用于获取与受控设备属性信息相匹配的配置文件,所述受控设备与主控设备连接,其特征在于,包括:The present invention also provides a device for obtaining a configuration file, which is used in the controlled device to assist in obtaining a configuration file that matches the attribute information of the controlled device, the controlled device is connected to the master device, and the device is characterized in that ,include:

属性提取模块,用于提取受控设备属性信息,其中,所述受控设备属性信息用于在所述主控设备中获取与其相匹配的配置文件;An attribute extraction module, configured to extract attribute information of the controlled device, wherein the attribute information of the controlled device is used to obtain a configuration file matching it in the master device;

请求生成模块,用于基于所述受控设备属性信息,生成配置文件获取请求;A request generation module, configured to generate a configuration file acquisition request based on the controlled device attribute information;

请求发送模块,用于发送所述配置文件获取请求至所述主控设备。A request sending module, configured to send the configuration file acquisition request to the master control device.

本发明的实施例中,由于不同受控设备的属性信息不同,因此在主控设备中许获取与受控设备属性信息相匹配的配置文件,从而可实现了对受控设备进行差异化及个性化的配置同步更新,满足数据业务快速发展的需求。In the embodiment of the present invention, since the attribute information of different controlled devices is different, the configuration file that matches the attribute information of the controlled device can be obtained in the master control device, so that the controlled device can be differentiated and individualized. The standardized configuration is updated synchronously to meet the needs of rapid development of data services.

本发明附加的方面和优点将在下面的描述中部分给出,这些将从下面的描述中变得明显,或通过本发明的实践了解到。Additional aspects and advantages of the invention will be set forth in part in the description which follows, and will become apparent from the description, or may be learned by practice of the invention.

附图说明Description of drawings

本发明上述的和/或附加的方面和优点从下面结合附图对实施例的描述中将变得明显和容易理解,其中:The above and/or additional aspects and advantages of the present invention will become apparent and easy to understand from the following description of the embodiments in conjunction with the accompanying drawings, wherein:

图1为本发明中获取配置文件的方法一个实施例的流程示意图;Fig. 1 is a schematic flow chart of an embodiment of a method for obtaining a configuration file in the present invention;

图2为本发明中获取配置文件的方法一个优选实施例的流程示意图;Fig. 2 is a schematic flow diagram of a preferred embodiment of the method for obtaining configuration files in the present invention;

图3为本发明中获取配置文件的装置一个实施例的结构示意图;FIG. 3 is a schematic structural diagram of an embodiment of a device for obtaining a configuration file in the present invention;

图4为本发明中获取配置文件的装置一个优选实施例的结构示意图。Fig. 4 is a schematic structural diagram of a preferred embodiment of the device for acquiring configuration files in the present invention.

具体实施方式Detailed ways

下面详细描述本发明的实施例,所述实施例的示例在附图中示出,其中自始至终相同或类似的标号表示相同或类似的元件或具有相同或类似功能的元件。下面通过参考附图描述的实施例是示例性的,仅用于解释本发明,而不能解释为对本发明的限制。Embodiments of the present invention are described in detail below, examples of which are shown in the drawings, wherein the same or similar reference numerals designate the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by referring to the figures are exemplary only for explaining the present invention and should not be construed as limiting the present invention.

本技术领域技术人员可以理解,除非特意声明,这里使用的单数形式“一”、“一个”、“所述”和“该”也可包括复数形式。应该进一步理解的是,本发明的说明书中使用的措辞“包括”是指存在所述特征、整数、步骤、操作、元件和/或组件,但是并不排除存在或添加一个或多个其他特征、整数、步骤、操作、元件、组件和/或它们的组。应该理解,当我们称元件被“连接”或“耦接”到另一元件时,它可以直接连接或耦接到其他元件,或者也可以存在中间元件。此外,这里使用的“连接”或“耦接”可以包括无线连接或无线耦接。这里使用的措辞“和/或”包括一个或更多个相关联的列出项的全部或任一单元和全部组合。Those skilled in the art will understand that unless otherwise stated, the singular forms "a", "an", "said" and "the" used herein may also include plural forms. It should be further understood that the word "comprising" used in the description of the present invention refers to the presence of said features, integers, steps, operations, elements and/or components, but does not exclude the presence or addition of one or more other features, Integers, steps, operations, elements, components, and/or groups thereof. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may also be present. Additionally, "connected" or "coupled" as used herein may include wireless connection or wireless coupling. The expression "and/or" used herein includes all or any elements and all combinations of one or more associated listed items.

本技术领域技术人员可以理解,除非另外定义,这里使用的所有术语(包括技术术语和科学术语),具有与本发明所属领域中的普通技术人员的一般理解相同的意义。还应该理解的是,诸如通用字典中定义的那些术语,应该被理解为具有与现有技术的上下文中的意义一致的意义,并且除非像这里一样被特定定义,否则不会用理想化或过于正式的含义来解释。Those skilled in the art can understand that, unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meaning as commonly understood by those of ordinary skill in the art to which this invention belongs. It should also be understood that terms, such as those defined in commonly used dictionaries, should be understood to have meanings consistent with their meaning in the context of the prior art, and unless specifically defined as herein, are not intended to be idealized or overly Formal meaning to explain.

本发明中,主控设备与受控设备均为网络设备。网络设备包括但不限于单个网络服务器、多个网络服务器组成的服务器组、服务器集群或基于云计算(CloudComputing)的由大量计算机或网络服务器构成的云,其中,云计算是分布式计算的一种,由一群松散耦合的计算机集组成的一个超级虚拟计算机。In the present invention, both the master control device and the controlled device are network devices. Network devices include, but are not limited to, a single web server, a server group composed of multiple web servers, a server cluster, or a cloud composed of a large number of computers or web servers based on cloud computing (Cloud Computing), where cloud computing is a type of distributed computing , a super virtual computer consisting of a group of loosely coupled computer sets.

图1为本发明中获取配置文件的方法一个实施例的流程示意图。Fig. 1 is a schematic flowchart of an embodiment of a method for obtaining a configuration file in the present invention.

本发明实施例中,主控设备与受控设备之间进行交互来实现获取配置文件。本实施例描述了一个主控设备与一个受控设备之间的交互过程,主控设备与多个受控设备之间的交互过程与之相似,不再赘述。In the embodiment of the present invention, the controlling device interacts with the controlled device to obtain the configuration file. This embodiment describes the interaction process between a master control device and a controlled device, and the interaction process between a master control device and multiple controlled devices is similar and will not be repeated here.

本发明的实施例以Puppet配置管理系统为例进行描述,主控设备与至少两个受控设备应用Puppet配置管理系统,本发明还可应用于与Puppet相似的其他配置管理系统。The embodiment of the present invention is described by taking the Puppet configuration management system as an example. The master device and at least two controlled devices apply the Puppet configuration management system. The present invention can also be applied to other configuration management systems similar to Puppet.

步骤S1210:受控设备提取受控设备属性信息,其中,受控设备属性信息用于在主控设备中获取与其相匹配的配置文件;步骤S1220:基于受控设备属性信息,生成配置文件获取请求;步骤S1230:发送配置文件获取请求至主控设备;步骤S1110:主控设备接收来自受控设备的配置文件获取请求,其中,配置文件获取请求包括受控设备属性信息;步骤S1120:基于从所述配置文件获取请求中提取到的受控设备属性信息,获取与所述受控设备属性信息相匹配的配置文件;步骤S1130:依据配置文件获取请求,将与受控设备属性信息相匹配的配置文件传送至受控设备。Step S1210: The controlled device extracts the attribute information of the controlled device, wherein the attribute information of the controlled device is used to obtain a matching configuration file in the master device; Step S1220: Based on the attribute information of the controlled device, generate a configuration file acquisition request ; Step S1230: Send a configuration file acquisition request to the master control device; Step S1110: The master control device receives the configuration file acquisition request from the controlled device, wherein the configuration file acquisition request includes the attribute information of the controlled device; Step S1120: Based on the According to the controlled device attribute information extracted in the configuration file acquisition request, obtain the configuration file that matches the controlled device attribute information; Step S1130: according to the configuration file acquisition request, obtain the configuration file that matches the controlled device attribute information The file is transferred to the controlled device.

本发明的实施例中,由于不同受控设备的属性信息不同,因此,可获取与各个受控设备的属性信息分别相匹配的多个不同的配置文件,从而可实现了对受控设备进行差异化及个性化的配置同步更新,满足数据业务快速发展的需求。In the embodiment of the present invention, since the attribute information of different controlled devices is different, multiple different configuration files that match the attribute information of each controlled device can be obtained, so that the difference between the controlled devices can be realized. Personalized and personalized configurations are updated synchronously to meet the needs of rapid development of data services.

步骤S1210:受控设备提取受控设备属性信息,其中,受控设备属性信息用于在主控设备中获取与其相匹配的配置文件;具体地,通过调用系统内部与各属性相关的接口,来提取受控设备属性信息。Step S1210: The controlled device extracts the attribute information of the controlled device, wherein the attribute information of the controlled device is used to obtain the matching configuration file in the master device; specifically, by calling the interface related to each attribute in the system, to Extract controlled device attribute information.

其中,受控设备属性信息包括不限于:Among them, the controlled device attribute information includes but is not limited to:

地理位置信息;例如,受控设备服务器,该服务器所在机房的具体地理位置;Geographic location information; for example, the controlled device server, the specific geographic location of the computer room where the server is located;

数据业务类型;即受控设备所属的数据业务类型,如受控设备A1是支持网址导航数据业务主页面部分的web服务器;受控设备A2是支持网址导航数据业务子页面部分的web服务器;A1与A2所属的数据业务类型不同。Data service type; that is, the data service type to which the controlled device belongs. For example, the controlled device A1 is a web server that supports the main page part of the website navigation data service; the controlled device A2 is a web server that supports the website navigation data service sub-page part; A1 It is different from the data service type to which A2 belongs.

受控设备的设备相关信息;可包括受控设备的系统性能信息、硬件参数等。Device-related information of the controlled device; may include system performance information, hardware parameters, etc. of the controlled device.

步骤S1220:基于受控设备属性信息,生成配置文件获取请求。Step S1220: Generate a configuration file acquisition request based on the attribute information of the controlled device.

具体地,按照预定周期,受控设备生成用于系统配置同步更新的配置文件获取请求,在生成过程中将受控设备属性信息写入配置文件获取请求。Specifically, according to a predetermined cycle, the controlled device generates a configuration file acquisition request for synchronous system configuration update, and writes the attribute information of the controlled device into the configuration file acquisition request during the generation process.

步骤S1230:受控设备发送配置文件获取请求至主控设备。Step S1230: the controlled device sends a configuration file acquisition request to the master device.

步骤S1110:主控设备接收来自受控设备的配置文件获取请求,其中,配置文件获取请求包括受控设备属性信息。Step S1110: the master control device receives a configuration file acquisition request from the controlled device, wherein the configuration file acquisition request includes the attribute information of the controlled device.

步骤S1120:基于从配置文件获取请求中提取到的受控设备属性信息,获取与受控设备属性信息相匹配的配置文件。Step S1120: Obtain a configuration file matching the attribute information of the controlled device based on the attribute information of the controlled device extracted from the configuration file acquisition request.

在一实施例中,由于先前根据其他受控设备的配置文件获取请求生成/获得的配置文件可以保存在主控设备的本地,因此,这些先前的配置文件后续可以重复利用以应用于具有相同/相似受控设备属性信息的受控设备中。从而,上述步骤S1120可以实施如下:In an embodiment, since the configuration files previously generated/obtained according to the configuration file acquisition requests of other controlled devices can be saved locally on the master device, these previous configuration files can be reused later to apply to the same/ In the controlled device similar to the property information of the controlled device. Thus, the above step S1120 can be implemented as follows:

在主控设备中查找与受控设备属性信息相关的配置文件,以作为与受控设备属性信息相匹配的配置文件。The configuration file related to the attribute information of the controlled device is searched in the master device as the configuration file matching the attribute information of the controlled device.

在另一实施例中,可以重新生成相应的配置文件。如图2所示,步骤S1120包括步骤S2121(图中未示出)、步骤S2122(图中未示出)和步骤S2123(图中未示出);步骤S2121:获取与配置文件获取请求相匹配的配置文件模板;步骤S2122:基于受控设备属性信息,确定与配置文件模板相应的属性特征信息;步骤S2123:将属性特征信息写入配置文件模板的相应位置,以生成与受控设备属性信息相匹配的配置文件。In another embodiment, the corresponding configuration files may be regenerated. As shown in Figure 2, step S1120 includes step S2121 (not shown in the figure), step S2122 (not shown in the figure) and step S2123 (not shown in the figure); step S2121: obtain and match the configuration file acquisition request The configuration file template; Step S2122: Based on the controlled device attribute information, determine the attribute feature information corresponding to the configuration file template; Step S2123: Write the attribute feature information into the corresponding position of the configuration file template to generate the controlled device attribute information matching configuration files.

步骤S2121:主控设备获取与配置文件获取请求相匹配的配置文件模板。Step S2121: the master control device acquires a configuration file template matching the configuration file acquisition request.

例如,从配置文件获取请求中提取受控设备的设备ID、配置请求类型等信息,通过调用预置的配置文件模板库的对外接口,获取到与受控设备的设备ID及配置请求类型相匹配的配置文件模板。其中,配置文件模板为预先生成的在特定位置处填入相应属性特征信息后即可生成配置文件的模板,请求同一配置请求类型的多个受控设备可使用同一配置文件模板。For example, extract the device ID of the controlled device, configuration request type and other information from the configuration file acquisition request, and obtain the device ID and configuration request type matching the controlled device by calling the external interface of the preset configuration file template library configuration file template. Wherein, the configuration file template is a pre-generated template that can generate a configuration file after filling in corresponding attribute characteristic information at a specific location, and multiple controlled devices requesting the same configuration request type can use the same configuration file template.

步骤S2122:基于受控设备属性信息,确定与配置文件模板相应的属性特征信息。Step S2122: Based on the controlled device attribute information, determine attribute feature information corresponding to the configuration file template.

具体地,确定与配置文件模板相应的属性特征列表;依据受控设备属性信息,在属性特征列表中查找以确定与受控设备属性信息相匹配的属性特征信息。Specifically, an attribute feature list corresponding to the configuration file template is determined; according to the attribute information of the controlled device, the attribute feature list is searched to determine the attribute feature information matching the attribute information of the controlled device.

其中,预先为配置文件模板生成属性特征列表,属性特征列表中包括与受控设备属性信息相匹配的可填入为配置文件模板的属性特征信息,属性特征信息可作为填充信息填入配置文件模板来生成完整的配置文件。Wherein, an attribute feature list is generated for the configuration file template in advance, and the attribute feature list includes attribute feature information that matches the attribute information of the controlled device and can be filled into the configuration file template, and the attribute feature information can be filled into the configuration file template as filling information to generate a complete configuration file.

步骤S2123:将属性特征信息写入配置文件模板的相应位置,以生成与受控设备属性信息相匹配的配置文件。Step S2123: Write the attribute characteristic information into the corresponding position of the configuration file template, so as to generate a configuration file matching the attribute information of the controlled device.

本优选实施例中,通过模板技术来生成针对不同受控设备属性信息的个性化配置文件,即对于同一配置请求类型,在主控设备端仅需维护一套配置文件模板及针对不同受控设备属性的属性特征信息,而无需维护多个针对多个手控设备属性的配置文件,在具有大量受控设备的服务器集群中,对大量受控设备提供相应的配置文件时可大大降低受控设备的硬件及数据处理压力,提高配置文件提供效率。In this preferred embodiment, template technology is used to generate personalized configuration files for different controlled device attribute information, that is, for the same configuration request type, only one set of configuration file templates needs to be maintained on the main control device side and for different controlled devices. Attribute characteristic information of attributes, without maintaining multiple configuration files for the attributes of multiple manually controlled devices. In a server cluster with a large number of controlled devices, when providing corresponding configuration files for a large number of controlled devices, the number of controlled devices can be greatly reduced. The pressure on hardware and data processing can be improved, and the efficiency of configuration files can be improved.

上述获取配置文件的方法的实施例还可以包括步骤S1130,以将获取的配置文件传送到受控设备:The above embodiments of the method for obtaining configuration files may also include step S1130, to transmit the obtained configuration files to the controlled device:

步骤S1130:依据配置文件获取请求,将与受控设备属性信息相匹配的配置文件传送至受控设备。Step S1130: According to the configuration file acquisition request, transmit the configuration file matching the attribute information of the controlled device to the controlled device.

例如,受控设备A1属性信息为地理位置信息“北京”,受控设备A2属性信息为地理位置信息“上海”;主控设备基于来自受控设备A1的配置文件获取请求和来自受控设备A2的配置文件获取请求中的主控设备ID、配置请求类型等信息,获取与该两个配置文件获取请求相匹配的统一的配置文件模板;随后,确定与配置文件模板相应的属性特征列表,从属性特征列表查找到与地理位置信息“北京”相匹配的属性特征信息为“bj”,与地理位置信息“上海”相匹配的属性特征信息为“sh”,则将两个属性特征信息分别写入配置文件模板的相应位置处,生成两个配置文件,随后将两个配置文件分别传送至相应的受控设备A1和A2,以用于受控设备的配置同步更新。For example, the attribute information of the controlled device A1 is geographic location information "Beijing", and the attribute information of the controlled device A2 is geographic location information "Shanghai"; the master control device acquires the request based on the configuration file from the controlled device A1 and the information such as the main control device ID and configuration request type in the configuration file acquisition request, and obtain a unified configuration file template that matches the two configuration file acquisition requests; then, determine the attribute feature list corresponding to the configuration file template, from The attribute feature list finds that the attribute feature information matching the geographic location information "Beijing" is "bj", and the attribute feature information matching the geographic location information "Shanghai" is "sh", then write the two attribute feature information separately Into the corresponding position of the configuration file template, generate two configuration files, and then transmit the two configuration files to the corresponding controlled devices A1 and A2 respectively, so as to be used for synchronous configuration update of the controlled devices.

图3为本发明中获取配置文件的装置一个实施例的结构示意图。Fig. 3 is a schematic structural diagram of an embodiment of a device for acquiring a configuration file in the present invention.

本发明的实施例中,受控设备中包括用于辅助获取配置文件的装置,其中,包括属性提取模块3210、请求生成模块3220和请求发送模块3230;主控设备中包括用于生获取配置文件的装置,其中,包括请求接收模块3110和配置文件生成模块3120。In the embodiment of the present invention, the controlled device includes a device for assisting in obtaining configuration files, including an attribute extraction module 3210, a request generating module 3220, and a request sending module 3230; the master device includes a device for generating and obtaining configuration files. , which includes a request receiving module 3110 and a configuration file generating module 3120.

受控设备的属性提取模块3210提取受控设备属性信息,其中,受控设备属性信息用于在主控设备中获取与其相匹配的配置文件;请求生成模块3220基于受控设备属性信息,生成配置文件获取请求;请求发送模块3230发送配置文件获取请求至主控设备;主控设备的请求接收模块3110接收来自受控设备的配置文件获取请求,其中,配置文件获取请求包括受控设备属性信息;模板获取模板3120基于从配置文件获取请求中提取到的受控设备属性信息,获取与受控设备属性信息相匹配的配置文件;主控设备依据配置文件获取请求,将与受控设备属性信息相匹配的配置文件传送至受控设备。The attribute extraction module 3210 of the controlled device extracts the attribute information of the controlled device, wherein the attribute information of the controlled device is used to obtain a matching configuration file in the master device; the request generation module 3220 generates a configuration file based on the attribute information of the controlled device A file acquisition request; the request sending module 3230 sends a configuration file acquisition request to the master device; the request receiving module 3110 of the master device receives a configuration file acquisition request from the controlled device, wherein the configuration file acquisition request includes controlled device attribute information; Template acquisition template 3120 acquires a configuration file matching the attribute information of the controlled device based on the attribute information of the controlled device extracted from the configuration file acquisition request; Matching configuration files are sent to the managed device.

本发明的实施例中,由于不同受控设备的属性信息不同,因此,可获取与各个受控设备的属性信息分别相匹配的多个不同的配置文件,从而可实现了对受控设备进行差异化及个性化的配置同步更新,满足数据业务快速发展的需求。In the embodiment of the present invention, since the attribute information of different controlled devices is different, multiple different configuration files that match the attribute information of each controlled device can be obtained, so that the difference between the controlled devices can be realized. Personalized and personalized configurations are updated synchronously to meet the needs of rapid development of data services.

受控设备的属性提取模块3210提取受控设备属性信息,其中,受控设备属性信息用于在主控设备中获取与其相匹配的配置文件;具体地,通过调用系统内部与各属性相关的接口,来提取受控设备属性信息。The attribute extraction module 3210 of the controlled device extracts the attribute information of the controlled device, wherein the attribute information of the controlled device is used to obtain the matching configuration file in the master device; specifically, by calling the interface related to each attribute in the system , to extract the property information of the controlled device.

其中,受控设备属性信息包括不限于:Among them, the controlled device attribute information includes but is not limited to:

地理位置信息;例如,受控设备服务器,该服务器所在机房的具体地理位置;Geographic location information; for example, the controlled device server, the specific geographic location of the computer room where the server is located;

数据业务类型;即受控设备所属的数据业务类型,如受控设备A1是支持网址导航数据业务主页面部分的web服务器;受控设备A2是支持网址导航数据业务子页面部分的web服务器;A1与A2所属的数据业务类型不同。Data service type; that is, the data service type to which the controlled device belongs. For example, the controlled device A1 is a web server that supports the main page part of the website navigation data service; the controlled device A2 is a web server that supports the website navigation data service sub-page part; A1 It is different from the data service type to which A2 belongs.

受控设备的设备相关信息,可包括受控设备的系统性能信息、硬件参数等。The device-related information of the controlled device may include system performance information, hardware parameters, etc. of the controlled device.

请求生成模块3220基于受控设备属性信息,生成配置文件获取请求。The request generation module 3220 generates a configuration file acquisition request based on the attribute information of the controlled device.

具体地,按照预定周期,受控设备生成用于系统配置同步更新的配置文件获取请求,在生成过程中将受控设备属性信息写入配置文件获取请求。Specifically, according to a predetermined cycle, the controlled device generates a configuration file acquisition request for synchronous system configuration update, and writes the attribute information of the controlled device into the configuration file acquisition request during the generation process.

请求发送模块3230发送配置文件获取请求至主控设备。The request sending module 3230 sends a configuration file acquisition request to the master control device.

主控设备的请求接收模块3110接收来自受控设备的配置文件获取请求,其中,配置文件获取请求包括受控设备属性信息。The request receiving module 3110 of the master device receives a configuration file acquisition request from the controlled device, wherein the configuration file acquisition request includes the attribute information of the controlled device.

配置文件获取模块3120基于从配置文件获取请求中提取到的受控设备属性信息,获取与受控设备属性信息相匹配的配置文件。The configuration file acquisition module 3120 acquires a configuration file matching the attribute information of the controlled device based on the attribute information of the controlled device extracted from the configuration file acquisition request.

在一实施例中,由于先前根据其他受控设备的配置文件获取请求生成/获得的配置文件可以保存在主控设备的本地,因此,这些先前的配置文件后续可以重复利用以应用于具有相同/相似受控设备属性信息的受控设备中。从而,上述配置文件获取模块可在主控设备中查找与受控设备属性信息相关的配置文件,以作为与受控设备属性信息相匹配的配置文件。In an embodiment, since the configuration files previously generated/obtained according to the configuration file acquisition requests of other controlled devices can be saved locally on the master device, these previous configuration files can be reused later to apply to the same/ In the controlled device similar to the property information of the controlled device. Therefore, the above-mentioned configuration file acquisition module can search the master device for a configuration file related to the attribute information of the controlled device as a configuration file matching the attribute information of the controlled device.

在另一实施例中,配置文件获取模块也可以重新生成相应的配置文件。如图4所示,配置文件获取模块包括模板获取子模板4121、属性特征确定子模块4122和配置文件生成子模块4123;模板获取子模板4121获取与配置文件获取请求相匹配的配置文件模板;属性特征确定子模块4122基于受控设备属性信息,确定与配置文件模板相应的属性特征信息;配置文件生成子模块4123将属性特征信息写入配置文件模板的相应位置,以生成与受控设备属性信息相匹配的配置文件。In another embodiment, the configuration file acquisition module can also regenerate the corresponding configuration file. As shown in Figure 4, the configuration file acquisition module includes template acquisition sub-template 4121, attribute feature determination sub-module 4122 and configuration file generation sub-module 4123; template acquisition sub-template 4121 obtains the configuration file template matched with the configuration file acquisition request; attribute The feature determination sub-module 4122 determines the attribute feature information corresponding to the configuration file template based on the attribute information of the controlled device; the configuration file generation sub-module 4123 writes the attribute feature information into the corresponding position of the configuration file template to generate the attribute information corresponding to the controlled device attribute information matching configuration files.

模板获取子模板4121获取与配置文件获取请求相匹配的配置文件模板。The template acquisition sub-template 4121 acquires the configuration file template matching the configuration file acquisition request.

例如,从配置文件获取请求中提取受控设备的设备ID、配置请求类型等信息,通过调用预置的配置文件模板库的对外接口,获取到与受控设备的设备ID及配置请求类型相匹配的配置文件模板。其中,配置文件模板为预先生成的在特定位置处填入相应属性特征信息后即可生成配置文件的模板,请求同一配置请求类型的多个受控设备可使用同一配置文件模板。For example, extract the device ID of the controlled device, configuration request type and other information from the configuration file acquisition request, and obtain the device ID and configuration request type matching the controlled device by calling the external interface of the preset configuration file template library configuration file template. Wherein, the configuration file template is a pre-generated template that can generate a configuration file after filling in corresponding attribute characteristic information at a specific location, and multiple controlled devices requesting the same configuration request type can use the same configuration file template.

属性特征确定子模块4122基于受控设备属性信息,确定与配置文件模板相应的属性特征信息。The attribute characteristic determination sub-module 4122 determines the attribute characteristic information corresponding to the configuration file template based on the attribute information of the controlled device.

具体地(参照图4),属性特征确定子模块4122包括特征列表确定单元(图中未示出)和查找单元(图中未示出);属性特征确定子模块4122确定与配置文件模板相应的属性特征列表;查找单元依据受控设备属性信息,在属性特征列表中查找以确定与受控设备属性信息相匹配的属性特征信息。Specifically (referring to Fig. 4), attribute feature determination sub-module 4122 includes a feature list determination unit (not shown in the figure) and a search unit (not shown in the figure); attribute feature determination sub-module 4122 determines the corresponding configuration file template An attribute feature list; the search unit searches in the attribute feature list according to the attribute information of the controlled equipment to determine the attribute feature information matching the attribute information of the controlled equipment.

其中,预先为配置文件模板生成属性特征列表,属性特征列表中包括与受控设备属性信息相匹配的可填入为配置文件模板的属性特征信息,属性特征信息可作为填充信息填入配置文件模板来生成完整的配置文件。Wherein, an attribute feature list is generated for the configuration file template in advance, and the attribute feature list includes attribute feature information that matches the attribute information of the controlled device and can be filled into the configuration file template, and the attribute feature information can be filled into the configuration file template as filling information to generate a complete configuration file.

配置文件生成子模块4123将属性特征信息写入配置文件模板的相应位置,以生成与受控设备属性信息相匹配的配置文件。本优选实施例中,通过模板技术来生成针对不同受控设备属性信息的个性化配置文件,即对于同一配置请求类型,在主控设备端仅需维护一套配置文件模板及针对不同受控设备属性的属性特征信息,而无需维护多个针对多个手控设备属性的配置文件,在具有大量受控设备的服务器集群中,对大量受控设备提供相应的配置文件时可大大降低受控设备的硬件及数据处理压力,提高配置文件提供效率。The configuration file generation sub-module 4123 writes the attribute characteristic information into the corresponding position of the configuration file template, so as to generate a configuration file matching the attribute information of the controlled device. In this preferred embodiment, template technology is used to generate personalized configuration files for different controlled device attribute information, that is, for the same configuration request type, only one set of configuration file templates needs to be maintained on the main control device side and for different controlled devices. Attribute characteristic information of attributes, without maintaining multiple configuration files for the attributes of multiple manually controlled devices. In a server cluster with a large number of controlled devices, when providing corresponding configuration files for a large number of controlled devices, the number of controlled devices can be greatly reduced. The pressure on hardware and data processing can be improved, and the efficiency of configuration files can be improved.

主控设备还可包括配置文件发送模块(图中未示出),用于依据配置文件获取请求,将与受控设备属性信息相匹配的配置文件传送至受控设备。The master control device may also include a configuration file sending module (not shown in the figure), configured to transmit the configuration file matching the attribute information of the controlled device to the controlled device according to the configuration file acquisition request.

本技术领域技术人员可以理解,本发明包括涉及用于执行本申请中所述操作中的一项或多项的设备。这些设备可以为所需的目的而专门设计和制造,或者也可以包括通用计算机中的已知设备。这些设备具有存储在其内的计算机程序,这些计算机程序选择性地激活或重构。这样的计算机程序可以被存储在设备(例如,计算机)可读介质中或者存储在适于存储电子指令并分别耦联到总线的任何类型的介质中,所述计算机可读介质包括但不限于任何类型的盘(包括软盘、硬盘、光盘、CD-ROM、和磁光盘)、ROM(Read-OnlyMemory,只读存储器)、RAM(RandomAccessMemory,随即存储器)、EPROM(ErasableProgrammableRead-OnlyMemory,可擦写可编程只读存储器)、EEPROM(ElectricallyErasableProgrammableRead-OnlyMemory,电可擦可编程只读存储器)、闪存、磁性卡片或光线卡片。也就是,可读介质包括由设备(例如,计算机)以能够读的形式存储或传输信息的任何介质。Those skilled in the art will appreciate that the present invention includes devices related to performing one or more of the operations described in this application. These devices may be specially designed and fabricated for the required purposes, or they may include known devices found in general purpose computers. These devices have computer programs stored therein that are selectively activated or reconfigured. Such a computer program can be stored in a device (e.g., computer) readable medium, including but not limited to any type of medium suitable for storing electronic instructions and respectively coupled to a bus. Types of disks (including floppy disks, hard disks, CDs, CD-ROMs, and magneto-optical disks), ROM (Read-Only Memory, read-only memory), RAM (Random Access Memory, random memory), EPROM (Erasable Programmable Read-Only Memory, rewritable and programmable Read-only memory), EEPROM (Electrically Erasable Programmable Read-Only Memory, Electrically Erasable Programmable Read-Only Memory), flash memory, magnetic card or optical card. That is, a readable medium includes any medium that stores or transmits information in a form readable by a device (eg, a computer).

本技术领域技术人员可以理解,可以用计算机程序指令来实现这些结构图和/或框图和/或流图中的每个框以及这些结构图和/或框图和/或流图中的框的组合。本技术领域技术人员可以理解,可以将这些计算机程序指令提供给通用计算机、专业计算机或其他可编程数据处理方法的处理器来实现,从而通过计算机或其他可编程数据处理方法的处理器来执行本发明公开的结构图和/或框图和/或流图的框或多个框中指定的方案。Those skilled in the art will understand that computer program instructions can be used to implement each block in these structural diagrams and/or block diagrams and/or flow diagrams and combinations of blocks in these structural diagrams and/or block diagrams and/or flow diagrams . Those skilled in the art can understand that these computer program instructions can be provided to general-purpose computers, professional computers, or processors of other programmable data processing methods for implementation, so that the computer or processors of other programmable data processing methods can execute the present invention. A scheme specified in a block or blocks of a structure diagram and/or a block diagram and/or a flow diagram of the invention disclosure.

本技术领域技术人员可以理解,本发明中已经讨论过的各种操作、方法、流程中的步骤、措施、方案可以被交替、更改、组合或删除。进一步地,具有本发明中已经讨论过的各种操作、方法、流程中的其他步骤、措施、方案也可以被交替、更改、重排、分解、组合或删除。进一步地,现有技术中的具有与本发明中公开的各种操作、方法、流程中的步骤、措施、方案也可以被交替、更改、重排、分解、组合或删除。Those skilled in the art can understand that the various operations, methods, and steps, measures, and solutions in the processes discussed in the present invention can be replaced, changed, combined, or deleted. Further, other steps, measures, and schemes in the various operations, methods, and processes that have been discussed in the present invention may also be replaced, changed, rearranged, decomposed, combined, or deleted. Further, steps, measures, and schemes in the prior art that have operations, methods, and processes disclosed in the present invention can also be alternated, changed, rearranged, decomposed, combined, or deleted.

以上所述仅是本发明的部分实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。The above descriptions are only part of the embodiments of the present invention. It should be pointed out that those skilled in the art can make some improvements and modifications without departing from the principles of the present invention. It should be regarded as the protection scope of the present invention.

Claims (10)

CN201510363871.4A2015-06-262015-06-26Configuration file obtaining method and devicePendingCN105100211A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201510363871.4ACN105100211A (en)2015-06-262015-06-26Configuration file obtaining method and device

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201510363871.4ACN105100211A (en)2015-06-262015-06-26Configuration file obtaining method and device

Publications (1)

Publication NumberPublication Date
CN105100211Atrue CN105100211A (en)2015-11-25

Family

ID=54579728

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201510363871.4APendingCN105100211A (en)2015-06-262015-06-26Configuration file obtaining method and device

Country Status (1)

CountryLink
CN (1)CN105100211A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN106713471A (en)*2016-12-292017-05-24北京奇艺世纪科技有限公司Method and device for acquiring configuration file
CN106789377A (en)*2017-03-242017-05-31聚好看科技股份有限公司The service parameter update method of network element cluster
CN108170477A (en)*2017-11-172018-06-15上海微波技术研究所(中国电子科技集团公司第五十研究所)Automatically the method that configuration file is produced in SCA software radios
CN108345449A (en)*2017-12-252018-07-31海尔优家智能科技(北京)有限公司A kind of information processing method, device, storage medium and computer equipment
CN109379325A (en)*2018-08-212019-02-22广州数源畅联科技有限公司A kind of backup client delivery method without user configuration
CN111400145A (en)*2020-03-312020-07-10厦门科灿信息技术有限公司Configuration method and device of flow chart monitoring page and terminal equipment
CN117193886A (en)*2023-11-062023-12-08成都科江科技有限公司Dynamic loading method for configuration file of industrial control system

Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN101321080A (en)*2007-06-042008-12-10华为技术有限公司 Method for configuring network equipment, network equipment, and network system
CN102006183A (en)*2010-11-122011-04-06百度在线网络技术(北京)有限公司Configuration parameter based Method and configuration equipment for configuring network equipment
CN102064966A (en)*2010-12-292011-05-18北京世纪互联工程技术服务有限公司Configuration method, server, equipment and system
CN104519100A (en)*2013-09-292015-04-15重庆新媒农信科技有限公司Method for automatic heterogeneous platform file synchronization and puppet server

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN101321080A (en)*2007-06-042008-12-10华为技术有限公司 Method for configuring network equipment, network equipment, and network system
CN102006183A (en)*2010-11-122011-04-06百度在线网络技术(北京)有限公司Configuration parameter based Method and configuration equipment for configuring network equipment
CN102064966A (en)*2010-12-292011-05-18北京世纪互联工程技术服务有限公司Configuration method, server, equipment and system
CN104519100A (en)*2013-09-292015-04-15重庆新媒农信科技有限公司Method for automatic heterogeneous platform file synchronization and puppet server

Cited By (12)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN106713471A (en)*2016-12-292017-05-24北京奇艺世纪科技有限公司Method and device for acquiring configuration file
CN106713471B (en)*2016-12-292019-12-13北京奇艺世纪科技有限公司Configuration file acquisition method and device
CN106789377A (en)*2017-03-242017-05-31聚好看科技股份有限公司The service parameter update method of network element cluster
CN108170477A (en)*2017-11-172018-06-15上海微波技术研究所(中国电子科技集团公司第五十研究所)Automatically the method that configuration file is produced in SCA software radios
CN108170477B (en)*2017-11-172020-12-15上海微波技术研究所(中国电子科技集团公司第五十研究所)Method for automatically producing configuration file in SCA software radio station
CN108345449A (en)*2017-12-252018-07-31海尔优家智能科技(北京)有限公司A kind of information processing method, device, storage medium and computer equipment
CN109379325A (en)*2018-08-212019-02-22广州数源畅联科技有限公司A kind of backup client delivery method without user configuration
CN109379325B (en)*2018-08-212022-03-18广州数源畅联科技有限公司Backup client delivery method without user configuration
CN111400145A (en)*2020-03-312020-07-10厦门科灿信息技术有限公司Configuration method and device of flow chart monitoring page and terminal equipment
CN111400145B (en)*2020-03-312022-09-09厦门科灿信息技术有限公司 Configuration method, device and terminal device for flow chart monitoring page
CN117193886A (en)*2023-11-062023-12-08成都科江科技有限公司Dynamic loading method for configuration file of industrial control system
CN117193886B (en)*2023-11-062024-01-05成都科江科技有限公司Dynamic loading method for configuration file of industrial control system

Similar Documents

PublicationPublication DateTitle
CN105100211A (en)Configuration file obtaining method and device
CN107330522B (en) Method, apparatus and system for updating a deep learning model
CN107330516B (en) Model parameter training method, device and system
CN114385759B (en)Configuration file synchronization method and device, computer equipment and storage medium
WO2019000630A1 (en)Multi-task scheduling method and system, application server and computer-readable storage medium
JP2021518933A5 (en)
CN107450961A (en)A kind of distributed deep learning system and its building method, method of work based on Docker containers
CN109144785A (en)Method and apparatus for Backup Data
CN103488494A (en)Multi-firmware synchronous updating and upgrading method for blade server
WO2017080257A1 (en)Data processing method and system based on key-value pair
CN107193605A (en)The installation method and system of a kind of operating system
US10838827B2 (en)System and method for time parameter based database restoration
CN108881231A (en)The method, apparatus and storage medium of synchronous account information in a kind of group system
CN108833610B (en) An information update method, device and system
WO2016155332A1 (en)Server and data processing method
CN103136030A (en)Virtual machine management system and method
CN106790432A (en) Method and device for updating software
CN113610527B (en)Alliance chain transaction method, device, system, terminal equipment and storage medium
KR101357135B1 (en)Apparatus for Collecting Log Information
CN106502856B (en)A kind of information processing method and device
US10824375B1 (en)Cloud-based snapshots with coarse and fine granularity maps for changed data
CN104503862B (en)The method and apparatus for obtaining the check value using channel bag
CN119052229A (en)File downloading method, device and computer program product
CN103403666B (en)Distributed storage control method, Apparatus and system
CN104991814A (en)Task execution result acquiring method and system

Legal Events

DateCodeTitleDescription
C06Publication
PB01Publication
C10Entry into substantive examination
SE01Entry into force of request for substantive examination
RJ01Rejection of invention patent application after publication

Application publication date:20151125

RJ01Rejection of invention patent application after publication

[8]ページ先頭

©2009-2025 Movatter.jp