Server asset data acquisition task processing method and apparatus, and electronic device

By using health weights, operation weights and execution weights in server asset data acquisition tasks to determine task priority and update task priority in task queues, the problem of impossible to accurately determine task priority in the prior art is solved, and task processing efficiency is improved.

CN119690604APending Publication Date: 2025-03-25INSPUR SUZHOU INTELLIGENT TECH CO LTD

Patent Information

Application Number
CN202411491865.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-24
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

In the prior art, it is impossible to accurately determine the priority of server asset data acquisition tasks, resulting in low task processing efficiency.

Method used

By getting the target task collection and initializing the priority of each target task based on the health weights. Add the target task set to the task queue, and update the task priority in the task queue based on priority metrics (including health weights, operation weights, and execution weights), and finally execute the task based on the updated priority.

Benefits of technology

It improves the accuracy of determining the priority of server asset data acquisition tasks, improves task processing efficiency, and solves the problem of low task processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119690604A_ABST
    Figure CN119690604A_ABST
Patent Text Reader

Abstract

The invention provides a server asset data acquisition task processing method and apparatus, and an electronic device, and belongs to the technical field of data processing, and the method comprises the steps of obtaining a target task set; the priority of each target task in the target task set is initialized according to the health weight, and the health weight is used for reflecting the health state of the server; adding the target task set into a task queue, and updating the priority of the tasks in the task queue based on a priority index, the priority index comprising a health weight; and executing the tasks in the task queue based on the priority of the tasks in the updated task queue. According to the processing method of the server asset data acquisition task provided by the invention, the technical problem that the task processing efficiency is low due to the fact that the priority of the server asset data acquisition task cannot be accurately determined in the processing method of the server asset data acquisition task in the related technology is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a method, device and electronic equipment for processing server asset data collection tasks. Background Art

[0002] With the exponential growth in the number of servers, the task of managing and maintaining large-scale server clusters has become increasingly arduous and complex. In order to ensure the stability and performance of the system, the collection of server runtime asset data is crucial to ensure system stability and performance. The collection and management of server asset data is a key component to ensure the health and performance of the Information Technology (IT) infrastructure.

[0003] In the related art, as the number of servers increases, it is impossible to accurately and reasonably determine the priority of server asset data collection tasks and other information collection tasks; especially when an abnormality or emergency occurs in the server, it is urgent to obtain real-time information of the server equipment, and give priority to collecting data from key equipment. If the priority of the task is not determined reasonably, low-priority tasks may not be executed, forming a monitoring blind spot, which reduces the efficiency of information collection and management.

[0004] It can be seen that the processing method of the server asset data collection task in the related art has a technical problem that it is unable to accurately determine the priority of the server asset data collection task, resulting in low task processing efficiency. Summary of the invention

[0005] The present invention provides a method, device and electronic device for processing server asset data collection tasks, which are used to solve the technical problem that the method for processing server asset data collection tasks in the related art cannot accurately determine the priority of the server asset data collection tasks, resulting in low task processing efficiency.

[0006] The present invention provides a method for processing server asset data collection tasks, comprising the following steps: obtaining a target task set, wherein each target task in the target task set corresponds to an asset data collection task of a server; initializing the priority of each target task in the target task set according to a health weight, wherein the health weight is used to reflect the health status of the server, the health weight increases as the health status of the server deteriorates, and the health weight is positively correlated with the priority of each target task; adding the target task set to a task queue, and updating the priority of the tasks in the task queue based on a priority index, wherein the priority index includes the health weight, an operation weight and an execution weight, the operation weight is used to reflect the urgency of the task, the operation weight increases as the urgency of the task increases, the execution weight is used to reflect the situation where the task is preempted for execution by a high-priority task, and the execution weight increases as the number of times the task is preempted for execution increases; executing the tasks in the task queue based on the updated priorities of the tasks in the task queue.

[0007] According to a method for processing server asset data acquisition tasks provided by the present invention, the task queue includes a target task set and a non-target task set, the priority index includes a first priority index and a second priority index, and the updating of the priority of the tasks in the task queue based on the priority index includes: updating the priority of each target task in the target task set based on the first priority index, wherein the first priority index includes the health weight, the operation weight and the execution weight; updating the priority of each non-target task in the non-target task set based on the second priority index, wherein the second priority index includes the operation weight and the execution weight.

[0008] According to a method for processing server asset data collection tasks provided by the present invention, the priority of tasks in the task queue is updated based on a priority index, comprising: calculating a comprehensive weight value for each task in the task queue, wherein the comprehensive weight value is obtained by multiplying each weight contained in the priority index by a preset value corresponding to each weight and then adding the results, and the sum of the preset values ​​corresponding to each weight is 1; updating the priority of each task based on the comprehensive weight value of each task, wherein the comprehensive weight value of each task is positively correlated with the priority of each task.

[0009] According to a method for processing server asset data acquisition tasks provided by the present invention, before updating the priority of the tasks in the task queue based on the priority index, the method also includes: taking each task in the task queue as the first current task and executing the following steps to obtain a current operation weight corresponding to the first current task: obtaining the refresh count of the first current task, wherein the refresh count increases by one each time an execution instruction of the first current task is received; determining the current operation weight based on the refresh count, wherein the refresh count is positively correlated with the current operation weight.

