Task synchronization method, device and computer equipment

By comparing the task information issued by users with the task information on network devices, using task overview information or task verification codes, the problem of inconsistent task information in the cloud computing environment is solved, and efficient task synchronization and management is achieved.

CN113395307BActive Publication Date: 2025-03-18HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010175109.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-03-13
Publication Date
2025-03-18
Estimated Expiration
2040-03-13

AI Technical Summary

Technical Problem

在云计算环境中,被管理的机器与用户下发的任务信息不一致,导致云服务提供商难以有效管理和监控这些机器。 传统技术依赖被动发现,时效性较低。

Method used

Provide a method of task synchronization, by obtaining the task information issued by the user and the task information on the network device, and comparing the two, actively discovering inconsistent situations. This method uses task overview information or network device-level task verification code to quickly determine task consistency and save interactive processes and bandwidth.

Benefits of technology

It realizes timely and proactively discovers the inconsistency between the managed machines and the task information sent by users, improves timeliness and facilitates effective management and monitoring by cloud service providers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113395307B_ABST
    Figure CN113395307B_ABST
Patent Text Reader

Abstract

The present application provides a method for task synchronization, including: obtaining at least one task information issued by a user, the task information indicating that a network device reports monitoring data, the monitoring data being used to manage and monitor the network device; obtaining at least one task information on the network device; comparing the at least one task information issued by the user with the at least one task information on the network device, and determining whether at least one task running on the network device is consistent with the at least one task issued by the user. The present application can proactively discover the inconsistency between the task information issued by the managed machine and the user in a timely manner, and facilitates the management and monitoring of the managed machine.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of network communication, and more specifically, to a method, an apparatus and a computer device for task synchronization. Background Art

[0002] With the development of cloud computing, cloud computing service providers need to monitor and manage managed machines. The managed machines may be network devices connected to computer devices, for example. Specifically, users may send tasks to network devices, and the network devices report monitoring data by executing the tasks.

[0003] In some abnormal situations, the tasks executed on the managed machines may be inconsistent with the task information issued by the users, which is not conducive to the management and monitoring of the managed machines by the cloud service provider. In traditional technical solutions, when the managed machines and the task information issued by the users are inconsistent, they mainly rely on passive discovery, which has low timeliness. Summary of the invention

[0004] The embodiments of the present application provide a method, apparatus, and computer device for task synchronization, which can promptly and proactively discover inconsistencies between task information issued by a managed machine and a user, thereby facilitating management and monitoring of the managed machine.

[0005] In a first aspect, a method for task synchronization is provided, comprising: obtaining at least one task information issued by a user, wherein the task information indicates that a network device reports monitoring data, and the monitoring data is used to manage and monitor the network device; obtaining at least one task information on the network device; comparing at least one task information issued by the user with at least one task information on the network device, and determining whether at least one task running on the network device is consistent with at least one task issued by the user.

[0006] In the above technical solution, the inconsistency between the managed machine (for example, network equipment) and the task information issued by the user can be discovered in a timely and proactive manner, which has high timeliness and facilitates the cloud service provider to manage and monitor the managed machines.

[0007] In a possible implementation manner, the at least one task information includes overview information of the at least one task, and the overview information of the at least one task includes an identification ID of the at least one task and version information of the at least one task.

[0008] In the above technical solution, by comparing the overview information of the tasks issued by the user and the overview information of the tasks in the network device, it is possible to promptly and proactively discover whether the task information of the managed machine (for example, network equipment) is consistent with that issued by the user, without having to obtain and compare the details of each task, thereby saving the interaction process between the network device and the bandwidth occupancy.

[0009] In another possible implementation, the at least one task information includes task information at a network device level, and the task information at the network device level is a verification code determined according to an ID of the at least one task and version information of the at least one task.

[0010] In the above technical solution, a network device-level verification code can be determined through the task overview information. As long as the network device-level task verification code reported by the managed machine (for example, network device) is consistent with the task verification code issued by the user, it can be determined whether the task information issued by the managed machine and the user are consistent, thereby saving the interaction process between the network device and the bandwidth occupancy.

[0011] In another possible implementation manner, the version information of the at least one task includes parameter information and plug-in package information of the at least one task.

[0012] In another possible implementation, the method further includes:

[0013] If the overview information of at least one task issued by the user is inconsistent with the overview information of at least one task on the network device, determining whether the number of tasks issued by the user and the number of tasks running on the network device are the same according to the ID of the task in the overview information;

[0014] If the number of tasks issued by the user is different from the number of tasks running on the network device, adding or deleting the tasks running on the network device; or

[0015] If the number of tasks issued by the user is the same as the number of tasks running on the network device, determine whether at least one task issued by the user is the same as at least one task running on the network device according to version information of at least one task in the overview information.

[0016] In the above technical solution, the inconsistency between the task information issued by the managed machine and the user can be discovered in a timely and proactive manner, and timely repairs can be made when inconsistencies occur, ensuring that the task information issued by the managed machine and the user is consistent, thereby facilitating the cloud service provider to manage and monitor the managed machines.

[0017] In another possible implementation, if the parameter information of the at least one task sent by the user is different from the parameter information of the at least one task on the network device, modify the parameter information of the at least one task on the network device; or

[0018] If the information of the plug-in package of at least one task sent by the user is different from the information of the plug-in package of at least one task running on the network device, the plug-in package of at least one task running on the network device is updated.

[0019] In another possible implementation manner, at least one task information on the network device reported by the network device is received through a heartbeat message.

[0020] In the above technical solution, the network device can report the task information through the heartbeat message, so that the existing heartbeat mechanism can be used to simplify the processing flow.

