[go: up one dir, main page]

CN103369054B - A kind of acquisition tasks management method and system - Google Patents

A kind of acquisition tasks management method and system Download PDF

Info

Publication number
CN103369054B
CN103369054B CN201310326074.XA CN201310326074A CN103369054B CN 103369054 B CN103369054 B CN 103369054B CN 201310326074 A CN201310326074 A CN 201310326074A CN 103369054 B CN103369054 B CN 103369054B
Authority
CN
China
Prior art keywords
collection
list
task
node
nodes
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.)
Expired - Fee Related
Application number
CN201310326074.XA
Other languages
Chinese (zh)
Other versions
CN103369054A (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.)
Beijing Sohu New Media Information Technology Co Ltd
Original Assignee
Beijing Sohu New Media Information Technology 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 Sohu New Media Information Technology Co Ltd filed Critical Beijing Sohu New Media Information Technology Co Ltd
Priority to CN201310326074.XA priority Critical patent/CN103369054B/en
Publication of CN103369054A publication Critical patent/CN103369054A/en
Application granted granted Critical
Publication of CN103369054B publication Critical patent/CN103369054B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

本发明实施例提供一种采集任务管理方法及系统,所述方法包括以下步骤:调度模块加载采集方案,从采集方案中读取目标节点列表;调度模块根据目标节点列表生成管理任务清单;调度模块根据预设的均衡机制,将管理任务清单中的采集任务分配向采集节点;所述系统包括调度模块,用于加载采集方案,从采集方案中读取目标节点列表;根据目标节点列表生成管理任务清单;根据预设的均衡机制,将管理任务清单中的采集任务分配向采集节点。

Embodiments of the present invention provide a collection task management method and system. The method includes the following steps: the scheduling module loads the collection scheme, and reads the target node list from the collection scheme; the scheduling module generates a management task list according to the target node list; the scheduling module According to the preset balance mechanism, the collection tasks in the management task list are allocated to the collection nodes; the system includes a scheduling module, which is used to load the collection scheme, and read the target node list from the collection scheme; generate management tasks according to the target node list list; according to the preset balance mechanism, the collection tasks in the management task list are allocated to the collection nodes.

Description

一种采集任务管理方法及系统A collection task management method and system

技术领域technical field

本发明涉及通信技术领域,特别涉及一种采集任务管理方法及系统。The invention relates to the field of communication technology, in particular to a collection task management method and system.

背景技术Background technique

服务器集群是指将很多子服务器集中起来一起进行同一服务的一种大规模服务器。在客户端看来一个服务器集群就等同于一个单一的服务器。显而易见,这种集成了多个子服务器的服务器集群拥有比单一服务器更高的运算速度。A server cluster refers to a large-scale server that gathers many sub-servers together to perform the same service. From the perspective of the client, a server cluster is equivalent to a single server. Obviously, this kind of server cluster integrating multiple sub-servers has a higher computing speed than a single server.

服务器集群可以用来作为大规模的数据采集系统,服务器集群中的子服务器协同运行,每个子服务器作为一个采集节点,执行相应的采集任务,即可实现多采集任务的并行处理,可以显著的提高数据采集的效率。在此前提之下,对于每个采集节点进行合理的任务管理和部署,便成为使母系统均衡运行的关键。The server cluster can be used as a large-scale data acquisition system. The sub-servers in the server cluster operate cooperatively. Each sub-server acts as a collection node and executes the corresponding collection tasks, which can realize parallel processing of multiple collection tasks, which can significantly improve The efficiency of data collection. Under this premise, reasonable task management and deployment for each collection node becomes the key to the balanced operation of the parent system.

现有的负载均衡器BIG-IP就是一种对集群数据采集系统中任务流量进行管理和分配的设备。BIG-IP能够提供灵活的算法,可以将数据流有效地转发到它所连接的集群数据采集系统。而面对前台的操作者,BIG-IP及其所管理的数据采集系统可以相当于一个虚拟服务器,使操作者无需针对每个采集节点进行操作。The existing load balancer BIG-IP is a device that manages and distributes task traffic in the cluster data collection system. BIG-IP provides flexible algorithms to efficiently forward data streams to the clustered data acquisition systems to which it is connected. Facing the front-end operator, BIG-IP and the data acquisition system it manages can be equivalent to a virtual server, so that the operator does not need to operate on each acquisition node.

BIG-IP中存在两种对采集节点进行管理和查验工具,分别是ECV(ExtendedContentVerification,扩展内容查证)和EAV(ExtendedApplicationVerification,扩展应用查证)。二者均可以根据请求对采集节点进行查验并反馈信息,通过反馈信息判断采集节点以及数据采集系统整体的运行状态,进而对采集任务进行管理和分配。不同在于,ECV响应于客户的查验请求,而EAV响应于具体应用的查验请求。There are two management and inspection tools for collection nodes in BIG-IP, namely ECV (ExtendedContentVerification, extended content verification) and EAV (ExtendedApplicationVerification, extended application verification). Both can check the collection nodes and feed back information according to the request, judge the operation status of the collection nodes and the overall data collection system through the feedback information, and then manage and allocate collection tasks. The difference is that ECV responds to client's inspection requests, while EAV responds to application-specific inspection requests.

但是,BIG-IP中两个查验工具存在的缺陷在于,虽然二者在一定程度上体现了采集任务进行管理和分配的基本思想;但是实际上,采集节点的拓扑结构纷繁复杂,而且是实时动态变化的;现有技术还不能够随着采集的进行实现数据采集系统整体达到任务流量和负载的均衡,也不能有效的进行数据采集系统的任务管理和采集节点的维护。However, the defect of the two inspection tools in BIG-IP is that although they reflect the basic idea of managing and distributing collection tasks to a certain extent, in fact, the topology of collection nodes is complicated and dynamic in real time. Changing; the existing technology is still not able to achieve the task flow and load balance of the data collection system as a whole as the collection progresses, nor can it effectively perform task management and collection node maintenance of the data collection system.

发明内容Contents of the invention

有鉴于此,本发明的目的在于提供一种采集任务管理方法及系统,所述方法在数据采集系统执行采集任务的过程中,实现对于采集任务和采集节点的管理和资源分配。In view of this, the purpose of the present invention is to provide a collection task management method and system, the method realizes the management and resource allocation of collection tasks and collection nodes during the process of data collection system executing collection tasks.

为实现上述目的,本发明有如下技术方案:To achieve the above object, the present invention has the following technical solutions:

一种采集任务管理方法,所述方法包括以下步骤:A collection task management method, said method comprising the following steps:

调度模块加载采集方案,从采集方案中读取目标节点列表;The scheduling module loads the collection plan, and reads the list of target nodes from the collection plan;

调度模块根据目标节点列表生成管理任务清单;The scheduling module generates a management task list according to the target node list;

调度模块根据预设的均衡机制,将管理任务清单中的采集任务分配向采集节点。The scheduling module assigns the collection tasks in the management task list to the collection nodes according to the preset balance mechanism.

所述调度模块还从采集方案中读取采集节点列表;则所述根据目标节点列表生成管理任务清单具体为:The scheduling module also reads the collection node list from the collection scheme; then the generation of the management task list according to the target node list is specifically:

利用采集节点列表提取进行任务单;Use the collection node list to extract the task list;

将目标节点列表与进行任务单进行对比,并将目标节点列表中对比进行任务单发生变化的部分作为管理任务清单。Compare the target node list with the ongoing task list, and use the part of the target node list that has changed compared with the ongoing task list as the management task list.

所述利用采集节点列表提取进行任务单具体为:The task list extraction by using the collection node list is specifically as follows:

调度模块监听采集节点列表中采集节点的通信,获取各个采集节点正在执行的采集任务,将正在执行的采集任务集合成进行任务单。The scheduling module monitors the communication of the collection nodes in the collection node list, obtains the collection tasks being executed by each collection node, and gathers the collection tasks being executed into a task list.