[0010] According to a method for processing server asset data collection tasks provided by the present invention, before updating the priority of the tasks in the task queue based on the priority index, the method also includes: taking each task in the task queue as the second current task and executing the following steps to obtain a current execution weight corresponding to the second current task: obtaining the number of preemption times of the second current task, wherein the number of preemption times is the number of times the second current task is preempted for execution by a high-priority task; determining the current execution weight based on the number of preemption times, wherein the number of preemption times is positively correlated with the current execution weight.

[0011] According to a method for processing server asset data collection tasks provided by the present invention, after executing the tasks in the task queue based on the updated priorities of the tasks in the task queue, the method further includes: obtaining the execution results of the tasks in the task queue in the current task execution cycle; and updating the execution weights of the tasks in the task queue in a target task execution cycle according to the execution results, wherein the target task execution cycle is the next task execution cycle of the current task execution cycle.

[0012] According to a method for processing server asset data collection tasks provided by the present invention, before executing the tasks in the task queue based on the updated priorities of the tasks in the task queue, the method further includes: upon receiving a priority adjustment instruction, adjusting the priority of the task corresponding to the priority adjustment instruction based on the priority adjustment instruction.

[0013] The present invention also provides a processing device for server asset data collection tasks, comprising the following modules: an acquisition module, used to acquire a target task set, wherein each target task in the target task set corresponds to an asset data collection task of a server; an initialization module, used to initialize the priority of each target task in the target task set according to a health weight, wherein the health weight is used to reflect the health status of the server, the health weight increases as the health status of the server deteriorates, and the health weight is positively correlated with the priority of each target task; an update module, used to add the target task set to a task queue, and update the priority of the tasks in the task queue based on a priority index, wherein the priority index includes the health weight, the operation weight and the execution weight, the operation weight is used to reflect the urgency of the task, the operation weight increases as the urgency of the task increases, the execution weight is used to reflect the situation where the task is preempted for execution by a high-priority task, and the execution weight increases as the number of times the task is preempted for execution increases; an execution module, used to execute the tasks in the task queue based on the updated priorities of the tasks in the task queue.

[0014] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, a method for processing server asset data collection tasks as described in any one of the above is implemented.

[0015] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the processing method of the server asset data collection task as described in any one of the above is implemented.

[0016] The present invention also provides a computer program product, including a computer program, and when the computer program is executed by a processor, the computer program implements any of the above-mentioned processing methods for server asset data collection tasks.

[0017] The present invention provides a method, device and electronic device for processing server asset data collection tasks, which obtain a target task set, wherein each target task in the target task set corresponds to an asset data collection task of a server; initialize the priority of each target task in the target task set according to a health weight, wherein the health weight is used to reflect the health status of the server; add the target task set to a task queue, and update the priority of the tasks in the task queue based on a priority indicator, wherein the priority indicator includes a health weight, an operation weight and an execution weight; execute the tasks in the task queue based on the priority of the tasks in the updated task queue; initialize the priority of each target task in the target task set according to the health weight, which can improve the accuracy of determining the priority of each target task in the target task set, update the priority of all tasks in the task queue according to the priority indicator, which can further improve the accuracy of the priority of each task in the task queue, and process tasks according to the updated priority, which can effectively improve the task processing efficiency, and solve the technical problem that the method for processing server asset data collection tasks in the related art cannot accurately determine the priority of the server asset data collection task, resulting in low task processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced one by one below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0019] Figure 1 It is a flow chart of the method for processing server asset data collection tasks provided by the present invention.

[0020] Figure 2 It is a structural diagram of the task processing system provided by the present invention.

[0021] Figure 3 It is a schematic diagram of the interaction between the queue priority management module and the collection execution module provided by the present invention.

[0022] Figure 4 It is a structural diagram of the acquisition execution module provided by the present invention.

[0023] Figure 5 It is a structural diagram of the visual management module provided by the present invention.

[0024] Figure 6 It is a structural schematic diagram of a processing device for server asset data collection tasks provided by the present invention.

[0025] Figure 7 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0026] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are 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 ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0027] It should be noted that in the description of the present invention, the terms "include", "comprise" or any other variant 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, the elements defined by the sentence "include one..." do not exclude the existence of other identical elements in the process, method, article or device including the elements. The orientation or position relationship indicated by the terms "upper", "lower" and the like is based on the orientation or position relationship shown in the drawings, which is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation of the present invention. Unless otherwise clearly specified and limited, the terms "installed", "connected" and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be an indirect connection through an intermediate medium, or it can be a connection between the two elements. For those skilled in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0028] The terms "first", "second", etc. in the present invention are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present invention can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of the same type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" means at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0029] In modern data centers and cloud computing environments, server information collection and management is a key component to ensure the health and performance of IT infrastructure. With the exponential growth in the number of servers, the task of managing and maintaining large-scale server clusters has become increasingly arduous and complex. In order to ensure the stability and performance of the system, server runtime information collection is crucial to ensure system stability and performance. It is usually necessary to collect server operation information regularly, and at the same time support users to manually refresh and trigger information collection to maintain the accuracy of server device information. However, with the increase in the number of servers, how to effectively manage information collection tasks, especially when the server is abnormal or in an emergency, how to obtain real-time information of the device in a timely manner and prioritize the collection of data from key devices, has become an urgent problem to be solved.