[0021] In a second aspect, a task synchronization device is provided, comprising:

[0022] An acquisition module is used to acquire at least one task information issued by a user, wherein the task information indicates that the network device reports monitoring data, and the monitoring data is used to manage and monitor the network device.

[0023] The acquisition module is further used to acquire at least one task information on the network device;

[0024] The determination module is used to compare at least one task information sent by the user with at least one task information on the network device to determine whether at least one task running on the network device is consistent with the at least one task sent by the user.

[0025] In a possible implementation manner, the at least one task information includes overview information of the at least one task, and the overview information of the at least one task includes an identification ID of the at least one task and version information of the at least one task.

[0026] In another possible implementation, the at least one task information includes task information at a network device level, and the task information at the network device level is a verification code determined according to an ID of the at least one task and version information of the at least one task.

[0027] In another possible implementation manner, the version information of the at least one task includes parameter information and plug-in package information of the at least one task.

[0028] In another possible implementation manner, the determining module is further configured to:

[0029] If the overview information of at least one task issued by the user is inconsistent with the overview information of at least one task on the network device, determining whether the number of tasks issued by the user and the number of tasks running on the network device are the same according to the ID of the task in the overview information;

[0030] If the number of tasks issued by the user is different from the number of tasks running on the network device, adding or deleting the tasks running on the network device; or

[0031] If the number of tasks issued by the user is the same as the number of tasks running on the network device, determine whether at least one task issued by the user is the same as at least one task running on the network device according to version information of at least one task in the overview information.

[0032] In another possible implementation manner, the determining module is specifically configured to:

[0033] If the parameter information of the at least one task sent by the user is different from the parameter information of the at least one task on the network device, modify the parameter information of the at least one task on the network device; or

[0034] If the information of the plug-in package of at least one task sent by the user is different from the information of the plug-in package of at least one task running on the network device, the plug-in package of at least one task running on the network device is updated.

[0035] The beneficial effects of the second aspect and any possible implementation of the second aspect correspond to the beneficial effects of the first aspect and any possible implementation of the first aspect, and will not be elaborated on herein.

[0036] In a third aspect, a computer device is provided, comprising: at least one processor and a memory, wherein the memory is used to store a computer program, and the at least one processor is used to call and run the computer program from the memory, so as to execute the method provided by the first aspect or any possible implementation of the first aspect.

[0037] Optionally, in a specific implementation, the number of the processors is not limited. The processor is a general-purpose processor, and optionally, the general-purpose processor can be implemented by hardware or by software. When implemented by hardware, the processor is a logic circuit, an integrated circuit, etc.; when implemented by software, the processor is a general-purpose processor, which is implemented by reading software code stored in a memory, and the memory is integrated in the processor, located outside the processor, and exists independently.

[0038] In a fourth aspect, a computer program product is provided, comprising: a computer program code, which, when executed on a computer, enables the computer to execute the method in the first aspect or any possible implementation of the first aspect.

[0039] In a fifth aspect, a computer-readable storage medium is provided, the computer-readable storage medium storing a computer program code, and when the computer program code is executed on a computer, the computer executes the method in the first aspect or any possible implementation of the first aspect. These computer-readable storages include, but are not limited to, one or more of the following: read-only memory (ROM), programmable ROM (PROM), erasable PROM (EPROM), Flash memory, electrically EPROM (EEPROM), and hard drive.

[0040] In a sixth aspect, a chip is provided, comprising a processor and a data interface, wherein the processor reads instructions stored in a memory through the data interface to execute the method in the first aspect or any possible implementation of the first aspect.

[0041] In the specific implementation process, the chip can be implemented in the form of a central processing unit (CPU), a micro controller unit (MCU), a micro processing unit (MPU), a digital signal processor (DSP), a system on chip (SoC), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or a programmable logic device (PLD).

[0042] Optionally, in a specific implementation, the number of the processors is not limited. The processor is a general-purpose processor, and optionally, the general-purpose processor can be implemented by hardware or by software. When implemented by hardware, the processor is a logic circuit, an integrated circuit, etc.; when implemented by software, the processor is a general-purpose processor, which is implemented by reading software code stored in a memory, and the memory is integrated in the processor, located outside the processor, and exists independently. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 It is a schematic diagram of the architecture of a computer device 100 provided in an embodiment of the present application.

[0044] Figure 2 It is a schematic diagram of a system architecture 200 provided in an embodiment of the present application and applicable to an embodiment of the present application.

[0045] Figure 3 It is a schematic flowchart of a task synchronization method provided in an embodiment of the present application.

[0046] Figure 4 It is a schematic flowchart of another task synchronization method provided in an embodiment of the present application.

[0047] Figure 5 It is a schematic block diagram of a task synchronization device 500 provided in an embodiment of the present application. DETAILED DESCRIPTION

[0048] The technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0049] The method for task synchronization provided in the embodiment of the present application can be applied to computer equipment, which can also be referred to as a computer system, including a hardware layer, an operating system layer running on the hardware layer, and an application layer running on the operating system layer. The hardware layer includes hardware such as a processing unit, a memory and a memory control unit, and the function and structure of the hardware are described in detail later. The operating system is any one or more computer operating systems that implement business processing through a process, such as a Linux operating system, a Unix operating system, an Android operating system, an iOS operating system or a Windows operating system. The application layer includes applications such as a browser, an address book, a word processing software, and an instant messaging software. Moreover, in the embodiment of the present application, optionally, the computer system is a handheld device such as a smart phone, or a terminal device such as a personal computer, and the present application is not particularly limited, as long as the method provided in the embodiment of the present application can be used to realize the situation that the task running on the host is inconsistent with the task issued by the user to quickly discover and repair it. The execution subject of the method for task synchronization provided in the embodiment of the present application can be a computer system, or a functional module in a computer system that can call a program and execute a program.