所述将目标节点列表中对比进行任务单发生变化的部分作为管理任务清单具体为:The part of the target node list that is compared with the task list that changes is used as the management task list is specifically:

当采集任务存在于目标节点列表中,且不存在于进行任务单中时,将该采集任务作为管理任务清单中的增加项;When the collection task exists in the target node list and does not exist in the task list, the collection task will be added to the management task list;

当采集任务不存在于目标节点列表中,且存在于进行任务单中时,将该采集任务作为管理任务清单中的删除项;When the collection task does not exist in the target node list and exists in the task list, the collection task will be deleted from the management task list;

当采集任务同时存在于目标节点列表和进行任务单中,但任意参数发生了变化时,将该采集任务作为管理任务清单中的修改项,且发生变化的参数以目标节点列表中参数为准。When the collection task exists in both the target node list and the progress task list, but any parameter changes, the collection task is regarded as a modification item in the management task list, and the changed parameters are subject to the parameters in the target node list.

所述预设的均衡机制具体为:The preset equalization mechanism is specifically:

根据目标节点列表中采集任务的数量和采集节点的数量,计算出每个采集节点的负载任务数值区间;According to the number of collection tasks in the target node list and the number of collection nodes, calculate the value interval of the load task of each collection node;

则所述根据预设的均衡机制将管理任务清单中的采集任务分配向采集节点具体为:Then the allocation of the collection tasks in the management task list to the collection nodes according to the preset balancing mechanism is specifically:

将管理任务清单中的采集任务分配到采集节点,使每个采集节点被分配的采集任务数量在负载任务数值区间内。Assign the collection tasks in the management task list to the collection nodes, so that the number of collection tasks assigned to each collection node is within the value range of the load task.

所述方法还包括:The method also includes:

为管理任务清单设置一个标志位,如果管理任务清单中记录了变化的采集任务时,将管理任务清单的标志位定义为true;Set a flag bit for the management task list, if a changed collection task is recorded in the management task list, define the flag bit of the management task list as true;

当根据预设的均衡机制将管理任务清单中的采集任务分配向采集节点后,将管理任务清单的标志位修改为false。After the collection tasks in the management task list are allocated to the collection nodes according to the preset balancing mechanism, the flag bit of the management task list is changed to false.

所述方法还包括:The method also includes:

调度模块向采集节点列表中的采集节点发送测试指令,致使采集节点根据测试指令对自身进行测试;调度模块并接收采集节点的反馈信息,根据反馈信息修改采集节点列表。The scheduling module sends test instructions to the collection nodes in the collection node list, causing the collection nodes to test themselves according to the test instructions; the scheduling module receives feedback information from the collection nodes, and modifies the collection node list according to the feedback information.

所述根据反馈信息修改采集节点列表具体为:The modification of the collection node list according to the feedback information is specifically:

如果采集节点反馈信息显示为测试失败,则将该采集节点从采集节点列表中删除,并将该采集节点加入死机节点列表中。If the feedback information of the collection node shows that the test fails, the collection node is deleted from the collection node list, and the collection node is added to the dead node list.

所述方法还包括:The method also includes:

调度模块向死机节点列表中的采集节点发送至少一次测试指令,当采集节点反馈信息至少一次显示为测试成功时,则将该采集节点加入到采集节点列表中。The dispatching module sends at least one test instruction to the collection nodes in the dead node list, and when the feedback information of the collection node shows that the test is successful at least once, the collection node is added to the collection node list.

所述方法还包括:The method also includes:

当新增采集节点时,将新增的采集节点加入采集节点列表中。When adding a collection node, add the newly added collection node to the list of collection nodes.

一种采集任务管理系统,所述系统具体包括:A collection task management system, the system specifically includes:

调度模块,用于加载采集方案,从采集方案中读取目标节点列表;根据目标节点列表生成管理任务清单;根据预设的均衡机制,将管理任务清单中的采集任务分配向采集节点。The scheduling module is used to load the collection plan, read the target node list from the collection plan; generate a management task list according to the target node list; assign the collection tasks in the management task list to the collection nodes according to the preset balancing mechanism.

所述调度模块包括:The scheduling module includes:

读取单元,用于加载采集方案,从采集方案中读取目标节点列表和采集节点列表;The reading unit is used to load the collection plan, and read the target node list and the collection node list from the collection plan;

进行单元,用于利用采集节点列表提取进行任务单;The processing unit is used to extract the task list by using the collection node list;

管理单元,用于将目标节点列表与进行任务单进行对比,并将目标节点列表中对比进行任务单发生变化的部分作为管理任务清单;The management unit is used to compare the target node list with the task list, and use the part of the target node list that has changed compared with the task list as the management task list;

分配单元,用于根据预设的均衡机制,将管理任务清单中的采集任务分配向采集节点。The allocation unit is configured to allocate the collection tasks in the management task list to the collection nodes according to a preset balancing mechanism.

所述调度模块还包括:The scheduling module also includes:

测试单元,用于向采集节点列表中的采集节点发送测试指令,致使采集节点根据测试指令对自身进行测试;调度模块并接收采集节点的反馈信息,根据反馈信息修改采集节点列表。The test unit is used to send test instructions to the collection nodes in the collection node list, causing the collection nodes to test themselves according to the test instructions; the scheduling module receives feedback information from the collection nodes, and modifies the collection node list according to the feedback information.

通过以上技术方案可知,本发明存在的有益效果是:可以在采集策略动态变化的情况下,相应的生成管理任务清单,并进一步的按照均衡机制修改采集节点中采集任务分配,实现采集节点上负载的均衡;通过对比目标节点列表与进行任务单,仅将变化的采集任务写入管理任务清单中,节约了通信资源和系统资源;通过为管理任务清单设置标志位,还能够避免已处理过的管理任务清单重复产生影响;向采集节点发送测试指令进行测试,实时的了解采集节点的状态,在采集节点发生变化的情况下修改采集节点列表,实现了动态的对采集节点进行管理,以便于采集任务更准确的管理和均衡的分配。It can be seen from the above technical solutions that the beneficial effects of the present invention are: in the case of dynamic changes in the collection strategy, a corresponding management task list can be generated, and the distribution of collection tasks in the collection nodes can be further modified according to the balancing mechanism, so as to realize the load on the collection nodes balance; by comparing the target node list with the task list, only the changed acquisition tasks are written into the management task list, saving communication resources and system resources; by setting the flag bit for the management task list, it is also possible to avoid processing Duplication of the management task list has an impact; send test instructions to the collection node for testing, understand the status of the collection node in real time, modify the list of collection nodes when the collection node changes, and realize dynamic management of the collection node for easy collection More accurate management and balanced distribution of tasks.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are For some embodiments of the present invention, those skilled in the art can also obtain other drawings based on these drawings without creative work.

图1为本发明实施例所述方法流程图;Fig. 1 is the flow chart of the method described in the embodiment of the present invention;

图2为本发明另一实施例所述方法流程图;Fig. 2 is a flow chart of the method described in another embodiment of the present invention;

图3为本发明实施例所述系统结构示意图。Fig. 3 is a schematic structural diagram of the system according to the embodiment of the present invention.

具体实施方式detailed description

为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments It is a part of embodiments of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.

在本发明中,所述方法在集群数据采集系统(本发明中可称之为所述采集任务管理方法及系统的母系统)执行采集任务的同时配合实施。在现有的集群数据采集系统中包括多个向目标节点进行数据采集的采集节点,并且该系统首先需要针对所有采集节点和目标节点制定采集策略,采集节点按照母系统制定的采集策略进行数据采集。In the present invention, the method is co-implemented while the cluster data collection system (which may be referred to as the parent system of the collection task management method and system in the present invention) executes the collection task. The existing cluster data acquisition system includes multiple acquisition nodes that collect data from the target node, and the system first needs to formulate acquisition strategies for all acquisition nodes and target nodes, and the acquisition nodes perform data acquisition according to the acquisition strategy formulated by the parent system .