[0030] In the related art, as the number of servers increases, it is impossible to accurately and reasonably determine the priority of server asset data collection tasks and other information collection tasks; traditional server asset information collection methods rely on set priority rules or manually adjust collection priorities, and the adjustment operation needs to be based on subjective judgment, and lacks the function of automatically adjusting priority; when system resources are tight, low-priority tasks may be postponed or skipped, resulting in inaccurate data; if the priority is set improperly, some low-priority tasks may not be executed, the server's information collection and update are not timely, forming a monitoring blind spot, and reducing the efficiency of information collection and management. Therefore, the processing method of server asset data collection tasks in the related art has a technical problem that it cannot accurately determine the priority of server asset data collection tasks, resulting in low task processing efficiency.

[0031] In order to at least solve some of the above problems, the following Figure 1-Figure 7 The present invention describes a method, device and electronic device for processing server asset data collection tasks.

[0032] The processing method of the server asset data collection task provided in this embodiment can be applied to the scenario of processing the server asset data collection task. The processing method of the server asset data collection task in this embodiment can be executed by the server.

[0033] Figure 1 It is a flow chart of the processing method of the server asset data collection task provided by the present invention, such as Figure 1 As shown, including but not limited to the following steps: Step 101: Obtain a target task set, wherein each target task in the target task set corresponds to an asset data collection task of a server.

[0034] In this embodiment, the asset data of the server refers to data such as hardware and software configuration information, performance parameters, network configuration, security settings, and related maintenance and usage records related to the server.

[0035] Each target task in the target task set corresponds to an asset data collection task of a server, that is, each target task corresponds to an asset data collection task of a server, and the target task set corresponds to asset data collection tasks of multiple servers.

[0036] The acquisition method of the target task in the target task set may include periodic timing collection and collection operation actively triggered by the user. After the server that needs to be collected is determined, the target task corresponding to the server is generated.

[0037] Step 102, initialize the priority of each target task in the target task set according to the health weight, wherein the health weight is used to reflect the health status of the server, the health weight increases as the health status of the server deteriorates, and the health weight is positively correlated with the priority of each target task.

[0038] In this embodiment, the health weight is used to reflect the health status of the server. The health weight can be determined by the server's alarm information, server trap message (Trap), CPU usage, memory usage, disk space, system error log and other information. The worse the health status of the server, the higher its corresponding health weight, indicating that the information collection demand of the server is more urgent; the health weight is positively correlated with the priority of each target task, that is, the larger the health weight of the task, the higher the initial priority corresponding to the task.

[0039] The priority of each target task in the target task set is initialized according to the health weight. Here, each target task corresponds to a server, and each target task corresponds to a health weight, which is used to reflect the health status of the server corresponding to the target task.

[0040] Step 103, add the target task set to the task queue, and update the priority of the tasks in the task queue based on the priority index, wherein the priority index includes health weight, operation weight and execution weight, the operation weight is used to reflect the urgency of the task, and the operation weight increases as the urgency of the task increases, and the execution weight is used to reflect the situation where the task is preempted by a high-priority task, and the execution weight increases as the number of times the task is preempted increases.

[0041] In this embodiment, the priority index includes health weight, operation weight and execution weight. The priority index is used to reflect the urgency of tasks in the task queue; the higher the health weight, operation weight and execution weight corresponding to the task, the higher the urgency of the task and the higher the priority of the task.

[0042] It should be noted that after the target task set is added to the task queue, the task queue may include target tasks and non-target tasks, and the initial priority sorting of tasks in the task queue is based on the initial priority of the tasks, that is, in the process of adding the target task set to the task queue, it is necessary to prioritize the target tasks in the target task set in the task queue according to their initial priority.

[0043] Furthermore, after adding the target task set to the task queue and initially prioritizing the tasks in the task queue, the priorities of the tasks in the task queue can be updated based on the priority indicators. Here, if the priorities of the tasks in the task queue are not updated based on the priority indicators, the priorities are prioritized according to the initial priorities of the tasks in the task queue; if the priorities of the tasks in the task queue are updated based on the priority indicators, the priorities of the tasks can be updated according to the health weight, operation weight and execution weight. Here, each task corresponds to its own priority indicator. The greater the weight of the priority indicator corresponding to each task, the greater the priority of the task after update.

[0044] Step 104 , executing the tasks in the task queue based on the updated priorities of the tasks in the task queue.

[0045] In this embodiment, the tasks in the task queue may be executed in order from high to low priority of the tasks in the task queue.

[0046] Through the embodiments provided by the present application, a target task set is obtained, wherein each target task in the target task set corresponds to an asset data collection task of a server; the priority of each target task in the target task set is initialized according to the health weight, wherein the health weight is used to reflect the health status of the server, the health weight increases as the health status of the server deteriorates, and the health weight is positively correlated with the priority of each target task; the target task set is added to a task queue, and the priority of the tasks in the task queue is updated based on the priority index, wherein the priority index includes the health weight, the operation weight and the execution weight, the operation weight is used to reflect the urgency of the task, the operation weight increases as the urgency of the task increases, the execution weight is used to reflect the situation where the task is preempted by a high-priority task, and the execution weight increases as the number of times the task is preempted increases; the tasks in the task queue are executed based on the priority of the tasks in the updated task queue; the processing method of the server asset data collection task in the related art is solved, and the technical problem that the priority of the server asset data collection task cannot be accurately determined, resulting in low task processing efficiency, is improved.