[0050] Figure 1 It is a schematic diagram of the architecture of a computer device 100 provided in an embodiment of the present application. Figure 1 The computer device 100 shown includes at least one processor 110 and a memory 120 .

[0051] Optionally, the computer device 100 further includes a system bus, wherein the processor 110 and the memory 120 are respectively connected to the system bus. The processor 110 can access the memory 120 through the system bus. For example, the processor 110 can read and write data or execute code in the memory 120 through the system bus. The system bus is a peripheral component interconnect express (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The system bus is divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 1 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0052] The function of the processor 110 is mainly to interpret the instructions (or codes) of the computer program and process the data in the computer software. The instructions of the computer program and the data in the computer software can be stored in the memory 120 or the cache 116.

[0053] In the embodiment of the present application, the processor 110 may be an integrated circuit chip with signal processing capabilities. As an example and not a limitation, the processor 110 is a general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component. Among them, the general-purpose processor is a microprocessor, etc. For example, the processor 110 is a central processing unit (CPU).

[0054] Each processor 110 includes at least one processing unit 112 and a memory control unit 114 .

[0055] Optionally, the processing unit 112 is also called a core or kernel, which is the most important component of the processor. The processing unit 112 is manufactured from single crystal silicon using a certain production process, and all calculations, command acceptance, command storage, and data processing of the processor are performed by the core. The processing units run program instructions independently and use the ability of parallel computing to speed up the running speed of the program. Various processing units have a fixed logical structure. For example, the processing unit includes logical units such as a first-level cache, a second-level cache, an execution unit, an instruction-level unit, and a bus interface.

[0056] The memory control unit 114 is used to control the data interaction between the memory 120 and the processing unit 112. Specifically, the memory control unit 114 receives a memory access request from the processing unit 112, and controls the access to the memory based on the memory access request. As an example but not a limitation, in the embodiment of the present application, the memory control unit is a device such as a memory management unit (MMU).

[0057] In the embodiment of the present application, each memory control unit 114 addresses the memory 120 through the system bus. An arbiter (not shown) is configured in the system bus, and the arbiter is responsible for processing and coordinating the contention access of multiple processing units 112 .

[0058] In the embodiment of the present application, the processing unit 112 and the memory control unit 114 are connected to each other through connection lines inside the chip, such as address lines, so as to achieve communication between the processing unit 112 and the memory control unit 114.

[0059] Optionally, each processor 110 further includes a cache 116, wherein the cache is a buffer for data exchange (called cache). When the processing unit 112 wants to read data, it will first search for the required data from the cache. If it is found, it will be executed directly. If it is not found, it will be searched from the memory. Since the operation speed of the cache is much faster than that of the memory, the role of the cache is to help the processing unit 112 run faster.

[0060] The memory 120 can provide a running space for the processes in the computer device 100. For example, the computer program (specifically, the program code) used to generate the process is stored in the memory 120. After the computer program is run by the processor to generate the process, the processor allocates a corresponding storage space for the process in the memory 120. Furthermore, the above storage space further includes a text segment, an initialized data segment, a bit initialized data segment, a stack segment, a heap segment, etc. The memory 120 stores the data generated during the running of the process in the storage space corresponding to the above process, such as intermediate data, process data, etc.

[0061] Optionally, the memory is also called internal memory, which is used to temporarily store the calculation data in the processor 110 and the data exchanged with the external memory such as the hard disk. As long as the computer is running, the processor 110 will transfer the data to be calculated to the memory for calculation, and when the calculation is completed, the processing unit 112 will transmit the result.

[0062] As an example and not a limitation, in the embodiment of the present application, the memory 120 is a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory is a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory is a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM (DR RAM). It should be noted that the memory 120 of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0063] It should be understood that the structure of the computer device 100 listed above is only an example, and the present application is not limited thereto. The computer device 100 of the embodiment of the present application includes various hardware in the computer system in the prior art. For example, the computer device 100 also includes other storage devices besides the memory 120, such as disk storage devices, etc.

[0064] With the development of cloud computing, cloud computing service providers need to monitor and manage managed machines. The managed machine may be, for example, a host connected to the computer device 100. Specifically, the computer device 100 may obtain some data information of the host and monitor and manage the machine based on the data information. The data information may include, but is not limited to: basic indicators of the host and service indicators deployed on the host. Basic indicators may be, for example, processor overhead, memory overhead, disk information, etc., and service indicators may be, for example, the number of processes, etc.

[0065] It should be understood that the host may be a physical machine or a virtual machine, and this application does not make any specific limitation.

[0066] The embodiments of the present application are applicable to a variety of scenarios. In one possible implementation, the embodiments are applicable to scenarios with a large number of managed machines. In another possible implementation, the embodiments are applicable to scenarios with a complex environment and prone to abnormalities, such as the Internet of Things (IOT).

[0067] Combine the following Figure 2 , a system architecture 200 applicable to an embodiment of the present application is described.

[0068] like Figure 2 As shown, the system architecture 200 includes a management unit (manager) 210, at least one computer device 100, at least one host (host) 220 and a third-party monitoring platform 230.

[0069] The management unit 210 is connected to at least one computer device 100 and is used to send task information issued by a user to the computer device 100. The task information is used to instruct at least one host 220 to report monitoring data.