采集策略规定了采集节点具体在某个时间针对某个目标节点采集目标数据,也就是规定了针对目标节点的采集任务;采集策略中包含了一个或多个采集任务,以分配到不同的采集节点上;采集策略是采集节点执行任务的依据。需要说明的是,在母系统中,采集任务一般是周期性的执行,也就是根据按照采集任务,采集节点以特定周期,循环不断的对目标节点进行数据的采集。在本发明的整体方案中,并不变更采集策略内容。The collection strategy stipulates that the collection node collects target data for a certain target node at a certain time, that is, specifies the collection tasks for the target node; the collection strategy contains one or more collection tasks to be assigned to different collection nodes Above; the acquisition strategy is the basis for the acquisition node to perform tasks. It should be noted that, in the parent system, collection tasks are generally performed periodically, that is, according to the collection tasks, the collection nodes collect data from the target nodes in a specific cycle in a continuous cycle. In the overall solution of the present invention, the acquisition policy content is not changed.

采集策略能够通过目标节点列表得以体现。目标节点列表中则包括各个目标节点的名称、地址等信息;目标节点列表中还可以包括每个目标节点被采集的方式的信息,例如采集周期。这就表示,目标节点列表中包括的目标节点即是采集策略中需要被采集数据的所有节点,也就是采集任务执行的目标;所以每个目标节点实际上也对应着采集策略中的一个采集任务,目标节点列表也体现了采集策略中采集任务的总和,也就等同于采集策略。The acquisition strategy can be reflected through the list of target nodes. The target node list includes information such as the name and address of each target node; the target node list may also include information on the manner in which each target node is collected, such as a collection period. This means that the target nodes included in the target node list are all the nodes that need to collect data in the collection strategy, that is, the target of the collection task execution; so each target node actually corresponds to a collection task in the collection strategy , the target node list also reflects the sum of collection tasks in the collection strategy, which is equivalent to the collection strategy.

而为了在采集的过程中分配采集任务,并控制采集节点有针对性的执行采集任务,还需要配置采集节点列表。采集节点列表和目标节点列表共同构成数据采集过程中一个完整的采集方案。In order to allocate collection tasks during the collection process and control the collection nodes to perform collection tasks in a targeted manner, it is also necessary to configure the collection node list. The collection node list and the target node list together constitute a complete collection scheme in the data collection process.

采集节点列表中包括了母系统中各个采集节点的名称、地址、运行状态以及分配状态等信息。即采集节点列表不仅描述母系统中哪些采集节点参与执行采集方案,还显示采集节点是否被分配并正在执行采集任务。The collection node list includes information such as the name, address, operation status, and distribution status of each collection node in the parent system. That is, the collection node list not only describes which collection nodes in the parent system participate in the execution of the collection scheme, but also shows whether the collection nodes are assigned and are executing collection tasks.

所述母系统即按照上述的采集方案运行,实现控制采集节点对目标节点进行数据采集。本发明中以针对上述两个列表进行操作为前提,实现对于采集任务的管理。上述应用背景在以下实施例中均适用。The parent system operates according to the above-mentioned collection scheme, and realizes controlling the collection node to collect data from the target node. In the present invention, the management of collection tasks is realized on the premise of operating on the above two lists. The above application background is applicable to the following embodiments.

参见图1所示,为本发明实施例所述采集任务管理方法的一个具体实施例。本实施例中将结合上述采集节点列表和目标节点列表生成管理任务清单,进而根据管理任务清单实现在动态变化的环境中有效的管理采集任务,使各个采集节点均衡稳定的运行。本实施例中所述方法具体包括以下步骤:Referring to FIG. 1 , it is a specific embodiment of the acquisition task management method described in the embodiment of the present invention. In this embodiment, the above collection node list and target node list will be combined to generate a management task list, and then according to the management task list, effective management of collection tasks in a dynamically changing environment will be realized, so that each collection node can run in a balanced and stable manner. The method described in this embodiment specifically includes the following steps:

步骤101、调度模块加载采集方案,从采集方案中读取目标节点列表。Step 101, the scheduling module loads the collection scheme, and reads the list of target nodes from the collection scheme.

通过所述方法的实施背景进一步可知,所述目标节点列表即意味着采集策略,所述采集策略中包括至少一个采集任务。本实施例中,调度模块可以从母系统中设有的数据库加载采集方案。It can be further known from the implementation background of the method that the target node list means a collection strategy, and the collection strategy includes at least one collection task. In this embodiment, the scheduling module can load the acquisition scheme from the database provided in the parent system.

以上步骤为所述方法得以执行必不可少的前期准备步骤。通过加载采集方案,调度模块获取目标节点列表,还可以进一步的获取采集节点列表,从而具备了进行后续的步骤的前提。还需说明的是,所述调度模块为本实施例所述方法中负责控制的部分。The above steps are the essential preparatory steps for the implementation of the method. By loading the collection scheme, the scheduling module obtains the list of target nodes, and can further obtain the list of collection nodes, so that the prerequisite for subsequent steps is met. It should also be noted that the scheduling module is the part in charge of control in the method described in this embodiment.

另外,调度模块还可以连接监听端口,利用监听端口直接接收母系统的相关指令。In addition, the scheduling module can also be connected to the monitoring port, and use the monitoring port to directly receive relevant instructions from the mother system.

步骤102、调度模块根据目标节点列表生成管理任务清单。Step 102, the scheduling module generates a management task list according to the target node list.

本实施例中对于采集节点负载的管理一般以一个采集任务为单位,通过均衡的分配采集任务以实现对于采集节点运行和负载状态的管理。一个采集任务(task)在系统中的数据呈现形式可以参考下表:In this embodiment, the management of the collection node load is generally based on a collection task as a unit, and the management of the operation and load status of the collection nodes is realized by distributing collection tasks in a balanced manner. The data presentation form of a collection task (task) in the system can refer to the following table:

参数名称parameter name 含义meaning server_idserver_id 目标节点ID4 -->target node ID4 --> server_typeserver_type 目标节点类型target node type raid_typeraid_type 目标节点磁盘类型Target node disk type server_ipserver_ip 目标节点ip地址target node ip address bmc_ipbmc_ip 目标节点bmc的ip地址The ip address of the target node bmc bmc_userbmc_user 目标节点bmc的用户名The username of the target node bmc bmc_passwordbmc_password 目标节点bmc的密码The password of the target node bmc ipmi_periodipmi_period 目标节点ipmi采集周期Target node ipmi collection cycle snmp_periodsnmp_period 目标节点snmp采集周期target node snmp collection cycle

表1Table 1

采集方案中,预先对采集节点进行任务的分配。但随着数据采集的进行,整体的采集方案会出现动态变化的情况,各采集节点的采集任务和采集节点均可能出现变化;比如,母系统重新配置了采集策略,原采集策略中的采集任务被修改或删除,还可能另有新的采集任务加入到采集策略中;或者某些采集节点可能死机,或者系统中新增了采集节点等。所以在采集过程中,各个采集节点的任务负载情况会出现不同程度的不均衡。现有技术难以针对类似的动态变化而随机应变,本实施例所述任务管理方法的目的即是通过动态的改变原有的采集任务分配,实现改善采集节点任务负载的不均衡。In the collection scheme, tasks are assigned to the collection nodes in advance. However, with the progress of data collection, the overall collection scheme will change dynamically, and the collection tasks and collection nodes of each collection node may change; for example, the parent system reconfigures the collection strategy, and the collection tasks in the original collection strategy It may be modified or deleted, and new collection tasks may be added to the collection strategy; or some collection nodes may crash, or new collection nodes may be added to the system. Therefore, during the collection process, the task load of each collection node will be unbalanced to varying degrees. It is difficult for existing technologies to adapt to similar dynamic changes. The purpose of the task management method described in this embodiment is to improve the unbalanced task load of collection nodes by dynamically changing the original distribution of collection tasks.