[0047] As an optional solution, the task queue includes a target task set and a non-target task set, the priority index includes a first priority index and a second priority index, and the priority of the task in the task queue is updated based on the priority index, including: S11, updating the priority of each target task in the target task set based on a first priority indicator, wherein the first priority indicator includes a health weight, an operation weight, and an execution weight; S12: updating the priority of each non-target task in the non-target task set based on a second priority indicator, wherein the second priority indicator includes an operation weight and an execution weight.

[0048] In this embodiment, each task in the task queue corresponds to its own health weight, operation weight and execution weight, that is, each task in the task queue corresponds to its own multiple weights, and these weights are used to reflect the priority of the task.

[0049] The task queue includes a target task set and a non-target task set. Each target task in the target task set corresponds to an asset data collection task of a server, and the non-target tasks in the non-target task set are other data collection tasks. Since the non-target tasks in the non-target task set do not involve the asset data collection tasks of the server, the update of the priority of the non-target tasks in the non-target task set does not need to involve the health weight.

[0050] The operation weight is used to reflect the urgency of the task. The operation weight increases with the urgency of the task. That is, the higher the urgency of the task, the greater the operation weight. The execution weight is used to reflect the situation where the task is preempted by a high-priority task. The execution weight increases with the number of times the task is preempted.

[0051] The priority of each target task in the target task set is updated based on the first priority indicator, and the priority of each non-target task in the non-target task set is updated based on the second priority indicator; here, the first priority indicator and the second priority indicator both contain multiple weights, and the priority of the task is determined based on the priority indicator. Optionally, the weights in the priority indicator can be added, and the priority of the task is determined according to the sum of the weights. The higher the sum of the weights, the higher the priority of the task.

[0052] Through this embodiment, the priorities of target tasks and non-target tasks are determined according to different priority indicators, which can effectively improve the accuracy of determining the priorities of tasks in the task queue.

[0053] As an optional solution, the priority of the task in the task queue is updated based on the priority indicator, including: S21, calculating a comprehensive weight value of each task in the task queue, wherein the comprehensive weight value is obtained by multiplying each weight included in the priority index by a preset value corresponding to each weight and then adding them together, and the sum of the preset values ​​corresponding to each weight is 1; S22, updating the priority of each task based on the comprehensive weight value of each task, wherein the comprehensive weight value of each task is positively correlated with the priority of each task.

[0054] In this embodiment, a corresponding preset value can be set for each weight, and a comprehensive weight value is determined according to the weight value and the preset value of each weight; exemplarily, for the target task, the first priority indicator includes health weight, operation weight and execution weight, the preset value of the health weight is 30%, the preset value of the operation weight is 35%, and the preset value of the execution weight is 35%. The health weight, operation weight and execution weight are multiplied by their respective corresponding preset values ​​to obtain the comprehensive weight value of the target task, and its priority is determined according to the comprehensive weight value. The higher the comprehensive weight value, the higher the priority; for non-target tasks, the second priority indicator includes operation weight and execution weight, the preset value of the operation weight is 50%, and the preset value of the execution weight is 50%. The operation weight and execution weight are multiplied by their respective corresponding preset values ​​to obtain the comprehensive weight value of the non-target task, and its priority is determined according to the comprehensive weight value. The higher the comprehensive weight value, the higher the priority.

[0055] Through this embodiment, the comprehensive weight value of each task is calculated based on the priority index, and the priority of each task is updated according to the comprehensive weight value, which can improve the accuracy of determining the priority of each task in the task queue. As an optional solution, before updating the priority of the task in the task queue based on the priority index, the method also includes: S31, taking each task in the task queue as the first current task and executing the following steps to obtain the current operation weight corresponding to the first current task: Obtaining the refresh count of the first current task, wherein the refresh count increases by one each time an execution instruction of the first current task is received; The current operation weight is determined according to the refresh times, wherein the refresh times is positively correlated with the current operation weight.

[0056] In this embodiment, the current operation weight is used to reflect the execution requirements of the first current task. For example, when the first current task needs to be executed urgently and the first current task is in a pending collection state in the task queue, the user can trigger the execution operation of the first current task once or multiple times through operations such as refresh, thereby increasing the refresh times of the first current task. The higher the refresh times of the first current task, the more urgent the execution of the first current task is. Therefore, the current operation weight of the first current task can be increased to provide data support for the subsequent collection priority adjustment.

[0057] Through this embodiment, the current operation weight is determined according to the refresh number, which can improve the accuracy of determining the operation weight corresponding to the task, thereby improving the stability and reliability of the processing method of the server asset data collection task in this embodiment.

[0058] As an optional solution, before updating the priority of the task in the task queue based on the priority indicator, the method further includes: S41, taking each task in the task queue as the second current task and executing the following steps to obtain a current execution weight corresponding to the second current task: Obtain the number of times the second current task is preempted, where the number of times the second current task is preempted by a high-priority task; The current execution weight is determined according to the number of preemption times, wherein the number of preemption times is positively correlated with the current execution weight.

