Command execution method, device and computer equipment based on resource allocation

By determining the number and ranking of trust resources in the virtual NVMe subsystem and calculating the duration they occupy in the command processing engine, the problem of unfair resource allocation in traditional systems is solved, and fair allocation of trust resources and time resources is achieved, thereby improving the fairness and efficiency of resource allocation.

CN115686851BActive Publication Date: 2026-07-31HUNAN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HUNAN UNIV
Filing Date
2022-11-03
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

In traditional methods, resource allocation is unfair, and computer resources cannot be allocated equally to execute corresponding commands when facing multiple applications.

Method used

Based on the attributes of the commands encapsulated by each virtual NVMe subsystem, the number of trusted resources is determined, and the subsystems are sorted according to the number of trusted resources. The duration during which each virtual NVMe subsystem is allowed to occupy the command processing engine is calculated, and the execution of commands is controlled based on the allocation results of trusted resources.

Benefits of technology

It achieves fair allocation of trust resources and fair allocation of time resources, ensuring that each virtual NVMe subsystem can fairly occupy the command processing engine time, thereby improving the fairness and efficiency of resource allocation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115686851B_ABST
    Figure CN115686851B_ABST
Patent Text Reader

Abstract

This application relates to a command execution method, apparatus, and computer device based on resource allocation. The method includes: determining the number of trusted resources for each virtual NVMe subsystem based on the attributes of the commands encapsulated in each virtual NVMe subsystem; sorting the virtual NVMe subsystems according to their respective trusted resource counts to obtain a sorting result; calculating, based on the sorting result, the allowed duration for each virtual NVMe subsystem to occupy the command processing engine to obtain a duration resource allocation result; and controlling each virtual NVMe subsystem to sequentially occupy the command processing engine to execute its encapsulated commands based on the duration resource allocation result. This method enables fair resource allocation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of cloud computing technology, and in particular to a command execution method, apparatus, computer device, storage medium, and computer program product based on resource allocation. Background Technology

[0002] With the advent of the cloud computing and big data era, services provided by traditional servers can now be accessed in the "cloud," and services such as cloud gaming and cloud desktops are gradually entering people's lives. To address the shortcomings of traditional layered architectures, virtualization and cloud scheduling management logically integrate computing, storage, and network devices from different manufacturers into a "cloud computing resource pool," providing adaptive, on-demand resource provisioning support for upper-layer applications. Traditionally, resource allocation is primarily based on the SATA protocol (Serial Advanced Technology Attachment).

[0003] However, traditional methods suffer from unfair resource allocation, failing to allocate computer resources equally to execute corresponding commands when faced with multiple applications. Summary of the Invention

[0004] Therefore, it is necessary to provide a resource allocation-based command execution method, apparatus, computer device, computer-readable storage medium, and computer program product that can equally allocate resources, addressing the aforementioned technical problems.

[0005] Firstly, this application provides a command execution method based on resource allocation, the method comprising:

[0006] Based on the attributes of the commands encapsulated in each virtual NVMe (Non-Volatile Memory Host Controller Interface Specification) subsystem, determine the number of trusted resources for each virtual NVMe subsystem.

[0007] The virtual NVMe subsystems are sorted according to the number of trusted resources for each subsystem, resulting in a sorting order.

[0008] Based on the sorting results, the duration for which each virtual NVMe subsystem is allowed to occupy the command processing engine is calculated sequentially to obtain the allocation result of the duration resources;

[0009] Based on the allocation results of the time-limited resources, each virtual NVMe subsystem is controlled to sequentially occupy the command processing engine to execute the encapsulated commands.

[0010] In one embodiment, the attributes of the command include the type of the command, the number of commands, and the number of queues consisting of the commands;

[0011] The determination of the number of trusted resources for each virtual NVMe subsystem based on the attributes of the commands encapsulated in each virtual NVMe subsystem includes:

[0012] The mapping process is performed on the type of command encapsulated in each virtual NVMe subsystem, the number of commands, the number of queues composed of the commands, the number of virtual NVMe subsystems, and the bandwidth parameters corresponding to each virtual NVMe subsystem to obtain the mapping result corresponding to each virtual NVMe subsystem.

[0013] The mapping result is multiplied by the total amount of trust resources in the trust resource pool to obtain the amount of trust resources for each virtual NVMe subsystem.

[0014] In one embodiment, sorting the virtual NVMe subsystems according to the number of trusted resources of each virtual NVMe subsystem to obtain the sorting result includes:

[0015] The number of trusted resources for each virtual NVMe subsystem is recorded using an array to obtain the data recording results.

[0016] Each value in the data record is sorted according to its numerical value to obtain the sorting result.

[0017] In one embodiment, the step of calculating the allowed time for each virtual NVMe subsystem to occupy the command processing engine based on the sorting result, and obtaining the time resource allocation result, includes:

[0018] Based on the sorting results, the first target virtual NVMe subsystem corresponding to the largest value in the sorting results and the second target virtual NVMe subsystem corresponding to the second largest value are determined, and a first duration for which the command processing engine is allowed to be occupied is allocated to the first target virtual NVMe subsystem.

[0019] Calculate the ratio of the number of trusted resources in the second target virtual NVMe subsystem to the number of trusted resources in the first target virtual NVMe subsystem, and obtain the ratio result;

[0020] The ratio result is multiplied by the first duration to obtain the second duration during which the second target virtual NVMe subsystem is allowed to occupy the command processing engine.