本实施例中,所述采集任务管理方法并不改变采集策略,也就是不会修改目标节点列表的内容。但母系统可以通过指令重新编辑采集策略,再根据新的采集策略修改目标节点列表。In this embodiment, the collection task management method does not change the collection strategy, that is, it does not modify the content of the target node list. However, the parent system can re-edit the collection strategy through instructions, and then modify the target node list according to the new collection strategy.

前述已经明确在目标节点列表中内容实质上就等同于采集策略中的内容,每个目标节点对应一个采集任务,母系统若改变了采集策略,这一改变必将也反映在目标节点列表上,所以说目标节点列表是能够体现动态变化的。本实施例中目标节点列表中共包括6个采集任务,下表为节点列表的数据形式:As mentioned above, it has been clarified that the content in the target node list is essentially the same as the content in the collection strategy. Each target node corresponds to a collection task. If the parent system changes the collection strategy, this change will also be reflected in the target node list. Therefore, the target node list can reflect dynamic changes. In this embodiment, the target node list includes 6 collection tasks, and the following table shows the data form of the node list:

表2Table 2

表2展现的目标节点中表Task1~Task6共六项任务。还对应的显示出每个任务对应的目标节点的ID以及其他信息,具体可对照表1,在此不作赘述。Table 2 shows the six tasks in the target node Table Task1~Task6. The ID and other information of the target node corresponding to each task are also correspondingly displayed. For details, please refer to Table 1, which will not be repeated here.

因为目标节点列表即表示了采集任务的集合,所以理论上可以直接将目标节点列表作为管理任务清单,供后续的任务均衡分配。但实际上仅根据目标节点列表本身,是无法看出采集任务的变化情况的,如果直接将目标节点列表作为管理任务清单而进行任务的分配,则相当于对所有的采集节点重新进行了一次任务分配;但实际上目标节点列表的变化情况一般都不是特别大,所以完全的重新分配浪费了大量通信资源和系统资源。本实施例中可以采取以下的优选方案得到管理任务清单:Because the target node list represents a collection of collection tasks, in theory, the target node list can be directly used as a management task list for subsequent balanced distribution of tasks. But in fact, it is impossible to see the change of the collection task only based on the target node list itself. If the target node list is directly used as the management task list to assign tasks, it is equivalent to re-executing the task for all collection nodes. Allocation; but in fact, the change of the target node list is generally not particularly large, so a complete re-allocation wastes a lot of communication resources and system resources. In this embodiment, the following preferred solutions can be adopted to obtain the management task list:

如果可以仅仅针对目标节点列表变化的部分进行采集节点负载的调整,必然会大大的节约资源。实际上在系统中,采集策略发生的变化并不能够直接的传达至采集节点,采集节点只依旧按照原有的分配执行任务。所以对照目标节点列表和采集节点当前执行的采集任务的情况,就可以发现目标几点列表的变化。If the load of the collection nodes can be adjusted only for the part of the target node list that changes, resources will be greatly saved. In fact, in the system, changes in the collection strategy cannot be directly communicated to the collection nodes, and the collection nodes only perform tasks according to the original assignment. Therefore, by comparing the list of target nodes and the collection tasks currently executed by the collection nodes, changes in the list of target points can be found.

本实施例中根据采集节点列表提取进行任务单,就是调度模块监听采集节点列表中采集节点的通信,通过监听通信内容直接的获取当前各个采集节点正在执行的采集任务,将所有将正在执行的采集任务集合成进行任务单。从实现方式上来讲,调度模块可以利用监听端口对采集节点进行通信交互和控制,In this embodiment, the task list is extracted according to the collection node list, that is, the scheduling module monitors the communication of the collection nodes in the collection node list, directly obtains the collection tasks currently being executed by each collection node by monitoring the communication content, and sends all the collection tasks that will be executed The task set is combined into a task list. In terms of implementation, the scheduling module can use the listening port to communicate and control the collection nodes.

假设在本实施例中,共包括两个采集节点,分别是第一采集节点和第二采集节点,通过监听两个采集节点的通信,可相应的得到两个进行任务单,具体如下:Assume that in this embodiment, there are two collection nodes, namely the first collection node and the second collection node. By monitoring the communication of the two collection nodes, two task orders can be obtained correspondingly, as follows:

第一进行任务单:First task list:

表3table 3

第一进行任务单表示,第一采集节点正在执行Task1和Task7两个任务。The first in-progress task list indicates that the first collection node is executing two tasks, Task1 and Task7.

第二进行任务单:The second task list:

表4Table 4

同理,第二进行任务单表示,第二采集节点正在执行Task3、Task4和Task5,对应的目标节点的信息同样按照规定的格式给予了显示。Similarly, the second execution task list indicates that the second collection node is executing Task3, Task4 and Task5, and the information of the corresponding target nodes is also displayed in a prescribed format.

合并上述第一进行任务单和第二进行任务单,即得到一个能够显示采集节点列表中所有采集节点任务执行和分配情况的进行任务单,也就是获悉了每个节点正在执行具体哪些任务。Combining the above-mentioned first task list and the second task list can obtain a task list that can display the task execution and distribution of all collection nodes in the collection node list, that is, know which specific tasks each node is performing.

但进行任务单显示的是,经过前一次对于采集节点的任务分配后,各个采集节点需具体的执行哪些采集任务。如果目标节点列表已发生变化,而采集节点的任务分配并没有随之改变,那么极可能出现采集节点负载的不均衡。However, the task list shows which collection tasks each collection node needs to perform after the previous task assignment to the collection nodes. If the list of target nodes has changed, but the task distribution of the collection nodes has not changed accordingly, it is very likely that the load of the collection nodes will be unbalanced.

本实施例中,将目标节点列表与进行任务单进行对比,并将目标节点列表中对比进行任务单发生变化的部分作为管理任务清单。生成管理任务清单可以按照以下的机制:In this embodiment, the target node list is compared with the task list, and the part of the target node list that has changed from the task list is used as the management task list. The management task list can be generated according to the following mechanism:

当一个采集任务存在于目标节点列表中,且不存在于进行任务单中时,将该采集任务作为管理任务清单中的增加项;When a collection task exists in the target node list and does not exist in the task list, the collection task will be added to the management task list;

当一个采集任务不存在于目标节点列表中,且存在于进行任务单中时,将该采集任务作为管理任务清单中的删除项;When a collection task does not exist in the target node list and exists in the task list, the collection task will be deleted from the management task list;

当一个采集任务同时存在于目标节点列表和进行任务单中,但任意参数发生了变化时,将该采集任务作为管理任务清单中的修改项,且发生变化的参数以目标节点列表中参数为准。When a collection task exists in the target node list and the task list at the same time, but any parameter is changed, the collection task is regarded as a modification item in the management task list, and the changed parameters are subject to the parameters in the target node list .

本实施例中,对比目标节点列表和进行任务单,可发现Task2和Task6属于增加项;Task7属于删除项;Task1、Task3和Task4均属于修改项(参数snmp_period发生了变化)。Task5未发生变化。由此,通过对比而得到的管理任务清单,避免了Task5重复的通信和处理,节约的系统资源。需要说明的是,本实施例中采集任务总数和未发生变化的采集任务数量较少,往往在真正的大规模母系统中,节约这一部分资源是相当可观的。In this embodiment, comparing the list of target nodes and the task list, it can be found that Task2 and Task6 belong to added items; Task7 belongs to deleted items; Task1, Task3 and Task4 all belong to modified items (the parameter snmp_period has changed). Task5 has not changed. Thus, the management task list obtained through comparison avoids repeated communication and processing of Task5 and saves system resources. It should be noted that the total number of collection tasks and the number of unchanged collection tasks in this embodiment are relatively small, and it is often quite considerable to save this part of resources in a real large-scale parent system.

按照上述方式,所述管理任务清单的具体数据形式如下表:According to the above method, the specific data form of the management task list is as follows:

addadd Task2、Task6Task2, Task6 modmod Task1、Task3、Task4Task1, Task3, Task4 deletedelete Task7Task7