[0059] In this embodiment, the number of preemption times is used to reflect the situation in which the second current task is preempted by a higher priority task in a periodic collection batch. It is mainly reflected in the scheduling management of low-priority tasks. When the number of preemption execution of low-priority tasks increases, resulting in the failure of the second current task to collect in this cycle, the execution weight is adjusted. The adjustment of this weight can prevent the low-priority task from being unable to be executed for a long time, resulting in untimely information updates.

[0060] Exemplarily, each time a task in the task queue is executed, the task will be executed periodically. For example, 10 tasks will be executed in each task execution cycle. If the second current task ranks 9th in priority among these 10 tasks, if there are 2 high-priority tasks inserted into this task execution cycle, the second current task will be squeezed out to the next task execution cycle. At this time, the second current task will be preempted 2 times. Since the second current task is squeezed into the next task execution cycle, the current execution weight corresponding to the second current task will be increased to avoid the second current task being unable to be executed for a long time, resulting in untimely information updates.

[0061] Through this embodiment, the current execution weight is determined according to the number of preemption times, which can improve the accuracy of determining the execution weight corresponding to the task, thereby improving the stability and reliability of the processing method of the server asset data collection task in this embodiment.

[0062] As an optional solution, after executing the tasks in the task queue based on the updated priorities of the tasks in the task queue, the method further includes: S51, obtaining the execution results of the tasks in the task queue in the current task execution cycle; S52, updating the execution weights of the tasks in the task queue within the target task execution cycle according to the execution result, wherein the target task execution cycle is the next task execution cycle of the current task execution cycle.

[0063] In this embodiment, multiple tasks will be executed within a task execution cycle, and the number of tasks executed within a task execution cycle is fixed. After the tasks that need to be executed within the current task execution cycle are completed, the corresponding execution results can be obtained. Here, the execution results include whether the task is executed successfully. The execution results can also include whether some low-priority tasks are squeezed into the next task execution cycle by other high-priority tasks within the current task execution cycle. If this happens, the execution weights corresponding to the tasks squeezed into the next task execution cycle can be adjusted and updated according to the task execution results.

[0064] Optionally, executing tasks in the task queue based on the priorities of the tasks in the updated task queue includes: The first n tasks in the task queue are selected for execution in descending order of priority, where n is the number of tasks that need to be executed in one task execution cycle.

[0065] Optionally, n collectors may be provided in the server for simultaneously executing multiple tasks in one task execution cycle.

[0066] Through this embodiment, after the execution of the tasks in the current task execution cycle is completed, the execution weights of the tasks in the target task execution cycle are updated based on the execution results, so that the accuracy of the execution weights can be improved.

[0067] As an optional solution, before executing the tasks in the task queue based on the updated priorities of the tasks in the task queue, the method further includes: S61: When a priority adjustment instruction is received, the priority of the task corresponding to the priority adjustment instruction is adjusted based on the priority adjustment instruction.

[0068] In this embodiment, the priority adjustment instruction can be sent by the user. When a server needs to perform emergency asset data collection, the user can send a priority adjustment instruction to adjust the priority of the target task corresponding to the server to the highest. When the priority adjustment instruction is received, the priority of the task corresponding to the priority adjustment instruction can be adjusted based on the priority adjustment instruction, thereby ensuring that the target task is executed first.

[0069] Through this embodiment, the priority of the task is adjusted based on the priority adjustment instruction, which further improves the stability and reliability of the processing method of the server asset data collection task in this embodiment.

[0070] The following describes a method for processing server asset data collection tasks in an embodiment of the present application in conjunction with optional examples. Figure 2 is a structural diagram of the task processing system provided by the present invention, such as Figure 2 As shown, the processing method of the server asset data collection task in this embodiment can be executed by a task processing system, which is set in the server. The task processing system may include: Figure 2 The collection task generation module, queue priority management module, collection execution module and visualization management module are shown.

[0071] Among them, the collection task generation module is a collection operation for each server device, including periodic timed collection and collection triggered by the user, generating a corresponding collection task, initializing a collection priority according to the current status of the device, and putting it into the collection queue. If the same device triggers collection multiple times and the collection task is already in the queue, it will not be created, and the priority management module will adjust the task weight to reallocate the collection priority. The collection task contains basic information such as the protocol information required for collection, the target device address, and the health status of the device.

[0072] The priority management module determines the priority of the collection queue according to the priority index of the collection task to achieve the purpose of priority collection. The priority index of the collection task is divided into health weight, operation weight, and execution weight.

[0073] Among them, the health weight is derived from the health status of the device, including alarms, traps and other information. The more serious the health status, the higher the health weight, indicating that the information collection demand of this device is more urgent; the operation weight refers to the user's demand for active triggering of collection of the device. For example, the current information of the device urgently needs to be collected and updated, but the collection task status in the queue is in the waiting state. If the user does not actively adjust the collection priority of this device, but triggers the device collection once or multiple times through operations such as refresh, it indicates that this device urgently needs to be collected. The operation weight of this device can be increased to provide data support for the subsequent collection priority adjustment.

[0074] Execution weight refers to the situation in which priority is preempted in periodic collection batches. It is mainly reflected in the scheduling management of low-priority tasks. The more times low-priority tasks are preempted, the more collection cannot be performed in this cycle, thereby triggering the adjustment of execution weight. The adjustment of this weight can prevent low-priority tasks from being unable to be executed for a long time, resulting in untimely information updates.

