A method, device, equipment, medium and product for verifying resource allocation

By generating random numbers in the target host, checking the calculation controller and judging its capabilities, the problem of inflexible controller selection in software and hardware hybrid RAID systems is solved, load balancing and resource maximization utilization is achieved, and overall performance and efficiency are improved.

CN120029557BActive Publication Date: 2025-07-18SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510511272.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-23
Publication Date
2025-07-18
Estimated Expiration
2045-04-23

AI Technical Summary

Technical Problem

The existing hybrid RAID system for software and hardware lacks flexibility when selecting XOR computing controllers, resulting in insufficient system adaptability and robustness, making it difficult to flexibly adjust verification resources according to performance requirements, affecting overall performance and efficiency.

Method used

By maintaining the preset controller list locally on the target host, a target random number is generated to select a matching verification calculation controller, and to determine whether its capabilities meet the task requirements. If not, the list will be traversed until a satisfied controller is found to achieve load balancing and resource maximization utilization.

Benefits of technology

It realizes flexible allocation of verification resources according to the performance requirements of verification calculation tasks, improves overall performance and hardware resource utilization efficiency, and avoids long-term high load or idleness of controllers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120029557B_ABST
    Figure CN120029557B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device, equipment, medium and product for verifying resource allocation, which relates to the technical field of data storage and is applied to a target host. The method includes: generating a target random number when obtaining a verification calculation task, and using the target random number as an index value to obtain a matching first verification calculation controller from a preset controller list; the preset controller list stores the verification calculation capability information of each current verification calculation controller, and each verification calculation controller is a hardware device connected to the target host and having a verification calculation function; obtaining the target verification calculation capability information of the first verification calculation controller, and determining whether it meets the calculation resource requirements of the verification calculation task; if it meets the requirements, using the first verification calculation controller to execute the verification calculation task; if it does not meet the requirements, sequentially traversing the preset controller list until a second verification calculation controller that meets the calculation resource requirements is determined, and then using the second verification calculation controller to execute the verification calculation task.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data storage, and particularly relates to a method, device, equipment, medium and product for allocating parity resources. Background Art

[0002] With the explosive growth of data volume and the continuous improvement of storage performance requirements, data storage technology faces many challenges. RAID (Redundant Array of Independent Disks) technology, as an important data storage solution, aims to improve data read / write efficiency, enhance data redundancy and system fault tolerance. Among them, the software-hardware hybrid RAID combines the flexibility of software RAID and the high-performance advantages of hardware RAID, aiming to achieve efficient data storage and access. It uses dedicated hardware to accelerate compute-intensive tasks, and the software is responsible for managing configuration tasks, showing excellent performance in terms of scalability and cost-effectiveness. However, with the development of technologies such as PCIe (Peripheral Component Interconnect Express, a high-speed serial computer expansion bus standard) SR-IOV (Single Root I / O Virtualization), there are currently emerging multi-functional RAID controllers and multi-functional SSD solutions. For example, a multi-functional composite RAID controller uses some functions as an XOR (Exclusive OR) calculation controller to provide XOR calculation support for software RAID. When performing data redundancy check calculations, it no longer requires the bandwidth resources of the CPU (Central Processing Unit) and DRAM (Dynamic Random Access Memory), thus not only saving precious bandwidth but also significantly improving performance. A typical software-hardware hybrid RAID functional architecture is as Figure 1 shown in.

[0003] However, adopting the solution as Figure 1 shown in still has the following problems: Software RAID lacks flexibility in selecting an XOR calculation controller. Currently, it can only select and use a fixed controller. If this controller is removed or fails, software RAID will no longer be able to use it, which limits the adaptability and robustness of the system, and also makes it difficult for software RAID to flexibly adjust according to its own performance requirements and the parity resources of the controller, resulting in problems of insufficient performance or resource waste, thus affecting the overall performance and efficiency.

[0004] In summary, how to flexibly allocate corresponding verification resources according to the performance requirements of the verification calculation task to improve the overall performance is a problem to be solved at present. Summary of the Invention

[0005] In view of this, the purpose of the present invention is to provide a verification resource allocation method, device, equipment, medium and product, which can flexibly allocate corresponding verification resources according to the performance requirements of the verification calculation task to improve the overall performance. The specific scheme is as follows:

[0006] In the first aspect, the present application discloses a verification resource allocation method, which is applied to a target host and includes:

[0007] Generate a target random number when obtaining a verification calculation task, and use the target random number as an index value to obtain a matching first verification calculation controller from a preset controller list; wherein, the preset controller list stores the verification calculation ability information of each current verification calculation controller, and each verification calculation controller is a hardware device connected to the target host and having a verification calculation function;

[0008] Obtain the target verification calculation ability information of the first verification calculation controller, and determine whether the target verification calculation ability information meets the calculation resource requirements of the verification calculation task;

[0009] If it meets, use the first verification calculation controller to execute the verification calculation task;

[0010] If it does not meet, traverse the preset controller list in sequence until a second verification calculation controller that meets the calculation resource requirements is determined, and then use the second verification calculation controller to execute the verification calculation task.

[0011] Optionally, generating a target random number when obtaining a verification calculation task includes:

[0012] Determine the current timestamp when obtaining the verification calculation task, and determine the current number of controllers in the preset controller list;

[0013] Generate a target random number according to the current timestamp and the current number of controllers.

[0014] Optionally, generating a target random number according to the current timestamp and the current number of controllers includes:

[0015] Use the current timestamp as a random seed, and use a preset random number generation function to process the random seed to generate an initial random number;

[0016] Perform a modulo operation on the initial random number based on the current number of controllers to obtain the target random number.

[0017] Optionally, generating a target random number according to the current timestamp and the current number of controllers, including:

[0018] Converting the current timestamp into a corresponding integer value, and performing a summation operation on the integer value and the current number of controllers, using the result of the summation operation as a random seed;

[0019] Processing the random seed using a preset random number generation function to generate an initial random number;

[0020] Performing a modulo operation on the initial random number based on the current number of controllers to obtain the target random number.

[0021] Optionally, the hardware device is a disk array controller or a solid-state drive controller;

[0022] Correspondingly, the method further includes:

[0023] During the startup process of the disk array controller or the solid-state drive controller, obtaining the corresponding controller information, and judging whether the disk array controller or the solid-state drive controller has a check calculation function based on the controller information;

[0024] If so, using the disk array controller or the solid-state drive controller with the check calculation function as a check calculation controller, and obtaining the check calculation capability information of the check calculation controller;

[0025] Storing each check calculation controller and the corresponding check calculation capability information into a preset controller list.

[0026] Optionally, obtaining the corresponding controller information, and judging whether the disk array controller or the solid-state drive controller has a check calculation function, including:

[0027] Sending a preset query command to the disk array controller or the solid-state drive controller to obtain the corresponding controller information;

[0028] Obtaining the controller type attribute from the first target byte of the controller information;

[0029] Judging whether the current attribute value of the controller type attribute is a preset attribute value corresponding to the check calculation controller set in advance;

[0030] If so, determining that the disk array controller or the solid-state drive controller has a check calculation function, otherwise determining that the disk array controller or the solid-state drive controller does not have a check calculation function.

[0031] Optionally, the check calculation capability information is an IOPS value;