[0021] According to the second calculation method, the duration for which each virtual NVMe subsystem is allowed to occupy the command processing engine is calculated sequentially to obtain the allocation result of the duration resources.

[0022] In one embodiment, controlling each virtual NVMe subsystem to sequentially occupy the command processing engine to execute the encapsulated commands based on the allocation result of the duration resources includes:

[0023] If the target virtual NVMe subsystem occupying the command processing engine is found to have either trusted resources or an incomplete command, then the target virtual NVMe subsystem is controlled to enter a waiting state.

[0024] If, during polling, it is found that the target virtual NVMe subsystem occupying the command processing engine has both trusted resources and incomplete commands, then the target virtual NVMe subsystem is controlled to occupy the command processing engine to execute the encapsulated commands.

[0025] In one embodiment, the method further includes:

[0026] The unexecuted commands encapsulated in each of the virtual NVMe subsystems are classified and processed according to the command type to obtain multiple queues of incomplete commands;

[0027] When the virtual NVMe subsystem occupies the command processing engine, it executes each command in the incomplete command queue in parallel and puts the executed commands into the corresponding completed command queue.

[0028] Secondly, this application provides a naming execution apparatus based on resource allocation, the apparatus comprising:

[0029] The trust resource quantity determination module is used to determine the trust resource quantity of each virtual NVMe subsystem based on the attributes of the commands encapsulated by each virtual NVMe subsystem.

[0030] The sorting result acquisition module is used to sort the virtual NVMe subsystems according to the number of trusted resources of each virtual NVMe subsystem, and obtain the sorting result;

[0031] The time-based resource allocation module is used to calculate the time allowed for each virtual NVMe subsystem to occupy the command processing engine based on the sorting results, and obtain the time-based resource allocation results.

[0032] The command execution module is used to control each of the virtual NVMe subsystems to sequentially occupy the command processing engine to execute the encapsulated commands based on the allocation result of the time-limited resources.

[0033] Thirdly, this application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the above-described method.

[0034] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described method.

[0035] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described method.

[0036] The aforementioned command execution method, apparatus, computer device, storage medium, and computer program product based on resource allocation calculate the amount of allocable trust resources for each virtual NVMe subsystem according to the attributes of the commands encapsulated within each virtual NVMe subsystem. This enables a fair allocation of trust resources, providing a strong prerequisite for the fair allocation of command processing engine time. By calculating the allowed command processing engine time for each virtual NVMe subsystem based on the sorting results, the time resource requirements of each virtual NVMe subsystem can be considered holistically, thereby achieving a fair allocation of time resources. Attached Figure Description

[0037] Figure 1 This is an application environment diagram of a command execution method based on resource allocation in one embodiment;

[0038] Figure 2 This is a flowchart illustrating a command execution method based on resource allocation in one embodiment;

[0039] Figure 3 This is a flowchart illustrating a command execution method based on resource allocation in another embodiment;

[0040] Figure 4 This is a flowchart illustrating a command execution method based on resource allocation in another embodiment;

[0041] Figure 5 This is a schematic diagram of the framework of a command execution method based on resource allocation in one embodiment;

[0042] Figure 6 This is a structural block diagram of a command execution device based on resource allocation in one embodiment;

[0043] Figure 7 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0044] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0045] The command execution method based on resource allocation provided in this application can be applied to, for example... Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or placed in the cloud or on another network server. Server 104 calculates the amount of trust resources that each virtual NVMe subsystem can be allocated based on the attribute characteristics of the commands encapsulated by each virtual NVMe subsystem. Server 104 then sorts the virtual NVMe subsystems according to the amount of trust resources allocated to each subsystem, obtaining a ranking result based on the amount of trust resources. Next, based on the ranking result, server 104 calculates the allowed time for each virtual NVMe subsystem to occupy the command processing engine, thus obtaining a time resource allocation result for the virtual NVMe subsystems. Finally, based on the calculated time resource allocation result, server 104 controls the virtual NVMe subsystems to sequentially occupy the command processing engine to execute the encapsulated commands. The terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, and smart in-vehicle systems. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted devices. The server 104 can be implemented using a standalone server or a server cluster consisting of multiple servers.

[0046] In one embodiment, such as Figure 2 As shown, a command execution method based on resource allocation is provided, which can be applied to... Figure 1 Taking server 104 as an example, the following steps are included:

[0047] Step 202: Determine the number of trusted resources for each virtual NVMe subsystem based on the attributes of the commands encapsulated in each virtual NVMe subsystem.

[0048] A virtual NVMe subsystem refers to a system virtualized from a solid-state drive (SSD) based on the NVMe protocol when processing computing tasks, used to fulfill the different types of cloud service needs of client machines. Different types of cloud service needs have asymmetrical resource requirements. Structurally, each virtual NVMe subsystem logically monopolizes processing, transmission, and storage resources, and similar resources among multiple virtual NVMe subsystems are approximately symmetrical. However, in terms of performance, the processing, transmission, and storage capabilities or performance that each virtual NVMe subsystem can provide are not entirely the same, meaning that the performance among multiple virtual NVMe subsystems is asymmetrical.

[0049] The attributes of a command refer to its type, the number of commands, and the number of queues formed by all commands encapsulated in the virtual NVMe subsystem. For example, if virtual NVMe subsystem A encapsulates commands A, B, and C, and all three commands are of type M, and these three commands form three parallel queues, then the attributes of this virtual NVMe subsystem are: command type M, number of commands 3, and number of queues formed by the commands 3.