[0070] Computer device 100: Each computer device 100 may be connected to at least one host 220, and specifically, the computer device 100 may be connected to an agent installed on the host 220. The computer device 100 is used to obtain monitoring data on at least one host 220 and report the monitoring data to the third-party monitoring platform 230.

[0071] Host 220: The agent running on each host 220 is responsible for obtaining the monitoring data on the host 220 according to the task information issued by the computer device 100, and reporting it to the computer device 100. Specifically, the agent can download the plug-in package according to the task information, and execute the plug-in package to report the obtained monitoring data to the computer device 100.

[0072] It should be understood that the management unit 210 is generally deployed globally. For example, the management unit 210 is a functional module in a computer device, which is used to send the task information issued by the user to the computer device 100. At least one computer device 100 and the agent on the host 220 are generally deployed at the region level. In other words, the computer device including the management unit 210 and the computer device 100 may not be the same device.

[0073] The third-party monitoring platform 230 is connected to at least one computer device 100, and is used to receive the monitoring data uniformly reported by at least one computer device 100, and process the monitoring data. Specifically, as an example, the monitoring data can be processed in a manner that is a combination of any one or more of the following: monitoring data caching, monitoring data persistence, and streaming processing of monitoring data (for example, alarm rule processing).

[0074] Optionally, in some embodiments, Figure 2 The system architecture 200 shown may also include a configuration center 240 and a repository 250 .

[0075] The configuration center 240 is used to record the address information of the computer device 100 in the region, so as to enable the agent on the host 220 to automatically discover the address information of the computer device 100 when it is installed for the first time.

[0076] Warehouse 250 is a warehouse for storing plug-ins, and is used by the agent on the host 220 to download plug-in packages.

[0077] In some abnormal situations, the task executed on the managed machine (e.g., host 220) may be inconsistent with the task information issued by the computer device 100. For example, the task information saved by the agent on the host 220 may be deleted by mistake, or the agent on the host 220 may read abnormally due to disk damage. The inconsistent task information is not conducive to the management and monitoring of the managed machine (e.g., host 220) by the cloud service provider.

[0078] In the traditional technical solution, when there is inconsistency between the task information issued by the managed machine and the computer device 100, it mainly relies on passive discovery, which has low timeliness.

[0079] The technical solution provided by the embodiment of the present application can timely and proactively discover the inconsistency between the task information issued by the managed machine (for example, the host 220) and the computer device 100, and promptly repair it when the inconsistency occurs, thereby ensuring that the task information issued by the managed machine and the computer device 100 is consistent, thereby facilitating the cloud service provider to manage and monitor the managed machines.

[0080] Combine the following Figure 3 , a task synchronization method provided in an embodiment of the present application is described in detail.

[0081] Figure 3 FIG. 1 is a schematic flow chart of a task synchronization method provided in an embodiment of the present application. Figure 3As shown, the method includes steps 310-330, and steps 310-330 are described in detail below.

[0082] Step 310: The computer device 100 obtains the task information issued by the user.

[0083] Specifically, the user may send the task information to the management unit 210 , and the management unit 210 sends the task information to the computer device 100 .

[0084] Optionally, in some embodiments, in order to improve the interaction efficiency between the management unit 210 and the computer device 100, the computer device 100 may first store the task information sent by the user in a memory, so that the computer device 100 can obtain the task information from the memory.

[0085] Specifically, as an example, the memory may be Redis, which is used as an intermediate cache to store the task information issued by the user. The computer device 100 may obtain the task information issued by the user from Redis.

[0086] It should be understood that for the sake of ease of description, Redis is used as an example in the embodiments of the present application.

[0087] Step 320: The computer device 100 obtains task information running on the host.

[0088] In the embodiment of the present application, the computer device 100 can obtain the task information running on the host through the agent installed on the host. There are many specific implementation methods. In one possible implementation method, the agent on the host can actively report the task information running on the host to the computer device 100. In another possible implementation method, the computer device 100 can also send a task information request message to the agent, and the agent on the host can report the task information running on the host to the computer device 100 according to the task information request message.

[0089] Optionally, in some embodiments, when facing millions of hosts, if the agent improperly handles the way of establishing a connection or sending data during network jitter or upgrade, it is easy to cause a distributed denial of service attack (DDoS). To this end, the embodiment of the present application optimizes the connection method between the agent and the computer device 100, and reduces the pressure on the network and the server (computer device 100) through random selection.

[0090] In a possible implementation, the agent randomly selects a computer device 100 when establishing a connection with the computer device 100. If the connection fails, the agent selects the next computer device in sequence to ensure load balancing of the server (computer device 100).

[0091] In another possible implementation, when the agent successfully establishes a connection with the computer device 100 for the last time, if the connection is disconnected, a computer device 100 will be randomly selected for connection to prevent excessive pressure on a certain computer device 100 due to the upgrade.

[0092] In another possible implementation, the time for starting task verification is dispersed within the heartbeat cycle to balance the load of the agent on the computer device 100 within the heartbeat cycle.

[0093] In another possible implementation, when the agent fails to establish a connection with the computer device 100 for multiple consecutive times, the address information of the current computer device 100 is obtained again through the configuration center 240 to achieve self-healing of the fault.

[0094] Step 330: The computer device 100 compares the task information sent by the user with the task information running on the host to determine whether the task running on the host is consistent with the task sent by the user.

[0095] There are many implementation methods for the computer device 100 to determine whether the task running on the host is consistent with the task issued by the user through the task information issued by the user and the task information running on the host, which is not specifically limited in this application. Different implementation methods will be described in detail below and will not be repeated here.