[0032] Correspondingly, obtaining the check calculation capability information of the check calculation controller, including:

[0033] Obtain the IOPS value of the check calculation controller from the second target byte of the controller information.

[0034] Optionally, store each check calculation controller and the corresponding check calculation capability information into a preset controller list, including:

[0035] Obtain the pre-created preset controller list;

[0036] Call the callback function to store each check calculation controller and the corresponding check calculation capability information into the preset controller list.

[0037] Optionally, the check resource allocation method of this application further includes:

[0038] When receiving an information update command sent by any check calculation controller, resend a preset query command to any check calculation controller to obtain the updated controller information;

[0039] Update the preset controller list based on the updated controller information.

[0040] Optionally, updating the preset controller list based on the updated controller information includes:

[0041] If it is determined according to the updated controller information that any check calculation controller does not have the check calculation function, remove any check calculation controller and the corresponding check calculation capability information from the preset controller list;

[0042] If it is determined according to the updated controller information that any check calculation controller still has the check calculation function, use the updated check capability information in the updated controller information to update the check capability information corresponding to any check calculation controller in the preset controller list.

[0043] Optionally, the information update command is a response command to an asynchronous event request command;

[0044] Correspondingly, the process of any check calculation controller sending an information update command includes:

[0045] When any check calculation controller detects that the local check calculation capability information has changed, determine whether there is an asynchronous event request command sent by a target host currently;

[0046] If there is, construct an information update command based on a preset event type and preset event information indicating that the local check calculation capability information has changed;

[0047] Use the information update command as a response command to the asynchronous event request command and send it to the target host.

[0048] Optionally, after determining whether there is an asynchronous event request command sent by the target host currently, it further includes:

[0049] If there is no unprocessed asynchronous event request command sent by the target host currently, store the preset event information indicating a change in the local verification calculation capability information into the local event queue;

[0050] When obtaining the asynchronous event request command sent by the target host, take out the preset event information from the local event queue, construct an information update command based on the preset event type and the preset event information, and then use the information update command as the response command to the asynchronous event request command and send it to the target host.

[0051] Optionally, when obtaining the information update command sent by any verification calculation controller, resend the preset query command to any verification calculation controller, including:

[0052] When obtaining the information update command sent by any verification calculation controller, parse the information update command to obtain the event type and the event information;

[0053] If the event type of the information update command is the preset event type and the event information of the information update command is the preset event information, resend the preset query command to any verification calculation controller.

[0054] Optionally, after traversing the preset controller list, it further includes:

[0055] If there is no verification calculation controller in the preset controller list that meets the computing resource requirements, split the verification calculation task into a corresponding number of first subtasks according to the current splitting granularity;

[0056] Traverse the preset controller list to determine the third verification calculation controller that meets the computing resource requirements of each first subtask, so as to use the third verification calculation controller to execute the first subtask.

[0057] Optionally, traversing the preset controller list to determine the third verification calculation controller that meets the computing resource requirements of each first subtask includes:

[0058] Generate a random index according to the timestamp information and the task identification number of each first subtask;

[0059] Start traversing the preset controller list from the random index to determine the third verification calculation controller that meets the computing resource requirements of each first subtask.

[0060] Optionally, the verification resource allocation method of the present application further includes:

[0061] If there is no verification calculation controller in the preset controller list that meets the computing resource requirements of the first subtask, increase the current splitting granularity by a preset step size to obtain a new current splitting granularity;

[0062] Split the verification calculation task into a corresponding number of second subtasks according to the new current splitting granularity, and then traverse the preset controller list to determine a fourth verification calculation controller that meets the computing resource requirements of each second subtask, so as to use the fourth verification calculation controller to execute the second subtask;

[0063] If there is no verification calculation controller in the preset controller list that meets the computing resource requirements of the second subtask, jump back to the step of increasing the current splitting granularity by a preset step size to obtain a new current splitting granularity.

[0064] In a second aspect, the present application discloses a verification resource allocation device, which is applied to a target host and includes:

[0065] A controller matching module, configured to generate a target random number when obtaining a verification calculation task, and use the target random number as an index value to obtain a matching first verification calculation controller from a preset controller list; wherein, the preset controller list stores the verification calculation capability information of each current verification calculation controller, and each verification calculation controller is a hardware device connected to the target host and having a verification calculation function;

[0066] A judgment module, configured to obtain the target verification calculation capability information of the first verification calculation controller, and judge whether the target verification calculation capability information meets the computing resource requirements of the verification calculation task;

[0067] A task execution module, configured to, if it is satisfied, use the first verification calculation controller to execute the verification calculation task;

[0068] A traversal module, configured to, if it is not satisfied, sequentially traverse the preset controller list until a second verification calculation controller that meets the computing resource requirements is determined, and then use the second verification calculation controller to execute the verification calculation task.

[0069] In a third aspect, the present application discloses an electronic device, including:

[0070] A memory, configured to store a computer program;

[0071] A processor, configured to execute the computer program to implement the steps of the foregoing disclosed verification resource allocation method.

[0072] In a fourth aspect, the present application discloses a computer-readable storage medium, configured to store a computer program; wherein, when the computer program is executed by a processor, the steps of the foregoing disclosed verification resource allocation method are implemented.

[0073] In a fifth aspect, the present application discloses a computer program product, including a computer program / instructions, which when executed by a processor implement the steps of the aforementioned disclosed method for allocating verification resources.

[0074] It can be seen that the target host in the present application generates a target random number when obtaining a verification calculation task, and uses the target random number as an index value to obtain a matching first verification calculation controller from a preset controller list; wherein, the preset controller list stores the verification calculation capability information of each current verification calculation controller, and each verification calculation controller is a hardware device connected to the target host and having a verification calculation function; obtain the target verification calculation capability information of the first verification calculation controller, and determine whether the target verification calculation capability information meets the calculation resource requirements of the verification calculation task; if it meets, use the first verification calculation controller to execute the verification calculation task; if it does not meet, sequentially traverse the preset controller list until a second verification calculation controller that meets the calculation resource requirements is determined, and then use the second verification calculation controller to execute the verification calculation task.

[0075] Beneficial effects: This application maintains a preset controller list locally on the target host. The list stores the verification calculation capability information of each current verification calculation controller. The verification calculation controller specifically refers to a hardware device that is connected to the target host and has the verification calculation function. When a verification calculation task is obtained, a corresponding target random number will be generated first, and the target random number will be used as an index value to obtain a matching first verification calculation controller from the preset controller list. That is, this application does not select verification calculation controllers to execute verification calculation tasks in a fixed order, but adopts a randomized method to select, so as to achieve load balancing of verification calculation controllers, avoid the situation where some controllers are overloaded for a long time while the rest of the controllers are idle, and can maximize the use of hardware resources. Further, it is also necessary to obtain the target verification calculation capability information of the selected first verification calculation controller and determine whether the target verification calculation capability information meets the calculation resource requirements of the verification calculation task. That is, this application does not directly use the first verification calculation controller to execute the verification calculation task, but needs to judge whether it has enough ability to meet the requirements of the current task. If it meets the requirements, the first verification calculation controller can be used to execute the verification calculation task. If it does not meet the requirements, it is necessary to traverse the preset controller list in turn until a second verification calculation controller that meets the calculation resource requirements is determined, and then use the second verification calculation controller to execute the verification calculation task. That is, this application first judges whether the matching first verification calculation controller can execute the current task. If not, it then traverses the subsequent verification calculation controllers in the list in turn. And because the random numbers generated for each verification calculation task are different, the range of subsequent traversed controllers is also different, and load balancing can also be achieved. In this way, this application can flexibly allocate corresponding verification resources according to the performance requirements of the verification calculation task, thereby improving the overall performance. Description of the Drawings

