Load balancing method and device, equipment and storage medium
By statistically analyzing the processing time and resource load of each processing unit in the solid-state drive based on non-linear relationships, and dynamically allocating input and output commands, the problem of load imbalance is solved, CPU utilization and NAND wear leveling are improved, and the system is adapted to complex application scenarios.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
- Filing Date
- 2026-01-30
- Publication Date
- 2026-05-12
AI Technical Summary
Existing solid-state drives (SSDs) suffer from uneven load distribution during multi-core collaborative processing, leading to low CPU computing resource utilization, reduced performance, and uneven NAND wear. This is particularly problematic in complex application scenarios such as AI training and financial trading systems.
By statistically analyzing the processing time of each processing unit based on nonlinear relationships, and combining cache resources and logical address resources, the target unit is dynamically determined for input and output command allocation, thereby achieving load balancing.
It improves the overall performance of solid-state drives, reduces the latency of input/output commands, reduces flash memory wear dispersion, and adapts to complex application scenarios.
Smart Images

Figure CN122018806A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a load balancing method, apparatus, device, and storage medium. Background Technology
[0002] Applications such as AI (Artificial Intelligence) training and data centers place high demands on the performance of SSDs (Solid State Disks) under various I / O (Input / Output) scenarios. The function of an SSD is to read and write data. In complex application scenarios involving multi-core collaborative processing, an imbalance in load distribution among different cores can lead to low CPU (Central Processing Unit) computing resource utilization, performance degradation, and uneven NAND (Nearest Disk) wear. In current enterprise-level data center SSD architectures, firmware schedulers typically employ static sharding or round-robin scheduling strategies for multi-core task allocation. These methods suffer from two technical bottlenecks: first, a lack of awareness of the computing resource load of each CPU core; and second, a lack of awareness of the specific resource load associated with each CPU core. This rigid scheduling mechanism is prone to causing computational peak conflicts between processor cores when dealing with mixed read / write storms in AI training or high-frequency small data packet scenarios in financial trading systems, resulting in decreased link bandwidth utilization and uneven NAND wear.
[0003] It is evident that how to balance the load on the microprocessor core in a solid-state drive to cope with complex application scenarios is a problem that needs to be solved by those skilled in the art. Summary of the Invention
[0004] The purpose of this invention is to provide a load balancing method, apparatus, device, and storage medium that can solve the problem that the microprocessor core in a solid-state drive is unable to cope with the load pressure in complex application scenarios.
[0005] To address the aforementioned technical problems, in a first aspect, embodiments of the present invention provide a load balancing method applied to solid-state drives in enterprise-level data centers, comprising: The processing time required by each processing unit to process the current input / output command is statistically calculated based on a nonlinear relationship, and the current computing resources are determined based on the statistically obtained processing time; the nonlinear relationship represents the relationship between the size of the logical block address corresponding to the input / output command and the processing time of the corresponding command. Based on the current computing power resources of each, and the current cache resources and current logical address resources corresponding to the corresponding processing units in the solid-state drive, the target unit is determined from each of the processing units; The current input / output command is assigned to the target unit for processing.
[0006] Optionally, the process of generating the nonlinear relationship includes: By fitting the logical block address corresponding to the historical input / output commands and the corresponding command processing time, a fitting curve containing the nonlinear relationship is obtained. Accordingly, the process time required by each processing unit to process the current input / output command based on the nonlinear relationship statistics includes: Based on the fitted curve, the processing time required for each processing unit to process the current input / output command is determined and statistically analyzed.
[0007] Optionally, the process of generating the nonlinear relationship includes: A mapping table containing the nonlinear relationship is generated based on the size of the logical block address corresponding to the historical input and output commands and the corresponding command processing time; Accordingly, the process time required by each processing unit to process the current input / output command based on the nonlinear relationship statistics includes: The processing time required for each processing unit to process the current input / output command is found and calculated from the mapping table.
[0008] Optionally, determining the current computing resources based on the statistically obtained processing time includes: Determine the current operating state of each processing unit in the solid-state drive; The waiting time required for each of the current working states to process the current input / output command is determined according to the current working state of each process unit. The total time required to process the current input / output command corresponding to the corresponding processing unit is calculated by combining the statistically obtained processing time and the waiting time corresponding to the relevant processing unit. The total time corresponding to each of the processing units is calculated using a preset computing power resource calculation formula to obtain the current computing power resource corresponding to each processing unit.
[0009] Optionally, the calculation process for the current cached resource includes: Determine the first consumption of cache resources corresponding to any processing unit in the solid-state drive; The ratio of the first consumption to the total amount of cache resources is calculated using a preset cache resource calculation formula to obtain the current cache resources.
[0010] Optionally, the calculation process for the current logical address resource includes: Determine the second consumption of logical address resources corresponding to any processing unit in the solid-state drive; The ratio of the second consumption to the total amount of the logical address resources is calculated using a preset logical address resource calculation formula to obtain the current logical address resources.
[0011] Optionally, determining the target unit from each of the processing units based on the current computing power resources and the current cache resources and current logical address resources corresponding to the corresponding processing units in the solid-state drive includes: Based on a preset load pressure calculation formula, the current computing power resources, current cache resources and current logical address resources corresponding to any processing unit in the solid-state drive are calculated to obtain the current load pressure corresponding to each processing unit. Arbitrate the current load pressure of each of the aforementioned processing units to determine the target unit with the lowest load pressure from among the aforementioned processing units; The preset load pressure calculation formula includes a first weight corresponding to the current computing power resource, a second weight corresponding to the current cache resource, and a third weight corresponding to the current logical address resource.
[0012] Secondly, this application provides a load balancing device for solid-state drives in enterprise-level data centers, comprising: The computing power resource determination module is used to calculate the processing time required by each processing unit to process the current input / output command based on a nonlinear relationship, and to determine the current computing power resources based on the calculated processing time; the nonlinear relationship represents the relationship between the size of the logical block address corresponding to the input / output command and the processing time of the corresponding command; The target unit determination module is used to determine the target unit from each of the processing units based on the current computing power resources and the current cache resources and current logical address resources corresponding to the corresponding processing units in the solid-state drive; The command allocation module is used to allocate the current input / output command to the target unit for processing.
[0013] Thirdly, this application provides an electronic device, comprising: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the load balancing method described above.
[0014] Fourthly, this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the load balancing method described above.
[0015] As can be seen from the above technical solution, this application is applied to solid-state drives (SSDs) in enterprise-level data centers. First, it uses a non-linear relationship to statistically analyze the processing time required by each processing unit to process the current input / output command, and then determines the current computing resources based on the statistically obtained processing time. The non-linear relationship characterizes the relationship between the size of the logical block address corresponding to the input / output command and the processing time of the corresponding command. Then, based on the current computing resources, and the current cache resources and current logical address resources corresponding to the processing units in the SSD, a target unit is determined from each processing unit. Finally, the current input / output command is allocated to the target unit for processing. Therefore, this application can simultaneously consider the load pressure of cache resources, the load pressure of logical address resources, and the computing load pressure of the processing units, actively performing load balancing, reducing the latency of input / output commands, reducing flash memory wear dispersion, and making the overall load pressure of the processing units more balanced, thereby improving SSD performance and adapting to complex application scenarios. Attached Figure Description
[0016] To more clearly illustrate the embodiments of the present invention, the accompanying drawings used in the 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.
[0017] Figure 1 This is a schematic diagram of an SSD hard disk structure provided in an embodiment of the present invention; Figure 2 A flowchart of a load balancing method provided in an embodiment of the present invention; Figure 3 A flowchart of a specific load balancing method provided in an embodiment of the present invention; Figure 4 A schematic diagram of a specific load balancing device provided in an embodiment of the present invention; Figure 5 A schematic diagram of another specific load balancing device provided in an embodiment of the present invention; Figure 6 This is a schematic diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0018] 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 of ordinary skill in the art without creative effort are within the protection scope of the present invention.
[0019] The terms "comprising" and "having," and any variations thereof, in the specification and accompanying drawings of this invention are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the steps or units listed, but may include steps or units not listed.
[0020] To enable those skilled in the art to better understand the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0021] Figure 1 This diagram illustrates the structure of an SSD, showing the relationship between the SSD controller, the host computer, and the NAND flash memory. The FTL (Flash Translation Layer) schedules multiple MCUs (Microcontroller Units). This scheduling mechanism can easily lead to performance degradation, low resource utilization, uneven NAND wear, and even reduced SSD lifespan. To address this, this application considers the load pressure of cache resources, logical address resources, and the computing power load pressure of the processing units simultaneously, proactively performing load balancing to reduce input / output command latency, reduce flash memory wear dispersion, and balance the overall load pressure of the processing units, thereby improving SSD performance and adapting to complex application scenarios.
[0022] like Figure 2 As shown, this embodiment discloses a load balancing method applied to solid-state drives in enterprise-level data centers, including: Step S11: Based on the nonlinear relationship, calculate the processing time required by each processing unit to process the current input / output command, and determine the current computing power resources based on the calculated processing time; the nonlinear relationship represents the relationship between the size of the logical block address corresponding to the input / output command and the processing time of the corresponding command.
[0023] It is understandable that for any input / output command (I / O) that needs to be processed, the command processing time required to process the command can be considered based on the size of its logical block address; here, the command processing time can only consider the minimum time consumption, without considering the time spent waiting due to asynchronous operations. In this embodiment, the processing time required by each processing unit in the solid-state drive to process the current input / output command can be statistically calculated based on the nonlinear relationship between the size of the logical block address corresponding to the input / output command and the corresponding command processing time; furthermore, based on the statistical processing times, the computing power resources of the solid-state drive at the current moment can be roughly estimated, that is, the current computing power resources can be obtained.
[0024] In one possible implementation, the process of generating the nonlinear relationship may include: fitting the logic block address corresponding to historical input / output commands with the corresponding command processing time to obtain a fitting curve containing the nonlinear relationship; correspondingly, calculating the processing time required by each processing unit to process the current input / output command based on the nonlinear relationship may include: determining and calculating the processing time required by each processing unit to process the current input / output command based on the fitting curve. Specifically, the nonlinear relationship between the logic block address corresponding to the input / output command and the corresponding command processing time can be obtained through curve fitting, ultimately resulting in a fitting curve containing the nonlinear relationship. Further, in the process of determining the processing time required for the current input / output command using the fitting curve, the size of the logic block address corresponding to the current input / output command is determined based on the fitting curve, and then the processing time corresponding to the corresponding point in the fitting curve is determined, i.e., the processing time required by each processing unit to process the current input / output command is obtained. It is understandable that by saving the nonlinear relationship between the logic block address corresponding to the input / output command and the corresponding command processing time through curve fitting, the processing time required for the input / output command does not require much space to calculate.
[0025] In another possible implementation, the process of generating the nonlinear relationship may include: generating a mapping table containing the nonlinear relationship based on the size of the logical block address corresponding to the historical input / output command and the corresponding command processing time; correspondingly, calculating the processing time required by each processing unit to process the current input / output command based on the nonlinear relationship may include: searching and calculating the processing time required by each processing unit to process the current input / output command from the mapping table. Specifically, the nonlinear relationship between the size of the logical block address corresponding to the input / output command and the corresponding command processing time can be obtained by constructing a mapping table, ultimately resulting in a mapping table containing the nonlinear relationship. Accordingly, in the process of using the mapping table to determine the processing time required for the current input / output command, the processing time corresponding to the historical input / output command that matches the size of the logical block address corresponding to the current input / output command is directly searched in the mapping table, and the found processing time is taken as the time required for the processing unit to process the current input / output command. It is understandable that storing the nonlinear relationship between the size of the logical block address corresponding to the input / output command and the corresponding command processing time in this mapping table method makes it easier to directly find the processing time required for the input / output command.
[0026] In another possible implementation, determining the current computing power resources based on the statistically obtained processing time may include: determining the current working state of each processing unit in the solid-state drive; determining the waiting time required for each processing unit to process the current input / output command based on the current working state; calculating the statistically obtained processing time and the waiting time corresponding to the relevant processing unit to obtain the total time required for the corresponding processing unit to process the current input / output command; and calculating the total time corresponding to each processing unit using a preset computing power resource calculation formula to obtain the current computing power resources corresponding to each processing unit. Specifically, the current computing power resources corresponding to the solid-state drive are related to the current working state of each processing unit. First, the current working state of each processing unit is determined; then, it is further considered whether the current working state of each processing unit is suitable for directly processing input / output commands. For example, some processing units are in an idle state and can directly process the current input / output command, while some processing units are currently processing other input / output commands and need to wait for those commands to be completed before processing the current input / output command; accordingly, the waiting time of each processing unit before processing the current input / output command can be obtained based on the current working state of each processing unit. Subsequently, by comprehensively considering the processing time and waiting time of each processing unit relative to the current input / output command, the total time required for each processing unit to complete the current input / output command can be calculated. Further, by combining a pre-set computing power resource calculation formula, the total time related to each processing unit can be calculated to obtain the current computing power resource corresponding to each processing unit in the solid-state drive. In a specific embodiment, the computing power resource can be calculated by accumulation; or, based on the differences in the performance of the processing units themselves and the varying times required to process the current input / output command, the current working state of each processing unit can be considered to perform a weighted calculation for different processing units to obtain the current computing power resource corresponding to each processing unit.
[0027] Step S12: Determine the target unit from each processing unit based on the current computing power resources, the current cache resources and the current logical address resources corresponding to the processing units in the solid-state drive.
[0028] In this application, the current computing power resources of each processing unit of the solid-state drive can be obtained through the above steps. Combined with the current cache resources and current logical address resources of the corresponding processing unit of the solid-state drive, the state of each processing unit can be further evaluated, and a suitable target processing unit can be determined. It is understood that the determined target processing unit should be the processing unit most suitable for processing the current input and output commands among the processing units of the solid-state drive.
[0029] In one possible implementation, the calculation process for the current cache resource may include: determining a first consumption of cache resources corresponding to any processing unit in the solid-state drive; and calculating the ratio of the first consumption to the total cache resource using a preset cache resource calculation formula to obtain the current cache resource. Specifically, the calculation process for the current cache resource of the processing unit needs to consider the total cache resource corresponding to the processing unit and the current consumption of cache resources, i.e., the first consumption; then, the first consumption and the corresponding total cache resource are calculated using a preset cache resource calculation formula to obtain the current cache resource. It is understood that the cache resource calculation formula can be a ratio calculation of the first consumption to the corresponding total resource, using this ratio to measure the current cache resource.
[0030] In another possible embodiment, the calculation process for the current logical address resource may include: determining a second consumption of logical address resources corresponding to any processing unit in the solid-state drive; and calculating the ratio of the second consumption to the total amount of logical address resources using a preset logical address resource calculation formula to obtain the current logical address resource. Specifically, for the logical address resources corresponding to processing units in the solid-state drive, considering the consumption of logical address resources corresponding to any processing unit, i.e., the second consumption, and the total amount of logical address resources, the current logical address resource can be obtained by calculating using a preset logical address resource calculation formula. It is understood that the logical address resource calculation formula can be a ratio calculation of the second consumption to the corresponding total amount of resources, using this ratio to measure the current logical address resource.
[0031] In another possible embodiment, determining the target unit from among the processing units based on the current computing power resources, and the current cache resources and current logical address resources corresponding to the corresponding processing units in the solid-state drive, may include: calculating the current computing power resources, current cache resources, and current logical address resources corresponding to any processing unit in the solid-state drive based on a preset load pressure calculation formula to obtain the current load pressure corresponding to each processing unit; arbitrating the current load pressures to determine the target unit with the lowest load pressure from among the processing units; wherein the preset load pressure calculation formula includes a first weight corresponding to the current computing power resources, a second weight corresponding to the current cache resources, and a third weight corresponding to the current logical address resources. Specifically, for each processing unit, the preset load pressure calculation formula can be used to calculate its corresponding current computing power resources, current cache resources, and current logical address resources; the load pressure calculation formula here is a formula constructed based on weight coefficients, including a first weight corresponding to the current computing power resources, a second weight corresponding to the current cache resources, and a third weight corresponding to the current logical address resources. This allows the calculation of the current load pressure corresponding to each processing unit. Subsequently, the current load pressure can be arbitrated to select a suitable target unit from among the processing units to process the current input / output command. In a specific embodiment, the load pressure corresponding to each processing unit needs to be updated in real time to ensure the accuracy and rationality of the allocation of input / output commands.
[0032] Step S13: Assign the current input / output command to the target unit for processing.
[0033] Furthermore, after determining the target unit suitable for processing the current input / output command from among the processing units based on the current load pressure, the current input / output command can be assigned to that target unit; understandably, this allows the current input / output command to be assigned to the processing unit with the lowest load pressure for processing.
[0034] Therefore, this application can calculate the processing time of each processing unit for input / output commands by combining the nonlinear relationship between the size of the logical block address corresponding to the input / output command and the processing time of the corresponding command, and also consider the resource occupancy of each processing unit, i.e., the load pressure of cache resources and the load pressure of logical address resources. In this way, the load pressure of the current processing unit can be calculated. Then, combined with the computing power load pressure of the processing unit, the load balancing is actively performed to reduce the latency of input / output commands, reduce the dispersion of flash memory wear, and make the overall load pressure of the processing unit tend to be balanced, thereby improving the performance of solid-state drives and adapting to complex application scenarios.
[0035] like Figure 3 As shown, this embodiment discloses a load balancing method, specifically including: In this embodiment, when it is necessary to process the current input / output command, the load pressure corresponding to each processing unit (MCU) can be calculated by the IO load calculation module in conjunction with the CPU power table (i.e., the mapping table in the above embodiment that represents the nonlinear relationship between the size of the logical block address corresponding to the input / output command and the processing time of the corresponding command). Then, the arbitration module arbitrates each load pressure and allocates the current input / output command to the processing unit with the lowest load pressure for processing.
[0036] Specifically, regarding the CPU computing power table, it should be noted that for any I / O command, the size of its processed LBA (Logical Block Address) can be denoted as n. LBA The test can give the CPU processing size as n LBA CPU time t for I / O commands LBA The CPU time should only consider the minimum time required by the CPU on the I / O path, excluding the time spent waiting due to asynchronous operations. CPU time t LBA Depends on n LBA And it exhibits a non-linear relationship. Furthermore, t LBA This can be achieved through two methods: fitting or looking up a table. Taking the lookup table method as an example, different values of n can be tested. LBA The corresponding t LBA This relationship is then built into the solid-state drive (SSD) as a table. When an I / O command arrives, the SSD only needs to look up the table to obtain the corresponding t. LBA .
[0037] Furthermore, the load pressure corresponding to the processing unit is specifically calculated and integrated based on the load pressure caused by CPU computing power resources, buffer resources, and PBA (Physical Block Address) resources. Among these, the CPU load pressure p... CPU Measured by the total time taken by the commands currently being processed: .
[0038] Buffer resources are determined by the proportion r of the current consumed buffer amount to the current buffer resource pool size. BUF Measurement, denoted as p BUF p BUF It can be simply written as r BUF direct proportional form .
[0039] PBA resources are determined by the proportion of PBA consumed by all current commands to the current PBA resource pool size. PBA Measurement, denoted as p PBA p PBAIt can be simply written as r PBA The direct proportional form, .
[0040] Each time an I / O command begins processing, the load pressure of the current core is calculated. Load pressure: .
[0041] When an I / O command is received or when I / O command processing is completed, update p. CPU The value of .
[0042] Furthermore, after receiving I / O commands at the front end of the solid-state drive, the arbitration module can calculate and compare the load pressure of each processing unit, arbitrate based on the load pressure, and allocate the I / O commands to the unit with the lowest pressure for processing.
[0043] Therefore, the solid-state drive (SSD) in this application can consider various resources and dynamically calculate the real-time load pressure of each processing unit. This enables active load balancing to balance the CPU computing power load pressure, maximizing CPU computing power and improving SSD performance. Furthermore, it can simultaneously consider the load pressure of buffer resources, thereby increasing buffer resource throughput, improving SSD performance, and reducing IO latency. Combined with the load pressure of PBA resources, it ensures that the PBA resources acquired by each processing unit are balanced, reducing NAND wear dispersion and improving NAND flash memory lifespan.
[0044] like Figure 4 As shown, this embodiment discloses a load balancing device applied to solid-state drives in enterprise-level data centers. It mainly includes an IO load calculation module, an arbitration module, and a CPU power table. The IO load calculation module can calculate the real-time load pressure of each processing unit in conjunction with the dynamic CPU power table, and then implement command allocation through the arbitration module.
[0045] Furthermore, such as Figure 5 As shown, this embodiment discloses another load balancing device applied to solid-state drives in enterprise-level data centers, including: The computing power resource determination module 11 is used to calculate the processing time required by each processing unit to process the current input and output commands based on nonlinear relationships, and to determine the current computing power resources based on the calculated processing time; the nonlinear relationship represents the relationship between the size of the logical block address corresponding to the input and output commands and the processing time of the corresponding commands; The target unit determination module 12 is used to determine the target unit from each processing unit based on the current computing power resources, as well as the current cache resources and current logical address resources corresponding to the corresponding processing unit in the solid-state drive; Command allocation module 13 is used to allocate the current input / output commands to the target unit for processing.
[0046] Therefore, this application can simultaneously consider the load pressure of cache resources, the load pressure of logical address resources, and the computing power load pressure of the processing unit, and actively perform load balancing to reduce the latency of input and output commands, reduce the dispersion of flash memory wear, and make the overall load pressure of the processing unit more balanced, thereby improving the performance of solid-state drives and adapting to complex application scenarios.
[0047] In one specific embodiment, the apparatus may include: The fitting curve generation module is used to fit the corresponding logical block address and the corresponding command processing time using the size of the historical input and output commands and the corresponding command processing time to obtain the corresponding fitting curve containing nonlinear relationships. Correspondingly, the computing power resource determination module 11 may include: The first processing time determination unit is used to determine and statistically analyze the processing time required by each processing unit to process the current input and output commands based on the fitted curve.
[0048] In another specific embodiment, the apparatus may include: The mapping table generation module is used to generate a mapping table containing non-linear relationships based on the size of the logical block address corresponding to the historical input and output commands and the corresponding command processing time. Correspondingly, the computing power resource determination module 11 may include: The second processing time determination unit is used to find and calculate the processing time required by each processing unit to process the current input / output command from the mapping table.
[0049] In one specific embodiment, the computing resource determination module 11 may include: The working status determination unit is used to determine the current working status of each processing unit in the solid-state drive; The waiting time determination unit is used to determine the waiting time required for each processing unit to process the current input / output command based on the current working status. The total time calculation unit is used to calculate the total time required for the corresponding processing unit to process the current input / output command based on the statistically obtained processing time and the waiting time corresponding to the relevant processing unit. The computing power resource calculation unit is used to calculate the total time corresponding to each processing unit using a preset computing power resource calculation formula, so as to obtain the current computing power resource corresponding to each processing unit.
[0050] In one specific embodiment, the target unit determination module 12 may include: The first consumption determination unit is used to determine the first consumption of cache resources corresponding to any processing unit in the solid-state drive; The cache resource calculation unit is used to calculate the ratio of the first consumption to the total amount of cache resources using a preset cache resource calculation formula, so as to obtain the current cache resources.
[0051] In another specific embodiment, the target unit determination module 12 may include: The second consumption determination unit is used to determine the second consumption of logical address resources corresponding to any processing unit in the solid-state drive; The logical address resource calculation unit is used to calculate the ratio of the second consumption to the total logical address resources using a preset logical address resource calculation formula, so as to obtain the current logical address resources.
[0052] In one specific embodiment, the target unit determination module 12 may include: The load pressure calculation unit is used to calculate the current computing power resources, current cache resources and current logical address resources corresponding to any processing unit in the solid-state drive based on the preset load pressure calculation formula, so as to obtain the current load pressure corresponding to each processing unit. An arbitration unit is used to arbitrate the current load pressures to determine the target unit with the lowest load pressure from among the processing units. The preset load pressure calculation formula includes a first weight corresponding to the current computing power resources, a second weight corresponding to the current cache resources, and a third weight corresponding to the current logical address resources.
[0053] Furthermore, embodiments of this application also disclose an electronic device, Figure 6 This is a structural diagram of an electronic device according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of this application. Specifically, the electronic device may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the load balancing method disclosed in any of the foregoing embodiments. Furthermore, the electronic device in this embodiment may specifically be an electronic computer.
[0054] In this embodiment, the power supply 23 is used to provide operating voltage for various hardware devices on the electronic device; the communication interface 24 can create a data transmission channel between the electronic device and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.
[0055] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored thereon can include operating system 221, computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0056] The operating system 221 is used to manage and control the various hardware devices on the electronic device and the computer program 222, which may be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program capable of performing the load balancing method executed by the electronic device as disclosed in any of the foregoing embodiments, the computer program 222 may further include a computer program capable of performing other specific tasks.
[0057] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned disclosed load balancing method. Specific steps of this method can be found in the corresponding content disclosed in the foregoing embodiments, and will not be repeated here.
[0058] Furthermore, this application also discloses a computer program product, including a computer program / instructions that, when executed by a processor, implement the aforementioned disclosed load balancing method.
[0059] 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 it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.
[0060] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0061] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0062] Finally, it should 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.
[0063] The technical solutions provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only intended to help understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A load balancing method, characterized in that, Solid-state drives (SSDs) used in enterprise data centers include: The processing time required by each processing unit to process the current input / output command is statistically calculated based on a nonlinear relationship, and the current computing resources are determined based on the statistically obtained processing time; the nonlinear relationship represents the relationship between the size of the logical block address corresponding to the input / output command and the processing time of the corresponding command. Based on the current computing power resources of each, and the current cache resources and current logical address resources corresponding to the corresponding processing units in the solid-state drive, the target unit is determined from each of the processing units; The current input / output command is assigned to the target unit for processing.
2. The load balancing method according to claim 1, characterized in that, The process of generating the nonlinear relationship includes: By fitting the logical block address corresponding to the historical input / output commands and the corresponding command processing time, a fitting curve containing the nonlinear relationship is obtained. Accordingly, the process time required by each processing unit to process the current input / output command based on the nonlinear relationship statistics includes: Based on the fitted curve, the processing time required for each processing unit to process the current input / output command is determined and statistically analyzed.
3. The load balancing method according to claim 1, characterized in that, The process of generating the nonlinear relationship includes: A mapping table containing the nonlinear relationship is generated based on the size of the logical block address corresponding to the historical input and output commands and the corresponding command processing time; Accordingly, the process time required by each processing unit to process the current input / output command based on the nonlinear relationship statistics includes: The processing time required for each processing unit to process the current input / output command is found and calculated from the mapping table.
4. The load balancing method according to claim 1, characterized in that, The determination of current computing resources based on statistically obtained processing time includes: Determine the current operating state of each processing unit in the solid-state drive; The waiting time required for each of the current working states to process the current input / output command is determined according to the current working state of each process unit. The total time required to process the current input / output command corresponding to the corresponding processing unit is calculated by combining the statistically obtained processing time and the waiting time corresponding to the relevant processing unit. The total time corresponding to each of the processing units is calculated using a preset computing power resource calculation formula to obtain the current computing power resource corresponding to each processing unit.
5. The load balancing method according to claim 1, characterized in that, The calculation process for the current cached resource includes: Determine the first consumption of cache resources corresponding to any processing unit in the solid-state drive; The ratio of the first consumption to the total amount of cache resources is calculated using a preset cache resource calculation formula to obtain the current cache resources.
6. The load balancing method according to claim 1, characterized in that, The calculation process for the current logical address resource includes: Determine the second consumption of logical address resources corresponding to any processing unit in the solid-state drive; The ratio of the second consumption to the total amount of the logical address resources is calculated using a preset logical address resource calculation formula to obtain the current logical address resources.
7. The load balancing method according to any one of claims 1 to 6, characterized in that, The step of determining the target unit from each of the processing units based on the current computing power resources, and the current cache resources and current logical address resources corresponding to the corresponding processing units in the solid-state drive, includes: Based on a preset load pressure calculation formula, the current computing power resources, current cache resources and current logical address resources corresponding to any processing unit in the solid-state drive are calculated to obtain the current load pressure corresponding to each processing unit. Arbitrate the current load pressure of each of the aforementioned processing units to determine the target unit with the lowest load pressure from among the aforementioned processing units; The preset load pressure calculation formula includes a first weight corresponding to the current computing power resource, a second weight corresponding to the current cache resource, and a third weight corresponding to the current logical address resource.
8. A load balancing device, characterized in that, Solid-state drives (SSDs) used in enterprise data centers include: The computing power resource determination module is used to calculate the processing time required by each processing unit to process the current input / output command based on a nonlinear relationship, and to determine the current computing power resources based on the calculated processing time; the nonlinear relationship represents the relationship between the size of the logical block address corresponding to the input / output command and the processing time of the corresponding command; The target unit determination module is used to determine the target unit from each of the processing units based on the current computing power resources and the current cache resources and current logical address resources corresponding to the corresponding processing units in the solid-state drive; The command allocation module is used to allocate the current input / output command to the target unit for processing.
9. 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 load balancing method as described in any one of claims 1 to 7.
10. 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 load balancing method as described in any one of claims 1 to 7.