[0050] Trusted resources refer to usable resources within a physical device. Examples include data processing resources, data transmission resources, and data storage resources. Each trusted resource is managed uniformly by the physical device. When a virtual NVMe subsystem has resource requirements, a trusted resource allocation method is used to allocate trusted resources to the virtual NVMe subsystem.

[0051] For example, the server calculates the number of trust resources available to each virtual NVMe subsystem based on the type of command encapsulated in each virtual NVMe subsystem, the number of commands, and the number of queues formed by the commands.

[0052] Step 204: Sort the virtual NVMe subsystems according to the number of trusted resources of each virtual NVMe subsystem to obtain the sorting results.

[0053] The sorting result is based on the number of trust resources allocated to each virtual NVMe subsystem. For example, if virtual NVMe subsystem A has 2 trust resources, virtual NVMe subsystem B has 3, and virtual NVMe subsystem C has 4, sorting them from largest to smallest would result in: Virtual NVMe subsystem C > Virtual NVMe subsystem B > Virtual NVMe subsystem A. Alternatively, sorting virtual NVMe subsystems A, B, and C from smallest to largest would result in: Virtual NVMe subsystem A > Virtual NVMe subsystem B > Virtual NVMe subsystem C.

[0054] For example, the server arranges the virtual NVMe subsystems in descending or ascending order according to the number of trust resources allocated to each virtual NVMe subsystem, thereby obtaining the desired sorting result.

[0055] Step 206: Based on the sorting results, calculate the duration for which each virtual NVMe subsystem is allowed to occupy the command processing engine, and obtain the allocation result of the duration resources.

[0056] The command processing engine is the engine in the physical device used to execute commands encapsulated within the virtual NVMe subsystem. Duration resources refer to the time each virtual NVMe subsystem is allowed to occupy the command processing engine for a single instance to complete the encapsulated command. For example, if virtual NVMe subsystem A has a duration resource of 10ms, then after virtual NVMe subsystem A occupies the command processing engine for 10ms, the process switches to the next virtual NVMe subsystem to occupy the command processing engine.

[0057] For example, the server calculates the allowed time for each virtual NVMe subsystem to occupy the command processing engine based on the sorting results of the virtual NVMe subsystems in the sorting order, thereby obtaining the allocation result of time resources for each virtual NVMe subsystem.

[0058] Step 208: Based on the allocation result of time-based resources, control each virtual NVMe subsystem to sequentially occupy the command processing engine to execute the encapsulated commands.

[0059] In the above-mentioned command execution method based on resource allocation, the number of allocatable trust resources for each virtual NVMe subsystem is calculated according to the attributes of the commands encapsulated by each virtual NVMe subsystem. This ensures a fair allocation of trust resources, providing a strong prerequisite for the fair allocation of command processing engine time. By calculating the allowed command processing engine time for each virtual NVMe subsystem based on the sorting results of the virtual NVMe subsystems, the time resource requirements of each virtual NVMe subsystem can be considered as a whole, thereby achieving a fair allocation of time resources.

[0060] In one embodiment, the attributes of a command include the command type, the number of commands, and the number of queues comprising the commands. Based on the attributes of the commands encapsulated by each virtual NVMe subsystem, the number of trust resources for each virtual NVMe subsystem is determined, including:

[0061] The mapping process is performed on the type of command encapsulated in each virtual NVMe subsystem, the number of commands, the number of command queues, the number of virtual NVMe subsystems, and the bandwidth parameters corresponding to each virtual NVMe subsystem to obtain the mapping result corresponding to each virtual NVMe subsystem.

[0062] The mapping result is multiplied by the total amount of trust resources in the trust resource pool to obtain the amount of trust resources for each virtual NVMe subsystem.

[0063] The bandwidth parameter is determined by the NVMe-based solid-state drive (SSD) that generates the virtual NVMe subsystem, and the bandwidth parameters vary depending on the NVMe protocol used. For example, the Intel P3600 series has a maximum sequential read bandwidth of 2600MB / s and a maximum sequential write bandwidth of 1250MB / s.

[0064] Mapping processing establishes a mapping relationship between the number of trusted resources and the types of commands encapsulated by the virtual NVMe subsystems, the number of commands, the number of command queues, the number of virtual NVMe subsystems encapsulating the commands, and the bandwidth parameters corresponding to the virtual NVMe subsystems.

[0065] A trust resource pool is a collection of trusted resources, serving as a configuration mechanism for partitioning physical device resources. Each physical device has a default resource pool. When a resource in the pool is no longer in use, the pool clears the busy flag for that resource, indicating that it can be used by the next request.

[0066] For example, the server uses the command type RB encapsulated in the virtual NVMe subsystem i. i The number of commands RNUM i The number of queues consisting of commands, QNUM i The number N of virtual NVMe subsystems encapsulating commands, and the bandwidth parameter BW of virtual NVMe subsystem i. i A mapping process is performed to obtain the mapping result corresponding to virtual NVMe subsystem i. Then, the mapping result corresponding to virtual NVMe subsystem i is multiplied by the total amount of trust resources C in the trust resource pool to obtain the amount of trust resources C allocated to virtual NVMe subsystem i. i The calculation process is as follows:

[0067] C i =f(RB) i ,N)*C=f(RNUM i QNUM i BW i ,N)*C