[0075] The queue priority management module receives the collection requirements actively triggered by the user, monitors the changes in the collection task priority and the execution status, and finally calculates the collection priority through comprehensive adjustment of the device health weight, operation weight, and execution weight.

[0076] Figure 3 It is a schematic diagram of the interaction between the queue priority management module and the collection execution module provided by the present invention. The main function of the collection execution module is to collect specific server device information and perform efficient collection through the thread pool multi-threaded execution method. The collection task execution process and progress are monitored, and the collection task execution results are collected. At the same time, the execution progress and results are fed back to the visualization management module to display the collection process and results.

[0077] exist Figure 3 In the process, the device status weight (i.e., health weight) is determined according to the basic information of the device, the operation weight of the task is updated according to the user's trigger or refresh operation, and the execution weight is updated according to the execution feedback of the acquisition execution module. Based on the above three weights, the priority of the task is adaptively adjusted, and the priority of the task is transmitted to the acquisition execution module for task execution.

[0078] Figure 4 is a schematic diagram of the structure of the acquisition execution module provided by the present invention. Figure 4 In the process, tasks and corresponding priorities are received from the queue priority management module, multiple collectors (i.e., collection execution units) are used to execute tasks, specific server device information is collected, and efficient collection is performed through thread pool multi-threaded execution. The collection task execution process and progress are monitored, and the collection task execution results are collected. At the same time, the execution progress and results are fed back to the visualization management module to display the collection process and results.

[0079] Figure 5 It is a structural diagram of the visual management module provided by the present invention. The system provides a visual management interface. The visual management page (visual user interface (UI)) is divided into a waiting area, an execution area, and a history area. The visual page updates the data in real time through the network socket (WebSocket) technology, which is convenient for realizing the functions of priority management, collection execution health, and collection result analysis. The waiting area can view the queue status of all the collection tasks currently being processed and executed, and provide a query function to facilitate the location of the collection task and adjust the operation; the execution area can view the collection that is currently being executed, and can view the execution progress and time consumption of each collection task. At the same time, it can manage the execution task such as pausing and stopping operations; the history area can view the collection results and abnormal situations of the collection tasks that have been executed, and at the same time, collect statistics and analyze the collection efficiency and the working status of the collector.

[0080] Exemplarily, this embodiment includes the following steps: 1) Collection task generation: When the user actively triggers or the system periodically collects information from the server device, the real-time basic information of the current server device is obtained, a corresponding collection task is generated, and it is placed in the collection queue waiting for execution.

[0081] 2) Health weight determination: The health weight of each collection task is determined based on the health status of the server. The worse the health status, the higher the health weight, indicating that the device urgently needs to collect data, thus obtaining a higher priority in the collection queue.

[0082] 3) Determine the operation weight: When the user actively initiates a collection operation, the system increases the operation weight for the task. The user's active operation indicates that the task has a high urgency, and the increase in the operation weight makes the task prioritized in the collection queue.

[0083] 4) Execution weight adjustment: During the execution of tasks in the collection queue, if some low-priority tasks are delayed multiple times due to preemption by high-priority tasks or cannot be executed in this cycle, the system will gradually increase the execution weight of these low-priority tasks to prevent them from not being executed for a long time. This mechanism ensures that even low-priority tasks can be processed within a reasonable time in periodic collection.

[0084] 5) Adaptive priority adjustment: The system dynamically adjusts the final priority of each collection task by combining the device status weight, operation weight, and execution weight. The priority adjustment mechanism ensures that important tasks (such as poor health status or user-specified tasks) are given priority, improving the collection efficiency of emergency key equipment.

[0085] 6) Multi-threaded collection execution: The collection executor takes tasks from the queue according to the priority order for execution. The collector uses multi-threading technology to process multiple collection tasks in parallel through the thread pool, thereby improving collection efficiency. The collector monitors the collection progress and results in real time and feeds this information back to the system.

[0086] 7) Visual management and display: The system provides a visual management module that displays the priority, execution status, and workload of each task in the collection queue in real time. Users can view the execution progress of tasks, adjust the priority of tasks, and analyze collection results through the visual interface. The visual interface supports viewing and statistics of historical data, helping users understand the effects of collection strategies and optimize future collection tasks.

[0087] Through this embodiment, by combining the dynamic adjustment of health weights, operation weights and execution weights, the system can intelligently and adaptively manage the priority of collection tasks to ensure that key tasks are processed first; at the same time, it can prevent task delays from forming monitoring blind spots, and through the dynamic adjustment of execution weights, prevent low-priority tasks from being not executed for a long time due to the existence of high-priority tasks, thereby ensuring that all tasks can be completed within a reasonable time.

[0088] This embodiment can also realize real-time monitoring, feedback and visual interaction. Through visual management and convenient interactive windows, users can monitor the execution of collection tasks in real time and adjust strategies in time to ensure the efficiency and accuracy of data collection and improve operational convenience.

[0089] It can be understood that through the improvement of the above method, the adaptive adjustment of the collection of data center server equipment information can be managed more effectively, ensuring the real-time collection of key server equipment information, while providing a friendly visual interactive page to improve the flexibility of collection management.