[0076] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained according to the provided drawings without creative efforts.

[0077] Figure 1 It is a schematic diagram of a traditional software and hardware hybrid RAID function architecture;

[0078] Figure 2 It is a flowchart of a verification resource allocation method disclosed in the present application;

[0079] Figure 3 It is a schematic diagram of a function architecture applicable to the verification resource allocation method disclosed in the present application;

[0080] Figure 4 Flow chart of a specific verification resource allocation method disclosed in this application;

[0081] Figure 5 Flow chart of a verification resource allocation disclosed in this application;

[0082] Figure 6 Schematic structural diagram of a verification resource allocation device disclosed in this application;

[0083] Figure 7 Structural diagram of an electronic device disclosed in this application. Specific embodiments

[0084] Next, the technical solutions in the embodiments of this application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0085] The current typical software and hardware hybrid RAID functional architecture is as Figure 1 shown. However, when adopting this solution, there are still the following problems: Software RAID lacks flexibility in selecting the XOR calculation controller. Currently, only a fixed controller can be selected. If this controller is removed or fails, software RAID will not be able to continue using it, which limits the adaptability and robustness of the system, and also makes it difficult for software RAID to flexibly adjust according to its own performance requirements and the verification resources of the controller, resulting in problems of insufficient performance or resource waste, thus affecting the overall performance and efficiency. The embodiments of this application disclose a verification resource allocation method, device, equipment, medium, and product, which can flexibly allocate corresponding verification resources for the verification calculation task according to its performance requirements to improve the overall performance.

[0086] See Figure 2 shown. The embodiments of this application disclose a verification resource allocation method, which is applied to a target host. The method includes:

[0087] Step S11: Generate a target random number when obtaining a verification calculation task, and use the target random number as an index value to obtain a matching first verification calculation controller from a preset controller list; wherein, the preset controller list stores the verification calculation ability information of each current verification calculation controller, and each verification calculation controller is a hardware device connected to the target host and having a verification calculation function.

[0088] In this embodiment, a preset controller list is maintained locally on the target host. The list stores the check calculation capability information of each current check calculation controller. The check calculation controller specifically refers to a hardware device that is connected to the target host and has the check calculation function. When a check calculation task is obtained, a corresponding target random number is first generated, and the target random number is used as an index value to obtain a matching first check calculation controller from the preset controller list.

[0089] That is, this application does not select the check calculation controller to execute the check calculation task in a fixed order, but adopts a randomized method to select, so as to achieve the load balancing of the check calculation controller, avoid the situation that some controllers are under high load for a long time while the rest of the controllers are idle, and can maximize the utilization of hardware resources.

[0090] It should be noted that the hardware device is a disk array controller (RAID controller) or a solid-state drive controller (SSD controller); correspondingly, the method of this application further includes: during the startup process of the disk array controller or the solid-state drive controller, obtaining the corresponding controller information, and based on the controller information, determining whether the disk array controller or the solid-state drive controller has the check calculation function; if so, using the disk array controller or the solid-state drive controller with the check calculation function as the check calculation controller, and obtaining the check calculation capability information of the check calculation controller; storing each check calculation controller and the corresponding check calculation capability information in the preset controller list. That is, during the startup process of the RAID controller or the SSD controller, the host obtains its corresponding controller information, so as to determine whether it has the check calculation function according to the controller information. It should be noted that the check calculation function here specifically refers to the XOR (Exclusive OR) function. In traditional hardware RAID, the RAID controller usually has an XOR calculation engine built-in to perform parity check calculations required for RAID5 / 6 and other modes; similarly, some high-performance SSD controllers may also integrate an XOR calculation acceleration unit for XOR calculation. Therefore, this application needs to determine whether the RAID controller or the SSD controller has the function of supporting XOR operation according to the controller information. If it has, these disk array controllers or solid-state drive controllers with the check calculation function are used as the check calculation controllers (i.e., XOR controllers), and further obtain the check calculation capability information of these check calculation controllers, and then store each check calculation controller and the corresponding check calculation capability information in the preset controller list.

[0091] In a specific embodiment, the above-mentioned obtaining of the corresponding controller information and determining whether the disk array controller or the solid-state drive controller has a check calculation function based on the controller information includes: sending a preset query command to the disk array controller or the solid-state drive controller to obtain the corresponding controller information; obtaining the controller type attribute from the first target byte of the controller information; determining whether the current attribute value of the controller type attribute is a preset attribute value preset corresponding to the check calculation controller; if so, determining that the disk array controller or the solid-state drive controller has a check calculation function, otherwise determining that the disk array controller or the solid-state drive controller does not have a check calculation function.

[0092] First, it should be pointed out that the present application adds an XOR controller type to the Controller Type (controller type) attribute represented by the 111th byte of the NVMe (Non-Volatile Memory Express) protocol Identify Controller Data Structure (CNS 01h), as shown in Table 1 below:

[0093] Table 1 Schematic table of controller type values

[0094]

[0095] Among them, Identify is a standardized command (Opcode E2h) defined by the NVMe protocol, used to query the static configuration information or dynamic status of NVMe devices (such as SSDs, RAID controllers). Through this query command, the host can obtain detailed parameters of the device, such as model, firmware version, supported functions, etc.

[0096] The key parameters of the Identify command are:

[0097] CNS (Controller or Namespace Structure): Specifies the query target type, and common values include:

[0098] 00h: Obtain Namespace (storage namespace) information;

[0099] 01h: Obtain Controller (controller) information (i.e., Identify Controller Data Structure);

[0100] 02h: Obtain the list of Active Namespaces.

[0101] Therefore, by sending an Identify command (CNS = 01h) to the RAID controller or SSD controller, the target host can obtain the Identify Controller Data Structure of the RAID controller or SSD controller, and then obtain the controller type attribute (i.e., the controller type field) from the 111th byte of the controller information. If the current attribute value of the controller type field is the preset attribute value 4h, then the controller is an XOR controller. That is to say, the corresponding disk array controller or solid-state drive controller has the parity calculation function. On the contrary, if the current attribute value of the controller type field is not 4h, it is determined that the disk array controller or solid-state drive controller does not have the parity calculation function.

[0102] In the specific implementation manner, the parity calculation capability information is the IOPS value; correspondingly, obtaining the parity calculation capability information of the parity calculation controller includes: obtaining the IOPS value of the parity calculation controller from the second target byte of the controller information. IOPS (Input / Output Operations Per Second) is a key indicator for measuring the calculation ability of the XOR controller, indicating the number of parity calculation tasks that the controller can process per second. In this application, it can specifically represent the number of parity check calculations that the controller can complete per second. If the maximum IOPS of an XOR controller is 100,000, it means that it can process at most 100,000 parity calculations per second. Therefore, this application uses the IOPS value to represent the parity calculation capability information of the parity calculation controller.