[0068] In this embodiment, a new trust resource is allocated to each virtual NVMe subsystem through a mapping processing method. This enables the trust resources in the trust resource pool to be allocated according to the resource requirements of each virtual NVMe subsystem, thereby achieving a fair allocation of trust resources.

[0069] In one embodiment, the virtual NVMe subsystems are sorted according to the number of trust resources of each virtual NVMe subsystem, and the sorting result includes:

[0070] The number of trusted resources for each virtual NVMe subsystem is recorded using an array to obtain the data recording results.

[0071] Sort each value in the data record results according to its size to obtain the sorted result.

[0072] For example, after calculating the number of trust resources allocated to each virtual NVMe subsystem, the server records the calculation results in the form of an array. After the server records the trust resource data values ​​allocated to each virtual NVMe subsystem in the same array, it sorts the data values ​​in the array according to the rules of ascending or descending, thereby obtaining the sorting results for the virtual NVMe subsystems.

[0073] In this embodiment, by using an array to record the number of trust resources allocated to each virtual NVMe subsystem, a large amount of trust resource data can be stored, and it is also convenient to sort the number of trust resources allocated to each virtual NVMe subsystem.

[0074] In one embodiment, such as Figure 3 As shown, based on the sorting results, the allowed time for each virtual NVMe subsystem to occupy the command processing engine is calculated sequentially, resulting in the following time resource allocation results:

[0075] Step 302: Based on the sorting results, determine the first target virtual NVMe subsystem corresponding to the largest value in the sorting results and the second target virtual NVMe subsystem corresponding to the second largest value, and allocate a first duration for the first target virtual NVMe subsystem to be allowed to occupy the command processing engine.

[0076] In this context, the first target virtual NVMe subsystem refers to the virtual NVMe subsystem ranked 1st, which is also the one allocated the most trust resources. The second target virtual NVMe subsystem refers to the virtual NVMe subsystem ranked 2nd, which is also the one allocated the second most trust resources. For example, if virtual NVMe subsystem A is allocated 3 trust resources, virtual NVMe subsystem B is allocated 5 trust resources, and virtual NVMe subsystem C is allocated 8 trust resources, then virtual NVMe subsystem C is the first target virtual NVMe subsystem, and virtual NVMe subsystem B is the second target virtual NVMe subsystem.

[0077] The first duration can be understood as the time allowed to occupy the command processing engine by the virtual NVMe subsystem that ranks 1st in the sorting results and has been allocated the most trusted resources. It is mainly defined by the user or randomly selected by the virtual machine.

[0078] For example, based on the ranking of the number of trust resources allocated to each virtual NVMe subsystem, the server first determines the first target virtual NVMe subsystem that has been allocated the most trust resources and the second target virtual NVMe subsystem that has been allocated the second most trust resources. Then, through user-defined or random selection by the virtual machine, the server determines the first duration for which the first target virtual NVMe subsystem is allowed to occupy the command processing engine.

[0079] Step 304: Calculate the ratio of the number of trusted resources in the second target virtual NVMe subsystem to the number of trusted resources in the first target virtual NVMe subsystem, and obtain the ratio result.

[0080] Step 306: Multiply the ratio result with the first duration to obtain the second duration for which the second target virtual NVMe subsystem is allowed to occupy the command processing engine.

[0081] The second duration can be understood as the time that the virtual NVMe subsystem, which ranks second in the sorting results and is allocated the second most trusted resources, is allowed to occupy the command processing engine.

[0082] For example, if the server obtains m1 of trusted resources for the first target virtual NVMe subsystem and m2 of trusted resources for the second target virtual NVMe subsystem, and the first duration is t1, then the ratio is m2 / m1. The product of this ratio m2 / m1 and the first duration t1 is then calculated to obtain the second duration for which the second target virtual NVMe subsystem is allowed to occupy the command processing engine.

[0083] Step 308: Calculate the duration for which each virtual NVMe subsystem is allowed to occupy the command processing engine according to the second duration calculation method, and obtain the duration resource allocation result.

[0084] For example, the server receives a second duration from the second target virtual NVMe subsystem that is allowed to occupy the command processing engine. Then, based on the sorting results of the number of trusted resources allocated to each virtual NVMe subsystem, the duration t for which the virtual NVMe subsystem ranked i is allowed to occupy the command processing engine is calculated. i The calculation process is as follows: Where, m i-1 The amount of trust resources allocated to the virtual NVMe subsystem ranked i-1, t i-1 The virtual NVMe subsystem ranked i-1 is allowed to occupy the command processing engine for a certain amount of time.

[0085] In this embodiment, by calculating the allowed time for each virtual NVMe subsystem to occupy the command processing engine based on the sorting results of the virtual NVMe subsystems, the time resource requirements of each virtual NVMe subsystem can be considered as a whole, thereby achieving a fair allocation of time resources.

[0086] In one embodiment, based on the allocation result of time-based resources, each virtual NVMe subsystem is controlled to sequentially occupy the command processing engine to execute the encapsulated commands, including:

[0087] If the target virtual NVMe subsystem occupying the command processing engine is found to have either trusted resources or an incomplete command, then the target virtual NVMe subsystem is controlled to enter a waiting state.

[0088] If the target virtual NVMe subsystem occupying the command processing engine is found to have both trusted resources and incomplete commands, then the target virtual NVMe subsystem is controlled to occupy the command processing engine to execute the encapsulated commands.