表5table 5

步骤103、调度模块根据预设的均衡机制,将管理任务清单中的采集任务分配向采集节点。Step 103, the scheduling module assigns the collection tasks in the management task list to the collection nodes according to the preset balancing mechanism.

本实施例中,预设的均衡机制可以如下表述:In this embodiment, the preset equalization mechanism can be expressed as follows:

根据目标节点列表中采集任务的数量和采集节点的数量,计算出每个采集节点的负载任务数值区间;并使每个采集节点被分配的采集任务数量在负载任务数值区间内。According to the number of collection tasks and the number of collection nodes in the target node list, the value interval of the load task of each collection node is calculated; and the number of collection tasks assigned to each collection node is within the value interval of the load task.

本实施例中,目标节点列表中包括6个采集任务,而采集节点数量为2,所以平均每个采集节点应负载的采集任务数量为3个;由于本实施例中采集任务和采集节点数量较少,所以可以直接设定负载任务数值区间等于3;而在其他环境下,可能中采集任务和采集节点数量很大,且平均值可能出现小数,那么相应的可以适当放宽负载任务数值区间,使其不再是一个单一的数值;假如在本实施例中放宽负载任务数值区间,可以设定负载任务数值区间为2~4。当然,根据采集任务和采集节点数量级别的不同,负载任务数值区间的范围也能够根据需要适当的改变。当所有的采集节点执行的任务数量均落在负载任务数值区间内,则认为此事所有的采集节点负载达到均衡。In this embodiment, the target node list includes 6 acquisition tasks, and the number of acquisition nodes is 2, so the average number of acquisition tasks that each acquisition node should load is 3; is less, so you can directly set the value interval of the load task to be equal to 3; in other environments, there may be a large number of collection tasks and collection nodes, and the average value may appear in decimals, so the value interval of the load task can be appropriately relaxed accordingly, so that It is no longer a single numerical value; if the value range of the load task is relaxed in this embodiment, the value range of the load task can be set as 2-4. Of course, according to different collection tasks and the number levels of collection nodes, the range of the load task value range can also be appropriately changed as needed. When the number of tasks executed by all collection nodes falls within the range of load task values, it is considered that the load of all collection nodes is balanced.

本实施例中,在根据管理任务清单分配采集任务时,未发生变化的采集任务一般不会被重新分配,而对于发生变化的采集任务,往往以修改项较为优先;也就是说,例如本实施例中Task1、Task3或Task4这种仅发生参数改变的采集任务,将尽可能的不改变原本执行该采集任务的采集节点,由此同样可以节约系统的工作量。In this embodiment, when the collection tasks are assigned according to the management task list, the collection tasks that have not changed will generally not be reassigned, and for the collection tasks that have changed, the modified items are often given priority; that is, for example, this implementation In the example, the acquisition tasks such as Task1, Task3, or Task4 that only change parameters will not change the original acquisition nodes that execute the acquisition tasks as much as possible, thereby saving the workload of the system.

例如,针对本实施例中的6个采集任务和2个采集节点,可按照以下方式进行分配,负载任务数值区间等于3。For example, for the 6 collection tasks and 2 collection nodes in this embodiment, they can be allocated in the following manner, and the value interval of the load task is equal to 3.

对于第一采集节点,原本执行Task1和Task7;Task1为修改项,以目标节点列表中的参数为准进行替换;Task7为删除项,则直接删除。此时第一采集节点仅被分配了一个采集任务,小于负载任务数值区间,所以将两个增加项Task2和Task6分配到第一采集节点执行。重新分配后,第一采集节点将执行Task1、Task2和Task6三个采集任务,满足负载任务数值区间。For the first collection node, Task1 and Task7 are originally executed; Task1 is a modified item, which is replaced based on the parameters in the target node list; Task7 is a deleted item, which is directly deleted. At this time, only one collection task is assigned to the first collection node, which is smaller than the value interval of the load task, so the two added items Task2 and Task6 are assigned to the first collection node for execution. After redistribution, the first collection node will execute three collection tasks Task1, Task2 and Task6 to meet the value interval of the load task.

而第二采集节点原本执行Task3、Task4和Task5共三个采集任务,其中Task3和Task4为修改项;则可以将Task3和Task4以目标节点列表中的参数为准进行替换,Task5维持不变,第二采集节点即执行三个采集任务,数量符合负载任务数值区间。The second collection node originally executes three collection tasks of Task3, Task4 and Task5, among which Task3 and Task4 are modification items; Task3 and Task4 can be replaced according to the parameters in the target node list, and Task5 remains unchanged. The second collection node executes three collection tasks, and the number meets the value range of the load task.

由此,本实施例中两个采集节点的负载任务均为三个,达到负载均衡。Therefore, in this embodiment, the load tasks of the two collection nodes are three, achieving load balance.

在本实施例中,还可以为管理任务清单设置一个标志位,该标志位可存在true和false两个位置,是否需要依照均衡机制进行采集任务的重新分配,需要依照管理任务清单的标志位来判断。具体的,当标志位为true则判断需重新分配,反之则不需重新分配。In this embodiment, a flag can also be set for the management task list, and the flag can have two positions of true and false. Whether it is necessary to redistribute the acquisition tasks according to the balance mechanism needs to be determined according to the flag of the management task list. judge. Specifically, when the flag bit is true, it is determined that reallocation is required, otherwise, reallocation is not required.

如果在步骤102中,目标节点列表不等同于进行任务单,也就是管理任务清单中记录了二者存在变化的采集任务时,将管理任务清单的标志位定义为true。当标志位为true,则开启本步骤中依照均衡机制进行采集任务的重新分配的过程。当分配过程结束后,需将管理任务清单的标志位修改为false。在标志位为false的情况下,则不触发本步骤,如此可以防止以处理过的管理任务清单再次对任务的分配产生影响。If in step 102, the target node list is not equal to the task list, that is, when the management task list records a collection task with a change between the two, define the flag bit of the management task list as true. When the flag bit is true, the process of reallocating collection tasks according to the balance mechanism in this step is started. After the allocation process is over, the flag bit of the management task list needs to be changed to false. If the flag bit is false, this step is not triggered, so that the processed management task list can be prevented from affecting task allocation again.

通过以上技术方案可知,本实施例中所述采集任务管理方法存在的有益效果是:所述方法可以在采集策略动态变化的情况下,相应的生成管理任务清单,并进一步的按照均衡机制修改采集节点中采集任务分配,实现采集节点上负载的均衡;通过对比目标节点列表与进行任务单,仅将变化的采集任务写入管理任务清单中,节约了通信资源和系统资源;通过为管理任务清单设置标志位,还能够避免已处理过的管理任务清单重复产生影响。From the above technical solutions, it can be seen that the beneficial effect of the collection task management method described in this embodiment is: the method can generate a management task list correspondingly when the collection strategy changes dynamically, and further modify the collection task according to the balance mechanism. The distribution of collection tasks in the nodes realizes the balance of the load on the collection nodes; by comparing the list of target nodes with the task list, only the changed collection tasks are written into the management task list, which saves communication resources and system resources; Setting the flag bit can also prevent the repeated influence of the processed management task list.

前述实施例所述的采集任务管理方法,实现了在采集过程中达到采集节点负载均衡,也就是说有针对性的避免了采集策略的动态变化产生的影响。而为了进一步的针对采集节点状态的动态变化,还可以将以下优化方案结合到所述方法的整体技术方案当中,具体参见图2所示:The acquisition task management method described in the foregoing embodiments realizes the load balancing of the acquisition nodes during the acquisition process, that is to say, the impact of the dynamic change of the acquisition strategy is avoided in a targeted manner. In order to further address the dynamic change of the collection node state, the following optimization scheme can also be combined into the overall technical scheme of the method, as shown in Figure 2 for details:

步骤201、调度模块向采集节点列表中的采集节点发送测试指令,致使采集节点根据测试指令对自身进行测试;调度模块并接收采集节点的反馈信息,根据反馈信息修改采集节点列表。Step 201, the scheduling module sends test instructions to the collection nodes in the collection node list, causing the collection nodes to test themselves according to the test instructions; the scheduling module receives feedback information from the collection nodes, and modifies the collection node list according to the feedback information.

前述已知,在母系统执行采集策略的过程中,不仅采集策略可能发生改变,采集节点的状态同样可能变化,执行采集任务的采集节点可能会出现故障死机;所以如果要维持母系统正常的执行任务,实时的对采集节点进行测试,了解各个采集节点的状态并做出管理行为是至关重要的。As mentioned above, in the process of executing the collection strategy of the parent system, not only the collection strategy may change, but also the state of the collection node may change, and the collection node executing the collection task may fail or crash; so if the normal execution of the parent system is to be maintained It is very important to test the collection nodes in real time, understand the status of each collection node and make management actions.

本实施例中,调度模块可以周期性的向采集节点列表中的采集节点发出测试指令,采集节点即可按照测试指令进行测试,并向调度模块反馈信息。调度模块由此获悉每个采集节点的状态。一般而言,正常运行的采集节点均可以根据测试指令完成测试,反馈信息中将显示为测试成功;但如果某一采集节点处于死机状态,则将无法完成测试,而返回一个显示为测试失败的反馈信息。In this embodiment, the scheduling module can periodically send test instructions to the collection nodes in the collection node list, and the collection nodes can perform tests according to the test instructions and feed back information to the scheduling module. The scheduling module thus learns the status of each collection node. Generally speaking, the collection nodes that are running normally can complete the test according to the test instructions, and the feedback information will show that the test is successful; but if a collection node is in a dead state, the test will not be completed, and a test failure will be returned. Feedback.

例如在上一实施例的具体场景下,调度模块同时向第一采集节点和第二采集节点发送测试指令;假设第一采集节点正常工作,则其反馈信息显示为测试成功,第二采集节点死机,则其反馈信息为测试失败。For example, in the specific scenario of the previous embodiment, the scheduling module sends test instructions to the first collection node and the second collection node at the same time; assuming that the first collection node is working normally, its feedback information shows that the test is successful, and the second collection node crashes , the feedback message is test failure.

进一步的,在收到反馈信息之后,调度模块将根据反馈信息做出相应的管理,也就是根据反馈信息修改采集节点列表。所述采集节点列表中包括的采集节点即是正在执行任务的所有采集节点,而一旦出现死机的采集节点,需从采集节点列表中删除。当然,如果所有采集节点均正常工作,在此将不对采集节点列表进行修改。Further, after receiving the feedback information, the scheduling module will make corresponding management according to the feedback information, that is, modify the collection node list according to the feedback information. The collection nodes included in the collection node list are all collection nodes that are executing tasks, and once a dead collection node appears, it needs to be deleted from the collection node list. Of course, if all the collection nodes work normally, the list of collection nodes will not be modified here.

本实施例中,将第二采集节点从采集节点列表中删除,并加入到死机节点列表中。In this embodiment, the second collection node is deleted from the list of collection nodes and added to the list of dead nodes.

另外,为了提高所述采集节点测试的准确性,本实施例中将进一步的包括:In addition, in order to improve the accuracy of the collection node test, this embodiment will further include:

步骤202、调度模块向死机节点列表中的采集节点发送至少一次测试指令,当采集节点反馈信息至少一次显示为测试成功时,则将该采集节点加入到采集节点列表中。Step 202 , the scheduling module sends at least one test instruction to the collection nodes in the dead node list, and when the feedback information from the collection nodes indicates that the test is successful at least once, the collection node is added to the collection node list.

加入到死机节点列表中的采集节点,均是在一次测试中反馈信息为测试失败的采集节点。但是由于仅经过了一次测试,并不能排除偶然因素导致测试失败的情况;或者也可能进入死机节点列表的采集节点经过维修后已经恢复了正常运行,可以重新执行采集任务。所以本实施例中对死机节点列表中的采集节点进行重复测试,也就是重复发送至少一次的测试指令,本实施例中优选为三次。当三次测试指令中至少一次反馈信息为测试成功,则认为该采集节点能够正常执行采集任务,将该采集节点重新加入到采集节点列表中。The acquisition nodes added to the dead node list are all acquisition nodes whose feedback information is a test failure in a test. However, since the test has only been performed once, it cannot be ruled out that the test fails due to accidental factors; or the collection nodes that may enter the dead node list have returned to normal operation after maintenance, and the collection task can be performed again. Therefore, in this embodiment, repeated testing is performed on the collection nodes in the dead node list, that is, the test instruction is repeatedly sent at least once, preferably three times in this embodiment. When the feedback information of at least one of the three test instructions is that the test is successful, it is considered that the collection node can normally perform the collection task, and the collection node is re-added to the collection node list.

本实施例中,对于母系统在采集策略执行中新增采集节点的情况,可以按照以下步骤操作:In this embodiment, for the case where the parent system adds a collection node during the execution of the collection strategy, the following steps can be followed:

步骤203、当新增采集节点时,将新增的采集节点加入采集节点列表中。Step 203, when adding a collection node, add the newly added collection node into the list of collection nodes.

无论是上述哪种情况,在更改了采集节点列表之后,均需要重新按照前述实施例中步骤102所描述,根据新的采集节点列表重置进行任务单,再进一步的重置管理任务清单,最终对采集节点的采集任务进行重新分配,以实现在采集节点的动态变化的情况下,重新达到负载均衡。In either case, after changing the collection node list, it is necessary to reset the task list according to the new collection node list as described in step 102 in the previous embodiment, and then further reset the management task list, and finally The collection tasks of the collection nodes are redistributed, so as to achieve load balance again under the condition of dynamic changes of the collection nodes.

本实施例所述方法存在的有益效果是:通过调度模块向采集节点发送测试指令进行测试,实时的了解采集节点的状态,在采集节点发生变化的情况下修改采集节点列表,实现了动态的对采集节点进行管理,以便于采集任务更准确的管理和均衡的分配。The beneficial effects of the method described in this embodiment are: the dispatching module sends test instructions to the collection nodes for testing, the state of the collection nodes is understood in real time, and the list of collection nodes is modified when the collection nodes change, realizing dynamic pairing The collection nodes are managed to facilitate more accurate management and balanced distribution of collection tasks.

对应图1所示实施例所述系统,本发明进一步的公开一种采集任务管理系统,所述系统是基于所述方法而设立,二者核心技术方案一致,所述系统具体包括:Corresponding to the system described in the embodiment shown in Figure 1, the present invention further discloses a collection task management system, the system is established based on the method, and the core technical solutions of the two are consistent, and the system specifically includes:

调度模块,用于加载采集方案,从采集方案中读取目标节点列表;根据目标节点列表生成管理任务清单;根据预设的均衡机制,将管理任务清单中的采集任务分配向采集节点。The scheduling module is used to load the collection plan, read the target node list from the collection plan; generate a management task list according to the target node list; assign the collection tasks in the management task list to the collection nodes according to the preset balancing mechanism.

参照图2所示,所述调度模块包括:As shown in Figure 2, the scheduling module includes:

读取单元,用于加载采集方案,从采集方案中读取目标节点列表和采集节点列表;The reading unit is used to load the collection plan, and read the target node list and the collection node list from the collection plan;

进行单元,用于利用采集节点列表提取进行任务单;The processing unit is used to extract the task list by using the collection node list;

管理单元,用于将目标节点列表与进行任务单进行对比,并将目标节点列表中对比进行任务单发生变化的部分作为管理任务清单;The management unit is used to compare the target node list with the task list, and use the part of the target node list that has changed compared with the task list as the management task list;

分配单元,用于根据预设的均衡机制,将管理任务清单中的采集任务分配向采集节点。The allocation unit is configured to allocate the collection tasks in the management task list to the collection nodes according to a preset balancing mechanism.