[0103] Furthermore, in the embodiments of the present application, the maximum IOPS value that the XOR controller can provide for parity calculation is added to the 107th to 110th bytes of the Controller Data Structure, as specifically shown in Table 2:

[0104] Table 2 Schematic Table of Byte Descriptions

[0105]

[0106] Therefore, when the current attribute value of the controller type field is 4h, continue to obtain and save the maximum IOPS value that the XOR controller can provide for parity calculation from the 107th to 110th bytes of the Identify Controller Data Structure. If the current attribute value of the controller type is not 4h, there is no need to obtain the maximum IOPS value anymore.

[0107] In a specific embodiment, storing each verification calculation controller and the corresponding verification calculation capability information into a preset controller list includes: obtaining a preset controller list created in advance; calling a callback function to store each verification calculation controller and the corresponding verification calculation capability information into the preset controller list. That is, the embodiment of the present application will call a callback function to store each verification calculation controller and the corresponding verification calculation capability information into the preset controller list for use in subsequent software RAID verification resource allocation.

[0108] Further, the above method further includes: when an information update command sent by any verification calculation controller is obtained, sending a preset query command to any verification calculation controller again to obtain updated controller information; updating the preset controller list based on the updated controller information. That is, the present application supports dynamic adjustment of the maximum IOPS value of verification calculation that can be provided by EP (Endpoint) devices such as RAID controllers or SSD controllers. When a RAID controller or an SSD controller fails or actively reduces / increases calculation verification resources during operation, it can send an information update command to the host to notify the host to re-obtain the controller information to update the preset controller list, so as to dynamically update its calculation verification capability.

[0109] Specifically, updating the preset controller list based on the updated controller information includes: if it is determined according to the updated controller information that any verification calculation controller does not have the verification calculation function, removing any verification calculation controller and the corresponding verification calculation capability information from the preset controller list; if it is determined according to the updated controller information that any verification calculation controller still has the verification calculation function, using the updated verification capability information in the updated controller information to update the verification capability information corresponding to any verification calculation controller in the preset controller list.

[0110] That is, there are mainly two situations in the process of updating the preset controller list. One situation is that it is determined according to the updated controller information that any verification calculation controller no longer has the verification calculation function, then removing any verification calculation controller and the corresponding verification calculation capability information from the preset controller list. The other situation is that it is determined according to the updated controller information that any verification calculation controller still has the verification calculation function, so using the updated verification capability information in the updated controller information to update the verification capability information corresponding to any verification calculation controller in the preset controller list.

[0111] Specifically, the information update command is a response command to an asynchronous event request command; correspondingly, the process of any check calculation controller sending an information update command includes: when any check calculation controller detects a change in the local check calculation capability information, it determines whether there is currently an asynchronous event request command sent by a target host; if so, it constructs an information update command based on a preset event type and preset event information used to represent the change in the local check calculation capability information; and sends the information update command as a response command to the asynchronous event request command to the target host.

[0112] It can be understood that the host will register a callback for NVMe device asynchronous event notification during the initialization process. When the number of check calculation resources is dynamically adjusted inside the XOR controller device, it will first determine whether there is currently an asynchronous event request command sent by a target host. Among them, the asynchronous event request command specifically refers to an AER (Asynchronous Event Request, an asynchronous event request command defined by the NVMe protocol, used for the mechanism of the host to register asynchronous event notification with the storage device) command, that is, the XOR controller will determine whether there is a blocked wait for an AER command. If so, inside the XOR controller, it assembles a response command to the AER command (i.e., Asynchronous Event Notice, AEN, an asynchronous event response command defined by the NVMe protocol, used to notify the host of the generation of an asynchronous event when an asynchronous event occurs inside the storage device, and the host performs corresponding processing according to different event types) based on a preset event type and preset event information used to represent the change in the local check calculation capability information, and interrupts to notify the host to complete the processing of the AEN. Through the asynchronous reporting mechanism, the reasonable use of hardware resources is optimized. When the hardware resources are idle, the check calculation load capacity is actively increased, and conversely, when the hardware resources are busy, the check calculation load capacity is actively decreased, so that the check calculation capability is reasonably supplied according to its own resource situation to improve the overall performance and fault tolerance of the hybrid RAID.

[0113] That is, the RAID controller or the SSD controller generates a check calculation attribute change event through the NVMe AER mechanism, and adds event information indicating the change in the calculation check attribute to the asynchronous event notification information of the NVMe protocol AER command, as shown in Table 3 specifically:

[0114] Table 3 Asynchronous Event Notification Information Table

[0115]

[0116] Further, after determining whether there is an asynchronous event request command sent by the target host currently, it further includes: if there is no unprocessed asynchronous event request command sent by the target host currently, storing preset event information used to represent a change in the local check computing capability information into the local event queue; when obtaining an asynchronous event request command sent by the target host, taking out the preset event information from the local event queue, constructing an information update command based on the preset event type and the preset event information, and then using the information update command as a response command to the asynchronous event request command and sending it to the target host. That is, if there is no unprocessed AER command sent by the target host currently, first store the preset event information used to represent a change in the local check computing capability information into the local event queue, and then when obtaining an asynchronous event request command sent by the target host subsequently, take out the preset event information from the local event queue, and construct an AEN command based on the preset event type and the preset event information and send it to the target host

[0117] Specifically, when the host obtains an information update command sent by any check computing controller, it resends a preset query command to any check computing controller, including: when obtaining an information update command sent by any check computing controller, parsing the information update command to obtain the event type and the event information; if the event type of the information update command is the preset event type and the event information of the information update command is the preset event information, resending the preset query command to any check computing controller.

[0118] That is, after the target host receives the AEN command, it obtains the event type Event Type and the event information Event Information through Dword 0. If it is determined that the event type is the preset event type Notice and the event information is the preset event information Parity Compute Attribute Changed, it resends an identify command (CNS01h) to the XOR controller to obtain the controller information again. That is, obtain the controller type field from the 111th byte of the Identify Controller Data Structure again. If the value of the controller type field is 4h, then it is the XOR controller, and obtain the maximum number of IOPS that the XOR controller can provide for check computing from the 107th to the 110th bytes and save it. The host then calls the callback function according to the newly obtained controller type and the maximum IOPS for check computing to complete the refresh of the XOR controller list information for use when allocating software RAID check resources subsequently.

[0119] Further, see Figure 3 as shown Figure 3Schematic diagram of a functional architecture applicable to the present application. It can be seen from the figure that the present application discloses a composite function pooling management method, which relies on a RAID controller and an SSD controller. The present application integrates an XOR engine pool in the host system to dynamically manage the XOR functions provided by the RAID controller and the SSD controller, and can flexibly allocate parity calculation resources according to the performance requirements of the software RAID, thereby optimizing performance and improving efficiency. The XOR engine pool has the following functions:

[0120] (1) XOR registration function, which provides a calculation parity registration function for EP devices such as RAID controllers or SSD controllers connected to the host RC (Root Complex), and serves as a data source for the XOR engine pool scheduling module to provide flexible calculation resources for the software RAID. During the startup process of the RAID controller or the SSD controller, the host obtains the controller information to obtain whether it supports calculation parity and its load capacity.