[0089] For example, if the server polls a target virtual NVMe subsystem and detects that the target virtual NVMe subsystem has either trusted resources or an incomplete command, the server will control the target virtual NVMe subsystem to enter a waiting state until trusted resources are reallocated or the incomplete command is encapsulated, and then the server will occupy the command processing engine to execute the encapsulated command.

[0090] In a specific application, when polling the target virtual NVMe subsystem A, if the server detects that the target virtual NVMe subsystem only has incomplete commands and the allocated trust resources have been used up, the server will control the target virtual NVMe subsystem to enter a waiting state, waiting for trust resources to be reallocated before using the command processing engine to execute the encapsulated commands.

[0091] In this embodiment, by detecting whether the target virtual NVMe subsystem simultaneously possesses trusted resources and incomplete commands, the target virtual NVMe subsystem can smoothly execute commands when occupying the command processing engine, thereby reducing resource consumption.

[0092] In one embodiment, the command execution method based on resource allocation further includes:

[0093] The unexecuted commands encapsulated in each virtual NVMe subsystem are classified and processed according to their command types, resulting in multiple queues of incomplete commands.

[0094] When the virtual NVMe subsystem occupies the command processing engine, it executes each command in the incomplete command queue in parallel and puts the completed commands into the corresponding completed command queue.

[0095] For example, before executing commands in the command processing engine, the server first divides all encapsulated commands into multiple queues according to command type, thus obtaining multiple queues of incomplete commands. When the server detects that a virtual NVMe subsystem has completed queue classification and is using the command processing engine, each incomplete command queue in that virtual NVMe subsystem uses a parallel processing method to execute the commands encapsulated in each incomplete command queue, and places the executed commands into the corresponding completed command queue.

[0096] In this embodiment, by dividing the unexecuted commands encapsulated in each virtual NVMe subsystem into multiple queues according to their type, commands in multiple queues can be executed simultaneously, thereby improving the efficiency of command execution.

[0097] This application also provides an application scenario in which the above-described resource allocation-based command execution method is applied. Specifically, the application of the resource allocation-based command execution method in this scenario is as follows: the entire implementation process is achieved by an intensity-aware arbitration module and a fair scheduling module, and the overall flow of the resource allocation-based command execution method is as follows. Figure 4As shown, there are four virtual NVMe subsystems: Virtual NVMe Subsystem A, Virtual NVMe Subsystem B, Virtual NVMe Subsystem C, and Virtual NVMe Subsystem D. Virtual NVMe Subsystem A encapsulates two types of commands, each with a quantity of 'a'; Virtual NVMe Subsystem B encapsulates two types of commands, each with a quantity of 'b'; Virtual NVMe Subsystem C encapsulates two types of commands, each with a quantity of 'c'; and Virtual NVMe Subsystem D encapsulates two types of commands, each with a quantity of 'd'. The number of incomplete command queues formed by each of the four virtual NVMe subsystems is 2, and the total resource volume in the trust resource pool is M. In the strength awareness module, mapping processing is performed based on the command types, command quantities, command queue quantities, the number of virtual NVMe subsystems, and the corresponding bandwidth parameters of each virtual NVMe subsystem to obtain the mapping result. Then, the mapping result of each virtual NVMe subsystem is multiplied by the total amount of resources M in the trust resource pool to obtain the amount of trust resources m1 allocated to virtual NVMe subsystem A, m2 allocated to virtual NVMe subsystem B, m3 allocated to virtual NVMe subsystem C, and m4 allocated to virtual NVMe subsystem D, where m1>m2>m3>m4.

[0098] In the fair scheduling module, based on the sorting result of the number of trusted resources allocated to virtual NVMe subsystems A, B, C, and D (m1>m2>m3>m4), the allocation order of duration resources is determined as follows: Virtual NVMe subsystem A> Virtual NVMe subsystem B> Virtual NVMe subsystem C> Virtual NVMe subsystem D. First, the duration for which virtual NVMe subsystem A is allowed to occupy the command execution processing engine is determined by the user as t1. Then, the duration for which virtual NVMe subsystem B is allowed to occupy the command execution processing engine is... The virtual NVMe subsystem C is allowed to occupy the command execution processing engine for a specified duration. The virtual NVMe subsystem D is allowed to occupy the command execution processing engine for a duration of [duration missing].

[0099] When polling one of the four virtual NVMe subsystems, it is known that each virtual NVMe subsystem has been allocated trust resources and encapsulated with incomplete commands. The server then controls that virtual NVMe subsystem to occupy the command processing engine and execute the commands encapsulated in the queue of each incomplete command in parallel. When the time-limited resources of the previous virtual NVMe subsystem are exhausted, the server switches to the next virtual NVMe subsystem in the physical queue to continue executing commands. The overall framework of the command execution method based on resource allocation is as follows: Figure 5 As shown.

[0100] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0101] Based on the same inventive concept, this application also provides a resource allocation-based command execution apparatus for implementing the resource allocation-based command execution method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more resource allocation-based command execution apparatus embodiments provided below can be found in the limitations of the resource allocation-based command execution method described above, and will not be repeated here.

[0102] In one embodiment, such as Figure 6 As shown, a command execution device based on resource allocation is provided, comprising:

[0103] The Trust Resource Quantity Determination Module 602 is used to determine the number of trust resources for each virtual NVMe subsystem based on the attributes of the commands encapsulated by each virtual NVMe subsystem.

[0104] The sorting result acquisition module 604 is used to sort the virtual NVMe subsystems according to the number of trust resources of each virtual NVMe subsystem and obtain the sorting result.