通过以上技术方案可知,所述系统存在的有益效果是:所述系统可以在采集策略动态变化的情况下,相应的生成管理任务清单,并进一步的按照均衡机制修改采集节点中采集任务分配,实现采集节点上负载的均衡;通过对比目标节点列表与进行任务单,仅将变化的采集任务写入管理任务清单中,节约了通信资源和系统资源。From the above technical solutions, it can be seen that the beneficial effect of the system is: the system can generate a management task list correspondingly when the collection strategy changes dynamically, and further modify the distribution of collection tasks in the collection nodes according to the balance mechanism, so as to realize Load balancing on the collection nodes; by comparing the target node list with the task list, only the changed collection tasks are written into the management task list, saving communication resources and system resources.

另外,在所述系统中还可以结合以下的优选方案:所述调度模块还包括:In addition, the following preferred solutions can also be combined in the system: the scheduling module also includes:

测试单元,用于向采集节点列表中的采集节点发送测试指令,致使采集节点根据测试指令对自身进行测试;调度模块并接收采集节点的反馈信息,根据反馈信息修改采集节点列表。The test unit is used to send test instructions to the collection nodes in the collection node list, causing the collection nodes to test themselves according to the test instructions; the scheduling module receives feedback information from the collection nodes, and modifies the collection node list according to the feedback information.

以上优选方案存在的有益效果是:向采集节点发送测试指令进行测试,实时的了解采集节点的状态,在采集节点发生变化的情况下修改采集节点列表,实现了动态的对采集节点进行管理,以便于采集任务更准确的管理和均衡的分配。The beneficial effects of the above optimal solution are: send test instructions to the collection node for testing, understand the state of the collection node in real time, modify the list of collection nodes when the collection node changes, and realize dynamic management of the collection node. For more accurate management and balanced distribution of collection tasks.

以上所述仅是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。The above is only a preferred embodiment of the present invention, it should be pointed out that, for those of ordinary skill in the art, without departing from the principle of the present invention, some improvements and modifications can also be made, and these improvements and modifications can also be made. It should be regarded as the protection scope of the present invention.

Claims (11)

1.一种采集任务管理方法,其特征在于,所述方法包括以下步骤:1. a collection task management method, is characterized in that, described method comprises the following steps: 调度模块加载采集方案,从采集方案中读取目标节点列表;The scheduling module loads the collection plan, and reads the list of target nodes from the collection plan; 调度模块根据目标节点列表生成管理任务清单;The scheduling module generates a management task list according to the target node list; 调度模块根据预设的均衡机制,将管理任务清单中的采集任务分配向采集节点;The scheduling module assigns the collection tasks in the management task list to the collection nodes according to the preset balance mechanism; 其中,所述调度模块还从采集方案中读取采集节点列表;则所述根据目标节点列表生成管理任务清单具体为:Wherein, the scheduling module also reads the collection node list from the collection plan; then the generation of the management task list according to the target node list is specifically: 利用采集节点列表提取进行任务单;Use the collection node list to extract the task list; 将目标节点列表与进行任务单进行对比,并将目标节点列表中对比进行任务单发生变化的部分作为管理任务清单。Compare the target node list with the ongoing task list, and use the part of the target node list that has changed compared with the ongoing task list as the management task list. 2.根据权利要求1所述方法,其特征在于,所述利用采集节点列表提取进行任务单具体为:2. The method according to claim 1, characterized in that, the extraction of the task list by using the collection node list is specifically: 调度模块监听采集节点列表中采集节点的通信,获取各个采集节点正在执行的采集任务,将正在执行的采集任务集合成进行任务单。The scheduling module monitors the communication of the collection nodes in the collection node list, obtains the collection tasks being executed by each collection node, and gathers the collection tasks being executed into a task list. 3.根据权利要求1所述方法,其特征在于,所述将目标节点列表中对比进行任务单发生变化的部分作为管理任务清单具体为:3. The method according to claim 1, characterized in that, the part of the target node list that is compared with the changed task list as the management task list is specifically: 当采集任务存在于目标节点列表中,且不存在于进行任务单中时,将该采集任务作为管理任务清单中的增加项;When the collection task exists in the target node list and does not exist in the task list, the collection task will be added to the management task list; 当采集任务不存在于目标节点列表中,且存在于进行任务单中时,将该采集任务作为管理任务清单中的删除项;When the collection task does not exist in the target node list and exists in the task list, the collection task will be deleted from the management task list; 当采集任务同时存在于目标节点列表和进行任务单中,但任意参数发生了变化时,将该采集任务作为管理任务清单中的修改项,且发生变化的参数以目标节点列表中参数为准。When the collection task exists in both the target node list and the progress task list, but any parameter changes, the collection task is regarded as a modification item in the management task list, and the changed parameters are subject to the parameters in the target node list. 4.根据权利要求1所述方法,其特征在于,所述预设的均衡机制具体为:4. The method according to claim 1, wherein the preset equalization mechanism is specifically: 根据目标节点列表中采集任务的数量和采集节点的数量,计算出每个采集节点的负载任务数值区间;According to the number of collection tasks in the target node list and the number of collection nodes, calculate the value interval of the load task of each collection node; 则所述根据预设的均衡机制将管理任务清单中的采集任务分配向采集节点具体为:Then the allocation of the collection tasks in the management task list to the collection nodes according to the preset balancing mechanism is as follows: 将管理任务清单中的采集任务分配到采集节点,使每个采集节点被分配的采集任务数量在负载任务数值区间内。Assign the collection tasks in the management task list to the collection nodes, so that the number of collection tasks assigned to each collection node is within the value range of the load task. 5.根据权利要求1-4任意一项所述方法,其特征在于,所述方法还包括:5. according to the method described in any one of claim 1-4, it is characterized in that, described method also comprises: 为管理任务清单设置一个标志位,如果管理任务清单中记录了变化的采集任务时,将管理任务清单的标志位定义为true;Set a flag bit for the management task list, if a changed collection task is recorded in the management task list, define the flag bit of the management task list as true; 当根据预设的均衡机制将管理任务清单中的采集任务分配向采集节点后,将管理任务清单的标志位修改为false。After the collection tasks in the management task list are allocated to the collection nodes according to the preset balancing mechanism, the flag bit of the management task list is changed to false. 6.根据权利要求1所述方法,其特征在于,所述方法还包括:6. The method according to claim 1, wherein the method further comprises: 调度模块向采集节点列表中的采集节点发送测试指令,致使采集节点根据测试指令对自身进行测试;调度模块并接收采集节点的反馈信息,根据反馈信息修改采集节点列表。The scheduling module sends test instructions to the collection nodes in the collection node list, causing the collection nodes to test themselves according to the test instructions; the scheduling module receives feedback information from the collection nodes, and modifies the collection node list according to the feedback information. 7.根据权利要求6所述方法,其特征在于,所述根据反馈信息修改采集节点列表具体为:7. The method according to claim 6, wherein the modification of the collection node list according to the feedback information is specifically: 如果采集节点反馈信息显示为测试失败,则将该采集节点从采集节点列表中删除,并将该采集节点加入死机节点列表中。If the feedback information of the collection node shows that the test fails, the collection node is deleted from the collection node list, and the collection node is added to the dead node list. 8.根据权利要求7所述方法,其特征在于,所述方法还包括:8. The method according to claim 7, wherein the method further comprises: 调度模块向死机节点列表中的采集节点发送至少一次测试指令,当采集节点反馈信息至少一次显示为测试成功时,则将该采集节点加入到采集节点列表中。The dispatching module sends at least one test instruction to the collection nodes in the dead node list, and when the feedback information of the collection node shows that the test is successful at least once, the collection node is added to the collection node list. 9.根据权利要求6-8任意一项所述方法,其特征在于,所述方法还包括:9. The method according to any one of claims 6-8, wherein the method further comprises: 当新增采集节点时,将新增的采集节点加入采集节点列表中。When adding a collection node, add the newly added collection node to the list of collection nodes. 10.一种采集任务管理系统,其特征在于,所述系统具体包括:10. A collection task management system, characterized in that the system specifically includes: 调度模块,用于加载采集方案,从采集方案中读取目标节点列表;根据目标节点列表生成管理任务清单;根据预设的均衡机制,将管理任务清单中的采集任务分配向采集节点;The scheduling module is used to load the collection plan, read the target node list from the collection plan; generate a management task list according to the target node list; assign the collection tasks in the management task list to the collection nodes according to the preset balancing mechanism; 所述调度模块包括:The scheduling module includes: 读取单元,用于加载采集方案,从采集方案中读取目标节点列表和采集节点列表;The reading unit is used to load the collection plan, and read the target node list and the collection node list from the collection plan; 进行单元,用于利用采集节点列表提取进行任务单;The processing unit is used to extract the task list by using the collection node list; 管理单元,用于将目标节点列表与进行任务单进行对比,并将目标节点列表中对比进行任务单发生变化的部分作为管理任务清单;The management unit is used to compare the target node list with the task list, and use the part of the target node list that has changed compared with the task list as the management task list; 分配单元,用于根据预设的均衡机制,将管理任务清单中的采集任务分配向采集节点。The allocation unit is configured to allocate the collection tasks in the management task list to the collection nodes according to a preset balancing mechanism. 11.根据权利要求10所述系统,其特征在于,所述调度模块还包括:11. The system according to claim 10, wherein the scheduling module further comprises: 测试单元,用于向采集节点列表中的采集节点发送测试指令,致使采集节点根据测试指令对自身进行测试;调度模块并接收采集节点的反馈信息,根据反馈信息修改采集节点列表。The test unit is used to send test instructions to the collection nodes in the collection node list, causing the collection nodes to test themselves according to the test instructions; the scheduling module receives feedback information from the collection nodes, and modifies the collection node list according to the feedback information.
CN201310326074.XA 2013-07-30 2013-07-30 A kind of acquisition tasks management method and system Expired - Fee Related CN103369054B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310326074.XA CN103369054B (en) 2013-07-30 2013-07-30 A kind of acquisition tasks management method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310326074.XA CN103369054B (en) 2013-07-30 2013-07-30 A kind of acquisition tasks management method and system