[0096] In the above technical solution, the inconsistency between the task information issued by the managed machine (e.g., host) and the computer device 100 can be discovered in a timely and proactive manner, which has high timeliness and facilitates the cloud service provider to manage and monitor the managed machine (e.g., host).

[0097] In step 330, in a possible implementation, the computer device 100 can determine whether the task information issued by the user is consistent with the task information running on the host according to the overview information of the task. The overview information of the task includes the identification (ID) of the task and the version information of the task, wherein the version information of the task mainly includes the version of the task and the version of the plug-in package.

[0098] Specifically, the computer device 100 can obtain the overview information of the tasks issued by the user and the overview information of the tasks running on the host stored in Redis, and determine whether the task information issued by the user and the task information running on the host are consistent by comparing the task overview information.

[0099] If the computer device 100 determines that the overview information of the task sent by the user is the same as the overview information of the task running on the host, it can be determined that the task information sent by the user is consistent with the task information running on the host, and the task processing flow is no longer needed.

[0100] If the computer device 100 determines that the overview information of the task sent by the user is different from the overview information of the task running on the host, it is determined that the task information sent by the user is different from the task information running on the host. It can be understood that the task information sent by the user is different from the task information running on the host, and the task processing flow needs to be performed. For the specific task processing flow, please refer to the description below, which will not be described in detail here.

[0101] In step 330, in another possible implementation, host-level task information (e.g., host verification code) can also be determined based on the task overview information (e.g., task ID and task version information), and the computer device 100 can determine whether the task information sent by the user is consistent with the task information running on the host based on the host-level task information (e.g., host verification code).

[0102] Specifically, the computer device 100 can obtain the host-level task information stored in Redis and the host-level task information on the host, and determine whether the task information issued by the user is consistent with the task information running on the host by comparing the host-level task information.

[0103] If the computer device 100 determines that the host-level task information stored in Redis is the same as the host-level task information on the host, it can be determined that the task information issued by the user is consistent with the task information running on the host, and there is no need to perform the task processing flow.

[0104] If the computer device 100 determines that the host-level task information stored in Redis is different from the host-level task information on the host, it is determined that the task information sent by the user is different from the task information running on the host. It can be understood that the task information sent by the user is different from the task information running on the host, and the task processing flow needs to be performed.

[0105] In the above technical solution, the computer device 100 can timely and proactively discover whether the task information issued by the managed machine (for example, the host) and the computer device 100 is consistent by comparing the overview information of the tasks stored in Redis and the overview information of the tasks reported by the agent in the host, or comparing the task verification information of the host stored in Redis and the task verification information of the host reported by the agent in the host, thereby reducing the interaction process between the computer device 100 and the agent and the bandwidth occupancy.

[0106] Optionally, in some embodiments, when the computer device 100 determines whether the task information issued by the user is consistent with the task information running on the host through the above method, it can further obtain detailed information of the task and detailed information of the plug-in package, wherein the detailed information of the task includes relevant parameters of the task, such as the time interval for monitoring data collection, the disk information where the monitoring data is located, etc. The detailed information of the plug-in package includes the verification code and version number of the plug-in package, etc. The computer device 100 determines the processing flow of the task by comparing the detailed information of the task and the detailed information of the plug-in package stored in Redis with the detailed information of the task and the detailed information of the plug-in package reported by the agent in the host.

[0107] Specifically, if the detailed information of the task stored in Redis is different from the detailed information of the task reported by the agent in the host, it can be understood that the task information issued by the user is different from the task information running on the host, and the task processing flow needs to be performed. Alternatively, if the detailed information of the plug-in package stored in Redis is different from the detailed information of the plug-in package reported by the agent in the host, it can also be understood that the task information issued by the user is different from the task information running on the host, and the task processing flow needs to be performed.

[0108] In the above technical solution, whether the task information issued by the managed machine (eg, host) and the computer device 100 is consistent can be determined through the detailed information of the task, thereby improving the accuracy of the detection.

[0109] It should be understood that in order to implement the above technical solution, in the embodiment of the present application, the task information can also be saved as a three-layer data structure, wherein the first layer of data includes host-level task information, for example, the host's check code, which is related to the number of tasks running on the host and the detailed information of the task. The second layer of data includes overview information of each task, and the overview information of the task includes the task ID and the version information of the task. The third layer of data includes detailed information of the task and detailed information of the plug-in package.

[0110] Specifically, after receiving the task information sent by the user, the management unit 210 can save the task information as the type of the above-mentioned three-layer data structure and store it in Redis.

[0111] In conjunction with Tables 1 to 4, a possible three-layer data structure of task information is exemplified below.

[0112] Table 1

[0113]

[0114] Among them, Table 1 is the first layer of data, "checksum" represents the checksum of a host, and "region code" represents the region where the host is located.

[0115] Table 2

[0116]

[0117] Table 2 is the second layer of data, including overview information of each task running on a host in Table 1. "fe134eb2-9a91-41f8..." indicates the ID of a task, and "{"fileUpdate":1575767922699,"taskUpdate":0}" indicates the version information of a task, where "fileUpdate" indicates the version of the plugin package of a task, and "taskUpdate" indicates the version of a task.

[0118] Table 3

[0119]

[0120] Table 3 is the third layer of data, including detailed information of a task corresponding to a task ID in Table 2. "args" indicates the disk parameters in the detailed information of the task, and "step" indicates the collection interval of the monitoring data in the detailed information of the task.

[0121] Table 4

[0122]

[0123] Table 4 is the third layer of data, including detailed information of the plug-in package corresponding to the ID of a task in Table 2. "Checksum" indicates the checksum of a plug-in package version, and "version" indicates the version number of the plug-in package.