[0105] The duration resource allocation module 606 is used to calculate the duration for which each virtual NVMe subsystem is allowed to occupy the command processing engine based on the sorting results, and obtain the duration resource allocation results.

[0106] The command execution module 608 is used to control each virtual NVMe subsystem to sequentially occupy the command processing engine to execute the encapsulated commands based on the allocation results of time-based resources.

[0107] In one embodiment, the trust resource quantity determination module further includes:

[0108] The mapping processing unit is used to map the type of commands, the number of commands, the number of command queues, the number of virtual NVMe subsystems, and the bandwidth parameters corresponding to each virtual NVMe subsystem to obtain the mapping result for each virtual NVMe subsystem.

[0109] The trust resource quantity determination unit is used to multiply the mapping result with the total amount of trust resources in the trust resource pool to obtain the trust resource quantity of each virtual NVMe subsystem.

[0110] In one embodiment, the sorting result acquisition module further includes:

[0111] The data recording unit is used to record the number of trusted resources for each virtual NVMe subsystem using an array, and obtain the data recording results.

[0112] The sorting result acquisition unit is used to sort each value in the data record result according to its numerical size to obtain the sorting result.

[0113] In one embodiment, the duration resource allocation module further includes:

[0114] The data acquisition unit is used to determine the first target virtual NVMe subsystem corresponding to the largest value in the sorting results and the second target virtual NVMe subsystem corresponding to the second largest value based on the sorting results, and to allocate a first duration for the first target virtual NVMe subsystem to occupy the command processing engine.

[0115] The ratio calculation unit is used to calculate the ratio of the number of trusted resources in the second target virtual NVMe subsystem to the number of trusted resources in the first target virtual NVMe subsystem, and obtain the ratio result.

[0116] The second duration calculation unit is used to multiply the ratio result with the first duration to obtain the second duration for which the second target virtual NVMe subsystem is allowed to occupy the command processing engine.

[0117] The duration resource calculation unit is used to calculate the duration during which each virtual NVMe subsystem is allowed to occupy the command processing engine according to the second duration calculation method, and obtain the duration resource allocation result.

[0118] In one embodiment, the command execution module further includes:

[0119] The waiting unit is used to control the target virtual NVMe subsystem to enter a waiting state if it is found that the target virtual NVMe subsystem occupying the command processing engine has either trusted resources or an incomplete command.

[0120] The command execution unit is used to control the target virtual NVMe subsystem to occupy the command processing engine and execute the encapsulated command if the target virtual NVMe subsystem that occupies the command processing engine has both trusted resources and incomplete commands.

[0121] In one embodiment, the command execution device based on resource allocation further includes:

[0122] The incomplete command queue determination unit is used to classify and process the unexecuted commands encapsulated in each virtual NVMe subsystem according to the command type, resulting in multiple incomplete command queues.

[0123] The incomplete command queue determination unit is used to execute commands in each incomplete command queue in parallel when the virtual NVMe subsystem occupies the command processing engine, and to put the executed commands into the corresponding completed command queue.

[0124] The modules in the aforementioned resource allocation-based command execution device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can invoke and execute the operations corresponding to each module.

[0125] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 7 As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs in the non-volatile storage media to run. The database stores the attributes of the commands encapsulated in each virtual NVMe subsystem, the number of trusted resources for each virtual NVMe subsystem, the sorting results of the virtual NVMe subsystems, the allowed time for each virtual NVMe subsystem to occupy the command processing engine, and data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a resource-allocation-based command execution method.

[0126] Those skilled in the art will understand that Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0127] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0128] Based on the attributes of the commands encapsulated by each virtual NVMe subsystem, the number of trusted resources for each virtual NVMe subsystem is determined. The virtual NVMe subsystems are then sorted according to their respective trusted resource counts. Based on the sorting results, the allowed duration for each virtual NVMe subsystem to occupy the command processing engine is calculated, resulting in a duration resource allocation. Based on the duration resource allocation, each virtual NVMe subsystem is controlled to sequentially occupy the command processing engine to execute its encapsulated commands.

[0129] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0130] The types of commands encapsulated in each virtual NVMe subsystem, the number of commands, the number of command queues, the number of virtual NVMe subsystems, and the bandwidth parameters corresponding to each virtual NVMe subsystem are mapped to obtain the mapping result for each virtual NVMe subsystem. The mapping result is then multiplied by the total amount of trust resources in the trust resource pool to obtain the amount of trust resources for each virtual NVMe subsystem.

[0131] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0132] The number of trusted resources for each virtual NVMe subsystem is recorded using an array to obtain the data recording results; each value in the data recording results is sorted according to its size to obtain the sorting results.

[0133] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0134] Based on the sorting results, the first target virtual NVMe subsystem corresponding to the largest value in the sorting results and the second target virtual NVMe subsystem corresponding to the second largest value are determined. A first duration for which the first target virtual NVMe subsystem is allowed to occupy the command processing engine is allocated. The ratio of the number of trusted resources of the second target virtual NVMe subsystem to the number of trusted resources of the first target virtual NVMe subsystem is calculated to obtain the ratio result. The ratio result is multiplied by the first duration to obtain the second duration for which the second target virtual NVMe subsystem is allowed to occupy the command processing engine. According to the calculation method of the second duration, the duration for which each virtual NVMe subsystem is allowed to occupy the command processing engine is calculated in turn to obtain the allocation result of the duration resources.