Publications (2)

Publication Number Publication Date
CN103369054A CN103369054A (en) 2013-10-23
CN103369054B true CN103369054B (en) 2016-05-18

Family

ID=49369575

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310326074.XA Expired - Fee Related CN103369054B (en) 2013-07-30 2013-07-30 A kind of acquisition tasks management method and system

Country Status (1)

Country Link
CN (1) CN103369054B (en)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105806144A (en) * 2015-05-18 2016-07-27 山东信合节能科技股份有限公司 Mine waste heat recycling system and method adopting cloud processing
CN105137925B (en) * 2015-07-23 2018-02-16 上海极熵数据科技有限公司 The job scheduling method of automatic industrial equipment
CN105868021A (en) * 2016-03-23 2016-08-17 浪潮通信信息系统有限公司 Task allocation method and apparatus
CN106126346B (en) * 2016-07-05 2019-02-26 东北大学 A large-scale distributed data acquisition system and method
CN106534259B (en) * 2016-09-30 2019-08-13 山东大学 Web data acquisition method, Web server and web data acquisition system based on Docker
CN106603282B (en) * 2016-12-08 2019-11-29 上海斐讯数据通信技术有限公司 A kind of acquisition method of network resource management system and net neutral energy data
CN108769115A (en) * 2018-04-19 2018-11-06 中国科学院计算技术研究所 Distributed RSS data acquisition method and system
CN109120688A (en) * 2018-08-10 2019-01-01 北京天安智慧信息技术有限公司 Distributed acquisition method for industrial real-time data
CN110912905A (en) * 2019-11-28 2020-03-24 云南电网有限责任公司电力科学研究院 Laboratory data acquisition system and method
CN112765121A (en) * 2021-01-08 2021-05-07 北京虹信万达科技有限公司 Administration and application system based on big data service
CN113342665B (en) * 2021-06-17 2023-10-20 北京百度网讯科技有限公司 Task allocation method and device, electronic equipment and computer readable medium
CN113918791A (en) * 2021-11-11 2022-01-11 国网江苏省电力有限公司无锡供电分公司 A Multi-source Heterogeneous Power Grid Information Collection System

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101938502A (en) * 2009-07-14 2011-01-05 北京邮电大学 A server cluster system and load balancing method
JP2012216090A (en) * 2011-03-31 2012-11-08 Fujitsu Ltd Data collection device, data collection program, and data collection method
CN103138989A (en) * 2013-02-25 2013-06-05 武汉华工安鼎信息技术有限责任公司 A massive log analysis system and method
CN103207920A (en) * 2013-04-28 2013-07-17 北京航空航天大学 Parallel metadata acquisition system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101938502A (en) * 2009-07-14 2011-01-05 北京邮电大学 A server cluster system and load balancing method
JP2012216090A (en) * 2011-03-31 2012-11-08 Fujitsu Ltd Data collection device, data collection program, and data collection method
CN103138989A (en) * 2013-02-25 2013-06-05 武汉华工安鼎信息技术有限责任公司 A massive log analysis system and method
CN103207920A (en) * 2013-04-28 2013-07-17 北京航空航天大学 Parallel metadata acquisition system

Also Published As

Publication number Publication date
CN103369054A (en) 2013-10-23

Similar Documents

Publication Publication Date Title
CN103369054B (en) A kind of acquisition tasks management method and system
CN103414761B (en) Mobile terminal cloud resource scheduling method based on Hadoop framework
CN105025095B (en) Realize the aggregated structure of cloud computing elasticity service
US8949847B2 (en) Apparatus and method for managing resources in cluster computing environment
EP3180695B1 (en) Systems and methods for auto-scaling a big data system
Xu et al. Survivable virtual infrastructure mapping in virtualized data centers
CN104123182B (en) Based on the MapReduce task of client/server across data center scheduling system and method
CN101986272A (en) Task scheduling method under cloud computing environment
CN104601664B (en) A kind of control system of cloud computing platform resource management and scheduling virtual machine
CN102929769B (en) Virtual machine internal-data acquisition method based on agency service
US10795736B2 (en) Cross-cluster host reassignment
US10191815B2 (en) Parallel node backup for CSV
CN103095599A (en) Dynamic feedback weighted integration load scheduling method of cloud computing operating system
CN104112049B (en) Based on the MapReduce task of P2P framework across data center scheduling system and method
JP2013168140A (en) Method for deploying virtual machines
Dong et al. Energy-aware scheduling schemes for cloud data centers on google trace data
KR101371068B1 (en) Method and System on Triggering Using Monitoring Metric for Cloud Computing Resource Management
CN109951320A (en) An extensible multi-level monitoring framework for cloud platform and its monitoring method
Khanna RAS: A novel approach for dynamic resource allocation
Wang et al. Dependency-aware network adaptive scheduling of data-intensive parallel jobs
US8977752B2 (en) Event-based dynamic resource provisioning
Li et al. Application research of docker based on mesos application container cluster
CN106059940A (en) Flow control method and device
Zhang et al. Design and implementation of cloud-based performance testing system for web services
CN104317635B (en) Dynamic resource scheduling method and system under hybrid task

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CP02 Change in the address of a patent holder
CP02 Change in the address of a patent holder

Address after: 100086 12, 1201, 3 building, 2 South Road, Haidian District Academy of Sciences, Beijing.

Patentee after: BEIJING SOHU NEW MEDIA INFORMATION TECHNOLOGY Co.,Ltd.

Address before: 100084 Beijing Haidian District Zhongguancun East Road 1 hospital 9 building Sohu cyber Building 8 floor 802 room.

Patentee before: BEIJING SOHU NEW MEDIA INFORMATION TECHNOLOGY Co.,Ltd.

CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20160518