[0121] (2) XOR load update asynchronous notification function, which allows EP devices such as RAID controllers or SSD controllers to dynamically adjust the maximum IOPS value of the parity calculation that can be provided, and also serves as a data source for the XOR engine pool scheduling module to provide flexible calculation resources for the software RAID. During the operation of the RAID controller or the SSD controller, when a failure occurs or the calculation parity resources are actively reduced / increased, a parity calculation attribute change event is generated through the NVMe AER mechanism, and the host is notified to re-obtain the controller information to dynamically update its calculation parity ability. That is, the XOR controller can provide feedback on its load situation to the software RAID, enabling the software RAID to flexibly adjust task allocation according to the actual load of the controller, thereby improving the overall performance and efficiency.

[0122] (3) XOR resource scheduling function, which internally maintains a preset controller list, and the list information includes the maximum IOPS value of the parity calculation that each XOR controller can provide; according to the performance requirements of the software RAID, limited resources are allocated for it to be used by the software RAID in the parity calculation in the form of an API (Application Programming Interface).

[0123] The initialization process of the XOR engine pool includes the following content:

[0124] 1. Host XOR engine pool resource initialization, including XOR controller list resource application and initialization, callback registration for the completion of NVMe driver initialization, etc.;

[0125] 2. The host completes the allocation of the BAR space of the PCIe multifunctional device, and obtains the configuration space and relevant information of the capability list of the RAID controller or SSD controller;

[0126] 3. The host sends an identify command (CNS 01h) to the RAID controller or SSD controller to obtain the controller information (Identify Controller Data Structure). Obtain the Controller Type field of the device type from the 111th byte of the Identify Controller Data Structure. If the Controller Type is 4h, then the controller is an XOR controller, and proceed to step 4; otherwise, proceed to step 5;

[0127] 4. The host obtains and saves the maximum IOPS value that the XOR controller can provide for parity calculation from the 107th to the 110th bytes of the Identify Controller Data Structure;

[0128] 5. The host continues to complete other initialization work of the NVMe device, including queue initialization, interrupt initialization, etc.; if it is an XOR controller type, proceed to step 6, otherwise the NVMe device initialization is completed;

[0129] 6. After the host NVMe initialization is completed and the parity calculation capability information of the XOR controller has been obtained, then call the callback function provided during the initialization of the XOR engine pool, and assign the XOR controller information to the preset controller list managed by the XOR engine pool for use during subsequent software RAID parity resource allocation.

[0130] Step S12: Obtain the target parity calculation capability information of the first parity calculation controller, and determine whether the target parity calculation capability information meets the calculation resource requirements of the parity calculation task.

[0131] In this embodiment, obtaining the target parity calculation capability information of the selected first parity calculation controller and determining whether the target parity calculation capability information meets the calculation resource requirements of the parity calculation task means that this application does not directly use the first parity calculation controller to perform the parity calculation task, but needs to determine whether it has sufficient capabilities to meet the requirements of the current task.

[0132] Step S13: If it is satisfied, use the first parity calculation controller to perform the parity calculation task.

[0133] In this embodiment, if the target parity calculation capability information of the first parity calculation controller meets the calculation resource requirements of the parity calculation task, the first parity calculation controller can be used to perform the parity calculation task.

[0134] Step S14: If not satisfied, sequentially traverse the preset controller list until a second verification calculation controller that meets the computing resource requirements is determined, and then use the second verification calculation controller to execute the verification calculation task.

[0135] In this embodiment, if the target verification calculation capability information of the first verification calculation controller does not meet the computing resource requirements of the verification calculation task, it is necessary to sequentially traverse the preset controller list until a second verification calculation controller that meets the computing resource requirements is determined, and then use the second verification calculation controller to execute the verification calculation task. That is to say, this application first determines whether the matching first verification calculation controller can execute the current task. If not, then sequentially traverse the subsequent verification calculation controllers in the list. Moreover, since the random numbers generated by each verification calculation task are different, the range of controllers traversed subsequently is also different, and load balancing can also be achieved. In this way, this application can flexibly allocate corresponding verification resources according to the performance requirements of the verification calculation task, thereby improving the overall performance.

[0136] It can be seen that this application maintains a preset controller list locally on the target host. The list stores the verification calculation capability information of each current verification calculation controller. The verification calculation controller specifically refers to a hardware device that is connected to the target host and has the verification calculation function. When a verification calculation task is obtained, a corresponding target random number will be generated first, and the target random number will be used as an index value to obtain a matching first verification calculation controller from the preset controller list. That is to say, this application does not select the verification calculation controller to execute the verification calculation task in a fixed order, but adopts a randomized method to select, so as to achieve the load balancing of the verification calculation controller, avoid the situation that some controllers are under long-term high load while the rest of the controllers are idle, and can maximize the utilization of hardware resources. Further, it is also necessary to obtain the target verification calculation capability information of the selected first verification calculation controller and determine whether the target verification calculation capability information meets the calculation resource requirements of the verification calculation task. That is to say, this application does not directly use the first verification calculation controller to execute the verification calculation task, but needs to judge whether it has enough ability to meet the requirements of the current task. If it meets, then the first verification calculation controller can be used to execute the verification calculation task. If it does not meet, it is necessary to traverse the preset controller list in turn until the second verification calculation controller that meets the calculation resource requirements is determined, and then use the second verification calculation controller to execute the verification calculation task. That is to say, this application first judges whether the matching first verification calculation controller can execute the current task. If not, then it traverses the subsequent verification calculation controllers in the list in turn. And because the random numbers generated by each verification calculation task are different, the range of subsequent traversed controllers is also different, and the load balancing can also be achieved. In this way, this application can flexibly allocate corresponding verification resources according to the performance requirements of the verification calculation task, thereby improving the overall performance.

[0137] See Figure 4 and Figure 5 As shown, this embodiment of the application discloses a specific verification resource allocation method. Compared with the previous embodiment, this embodiment further explains and optimizes the technical solution. Specifically, it includes:

[0138] Step S21: When a verification calculation task is obtained, determine the current timestamp and the current number of controllers in the preset controller list, so as to generate a target random number according to the current timestamp and the current number of controllers.

[0139] In this embodiment, when the software RAID needs to execute a data verification calculation task, it will actively submit a verification calculation task carrying the calculation resource requirements to the XOR engine pool, where the calculation resource requirements are the IOPS values required for the verification calculation. When the target host obtains the verification calculation task, it will determine the current timestamp and the current number of controllers in the preset controller list, so as to generate a target random number according to the current timestamp and the current number of controllers.

[0140] In a specific implementation manner, generating a target random number according to the current timestamp and the current number of controllers includes: using the current timestamp as a random seed, and processing the random seed with a preset random number generation function to generate an initial random number; performing a modulo operation on the initial random number based on the current number of controllers to obtain the target random number. That is, assuming that the current number of controllers is N, the present application can first use the current timestamp as a random seed, process the random seed with a preset random number generation function to generate an initial random number, and then map the initial random number to 0 to N-1 to obtain the target random number. Specifically, the modulo operation can be performed on the initial random number using the current number of controllers N to obtain the target random number.