[0124] After actively discovering the inconsistency between the task information issued by the managed machine (e.g., host) and the computer device 100 through the above-mentioned method, the embodiment of the present application can also promptly perform repairs to make the task information issued by the managed machine (e.g., host) and the computer device 100 consistent, thereby facilitating the cloud service provider to manage and monitor the managed machine (e.g., host).

[0125] The specific implementation of the above repair process is described in detail below.

[0126] In a possible implementation, the computer device 100 compares the overview information of the tasks issued by the user stored in Redis with the overview information of the tasks running on the host.

[0127] As an example, the computer device 100 compares the task IDs sent by the user and the IDs of the tasks running on the host stored in Redis. If the number of tasks sent by the user is inconsistent with the number of tasks running on the host, it is necessary to add or delete tasks. Specifically, if the number of tasks sent by the user in Redis is greater than the number of tasks running on the host, it can be understood that some tasks are lost on the host. At this time, the computer device 100 needs to obtain the task information that is not running on the host from Redis and send the task information to the agent on the host. If the number of tasks sent by the user in Redis is less than the number of tasks running on the host, it can be understood that some of the tasks executed on the host have not been deleted. At this time, the computer device 100 can send an instruction to delete the task information to the agent on the host, so that the agent can delete some tasks on the host, so that the task information sent by the managed machine (for example, the host) and the computer device 100 are consistent.

[0128] As another example, the computer device 100 compares the version information of the task issued by the user and the version information of the task running on the host stored in Redis. If the version information of the task issued by the user and the version information of the task running on the host are inconsistent, the task needs to be modified.

[0129] Specifically, the version information of the task mainly includes the version of the task and the version of the plug-in package. If the versions of the task are inconsistent, the detailed information of the task needs to be modified. If the versions of the plug-in package are inconsistent, the plug-in package needs to be updated.

[0130] For example, if the detailed information of a task needs to be modified, the computer device 100 can obtain the detailed information of the task stored in Redis, and send the detailed information of the task to the agent on the host, so that the agent can modify the task running on the host.

[0131] For another example, if a plug-in package needs to be updated, the computer device 100 can query the latest plug-in package through the third-party interface to obtain download information, and send the download information to the agent on the host, and the agent obtains the latest plug-in package from the warehouse 250 according to the download information to update the plug-in package.

[0132] It should be understood that the download information includes the downloaded uniform resource locator (URL), authentication token, etc.

[0133] Optionally, in some embodiments, after acquiring the above download information, the computer device 100 may cache the download information for direct use next time.

[0134] Combine the following Figure 4 , a specific implementation of the method provided in the embodiment of the present application is described in detail. It should be noted that the following examples are only intended to help those skilled in the art understand the embodiments of the present application, and are not intended to limit the application embodiments to the specific numerical values ​​or specific scenarios illustrated. Those skilled in the art can obviously make various equivalent modifications or changes based on the examples given in the text, and such modifications and changes also fall within the scope of the embodiments of the present application.

[0135] Figure 4 FIG. 1 is a schematic flow chart of another task synchronization method provided by an embodiment of the present application. Figure 4 As shown, the method includes steps 410-495, and steps 410-495 are described in detail below.

[0136] Step 410: The management unit 210 receives task information sent by the user.

[0137] Step 415: The management unit 210 saves the task information sent by the user into a three-layer data structure and stores it in Redis.

[0138] Specifically, the management unit 210 may save the task information sent by the user as the three-layer data structure described above, and update the data structure in Redis, so as to save the task information sent by the user in Redis.

[0139] Step 420: The agent on the host calculates the host's verification code based on the saved task information.

[0140] In the embodiment of the present application, the agent on the host can calculate the verification code of the host according to a preset rule.

[0141] Step 425 : the agent reports the host's verification code to the computer device 100 .

[0142] There are many specific implementations. In one possible implementation, the agent on the host can actively report the host's verification code to the computer device 100. As an example, the agent can report the host's verification code to the computer device 100 through a heartbeat message, which can use the existing heartbeat mechanism to simplify the processing flow. In another possible implementation, the computer device 100 can also send a request message to the agent, and the agent on the host can report the host's verification code to the computer device 100 according to the request message.

[0143] Step 430: The computer device 100 obtains the verification code of the host stored in Redis.

[0144] Step 435: The computer device 100 compares the host verification code reported by the agent with the host verification code obtained from Redis to determine whether the task processing process needs to be performed.

[0145] If the computer device 100 determines that the verification code of the host reported by the agent and the verification code of the host obtained from Redis are consistent, no relevant processing of the task is performed.

[0146] If the computer device 100 determines that the host verification code reported by the agent and the host verification code obtained from Redis are inconsistent, steps 440-450 are executed.

[0147] Step 440: The computer device 100 sends a task overview information request message to the agent.

[0148] Step 445 : the agent reports the overview information of the task to the computer device 100 .

[0149] Step 450: The computer device 100 obtains overview information of the tasks stored in Redis.

[0150] Step 455: the computer device 100 compares the task overview information reported by the agent with the task overview information obtained from Redis to determine whether task-related processing is required.

[0151] Specifically, if the number of tasks reported by the agent is greater than the number of tasks obtained from Redis, the computer device 100 executes step 460. If the number of tasks reported by the agent is less than the number of tasks obtained from Redis, the computer device 100 executes step 465. If the version of the task reported by the agent is inconsistent with the version of the task running on the host, the computer device 100 executes step 470. If the version of the plug-in package reported by the agent is inconsistent with the version of the plug-in package running on the host, the computer device 100 executes step 475.

