Server scheduling method, system, computer program product, device and medium
By using load balancing scheduling strategies and heartbeat mechanisms, the resource allocation of virtual servers is dynamically managed, solving the problem of low resource utilization of virtual servers and achieving more efficient resource allocation and system stability.
Patent Information
- Application Number
- CN202511485178.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-17
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2045-10-17
AI Technical Summary
In existing technologies, the resource allocation method of virtual servers cannot dynamically perceive the load status, resulting in some node devices accumulating and resources becoming saturated, while other nodes are idle, reducing the overall resource utilization of the system.
A load balancing scheduling strategy is adopted. By obtaining the running status information of virtual servers and the number of virtual devices, a target virtual server is selected based on a scoring mechanism, and its address information is transmitted to the flash translation layer for virtual device application. Resource management is combined with a heartbeat mechanism and a timeout mechanism.
It improves the resource utilization of the flash conversion layer for virtual servers, achieves more efficient resource allocation and system stability, and avoids equipment accumulation and resource waste.
Smart Images

Figure CN120950223B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of solid-state drive technology, and more specifically, to server scheduling methods, systems, computer program products, devices, and media. Background Technology
[0002] With the development of solid-state drive (SSD) technology, functional verification, performance evaluation, and algorithm simulation based on the Flash Translation Layer (FTL) have gradually become integral parts of the research and development of next-generation solid-state storage systems. In a virtualized testing environment, multiple virtual server nodes are typically deployed to simulate multiple virtual devices in parallel, thereby supporting the operation of large-scale FTL simulation and testing tasks.
[0003] Due to the high concurrency and randomness of testing tasks, the creation and destruction of devices exhibit a dense burst pattern in time, placing high demands on the system's resource allocation capabilities, scheduling strategies, and fault handling capabilities. To meet these requirements, static allocation or simple round-robin methods can be used for the deployment and scheduling of virtual devices, i.e., selecting target server nodes sequentially or using an average load approach.
[0004] However, polling scheduling or static mapping cannot dynamically perceive the current load status of each virtual server, which can easily lead to some nodes accumulating devices and saturating resources, while other nodes remain idle, thereby reducing the overall resource utilization of the system.
[0005] In summary, improving the resource utilization of the flash conversion layer for virtual servers is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0006] The purpose of this invention is to provide a server scheduling method that can, to some extent, solve the technical problem of how to improve the resource utilization of the flash memory translation layer for virtual servers. This invention also provides a server scheduling system, an electronic device, and a computer-readable storage medium.
[0007] To achieve the above objectives, in one aspect, the present invention provides a server scheduling method, comprising:
[0008] Get the configured load balancing scheduling policy;
[0009] Determine the running status information of each virtual server;
[0010] Determine the number of virtual devices for each virtual server;
[0011] Based on the operating status information and the number of virtual devices, a target virtual server is selected according to the load balancing scheduling strategy.
[0012] The address information of the target virtual server is transmitted to the flash translation layer so that the flash translation layer performs virtual device application on the target virtual server according to the address information.
[0013] On the other hand, based on the operational status information and the number of virtual devices, the target virtual server is selected according to the load balancing scheduling strategy, including:
[0014] Based on the operating status information and the number of virtual devices, each virtual server is scored according to the load balancing scheduling strategy;
[0015] The target virtual server is selected based on the scores of each virtual server.
[0016] On the other hand, the target virtual server is selected based on the ratings of each virtual server, including:
[0017] The virtual servers are sorted according to their scores from highest to lowest to obtain the sorting results.
[0018] Starting from the head of the sorting results, select a target number of virtual servers as the target virtual servers.
[0019] On the other hand, after selecting the target number of virtual servers as the target virtual servers, starting from the head of the sorting result, the process further includes:
[0020] Determine the number of virtual devices that need to be created by the flash memory conversion layer;
[0021] Based on the rating of the target virtual server and the quantity value, allocate the number of virtual devices to be created for each target virtual server;
[0022] The number of virtual devices created by the target virtual server is transferred to the flash conversion layer.
[0023] On the other hand, based on the rating and quantity value of the target virtual server, the number of virtual devices created for each target virtual server is allocated, including:
[0024] Generate the rating and value of the target virtual server;
[0025] The ratio of the target virtual server's score to the sum of the scores is used as the device creation weight for the target virtual server.
[0026] The number of virtual devices created for the target virtual server is determined based on the product of the device creation weight and the quantity value.
[0027] On the other hand, determining the number of virtual devices that need to be created by the flash conversion layer includes:
[0028] Obtain the virtual device creation request sent by the flash memory conversion layer;
[0029] The virtual device creation request is cached in the ready queue;
[0030] The number of virtual devices to be created is determined based on the virtual device creation requests in the ready queue.
[0031] On the other hand, after transmitting the address information of the target virtual server to the flash translation layer, the process also includes:
[0032] Obtain the virtual device offload request sent by the flash memory conversion layer;
[0033] Determine the target virtual device to be uninstalled in the virtual device uninstallation request;
[0034] Detect the status of the target virtual device;
[0035] If the target virtual device is successfully created, the virtual server is controlled to unload the target virtual device normally.
[0036] If the target virtual device is in a state of creation failure or no response, the control virtual server will unload the virtual device based on the virtual device creation timeout mechanism.
[0037] On the other hand, controlling the virtual server to unload the virtual device based on the virtual device creation timeout mechanism includes:
[0038] The response information sent by the virtual server to the flash conversion layer, representing the creation result of the target virtual device, is intercepted so that the virtual server unloads the target virtual device after a timeout if it does not receive feedback information.
[0039] The feedback information includes the feedback result of the flash memory conversion layer to the response information.
[0040] On the other hand, after transmitting the address information of the target virtual server to the flash translation layer, the process also includes:
[0041] Receive virtual device change information from the target virtual server;
[0042] The number of virtual devices on the target virtual server is updated based on the virtual device change information.
[0043] On the other hand, after transmitting the address information of the target virtual server to the flash translation layer, the process also includes:
[0044] Receive the running status change information of the target virtual server;
[0045] Update the running status information of the target virtual server based on the running status change information.
[0046] On the other hand, it also includes:
[0047] Send heartbeat packets to the virtual server periodically;
[0048] Check if the virtual server sends back an confirmation packet within the set time;
[0049] If the virtual server fails to send back the confirmation packet within the set time, the virtual server is marked as abnormal and prohibited from participating in load balancing scheduling.
[0050] On the other hand, determining the operational status information of each virtual server includes:
[0051] Obtain the node health status, network communication status, processing latency information, and historical load data of each virtual server;
[0052] For each virtual server, the node health status, network communication status, processing latency information, and historical load data of the virtual server are used as the virtual server's running status information.
[0053] Determine the number of virtual devices for each virtual server, including:
[0054] For each virtual server, determine the number of virtual devices that have been created, are being created, and are being unloaded within that virtual server.
[0055] The number of virtual devices created, the number of virtual devices being created, and the number of virtual devices being uninstalled are taken as the number of virtual devices of the virtual server.
[0056] On the one hand, a server scheduling system is provided, including a load balancer controller, which is connected between a flash conversion layer and a virtual server;
[0057] The load balancer controller includes:
[0058] The state storage unit is used to store the running status information of each virtual server;
[0059] The service queue is used to store the number of virtual devices for each virtual server;
[0060] The scheduling engine is used to obtain the configured load balancing scheduling policy; and select the target virtual server based on the running status information and the number of virtual devices according to the load balancing scheduling policy.
[0061] A communication interface is used to transmit the address information of the target virtual server to the flash memory translation layer, so that the flash memory translation layer performs virtual device application on the target virtual server according to the address information.
[0062] On the one hand, a computer program product is provided, including a computer program / instructions that, when executed by a processor, implement the steps of any of the methods described above.
[0063] On the one hand, an electronic device is provided, comprising:
[0064] Memory, used to store computer programs;
[0065] A processor for implementing the steps of any of the methods described above when executing the computer program.
[0066] On one hand, a computer-readable storage medium is provided, wherein a computer program is stored therein, and when executed by a processor, the computer program implements the steps of any of the methods described above.
[0067] This invention provides a server scheduling method, which involves: obtaining a configured load balancing scheduling strategy; determining the operating status information of each virtual server; determining the number of virtual devices on each virtual server; selecting a target virtual server based on the operating status information and the number of virtual devices according to the load balancing scheduling strategy; and transmitting the address information of the target virtual server to a flash memory translation layer so that the flash memory translation layer can apply virtual devices to the target virtual server according to the address information. The beneficial effects of this invention are that it allows for the statistical analysis of the operating status information and the number of virtual devices for each virtual server. Since the operating status information reflects the operating status of the virtual server, and the number of virtual devices reflects the number of virtual devices on the virtual server, and the flash memory translation layer needs to apply the virtual devices on the virtual server, selecting a target virtual server based on the operating status information and the number of virtual devices according to a load balancing scheduling strategy is equivalent to comprehensively considering the operating status and number of virtual devices of all virtual servers to select a load-balanced target virtual server. Compared to sequential or load-based selection of target virtual servers, this method can more evenly select the required target virtual servers. Furthermore, after transmitting the address information of the target virtual server to the flash memory translation layer, the flash memory translation layer can apply the virtual devices to the target virtual server according to the address information, resulting in more efficient resource utilization of the virtual server. The server scheduling system, computer program product, electronic device, and computer-readable storage medium provided by this invention also solve corresponding technical problems. Attached Figure Description
[0068] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0069] Figure 1 A flowchart of a server scheduling method provided in an embodiment of the present invention;
[0070] Figure 2 This is a flowchart of server scheduling based on scoring;
[0071] Figure 3 A flowchart for creating a virtual device;
[0072] Figure 4 Flowchart of server scheduling for virtual device unloading;
[0073] Figure 5 A flowchart for unloading a virtual device;
[0074] Figure 6 A flowchart for updating virtual server information;
[0075] Figure 7 This is a flowchart of server scheduling based on a heartbeat mechanism;
[0076] Figure 8 This is a schematic diagram of the structure of a server scheduling system provided in an embodiment of the present invention;
[0077] Figure 9 This is a schematic diagram of the load balancer controller.
[0078] Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention;
[0079] Figure 11 This is another structural schematic diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0080] 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, and 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.
[0081] With the development of solid-state storage technology, functional verification, performance evaluation, and algorithm simulation based on Flash Translation Layer (FTL) have gradually become integral parts of the research and development of next-generation solid-state storage systems. In a virtualized testing environment, multiple virtual server nodes are typically deployed to simulate multiple virtual devices in parallel, thereby supporting the operation of large-scale FTL simulation and testing tasks.
[0082] In such simulation platforms, each virtual server node can host several virtual devices and receive device creation and unloading requests from the upper-layer FTL module. Due to the high concurrency and randomness of the test tasks, device creation and destruction exhibit a dense burst characteristic in time, placing high demands on the system's resource allocation capabilities, scheduling strategies, and fault handling capabilities. As the simulation scale expands, dozens or even hundreds of virtual devices may be created or unloaded simultaneously in a short period of time. The system must possess an efficient and reliable resource management mechanism to ensure the accuracy of the simulation tasks and the overall stability of the system.
[0083] Each virtual server can host multiple virtual devices, thus supporting larger-scale, higher-concurrency FTL simulation tasks. However, as the simulation scales up, the large-scale creation or destruction of devices can easily lead to uneven distribution of virtual server resources. Some servers may experience a backlog of device creation tasks and saturation of processing capacity, while other servers may have idle resources that are not being effectively utilized. This uneven resource usage can lead to a series of problems such as decreased system performance, increased task response latency, and even simulation data errors, seriously affecting the accuracy and stability of the testing system.
[0084] Existing virtual storage simulation systems generally employ static allocation or simple round-robin methods for deploying and scheduling virtual devices. This means that when a device creation request is initiated, the target server node is selected sequentially or using a load-average approach. However, round-robin scheduling or static mapping cannot dynamically perceive the current load status of each virtual server, easily leading to device accumulation and resource saturation on some nodes, while other nodes remain idle, thus reducing the overall system resource utilization. The server scheduling scheme provided by this invention can improve the resource utilization of the flash memory conversion layer for virtual servers.
[0085] Please see Figure 1 , Figure 1 A flowchart of a server scheduling method provided in an embodiment of the present invention.
[0086] An embodiment of the present invention provides a server scheduling method, which may include the following steps:
[0087] Step S101: Obtain the configured load balancing scheduling policy.
[0088] In practical applications, when using virtual devices on virtual servers in a flash memory conversion layer, the requirements for virtual devices vary depending on the application method. Therefore, it's necessary to use appropriate load balancing scheduling strategies to select the appropriate virtual server. This requires obtaining the configured load balancing scheduling strategy. Both the virtual server and the virtual device reside on a solid-state drive (SSD).
[0089] It should be noted that the type of load balancing scheduling strategy can be flexibly determined according to the application scenario. For example, the load balancing scheduling strategy can be a strategy that prioritizes the fewest number of virtual devices, a strategy that weights scheduling based on resource utilization, or a strategy that prioritizes the least resource load combined with a health status filtering strategy. Of course, the load balancing scheduling strategy can also be flexibly configured by the user according to business needs.
[0090] Step S102: Determine the running status information of each virtual server.
[0091] Step S103: Determine the number of virtual devices for each virtual server.
[0092] In practical applications, since the operating status of a virtual server reflects its resource usage, and virtual devices are deployed on the virtual server, these devices consume the server's resources. Therefore, the number of virtual devices also reflects the virtual server's resource usage. Load balancing requires balancing the resource usage among virtual servers. Thus, we can determine the operating status information of each virtual server and the number of virtual devices on each virtual server, so that we can perform load balancing on the virtual servers based on the operating status information and the number of virtual devices.
[0093] In the exemplary embodiment, the running status information of the virtual server and the number of virtual devices can be flexibly determined according to application requirements. For example, in determining the running status information of each virtual server, the node health status, network communication status, processing latency information, and historical load data of each virtual server can be obtained. For each virtual server, the node health status, network communication status, processing latency information, and historical load data are used as the running status information of the virtual server. In determining the number of virtual devices of each virtual server, for each virtual server, the number of virtual devices created, the number being created, and the number being unloaded in the virtual server are determined, and the number of created, the number being created, and the number being unloaded are used as the number of virtual devices of the virtual server.
[0094] Step S104: Based on the running status information and the number of virtual devices, select the target virtual server according to the load balancing scheduling strategy.
[0095] In practical applications, after determining the load balancing strategy, runtime status information, and the number of virtual devices, a target virtual server can be selected based on the runtime status information and the number of virtual devices, according to the load balancing scheduling strategy. The number of target virtual servers can be one or more. For example, under a "fewest devices first" load balancing strategy, the virtual server with the fewest currently running virtual devices can be selected as the target virtual server. Under a "resource utilization weighted scheduling" load balancing strategy, indicators such as CPU utilization, memory usage, and virtual device load can be comprehensively considered to prioritize virtual servers, and then the target virtual server is selected based on the ranking result.
[0096] Step S105: Transmit the address information of the target virtual server to the flash translation layer so that the flash translation layer can apply virtual devices to the target virtual server according to the address information.
[0097] In practical applications, after selecting a target virtual server, the address information of the target virtual server can be transmitted to the flash translation layer. In this way, the flash translation layer can communicate with the target virtual server according to the address information, thereby managing the virtual devices on the target virtual server. For example, virtual devices can be created on the target virtual server for application, and virtual devices can be uninstalled after application.
[0098] It should be noted that the types of virtual servers and virtual devices in this invention can be determined based on the interface between the flash conversion layer and the virtual server. For example, the virtual server can be a virtual NVMe (Non-Volatile Memory Express) server, and the virtual device can be a virtual NVMe device; for example, the virtual server can be a virtual SCSI (Small Computer System Interface) server, and the virtual device can be a virtual SCSI device; for example, the virtual server can be a virtual SATA (Serial Advanced Technology Attachment) server, and the virtual device can be a virtual SATA device; and for example, the virtual server can be a virtual UFS (Universal Flash Storage) server, and the virtual device can be a virtual UFS device, etc.
[0099] This invention provides a server scheduling method, which involves: obtaining a configured load balancing scheduling strategy; determining the operating status information of each virtual server; determining the number of virtual devices on each virtual server; selecting a target virtual server based on the operating status information and the number of virtual devices according to the load balancing scheduling strategy; and transmitting the address information of the target virtual server to a flash memory translation layer so that the flash memory translation layer can apply virtual devices to the target virtual server according to the address information. In this invention, the operating status information and the number of virtual devices of each virtual server can be statistically analyzed. Since the operating status information of the virtual server reflects its operating status, and the number of virtual devices reflects the number of virtual devices on the virtual server, and the flash conversion layer needs to apply the virtual devices on the virtual server, selecting the target virtual server based on the operating status information and the number of virtual devices according to the load balancing scheduling strategy is equivalent to comprehensively considering the operating status and the number of virtual devices of all virtual servers to select the target virtual server with load balancing. Compared with the method of selecting target virtual servers in sequence or solely based on load, the required target virtual server can be selected more evenly. After the address information of the target virtual server is transmitted to the flash conversion layer, the flash conversion layer can apply the virtual devices to the target virtual server according to the address information, thus enabling more efficient utilization of virtual server resources.
[0100] Building upon the above embodiments, when there is a large amount of runtime status information and virtual device quantity data, selecting a suitable target virtual server based on a load balancing strategy becomes a problem that needs to be solved. For this purpose, please refer to... Figure 2 The server scheduling method provided in this embodiment of the invention may include the following steps:
[0101] Step S201: Obtain the configured load balancing scheduling policy.
[0102] Step S202: Determine the running status information of each virtual server.
[0103] Step S203: Determine the number of virtual devices for each virtual server.
[0104] Step S204: Based on the running status information and the number of virtual devices, score each virtual server according to the load balancing scheduling strategy.
[0105] Step S205: Select the target virtual server based on the scores of each virtual server.
[0106] In an exemplary embodiment, during the process of selecting a target virtual server based on the running status information and the number of virtual devices according to the load balancing scheduling strategy, each virtual server can be scored according to the running status information and the number of virtual devices, so as to convert the running status information and the number of virtual devices of the virtual server into a unified score according to the load balancing scheduling strategy, and then the target virtual server can be selected directly based on the score of each virtual server.
[0107] In specific application scenarios, when scoring each virtual server based on its running status information and the number of virtual devices according to a load balancing scheduling strategy, the required target information can be selected from the running status information and the number of virtual devices according to the load balancing scheduling strategy. Then, the standard value and standard score of the target information are determined. The standard score is adjusted according to the difference between the target information and the standard value to obtain the actual score corresponding to the target information. Finally, all actual scores are weighted and averaged to obtain the score of the virtual server. The weight of the actual score is consistent with the degree of impact of the target information on the resource performance of the virtual server. In this way, the target information is first selected from the running status information and the number of virtual devices according to the load balancing scheduling strategy, excluding other information unrelated to the load balancing scheduling strategy from participating in the virtual server scoring. This ensures that the generated score is compatible with the load balancing scheduling strategy. Furthermore, considering the differences between various types of information, direct scoring is not suitable. Therefore, the standard value and standard score of the target information are first determined. Then, the standard score is adjusted according to the difference between the target information and the standard value to obtain the actual score corresponding to the target information. This achieves the determination of the actual score of the target information based on its own characteristics, ensuring the adaptability of the actual score to the target information. This allows the actual score to accurately reflect the resource performance corresponding to the target information in the virtual server. Finally, the weighted average of all actual scores is used to obtain the score of the virtual server. This is equivalent to scoring according to the degree of influence of various types of target information on the resource performance of the virtual server. This allows the generated virtual server score to accurately reflect the resource performance of the virtual server, thereby enabling accurate load balancing of the virtual server.
[0108] In specific application scenarios, considering that if the flash conversion layer creates multiple virtual devices at once, and all virtual devices reside on a single virtual server, the load on that single virtual server will increase significantly, which is detrimental to load balancing. Therefore, in the process of selecting target virtual servers based on the scores of each virtual server, the virtual servers can be sorted in descending order of score to obtain a sorting result. Starting from the head of the sorting result, a target number of virtual servers are selected as target virtual servers. The target number can be determined based on the number of virtual devices that the flash conversion layer needs to create. Correspondingly, in order to evenly distribute the required virtual devices to all target virtual servers, after selecting the target number of virtual servers starting from the head of the sorting result, the number of virtual devices that the flash conversion layer needs to create can also be determined. Based on the score and number of target virtual servers, the number of virtual devices to be created for each target virtual server is allocated. The number of virtual devices to be created for each target virtual server is then transmitted to the flash conversion layer so that the flash conversion layer can create the corresponding number of virtual devices on each target virtual server according to the number of virtual devices to be created for each target virtual server.
[0109] In specific application scenarios, during the process of allocating the number of virtual devices to be created for each target virtual server based on its rating and quantity value, the rating and value of the target virtual server can be generated; the ratio of the rating of the target virtual server to the rating and value can be used as the device creation weight of the target virtual server; and the number of virtual devices to be created for the target virtual server can be determined based on the product of the device creation weight and the quantity value, for example, by rounding the product value to obtain the number of virtual devices to be created for the target virtual server.
[0110] In specific application scenarios, when determining the number of virtual devices to be created by the flash conversion layer, virtual device creation requests sent by the flash conversion layer can be obtained. These virtual device creation requests can be those sent by the flash conversion layer when a test task requires the construction of a new storage mapping relationship. The virtual device creation requests are then cached in a ready queue. Based on the virtual device creation requests in the ready queue, the number of virtual devices to be created can be determined. For example, after deduplicating the virtual device creation requests in the ready queue, the number of virtual devices to be created can be determined based on the remaining requests. Alternatively, the virtual device creation requests in the ready queue can be sorted, and the sorted virtual device creation requests can be captured according to a set time window. The number of virtual devices to be created can then be determined based on the captured virtual device creation requests.
[0111] Step S206: Transmit the address information of the target virtual server to the flash translation layer so that the flash translation layer can apply virtual devices to the target virtual server according to the address information.
[0112] It should be noted that during the process of creating a virtual device in the target virtual server, the flash translation layer can establish a communication channel with the target virtual server according to the address information and send a creation command to the target virtual server through the communication channel. After receiving the creation command, the target virtual server starts a phased device construction process. First, it creates a virtual PCI (Peripheral Component Interconnect) device to build the hardware interface virtualization environment of the device. Then, it creates the virtual device, that is, it loads the protocol layer and control module based on the former to complete the construction of the logical device. After the virtual device is successfully created, the target virtual server sends a "device created" notification to the flash translation layer. Subsequently, the flash translation layer registers the device information and initializes the device status. Finally, it confirms that the device has been "created successfully," marking the completion of the loading process. This process is as follows: Figure 3 As shown.
[0113] As can be seen from the implementation process, in the process of selecting target virtual servers based on operating status information and the number of virtual devices according to the load balancing scheduling strategy, this invention scores each virtual server based on the operating status information and the number of virtual devices according to the load balancing scheduling strategy. This realizes that the operating status information and the number of virtual devices required for scheduling virtual servers are converted into a unified score according to the load balancing scheduling strategy, and then the target virtual server can be selected directly based on the score of each virtual server, thereby improving the selection efficiency of target virtual servers.
[0114] Based on the above embodiments, the flash conversion layer can also unload virtual devices that have been applied in the virtual server as needed. During this process, to avoid intermediate states such as "partial creation" or "fake unloading" of virtual devices, which could lead to resource leaks, device failures, or data conflicts, please refer to [link to relevant documentation]. Figure 4 The server scheduling method provided in this embodiment of the invention may include the following steps:
[0115] Step S401: Obtain the configured load balancing scheduling policy.
[0116] Step S402: Determine the running status information of each virtual server.
[0117] Step S403: Determine the number of virtual devices for each virtual server.
[0118] Step S404: Based on the running status information and the number of virtual devices, select the target virtual server according to the load balancing scheduling strategy.
[0119] Step S405: Transmit the address information of the target virtual server to the flash translation layer so that the flash translation layer can apply virtual devices to the target virtual server according to the address information.
[0120] Step S406: Obtain the virtual device offload request sent by the flash conversion layer.
[0121] Step S407: Determine the target virtual device to be uninstalled in the virtual device uninstallation request.
[0122] Step S408: Detect the status of the target virtual device.
[0123] Step S409: In response to the target virtual device's status being "created successfully," the control virtual server normally unloads the target virtual device.
[0124] Step S410: In response to the target virtual device's status being creation failure or no response, the control virtual server unloads the virtual device based on the virtual device creation timeout mechanism.
[0125] In an exemplary embodiment, after transmitting the address information of the target virtual server to the flash translation layer, if it is necessary to unload the virtual device, the unloading method can be determined based on the status of the virtual device to ensure that the virtual server accurately unloads the virtual device. Specifically, this involves obtaining the virtual device unloading request sent by the flash translation layer. This request can be generated by the flash translation layer when the simulation task ends or system resources are released. The system then determines the target virtual device to be unloaded and detects its status. If the target virtual device is successfully created, the system controls the virtual server to unload the target virtual device normally. If the target virtual device is unsuccessfully created or not responding, the system controls the virtual server to unload the virtual device based on the virtual device creation timeout mechanism. "Not responding" could mean the target virtual device is still being created or the virtual device creation command has not been completed.
[0126] In specific application scenarios, during the process of controlling the virtual server to unload the virtual device based on the virtual device creation timeout mechanism, the response information sent by the virtual server to the flash conversion layer, which represents the creation result of the target virtual device, can be intercepted, so that the virtual server unloads the target virtual device after the timeout period if it does not receive the feedback information; wherein, the feedback information includes the feedback result of the flash conversion layer on the response information.
[0127] It should be noted that during the normal unloading of the target virtual device by the virtual server, upon receiving the unloading command, the virtual server will release resources in an orderly manner, terminate background simulation threads, unload the virtual device driver, and reclaim PCI space. During the unloading process based on the virtual device creation timeout mechanism, the virtual server must wait for incomplete virtual device creation commands to time out to ensure that unprocessed commands do not cause further blocking; the virtual server kernel will set the virtual PCI status to an unavailable state, such as "dead," to mark the target virtual device as a faulty device; the target virtual device unloading operation will then be executed, completing the reclamation of the target virtual device and releasing its resources. The virtual device unloading process is as follows: Figure 5 As shown.
[0128] As can be seen from the implementation process, after the address information of the target virtual server is transmitted to the flash memory translation layer, if it is necessary to unload the virtual device, the present invention can obtain the virtual device unloading request sent by the flash memory translation layer; determine the target virtual device to be unloaded in the virtual device unloading request; detect the status of the target virtual device; if the status of the target virtual device is successful creation, the virtual server is controlled to unload the target virtual device normally; if the status of the target virtual device is creation failure or no response, the virtual server is controlled to unload the virtual device based on the virtual device creation timeout mechanism. This achieves the control of the virtual server to unload the target virtual device normally based on its creation success status, or to control the virtual server to unload the virtual device based on the virtual device creation timeout mechanism, effectively avoiding the residual state of "dirty devices" and helping to prevent identification confusion or resource occupation conflicts in subsequent scheduling processes.
[0129] Based on the above embodiments, if the flash memory translation layer manages the virtual devices on the virtual server, such as creating a new virtual device or uninstalling a virtual device, the number and operating status information of the virtual devices on the virtual server will change, which will affect the subsequent scheduling of the virtual server. Therefore, please refer to [link to relevant documentation]. Figure 6 The server scheduling method provided in this embodiment of the invention may include the following steps:
[0130] Step S601: Obtain the configured load balancing scheduling policy.
[0131] Step S602: Determine the running status information of each virtual server.
[0132] Step S603: Determine the number of virtual devices for each virtual server.
[0133] Step S604: Based on the running status information and the number of virtual devices, select the target virtual server according to the load balancing scheduling strategy.
[0134] Step S605: Transmit the address information of the target virtual server to the flash translation layer so that the flash translation layer can apply virtual devices to the target virtual server according to the address information.
[0135] Step S606: Receive virtual device change information from the target virtual server.
[0136] Step S607: Update the number of virtual devices on the target virtual server based on the virtual device change information.
[0137] Step S608: Receive the running status change information of the target virtual server.
[0138] Step S609: Update the running status information of the target virtual server based on the running status change information.
[0139] In other words, in the exemplary embodiment, after transmitting the address information of the target virtual server to the flash translation layer, it can also receive virtual device change information of the target virtual server; based on the virtual device change information, the number of virtual devices of the target virtual server is updated, for example, when the virtual device change information indicates the creation of a new virtual device, the number of created devices and the number of devices being created in the virtual device count are updated accordingly. It also receives running status change information of the target virtual server; based on the running status change information, the running status information of the target virtual server is updated. This ensures that the running status information of the virtual server and the number of virtual devices are up-to-date, facilitating accurate scheduling of the virtual server in the next iteration.
[0140] Based on the above embodiments, if a virtual server malfunctions, scheduling the faulty virtual server to the flash translation layer for application processing would affect the processing progress of the flash translation layer. To avoid this situation, please refer to [link to relevant documentation]. Figure 7 The server scheduling method provided in this embodiment of the invention may include the following steps:
[0141] Step S701: Obtain the configured load balancing scheduling policy.
[0142] Step S702: Determine the running status information of each virtual server.
[0143] Step S703: Determine the number of virtual devices for each virtual server.
[0144] Step S704: Based on the running status information and the number of virtual devices, select the target virtual server according to the load balancing scheduling strategy.
[0145] Step S705: Transmit the address information of the target virtual server to the flash translation layer so that the flash translation layer can apply virtual devices to the target virtual server according to the address information.
[0146] Step S706: Periodically send heartbeat packets to the virtual server.
[0147] Step S707: Check whether the virtual server sends back an acknowledgment packet within the set time.
[0148] Step S708: If the virtual server does not send back an acknowledgment packet within a set time, the virtual server is marked as abnormal and the abnormal virtual server is prohibited from participating in load balancing scheduling.
[0149] In other words, in the exemplary embodiment, heartbeat packets can be sent to the virtual server periodically; it can also detect whether the virtual server sends back an acknowledgment packet within a set time; if the virtual server does not send back an acknowledgment packet within the set time, the virtual server is marked as abnormal and prohibited from participating in load balancing scheduling. In this way, fault identification and scheduling isolation of virtual servers can be performed based on the heartbeat mechanism, which can avoid problems such as scheduling errors, system crashes, or emulation interruptions caused by scheduling faulty virtual servers to the flash conversion layer.
[0150] Please see Figure 8 , Figure 8 This is a schematic diagram of a server scheduling system provided in an embodiment of the present invention.
[0151] An embodiment of the present invention provides a server scheduling system, which may include a load balancer controller connected between a flash conversion layer and a virtual server, such as... Figure 9 As shown;
[0152] The load balancer controller includes:
[0153] The state storage unit is used to store the running status information of each virtual server;
[0154] The service queue is used to store the number of virtual devices for each virtual server;
[0155] The scheduling engine is used to obtain the configured load balancing scheduling policy; based on the running status information and the number of virtual devices, it selects the target virtual server according to the load balancing scheduling policy.
[0156] The communication interface is used to transmit the address information of the target virtual server to the flash translation layer, so that the flash translation layer can apply virtual devices to the target virtual server according to the address information.
[0157] In addition, the load balancing controller of the present invention may also include service queues, etc. The corresponding functional descriptions of the load balancing controller can be found in the above embodiments and will not be repeated here. Through the coordinated operation of the above modules, the present invention achieves intelligent virtual device creation and scheduling, dynamic balanced allocation of system resources, and real-time perception and fault-tolerant control of virtual server status, greatly improving the management automation level and operating efficiency of the FTL simulation system. It is suitable for scenarios such as large-scale storage simulation test platforms and virtual storage resource scheduling in cloud infrastructure environments.
[0158] In an exemplary embodiment, the communication interface module serves as the information channel between the load balancer controller and external entities, including the FTL emulation module and virtual servers. This module supports a bidirectional communication mechanism, receiving heartbeat packets and status update notifications from the virtual server on one hand, and returning server address information to the FTL emulation module on the other to establish a communication connection. Furthermore, this module supports service discovery protocols, status broadcasting, and node synchronization mechanisms to ensure consistent state across all parts of the system and high availability.
[0159] To facilitate understanding of the server scheduling scheme provided by this invention, the scheme is now described in conjunction with the process of creating and unloading virtual devices in the flash conversion layer. It is assumed that the system has three virtual server nodes, namely Node A, Node B and Node C, and each virtual server can support several virtual devices.
[0160] Assuming the FTL module needs to initiate a request to create 10 virtual devices simultaneously, it can include the following steps:
[0161] The FTL module places the 10 virtual device creation requests into the load balancer's ready queue (RequestQueue) one by one. Request Queue: [Req_1, Req_2, Req_3, ..., Req_10]. Each request can contain the following information: request ID, FTL instance identifier, creation timestamp, etc.
[0162] The Scheduler Engine reads records from the Service Table showing the number of currently running devices, the number of devices being loaded, and the number of devices being unloaded for each node. For example, Node A: 3 devices, 0 devices, 0 devices; Node B: 2 devices, 0 devices, 0 devices; Node C: 1 device, 0 devices, 0 devices.
[0163] The scheduling engine reads the resource health status of the evaluation nodes from the State Store, for example: Node A: CPU 70%, MEM 80%, NET OK; Node B: CPU 30%, MEM 50%, NET OK; Node C: CPU 15%, MEM 40%, NET OK.
[0164] Assuming the load balancing scheduling strategy adopted is "least resource load priority + health status screening" strategy, and the number of devices loading and unloading is 0, the scheduling engine scores each virtual server as follows: Node A: score = 60; Node B: score = 85; Node C: score = 95;
[0165] The scheduling engine distributes the 10 requests to three virtual servers based on their scores. For example, Node C is assigned Req_1~Req_4; Node B is assigned Req_5~Req_8; and Node A is assigned Req_9~Req10. In each allocation process, the virtual server address is fed back to the FTL module through the communication interface to establish peer-to-peer communication.
[0166] Upon receiving a request, each virtual server node completes device construction according to the following process: creating a virtual PCI device and loading the virtual protocol stack; starting a background service thread; and sending a "creation complete" message to FTL.
[0167] After receiving confirmation of virtual device online status, the load balancer controller automatically synchronizes the device status to the service queue and status storage unit, updating as follows: Node C: 5 devices (originally 1+4); Node B: 6 devices (originally 2+4); Node A: 5 devices (originally 3+2).
[0168] Assuming the task is completed, the FTL module initiates an unload request, specifying a list of device IDs to be unloaded: [Dev_1, Dev_2, ..., Dev_10], and puts these requests into the ready queue, waiting for the load balancer controller to schedule and process them;
[0169] The scheduling engine checks the status of each target virtual device to be unloaded to confirm whether it is running normally: if the status is "creation successful", it is marked as normal unloading; if the status is "creation failed" or "no response", it is transferred to the abnormal process; assuming Dev_4 is abnormal, it enters the "failed creation unloading" process, while Dev_1~Dev_3 and Dev_5~Dev_10 enter the normal unloading process.
[0170] The virtual server executes the device destruction process. For normal target virtual devices, it releases resources, such as releasing IO threads, caches, queues, etc., unloads the PCI driver, sends an "unloading complete" notification to the controller, and updates the status module: Node C: 5→1 device, Node B: 6→2 devices, Node A: 5→3 devices.
[0171] For abnormal target virtual devices, the virtual server waits for IO commands for a timeout, marks the target virtual device status as "dead", forcibly reclaims resources, and the load balancer controller synchronously clears the status mark to prevent resource leakage;
[0172] The load balancer controller completes state recycling and cleanup: After all target virtual devices are unloaded, the state storage module clears the corresponding device records, and the service queue updates the idle status to automatically carry out the next round of virtual device allocation and scheduling.
[0173] This invention also provides an electronic device and a computer-readable storage medium, both of which have the corresponding effects of the server scheduling method provided in the embodiments of this invention. Please refer to [link / reference]. Figure 10 , Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention.
[0174] An electronic device provided by an embodiment of the present invention includes a memory 201 and a processor 202. The memory 201 stores a computer program, and the processor 202 executes the computer program to implement the steps of the server scheduling method described in any of the above embodiments.
[0175] Please see Figure 11 Another electronic device provided in this embodiment of the invention may further include: an input port 203 connected to the processor 202 for transmitting commands input from the outside to the processor 202; a display unit 204 connected to the processor 202 for displaying the processing results of the processor 202 to the outside; and a communication module 205 connected to the processor 202 for enabling communication between the electronic device and the outside. The display unit 204 may be a display panel, a laser scanner, or the like; the communication method used by the communication module 205 includes, but is not limited to, Mobile High-Definition Link (MHL), Universal Serial Bus (USB), High-Definition Multimedia Interface (HDMI), wireless connectivity: Wireless Fidelity (WiFi), Bluetooth communication technology, Bluetooth Low Energy communication technology, and communication technology based on IEEE 802.11s.
[0176] The present invention provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the server scheduling method described in any of the above embodiments.
[0177] The computer-readable storage media involved in this invention include random access memory (RAM), memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disks, removable disks, CD-ROMs (compact disc read-only memory), or any other form of storage media known in the art.
[0178] The present invention provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the server scheduling method described in any of the above embodiments.
[0179] For descriptions of relevant parts of the server scheduling system, electronic device, computer program product, and computer-readable storage medium provided in this embodiment of the invention, please refer to the detailed description of the corresponding parts in the server scheduling method provided in this embodiment of the invention, which will not be repeated here. Furthermore, parts of the technical solutions provided in this embodiment of the invention that are consistent with the implementation principles of corresponding technical solutions in the prior art have not been described in detail to avoid excessive elaboration.
[0180] It should also be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0181] 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 server scheduling method, characterized in that, include: Get the configured load balancing scheduling policy; Determine the running status information of each virtual server, including node health status, network communication status, processing latency information, and historical load data; Determine the number of virtual devices for each virtual server. The number of virtual devices includes the number that have been created, the number that are being created, and the number that are being unloaded. Based on the operating status information and the number of virtual devices, a target virtual server is selected according to the load balancing scheduling strategy. The address information of the target virtual server is transmitted to the flash translation layer so that the flash translation layer performs virtual device application on the target virtual server according to the address information; Obtain the virtual device offload request sent by the flash memory conversion layer; Determine the target virtual device to be uninstalled in the virtual device uninstallation request; Detect the status of the target virtual device; In response to the target virtual device's status being creation failure or no response, the response information representing the target virtual device creation result sent by the virtual server to the flash conversion layer is intercepted, so that the virtual server unloads the target virtual device after a timeout if it does not receive feedback information; wherein, the feedback information includes the flash conversion layer's feedback result on the response information; The process of selecting a target virtual server based on the operational status information and the number of virtual devices, according to the load balancing scheduling strategy, includes: Select the required target information from the running status information and the number of virtual devices according to the load balancing scheduling strategy; Determine the standard values and standard scores for the target information; The standard score is adjusted based on the difference between the target information and the standard value to obtain the actual score corresponding to the target information; The score of the virtual server is obtained by taking a weighted average of all actual scores. The weight of the actual scores is consistent with the degree of impact of the target information on the resource performance of the virtual server. The target virtual server is selected based on the scores of each virtual server.
2. The server scheduling method according to claim 1, characterized in that, The target virtual server is selected based on the ratings of each virtual server, including: The virtual servers are sorted according to their scores from highest to lowest to obtain the sorting results. Starting from the head of the sorting results, select a target number of virtual servers as the target virtual servers.
3. The server scheduling method according to claim 2, characterized in that, Starting from the head of the sorting results, after selecting the target number of virtual servers as the target virtual servers, the process further includes: Determine the number of virtual devices that need to be created by the flash memory conversion layer; Based on the rating of the target virtual server and the quantity value, allocate the number of virtual devices to be created for each target virtual server; The number of virtual devices created by the target virtual server is transferred to the flash conversion layer.
4. The server scheduling method according to claim 3, characterized in that, Based on the rating and quantity value of the target virtual server, the number of virtual devices to be created for each target virtual server is allocated, including: Generate the rating and value of the target virtual server; The ratio of the target virtual server's score to the sum of the scores is used as the device creation weight for the target virtual server. The number of virtual devices created for the target virtual server is determined based on the product of the device creation weight and the quantity value.
5. The server scheduling method according to claim 3, characterized in that, Determining the number of virtual devices required to be created by the flash translation layer includes: Obtain the virtual device creation request sent by the flash memory conversion layer; The virtual device creation request is cached in the ready queue; The number of virtual devices to be created is determined based on the virtual device creation requests in the ready queue.
6. The server scheduling method according to claim 1, characterized in that, After detecting the status of the target virtual device, the method further includes: If the target virtual device is successfully created, the virtual server will unload the target virtual device normally.
7. The server scheduling method according to any one of claims 1 to 6, characterized in that, After transmitting the address information of the target virtual server to the flash translation layer, the process also includes: Receive virtual device change information from the target virtual server; The number of virtual devices on the target virtual server is updated based on the virtual device change information.
8. The server scheduling method according to claim 7, characterized in that, After transmitting the address information of the target virtual server to the flash translation layer, the process further includes: Receive the running status change information of the target virtual server; Update the running status information of the target virtual server based on the running status change information.
9. The server scheduling method according to claim 1, characterized in that, Also includes: Send heartbeat packets to the virtual server periodically; Check if the virtual server sends back an confirmation packet within the set time; If the virtual server fails to send back the confirmation packet within the set time, the virtual server is marked as abnormal and prohibited from participating in load balancing scheduling.
10. A server scheduling system, characterized in that, Includes a load balancer controller, which is connected between the flash conversion layer and the virtual server; The load balancer controller includes: The state storage unit is used to store the running status information of each virtual server, including node health status, network communication status, processing latency information, and historical load data. The service queue is used to store the number of virtual devices for each virtual server. The number of virtual devices includes the number of virtual devices that have been created, the number that are being created, and the number that are being unloaded. The scheduling engine is used to obtain the configured load balancing scheduling policy; and select the target virtual server based on the running status information and the number of virtual devices according to the load balancing scheduling policy. A communication interface is used to transmit the address information of the target virtual server to the flash memory translation layer, so that the flash memory translation layer performs virtual device application on the target virtual server according to the address information; The scheduling engine is configured to: acquire a virtual device unloading request sent by the flash conversion layer; determine the target virtual device to be unloaded by the virtual device unloading request; detect the status of the target virtual device; and, in response to the status of the target virtual device being creation failure or no response, intercept the response information sent by the virtual server to the flash conversion layer representing the creation result of the target virtual device, so that the virtual server unloads the target virtual device after a timeout if it does not receive feedback information; wherein the feedback information includes the feedback result of the flash conversion layer to the response information; The scheduling engine is used to: select the target information to be referenced from the running status information and the number of virtual devices according to the load balancing scheduling strategy; determine the standard value and standard score of the target information; adjust the standard score according to the difference between the target information and the standard value to obtain the actual score corresponding to the target information; calculate a weighted average of all actual scores to obtain the score of the virtual server, with the weight of the actual score consistent with the degree of impact of the target information on the resource performance of the virtual server; and select the target virtual server based on the scores of each virtual server.
11. A computer program product, comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method as described in any one of claims 1 to 9.
12. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the method as claimed in any one of claims 1 to 9.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method as described in any one of claims 1 to 9.
Citation Information
Patent Citations
Cloud computing virtualized server cluster load balancing system and method
CN105187531A