[0141] In another specific implementation manner, generating a target random number according to the current timestamp and the current number of controllers includes: converting the current timestamp into a corresponding integer value, and performing a summation operation on the integer value and the current number of controllers to use the summation operation result as a random seed; processing the random seed with a preset random number generation function to generate an initial random number; performing a modulo operation on the initial random number based on the current number of controllers to obtain the target random number. Similarly assuming that the current number of controllers is N, the present application can also first convert the current timestamp into a corresponding integer value, add the integer value and the current number of controllers as a random seed, then process the random seed with a preset random number generation function to generate an initial random number, and finally perform a modulo operation on the initial random number based on the current number of controllers N to obtain a target random number within the range of 0 to N-1.

[0142] Step S22: Using the target random number as an index value to obtain a matching first verification calculation controller from the preset controller list; wherein, the preset controller list stores the verification calculation capability information of each current verification calculation controller, and each verification calculation controller is a hardware device connected to the target host and having a verification calculation function.

[0143] In this embodiment, the generated target random number is used as an index value to obtain a matching first verification calculation controller from the preset controller list. It can be understood that since the current number of controllers in the preset controller list is N, its index can be represented as 0 to N-1, so the corresponding first verification calculation controller can be matched based on the previously calculated target random number.

[0144] Step S23: Obtain the target verification calculation capability information of the first verification calculation controller, and determine whether the target verification calculation capability information meets the computing resource requirements of the verification calculation task.

[0145] In this embodiment, further obtain the target verification calculation capability information of the first verification calculation controller from the preset controller list, that is, the maximum IOPS value, and determine whether this number is greater than or equal to the IOPS value required for the initial software RAID.

[0146] Step S24: If it is satisfied, use the first verification calculation controller to execute the verification calculation task.

[0147] In this embodiment, if the maximum IOPS value of the first verification calculation controller is greater than or equal to the IOPS value required for the initial software RAID, then select the first verification calculation controller as the hardware resource provider for software RAID calculation verification, that is, use the first verification calculation controller to execute the verification calculation task.

[0148] Step S25: If it is not satisfied, traverse the preset controller list in sequence until a second verification calculation controller that meets the computing resource requirements is determined, and then use the second verification calculation controller to execute the verification calculation task.

[0149] In this embodiment, if the maximum IOPS value of the first verification calculation controller is less than the IOPS value required for the initial software RAID, then start from the first verification calculation controller and traverse the preset controller list in index order, that is, sequentially obtain the maximum IOPS values of the subsequent verification calculation controllers, and determine whether they are greater than or equal to the IOPS value required for the software RAID. If there is a second verification calculation controller that meets the computing resource requirements in the preset controller list, then use the second verification calculation controller to execute the verification calculation task.

[0150] Step S26: If there is no verification calculation controller that meets the computing resource requirements in the preset controller list, split the verification calculation task into a corresponding number of first subtasks according to the current splitting granularity.

[0151] In this embodiment, if no verification calculation controller that meets the computing resource requirements is found after traversing the preset controller list, then split the verification calculation task into a corresponding number of first subtasks according to the current splitting granularity and rematch, that is, split the initial required IOPS value into multiple smaller IOPS values. Among them, the splitting granularity defaults to 2 / 4 / 6 / … / 2n granularity.

[0152] Step S27: Traverse the preset controller list to determine a third verification calculation controller that meets the computing resource requirements of each first subtask, and use the third verification calculation controller to execute the first subtask.

[0153] In this embodiment, re-traverse the preset controller list to determine a third verification calculation controller that meets the computing resource requirements of each first subtask, and use the third verification calculation controller to execute the first subtask. For example, assume that the required IOPS for software RAID = 50K, but the remaining IOPS of the largest single controller = 30K. At this time, split the required IOPS = 50K into 25K + 25K according to the granularity of 2, that is, the computing resource requirement for each first subtask is 25K. At this time, allocate these two first subtasks to two verification calculation controllers with the largest IOPS value exceeding 25K.

[0154] In the specific implementation manner, traversing the preset controller list to determine a third verification calculation controller that meets the computing resource requirements of each first subtask includes: generating a random index according to the timestamp information and task identification number of each first subtask; starting from the random index, traverse the preset controller list to determine a third verification calculation controller that meets the computing resource requirements of each first subtask. That is, this application also needs to re-execute the process of generating a random index and matching the controller for each subtask. Specifically, a random index can be generated according to the timestamp information and task identification number of each first subtask, and then start from the random index to traverse the preset controller list to determine a third verification calculation controller that meets the computing resource requirements of each first subtask.

[0155] In addition, the above method further includes: if there is no verification calculation controller in the preset controller list that meets the computing resource requirements of the first subtask, increase the current splitting granularity by a preset step length to obtain a new current splitting granularity; split the verification calculation task into a corresponding number of second subtasks according to the new current splitting granularity, and then traverse the preset controller list to determine a fourth verification calculation controller that meets the computing resource requirements of each second subtask, and use the fourth verification calculation controller to execute the second subtask; if there is no verification calculation controller in the preset controller list that meets the computing resource requirements of the second subtask, re-jump to the step of increasing the current splitting granularity by a preset step length to obtain a new current splitting granularity.

[0156] That is, if, after splitting the verification calculation task into a corresponding number of first subtasks according to the current splitting granularity, there is still no verification calculation controller in the preset controller list that meets the computing resource requirements of the first subtask, it is necessary to increase the current splitting granularity by a preset step length to obtain a new current splitting granularity. For example, if the previous current splitting granularity was 2, it is further increased to 4. Then, the verification calculation task is split into a corresponding number of second subtasks according to the new current splitting granularity. Next, the preset controller list is traversed to determine the fourth verification calculation controller that meets the computing resource requirements of each second subtask, so as to use the fourth verification calculation controller to execute the second subtask. If there is no verification calculation controller in the preset controller list that meets the computing resource requirements of the second subtask, it will jump back to the step of increasing the current splitting granularity by a preset step length to obtain a new current splitting granularity.

[0157] For example, assume that the required IOPS for software RAID = 60K;

[0158] Preset controller list:

[0159] Verification calculation controller A: Remaining IOPS = 20K;

[0160] Verification calculation controller B: Remaining IOPS = 25K;

[0161] Verification calculation controller C: Remaining IOPS = 15K;

[0162] Verification calculation controller D: Remaining IOPS = 15K;

[0163] First traversal of the list: No controller meets 60K, so the splitting process is triggered;

[0164] Split into 2 parts (30K + 30K):

[0165] The first subtask (requiring 30K IOPS): No controller meets, continue to split;

[0166] Split into 4 parts (15K + 15K + 15K + 15K):

[0167] The second subtask 1 (requiring 15K IOPS): Allocated to controller A;

[0168] The second subtask 2 (requiring 15K IOPS): Allocated to controller B;

[0169] The second subtask 3 (requiring 15K IOPS): Allocated to controller C;

[0170] The second subtask 4 (requiring 15K IOPS): Allocated to controller D;

[0171] All subtasks are assigned, and the process ends.

[0172] It should be noted that when some subtasks match successfully, but there are still some subtasks that do not match successfully, these unmatched subtasks can be split again, or the entire verification calculation task can be split again.

[0173] It can be seen that this application combines the advantages of hybrid RAID, provides a flexible verification resource allocation mechanism for software RAID, and further improves the overall performance and fault tolerance of hybrid RAID; this application accelerates data verification calculation through hardware, reduces the computing power of the host CPU, and improves the other processing capabilities of the host system; this application can also implement the concurrency ability of verification calculation. Through flexible resource allocation, it realizes the concurrent calculation of data redundancy verification by software RAID, and can simultaneously call multiple calculation verification controllers to execute verification calculation tasks.