[0152] Step 460: the computer device 100 sends instruction information of the newly added task to the agent, and the instruction information includes detailed information of the newly added task.

[0153] Step 465: the computer device 100 sends an instruction message for deleting the task to the agent, where the instruction message includes overview information of the task to be deleted.

[0154] Step 470: The computer device 100 sends detailed information of a task to the agent.

[0155] Specifically, the computer device 100 may first obtain detailed information of a task from Redis, and send the detailed information of the task to the agent, so that the agent can modify the task so that the task running on the agent is consistent with the task stored in Redis.

[0156] Step 475 : the computer device 100 obtains the plug-in information through the management unit 210 .

[0157] Optionally, in some embodiments, after the computer device 100 obtains the plug-in information, the plug-in information may also be saved in Redis. Specifically, the plug-in information in Redis may be updated.

[0158] Step 480: The computer device 100 sends the plug-in information to the agent.

[0159] Step 485: the agent obtains the latest plug-in package from the warehouse 250 according to the plug-in information.

[0160] Step 490: The computer device 100 obtains updated status information of the task on the agent.

[0161] Step 495: The computer device 100 updates the update status information of the task in Redis.

[0162] The computer device 100 can update the update status information of the task in Redis according to the update status information of the task on the agent, so that the management unit 210 can determine whether the task on the host has been updated according to the status information of the task in Redis.

[0163] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0164] The following will be combined Figure 5 , describes in detail the embodiment of the device of the present application. It should be understood that the description of the method embodiment corresponds to the description of the device embodiment, so the parts not described in detail can refer to the previous method embodiment.

[0165] Figure 5 1 is a schematic block diagram of a task synchronization device 500 provided in an embodiment of the present application. The task synchronization device 500 can be implemented as part or all of the device through software, hardware, or a combination of both. It should be understood that the task synchronization device 500 is a functional module in the computer device 100, which is used to execute the method flow executed by the above-mentioned computer device 100.

[0166] The task synchronization device 500 includes: an acquisition module 510 and a determination module 520, wherein:

[0167] The acquisition module 510 is used to acquire at least one task information issued by the user, wherein the task information indicates that the network device reports monitoring data, and the monitoring data is used to manage and monitor the network device.

[0168] The acquisition module 510 is further used to acquire at least one task information on the network device;

[0169] The determination module 520 is used to compare the at least one task information sent by the user with the at least one task information on the network device to determine whether the at least one task running on the network device is consistent with the at least one task sent by the user.

[0170] Optionally, the at least one task information includes overview information of the at least one task, and the overview information of the at least one task includes an identification ID of the at least one task and version information of the at least one task.

[0171] Optionally, the at least one task information includes task information at a network device level, and the task information at the network device level is a verification code determined according to an ID of the at least one task and version information of the at least one task.

[0172] Optionally, the version information of the at least one task includes parameter information and plug-in package information of the at least one task.

[0173] Optionally, the determining module 520 is further configured to:

[0174] If the overview information of at least one task issued by the user is inconsistent with the overview information of at least one task on the network device, determining whether the number of tasks issued by the user and the number of tasks running on the network device are the same according to the ID of the task in the overview information;

[0175] If the number of tasks issued by the user is different from the number of tasks running on the network device, adding or deleting the tasks running on the network device; or

[0176] If the number of tasks issued by the user is the same as the number of tasks running on the network device, determine whether at least one task issued by the user is the same as at least one task running on the network device according to version information of at least one task in the overview information.

[0177] Optionally, the determining module 520 is specifically configured to:

[0178] If the parameter information of the at least one task sent by the user is different from the parameter information of the at least one task on the network device, modify the parameter information of the at least one task on the network device; or

[0179] If the information of the plug-in package of at least one task sent by the user is different from the information of the plug-in package of at least one task running on the network device, the plug-in package of at least one task running on the network device is updated.

[0180] In this embodiment, a computer device is also provided, which includes at least one processor and a memory, the memory is used to store one or more instructions, and the at least one processor is used to compare at least one task information issued by the user and at least one task information on the network device to determine whether at least one task running on the network device is consistent with at least one task issued by the user.

[0181] In this embodiment, a computer-readable storage medium is also provided. The computer-readable storage medium stores instructions. When the instructions in the computer-readable storage medium are executed on a computing device, the computing device executes the method provided above.

[0182] In this embodiment, a computer program product including instructions is also provided. When the computer program product is executed on a computing device, the computing device executes the method provided above.

[0183] In this embodiment, a chip is also provided, which includes a processor and a data interface, wherein the processor reads instructions stored in the memory through the data interface to execute the method in the first aspect or any possible implementation of the first aspect.

[0184] In the specific implementation process, the chip can be implemented in the form of a central processing unit (CPU), a micro controller unit (MCU), a micro processing unit (MPU), a digital signal processor (DSP), a system on chip (SoC), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or a programmable logic device (PLD).

[0185] Optionally, in a specific implementation, the number of the processors is not limited. The processor is a general-purpose processor, and optionally, the general-purpose processor can be implemented by hardware or by software. When implemented by hardware, the processor is a logic circuit, an integrated circuit, etc.; when implemented by software, the processor is a general-purpose processor, which is implemented by reading software code stored in a memory, and the memory is integrated in the processor, located outside the processor, and exists independently.

[0186] The above embodiments are implemented in whole or in part by software, hardware, firmware or any other combination. When implemented by software, the above embodiments are implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part.

[0187] Optionally, the computer is a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions are transmitted from one website, computer, server or data center to another website, computer, server or data center by wired means (e.g., infrared, wireless, microwave, etc.).