[0090] Figure 6 Schematic diagram of the structure of the processing device for server asset data collection task provided by the present invention, such as Figure 6 As shown, including but not limited to the following modules: An acquisition module 601 is used to acquire a target task set, wherein each target task in the target task set corresponds to an asset data collection task of a server; Initialization module 602, used to initialize the priority of each target task in the target task set according to the health weight, wherein the health weight is used to reflect the health status of the server, the health weight increases as the health status of the server deteriorates, and the health weight is positively correlated with the priority of each target task; An updating module 603 is used to add the target task set to the task queue, and update the priority of the task in the task queue based on the priority index, wherein the priority index includes a health weight, an operation weight, and an execution weight. The operation weight is used to reflect the urgency of the task, and the operation weight increases as the urgency of the task increases. The execution weight is used to reflect the situation where the task is preempted by a high-priority task, and the execution weight increases as the number of times the task is preempted increases. The execution module 604 is used to execute the tasks in the task queue based on the updated priorities of the tasks in the task queue.

[0091] Through the embodiments of the present application, a target task set is obtained, wherein each target task in the target task set corresponds to an asset data collection task of a server; the priority of each target task in the target task set is initialized according to the health weight, wherein the health weight is used to reflect the health status of the server, the health weight increases as the health status of the server deteriorates, and the health weight is positively correlated with the priority of each target task; the target task set is added to a task queue, and the priority of the tasks in the task queue is updated based on the priority index, wherein the priority index includes the health weight, the operation weight and the execution weight, the operation weight is used to reflect the urgency of the task, the operation weight increases as the urgency of the task increases, the execution weight is used to reflect the situation where the task is preempted by a high-priority task, and the execution weight increases as the number of times the task is preempted increases; the tasks in the task queue are executed based on the priority of the tasks in the updated task queue; the processing method of the server asset data collection task in the related art is solved, and the technical problem that the priority of the server asset data collection task cannot be accurately determined, resulting in low task processing efficiency, is improved.

[0092] It should be noted that the processing device for server asset data collection tasks provided by the present invention can execute the processing method for server asset data collection tasks of any of the above-mentioned embodiments during specific operation, which will not be elaborated in this embodiment.

[0093] Figure 7 is a schematic diagram of the structure of the electronic device provided by the present invention, such as Figure 7As shown, the electronic device may include: a processor (processor) 710 , a communication interface (Communications Interface) 720 , a memory (memory) 730 and a communication bus 740 , wherein the processor 710 , the communication interface 720 , and the memory 730 communicate with each other through the communication bus 740 . The processor 710 can call the logic instructions in the memory 730 to execute a processing method for the server asset data collection task, the method comprising: obtaining a target task set, wherein each target task in the target task set corresponds to an asset data collection task of a server; initializing the priority of each target task in the target task set according to the health weight, wherein the health weight is used to reflect the health status of the server, the health weight increases as the health status of the server deteriorates, and the health weight is positively correlated with the priority of each target task; adding the target task set to the task queue, and updating the priority of the tasks in the task queue based on the priority index, wherein the priority index includes the health weight, the operation weight and the execution weight, the operation weight is used to reflect the urgency of the task, the operation weight increases as the urgency of the task increases, the execution weight is used to reflect the situation where the task is preempted by a high-priority task, and the execution weight increases as the number of times the task is preempted increases; executing the tasks in the task queue based on the priority of the tasks in the updated task queue.

[0094] In addition, the logic instructions in the above-mentioned memory 730 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0095] On the other hand, the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, the computer program including program instructions, and when the program instructions are executed by a computer, the computer can execute the server asset data collection task processing method provided by the above embodiments, the method including: obtaining a target task set, wherein each target task in the target task set corresponds to an asset data collection task of a server; initializing the priority of each target task in the target task set according to a health weight, wherein the health weight is used to reflect the health status of the server, the health weight increases as the health status of the server deteriorates, and the health weight is positively correlated with the priority of each target task; adding the target task set to a task queue, and updating the priority of the tasks in the task queue based on a priority index, wherein the priority index includes a health weight, an operation weight and an execution weight, the operation weight is used to reflect the urgency of the task, the operation weight increases as the urgency of the task increases, the execution weight is used to reflect the situation where the task is preempted by a high-priority task, and the execution weight increases as the number of times the task is preempted increases; executing the tasks in the task queue based on the priority of the tasks in the updated task queue.

[0096] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a processing method for executing the server asset data collection task provided in the above-mentioned embodiments, the method comprising: obtaining a target task set, wherein each target task in the target task set corresponds to an asset data collection task of a server; initializing the priority of each target task in the target task set according to a health weight, wherein the health weight is used to reflect the health status of the server, the health weight increases as the health status of the server deteriorates, and the health weight is positively correlated with the priority of each target task; adding the target task set to a task queue, and updating the priority of the tasks in the task queue based on a priority index, wherein the priority index includes a health weight, an operation weight and an execution weight, the operation weight is used to reflect the urgency of the task, the operation weight increases as the urgency of the task increases, the execution weight is used to reflect the situation where the task is preempted by a high-priority task, and the execution weight increases as the number of times the task is preempted increases; executing the tasks in the task queue based on the priority of the tasks in the updated task queue.

[0097] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, i.e., they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative effort.