[0174] See Figure 6 As shown, an embodiment of this application discloses a verification resource allocation device, which is applied to a target host. The device includes:

[0175] A controller matching module 11, configured to generate a target random number when obtaining a verification calculation task, and use the target random number as an index value to obtain a matching first verification calculation controller from a preset controller list; wherein, the preset controller list stores the verification calculation capability information of each current verification calculation controller, and each verification calculation controller is a hardware device connected to the target host and having a verification calculation function;

[0176] A judgment module 12, configured to obtain the target verification calculation capability information of the first verification calculation controller, and judge whether the target verification calculation capability information meets the calculation resource requirements of the verification calculation task;

[0177] A task execution module 13, configured to, if it is satisfied, use the first verification calculation controller to execute the verification calculation task;

[0178] A traversal module 14, configured to, if it is not satisfied, sequentially traverse the preset controller list until a second verification calculation controller that meets the calculation resource requirements is determined, and then use the second verification calculation controller to execute the verification calculation task.

[0179] As can be seen, the present application maintains a preset controller list locally on the target host. The list stores the check calculation capability information of each current check calculation controller. The check calculation controller specifically refers to a hardware device that is connected to the target host and has the check calculation function. When obtaining a check calculation task, a corresponding target random number will be generated first, and the target random number will be used as an index value to obtain a matching first check calculation controller from the preset controller list. That is, the present application does not select a check calculation controller to execute the check calculation task in a fixed order, but adopts a randomized method to select, so as to achieve load balancing of the check calculation controllers, avoid the situation where some controllers are under high load for a long time while the rest of the controllers are idle, and can maximize the use of hardware resources. Further, it is also necessary to obtain the target check calculation capability information of the selected first check calculation controller and determine whether the target check calculation capability information meets the calculation resource requirements of the check calculation task. That is, the present application does not directly use the first check calculation controller to execute the check calculation task, but needs to determine whether it has sufficient ability to meet the requirements of the current task. If it meets the requirements, then the first check calculation controller can be used to execute the check calculation task. If it does not meet the requirements, it is necessary to sequentially traverse the preset controller list until a second check calculation controller that meets the calculation resource requirements is determined, and then use the second check calculation controller to execute the check calculation task. That is, the present application first determines whether the matching first check calculation controller can execute the current task. If not, then sequentially traverse the subsequent check calculation controllers in the list. And because the random numbers generated for each check calculation task are different, the range of subsequent traversed controllers is also different, and load balancing can also be achieved. In this way, the present application can flexibly allocate corresponding check resources according to the performance requirements of the check calculation task, thereby improving the overall performance.

[0180] Since the embodiments of the device part correspond to the above embodiments, the embodiments of the device part are described with reference to the embodiments of the above method part and will not be elaborated here.

[0181] Figure 7 It is a schematic structural diagram of an electronic device provided by an embodiment of the present application. Specifically, it 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. Among them, the memory 22 is used to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps in the check resource allocation method executed by the electronic device disclosed in any of the foregoing embodiments.

[0182] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and no specific limitation is imposed on it here; the input / output interface 25 is used to obtain external input data or output data to the outside, and its specific interface type can be selected according to specific application needs, and no specific limitation is imposed here.

[0183] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor used to process data in the wake state, also known as the CPU (Central Processing Unit); the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 21 may be integrated with a GPU (Graphics Processing Unit), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may further include an AI (Artificial Intelligence) processor, and the AI processor is used to process computational operations related to machine learning.

[0184] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, a random access memory, a disk, or an optical disc, etc. The resources stored thereon include an operating system 221, a computer program 222, and data 223, etc., and the storage method can be temporary storage or permanent storage.

[0185] Among them, the operating system 221 is used to manage and control each hardware device on the electronic device 20 and the computer program 222, so as to implement the operation and processing of the massive data 223 in the memory 22 by the processor 21. It can be Windows, Unix, Linux, etc. In addition to the computer program that can be used to complete the verification resource allocation method executed by the electronic device 20 disclosed in any of the foregoing embodiments, the computer program 222 may further include a computer program that can be used to complete other specific tasks. The data 223 may include not only the data transmitted by external devices received by the electronic device, but also the data collected by its own input / output interface 25, etc.

[0186] Furthermore, an embodiment of the present application also discloses a computer-readable storage medium. When the computer program stored in the storage medium is loaded and executed by a processor, the steps of the verification resource allocation method disclosed in any of the foregoing embodiments are implemented.

[0187] An embodiment of the present invention also discloses a computer program product, including a computer program / instructions. When the computer program / instructions are executed by a processor, the steps of the verification resource allocation method disclosed in any of the foregoing embodiments are implemented.

[0188] In this specification, the various embodiments are described in a progressive manner. The key point of each embodiment is to illustrate the differences from other embodiments. The same or similar parts among the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple. For the relevant parts, refer to the description of the method part.

[0189] Those skilled in the art can further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed in this article can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner 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 to exceed the scope of this application.

[0190] The steps of the methods or algorithms described in connection with the embodiments disclosed herein may be implemented directly in hardware, in software modules executed by a processor, or in a combination thereof. The software modules may be located in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, a hard disk, a removable disk, a compact disc read-only memory (CD-ROM), or any other form of storage medium known in the art.

[0191] Finally, it should also be noted that in this document, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variation thereof is intended to cover a non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the phrase "comprising a..." does not exclude the presence of additional identical elements in the process, method, article or device comprising the element.

[0192] The above has introduced in detail a method, apparatus, device and storage medium for allocating verification resources provided by the present invention. Specific examples are used herein to elaborate on the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present invention.

Claims

1. A resource allocation verification method, characterized in that, Applied to a target host, including: Generating a target random number when obtaining a verification calculation task, and using the target random number as an index value to obtain a matching first verification calculation controller from a preset controller list; wherein, the preset controller list stores the verification calculation capability information of each current verification calculation controller, and each of the verification calculation controllers is a hardware device connected to the target host and having a verification calculation function; Obtaining the target verification calculation capability information of the first verification calculation controller, and determining whether the target verification calculation capability information meets the calculation resource requirements of the verification calculation task; If it meets the requirements, using the first verification calculation controller to execute the verification calculation task; If it does not meet the requirements, sequentially traverse the preset controller list until a second verification calculation controller that meets the calculation resource requirements is determined, and then use the second verification calculation controller to execute the verification calculation task; Wherein, the generating a target random number when obtaining a verification calculation task includes: Determining the current timestamp when obtaining a verification calculation task, and determining the current number of controllers in the preset controller list; Generating a target random number according to the current timestamp and the current number of controllers; The sequentially traversing the preset controller list includes: Sequentially traversing the preset controller list in index order starting from the first verification calculation controller.

2. The calibration resource allocation method according to claim 1, wherein The generating a target random number according to the current timestamp and the current number of controllers includes: Using the current timestamp as a random seed, and processing the random seed with a preset random number generation function to generate an initial random number; Performing a modulo operation on the initial random number based on the current number of controllers to obtain a target random number.

