Resource allocation method, apparatus, device, storage medium and program product
By dynamically allocating and reusing remappingable resources in ray tracing tasks, the problem of resource waste in ray tracing tasks is solved, and efficient use of resources is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- VASTAI TECH (SHANGHAI) INC
- Filing Date
- 2026-05-25
- Publication Date
- 2026-06-19
AI Technical Summary
In existing technologies, ray tracing tasks suffer from low resource utilization, especially when ray processing requests contain invalid requests, storage resources cannot be reused, leading to resource waste.
By dynamically allocating resources from the resource pool to the scheduling unit, determining the resource set using the number of remappable resources, prioritizing the reuse of allocated but ineffective resources, and supplementing new resources as needed, efficient resource scheduling is achieved.
This improved resource utilization, reduced resource waste caused by invalid ray processing requests, and enhanced the overall efficiency of resource management.
Smart Images

Figure CN122240341A_ABST
Abstract
Description
Technical Field
[0001] The exemplary embodiments disclosed herein generally relate to the field of computers, and particularly to resource allocation methods, apparatus, devices, storage media, and program products. Background Technology
[0002] With the widespread application of ray tracing in fields such as robot vision and autonomous driving, hardware ray tracing architectures face increasingly severe challenges in resource efficiency. For example, using a fixed number of ray processing requests as the basic processing unit, regardless of whether the ray processing request is valid, allocating and occupying storage resources uniformly leads to resource waste. Therefore, how to improve resource utilization is a matter of concern. Summary of the Invention
[0003] In a first aspect of this disclosure, a resource allocation method is provided. The method includes: allocating a first set of resources from a resource pool to a first scheduling unit, the first number of resources in the first set being determined based at least on a second number of remappable resources in a first resource set, the first resource set including resources already allocated to the first scheduling unit, the remappable resources including resources mapped to invalid ray processing requests; scheduling the first resource set using the first scheduling unit to process a first batch of ray processing requests; additionally allocating a second set of resources from the resource pool to a second scheduling unit, the third number of resources in the second set being determined based at least on a fourth number of remappable resources in the second resource set, the second resource set including resources already allocated to the second scheduling unit; and scheduling the second resource set using the second scheduling unit to process a second batch of ray processing requests.
[0004] In a second aspect of this disclosure, an apparatus for resource allocation is provided. The apparatus includes: a first allocation module configured to allocate a first set of resources from a resource pool to a first scheduling unit, the first number of resources in the first set being determined based at least on a second number of remappable resources in a first resource set, the first resource set including resources already allocated to the first scheduling unit, the remappable resources including resources mapped to invalid ray processing requests; a first processing module configured to use the first scheduling unit to schedule the first resource set to process a first batch of ray processing requests; a second allocation module configured to allocate an additional second set of resources from the resource pool to a second scheduling unit, the third number of resources in the second set being determined based at least on a fourth number of remappable resources in the second resource set, the second resource set including resources already allocated to the second scheduling unit; and a second processing module configured to use the second scheduling unit to schedule the second resource set to process a second batch of ray processing requests.
[0005] In a third aspect of this disclosure, an electronic device is provided. The device includes at least one processor; and at least one memory coupled to the at least one processor and storing instructions for execution by the at least one processor. When executed by the at least one processor, the instructions cause the device to perform the method of the first aspect.
[0006] In a fourth aspect of this disclosure, a computer-readable storage medium is provided. The computer-readable storage medium stores computer-executable instructions that can be executed by a processor to implement the method of the first aspect.
[0007] In a fifth aspect of this disclosure, a computer program product is provided. The computer program product is tangibly stored in a computer storage medium and includes computer-executable instructions that, when executed by a device, cause the device to perform the method of the first aspect.
[0008] In this way, the embodiments of this disclosure can improve resource utilization.
[0009] It should be understood that the content described in this content section is not intended to limit the key or essential features of the embodiments of this disclosure, nor is it intended to restrict the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0010] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. In the drawings, the same or similar reference numerals denote the same or similar elements, wherein: Figure 1 A schematic diagram is shown of an example environment in which embodiments of the present disclosure may be implemented; Figure 2 A flowchart illustrating an example resource allocation process according to some embodiments of this disclosure is shown; Figures 3A to 3D A schematic diagram illustrating a resource allocation process according to some embodiments of the present disclosure is shown; Figure 4 A schematic structural block diagram of an example apparatus for resource allocation according to some embodiments of the present disclosure is shown; Figure 5 A block diagram of an electronic device capable of implementing several embodiments of the present disclosure is shown. Detailed Implementation
[0011] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0012] It should be noted that the headings of any section / subsection provided herein are not limiting. Various embodiments are described throughout this document, and embodiments of any type may be included under any section / subsection. Furthermore, embodiments described in any section / subsection may be combined in any way with any other embodiments described in the same section / subsection and / or different sections / subsections.
[0013] In the description of embodiments of this disclosure, the term "comprising" and similar terms should be understood as open-ended inclusion, i.e., "including but not limited to". The term "based on" should be understood as "at least partially based on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The term "some embodiments" should be understood as "at least some embodiments". Other explicit and implicit definitions may also be included below. The terms "first", "second", etc., may refer to different or the same objects. Other explicit and implicit definitions may also be included below.
[0014] The embodiments of this disclosure may involve user data, data acquisition, and / or use. All of these aspects comply with applicable laws, regulations, and relevant provisions. In the embodiments of this disclosure, all data collection, acquisition, processing, manipulation, forwarding, and use are conducted with the user's knowledge and confirmation. Accordingly, in implementing the embodiments of this disclosure, the type, scope of use, and usage scenarios of any data or information that may be involved should be communicated to the user and their authorization obtained in accordance with relevant laws and regulations through appropriate means. The specific methods of notification and / or authorization may vary depending on the actual situation and application scenario, and the scope of this disclosure is not limited in this respect.
[0015] In this specification and the embodiments, any processing of personal information will be carried out only under the premise of legality (such as obtaining the consent of the personal information subject, or being necessary for the performance of a contract), and will only be carried out within the scope stipulated or agreed upon. A user's refusal to process personal information beyond what is necessary for basic functions will not affect the user's use of basic functions.
[0016] In ray tracing tasks, the traditional batch scheduling mode has a significant resource utilization bottleneck: when there are some invalid ray processing requests in a fixed number of ray processing requests, these invalid ray processing requests will still occupy storage resources, causing storage resources to be unable to be reused by new ray processing requests, resulting in a waste of storage resources.
[0017] Embodiments of this disclosure propose a resource allocation scheme. The scheme includes: allocating a first set of resources from a resource pool to a first scheduling unit, the first number of resources in the first set being determined based at least on a second number of remappable resources in a first resource set, the first resource set including resources already allocated to the first scheduling unit, and the remappable resources including resources mapped to invalid ray processing requests; using the first scheduling unit to schedule the first resource set to process a first batch of ray processing requests; additionally allocating a second set of resources from the resource pool to a second scheduling unit, the third number of resources in the second set being determined based at least on a fourth number of remappable resources in the second resource set, the second resource set including resources already allocated to the second scheduling unit; and using the second scheduling unit to schedule the second resource set to process a second batch of ray processing requests.
[0018] In this way, the embodiments of this disclosure can maximize the use of allocated but not yet effectively used storage resources by dynamically allocating new resources based on the number of remapped resources, effectively reducing resource waste caused by invalid ray processing requests, thereby improving resource utilization.
[0019] The following section provides a detailed description of various example implementations of this scheme, with reference to the accompanying drawings.
[0020] Example environment: Figure 1 A schematic diagram of an example environment 100 in which embodiments of the present disclosure can be implemented is shown. For example... Figure 1 As shown, the example environment 100 may include a light control unit 110, a request sending unit 120, and a request traversal unit 130.
[0021] In this example environment 100, the light control unit 110 may include a resource pool, a first scheduling unit, a second scheduling unit, a mapping unit, and a counting unit.
[0022] In some embodiments, a resource pool may include multiple resource storage locations that can be independently allocated or released. Each resource storage location is used to store one ray processing request (valid or invalid).
[0023] The first and second scheduling units can be associated with a resource pool to schedule resources from the pool to receive and process the Mth batch of optical processing requests. Each scheduling unit can schedule a set of resources to serve one batch of optical processing requests. The first and second scheduling units can be used alternately in a ping-pong manner or can operate at least partially in parallel.
[0024] The mapping unit, associated with the first scheduling unit and the second scheduling unit, stores the resource index information actually occupied by each batch of ray processing requests. The counting unit, also associated with the first scheduling unit and the second scheduling unit, stores the number of valid ray processing requests in each batch of ray processing requests.
[0025] During operation, the light control unit 110 can receive batches of light processing requests from the request sending unit 120 (e.g., the light emitting unit), allocate resources from the resource pool through the first scheduling unit or the second scheduling unit, and record resource index information to the mapping unit and the number of valid light processing requests to the counting unit. When the request traversal unit 130 completes the light processing, it can send a completion signal to the counting unit, and the counting unit will decrement the count value of the corresponding batch accordingly. When the count value reaches zero, the light control unit 110 can reassemble all the processing results of the batch based on the resource index information stored in the mapping unit and return them to the request sending unit 120.
[0026] In some embodiments, examples of the ray control unit 110 may include, but are not limited to, resource control circuitry in a ray tracing accelerator or dedicated hardware modules in a system-on-a-chip.
[0027] Examples of the request sending unit 120 may include, but are not limited to, a ray emitting unit or a ray generation module in a graphics processor. The request sending unit 120 can be used to send batch-form ray processing requests to the ray control unit 110, and can also perform resource allocation and subsequent processing to the ray control unit 110.
[0028] Examples of the request traversal unit 130 may include, but are not limited to, a ray traversal unit or a ray intersection module. The request traversal unit 130 can be used to perform actual traversal and intersection calculations on the ray processing requests received by the ray control unit 110, and to send a completion signal back to the ray control unit 110 after processing is completed.
[0029] It should be understood that the structure and function of the various elements in environment 100 are described for illustrative purposes only and do not imply any limitation on the scope of this disclosure.
[0030] The following description will continue with reference to the accompanying drawings, which will provide some exemplary embodiments of this disclosure.
[0031] Figure 2A flowchart of an example resource allocation process 200 according to some embodiments of the present disclosure is shown. Process 200 can be implemented at the light control unit 110. Reference is made below. Figure 1 To describe process 200.
[0032] like Figure 2 As shown, in step 210, the light control unit 110 can allocate a first group of resources from the resource pool to the first scheduling unit. The first number of resources in the first group is determined based at least on the second number of remappable resources in the first resource set, which includes resources already allocated to the first scheduling unit and remappable resources including resources mapped to invalid light processing requests.
[0033] In some embodiments, the resource pool may include multiple resource storage locations (also referred to as resources), each of which can be independently allocated or released. In some embodiments, the optical control unit 110 may allocate a first set of resources to the first scheduling unit from the resource pool. For example, the optical control unit 110 may select at least one currently unallocated resource from the resource pool as the newly allocated first set of resources.
[0034] In some embodiments, remappable resources may include, but are not limited to: resources mapped to invalid ray processing requests, resources that have been allocated but not actually occupied, or other suitable types of reusable resources. In some embodiments, invalid ray processing requests may refer, for example, ray processing requests that do not satisfy the requirement to continue performing ray processing operations. Examples of invalid ray processing requests include, but are not limited to: rays that do not hit any scene geometry, rays that exceed the maximum recursion depth, or other suitable types of rays. Although these invalid ray processing requests occupy resources, the resources they occupy can be remapped (or reused) to improve resource utilization efficiency.
[0035] In some embodiments, the size of the first number of resources newly allocated by the optical control unit 110 from the resource pool to the first scheduling unit may be determined based at least on the second number of remappable resources in the first resource set. In some embodiments, the first number of resources in the first group may be negatively correlated with the second number of remappable resources; for example, when the number of remappable resources is large, the number of newly allocated resources in the first group may be reduced accordingly. Conversely, when the number of remappable resources is small, the number of newly allocated resources in the first group may be increased accordingly.
[0036] Specifically, the ray control unit 110 can determine the first number of the first resources based on the difference between a preset number and a second number. This preset number may correspond to the maximum number of resources required for a single batch of ray processing requests (e.g., the number of ray processing requests included in a single batch). For example, assuming the maximum number of resources required for a single batch of ray processing requests is 32, and the second number of remapable resources in the first scheduling unit is 8, then the ray control unit 110 can determine the first number of the first resources to be 32 - 8 = 24.
[0037] In some embodiments, such a single batch of light processing requests may be a group of light processing requests sent at once by a request sending unit (e.g., a light emitting unit). Additionally or alternatively, such a single batch of light processing requests may also be a group of light processing requests determined from a previous batch of light processing requests. For example, when valid light processing requests from a previous batch are reflected, refracted, or scattered, resulting in light processing requests that need to be followed, these light processing requests can be reorganized into a new batch of light processing requests. It is understood that this disclosure is not intended to limit the source of the individual batches of light processing requests.
[0038] As an example, assuming the resource pool has 128 resources, the maximum number of resources required for a single batch of ray processing requests is 32, and the first scheduling unit already has 8 remappable resources (e.g., resources occupied by invalid ray processing requests), then the ray control unit 110 can allocate a first set of resources to the first scheduling unit in the form of 32-8=24 resources, and reuse the 8 remappable resources already owned by the first scheduling unit to process the first batch of ray processing requests. In this way, the system can reuse existing remappable resources while supplementing new resources as needed, thereby keeping the total resource allocation within a preset range.
[0039] In other embodiments, the optical control unit 110 may also release remappable resources in the first scheduling unit to a resource pool and reallocate a preset number of resources from the resource pool to the first scheduling unit. As an example, in response to returning remappable resources already owned by the first scheduling unit to the resource pool, the optical control unit 110 may use a resource allocation algorithm to reallocate a preset number of resources from the resource pool to the first scheduling unit.
[0040] As an example, the optical control unit 110 can sequentially select a preset number of resources from the resource pool and redistribute them to the first scheduling unit according to the resource number order corresponding to each resource in the resource pool. Specifically, the optical control unit 110 can sequentially traverse the resources in the resource pool according to the monotonically increasing order (e.g., from smallest to largest) or monotonically decreasing order (e.g., from largest to smallest) of the resource numbers, selecting unoccupied resources until the preset number is reached.
[0041] As another example, the ray control unit 110 may also prioritize the most recently or earliest remapped resources that have been put back into the resource pool, based on the order in which remapped resources are released into the resource pool, to reassign them to the first scheduling unit.
[0042] In this manner, the preset number of resources reallocated by the optical control unit 110 to the first scheduling unit may overlap with the remappable resources released into the resource pool, or they may not overlap. Specifically, the preset number of resources may include all remappable resources, some remappable resources, or resources not involved at all that are put back into the resource pool.
[0043] It is understood that this disclosure is intended to illustrate the ability of remapped resources to be reused, but is not intended to limit the specific allocation of remapped resources (e.g., the specific timing or order in which remapped resources are reused).
[0044] To avoid resource contention, in some embodiments, the optical control unit 110, in response to the allocation of a first group of resources to a first scheduling unit, can mark the first group of resources as occupied, regardless of whether the resources in the first group are mapped to invalid optical processing requests. That is, before the optical control unit 110 completes processing of the first group of resources using the first scheduling unit or actively releases them, other scheduling units cannot use this first group of resources as available for allocation. For example, such a first group of resources can be identified by other scheduling units as an unallocated group of resources. As an example, suppose the optical control unit 110 newly allocates 24 resources to the first scheduling unit. After the allocation is completed, the optical control unit 110 can mark these 24 resources as occupied, making them unusable by other scheduling units.
[0045] In other embodiments, when the ray control unit 110 releases remappable resources from the first scheduling unit to the resource pool and reallocates a preset number of resources to them, a group of resources reallocated to the first scheduling unit can be marked as occupied, regardless of whether the resources in this group are mapped to invalid ray processing requests. As an example, suppose the ray control unit 110 newly allocates 32 resources from the resource pool to the first scheduling unit. After allocation, the ray control unit 110 can mark these 32 resources as occupied, making them unusable by other scheduling units.
[0046] By using this allocation-occupancy marking rule, the optical control unit 110 does not need to dynamically determine the resource usage status, thereby simplifying the resource management logic, avoiding resource contention and duplicate allocation, and ensuring data consistency when multiple scheduling units operate in parallel.
[0047] In step 220, the light control unit 110 can use the first scheduling unit to schedule the first resource set to process the first batch of light processing requests.
[0048] In some embodiments, the first resource set may refer to all resources allocated to the first scheduling unit for processing the first batch of ray processing requests. For example, this includes remappable resources in the first resource set and a first set of newly allocated resources from the resource pool. As an example, suppose the first resource set consists of 8 remappable resources (resources occupied by ray processing requests marked as invalid in previous batches) and 24 newly allocated resources, totaling 32 resources. When the first batch of ray processing requests arrives, the ray control unit 110 can utilize the first scheduling unit to schedule these 32 resources to receive the first batch of ray processing requests.
[0049] In other embodiments, when the remapable resources in the first scheduling unit are released to the resource pool and the ray control unit 110 reallocates a preset number of resources to the first scheduling unit, such a first resource set may also refer to the preset number of resources that have been reallocated.
[0050] In some embodiments, the optical control unit 110 can utilize the first scheduling unit to use the pre-allocated first resource set as storage space to sequentially receive the first batch of optical processing requests. This order can be the sequence in which the optical processing requests are sent from the request sending unit. For example, suppose the first scheduling unit is allocated resource storage locations numbered 0 to 31, and the current batch contains 32 optical processing requests. The optical control unit 110 can store the first optical processing request in resource storage location numbered 0, the second in resource storage location numbered 1, ..., the 32nd in resource storage location numbered 31, and so on.
[0051] Alternatively, the ray control unit 110 can also utilize the first scheduling unit to prioritize the use of remapable resources in the first resource set to store newly allocated ray processing requests. For example, if there are 8 remapable resources in the first resource set (originally occupied by invalid ray processing requests), the ray control unit 110 can use the scheduling unit to remap these 8 resources to new ray processing requests, and then use the newly allocated first set of resources. In this way, allocated but ineffective resources can be reused, reducing the need for new resource allocation.
[0052] It is understood that the above allocation process is merely an illustrative example. This disclosure is intended to illustrate that remapped resources have the ability to be reused, but is not intended to limit the specific allocation method of remapped resources (e.g., the specific timing or order in which remapped resources are reused).
[0053] In some embodiments, the ray control unit 110 may mark a ray processing request as a remapable resource when it is determined to be an invalid ray processing request. For example, when a ray processing request is identified as invalid, the ray control unit 110 may mark the resource it occupies as a remapable resource for subsequent reuse.
[0054] In step 230, the optical control unit 110 may allocate a second set of resources to the second scheduling unit from the resource pool. The third number of the second set of resources is determined based at least on the fourth number of remapable resources in the second resource set, which includes the resources already allocated to the second scheduling unit.
[0055] As an example, assuming the second scheduling unit already has 8 remappable resources and the maximum number of resources required per batch is 32, the ray control unit 110 can allocate 24 new resources to the second scheduling unit (i.e., 32-8=24). These 24 new resources, together with the 8 existing remappable resources of the second scheduling unit, constitute the second resource set, totaling 32 resource locations, used to process the ray processing requests of the second batch.
[0056] Similarly, in response to the second group of resources being allocated to the second scheduling unit, the ray control unit 110 can mark the second group of resources as occupied, regardless of whether the resources in the second group are mapped to invalid ray processing requests. Additionally or alternatively, if the ray control unit 110 releases remappable resources in the second scheduling unit to the resource pool and reallocates a preset number of resources to them, a group of resources reallocated to the second scheduling unit can be marked as occupied, regardless of whether the resources in this group are mapped to invalid ray processing requests.
[0057] In some embodiments, the optical control unit 110 may allocate a second set of resources from the resource pool to the second scheduling unit in parallel with at least part of the reception process of the first batch of optical processing requests. For example, the optical control unit 110 may allocate resources to the second scheduling unit in parallel during the reception of the first batch of optical processing requests.
[0058] As an example, suppose the ray control unit 110 receives the first ray processing request in the first batch of ray processing requests, and the ray control unit 110 can simultaneously initiate the operation of allocating resources to the second scheduling unit. As another example, suppose the ray control unit 110 is receiving the first batch of ray processing requests, and upon receiving a ray processing request at the target location (e.g., the Nth request), the ray control unit 110 can simultaneously initiate the operation of allocating resources to the second scheduling unit.
[0059] In this way, the optical control unit 110 can allocate resources to the second scheduling unit in advance during the reception of the first batch of optical processing requests. Once the first batch of optical processing requests has been received, the second batch of optical processing requests can be received immediately without waiting for the allocation of resources to the second scheduling unit, thereby improving the overall resource utilization efficiency.
[0060] In step 240, the light control unit 110 may use the second scheduling unit to schedule the second resource set to process the second batch of light processing requests.
[0061] In some embodiments, the second resource set may refer to all resources allocated to the second scheduling unit for processing the second batch of ray processing requests. For example, this includes remappable resources in the second resource set and a second set of resources newly allocated from the resource pool. As an example, suppose the second resource set consists of 8 remappable resources (resources occupied by ray processing requests marked as invalid in previous batches) and 24 newly allocated resources, totaling 32 resources. The ray control unit 110 can utilize the second scheduling unit to schedule these 32 resources to process the second batch of ray processing requests.
[0062] In other embodiments, when the remapable resources in the second scheduling unit are released to the resource pool and the ray control unit 110 reallocates a preset number of resources to the second scheduling unit, such a second resource set may also refer to the preset number of resources that have been reallocated. In some embodiments, the remapable resources in the first resource set and the remapable resources in the second resource set are different, and the first group of resources and the second group of resources are also different.
[0063] In some embodiments, the optical control unit 110 can utilize the second scheduling unit to use the allocated second resource set as storage space to sequentially receive a second batch of optical processing requests. This order can be the order in which the optical processing requests are sent from the request sending unit. For example, suppose the second scheduling unit is allocated resource storage locations numbered 0 to 31, and the current batch contains 32 optical processing requests. The optical control unit 110 can store the first optical processing request in resource storage location numbered 0, the second in resource storage location numbered 1, ..., the 32nd in resource storage location numbered 31, and so on.
[0064] Alternatively, the ray control unit 110 may also utilize the second scheduling unit to preferentially use remappable resources in the second resource set to store newly allocated ray processing requests. For example, if there are 8 remappable resources in the second resource set (originally occupied by invalid ray processing requests), the ray control unit 110 can use the scheduling unit to remap these 8 resources to new ray processing requests, and then use the newly allocated second set of resources. In this way, allocated but ineffective resources can be reused, reducing the need for new resource allocation. It is understood that the above allocation process is only an illustrative example, and this disclosure aims to illustrate that remappable resources have the ability to be reused, but is not intended to limit the specific allocation method of remappable resources (e.g., the specific timing or order in which remappable resources are reused).
[0065] In some embodiments, the ray control unit 110 may mark a ray processing request as a remapable resource when it is determined to be an invalid ray processing request. For example, when a ray processing request is identified as invalid, the ray control unit 110 may mark the resource it occupies as a remapable resource for subsequent reuse.
[0066] In some embodiments, the number of scheduling units may be more than two. For example, three or more scheduling units may be configured to perform parallel allocation of resources and reception processing of optical requests in a similar manner. It is understood that this disclosure is not intended to limit the specific number of scheduling units.
[0067] In some embodiments, in response to completing the reception of the first batch of light processing requests, the light control unit 110 can store a first set of index information corresponding to the first resource set in the mapping unit. As an example, after the last light processing request in the first batch of light processing requests is received, the light control unit 110 can record the resource locations actually occupied by this batch of light processing requests and store the identifiers (e.g., resource numbers or addresses) corresponding to these resource locations as a set of index information in the mapping unit.
[0068] In some embodiments, the light control unit 110 can store this first set of index information in a storage location corresponding to the first batch of processing requests. Such a storage location can be a storage space with a batch identifier (Batch ID) as its address. For example, assuming the Batch ID of the first batch of light processing requests is 0, the light control unit 110 can store the corresponding first set of index information in the mapping unit at address 0; if the Batch ID of the first batch of light processing requests is 1, the light control unit 110 can store the corresponding first set of index information in the location at address 1. In this way, the corresponding index information can be quickly located from the mapping unit using the Batch ID, facilitating retrieval and use when subsequent results are returned.
[0069] In some embodiments, the light control unit 110 may store a fifth number of valid light processing requests in the first batch of light processing requests in the counting unit. For example, after the first batch of light processing requests is received, the light control unit 110 may count the number of valid light processing requests in the batch (e.g., light that hits the scene or does not exceed the maximum depth, etc.) and store that number as the fifth number in the counting unit.
[0070] As an example, suppose the first batch of ray processing requests includes 24 valid ray processing requests and 8 invalid ray processing requests. The ray control unit 110 can store the number of valid ray processing requests (e.g., 24) as a fifth number in the counting unit.
[0071] In some embodiments, the light control unit 110 can store this fifth number in the storage location corresponding to the first batch of processing requests. Such a storage location can be a storage space addressed by the Batch ID. For example, assuming the Batch ID of the first batch of light processing requests is 0, the light control unit 110 can store the fifth number of the light processing requests in that batch at address 0 in the counting unit; if the Batch ID of the first batch of light processing requests is 1, the light control unit 110 can store the fifth number of the light processing requests in that batch at address 1. In this way, the number of corresponding valid light rays can be quickly located from the counting unit using the Batch ID, facilitating retrieval and use when subsequent results are returned.
[0072] Alternatively or concurrently, the storage locations corresponding to the aforementioned index information or valid ray processing requests may also be dynamically allocated storage areas in any suitable form, such as pointers or linked lists.
[0073] In some embodiments, in response to completing the processing of the second batch of light processing requests, the light control unit 110 can save the second set of index information corresponding to the second resource set to the mapping unit. Further, the light control unit 110 can store the sixth number of valid light processing requests in the second batch of light processing requests to the counting unit.
[0074] This process is similar to the corresponding processing process for the first batch of light processing requests, and will not be described in detail here. In some embodiments, in the mapping unit, the second set of index information may have adjacent storage locations as the first set of index information. For example, the light control unit 110 may store the first set of index information at address 0 in the mapping unit and store the second set of index information at address 1 in the mapping unit. Similarly, in the counting unit, the sixth number may have adjacent storage locations as the fifth number. For example, the light control unit 110 may store the fifth number at address 0 in the counting unit and store the sixth number at address 1 in the counting unit.
[0075] In other embodiments, the second set of index information may also have a non-adjacent storage location with the first set of index information. For example, the light control unit 110 may store the first set of index information at address 0 in the mapping unit and store the second set of index information at address 2 in the mapping unit. Similarly, in the counting unit, the sixth number may have a non-adjacent storage location with the fifth number. For example, the light control unit 110 may store the fifth number at address 0 in the counting unit and store the sixth number at address 2 in the counting unit.
[0076] In some embodiments, the light control unit 110 may decrement the fifth number stored in the counting unit in response to each valid light processing request in the first batch of light processing requests that has been processed. For example, whenever a valid light processing request is processed by a downstream module (e.g., a request traversal unit), the light control unit 110 may decrement the count value in the counting unit corresponding to the valid light processing requests of that batch by one, thereby tracking the number of valid light processing requests in that batch that have not yet been processed in real time.
[0077] As an example, suppose the fifth number of valid light processing requests in the first batch stored in the counting unit is 24. When the first valid light processing request is completed, the light control unit 110 decrements the count value from 24 to 23, when the second valid light processing request is completed, it decrements from 23 to 22, and so on, until it reaches 0. In this way, the value in the counting unit always reflects the number of valid light rays that have not yet been processed.
[0078] As an example, assuming the Batch ID of the first batch of light processing requests is 0, the light control unit 110 can store the fifth number of the batch in the counting unit at address 0, and perform the above-mentioned decrementing operation at that address.
[0079] In some embodiments, in response to a fifth number indication that all valid light processing requests in the first batch of light processing requests have been processed, the light control unit 110 may return at least one request processing result corresponding to the first batch of light processing requests.
[0080] As an example, when the fifth number stored in the counting unit decreases to zero, it can be indicated that all valid light processing requests in the first batch of light processing requests have been processed. At this time, the light control unit 110 can trigger a processing result return operation to return at least one request processing result corresponding to the valid light processing requests in the first batch of light processing requests to the light emitting unit or other upper-level modules.
[0081] As an example, assuming that the first batch of light processing requests includes 24 valid light processing requests, when the count value at the corresponding storage location in the counting unit decreases to 0, the light control unit 110 can determine that all valid light processing requests in this batch have been processed, and can return the 24 processing results corresponding to the 24 valid light processing requests in this batch to the light emitting unit or other higher-level modules.
[0082] In some embodiments, in response to completing the processing of all valid light processing requests, the light control unit 110 may sort at least one request processing result based on the request receiving order.
[0083] In some embodiments, the processing order of the light processing requests may differ from the receiving order (e.g., some light processing requests are processed faster, and some light processing requests are processed slower). The light control unit 110 may sort the processing results of at least one request based on the initial receiving order of the light processing requests, so that the order of the processing results of at least one request is consistent with the receiving order of the light processing requests.
[0084] Furthermore, the light control unit 110 can return at least one sorted request processing result. As an example, the light control unit 110 returns at least one sorted request processing result to the light transmitting unit or other upper-level modules, so that the light transmitting unit or other upper-level modules can directly obtain processing results consistent with the receiving order of the first batch of light processing requests, without having to perform a reordering operation themselves.
[0085] As an example, the light control unit 110 arranges the processing results in the order of 0, 1, 2...23, and can return at least one of the sorted request processing results to the light emitting unit. In this way, the light emitting unit can directly match each result with the previously issued light processing request one by one, without the need for additional caching or reordering logic, thereby simplifying the design of the upper-layer module and reducing processing latency.
[0086] It is understandable that the storage of index information, the storage of the number of valid ray processing requests, the return of request results, and sorting, as described above using the first batch of ray processing requests as an example, also apply to ray processing requests in other batches (such as the second batch, the third batch, etc.). The ray control unit 110 can independently maintain the count value of each batch in the counting unit and the index information of the resources in the mapping unit. When the count value of any batch reaches zero, the ray control unit 110 can reorganize and return the request results based on the index information corresponding to that batch.
[0087] In some embodiments, the optical control unit 110 may also determine a seventh number of remaining resources in the resource pool. In some embodiments, during the allocation of resources to the scheduling unit, the optical control unit 110 may determine in real time the number of currently unoccupied resources in the resource pool in order to determine whether the needs of the next batch of optical processing requests can be met.
[0088] In some embodiments, in response to a seventh number being less than a preset number, the light control unit 110 may send a message to a request sending unit (e.g., a light emitting unit), indicating the seventh number. This preset number may correspond to the maximum number of resources required for a single batch of light processing requests (e.g., 32). When the remaining resources are insufficient to meet the maximum number of resources required for a complete batch of light processing requests, the light control unit 110 may inform the request sending unit of the remaining resource quantity, and the request sending unit may decide whether to issue a new batch request.
[0089] In some embodiments, the request sending unit (e.g., the light emitting unit) may assess whether the remaining resources are sufficient to handle a new batch of light processing requests based on the number of valid light processing requests in the batch to be sent, the potential availability of remapped resources, or other factors. If the assessment result is yes, the light control unit 110 may request the sending unit to issue a new batch of light processing requests; otherwise, it may wait for more resources to be released before sending or select another resource pool.
[0090] As an example, suppose the preset number is 32, and the seventh number determined by the light control unit 110 is 24 (i.e., less than 32 resources remain). In this case, the light control unit 110 can send a message to the light transmitting unit, indicating that only 24 resources are currently available. Upon receiving this message, the light transmitting unit can assess whether there are still sufficient resources to issue a new batch of light processing requests.
[0091] In some embodiments, the light control unit 110 may receive a second batch of light processing requests from the request sending unit. In some embodiments, after receiving an indication of the remaining resource quantity, the light control unit 110 may use the request sending unit to determine whether to send a new batch of light processing requests based on the current situation (e.g., the number of light processing requests in the batch to be sent does not exceed the number of remaining resources or the number of valid light processing requests in the batch to be sent does not exceed the number of remaining resources), and the light control unit 110 may receive the batch of light processing requests.
[0092] In some embodiments, the optical control unit 110 may allocate an additional seventh number of resources to the second scheduling unit. As an example, assuming the seventh number is 24, and the optical transmitting unit decides to issue a second batch of requests, the optical control unit 110 may allocate all 24 remaining resources to the second scheduling unit to maximize resource utilization.
[0093] It is understood that the above description uses the example of allocating fewer than the preset number of resources to the second scheduling unit from the resource pool. In other embodiments, fewer than the preset number of resources may also be allocated to the first scheduling unit from the resource pool, depending on the system scheduling strategy.
[0094] For example, when the optical control unit 110 receives the Pth batch of optical processing requests using the second scheduling unit, it can simultaneously (or in parallel) allocate a set of resources to the first scheduling unit from the resource pool. In response to the fact that the number of remaining resources in the resource pool is less than a preset number, the optical control unit 110 can send a message to the request sending unit. After receiving the message, the request sending unit can evaluate whether the remaining resources are sufficient to process the new batch of optical processing requests. In response to the request sending unit indicating that the new batch of optical processing requests can be sent, the optical control unit 110 can receive the new batch of optical processing requests from the request sending unit and allocate the remaining resources in the resource pool to the first scheduling unit.
[0095] It should be noted that the first and second scheduling units mentioned above allocate resources in an alternating manner. As an example, the target scheduling unit for resource allocation can be determined based on the parity of the current batch. For instance, when the number of batches is odd (e.g., the first batch, the third batch, etc.), the light control unit 110 can allocate resources to the first scheduling unit and use it to process the light processing requests for odd-numbered batches. When the number of batches is even (e.g., the second batch, the fourth batch, etc.), the light control unit 110 can allocate resources to the second scheduling unit and use it to process the light processing requests for even-numbered batches.
[0096] It is understood that the above content is merely an illustrative example, intended to illustrate that the first scheduling unit and the second scheduling unit use an alternating rotation method for resource allocation, and is not intended to limit the number of scheduling units or the specific form of the alternation rules.
[0097] Figures 3A to 3D A schematic diagram of a resource allocation process according to some embodiments of the present disclosure is shown. For ease of understanding, reference will be made below. Figures 3A to 3D This paper introduces an example process of resource pool 330 from its initial state (all resources unallocated) to a near-full state.
[0098] In the initial state, the 128 resources (numbered 0 to 127) in resource pool 330, scheduling unit a, and scheduling unit b are all in an unallocated state. The ray control unit 110 can allocate a set of resources a (e.g., resources numbered 0 to 31 in resource pool 330) from resource pool 330 to scheduling unit a. The number of such a set of resources a can be determined based on the maximum number of resources requested in a single batch of ray processing (e.g., 32).
[0099] In some embodiments, in response to a set of resources a being allocated to scheduling unit a, the light control unit 110 may mark the set of resources a (e.g., resources numbered 0 to 31 in resource pool 330) as occupied, regardless of whether the resources in the set of resources a are mapped to invalid light processing requests.
[0100] Figure 3A This shows the resource allocation status in resource pool 330 after receiving the first batch of ray processing requests. (Reference) Figure 3A The light control unit 110 can use the scheduling unit a to schedule this group of resources a to receive the light processing requests of the ath batch. In some embodiments, the light control unit 110 responds to all the light processing requests of the ath batch as valid light processing requests, so this group of resources a can be fully occupied.
[0101] In some embodiments, during the process of receiving the first batch of light processing requests, the light control unit 110 may simultaneously (or in parallel) allocate a set of resources b (e.g., resources numbered 32 to 63 in resource pool 330) to the scheduling unit b for use by subsequent batches of light processing requests (e.g., the first batch of light processing requests).
[0102] Similarly, in response to a set of resources b being allocated to the scheduling unit b, the ray control unit 110 can mark the set of resources b (e.g., resources numbered 32 to 63 in resource pool 330) as occupied, regardless of whether the resources in the set of resources b are mapped to invalid ray processing requests.
[0103] In some embodiments, after receiving the first batch of light processing requests, the light control unit 110 can store the index information (e.g., resource numbers 0 to 31) of the 32 resources recorded by the scheduling unit a at address 0 of the mapping unit 340. Simultaneously, it stores the number of valid light processing requests (e.g., 32) in the first batch at address 0 of the counting unit 350. At this time, resources numbered 0 to 63 in the resource pool 330 are occupied, while resources numbered 64 to 127 remain idle.
[0104] Figure 3B This shows the resource allocation status in resource pool 330 after receiving the bth batch of ray processing requests. (Reference) Figure 3B The light control unit 110 can utilize the scheduling unit b to schedule this group of resources b to receive the bth batch of light processing requests. In some embodiments, in response to the bth batch of light processing requests comprising 24 valid light processing requests, the light control unit 110 can utilize the scheduling unit b to determine 24 resources (e.g., resources numbered 36 to 59 in resource pool 330) from a previously allocated group of resources b (e.g., resources numbered 32 to 35 and 60 to 63 in resource pool 330) to receive this batch of light processing requests. Resources numbered 32 to 35 and 60 to 63 in resource pool 330 can be marked as remappable resources.
[0105] In some embodiments, while receiving the bth batch of light processing requests, the light control unit 110 may simultaneously (or in parallel) continue to allocate new resources to the scheduling unit a, for example, allocating a set of resources c (e.g., resources numbered 64 to 95 in resource pool 330) from resource pool 330 for use by subsequent batches of light processing requests (e.g., the cth batch of light processing requests).
[0106] Similarly, in response to a set of resources c being allocated to scheduling unit a, the light control unit 110 can mark the set of resources c (e.g., resources numbered 64 to 95 in resource pool 330) as occupied, regardless of whether the resources in the set of resources c are mapped to invalid light processing requests.
[0107] In some embodiments, after receiving the b batch of light processing requests, the light control unit 110 can store the index information (e.g., resource numbers 32 to 63) of the 32 resources recorded by the scheduling unit b at address 1 of the mapping unit 340. Simultaneously, the number of valid light processing requests in the b batch (e.g., 24) is stored at address 1 of the counting unit 350. At this time, resources numbered 0 to 63 and 64 to 95 in the resource pool 330 are occupied, while resources numbered 96 to 127 remain idle.
[0108] Figure 3C This shows the resource allocation status in resource pool 330 after receiving the cth batch of ray processing requests. (Reference) Figure 3C The light control unit 110 can utilize the scheduling unit a to schedule this group of resources c to receive the c-th batch of light processing requests. In some embodiments, in response to the c-th batch of light processing requests comprising 16 valid light processing requests, the light control unit 110 can utilize the scheduling unit a to determine 16 resources (e.g., resources numbered 72 to 79 and 84 to 91 in resource pool 330) from a previously allocated group of resources c (e.g., resources numbered 64 to 71, 80 to 83, and 92 to 95 in resource pool 330) to receive this batch of light processing requests. Resources numbered 64 to 71, 80 to 83, and 92 to 95 in resource pool 330 can be marked as remappable resources.
[0109] In some embodiments, while receiving the cth batch of light processing requests, the light control unit 110 can simultaneously (or in parallel) continue to allocate new resources to the scheduling unit b. At this time, in addition to the remappable resources in the scheduling unit b (e.g., resources numbered 32 to 35 and 60 to 63), the light control unit 110 can also allocate a new set of resources d from the resource pool 330 (e.g., resources numbered 96 to 119 in the resource pool 330) for use by subsequent batches of light processing requests (e.g., the dth batch of light processing requests). Thus, the scheduling unit b has a total of 32 resources (some of which are remappable resources, and some are newly allocated resources).
[0110] Additionally or alternatively, the optical control unit 110 may also release the remappable resources in the scheduling unit b to the resource pool 330, and reallocate a preset number of resources to the scheduling unit b from the resource pool 330. For example, the optical control unit 110 may reallocate 32 resources to the scheduling unit b from the resource pool 330.
[0111] Similarly, in response to a set of resources d being allocated to scheduling unit b, the ray control unit 110 can mark this set of resources d (e.g., resources numbered 96 to 119 in resource pool 330) and remappable resources (e.g., resources numbered 32 to 35 and 60 to 63) as occupied, regardless of whether the resources in this set of resources d and the remappable resources are mapped to invalid ray processing requests. Additionally or alternatively, if the remappable resources in scheduling unit b are released to resource pool 330 and a preset number of resources are reallocated to them, the ray control unit 110 can also mark the set of resources reallocated to scheduling unit a as occupied, regardless of whether the resources in this set of resources are mapped to invalid ray processing requests.
[0112] In some embodiments, after receiving the c-th batch of light processing requests, the light control unit 110 can store the index information (e.g., resource numbers 64 to 95) of the 32 storage resources recorded by the scheduling unit a at address 2 of the mapping unit 340. Simultaneously, the number of valid light processing requests in the c-th batch (e.g., 16) is stored at address 2 of the counting unit 350. At this time, resources numbered 0 to 119 in the resource pool 330 are occupied, while resources numbered 120 to 127 remain idle.
[0113] Figure 3D This shows the resource allocation status in resource pool 330 after receiving the dth batch of ray processing requests. (Reference) Figure 3D The ray control unit 110 can utilize the scheduling unit b to schedule this group of resources d (e.g., resources numbered 96 to 119 in resource pool 330) and remappable resources (e.g., resources numbered 32 to 35 and 60 to 63) to receive the d-th batch of ray processing requests. Additionally or alternatively, the ray control unit 110 can also utilize 32 resources reallocated to the scheduling unit b to receive the d-th batch of ray processing requests.
[0114] In some embodiments, in response to a batch of d-th light processing requests comprising eight valid light processing requests, the light control unit 110 may utilize the scheduling unit b to determine eight resources (e.g., resources numbered 96 to 119 in resource pool 330) from a previously allocated set of resources d (e.g., resources numbered 96 to 119 in resource pool 330) and remappable resources (e.g., resources numbered 32 to 35 and 60 to 63) to receive this batch of light processing requests. Resources numbered 32 to 35, 60 to 63, 98 to 99, 102 to 107, and 112 to 119 in resource pool 330 may be marked as remappable resources.
[0115] In some embodiments, while receiving the dth batch of light processing requests, the light control unit 110 may simultaneously (or in parallel) continue to allocate new resources to the scheduling unit a. At this time, in addition to the remappable resources in the scheduling unit a (e.g., resources numbered 64 to 71, 80 to 83, and 92 to 95), the light control unit 110 may also allocate a new set of resources e (e.g., resources numbered 120 to 127 in resource pool 330) from the resource pool 330 for use by subsequent batches of light processing requests (e.g., the eth batch of light processing requests). Additionally or alternatively, the light control unit 110 may also release the remappable resources in the scheduling unit a to the resource pool 330 and reallocate resources to the scheduling unit a from the resource pool 330.
[0116] In some embodiments, in response to the fact that the number of resources (24) allocated to scheduling unit a does not meet the maximum number of resources for a single batch of optical processing requests, the optical control unit 110 may send a message to a request sending unit (e.g., an optical transmitting unit) indicating that only 24 resources are currently available. The request sending unit can then evaluate whether to send the e-th batch of optical processing requests. In response to sending the e-th batch of optical processing requests, the optical control unit 110 may allocate all remaining resources to scheduling unit a.
[0117] In some embodiments, after receiving the dth batch of light processing requests, the light control unit 110 can store the index information of the 32 storage resources recorded by the scheduling unit b (e.g., resource numbers 32 to 35, 60 to 63, and 96 to 119) at address 3 of the mapping unit 340. Simultaneously, the number of valid light processing requests in the dth batch (e.g., 8) is stored at address 3 of the counting unit 350.
[0118] In some embodiments, in response to completing the processing of each batch (e.g., batch a, batch b, batch c, batch d) of valid light processing requests, the light control unit 110 may decrement the number of corresponding valid light processing requests stored in the counting unit. In response to completing the processing of all valid light processing requests in the first batch of light processing requests, the light control unit 110 may return at least one request processing result corresponding to a valid light processing request in the first batch of light processing requests. Specifically, in response to completing the processing of all valid light processing requests, the light control unit 110 may sort at least one request processing result based on the request reception order. Further, the light control unit 110 may return at least one sorted request processing result.
[0119] In this way, the embodiments of this disclosure can maximize the use of allocated but not yet effectively used storage resources by dynamically allocating new resources based on the number of remappable resources, effectively reducing resource waste caused by invalid ray processing requests, thereby improving resource utilization.
[0120] Example devices and equipment: Embodiments of this disclosure also provide corresponding apparatus for implementing the above methods or processes. Figure 4 A schematic structural block diagram of an example device 400 for resource allocation according to certain embodiments of the present disclosure is shown. Device 400 may be implemented as or included in a light control unit 110. Various modules / components in device 400 may be implemented by hardware, software, firmware, or any combination thereof.
[0121] like Figure 4 As shown, the apparatus 400 includes a first allocation module 410 configured to allocate a first set of resources from a resource pool to a first scheduling unit, the first number of which is determined based at least on a second number of remappable resources in a first resource set, the first resource set including resources already allocated to the first scheduling unit, and remappable resources including resources mapped to invalid ray processing requests; a first processing module 420 configured to use the first scheduling unit to schedule the first resource set to process a first batch of ray processing requests; a second allocation module 430 configured to allocate an additional second set of resources from a resource pool to a second scheduling unit, the third number of which is determined based at least on a fourth number of remappable resources in the second resource set, the second resource set including resources already allocated to the second scheduling unit; and a second processing module 440 configured to use the second scheduling unit to schedule the second resource set to process a second batch of ray processing requests.
[0122] In some embodiments, the second allocation module 430 is further configured to allocate a second set of resources from the resource pool to the second scheduling unit, at least in parallel with the reception process of the first batch of light processing requests.
[0123] In some embodiments, the apparatus 400 further includes a first storage module configured to, in response to receiving the first batch of light processing requests, store a first set of index information corresponding to the first resource set in a mapping unit; and store a fifth number of valid light processing requests in the first batch of light processing requests in a counting unit.
[0124] In some embodiments, the apparatus 400 further includes a second storage module configured to, in response to completing the reception of a second batch of light processing requests, store a second set of index information corresponding to the second resource set in a mapping unit; and store a sixth number of valid light processing requests in the second batch of light processing requests in a counting unit.
[0125] In some embodiments, the apparatus 400 further includes a third processing module configured to decrement a fifth number stored in the counting unit in response to each valid light processing request in the first batch of light processing requests being processed; and to return at least one request processing result corresponding to the first batch of light processing requests in response to the fifth number indicating that all valid light processing requests in the first batch of light processing requests have been processed.
[0126] In some embodiments, the third processing module is further configured to, in response to completing the processing of all valid light processing requests, sort at least one request processing result based on the request receiving order; and return at least one sorted request processing result.
[0127] In some embodiments, the apparatus 400 further includes a fourth processing module configured to mark the first group of resources as occupied in response to the first group of resources being allocated to the first scheduling unit, regardless of whether the resources in the first group of resources are mapped to an invalid ray processing request.
[0128] In some embodiments, the first number is determined based on the difference between a preset number and a second number, the preset number corresponding to the maximum number of resources required for a single batch of light processing requests.
[0129] In some embodiments, the second allocation module 430 is further configured to: determine a seventh number of remaining resources in the resource pool; in response to the seventh number being less than a preset number, send a message to the request sending unit indicating the seventh number; receive a second batch of optical processing requests from the request sending unit; and allocate the seventh number of resources to the second scheduling unit.
[0130] The modules included in device 400 can be implemented in various ways, including software, hardware, firmware, or any combination thereof. In some embodiments, one or more units can be implemented using software and / or firmware, such as machine-executable instructions stored on a storage medium. In addition to or as an alternative to machine-executable instructions, some or all of the modules in device 400 can be implemented at least partially by one or more hardware logic components. By way of example, and not limitation, exemplary types of hardware logic components that can be used include field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-chips (SoCs), complex programmable logic devices (CPLDs), and so on.
[0131] like Figure 5 As shown, electronic device 500 is in the form of a general-purpose electronic device. Components of electronic device 500 may include, but are not limited to, one or more processing units or processors 510, memory 520, storage devices 530, one or more communication units 540, one or more input devices 550, and one or more output devices 560. Processor 510 may be a physical or virtual processor and is capable of performing various processes according to programs stored in memory 520. In a multiprocessor system, multiple processors execute computer-executable instructions in parallel to improve the parallel processing capability of electronic device 500. Figure 5 The electronic device 500 shown can be used to achieve Figure 1 In the light control unit 110.
[0132] Electronic device 500 typically includes multiple computer storage media. Such media can be any accessible media that is accessible to electronic device 500, including but not limited to volatile and non-volatile media, removable and non-removable media. Memory 520 can be volatile memory (e.g., registers, cache, random access memory (RAM)), non-volatile memory (e.g., read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory), or some combination thereof. Storage device 530 can be removable or non-removable media and can include machine-readable media, such as flash drives, disks, or any other media that can be used to store information and / or data and can be accessed within electronic device 500.
[0133] Electronic device 500 may further include additional removable / non-removable, volatile / non-volatile storage media. Although not explicitly stated... Figure 5As shown, disk drives for reading from or writing to removable, non-volatile disks (e.g., "floppy disks") and optical disk drives for reading from or writing to removable, non-volatile optical disks can be provided. In these cases, each drive can be connected to a bus (not shown) via one or more data media interfaces. Memory 520 may include computer program product 525 having one or more program modules configured to perform various methods or actions of various embodiments of this disclosure.
[0134] Communication unit 540 enables communication with other electronic devices via a communication medium. Additionally, the functionality of components of electronic device 500 can be implemented using a single computing cluster or multiple computing machines capable of communicating via communication connections. Therefore, electronic device 500 can operate in a networked environment using logical connections to one or more other servers, network personal computers (PCs), or another network node.
[0135] Input device 550 can be one or more input devices, such as a mouse, keyboard, trackball, etc. Output device 560 can be one or more output devices, such as a monitor, speaker, printer, etc. Electronic device 500 can also communicate with one or more external devices (not shown) via communication unit 540 as needed. These external devices include storage devices, display devices, etc., and can communicate with one or more devices that enable user interaction with electronic device 500, or with any device that enables electronic device 500 to communicate with one or more other electronic devices (e.g., network card, modem, etc.). Such communication can be performed via input / output (I / O) interface (not shown).
[0136] According to an exemplary implementation of this disclosure, a computer-readable storage medium is provided that stores computer-executable instructions thereon, wherein the computer-executable instructions are executed by a processor to implement the methods described above. According to an exemplary implementation of this disclosure, a computer program product is also provided, which is tangibly stored on a non-transitory computer-readable medium and includes computer-executable instructions, which are executed by a processor to implement the methods described above.
[0137] Various aspects of this disclosure are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatuses, devices, and computer program products implemented according to this disclosure. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.
[0138] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processing unit of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner. Thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.
[0139] Computer-readable program instructions can be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions that execute on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.
[0140] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction, which contains one or more executable instructions for implementing the specified logical function. In some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0141] Various implementations of this disclosure have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed implementations. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described implementations. The terminology used herein is chosen to best explain the principles, practical applications, or improvements to technology in the market, or to enable others skilled in the art to understand the various implementations disclosed herein.
Claims
1. A resource allocation method, characterized in that, The method includes: A first set of resources is newly allocated from the resource pool to the first scheduling unit. The first number of resources in the first set is determined based at least on the second number of remappable resources in the first resource set, which includes resources already allocated to the first scheduling unit. The remappable resources include resources mapped to invalid ray processing requests. The first scheduling unit is used to schedule the first resource set to process the first batch of optical processing requests; A second set of resources is additionally allocated from the resource pool to the second scheduling unit, the third number of which is determined based at least on a fourth number of remappable resources in the second resource set, which includes resources already allocated to the second scheduling unit; and The second scheduling unit is used to schedule the second set of resources to process the second batch of optical processing requests.
2. The method according to claim 1, characterized in that, The allocation of a second set of resources from the resource pool to the second scheduling unit includes: At least partially in parallel with the reception process of the first batch of light processing requests, the second set of resources is additionally allocated from the resource pool to the second scheduling unit.
3. The method according to claim 1, characterized in that, The method further includes: In response to receiving the first batch of light processing requests, the first set of index information corresponding to the first resource set is stored in the mapping unit; and The fifth number of valid ray processing requests in the first batch is stored in the counting unit.
4. The method according to claim 3, characterized in that, The method further includes: In response to receiving the second batch of light processing requests, the second set of index information corresponding to the second resource set is stored in the mapping unit; and The sixth number of valid light processing requests in the second batch of light processing requests is stored in the counting unit.
5. The method according to claim 3, characterized in that, The method further includes: In response to each valid light processing request in the first batch of light processing requests that has been processed, the fifth number stored in the counting unit is decremented; and In response to the fifth number indication that all valid light processing requests in the first batch of light processing requests have been processed, at least one request processing result corresponding to the first batch of light processing requests is returned.
6. The method according to claim 5, characterized in that, The return of at least one request processing result corresponding to the first batch of light processing requests includes: In response to completing the processing of all valid light processing requests, the processing results of at least one request are sorted based on the order in which the requests were received; and Return the sorted results of the processing of at least one request.
7. The method according to claim 1, characterized in that, The method further includes: In response to the first group of resources being allocated to the first scheduling unit, the first group of resources is marked as occupied, regardless of whether the resources in the first group are mapped to invalid ray processing requests.
8. The method according to claim 1, characterized in that, The first number is determined based on the difference between a preset number and a second number, the preset number corresponding to the maximum number of resources required for a single batch of light processing requests.
9. The method according to claim 8, characterized in that, The step of allocating a second set of resources from the resource pool to the second scheduling unit includes: Determine the seventh number of remaining resources in the resource pool; In response to the seventh number being less than the preset number, a message is sent to the request sending unit, the message indicating the seventh number; Receive the second batch of light processing requests from the request sending unit; and The seventh number of resources are additionally allocated to the second scheduling unit.
10. An apparatus for resource allocation, characterized in that, The device includes: The first allocation module is configured to allocate a first group of resources from the resource pool to the first scheduling unit. The first number of the first group of resources is determined based at least on the second number of remappable resources in the first resource set, which includes resources already allocated to the first scheduling unit. The remappable resources include resources mapped to invalid ray processing requests. The first processing module is configured to use the first scheduling unit to schedule the first resource set to process the first batch of light processing requests; The second allocation module is configured to allocate a second set of resources from the resource pool to the second scheduling unit, wherein a third number of the second set of resources is determined based at least on a fourth number of remappable resources in the second resource set, which includes resources already allocated to the second scheduling unit; and The second processing module is configured to use the second scheduling unit to schedule the second resource set to process the second batch of light processing requests.
11. An electronic device comprising at least one processor; and at least one memory, characterized in that, The at least one memory is coupled to the at least one processor and stores instructions for execution by the at least one processor, which, when executed by the at least one processor, cause the electronic device to perform the method according to any one of claims 1 to 9.
12. A computer-readable storage medium having computer-executable instructions stored thereon, characterized in that, When the computer-executable instructions are executed by a processor, they implement the method according to any one of claims 1 to 9.
13. A computer program product, said computer program product being tangibly stored in a computer storage medium and comprising computer-executable instructions, characterized in that, The computer-executable instructions, when executed by the device, cause the device to perform the method according to any one of claims 1 to 9.