Information collection method and device
Through the combination of multi-processing programs and message queue middleware, the scalability and availability problems of the distributed device information collection system are solved, efficient information collection and resource optimization are achieved, and the processing capacity and reliability of the system are improved.
Patent Information
- Application Number
- CN202011470311.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-14
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2040-12-14
AI Technical Summary
The existing device information collection system has low scalability and lacks high availability when processing a large number of distributed devices, resulting in a performance bottleneck on the main node and making it difficult to implement a scalable and highly available information collection platform.
Use multiple handlers to receive task requests on a peer-to-peer basis, split tasks and process them through highly available message queue middleware, use multiple second handlers to asynchronously process subtasks, store information and perform resource optimization, and dynamically adjust handlers. Quantity to suit task volume.
It implements an efficient, scalable and highly available information collection method from a large number of distributed devices, improves processing efficiency and system resource utilization, and reduces the time for information collection and resource optimization.
Smart Images

Figure CN112698929B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer information processing, and in particular to an information collection method and device. Background Art
[0002] With the increasing development and progress of communication technology and the Internet, the use of ultra-large data computing platforms composed of distributed storage devices or computing devices across regions and time zones is becoming a trend.
[0003] Then, how to collect relevant information of devices from these increasingly distributed devices, such as configuration data, performance data, status data, etc., and manage these data in a unified manner, is becoming increasingly difficult.
[0004] Most of the existing equipment information collection systems use a system architecture of one master node and multiple proxy nodes, and integrate data capture, storage, and display functions together, with low scalability and lack of high availability solutions. Under this architecture, once the number of devices grows to a certain level, such as more than 200 devices, the master node will have an obvious performance bottleneck.
[0005] Therefore, how to build a scalable and highly available distributed information collection platform and implement a more scalable device information collection method based on it is still a technical problem to be solved. Summary of the invention
[0006] In view of the above problems, embodiments of the present invention provide an information collection method, device and storage medium.
[0007] According to the first aspect of an embodiment of the present invention, an information collection method includes: multiple first processing programs receive task requests in a peer-to-peer manner, obtain a device list and split the task request into multiple subtasks, and send the subtasks to a highly available message queue middleware MQ; after the message queue middleware receives the subtasks, it notifies multiple second processing programs to extract the subtasks for processing; and multiple second processing programs obtain subtasks from the message queue middleware in a peer-to-peer manner and process the corresponding subtasks.
[0008] According to an implementation manner of an embodiment of the present invention, the task request includes an information collection task, and correspondingly, processing the corresponding subtask includes collecting information of the corresponding device.
[0009] According to an implementation manner of an embodiment of the present invention, before collecting information of the corresponding device, the method further includes: customizing the information to be collected.
[0010] According to an implementation manner of an embodiment of the present invention, after collecting information of the corresponding device, the method further includes: storing the collected information in an information storage system shared with other applications.
[0011] According to an implementation of an embodiment of the present invention, after collecting information of the corresponding device, the method also includes: judging whether there is a device with abnormal resource usage based on the information collected by the information collection task and in combination with other device management information; if so, generating a resource tuning task for the corresponding device and sending the resource tuning task to multiple first processing programs.
[0012] According to an implementation of an embodiment of the present invention, the task request also includes a resource optimization task.
[0013] According to an implementation mode of an embodiment of the present invention, obtaining a device list includes: obtaining a device list from a configuration management database CMDB, wherein the configuration management database also stores other device management information corresponding to the device; accordingly, after processing the corresponding subtask, the method also includes: updating the device list and / or other device management information of the configuration management database according to the processing result of the subtask.
[0014] According to an implementation of an embodiment of the present invention, the message queue middleware has multiple instances, and accordingly, sending the subtask to the highly available message queue middleware includes: sending the subtask to an instance of the highly available message queue middleware that is adjacent to the device corresponding to the subtask.
[0015] According to an implementation manner of an embodiment of the present invention, after splitting the task request into a plurality of subtasks, the method further includes: obtaining the number of subtasks; and adjusting the number of second processing programs according to the number of subtasks.
[0016] According to a second aspect of an embodiment of the present invention, there is provided an information collection device, which includes: a task request receiving module, used to receive task requests in a peer-to-peer manner; a device list acquisition module, used to acquire a device list; a subtask splitting module, used to split the task request into multiple subtasks; a subtask sending module, used to send the subtask to a highly available message queue middleware MQ; a subtask scheduling module, used to notify multiple second processing programs to extract subtasks for processing after receiving the subtasks; and a subtask processing module, used to acquire subtasks from the message queue middleware in a peer-to-peer manner and process the corresponding subtasks.
[0017] According to a third aspect of an embodiment of the present invention, a computer storage medium stores program instructions on the computer storage medium, and the program instructions are used to execute any of the above-mentioned information collection methods when running.
[0018] The embodiment of the present invention provides an information collection method, device and computer storage medium, the method comprising: multiple first processing programs receive task requests in a peer-to-peer manner, obtain a device list and split the task request into multiple subtasks, and send the subtasks to a highly available message queue middleware MQ; then, multiple second processing programs obtain the subtasks from the message queue middleware in a peer-to-peer manner and process the corresponding subtasks, wherein the number of the second processing programs can be adjusted accordingly according to the number of the subtasks. In this way, task requests are received by multiple peer programs, and task scheduling is performed using the highly available message queue middleware MQ, and then the tasks are obtained and processed by multiple peer programs, thereby achieving high availability in each link from receiving tasks, scheduling tasks to processing tasks.
[0019] It should be understood that the teachings of the present invention are not required to achieve all of the beneficial effects described above, but specific technical solutions can achieve specific technical effects, and other embodiments of the present invention can also achieve beneficial effects not mentioned above. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood by reading the detailed description below with reference to the accompanying drawings. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, in which:
[0021] In the drawings, the same or corresponding reference numerals represent the same or corresponding parts.
[0022] Figure 1 This is a schematic diagram of the implementation process of the information collection method according to an embodiment of the present invention;
[0023] Figure 2 This is a schematic diagram of a specific implementation process of an information collection method according to an embodiment of the present invention;
[0024] Figure 3 The figure is a schematic diagram of the structure of the information collection device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0025] In order to make the purpose, features and advantages of the present invention more obvious and easy to understand, 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 are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0026] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine different embodiments or examples described in this specification and the features of different embodiments or examples, unless they are contradictory.
[0027] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0028] Figure 1 The implementation process of the information collection method according to the embodiment of the present invention is shown. Figure 1 The method includes: operation 110, multiple first processing programs receive task requests in a peer-to-peer manner, obtain a device list and split the task request into multiple subtasks, and send the subtasks to a highly available message queue middleware MQ; operation 120, after the message queue middleware receives the subtasks, it notifies multiple second processing programs to extract the subtasks for processing; operation 130, multiple second processing programs obtain subtasks from the message queue middleware in a peer-to-peer manner and process the corresponding subtasks.
[0029] In operation 110, the first processing program may be an application program, a network service, or a page for receiving network requests. The first processing program may be deployed on distributed servers or processing nodes, wherein the server may also correspond to a virtual machine. In addition, the first processing program on the same server or processing node may also run in multiple program execution containers (e.g., docker) to form multiple independent and equal instances. Usually, a load balancer or agent is usually set at the front end of the first processing program to enable multiple first processing programs to receive task requests in an equal manner, so as to achieve high availability of receiving task requests.
[0030] Afterwards, in order to further improve the concurrency of subsequent processing jobs, the task request can be split into multiple subtasks based on the device list.
[0031] The device list may be specified by parameters in the task request; may be obtained from a specified device configuration information management database; may be specified in a configuration file, etc.
[0032] Subtasks refer to task units that can be run independently after splitting the received task request in combination with the device list. For example, suppose the task "Collect the remaining storage space of all devices in area B" is received, where the list of all devices in area B obtained is: server01, server 02, ..., server15, then the task can be split into "Subtask 01: Collect the remaining storage space of server01", "Subtask 02: Collect the remaining storage space of server02", ..., "Subtask 15: Collect the remaining storage space of server15".
[0033] Sending subtasks to a highly available message queue middleware mainly refers to placing the task as a message into a message queue by acting as a producer of the message queue middleware.
[0034] In this way, a task can be decomposed into multiple subtasks that can be executed concurrently, which improves the efficiency of program operation and significantly shortens the execution time.
[0035] In operation 120, the message queue middleware mainly refers to the middleware that realizes high availability and persistence of the message queue through the cluster system. The message queue is a first-in-first-out data structure. The data generator can put the data to be provided into the message queue, and it can be returned without waiting. The data consumer can asynchronously obtain the required data for processing by subscription or push by the message queue middleware. It is particularly suitable for solving problems such as application coupling, asynchronous messages and traffic clipping in distributed systems.
[0036] For the application scenario of the embodiment of the present invention, the task of collecting device information can be divided into multiple subtasks that can be executed in parallel for each device in the device list, and these subtasks can be executed asynchronously. Therefore, the introduction of message queue middleware for task allocation can greatly improve the processing capacity of the system compared with the traditional task allocation method.
[0037] An example is as follows: suppose a task request is to collect information from 100 devices, the time for parsing and splitting the task request is 50 milliseconds, and the time required to collect information from one device each time is 50 milliseconds. Without considering network transmission delays, the time for serial execution of the task request is 5050 (50*11) milliseconds, and the time for parallel execution of the task request is 100 (50+50) milliseconds.
[0038] Without the introduction of a message queue, the above task request will be processed by a server or node running the first processing program. When the task request is executed serially, the CPU processing capacity in 1 second is approximately 0.2 times (1000 / 5050); the request capacity processed in parallel is 10 times (1000 / 100).
[0039] With the introduction of the message queue, the server or node running the first processing program only needs to parse and split the task request without executing each subtask of collecting individual device information. At this time, the processing time per time is reduced from a minimum of 100 milliseconds to 50 milliseconds, and the CPU processing capacity in 1 second is about 20 times (1000 / 50).
[0040] It can be seen that after adopting the message queue, the processing capacity of the CPU of the server running the first processing program in unit time can be greatly improved.
[0041] As for the servers or nodes running the second processing program end, when the message queue middleware is not introduced, each server or node will randomly receive a varying number of information collection subtasks. Since the hardware performance of each server or node may be different, and the load in a certain period of time may also be different, it is possible that some servers or nodes have completed the assigned information collection subtasks, while some servers or nodes still have many information collection subtasks that have not been processed.
[0042] After the introduction of the message queue, each second processing program can obtain a single information collection subtask from the message queue one by one according to its own processing capacity. In this way, even if the processing speed of a server or node running the second processing program is slow, it will not become a bottleneck for task request processing.
[0043] It can be seen that after the introduction of the message queue, the processing efficiency of the information collection subtask request can be greatly improved and the total processing time can be shortened.
[0044] In operation 130, the second processing program mainly refers to the consumer of the message queue on the message queue middleware, and as a consumer of the message queue, obtains messages from the message queue for processing. The second processing program can be an application program, a network service, or an executable script program.
[0045] The second processing program can be deployed on various distributed servers or processing nodes. The second processing program on the same server or processing node can also run in multiple program execution containers (for example, docker) to form multiple independent and peer instances.
[0046] The second processing program can also establish a registration relationship with MQ by subscription, and will receive corresponding notification when there is a message that needs to be processed stored in the MQ queue.
[0047] The second processing program, as a consumer of the message queue, obtains subtasks from the message queue middleware in a peer-to-peer manner and processes them accordingly.
[0048] It can be seen that task requests are received through multiple peer programs, and task scheduling is performed using the highly available message queue middleware MQ. These tasks are then acquired and processed by multiple peer programs, thereby achieving high availability in all links from receiving tasks, scheduling tasks to processing tasks.
[0049] According to an implementation manner of an embodiment of the present invention, the task request includes an information collection task, and correspondingly, processing the corresponding subtask includes collecting information of the corresponding device.
[0050] According to an implementation manner of an embodiment of the present invention, before collecting information of the corresponding device, the method further includes: customizing the information to be collected.
[0051] In this embodiment, the task of information collection is performed by a second program developed by the implementer. Therefore, the information to be collected can be customized through programming. For example, data can be obtained through a storage interface, and the storage type and related indicators can be flexibly customized, including: relevant indicators can be specified through certain parameters in the task request; relevant indicators to be collected can also be defined through certain configuration files, etc.
[0052] Compared with using the preset information types in a third-party information collection system, the types of information that can be collected can be defined according to needs and can be continuously expanded, making it more flexible to implement.
[0053] According to an implementation manner of an embodiment of the present invention, after collecting information of the corresponding device, the method further includes: storing the collected information in an information storage system shared with other applications.
[0054] In this embodiment, the information storage system may be a network shared file system, a distributed database, a configuration information table, etc. The information in these information storage systems can be shared by other applications, such as a device information management system, a system status tracking system, a reporting system, etc., to avoid repeated information collection and to more conveniently synchronize information in various systems.
[0055] According to an implementation of an embodiment of the present invention, after collecting information of the corresponding device, the method also includes: judging whether there is a device with abnormal resource usage based on the information collected by the information collection task and in combination with other device management information; if so, generating a resource tuning task for the corresponding device and sending the resource tuning task to multiple first processing programs.
[0056] In this embodiment, other device management information mainly refers to the device's usage information (what processing services it is used for) and resource usage thresholds set according to the usage information, such as CPU usage, memory allocation, hard disk storage space usage, number of connections, number of IO accesses, etc.
[0057] When determining whether there is a device with abnormal resource usage, the collected information can be compared with the corresponding resource usage threshold. If there is a situation that exceeds the threshold range, it can be determined that the task has abnormal resource usage.
[0058] Resource tuning tasks mainly refer to corresponding resource management tasks generated based on abnormal resource usage, such as terminating programs that occupy too many resources; suspending, restarting or deleting servers with abnormal resource usage; reallocating resources to devices with abnormal resource usage, etc.
[0059] In this embodiment, not only will the daily information collection tasks be completed, but the resource usage of the equipment will also be regularly monitored based on the collected information, thereby forming an information feedback mechanism to automatically discover and promptly handle corresponding abnormal events, so that the equipment is in a well-controlled state as much as possible.
[0060] According to an implementation of an embodiment of the present invention, the task request also includes a resource optimization task.
[0061] In this embodiment, the highly available information collection architecture can also be used to perform resource optimization tasks. In this way, the repeated construction of the system can be reduced, the utilization rate of each processing node can be improved, and information collection and resource optimization can be centrally managed to form a virtuous cycle.
[0062] According to an implementation mode of an embodiment of the present invention, obtaining a device list includes: obtaining a device list from a configuration management database CMDB, wherein the configuration management database also stores other device management information corresponding to the device; accordingly, after processing the corresponding subtask, the method also includes: updating the device list and / or other device management information of the configuration management database according to the processing result of the subtask.
[0063] Compared with the method of maintaining the device list by yourself, in this embodiment, a connection is established with the CMDB and the device list is directly obtained from the CMDB, so that the update status and the latest status of the device can be known in real time without regular synchronization, which greatly reduces the update delay and inaccurate information problems.
[0064] In addition, after processing the corresponding subtasks, the device list and / or other device management information of the configuration management database is updated according to the processing results of the subtasks, which can also directly form a closed-loop management of the device information.
[0065] According to an implementation of an embodiment of the present invention, the message queue middleware has multiple instances, and accordingly, sending the subtask to the highly available message queue middleware includes: sending the subtask to an instance of the highly available message queue middleware that is adjacent to the device corresponding to the subtask.
[0066] In this embodiment, using instances where the subtasks correspond to devices in close proximity, for example, pairing by IP address, can shorten network transmission events, thereby shortening the processing time of the entire task.
[0067] According to an implementation manner of an embodiment of the present invention, after splitting the task request into a plurality of subtasks, the method further includes: obtaining the number of subtasks; and adjusting the number of second processing programs according to the number of subtasks.
[0068] The number of second processing programs mainly refers to the number of instances of the second processing programs running in different containers on different servers or processing nodes. The number of second processing programs can be adjusted by creating or deleting running instances of the second processing programs through application management tools of different servers or processing nodes.
[0069] When there are many subtasks, a new running instance of the second processing program can be created to extract subtasks from the message queue as quickly as possible; on the contrary, when there are many subtasks, the running instance of the second processing program can be deleted to free up more system resources. In this way, the situation where the second processing program cannot handle too few instances can be minimized; at the same time, the existing system resources can be fully utilized to further improve the utilization rate of system resources.
[0070] Figure 2 The specific implementation process of the information collection method of the embodiment of the present invention is shown. Figure 2As shown, in this application, the task request handler 202 and the subtask executor 204 are implemented by microservices deployed by kubernetes+docer. These microservices (e.g., task request handler 202 and subtask executor 204) are deployed on multiple running containers (e.g., docker) in multiple virtual machine servers (Node / Worker) on kubernetes. Through this deployment method, a peer-to-peer relationship and a high availability mechanism between multiple handler instances can be achieved, that is, when a container or a virtual machine fails, it will not affect other containers or virtual machines, nor will it affect the processing and advancement of the collection task, while increasing the task parallel processing capability of the entire application.
[0071] In this application, the specific process of performing information collection tasks is as follows:
[0072] First, the task scheduler 201 triggers the information collection task through a scheduled task (e.g., cronjob) or after receiving a command to perform information collection;
[0073] Next, these tasks will be processed by multiple task request handlers 202 (first handlers), which are also deployed on multiple running containers (dockers) in certain virtual machines (Node / Worker) on kubernetes to achieve peer-to-peer reception and processing of task requests;
[0074] When each task request handler 202 processes an information collection task, it will first obtain a list of devices from the configuration management data (CMDB) 208, and then split the received information collection task into subtasks for each device. For example, the task "Collect CPU usage of all devices in computer room A" is received; all devices in computer room A are obtained from CMDB, such as server01, server 02, ..., server15; the task is split into "Subtask 01: Collect CPU usage of server01", "Subtask 02: Collect CPU usage of server02", ..., "Subtask 15: Collect CPU usage of server15". Subsequently, the IP address of each server is obtained, and each subtask is sent to a message queue (MQ) 203 (for example, RabbitMQ) adjacent to the IP address;
[0075] After that, the message queue (MQ) 203 receives the relevant task and notifies the subtask execution program 204 (second processing program) registered to receive the message queue task to extract the information collection subtask;
[0076] Subsequently, the subtask execution program 204 obtains the information collection subtask, for example, "Subtask 01: Collect CPU usage of server01", and will access server01 and collect the CPU usage of server01. After obtaining the results, the collected results are sent to the performance information system 206 (for example, Prometheus) or the configuration / status information database 205 (for example, MySQL).
[0077] Then, after collecting the information, the task scheduler 201 will also check whether Server01 has abnormal resource usage based on the device management information of the CMDB, including business priority, devices connected to the business, CPU usage or storage space available for business use, and information collected in the configuration / status database 205 and the performance information system 206.
[0078] For example, the information in the CMDB shows that there are currently two business system hosts using the same storage, namely the order business host server01 (S1, the highest level, sensitive to IO delay) and the report business server02 (S3, medium level, insensitive to IO delay). The two business hosts use the same storage performance quota (such as 10000iops). At a certain moment, according to the performance collection data, it is found that the read and write response delays of the two hosts are both over 10ms.
[0079] According to the definition of business classification in CMDB, the read and write delays at this time exceed the warning threshold of S1-level business, but do not reach the warning threshold of S3-level business. Therefore, the resource optimization task for S1-level business is triggered on the task scheduler 201.
[0080] Afterwards, the task scheduler 201 starts a process for processing resource optimization tasks to process the resource optimization tasks, including:
[0081] The resource tuning task is sent to a task request processing program 202, and the task request processing program 202 sends the resource tuning task to a message queue (MQ) adjacent to server01;
[0082] The message queue (MQ) notifies the subtask executor 204 (acting as the resource tuning executor at this time) that is registered to receive the message queue task to extract the resource tuning subtask;
[0083] Access server01 through subtask processing program 204, and adjust the storage performance quota threshold of order service host server01 first (in units of 10%). After adjustment, continue to compare the collected performance indicators. If the read and write delay of the order system host is reduced to below the performance warning threshold of S1 level service, stop adjusting; otherwise, continue adjusting.
[0084] Assume that in another case, if the task received by the subtask processing program 204 is "termination of server01", it is also necessary to update the device list in the CMB and delete server01.
[0085] During the above information collection process or the execution process of the resource allocation task, the task scale scheduling 207 will periodically check the number of tasks in the MQ, and dynamically adjust the number of instances of the subtask execution program 204 according to the number of tasks in the MQ.
[0086] In addition, since the information collection and resource tuning tasks are microservices implemented through RestfulAPI, data can be obtained through the storage interface in the code that implements its functions, and the storage type and related indicators can be flexibly customized, thereby realizing the customization of the information to be collected.
[0087] Furthermore, an embodiment of the present invention also provides an information collection device, such as Figure 3 As shown, the device 30 includes: a task request receiving module 301, which is used to receive task requests in a peer-to-peer manner; a device list acquisition module 302, which is used to obtain a device list; a subtask splitting module 303, which is used to split the task request into multiple subtasks; a subtask sending module 304, which is used to send the subtask to the highly available message queue middleware MQ; a subtask scheduling module 305, which is used to notify multiple second processing programs to extract subtasks for processing after receiving the subtasks; and a subtask processing module 306, which is used to obtain subtasks from the message queue middleware in a peer-to-peer manner and process the corresponding subtasks.
[0088] According to an implementation of an embodiment of the present invention, the task request receiving module 301 is specifically used to receive an information collection task, and correspondingly, the subtask processing module 306 is specifically used to collect information of the corresponding device.
[0089] According to an implementation of an embodiment of the present invention, the device 30 further includes a collection information customization module for customizing the information to be collected.
[0090] According to an implementation of an embodiment of the present invention, the device 30 further includes an information storage module, which is used to store the collected information in an information storage system shared with other applications.
[0091] According to an implementation mode of an embodiment of the present invention, the device 30 also includes: a resource anomaly judgment module, which is used to judge whether there are devices with abnormal resource occupancy based on the information collected by the information collection task and in combination with other device management information; a resource tuning task generation module, which is used to generate resource tuning tasks for corresponding devices; and a resource tuning task sending module, which is used to send resource tuning tasks to multiple first processing programs.
[0092] According to an implementation of an embodiment of the present invention, the task request receiving module 301 is specifically used to receive a resource tuning task.
[0093] According to an implementation mode of an embodiment of the present invention, the device list acquisition module 302 is specifically used to obtain a device list from a configuration management database CMDB, wherein the configuration management database also stores other device management information corresponding to the device; accordingly, the device 30 also includes a data update module, which is used to update the device list and / or other device management information in the configuration management database according to the processing results of the subtask.
[0094] According to an implementation of an embodiment of the present invention, the message queue middleware has multiple instances. Accordingly, the subtask sending module 304 is specifically used to send the subtask to an instance of the highly available message queue middleware that is adjacent to the device corresponding to the subtask.
[0095] According to an implementation of an embodiment of the present invention, the device 30 further includes: a subtask quantity acquisition module, used to acquire the number of subtasks; and a second processing program quantity adjustment module, used to adjust the number of second processing programs according to the number of subtasks.
[0096] According to a third aspect of an embodiment of the present invention, a computer storage medium stores program instructions on the computer storage medium, and the program instructions are used to execute any of the above-mentioned information collection methods when running.
[0097] It should be pointed out here that the above description of the information collection device embodiment and the above description of the computer storage medium embodiment are similar to the description of the aforementioned method embodiment and have similar beneficial effects as the aforementioned method embodiment, so they will not be described in detail. For the technical details that have not been disclosed in the description of the information collection device embodiment and the computer storage medium embodiment of the present invention, please refer to the description of the aforementioned method embodiment of the present invention for understanding, and in order to save space, they will not be described in detail.
[0098] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0099] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another device, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0100] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0101] In addition, all functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0102] A person skilled in the art can understand that all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: mobile storage medium, read-only memory (ROM), disk or optical disk, etc. Various media that can store program codes.
[0103] Alternatively, if the above-mentioned integrated unit of the present invention is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention can be essentially or partly reflected in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods of each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage media, ROM, magnetic disks or optical disks.
[0104] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A method for collecting information, the method comprising: include: A plurality of first processing programs receive the task request in a peer-to-peer manner, obtain a device list and split the task request into a plurality of subtasks, and send the subtasks to a highly available message queue middleware MQ; After receiving the subtask, the message queue middleware notifies a plurality of second processing programs to extract the subtask for processing; The plurality of second processing programs obtain the subtasks from the message queue middleware in an equal manner and process the corresponding subtasks; After splitting the task request into a plurality of subtasks, the method further includes: Get the number of subtasks; The number of the second processing programs is adjusted according to the number of the subtasks.
2. According to the method of claim 1, the task request includes an information collection task, and accordingly, the processing of the corresponding subtask includes collecting information of the corresponding device.
3. The method according to claim 2, before collecting the information of the corresponding device, the method further include: Customize the information to be collected.
4. The method according to claim 2, after collecting the information of the corresponding device, the method further include: The collected information is stored in an information storage system shared with other applications.
5. The method according to claim 2, after collecting the information of the corresponding device, the method further include: Based on the information collected by the information collection task and combined with other device management information, it is determined whether there is a device with abnormal resource usage. If so, a resource tuning task is generated for the corresponding device and the resource tuning task is sent to the multiple first processing programs. The method according to claim 5 , wherein the task request further comprises a resource tuning task.
7. The method according to claim 1, wherein obtaining a device list comprises: include: Obtaining a device list from a configuration management database CMDB, wherein the configuration management database also stores other device management information corresponding to the devices; Accordingly, after the corresponding subtask is processed, the method further includes: According to the processing result of the subtask, the device list and / or other device management information of the configuration management database is updated.
8. According to the method of claim 1, the message queue middleware has multiple instances, and accordingly, the subtask is sent to the highly available message queue middleware, include: The subtask is sent to an instance of a highly available message queue middleware that is located adjacent to a device corresponding to the subtask.
9. An information collection device, the device include: A task request receiving module, used for receiving task requests in a peer-to-peer manner; Device list acquisition module, used to obtain device list; A subtask splitting module, used for splitting the task request into multiple subtasks; A subtask sending module, used for sending the subtask to a highly available message queue middleware MQ; A subtask scheduling module, used for notifying a plurality of second processing programs to extract the subtask for processing after receiving the subtask; A subtask processing module, used to obtain the subtask from the message queue middleware in a peer-to-peer manner and process the corresponding subtask; A subtask quantity acquisition module is used to obtain the number of subtasks; The second processing program quantity adjustment module is used to adjust the number of the second processing programs according to the number of the subtasks.