3. The verification resource allocation method according to claim 1, wherein The generating a target random number according to the current timestamp and the current number of controllers includes: Converting the current timestamp into a corresponding integer value, and performing a summation operation on the integer value and the current number of controllers to use the summation operation result as a random seed; Processing the random seed with a preset random number generation function to generate an initial random number; Performing a modulo operation on the initial random number based on the current number of controllers to obtain a target random number.

4. The calibration resource allocation method according to claim 1, wherein The hardware device is a disk array controller or a solid state drive controller; Correspondingly, the method further includes: During the startup process of the disk array controller or the solid state drive controller, obtaining the corresponding controller information, and determining whether the disk array controller or the solid state drive controller has a verification calculation function based on the controller information; If so, using the disk array controller or the solid state drive controller with the verification calculation function as a verification calculation controller, and obtaining the verification calculation capability information of the verification calculation controller; Storing each of the verification calculation controllers and the corresponding verification calculation capability information into the preset controller list.

5. The check resource allocation method according to claim 4, wherein The obtaining the corresponding controller information, and determining whether the disk array controller or the solid state drive controller has a verification calculation function based on the controller information includes: Send a preset query command to the disk array controller or the solid-state drive controller to obtain the corresponding controller information; Obtain the controller type attribute from the first target byte of the controller information; Determine whether the current attribute value of the controller type attribute is a preset attribute value corresponding to the check calculation controller set in advance; If so, determine that the disk array controller or the solid-state drive controller has the check calculation function, otherwise determine that the disk array controller or the solid-state drive controller does not have the check calculation function.

6. The verification resource allocation method according to claim 5, wherein The check calculation ability information is an IOPS value; Correspondingly, obtaining the check calculation ability information of the check calculation controller includes: Obtain the IOPS value of the check calculation controller from the second target byte of the controller information.

7. The calibration resource allocation method according to claim 4, wherein Storing each of the check calculation controllers and the corresponding check calculation ability information into the preset controller list includes: Obtain the preset controller list created in advance; Call a callback function to store each of the check calculation controllers and the corresponding check calculation ability information into the preset controller list.

8. The verification resource allocation method according to claim 5, wherein It further includes: When an information update command sent by any check calculation controller is obtained, resend the preset query command to the any check calculation controller to obtain updated controller information; Update the preset controller list based on the updated controller information.

9. The verification resource allocation method according to claim 8, wherein Updating the preset controller list based on the updated controller information includes: If it is determined according to the updated controller information that the any check calculation controller does not have the check calculation function, remove the any check calculation controller and the corresponding check calculation ability information from the preset controller list; If it is determined according to the updated controller information that the any check calculation controller still has the check calculation function, update the check ability information corresponding to the any check calculation controller in the preset controller list with the updated check ability information in the updated controller information.

10. The check resource allocation method according to claim 8, wherein The information update command is a response command to an asynchronous event request command; Correspondingly, the process of any check calculation controller sending an information update command includes: When the any check calculation controller detects that the local check calculation ability information has changed, determine whether there is currently an asynchronous event request command sent by the target host; If so, construct an information update command based on a preset event type and preset event information indicating that the local check calculation ability information has changed; Use the information update command as a response command to the asynchronous event request command and send it to the target host.

11. The verification resource allocation method according to claim 10, wherein After determining whether there is currently an asynchronous event request command sent by the target host, it further includes: If there is currently no unprocessed asynchronous event request command sent by the target host, store the preset event information indicating that the local check calculation ability information has changed into the local event queue; When receiving the asynchronous event request command sent by the target host, retrieve the preset event information from the local event queue, construct an information update command based on the preset event type and the preset event information, and then use the information update command as the response command to the asynchronous event request command and send it to the target host.

12. The verification resource allocation method according to claim 10, wherein When receiving the information update command sent by any check calculation controller, resending the preset query command to the any check calculation controller includes: When receiving the information update command sent by any check calculation controller, parse the information update command to obtain the event type and event information; If the event type of the information update command is the preset event type and the event information of the information update command is the preset event information, resend the preset query command to the any check calculation controller.

13. The check resource allocation method according to any one of claims 1 to 12, characterized in that, After traversing the preset controller list, it further includes: If there is no check calculation controller in the preset controller list that meets the computing resource requirements, split the check calculation task into a corresponding number of first subtasks according to the current splitting granularity; Traverse the preset controller list to determine a third check calculation controller that meets the computing resource requirements of each first subtask, and use the third check calculation controller to execute the first subtask.

14. The verification resource allocation method according to claim 13, wherein Traversing the preset controller list to determine a third check calculation controller that meets the computing resource requirements of each first subtask includes: Generate a random index according to the timestamp information and task identification number of each first subtask; Start traversing the preset controller list from the random index to determine a third check calculation controller that meets the computing resource requirements of each first subtask.

15. The check resource allocation method according to claim 13, wherein It further includes: If there is no check calculation controller in the preset controller list that meets the computing resource requirements of the first subtask, increase the current splitting granularity by a preset step length to obtain a new current splitting granularity; Split the check calculation task into a corresponding number of second subtasks according to the new current splitting granularity, then traverse the preset controller list to determine a fourth check calculation controller that meets the computing resource requirements of each second subtask, and use the fourth check calculation controller to execute the second subtask; If there is no check calculation controller in the preset controller list that meets the computing resource requirements of the second subtask, jump back to the step of increasing the current splitting granularity by a preset step length to obtain a new current splitting granularity.

16. A resource allocation verification device, characterized in that, Applied to the target host, it includes: A controller matching module, configured to generate a target random number when receiving a check calculation task, and use the target random number as an index value to obtain a matching first check calculation controller from a preset controller list; wherein, the preset controller list stores the check calculation capability information of current check calculation controllers, and each check calculation controller is a hardware device connected to the target host and having a check calculation function. A judgment module, configured to obtain the target verification calculation capability information of the first verification calculation controller, and judge whether the target verification calculation capability information meets the calculation resource requirements of the verification calculation task; A task execution module, configured to, if it is satisfied, use the first verification calculation controller to execute the verification calculation task; A traversal module, configured to, if it is not satisfied, sequentially traverse the preset controller list until a second verification calculation controller that meets the calculation resource requirements is determined, and then use the second verification calculation controller to execute the verification calculation task; Wherein, the controller matching module is specifically configured to determine the current timestamp when a verification calculation task is obtained, and determine the current number of controllers in the preset controller list; generate a target random number according to the current timestamp and the current number of controllers; The traversal module is specifically configured to sequentially traverse the preset controller list in index order starting from the first verification calculation controller.

17. An electronic device, characterized in that, Including: A memory, configured to store a computer program; A processor, configured to execute the computer program to implement the steps of the verification resource allocation method according to any one of claims 1 to 15.

18. A computer-readable storage medium, characterized in that, For storing a computer program; wherein, when the computer program is executed by a processor, the steps of the verification resource allocation method according to any one of claims 1 to 15 are implemented.

19. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by a processor, the steps of the verification resource allocation method according to any one of claims 1 to 15 are implemented.

Citation Information

Patent Citations

  • Resource allocation method and apparatus, and electronic device

    CN107608790A

  • Resource allocation method and device, electronic equipment and storage medium

    CN116010110A

  • Computing power resource allocation method and device, equipment, storage medium and product

    CN118093183A