A state information collection method and related components thereof
By acquiring hardware status in parallel and utilizing the weight values of the virtual execution environment to collect server hardware status information, the problems of extended and failed data collection tasks are solved, ensuring the efficiency and completeness of server management.
Patent Information
- Application Number
- CN202210469683.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-30
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2042-04-30
AI Technical Summary
Existing technologies for collecting server hardware status information can easily lead to extended collection tasks, concurrency issues, redundancy, and failures, affecting the server's entire lifecycle management.
During the execution of the data acquisition task, the hardware status is acquired in parallel. By determining the weight value of the virtual execution environment, the environment with the highest weight value is used to acquire status information, thereby avoiding duplicate acquisition and task failure.
This approach avoids redundancy and failures in the data collection process without affecting the normal execution of data collection tasks, thus ensuring the smooth operation of server lifecycle management.
Smart Images

Figure CN114741264B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of task execution, and in particular to a method for acquiring status information and related components. Background Technology
[0002] To achieve full lifecycle management of servers and their internal hardware, servers periodically execute a task to collect their internal hardware parameters. If the state of this hardware changes during this task—such as due to firmware updates, hardware replacements, or server removal / delisting—then the changed state information needs to be collected promptly. For example, when a server is delisted, its availability information needs to be collected. Current technology typically uses a collection task to collect state information. When a hardware state change is detected, the collection task collects the state information first, and then continues with its original steps. However, this method prolongs the execution time of the collection task, easily leading to multiple concurrent collection tasks. Furthermore, if another hardware state change occurs while multiple collection tasks are running concurrently, the original logic of these tasks is paused, resulting in multiple state information collections. This makes the entire collection process redundant and complex. Additionally, if the execution time of a collection task is too long, it may fail. Summary of the Invention
[0003] The purpose of this invention is to provide a status information acquisition method and related components that will not affect the normal execution of the acquisition task, do not require stopping the logic of the original acquisition hardware parameters of the acquisition task, can avoid the redundancy and complexity of the acquisition process caused by acquiring status information multiple times, and also avoid the failure of the acquisition task due to excessive execution time.
[0004] To address the aforementioned technical problems, this invention provides a method for acquiring status information, comprising:
[0005] While a data acquisition task is being executed, tasks to acquire the current state of each piece of hardware in the device are executed in parallel.
[0006] When it is determined that the current state of the hardware has changed, a first weight value is determined for each preset virtual execution environment at the current time. The value of the first weight value is positively correlated with the idle level of the preset virtual execution environment and positively correlated with the execution power of the preset virtual execution environment.
[0007] The preset virtual execution environment with the highest first weight value is used to collect the status information of the hardware whose current state has changed.
[0008] Preferably, determining the first weight value of each preset virtual execution environment at the current time includes:
[0009] Determine the execution capacity of each virtual execution environment and the load of each virtual execution environment at the current time;
[0010] Determine the amount of data generated by the hardware when it performs a task in which the current state changes;
[0011] A second weight value is determined for each of the virtual execution environments based on the data volume and the execution power, wherein the second weight value is negatively correlated with the ratio between the data volume and the execution power;
[0012] The first weight value is determined based on the second weight value and the load of each virtual execution environment, wherein the load is negatively correlated with the first weight value and the second weight value is positively correlated with the first weight value.
[0013] Preferably, determining that the current state of the hardware has changed includes:
[0014] Obtain the current execution task of each of the aforementioned hardware components at the current time;
[0015] Determine whether any of the currently executing tasks are marked by a preset task;
[0016] If so, it is determined that the current state of the hardware has changed;
[0017] If not, then it is determined that the current state of the hardware has not changed.
[0018] Preferably, determining that the current state of the hardware has changed includes:
[0019] For any of the aforementioned hardware, determine whether the current state of the hardware obtained at the current time is consistent with the current state of the hardware obtained the last time;
[0020] If they match, then it is determined that the current state of the hardware has not changed;
[0021] If there is a discrepancy, it is determined that the current state of the hardware has changed.
[0022] Preferably, after collecting the state information of the hardware whose current state has changed using the preset virtual execution environment with the highest first weight value, the method further includes:
[0023] Store the status information in a preset directory;
[0024] A third weight value is determined for each state information based on preset keywords, and the third weight value is positively correlated with the number of preset keywords contained in the state information;
[0025] The status information is sorted in the preset directory according to the third weight value of each status information.
[0026] Preferably, determining the third weight value for each of the state information items based on preset keywords includes:
[0027] Determine a first quantity of the status information stored in the preset directory;
[0028] Determine a second quantity of status information containing the preset keyword in the preset directory;
[0029] Determine the third number of the preset keywords contained in each of the aforementioned status information;
[0030] Determine the sum of the first quantity and the second quantity, and a preset value;
[0031] For any of the aforementioned state information, determine the sum of the second quantities between the third quantity and the preset value;
[0032] For any of the stated state information, the ratio between the first quantity and the second quantity is determined as the third weight value of the state information.
[0033] Preferably, sorting the state information in the preset directory according to the third weight value of each state information includes:
[0034] Determine the character length of each of the aforementioned status information;
[0035] The average character length of the preset directory is determined based on the length of each of the aforementioned characters.
[0036] Determine the ratio between the character length of each of the stated status information and the average character length;
[0037] The state information is sorted in the preset directory according to the third weight value and the ratio of each state information.
[0038] This application also provides a status information acquisition system, including:
[0039] The current status acquisition unit is used to execute the acquisition task of the current status of each hardware in the acquisition device in parallel when there is an acquisition task being executed.
[0040] The first weight value determination unit is used to determine the first weight value of each preset virtual execution environment at the current time when it is determined that the current state of the hardware has changed. The value of the first weight value is positively correlated with the idle degree of the preset virtual execution environment and positively correlated with the execution power of the preset virtual execution environment.
[0041] The status information acquisition unit is used to acquire the status information of the hardware whose current status has changed using the preset virtual execution environment with the highest first weight value.
[0042] This application also provides a server instance allocation device for application services, including:
[0043] Memory, used to store computer programs;
[0044] A processor is used to implement the steps of the state information acquisition method described above when executing the computer program.
[0045] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the state information acquisition method described above.
[0046] This invention provides a state information acquisition method and related components. While an acquisition task is being executed, acquisition tasks for obtaining the current state of various hardware components are executed in parallel. When a change in the current state of hardware is detected, a first weight value is determined for each preset virtual execution environment at the current time. The value of the first weight value is positively correlated with the idle level and execution power of the preset virtual execution environment. Then, the preset virtual execution environment with the highest first weight value is used to acquire the state information of the hardware whose current state has changed. Because the acquisition task and the acquisition task are executed in parallel, it does not affect the normal execution of the acquisition task. It does not require stopping the original logic of acquiring hardware parameters. By acquiring state information through the preset virtual execution environment with the highest first weight value, redundancy and complexity in the acquisition process caused by acquiring state information multiple times can be avoided. It also avoids acquisition task failure due to excessively long execution time. Attached Figure Description
[0047] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the prior art and embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0048] Figure 1 A flowchart of a status information acquisition method provided in this application;
[0049] Figure 2 A flowchart of another status information acquisition method provided in this application;
[0050] Figure 3 A flowchart of another status information acquisition method provided in this application;
[0051] Figure 4 This application provides a schematic diagram of the structure of a status information acquisition system;
[0052] Figure 5 This is a schematic diagram of the structure of a status information acquisition device provided in this application. Detailed Implementation
[0053] The core of this invention is to provide a status information acquisition method and related components, which will not affect the normal execution of the acquisition task, does not require stopping the logic of the original acquisition hardware parameters of the acquisition task, can avoid the redundancy and complexity of the acquisition process caused by acquiring status information multiple times, and also avoids the failure of the acquisition task due to excessive execution time.
[0054] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0055] Please refer to Figure 1 , Figure 1 A flowchart of a status information acquisition method provided in this application includes:
[0056] S1: When a data acquisition task is being executed, execute the task of acquiring the current state of each piece of hardware in the device in parallel;
[0057] S2: When it is determined that the current state of the hardware has changed, determine the first weight value of each preset virtual execution environment at the current time. The value of the first weight value is positively correlated with the idle level of the preset virtual execution environment and positively correlated with the execution power of the preset virtual execution environment.
[0058] S3: Use the preset virtual execution environment with the highest first weight value to collect the status information of the hardware whose current state has changed.
[0059] Data collection is a crucial part of server lifecycle management. To achieve this, data collection tasks are executed periodically. These tasks gather various information about the server's hardware, such as hardware parameters and load, and may also include hardware status information. If the hardware status information changes during the data collection process, it indicates that the previously collected status information is outdated, requiring the acquisition of the latest status data. However, current technologies still rely on the current data collection task to obtain the latest status information. This prolongs the task's execution time. Excessive execution time increases the risk of task failure due to uncontrollable factors such as power outages and voltage instability, negatively impacting server lifecycle management.
[0060] To ensure the smooth execution of data collection tasks and to guarantee the full lifecycle management of the server, this application refers to... Figure 2 , Figure 2 The flowchart of another state information acquisition method provided in this application shows that when the acquisition task is being executed, the current state of each hardware is acquired in parallel. When the state of a hardware changes, the acquisition task will not acquire the state information of that hardware, but will continue to execute its subsequent task logic, which is equivalent to separating the acquisition task from the task when the state changes. At the same time, the first weight value of each preset virtual execution environment is determined. The first weight value is positively correlated with the execution power and idle level of each virtual execution environment. The execution power is the data processing capability of the virtual execution environment per unit time. The idle level is negatively correlated with the load or computation of the virtual execution environment at the current time. That is, the higher the load, the less idle. The virtual execution environment is a virtual environment with computing and execution capabilities established in the server, which can be used for normal task operation and can be dynamically created and destroyed. For example, a server instance is a virtual environment. Since the virtual execution environment is independent, it will not affect the normal operation of other tasks or other virtual execution environments on the server. Therefore, whenever a hardware status change occurs, the optimal virtual execution environment, i.e. the virtual execution environment with the highest first weight value, can be determined each time to collect the status information in order to balance the load among the various virtual execution environments.
[0061] It's important to note that execution capability can be reflected not only by the data processing capacity of the virtual execution environment per unit time, but also by its preset task completion time. The preset task completion time is a time value set based on the virtual execution environment's data processing capacity. Ideally, when the virtual execution environment is collecting status information, it should complete the collection before the preset task completion time expires. Therefore, the preset task completion time reflects the slowest completion time for the virtual execution environment to perform the task of collecting status information; the shorter the time, the stronger the execution capability. When determining the first weight value for each virtual execution environment, a shorter preset task completion time results in a higher first weight value. Furthermore, if, during operation, a virtual execution environment is found to be still executing a task after its corresponding preset task completion time has elapsed, this may be due to changes in the virtual execution environment itself or some logical error, indicating a decrease in its execution capability. In this case, it may be necessary to adjust the preset task completion time of the virtual execution environment.
[0062] Furthermore, to reduce server load, virtual execution environments (VEXs) can be created and destroyed at any time. Specifically, VEXs can be left uncreated while a data collection task is in progress. They can be created only when a hardware status change is detected. If multiple hardware status changes, multiple VEXs can be created to collect status information from each hardware component. When the data collection task is not running, these VEXs can be destroyed to release server load. Additionally, a certain number of VEXs can be created at the start of a data collection task, and additional innovative VEXs can be created during task execution. This application does not limit the timing of creating and destroying VEXs.
[0063] Based on this, while the data acquisition task is being executed, tasks to acquire the current state of various hardware components are executed in parallel. When a change in the current state of any hardware component is detected, a first weight value is determined for each preset virtual execution environment at the current time. The value of the first weight value is positively correlated with the idle level and execution power of the preset virtual execution environment. Then, the preset virtual execution environment with the highest first weight value is used to acquire the state information of the hardware whose current state has changed. Since the acquisition task and the data acquisition task are executed in parallel, they do not affect the normal execution of the data acquisition task. There is no need to stop the original logic of the data acquisition task for acquiring hardware parameters. By acquiring state information through the preset virtual execution environment with the highest first weight value, the redundancy and complexity of the data acquisition process caused by acquiring state information multiple times can be avoided. It also avoids the situation where the data acquisition task fails due to excessive execution time.
[0064] Based on the above embodiments:
[0065] As a preferred embodiment, determining the first weight value of each preset virtual execution environment at the current time includes:
[0066] Determine the execution capacity of each virtual execution environment and the load of each virtual execution environment at the current time;
[0067] Determine the amount of data generated by the hardware when performing a task in which the current state changes;
[0068] The second weight value of each virtual execution environment is determined based on the amount of data and the execution capability. The second weight value is negatively correlated with the ratio between the amount of data and the execution capability.
[0069] The first weight value is determined based on the second weight value and the load of each virtual execution environment. The load is negatively correlated with the first weight value, and the second weight value is positively correlated with the first weight value.
[0070] To determine the first weight value, in this application, for each virtual execution environment, its preset task completion time can be used as its execution capability. The preset task completion time is a preset time value that specifies the completion time of the virtual execution environment in performing the task of collecting the status information of the hardware whose current state has changed. For example, when the preset task completion time is 1 second, it is specified that the virtual execution environment needs to complete the task of collecting status information within 1 second. Since this time is set according to the data processing capability of each virtual execution environment, it can be seen that the shorter the time, the higher the execution capability of the virtual execution environment. However, when the task of collecting status information is not completed after the preset task completion time, it indicates that the execution capability of the virtual execution environment has decreased, and its time and the first weight value need to be adjusted according to the actual situation. A linked list can be created to record the identifier value, preset task completion time, and load of each virtual execution environment. For example, in the linked list, an identifier value set C can be created for each virtual execution environment, C = {1, 2, 3, 4...X}, which contains the identifier values of each virtual execution environment; a time set EndTime can be created, EndTime = {time1, time2, time3...timeX}, which contains the preset task completion time of each virtual execution environment; and a load set Int can be created, Int = {int1, int2, int3...intX}, which contains the load of each virtual execution environment. The first weight value of each virtual execution environment is determined based on these sets in the linked list.
[0071] When the current state of hardware changes, it indicates that the hardware is performing a task, such as a firmware update. During task execution, the hardware generates data, the amount of which depends on the hardware type and the specific task being performed. For example, when performing a firmware update, the data volume is related to the size of the firmware. To determine the optimal virtual execution environment, a second weight value needs to be determined based on the ratio of data volume to execution power. Since different hardware states generate different amounts of data when they change, when the data volume is small, it's unnecessary to use a high-performance virtual execution environment to acquire small amounts of state information. This saves the load so that a high-performance virtual execution environment can collect subsequent, larger amounts of state information. Based on this, the ratio of data volume to execution power can be determined. The smaller the ratio, the more suitable the corresponding virtual execution environment is for collecting the state information corresponding to the current data volume. Regarding load, the higher the load on the virtual execution environment at the current time, the smaller the first weight value. Based on this, an accurate first weight value can be determined.
[0072] As a preferred embodiment, determining that there is a change in the current state of the hardware includes:
[0073] Get the current task being executed by each hardware component at the current time;
[0074] Determine whether any of the currently executing tasks are marked by a preset task.
[0075] If so, it is determined that the current state of the hardware has changed;
[0076] If not, then it is determined that there is no change in the current state of the hardware.
[0077] To determine whether the current state of the hardware has changed, this application defines a change in the current state of the hardware as indicating that the hardware is currently performing a task. For example, when a firmware update causes a change in the hardware's state, it indicates that the hardware is currently performing a firmware update task. Therefore, the task being performed by the hardware reflects whether its state has changed. Based on this, among the various tasks that each piece of hardware can execute, tasks related to hardware state changes are marked. When retrieving the currently executing task of each piece of hardware at the current time, if a marked task is found, it indicates that the state of the hardware corresponding to that task has changed. For example, each task related to state changes in the hardware is pre-marked with the `Alter` annotation. When retrieving the currently executing task of that hardware, if a currently executing task contains the `Alter` annotation, it indicates that the current state of the hardware has changed. Based on this, it is possible to determine whether the current state of the hardware has changed.
[0078] As a preferred embodiment, determining that there is a change in the current state of the hardware includes:
[0079] For any piece of hardware, determine whether the current state of the hardware obtained at the current time is consistent with the current state of the hardware obtained at the last time;
[0080] If they match, then it is determined that the current state of the hardware has not changed;
[0081] If there is a discrepancy, it is determined that the current state of the hardware has changed.
[0082] To determine whether the current state of the hardware has changed, this application addresses the issue that when the current state of the hardware changes, its state after the change differs from its state before the change. Therefore, the change can be determined by comparing the consistency between the two states. If a change is confirmed, a virtual execution environment is used to collect the state information of the hardware whose current state has changed. For example, if a server's on-state is "on," and it is then taken offline, the on-state of the offline server will be "off." It is evident that the current state is "off," while the previously acquired state was "on," thus confirming that the current state of the hardware has changed. Based on this, it is possible to accurately determine whether the current state of the hardware has changed.
[0083] As a preferred embodiment, after collecting the state information of the hardware whose current state has changed using the preset virtual execution environment with the highest first weight value, the method further includes:
[0084] Store status information in a preset directory;
[0085] The third weight value of each status information is determined based on preset keywords. The third weight value is positively correlated with the number of preset keywords contained in the status information.
[0086] The status information is sorted in a preset directory according to the third weight value of each status information.
[0087] To facilitate user viewing and management, this application, after collecting the status information of hardware whose current state has changed, can store the status information as a file in a preset directory, which can be called a status information file. This directory stores the status information of all hardware whose states have changed. Please refer to [reference needed]. Figure 3 , Figure 3The flowchart of another state information acquisition method provided in this application shows that after determining the state changes of various hardware components due to various reasons, the state information is acquired through the corresponding virtual execution environment and finally stored in a preset directory. The preset keyword can be any pre-defined character or word. When a user wants to search for related state information files based on a certain word, the user-input text can be used as a new preset keyword. The more times a state information file contains the preset keyword, the higher its third weight value and the higher its ranking in the directory. This facilitates user viewing of state information files related to the preset keyword during searches, making management easier.
[0088] As a preferred embodiment, the third weight value of each state information is determined based on preset keywords, including:
[0089] Determine the first quantity of status information stored in the preset directory;
[0090] Determine the second quantity of status information containing preset keywords in the preset directory;
[0091] Determine the third number of preset keywords contained in each status message;
[0092] Determine the sum of the first quantity and the second quantity, and the preset value;
[0093] For any given state information, determine the sum of the second quantity between the third quantity and the preset value;
[0094] For any state information, the ratio between the first quantity and the second quantity is determined as the third weight value of the state information.
[0095] To determine the third weight value, this application first determines the total number of status information files stored in the preset directory, the total number of status information files containing at least one preset keyword, and the number of preset keywords contained in each status information file. Based on these three quantities, the third weight value of each status information file can be determined, specifically:
[0096]
[0097] Where W is the third weight value of the status information file, L is the total number of status information files stored in the preset directory (i.e., the first number), M is the total number of status information files containing at least one preset keyword (i.e., the second number), N is the number of preset keywords contained in the status information files (i.e., the third number), and C is a preset constant value such as 0.5. Based on this, the third weight value of each status information file for the preset keyword can be determined.
[0098] As a preferred embodiment, the status information is sorted in a preset directory according to the third weight value of each status information, including:
[0099] Determine the character length of each status message;
[0100] The average character length of the preset directory is determined based on the length of each character.
[0101] Determine the ratio between the character length of each status message and the average character length;
[0102] The status information is sorted in a preset directory based on the third weight value and ratio of each status information.
[0103] To accurately sort the various status information files, this application considers that the file lengths (i.e., character lengths) of the various status information files are different. A longer status information file contains more content and information, thus it is more important. Therefore, the various status information files can be further sorted based on their length and a third weight value. Specifically:
[0104]
[0105] Among them, W i Let L be the third weight value of the i-th status information file in the preset directory, L be the total number of status information files stored in the preset directory (i.e., the first number), File be the character length of the status information file, Afile be the average character length in the preset directory, and S be the sorting result based on each status information file. The size of each status information file is used to sort its location in the preset directory.
[0106] It is evident that the more preset keywords a status information file contains, the earlier it appears in the preset directory. When the number of preset keywords is the same, the longer the character length of the status information file, the earlier it appears in the preset directory. Based on this, it is possible to accurately sort each status information, which facilitates sorting and retrieving large files for the entire lifecycle management of the record server.
[0107] Please refer to Figure 4 , Figure 4 A schematic diagram of a status information acquisition system provided in this application includes:
[0108] The current status acquisition unit 11 is used to execute the acquisition task of the current status of each hardware in the acquisition device in parallel when there is an acquisition task being executed;
[0109] The first weight value determination unit 12 is used to determine the first weight value of each preset virtual execution environment at the current time when it is determined that the current state of the hardware has changed. The value of the first weight value is positively correlated with the idle degree of the preset virtual execution environment and positively correlated with the execution power of the preset virtual execution environment.
[0110] The status information acquisition unit 13 is used to acquire the status information of hardware whose current status has changed using the preset virtual execution environment with the highest first weight value.
[0111] For a detailed description of the status information acquisition system provided in this application, please refer to the above embodiments; further details will not be repeated here.
[0112] Please refer to Figure 5 , Figure 5 A schematic diagram of a status information acquisition device provided in this application includes:
[0113] Memory 21 is used to store computer programs;
[0114] The processor 22 is used to implement the steps of the state information acquisition method described above when executing a computer program.
[0115] For a detailed description of the status information acquisition device provided in this application, please refer to the above embodiments; further details will not be repeated here.
[0116] This application also provides a computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, it implements the steps of the state information acquisition method described above.
[0117] For a detailed description of the computer-readable storage medium provided in this application, please refer to the above embodiments; further details will not be repeated here.
[0118] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.
[0119] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for acquiring status information, characterized in that, include: While a data acquisition task is being executed, tasks to acquire the current state of each piece of hardware in the device are executed in parallel. When it is determined that the current state of the hardware has changed, a first weight value is determined for each preset virtual execution environment at the current time. The value of the first weight value is positively correlated with the idle level of the preset virtual execution environment and positively correlated with the execution power of the preset virtual execution environment. The preset virtual execution environment with the highest first weight value is used to collect the status information of the hardware whose current state has changed; The process includes, after collecting the state information of the hardware whose current state has changed using the preset virtual execution environment with the highest first weight value, the process further includes: Store the status information in a preset directory; A third weight value is determined for each state information based on preset keywords, and the third weight value is positively correlated with the number of preset keywords contained in the state information; The state information is sorted in the preset directory according to the third weight value of each state information; The process of determining the third weight value for each state information based on preset keywords includes: Determine a first quantity of the status information stored in the preset directory; Determine a second quantity of status information containing the preset keyword in the preset directory; Determine the third number of the preset keywords contained in each of the aforementioned status information; Determine the sum of the first quantity and the second quantity, and a preset value; For any of the aforementioned state information, determine the sum of the second quantities between the third quantity and the preset value; For any of the stated state information, the ratio between the first quantity and the second quantity is determined as the third weight value of the state information.
2. The status information acquisition method as described in claim 1, characterized in that, Determine the first weight value of each preset virtual execution environment at the current time, including: Determine the execution capacity of each virtual execution environment and the load of each virtual execution environment at the current time; Determine the amount of data generated by the hardware when it performs a task in which the current state changes; A second weight value is determined for each of the virtual execution environments based on the data volume and the execution power, wherein the second weight value is negatively correlated with the ratio between the data volume and the execution power; The first weight value is determined based on the second weight value and the load of each virtual execution environment, wherein the load is negatively correlated with the first weight value and the second weight value is positively correlated with the first weight value.
3. The status information acquisition method as described in claim 1, characterized in that, Determining that the current state of the hardware has changed includes: Obtain the current execution task of each of the aforementioned hardware components at the current time; Determine whether any of the currently executing tasks are marked by a preset task; If so, it is determined that the current state of the hardware has changed; If not, then it is determined that the current state of the hardware has not changed.
4. The status information acquisition method as described in claim 1, characterized in that, Determining that the current state of the hardware has changed includes: For any of the aforementioned hardware, determine whether the current state of the hardware obtained at the current time is consistent with the current state of the hardware obtained the last time; If they match, then it is determined that the current state of the hardware has not changed; If there is a discrepancy, it is determined that the current state of the hardware has changed.
5. The status information acquisition method as described in claim 1, characterized in that, Sort the state information in the preset directory according to the third weight value of each state information, including: Determine the character length of each of the aforementioned status information; The average character length of the preset directory is determined based on the length of each of the aforementioned characters. Determine the ratio between the character length of each of the stated status information and the average character length; The state information is sorted in the preset directory according to the third weight value and the ratio of each state information.
6. A status information acquisition system, characterized in that, include: The current status acquisition unit is used to execute the acquisition task of the current status of each hardware in the acquisition device in parallel when there is an acquisition task being executed. The first weight value determination unit is used to determine the first weight value of each preset virtual execution environment at the current time when it is determined that the current state of the hardware has changed. The value of the first weight value is positively correlated with the idle degree of the preset virtual execution environment and positively correlated with the execution power of the preset virtual execution environment. The status information acquisition unit is used to acquire the status information of the hardware whose current status has changed using the preset virtual execution environment with the highest first weight value; The status information processing module is used to collect the status information of the hardware whose current status has changed using the preset virtual execution environment with the highest first weight value, and then store the status information in a preset directory. A third weight value is determined for each of the status information items based on preset keywords, and the third weight value is positively correlated with the number of preset keywords contained in the status information item. The status information items are then sorted in a preset directory based on their third weight values. Determining the third weight value for each status information item based on preset keywords includes: determining a first number of status information items stored in the preset directory; determining a second number of status information items in the preset directory containing the preset keywords; determining a third number of preset keywords contained in each status information item; determining a first sum of the difference between the first and second numbers and a preset value; for any given status information item, determining a second sum of the third number and the preset value; and for any given status information item, determining the ratio between the first sum and the second sum as the third weight value for that status information item.
7. A server instance allocation device for application services, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the state information acquisition method as described in any one of claims 1 to 5 when executing the computer program.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the state information acquisition method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Hardware information acquisition method and device, electronic equipment and storage medium
CN112162900A
Data acquisition method and device, equipment and storage medium
CN112905336A