[0188] The computer-readable storage medium is any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more available media. The available medium is a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium. The semiconductor medium is a solid-state hard disk.

[0189] It should be understood that the term "and / or" in this article is only a description of the association relationship of associated objects, indicating the existence of three relationships. For example, A and / or B means: A exists alone, A and B exist at the same time, and B exists alone, where A and B are singular or plural. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship, but it may also indicate an "and / or" relationship. Please refer to the context for specific understanding.

[0190] In this application, "at least one" means one or more, and "plurality" means two or more. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c means: a, b, c, ab, ac, bc, or abc, where a, b, c is single or multiple.

[0191] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0192] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0193] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above may refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.

[0194] In several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways.

[0195] For example, the device embodiments described above are only illustrative, for example, the division of the units is only a logical function division, and there can be other division methods in actual implementation, such as combining or integrating multiple units or components into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed is an indirect coupling or communication connection of some interfaces, devices or units, which is electrical, mechanical or other forms.

[0196] Optionally, the units described as separate components are physically separated or not physically separated, and the components displayed as units are physically separated or not physical units, that is, located in one place, or distributed on multiple network units. Some or all of the units are selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0197] In addition, each functional unit in each embodiment of the present application can be integrated into one processing unit. Optionally, each unit exists physically separately, or two or more units are integrated into one unit.

[0198] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be embodied in the form of a software product in essence or in other words, the part that contributes to the prior art or the part of the technical solution. The computer software product is stored in a storage medium, including several instructions for a computer device (a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media capable of storing program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0199] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A task synchronization method, characterized in that: The method comprises: Acquire at least one task information issued by a user, wherein the task information instructs a network device to report monitoring data, and the monitoring data is used to manage and monitor the network device; Acquire at least one task information on the network device; Compare at least one task information sent by the user with at least one task information on the network device to determine whether at least one task running on the network device is consistent with the at least one task sent by the user.

2. The method according to claim 1, characterized in that The at least one task information includes overview information of the at least one task, and the overview information of the at least one task includes an identification ID of the at least one task and version information of the at least one task.

3. The method according to claim 1, characterized in that The at least one task information includes task information at a network device level, and the task information at the network device level is a verification code determined according to the ID of the at least one task and the version information of the at least one task.

4. The method according to claim 2 or 3, characterized in that: The version information of the at least one task includes parameter information and plug-in package information of the at least one task.

5. The method according to claim 4, characterized in that The method further comprises: If the overview information of at least one task issued by the user is inconsistent with the overview information of at least one task on the network device, determining whether the number of tasks issued by the user and the number of tasks running on the network device are the same according to the ID of the task in the overview information; If the number of tasks issued by the user is different from the number of tasks running on the network device, adding or deleting the tasks running on the network device; or If the number of tasks issued by the user is the same as the number of tasks running on the network device, determine whether at least one task issued by the user is the same as at least one task running on the network device according to version information of at least one task in the overview information.

6. The method according to claim 5, characterized in that The determining, according to the version information of at least one task in the overview information, whether the at least one task issued by the user is the same as the at least one task running on the network device includes: If the parameter information of the at least one task sent by the user is different from the parameter information of the at least one task on the network device, modify the parameter information of the at least one task on the network device; or If the information of the plug-in package of at least one task sent by the user is different from the information of the plug-in package of at least one task running on the network device, the plug-in package of at least one task running on the network device is updated.

7. A task synchronization device, characterized in that: include: An acquisition module, used to acquire at least one task information issued by a user, wherein the task information indicates that a network device reports monitoring data, and the monitoring data is used to manage and monitor the network device; The acquisition module is further used to acquire at least one task information on the network device; The determination module is used to compare at least one task information sent by the user with at least one task information on the network device to determine whether at least one task running on the network device is consistent with the at least one task sent by the user.

8. The device according to claim 7, characterized in that The at least one task information includes overview information of the at least one task, and the overview information of the at least one task includes an identification ID of the at least one task and version information of the at least one task.

9. The device according to claim 7, characterized in that The at least one task information includes task information at a network device level, and the task information at the network device level is a verification code determined according to the ID of the at least one task and the version information of the at least one task.

10. The device according to claim 7 or 8, characterized in that The version information of the at least one task includes parameter information and plug-in package information of the at least one task.

11. The device according to claim 10, characterized in that The determining module is also used for: If the overview information of at least one task issued by the user is inconsistent with the overview information of at least one task on the network device, determining whether the number of tasks issued by the user and the number of tasks running on the network device are the same according to the ID of the task in the overview information; If the number of tasks issued by the user is different from the number of tasks running on the network device, adding or deleting the tasks running on the network device; or If the number of tasks issued by the user is the same as the number of tasks running on the network device, determine whether at least one task issued by the user is the same as at least one task running on the network device according to version information of at least one task in the overview information.

12. The device according to claim 11, characterized in that The determination module is specifically used for: If the parameter information of the at least one task sent by the user is different from the parameter information of the at least one task on the network device, modify the parameter information of the at least one task on the network device; or If the information of the plug-in package of at least one task sent by the user is different from the information of the plug-in package of at least one task running on the network device, the plug-in package of at least one task running on the network device is updated.

13. A computer device, characterized in that: include: A processor and a memory, the memory being used to store a program, and the processor being used to call and run the program from the memory to execute the method according to any one of claims 1 to 6.

14. A computer-readable storage medium, characterized in that: The method comprises a computer program which, when executed on a computer, causes the computer to execute the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Task monitoring method, apparatus and system

    CN108268358A

  • Monitoring system, monitoring method and computing node

    CN109787850A