[0098] Through the description of the above implementation modes, those skilled in the art can clearly understand that each implementation mode can be implemented by means of software plus a necessary general hardware platform, or of course by hardware. Based on such an understanding, the above technical solution can essentially or in other words be embodied in the form of a software product that contributes to the prior art. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or some parts of the embodiment.

[0099] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for processing a server asset data collection task, characterized in that: include: Acquire a target task set, wherein each target task in the target task set corresponds to an asset data collection task of a server; Initializing the priority of each target task in the target task set according to a health weight, wherein the health weight is used to reflect the health status of the server, the health weight increases as the health status of the server deteriorates, and the health weight is positively correlated with the priority of each target task; Adding the target task set to a task queue, and updating the priorities of the tasks in the task queue based on a priority index, wherein the priority index includes the health weight, the operation weight, and the execution weight, wherein the operation weight is used to reflect the urgency of the task, and the operation weight increases as the urgency of the task increases, and the execution weight is used to reflect the situation where the task is preempted by a high-priority task, and the execution weight increases as the number of times the task is preempted increases; The tasks in the task queue are executed based on the updated priorities of the tasks in the task queue.

2. The method for processing server asset data collection tasks according to claim 1, characterized in that: The task queue includes a target task set and a non-target task set, the priority index includes a first priority index and a second priority index, and updating the priority of the task in the task queue based on the priority index includes: Updating the priority of each target task in the target task set based on the first priority indicator, wherein the first priority indicator includes the health weight, the operation weight, and the execution weight; The priority of each non-target task in the non-target task set is updated based on the second priority indicator, wherein the second priority indicator includes the operation weight and the execution weight.

3. The method for processing server asset data collection tasks according to any one of claims 1 or 2, characterized in that: The updating of the priority of the task in the task queue based on the priority indicator includes: Calculating a comprehensive weight value of each task in the task queue, wherein the comprehensive weight value is obtained by multiplying each weight included in the priority index by a preset value corresponding to each weight and then adding them together, and the sum of the preset values ​​corresponding to each weight is 1; The priority of each task is updated based on the comprehensive weight value of each task, wherein the comprehensive weight value of each task is positively correlated with the priority of each task.

4. The method for processing server asset data collection tasks according to claim 3, characterized in that: Before updating the priorities of the tasks in the task queue based on the priority indicators, the method further includes: Take each task in the task queue as the first current task and perform the following steps to obtain the current operation weight corresponding to the first current task: Obtaining a refresh count of the first current task, wherein the refresh count increases by one each time an execution instruction of the first current task is received; The current operation weight is determined according to the refresh number, wherein the refresh number is positively correlated with the current operation weight.

5. The method for processing server asset data collection tasks according to claim 3, characterized in that: Before updating the priorities of the tasks in the task queue based on the priority indicators, the method further includes: Each task in the task queue is used as a second current task to perform the following steps to obtain a current execution weight corresponding to the second current task: Obtaining the number of times the second current task is preempted, wherein the number of times the second current task is preempted by a high-priority task; The current execution weight is determined according to the preemption times, wherein the preemption times is positively correlated with the current execution weight.

6. The method for processing server asset data collection tasks according to claim 3, characterized in that: After executing the tasks in the task queue based on the updated priorities of the tasks in the task queue, the method further includes: Obtaining the execution results of the tasks in the task queue in the current task execution cycle; The execution weight of the task in the task queue within a target task execution cycle is updated according to the execution result, wherein the target task execution cycle is a next task execution cycle of the current task execution cycle.

7. The method for processing server asset data collection tasks according to any one of claims 1 to 6, characterized in that: Before executing the tasks in the task queue based on the updated priorities of the tasks in the task queue, the method further includes: In the case where a priority adjustment instruction is received, the priority of the task corresponding to the priority adjustment instruction is adjusted based on the priority adjustment instruction.

8. A processing device for server asset data collection tasks, characterized in that: include: An acquisition module, used to acquire a target task set, wherein each target task in the target task set corresponds to an asset data collection task of a server; An initialization module, used to initialize the priority of each target task in the target task set according to a health weight, wherein the health weight is used to reflect the health status of the server, the health weight increases as the health status of the server deteriorates, and the health weight is positively correlated with the priority of each target task; An updating module, used for adding the target task set to a task queue, and updating the priority of the tasks in the task queue based on a priority index, wherein the priority index includes the health weight, the operation weight and the execution weight, the operation weight is used to reflect the urgency of the task, and the operation weight increases as the urgency of the task increases, and the execution weight is used to reflect the situation that the task is preempted by a high-priority task, and the execution weight increases as the number of times the task is preempted increases; An execution module is used to execute the tasks in the task queue based on the updated priorities of the tasks in the task queue.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, it implements the processing method of the server asset data collection task as described in any one of claims 1 to 7.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements the processing method of the server asset data collection task as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Data collection method, device and equipment based on micro service and storage medium

    CN113791961A

  • Data processing method and device, computer equipment and storage medium

    CN114153581A

  • Task processing method and device, server equipment and medium

    CN116132316A

  • System which automatically detects fault information of system and automatically samples, encrypts and transmits log files during installation / normal operation / fault

    JP2008257413A

Cited By

  • Data acquisition method and equipment

    CN120729923A

  • Server data acquisition method and device

    CN120821645A