[0135] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0136] If the target virtual NVMe subsystem occupying the command processing engine is found to have either trusted resources or an incomplete command, the target virtual NVMe subsystem is controlled to enter a waiting state. If the target virtual NVMe subsystem occupying the command processing engine has both trusted resources and an incomplete command, the target virtual NVMe subsystem is controlled to occupy the command processing engine to execute the encapsulated command.

[0137] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0138] The unexecuted commands encapsulated in each virtual NVMe subsystem are classified and processed according to their command type, resulting in multiple queues of incomplete commands. When a virtual NVMe subsystem occupies the command processing engine, the commands in each queue of incomplete commands are executed in parallel, and the executed commands are placed into the corresponding queue of completed commands.

[0139] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:

[0140] Based on the attributes of the commands encapsulated by each virtual NVMe subsystem, the number of trusted resources for each virtual NVMe subsystem is determined. The virtual NVMe subsystems are then sorted according to their respective trusted resource counts. Based on the sorting results, the allowed duration for each virtual NVMe subsystem to occupy the command processing engine is calculated, resulting in a duration resource allocation. Based on the duration resource allocation, each virtual NVMe subsystem is controlled to sequentially occupy the command processing engine to execute its encapsulated commands.

[0141] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0142] The types of commands encapsulated in each virtual NVMe subsystem, the number of commands, the number of command queues, the number of virtual NVMe subsystems, and the bandwidth parameters corresponding to each virtual NVMe subsystem are mapped to obtain the mapping result for each virtual NVMe subsystem. The mapping result is then multiplied by the total amount of trust resources in the trust resource pool to obtain the amount of trust resources for each virtual NVMe subsystem.

[0143] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0144] The number of trusted resources for each virtual NVMe subsystem is recorded using an array to obtain the data recording results; each value in the data recording results is sorted according to its size to obtain the sorting results.

[0145] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0146] Based on the sorting results, the first target virtual NVMe subsystem corresponding to the largest value in the sorting results and the second target virtual NVMe subsystem corresponding to the second largest value are determined. A first duration for which the first target virtual NVMe subsystem is allowed to occupy the command processing engine is allocated. The ratio of the number of trusted resources of the second target virtual NVMe subsystem to the number of trusted resources of the first target virtual NVMe subsystem is calculated to obtain the ratio result. The ratio result is multiplied by the first duration to obtain the second duration for which the second target virtual NVMe subsystem is allowed to occupy the command processing engine. According to the calculation method of the second duration, the duration for which each virtual NVMe subsystem is allowed to occupy the command processing engine is calculated in turn to obtain the allocation result of the duration resources.

[0147] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0148] If the target virtual NVMe subsystem occupying the command processing engine is found to have either trusted resources or an incomplete command, the target virtual NVMe subsystem is controlled to enter a waiting state. If the target virtual NVMe subsystem occupying the command processing engine has both trusted resources and an incomplete command, the target virtual NVMe subsystem is controlled to occupy the command processing engine to execute the encapsulated command.

[0149] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0150] The unexecuted commands encapsulated in each virtual NVMe subsystem are classified and processed according to their command type, resulting in multiple queues of incomplete commands. When a virtual NVMe subsystem occupies the command processing engine, the commands in each queue of incomplete commands are executed in parallel, and the executed commands are placed into the corresponding queue of completed commands.

[0151] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:

[0152] Based on the attributes of the commands encapsulated by each virtual NVMe subsystem, the number of trusted resources for each virtual NVMe subsystem is determined. The virtual NVMe subsystems are then sorted according to their respective trusted resource counts. Based on the sorting results, the allowed duration for each virtual NVMe subsystem to occupy the command processing engine is calculated, resulting in a duration resource allocation. Based on the duration resource allocation, each virtual NVMe subsystem is controlled to sequentially occupy the command processing engine to execute its encapsulated commands.

[0153] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0154] The types of commands encapsulated in each virtual NVMe subsystem, the number of commands, the number of command queues, the number of virtual NVMe subsystems, and the bandwidth parameters corresponding to each virtual NVMe subsystem are mapped to obtain the mapping result for each virtual NVMe subsystem. The mapping result is then multiplied by the total amount of trust resources in the trust resource pool to obtain the amount of trust resources for each virtual NVMe subsystem.

[0155] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0156] The number of trusted resources for each virtual NVMe subsystem is recorded using an array to obtain the data recording results; each value in the data recording results is sorted according to its size to obtain the sorting results.

[0157] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0158] Based on the sorting results, the first target virtual NVMe subsystem corresponding to the largest value in the sorting results and the second target virtual NVMe subsystem corresponding to the second largest value are determined. A first duration for which the first target virtual NVMe subsystem is allowed to occupy the command processing engine is allocated. The ratio of the number of trusted resources of the second target virtual NVMe subsystem to the number of trusted resources of the first target virtual NVMe subsystem is calculated to obtain the ratio result. The ratio result is multiplied by the first duration to obtain the second duration for which the second target virtual NVMe subsystem is allowed to occupy the command processing engine. According to the calculation method of the second duration, the duration for which each virtual NVMe subsystem is allowed to occupy the command processing engine is calculated in turn to obtain the allocation result of the duration resources.

[0159] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0160] If the target virtual NVMe subsystem occupying the command processing engine is found to have either trusted resources or an incomplete command, the target virtual NVMe subsystem is controlled to enter a waiting state. If the target virtual NVMe subsystem occupying the command processing engine has both trusted resources and an incomplete command, the target virtual NVMe subsystem is controlled to occupy the command processing engine to execute the encapsulated command.

