Storage resource scheduling method, device, electronic device and storage medium
By monitoring the application amount of resource application requests, it is determined whether to apply for storage resources in physical video memory or internal memory, using a unified addressing module to manage addresses and using a cache module to improve data access speed, thus solving the problem of insufficient video memory in GPU virtualization environment and achieving efficient utilization of video memory resources.
Patent Information
- Application Number
- CN202211732417.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-30
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2042-12-30
AI Technical Summary
Modern physical video memory capacity cannot meet the growing demand for video memory from applications, especially in GPU virtualization environments, resulting in insufficient video memory and the inability to create tasks.
By monitoring the amount of resource application requests, it is determined whether to apply for storage resources in physical video memory or memory, using a unified addressing module to manage physical and memory addresses, creating a virtual address association relationship, and improving data access speed through a cache module.
It improves the utilization rate of video memory, solves the problem of insufficient video memory, and realizes flexible scheduling and efficient utilization of video memory resources.
Smart Images

Figure CN116149852B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of video memory super-resolution technology, and in particular to a storage resource scheduling method, device, electronic device and storage medium. Background Art
[0002] A graphics processing unit (GPU) can provide a multi-tasking computing environment within a limited physical GPU. In a GPU virtualization system, multiple tasks are created, but these computing tasks use limited GPU resources.
[0003] The capacity of modern physical video memory cannot keep up with the growing demand for video memory from applications. Video memory is often insufficient for applications, especially in GPU virtualization environments. As the number of virtualizations increases, physical video memory can no longer meet the memory requirements of virtualized tasks. Because video memory is used to store code and data for running processes, it cannot be used by scheduling like a CPU, which divides it up by time. Therefore, virtualization environments can only spatially divide video memory and allocate it to each task. As the number of tasks increases, the amount of available video memory decreases, and eventually, insufficient physical video memory makes it impossible to create tasks.
[0004] To address the above-mentioned problems, no effective solutions have been proposed so far. Summary of the Invention
[0005] Embodiments of the present invention provide a method, device, electronic device, and storage medium for scheduling storage resources, so as to at least solve the technical problem of low utilization of video memory in related technologies.
[0006] According to one aspect of an embodiment of the present invention, a scheduling method for storage resources is provided, including: monitoring a resource application request initiated by a front-end application, wherein the resource application request is used to apply for storage space and the resource application request carries an application quantity; responding to the resource application request, determining whether to apply for storage resources in physical video memory or internal memory based on the application quantity carried in the resource application request; and returning the applied storage resources to the front-end application for use.
[0007] Optionally, the application for storage resources in the physical video memory or the internal memory is determined based on the application amount carried in the resource application request, including: determining whether the remaining amount of video memory resources in the physical video memory is lower than the application amount; if the remaining amount of video memory resources is lower than the application amount, accessing the internal memory and applying for storage resources from the internal memory; if the remaining amount of video memory resources is higher than or equal to the application amount, applying for storage resources in the physical video memory.
[0008] Optionally, the applied storage resources are managed through a unified addressing module, which includes: obtaining the applied storage resources, wherein the storage resources include: the physical address of the physical video memory and the physical address of the internal memory; virtualizing the physical address of the physical video memory and the physical address of the internal memory respectively to obtain the virtual address of the physical video memory and the virtual address of the internal memory; creating a first association relationship between the physical address and the virtual address of the physical video memory, and creating a second association relationship between the physical address and the virtual address of the internal memory; caching the virtual address of the physical video memory and the virtual address of the internal memory, and writing them into a cache module, wherein the cache module loads corresponding data through the cached virtual address.
[0009] Optionally, the structure of the virtual address includes: at least one index address and an offset, wherein the index address is used to indicate a physical address associated with a corresponding directory.
[0010] Optionally, the method also includes: receiving a data access request from a front-end application; responding to the data access request, calling a unified addressing module, wherein the unified addressing module feeds back a physical address; accessing a cache module based on the fed-back physical address, and obtaining data fed back by the cache module that matches the data access request.
[0011] According to another aspect of an embodiment of the present invention, a storage resource scheduling device is also provided, including: a monitoring module, used to monitor resource application requests initiated by a front-end application, wherein the resource application request is used to apply for storage space, and the resource application request carries an application quantity; a processing module, used to respond to the resource application request, and determine whether to apply for storage resources in the physical video memory or internal memory based on the application quantity carried by the resource application request; and a calling module, used to return the applied storage resources to the front-end application for use.
[0012] Optionally, the device also includes: a management module, which is used to manage the applied storage resources through a unified addressing module, and the management module includes: an acquisition module, which is used to acquire the applied storage resources, wherein the storage resources include: the physical address of the physical video memory and the physical address of the internal memory; a virtualization processing module, which is used to virtualize the physical address of the physical video memory and the physical address of the internal memory respectively to obtain the virtual address of the physical video memory and the virtual address of the internal memory; a creation module, which is used to create a first association relationship between the physical address and the virtual address of the physical video memory, and create a second association relationship between the physical address and the virtual address of the internal memory; a storage module, which is used to cache the virtual address of the physical video memory and the virtual address of the internal memory, and write them into a cache module, wherein the cache module loads corresponding data through the cached virtual address.
[0013] Optionally, the structure of the virtual address includes: at least one index address and an offset, wherein the index address is used to indicate a physical address associated with a corresponding directory.
[0014] Optionally, the device also includes: a receiving module for receiving a data access request from a front-end application; a calling module for responding to the data access request and calling the unified addressing module, wherein the unified addressing module feeds back a physical address; and an obtaining module for accessing the cache module based on the fed-back physical address and obtaining data fed back by the cache module that matches the data access request.
[0015] According to another aspect of an embodiment of the present invention, an electronic device is also provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute any of the above methods.
[0016] According to another aspect of an embodiment of the present invention, a non-transitory computer-readable storage medium storing computer instructions is further provided, wherein the computer instructions are used to enable a computer to execute any one of the above methods.
[0017] In an embodiment of the present invention, a resource application request initiated by a front-end application is monitored, wherein the resource application request is used to apply for storage space and carries a request amount. In response to the resource application request, a determination is made as to whether to apply for storage resources in physical video memory or internal memory based on the request amount carried in the resource application request. The requested storage resources are then returned to the front-end application for use. It is readily apparent that the resource application request can be initiated by the front-end application and the request amount carried in the resource application request. Furthermore, the resource storage location can be determined based on the request amount, thereby improving video memory utilization and resolving the technical issue of low video memory utilization in related technologies. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0019] Figure 1 is a flow chart of a storage resource scheduling method according to an embodiment of the present invention;
[0020] Figure 2a is a schematic diagram of a graphics processor video memory resource application and scheduling process according to an embodiment of the present invention;
[0021] Figure 2b This is a flow chart of a graphics processor video memory resource application and scheduling process according to an embodiment of the present invention;
[0022] Figure 31 is a schematic diagram of a graphics processor memory resource application and scheduling according to an embodiment of the present invention;
[0023] Figure 4 1 is a schematic diagram of a graphics processor memory data reading method according to an embodiment of the present invention;
[0024] Figure 5 is a schematic diagram of a storage resource device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0025] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0026] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0027] According to an embodiment of the present invention, an embodiment of a scheduling method for storage resources is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0028] Currently, the most common and effective detection method for determining the deformation of power transformer windings in related technologies is winding frequency response measurement, but this can only be performed during a power outage. More advanced detection methods include collecting transformer vibration or sound signals for spectral feature analysis. This method can compare the spectral signals before and after a short-circuit impact and score them to determine the degree of transformer winding deformation and whether a power outage is required for maintenance. However, most of these current methods have varying degrees of problems, such as poor anti-interference ability, high noise, insufficient monitoring data, and insufficient algorithm intelligence. They are only targeted at specific scenarios and specific transformers, and the model needs to be rebuilt when the usage scenario is changed. They also have limited adaptability to different transformers and different working conditions.
[0029] Example 1
[0030] Figure 1 FIG. 1 is a flow chart of a method for scheduling storage resources according to an embodiment of the present invention. Figure 1 As shown, the method includes the following steps:
[0031] Step S102: monitoring a resource application request initiated by a front-end application, wherein the resource application request is used to apply for storage space and carries an application amount.
[0032] The above-mentioned front-end application can be the front-end part of the website, wherein the front-end application can be an artificial intelligence (AI) application. Optionally, the front-end application runs on a browser such as a client (also called a PC) or a mobile terminal to display web pages to users.
[0033] The above-mentioned resource application request can be a storage space for requesting resources, where the resources can include but are not limited to browsing data, video playback records, etc. on the front-end application. Optionally, the resource application request can be issued in the form of a request instruction, and the request instruction can be displayed in voice or text form.
[0034] The above-mentioned application amount can be used to represent the quantity of resources. Optionally, the location where the resources are stored can be determined based on the application amount.
[0035] In an optional embodiment, the front-end application can be monitored in real time through a monitoring program. When it is detected that the front-end application initiates a resource application request, the storage space of this type of resource can be determined based on the application amount carried in the resource application request initiated by the front-end.
[0036] Figure 2a FIG. 1 is a schematic diagram of a graphics processor memory resource application and scheduling process according to an embodiment of the present invention. Figure 2aAs shown, when the front-end application is an artificial intelligence application, that is, an AI application, based on multi-tasking, the graphics processing unit (GPU) video memory resource application and scheduling process is described. S20 is a plurality of AI computing tasks run by the user. The AI computing task applies for video memory through the system in step S21. The system in S21 will use relevant logical judgment to schedule to the memory for resource creation when the GPU video memory is insufficient. That is, the video memory application in the multi-tasking situation is solved by applying for 5G video memory, 2G video memory, and 3G video memory.
[0037] Step S104 : In response to the resource application request, it is determined whether to apply for storage resources in the physical video memory or the internal memory based on the application amount carried in the resource application request.
[0038] The above-mentioned physical video memory can be video memory, that is, the video memory of the independent graphics card is carried by the graphics card itself, while the integrated graphics card needs to be allocated from the system memory.
[0039] The above-mentioned memory may be an internal memory, which is used to temporarily store the calculation data in the central processing unit and the data exchanged with the external memory such as the hard disk.
[0040] In an optional embodiment, after receiving a resource request initiated by a front-end application, the system can determine whether to store the resource in physical video memory or in internal memory based on the requested amount carried in the resource request. Optionally, it can determine whether the remaining amount of video memory resources in the physical video memory is less than the requested amount. If the remaining amount of video memory resources is less than the requested amount, the storage resource is requested from the internal memory. If the remaining amount of video memory resources is greater than or equal to the requested amount, the storage resource is requested in the physical video memory.
[0041] Figure 2b FIG. 1 is a flow chart of a graphics processor memory resource application and scheduling process according to an embodiment of the present invention. Figure 2b As shown, the process is divided into the following steps:
[0042] Step S200: The artificial intelligence application is started.
[0043] Step S202: The artificial intelligence application starts loading the relevant library, that is, the corresponding dynamic library.
[0044] Step S204: The artificial intelligence application applies for visual processor video memory.
[0045] Step S206: The resource scheduling module responds to the request for video memory.
[0046] Step S208: Determine whether the remaining visual processor memory meets the current request.
[0047] Optionally, if the remaining visual processors meet the current request, the process proceeds to step S210; if the remaining visual processors do not meet the current request, the process proceeds to step S212.
[0048] Step S210: If the request is met, the system will open up corresponding space in the visual processor memory. After the space is opened, it will be uniformly maintained through the unified addressing module, and the video memory will be applied for on the visual processor memory and added to the virtual address pool.
[0049] Step S212: If the physical video memory does not meet the current application, the system will open up corresponding space in the memory. After the space is opened, it will be uniformly maintained through the unified addressing module, that is, the video memory is applied for on the memory and added to the virtual address pool.
[0050] Step S214: using the Application Programming Interface (API) to call and return.
[0051] Step S106: Return the requested storage resources to the front-end application for use.
[0052] Among them, this solution and system are divided into three major modules: resource scheduling, unified addressing, and cache. The resource scheduling module encapsulates and enhances the function of GPU applying for video memory. The unified addressing module is responsible for virtualizing the real video memory and the physical address of the memory to provide a virtual access address to the outside world. When reading and writing data, the virtualized address is converted into a real physical address for reading and writing. The resource scheduling module and the physical device cache data through the cache module to improve the reading and writing speed. The resource scheduling module will monitor the application of video memory. If it exceeds the remaining amount of video memory, the scheduling module will open up a corresponding memory in the system for the application to use for the excess part. The unified addressing module maintains the real physical address information corresponding to the virtualized address. After the task is completed, the corresponding resources will be released according to the physical address information corresponding to the virtualized address.
[0053] The virtual address is 48 bits long and can be divided into four parts: the global directory (Projected Gradient Descent, PGD index), the parent directory (Projected Upper Descent, PUD index), the intermediate directory (Projected Middle Descent, PMD index), and the offset. The unified addressing module stores the starting physical memory address of the global directory. The process of converting a virtual memory address to a physical memory address is as follows:
[0054] The unified addressing module obtains the physical memory address of the global directory, and then uses bits 39 to 47 of the virtual memory address as an index to read the physical memory address of the parent directory from the PGD index; uses bits 30 to 38 of the virtual memory address as an index to read the physical memory address of the intermediate directory from the PUD index; uses bits 21 to 29 of the virtual memory address as an index to read the physical memory address of the physical memory page from the PMD index; uses bits 0 to 20 of the virtual memory address as the offset of the physical memory page to obtain the final physical memory address.
[0055] In an embodiment of the present invention, a resource application request initiated by a front-end application is monitored, wherein the resource application request is used to apply for storage space and carries a request amount. In response to the resource application request, a determination is made as to whether to apply for storage resources in physical video memory or internal memory based on the request amount carried in the resource application request. The requested storage resources are then returned to the front-end application for use. It is readily apparent that the resource application request can be initiated by the front-end application and the request amount carried in the resource application request. Furthermore, the resource storage location can be determined based on the request amount, thereby improving video memory utilization and resolving the technical issue of low video memory utilization in related technologies.
[0056] Optionally, based on the request amount carried in the resource request request, it is determined whether to apply for storage resources in the physical video memory or the internal memory, including: determining whether the remaining amount of video memory resources in the physical video memory is lower than the request amount; if the remaining amount of video memory resources is lower than the request amount, accessing the internal memory and applying for storage resources from the internal memory; if the remaining amount of video memory resources is higher than or equal to the request amount, applying for storage resources in the physical video memory.
[0057] Figure 3 FIG. 1 is a schematic diagram of a graphics processor memory resource application and scheduling according to an embodiment of the present invention. Figure 3 As shown in the figure, the video memory scheduling system can be divided into three modules, namely the resource scheduling module, the unified addressing module and the cache module. Among them, the resource scheduling module is used to load the response of video memory requests and allocate corresponding space in the memory or video memory through relevant logical judgment. The unified addressing module is responsible for the generation of virtual addresses and the maintenance of the correspondence between virtual addresses and physical addresses. The cache module is used to improve the access speed of data. The cache module loads the corresponding data in advance according to the corresponding logic to speed up the reading of data. Figure 3 As shown in the numbers, the application and scheduling of video memory resources are divided into the following steps:
[0058] Step 3.1: You can first use the artificial intelligence application to apply for video memory.
[0059] Step 3.2: The resource scheduling module responds to the request for video memory and uses corresponding logic to determine whether to allocate the corresponding space in GPU video memory or main memory.
[0060] Step 3.3: Generate virtual address. The virtual address has a total of 48 bits, including global directory: bits 39 to 47 (9 bits in total); parent directory: bits 30 to 38 (9 bits in total); intermediate directory: bits 21 to 29 (9 bits in total); offset: bits 0 to 20 (21 bits in total). The generation of virtual address is divided into four steps, as follows:
[0061] Step 3.3.1: Create a global directory address; Step 3.3.2: Create a parent directory address; Step 3.3.3: Create an intermediate directory address; Step 3.3.4: Create an offset address.
[0062] Step 3.4: After the virtual address is generated, the final physical address is saved through the 21-bit offset.
[0063] Step 3.5: The unified addressing module writes the virtual address to the cache module.
[0064] Step 3.6: The cache module loads the corresponding data through the virtual address through the relevant logic.
[0065] Optionally, the applied storage resources are managed through a unified addressing module, which includes: obtaining the applied storage resources, wherein the storage resources include: the physical address of the physical video memory and the physical address of the internal memory; virtualizing the physical address of the physical video memory and the physical address of the internal memory respectively to obtain the virtual address of the physical video memory and the virtual address of the internal memory; creating a first association relationship between the physical address and the virtual address of the physical video memory, and creating a second association relationship between the physical address and the virtual address of the internal memory; caching the virtual address of the physical video memory and the virtual address of the internal memory, and writing them into a cache module, wherein the cache module loads corresponding data through the cached virtual address.
[0066] The above virtualization processing is used to process the physical address of the video memory and the physical address of the internal memory to obtain the virtual address of the physical video memory and the virtual address of the internal memory.
[0067] The first association relationship mentioned above may be an association relationship between a physical address and a virtual address of a physical video memory.
[0068] The second association relationship mentioned above may be an association relationship between a physical address and a virtual address of a memory.
[0069] Figure 4 FIG. 1 is a schematic diagram of a graphics processor memory data reading method according to an embodiment of the present invention. Figure 4 As shown, the reading process is divided into the following steps:
[0070] Step 4.1: The AI application calls the AI to obtain the video memory data.
[0071] Step 4.2: The resource scheduling module calls the unified addressing module to obtain the real physical address.
[0072] The unified addressing module stores the starting physical memory address of the global directory. The process of converting the virtual memory address into the physical memory address is as follows:
[0073] The unified addressing module obtains the physical memory address of the global directory, uses bits 39 to 47 of the virtual memory address as the index, and reads the physical memory address of the parent directory from the PGD index.
[0074] Using bits 30 to 38 of the virtual memory address as the index, read the physical memory address of the intermediate directory from the PUD index.
[0075] Using bits 21 to 29 of the virtual memory address as the index, the physical memory address of the physical memory page is read from the PMD index.
[0076] Use bits 0 to 20 of the virtual memory address as the offset of the physical memory page to obtain the final physical memory address.
[0077] Step 4.3: The unified addressing module returns the real physical address.
[0078] Step 4.4: The resource scheduling module requests the cache module to obtain relevant data according to the real physical address.
[0079] Step 4.5: The cache module returns the corresponding data.
[0080] Step 4.6: The resource scheduling module returns data.
[0081] Optionally, the structure of the virtual address includes: at least one index address and an offset, wherein the index address is used to indicate a physical address associated with a corresponding directory.
[0082] In an optional embodiment, a scheduler can be used to determine the switched video memory page from the video memory pages used to store the target rendering context according to the frequency of use, wherein the scheduler switches the switched video memory page out of the video memory and allocates the free video memory pages in the video memory after the switch to the active rendering context. Through the above scheme, video memory resources can be flexibly scheduled and the utilization efficiency of video memory resources can be improved. Optionally, the super-resolution of video memory is achieved by supplementing video memory with internal memory, which is more efficient than the hot and cold data exchange scheme. The data reading and writing speed is further improved by the cache module. Compared with the hot and cold data scheme, it not only greatly improves the reading and writing speed, but also truly achieves super-resolution of video memory.
[0083] Optionally, the method also includes: receiving a data access request from a front-end application; responding to the data access request, calling a unified addressing module, wherein the unified addressing module feeds back a physical address; accessing a cache module based on the fed-back physical address, and obtaining data fed back by the cache module that matches the data access request.
[0084] In an optional embodiment, the present invention proposes a method and system for achieving video memory super-resolution based on GPU unified addressing technology. This method allocates corresponding space in memory and virtualizes the memory into corresponding video memory through related technologies, providing unified addressing to external devices. This allows for super-resolution of video memory. Directly virtualizing video memory from memory greatly increases data read and write speeds, significantly improving efficiency compared to hot and cold data exchange.
[0085] Example 2
[0086] According to an embodiment of the present invention, a storage resource scheduling device is also provided, which can execute the transformer status detection method in the above embodiment. The specific implementation method and preferred application scenario are the same as the above embodiment and will not be repeated here.
[0087] Figure 5 is a schematic diagram of a storage resource device according to an embodiment of the present invention, such as Figure 5 As shown, the device includes:
[0088] The monitoring module 502 is used to monitor the resource application request initiated by the front-end application, wherein the resource application request is used to apply for storage space and carries the application amount.
[0089] The processing module 504 is configured to respond to the resource application request and determine whether to apply for storage resources in the physical video memory or the internal memory based on the application amount carried in the resource application request.
[0090] The calling module 506 is used to return the requested storage resources to the front-end application for use.
[0091] Optionally, the processing module 504 includes: a judgment module, used to judge whether the remaining amount of video memory resources of the physical video memory is lower than the application amount; a first application module, used to access the memory and apply for storage resources from the memory if the remaining amount of video memory resources is lower than the application amount; and a second application module, used to apply for storage resources in the physical video memory if the remaining amount of video memory resources is higher than or equal to the application amount.
[0092] Optionally, the device also includes: a management module, which is used to manage the applied storage resources through a unified addressing module, and the management module includes: an acquisition module, which is used to acquire the applied storage resources, wherein the storage resources include: the physical address of the physical video memory and the physical address of the internal memory; a virtualization processing module, which is used to virtualize the physical address of the physical video memory and the physical address of the internal memory respectively to obtain the virtual address of the physical video memory and the virtual address of the internal memory; a creation module, which is used to create a first association relationship between the physical address and the virtual address of the physical video memory, and create a second association relationship between the physical address and the virtual address of the internal memory; a storage module, which is used to cache the virtual address of the physical video memory and the virtual address of the internal memory, and write them into a cache module, wherein the cache module loads corresponding data through the cached virtual address.
[0093] Optionally, the device also includes: a receiving module for receiving a data access request from a front-end application; a calling module for responding to the data access request and calling the unified addressing module, wherein the unified addressing module feeds back a physical address; and an obtaining module for accessing the cache module based on the fed-back physical address and obtaining data fed back by the cache module that matches the data access request.
[0094] Example 3
[0095] According to an embodiment of the present invention, an electronic device is also provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform any of the aforementioned methods.
[0096] Example 4
[0097] According to an embodiment of the present invention, a non-transitory computer-readable storage medium storing computer instructions is further provided, wherein the computer instructions are used to enable a computer to execute any one of the above methods.
[0098] The serial numbers of the above embodiments of the present invention are for description only and do not represent the advantages or disadvantages of the embodiments.
[0099] In the above embodiments of the present invention, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0100] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only exemplary. For example, the division of the units can be a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0101] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0102] In addition, the functional units in the various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0103] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk, etc. Various media that can store program codes.
[0104] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as within the scope of protection of the present invention.
Claims
1. A storage resource scheduling method, comprising: Monitoring a resource application request initiated by a front-end application, wherein the resource application request is for applying for storage space and carries an application amount; In response to the resource application request, determining to apply for storage resources in a physical video memory or a memory based on the application amount carried in the resource application request; Returning the requested storage resources to the front-end application for use; wherein the applied storage resources are managed through a unified addressing module, including: obtaining the applied storage resources, wherein the storage resources include: a physical address of the physical video memory and a physical address of the memory; performing virtualization processing on the physical address of the physical video memory and the physical address of the memory respectively to obtain a virtual address of the physical video memory and a virtual address of the memory, wherein the structure of the virtual address includes: at least one index address and an offset, wherein the index address is used to indicate a physical address associated with a corresponding directory, wherein the directory includes a global directory, an upper directory, and an intermediate directory; creating a first association relationship between the physical address of the physical video memory and the virtual address, and creating a second association relationship between the physical address of the memory and the virtual address; caching the virtual address of the physical video memory and the virtual address of the memory, and writing them into a cache module, wherein the cache module loads corresponding data through the cached virtual address; The unified addressing module is further configured to store the starting physical memory address of the global directory and convert the virtual address into a physical address to read and write the data.
2. The method according to claim 1, wherein Determining to apply for storage resources in a physical video memory or a memory based on the application amount carried in the resource application request includes: Determining whether the remaining amount of the video memory resource of the physical video memory is lower than the requested amount; If the remaining amount of the video memory resource is lower than the requested amount, access the memory and request the storage resource from the memory; If the remaining amount of the video memory resource is greater than or equal to the requested amount, the storage resource is requested in the physical video memory.
3. The method according to claim 1, wherein The method further comprises: Receiving a data access request from the front-end application; In response to the data access request, calling the unified addressing module, wherein the unified addressing module feeds back a physical address; The cache module is accessed based on the fed-back physical address to obtain data matched with the data access request fed back by the cache module.
4. A storage resource scheduling device, comprising: A monitoring module, configured to monitor resource application requests initiated by a front-end application, wherein the resource application request is for applying for storage space and carries an application amount; a processing module, configured to respond to the resource application request and determine whether to apply for storage resources in a physical video memory or a memory based on the application amount carried in the resource application request; A calling module, used to return the applied storage resources to the front-end application for use; The device further comprises: a management module for managing the applied storage resources through a unified addressing module, the management module comprising: an acquisition module for acquiring the applied storage resources, wherein the storage resources comprise: a physical address of the physical video memory and a physical address of the memory; a virtualization processing module for performing virtualization processing on the physical address of the physical video memory and the physical address of the memory respectively to obtain a virtual address of the physical video memory and a virtual address of the memory, wherein the structure of the virtual address comprises: at least one index address and an offset, wherein the index address is used to indicate a physical address associated with a corresponding directory, wherein the directory comprises a global directory, an upper directory, and an intermediate directory; a creation module for creating a first association relationship between the physical address of the physical video memory and the virtual address, and creating a second association relationship between the physical address of the memory and the virtual address; a storage module for caching the virtual address of the physical video memory and the virtual address of the memory and writing them into a cache module, wherein the cache module loads corresponding data through the cached virtual address; The unified addressing module is further configured to store the starting physical memory address of the global directory and convert the virtual address into a physical address to read and write the data.
5. The device according to claim 4, wherein The processing module includes: A judging module, configured to judge whether the remaining amount of the video memory resource of the physical video memory is lower than the requested amount; A first application module is configured to access the memory and apply for the storage resource from the memory if the remaining amount of the video memory resource is lower than the application amount; The second application module is configured to apply for the storage resource in the physical video memory if the remaining amount of the video memory resource is greater than or equal to the application amount.
6. The device according to claim 4, wherein The device further comprises: A receiving module, configured to receive a data access request from the front-end application; a calling module, configured to call the unified addressing module in response to the data access request, wherein the unified addressing module feeds back a physical address; The obtaining module is used to access the cache module based on the fed-back physical address, and obtain the data fed back by the cache module that matches the data access request.
7. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 3.
8. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-3.
Citation Information
Patent Citations
Video memory allocation method and device, electronic equipment and readable storage medium
CN113835887A