[0161] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0162] The unexecuted commands encapsulated in each virtual NVMe subsystem are classified and processed according to their command type, resulting in multiple queues of incomplete commands. When a virtual NVMe subsystem occupies the command processing engine, the commands in each queue of incomplete commands are executed in parallel, and the executed commands are placed into the corresponding queue of completed commands.

[0163] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data shall comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0164] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0165] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0166] The above embodiments are merely illustrative of several implementation methods of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method of command execution based on resource allocation, characterized by, The method includes: Based on the attributes of the commands encapsulated by each virtual NVMe subsystem, determine the number of trusted resources for each virtual NVMe subsystem. The virtual NVMe subsystems are sorted according to the number of trusted resources for each subsystem, resulting in a sorting order. Based on the sorting results, the duration for which each virtual NVMe subsystem is allowed to occupy the command processing engine is calculated sequentially to obtain the allocation result of the duration resources; Based on the allocation result of the time-limited resources, each virtual NVMe subsystem is controlled to sequentially occupy the command processing engine to execute the encapsulated commands; The step of calculating the allowed command processing engine time for each virtual NVMe subsystem based on the sorting results to obtain the time resource allocation result includes: determining the first target virtual NVMe subsystem corresponding to the largest value in the sorting results and the second target virtual NVMe subsystem corresponding to the second largest value, and allocating a first time allowed to occupy the command processing engine for the first target virtual NVMe subsystem; calculating the ratio of the number of trusted resources of the second target virtual NVMe subsystem to the number of trusted resources of the first target virtual NVMe subsystem, and obtaining the ratio result; multiplying the ratio result by the first time to obtain a second time allowed to occupy the command processing engine for the second target virtual NVMe subsystem; and calculating the allowed command processing engine time for each virtual NVMe subsystem according to the calculation method of the second time to obtain the time resource allocation result.

2. The method of claim 1, wherein, The attributes of the command include the type of the command, the number of commands, and the number of queues formed by the commands; The determination of the number of trusted resources for each virtual NVMe subsystem based on the attributes of the commands encapsulated in each virtual NVMe subsystem includes: The mapping process is performed on the type of command encapsulated in each virtual NVMe subsystem, the number of commands, the number of queues composed of the commands, the number of virtual NVMe subsystems, and the bandwidth parameters corresponding to each virtual NVMe subsystem to obtain the mapping result corresponding to each virtual NVMe subsystem. The mapping result is multiplied by the total amount of trust resources in the trust resource pool to obtain the amount of trust resources for each virtual NVMe subsystem.

3. The method according to claim 1, characterized in that, The process of sorting the virtual NVMe subsystems according to the number of trusted resources in each virtual NVMe subsystem to obtain a sorting result includes: The number of trusted resources for each virtual NVMe subsystem is recorded using an array to obtain the data recording results. Each value in the data record is sorted according to its numerical value to obtain the sorting result.

4. The method according to claim 1, characterized in that, Based on the allocation result of the time-limited resources, the system controls each virtual NVMe subsystem to sequentially occupy the command processing engine to execute the encapsulated commands, including: If the target virtual NVMe subsystem occupying the command processing engine is found to have either trusted resources or an incomplete command, then the target virtual NVMe subsystem is controlled to enter a waiting state. If, during polling, it is found that the target virtual NVMe subsystem occupying the command processing engine has both trusted resources and incomplete commands, then the target virtual NVMe subsystem is controlled to occupy the command processing engine to execute the encapsulated commands.

5. The method according to claim 1, characterized in that, The method further includes: The unexecuted commands encapsulated in each of the virtual NVMe subsystems are classified and processed according to the command type to obtain multiple queues of incomplete commands; When the virtual NVMe subsystem occupies the command processing engine, it executes each command in the incomplete command queue in parallel and puts the executed commands into the corresponding completed command queue.

6. A naming execution device based on resource allocation, characterized in that, The device includes: The trust resource quantity determination module is used to determine the trust resource quantity of each virtual NVMe subsystem based on the attributes of the commands encapsulated by each virtual NVMe subsystem. The sorting result acquisition module is used to sort the virtual NVMe subsystems according to the number of trusted resources of each virtual NVMe subsystem, and obtain the sorting result; The time-based resource allocation module is used to calculate the time allowed for each virtual NVMe subsystem to occupy the command processing engine based on the sorting results, and obtain the time-based resource allocation results. The command execution module is used to control each of the virtual NVMe subsystems to sequentially occupy the command processing engine to execute the encapsulated commands based on the allocation result of the time resources. The step of calculating the allowed command processing engine time for each virtual NVMe subsystem based on the sorting results to obtain the time resource allocation result includes: determining the first target virtual NVMe subsystem corresponding to the largest value in the sorting results and the second target virtual NVMe subsystem corresponding to the second largest value, and allocating a first time allowed to occupy the command processing engine for the first target virtual NVMe subsystem; calculating the ratio of the number of trusted resources of the second target virtual NVMe subsystem to the number of trusted resources of the first target virtual NVMe subsystem, and obtaining the ratio result; multiplying the ratio result by the first time to obtain a second time allowed to occupy the command processing engine for the second target virtual NVMe subsystem; and calculating the allowed command processing engine time for each virtual NVMe subsystem according to the calculation method of the second time to obtain the time resource allocation result.

7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 5.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.

9. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.