Resource management method and device, equipment and storage medium
By releasing time and time-freeing of resources in electronic devices, the problem of insufficient memory is solved, and efficient utilization of resources and maximum use of storage devices is achieved.
Patent Information
- Application Number
- CN202311211635.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-19
- Publication Date
- 2025-03-21
AI Technical Summary
In electronic devices, the number of algorithm post-processing nodes continues to increase as services increase, resulting in insufficient memory, and existing cache policies cannot effectively meet resource usage needs.
By obtaining resource application requests for service data to be processed, if the remaining resources of the first storage device are insufficient, the execution time and resource release time of the resource to be released and the corresponding data processing algorithm are determined, and storage devices with fast read and write speeds are preferred to realize resource management between multiple storage devices.
Improve resource utilization to ensure that the resources of storage devices are used to the maximum extent possible while ensuring the normal operation of the application.
Smart Images

Figure CN119668822A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of resource management, and in particular to a resource management method, device, equipment and storage medium. Background Art
[0002] In electronic devices, the number of algorithm post-processing nodes increases with the increase of business, and each algorithm post-processing node corresponds to a resident memory. Taking ultrasound equipment as an example, in general, the main process of the memory pool is about 1400M, and the background process is about 600M. If there is no memory cleanup mechanism, as the business increases, the memory will become increasingly insufficient. The usual cache strategies include: for writing new data, write the new data in the cache database and record the time, then write the new data to the disk and return a successful write; for updating data, check whether the data exists in the cache database. If not, update the data on the disk and write the updated data to the cache database. If it exists, update the data in the cache database and update the data on the disk at the same time, and then return a successful update. However, due to the strong coupling of algorithm post-processing nodes and the different time consumption of each algorithm node, the commonly used cache strategy cannot meet the resource usage requirements well. Summary of the invention
[0003] In view of this, the purpose of the present invention is to provide a resource management method, apparatus, device and storage medium, which can release resources in storage devices based on algorithm execution time and resource release time, give priority to storage devices with fast read and write speeds, realize resource management among multiple storage devices, and improve resource utilization. The specific scheme is as follows:
[0004] In a first aspect, the present application provides a resource management method, comprising:
[0005] Obtaining a resource application request initiated for pending business data of an electronic device;
[0006] If the remaining storage resources in the current first storage device are insufficient, determine the first resource to be released from the first storage device, and determine the first algorithm execution time of the data processing algorithm corresponding to the first resource to be released and the first resource release time; the first resource release time is the migration time required to migrate the data stored on the first resource to be released to the second storage device; the second storage device is a storage device with a data reading and writing speed lower than that of the first storage device;
[0007] The first resource to be released is released using a release method determined based on the execution time of the first algorithm and the release time of the first resource, so that the service data to be processed can be written into the first storage device when the remaining storage resources in the first storage device are sufficient after the current resources are released.
[0008] Optionally, determining the first resource to be released from the first storage device includes:
[0009] Determine a number of releasable resources from the first storage device, and determine the priorities corresponding to the releasable resources respectively;
[0010] The resource with the highest priority among the plurality of releasable resources is determined as the first resource to be released.
[0011] Optionally, determining the priorities corresponding to the releasable resources respectively includes:
[0012] The priorities corresponding to the releasable resources are determined based on the algorithm execution time of the data processing algorithms corresponding to the releasable resources and the resource size.
[0013] Optionally, determining a first resource release time corresponding to the first resource to be released includes:
[0014] Determining a target read / write speed based on a historical data read / write speed of the second storage device;
[0015] A first resource release time corresponding to the first resource to be released is determined based on the resource size of the first resource to be released and the target read / write speed.
[0016] Optionally, releasing the first resource to be released by using a release method determined based on the execution time of the first algorithm and the release time of the first resource includes:
[0017] If the execution time of the first algorithm is less than the release time of the first resource, determining the release mode is to directly delete the data, and directly deleting the data currently stored on the first resource to be released;
[0018] If the execution time of the first algorithm is not less than the release time of the first resource, the release method is determined to be data migration, and the data stored on the first resource to be released is migrated to the second storage device.
[0019] Optionally, releasing the first resource to be released by using a release method determined based on the execution time of the first algorithm and the release time of the first resource includes:
[0020] If the execution time of the first algorithm is less than the release time of the first resource, determining the release mode is to directly delete the data, and directly deleting the data currently stored on the first resource to be released;
[0021] If the execution time of the first algorithm is not less than the first resource release time, and the remaining storage resources in the second storage device are sufficient, directly migrate the data stored in the first resource to be released to the second storage device;
[0022] If the execution time of the first algorithm is not less than the first resource release time, and the remaining storage resources in the second storage device are currently insufficient, then determine the second resource to be released from the second storage device, and determine the second algorithm execution time of the data processing algorithm corresponding to the second resource to be released and the second resource release time; the second resource release time is the migration time required to migrate the data stored on the second resource to be released to the third storage device; the third storage device is a storage device with a data reading and writing speed lower than that of the second storage device;
[0023] The corresponding resources to be released are released using a release method determined based on the first algorithm execution time, the first resource release time, the second algorithm execution time and the second resource release time.
[0024] Optionally, releasing the corresponding resources to be released by using a release method determined based on the first algorithm execution time, the first resource release time, the second algorithm execution time, and the second resource release time includes:
[0025] Determine a corresponding algorithm execution total time based on the first algorithm execution time and the second algorithm execution time, and determine a corresponding resource release total time based on the first resource release time and the second resource release time;
[0026] If the total execution time of the algorithm is less than the total resource release time, determining the release mode is to directly delete the data, and directly deleting the data currently stored on the first resource to be released;
[0027] If the total algorithm execution time is not less than the total resource release time, releasing the second resource to be released by using a release method determined based on the second algorithm execution time and the second resource release time;
[0028] If the remaining storage resource size in the second storage device is not less than the resource size of the first resource to be released, the data stored in the first resource to be released is migrated to the second storage device.
[0029] Optionally, releasing the second resource to be released by using a release method determined based on the execution time of the second algorithm and the release time of the second resource includes:
[0030] If the execution time of the second algorithm is less than the release time of the second resource, directly deleting the data currently stored on the second resource to be released;
[0031] If the execution time of the second algorithm is not less than the second resource release time, the data stored on the second resource to be released is migrated to the third storage device.
[0032] In a second aspect, the present application provides a resource management device, including:
[0033] A request acquisition module, used to acquire a resource application request initiated for the pending business data of the electronic device;
[0034] A resource determination module, configured to determine a first resource to be released from the first storage device if the remaining storage resources in the current first storage device are insufficient, and determine a first algorithm execution time of a data processing algorithm corresponding to the first resource to be released and a first resource release time; the first resource release time is the migration time required to migrate the data stored on the first resource to be released to a second storage device; the second storage device is a storage device having a data reading and writing speed lower than that of the first storage device;
[0035] A resource release module is used to release the first resource to be released using a release method determined based on the execution time of the first algorithm and the release time of the first resource, so as to write the business data to be processed into the first storage device when the remaining storage resources in the first storage device are sufficient after the current resources are released.
[0036] In a third aspect, the present application provides an electronic device, including:
[0037] Memory, used to store computer programs;
[0038] The processor is used to execute the computer program to implement the aforementioned resource management method.
[0039] In a fourth aspect, the present application provides a computer-readable storage medium for storing a computer program, wherein the computer program implements the aforementioned resource management method when executed by a processor.
[0040] In the present application, a resource application request initiated for pending business data of an electronic device is obtained; if the remaining storage resources in the current first storage device are insufficient, a first resource to be released is determined from the first storage device, and a first algorithm execution time of a data processing algorithm corresponding to the first resource to be released and a first resource release time are determined; the first resource release time is the migration time required to migrate the data stored on the first resource to be released to a second storage device; the second storage device is a storage device with a data reading and writing speed lower than that of the first storage device; the first resource to be released is released using a release method determined based on the first algorithm execution time and the first resource release time, so that the pending business data can be written into the first storage device when the remaining storage resources in the first storage device are sufficient after the current resources are released. It can be seen that when the remaining storage resources in the current first storage device are insufficient, the present application releases the resources to be released in the first storage device based on the algorithm execution time and the resource release time. The release method includes migrating the data stored on the resources to be released from the first storage device with a higher read and write speed to the second storage device with a lower read and write speed, so that the storage device with a faster read and write speed is given priority when storing resources, and resource management is realized among multiple storage devices, as well as the resources of the storage device are used to the maximum extent possible while ensuring the normal operation of the application, thereby improving resource utilization. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0042] Figure 1 A flow chart of a resource management method disclosed in this application;
[0043] Figure 2 An overall flow chart of resource management disclosed in this application;
[0044] Figure 3 A memory resource management flow chart disclosed in this application;
[0045] Figure 4 A video memory resource management flow chart disclosed in this application;
[0046] Figure 5 A storage device resource exchange relationship diagram disclosed in this application;
[0047] Figure 6A schematic diagram of the structure of a resource management device disclosed in this application;
[0048] Figure 7 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION
[0049] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments 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 creative work are within the scope of protection of the present invention.
[0050] Generally, due to the strong coupling of algorithm post-processing nodes and the different time consumption of each algorithm node, the commonly used cache strategy cannot meet the resource usage requirements well. To this end, the present application provides a resource management method that can release resources in a storage device based on the algorithm execution time and the resource release time, give priority to storage devices with fast read and write speeds, realize resource management between multiple storage devices, and improve resource utilization.
[0051] See also Figure 1 As shown, an embodiment of the present invention discloses a resource management method, including:
[0052] Step S11: Obtain a resource application request initiated for the service data to be processed of the electronic device.
[0053] Among them, the electronic device can be various devices that need to perform data processing and data storage, and at least two storage devices can be configured on it. The electronic device can be, but is not limited to, medical electronic devices such as ultrasound instruments and endoscope instruments. The storage device can be a memory, a video memory, a disk, etc. The business data to be processed is the data corresponding to the electronic device to implement the corresponding business function. Taking an ultrasound instrument as an example, the business data to be processed is collected by the ultrasound instrument, wherein the business data to be processed includes but is not limited to ultrasound image data, ultrasound scanning parameters, text data, interaction data, operation logs, etc.
[0054] For ease of description, the following description of the solution will be made using an ultrasonic instrument as an example. The implementation methods of other electronic devices are similar and will not be repeated in the embodiments of this application. In order to save the business data to be processed to a storage device, it is necessary to first initiate a resource application request for the business data to be processed to the ultrasound host, and when the ultrasound host receives the resource application request, determine the resource type and the resource size required for the business data to be processed based on the resource application request, and also determine the corresponding first storage device according to the resource type. For example, if the resource type is a memory resource, the corresponding first storage device is determined to be a memory; if the resource type is a video memory resource, the corresponding first storage device is determined to be a video memory.
[0055] Step S12: If the remaining storage resources in the current first storage device are insufficient, determine the first resource to be released from the first storage device, and determine the first algorithm execution time of the data processing algorithm corresponding to the first resource to be released and the first resource release time; the first resource release time is the migration time required to migrate the data stored on the first resource to be released to the second storage device; the second storage device is a storage device with a data reading and writing speed lower than that of the first storage device.
[0056] In a specific implementation, if the remaining storage resource size in the current first storage device is greater than or equal to the resource size required for the business data to be processed, that is, the remaining storage resources in the current first storage device are sufficient, the business data to be processed can be directly written into the first storage device.
[0057] In another specific implementation, if the remaining storage resource size in the current first storage device is less than the resource size required for the business data to be processed, that is, the remaining storage resources in the current first storage device are insufficient, it is necessary to release some resources in the first storage device so as to write the business data to be processed into the first storage device. Specifically, the first resource to be released is first determined from the first storage device, and the first algorithm execution time of the data processing algorithm corresponding to the first resource to be released is determined, and the migration time of migrating the data stored on the first resource to be released from the first storage device to the second storage device is determined to obtain the first resource release time corresponding to the first resource to be released. It should be noted that the data reading and writing speed of the first storage device is greater than the data reading and writing speed of the second storage device. For determining the first algorithm execution time of the data processing algorithm corresponding to the first resource to be released, for example, if the data processing algorithm corresponding to the first resource to be released is an image segmentation algorithm, the first algorithm execution time is the algorithm execution time of the image segmentation algorithm; if the data processing algorithm corresponding to the first resource to be released is an ultrasound imaging algorithm, the first algorithm execution time is the algorithm execution time of the ultrasound imaging algorithm.
[0058] Wherein, determining the first resource to be released from the first storage device includes: determining a number of releasable resources from the first storage device, and determining the priorities corresponding to each releasable resource; determining the resource with the highest priority among the number of releasable resources as the first resource to be released. It is understandable that, since not all resources in the storage device can be released, it is necessary to first determine a number of releasable resources from all stored resources of the first storage device, and determine the priorities corresponding to each releasable resource, and then select the resource with the highest priority from the number of releasable resources and use it as the first resource to be released. It should be noted that the priority reflects the amount of data processed per second by the data processing algorithm corresponding to the releasable resource. The larger the amount of data processed per second, the higher the priority, and the faster the releasable resource can be released, so that the business data to be processed can be written to the storage device faster.
[0059] It should be noted that determining the priorities corresponding to each releasable resource includes: determining the priorities corresponding to each releasable resource based on the algorithm execution time and resource size of the data processing algorithm corresponding to each releasable resource. Specifically, the algorithm execution time of the data processing algorithm corresponding to each releasable resource is determined, and the resource size corresponding to each releasable resource is determined. Based on the ratio between the resource size corresponding to each releasable resource and the algorithm execution time of the corresponding data processing algorithm, the amount of data processed per second by the data processing algorithm corresponding to each releasable resource can be obtained. Based on the amount of data processed per second, the priorities corresponding to each releasable resource are determined, and the priority is directly proportional to the amount of data processed per second.
[0060] Further, determining the first resource release time corresponding to the first resource to be released includes: determining the target read / write speed based on the historical data read / write speed of the second storage device; determining the first resource release time corresponding to the first resource to be released based on the resource size of the first resource to be released and the target read / write speed. It can be understood that since the data read / write speed of the storage device is limited by factors such as resource utilization, a suitable empirical value can be selected according to the actual situation of the program. For example, 0.8 times the peak value of the data read / write speed of the storage device can be selected as the target read / write speed of the storage device. The data read / write speed of the video memory is greater than the data read / write speed of the memory, and the data read / write speed of the memory is greater than the data read / write speed of the disk. Taking an ultrasonic instrument as an example, the data read / write speed of the memory is about 1.6G / s. At this time, the first resource release time refers to the migration time of migrating the data stored on the first resource to be released from the video memory to the memory; the data read / write speed of the disk is about 170M / s. The first resource release time refers to the migration time of migrating the data stored on the first resource to be released from the memory to the disk.
[0061] Step S13: Release the first resource to be released using a release method determined based on the execution time of the first algorithm and the release time of the first resource, so that the service data to be processed can be written into the first storage device when the remaining storage resources in the first storage device are sufficient after the current resources are released.
[0062] In this embodiment, a corresponding release method is determined based on a comparison result between the execution time of the first algorithm and the release time of the first resource, and the first resource to be released is released using the release method. If the remaining storage resource size in the first storage device after the current resource is released is still smaller than the resource size required for the business data to be processed, the operation of determining the first resource to be released from the first storage device is re-executed to continue releasing the resources in the first storage device until the remaining storage resource size in the first storage device after the current resource is released is not smaller than the resource size required for the business data to be processed, so that the business data to be processed is written into the first storage device.
[0063] like Figure 2 As shown, a resource application request initiated for pending business data of an electronic device is obtained, and the corresponding resource type is determined, and the first storage device is determined based on the resource type. When the first storage device is a memory, it is determined whether the remaining storage resources in the current memory are sufficient. If so, it indicates that the memory application is successful, and the pending business data is written into the memory; if not, it is necessary to release the first to-be-released resource with the highest priority in the current memory, so that the pending business data can be written into the memory when the remaining storage resources in the memory after the current resources are released are sufficient. When the first storage device is a video memory, it is determined whether the remaining storage resources in the current video memory are sufficient. If so, it indicates that the memory application is successful, and the pending business data is written into the video memory; if not, it is necessary to release the first to-be-released resource with the highest priority in the current video memory, so that the pending business data can be written into the video memory when the remaining storage resources in the video memory after the current resources are released are sufficient.
[0064] Combination Figure 2 and Figure 3As shown, when the first storage device is a memory, the second storage device is a disk, and the data read and write speed of the disk is lower than the data read and write speed of the memory, it is determined whether the remaining storage resources in the current memory are sufficient. If the remaining storage resources in the current memory are sufficient, it indicates that the memory application is successful; if the remaining storage resources in the current memory are insufficient, it is necessary to further release the first resource to be released based on the comparison result between the execution time of the first algorithm and the release time of the first resource, and then jump to the step of determining whether the remaining storage resources in the current memory are sufficient. Specifically, it is determined whether the ratio between the release time of the first resource and the execution time of the first algorithm is greater than 1, that is, it is determined whether the execution time of the first algorithm is less than the release time of the first resource. If the execution time of the first algorithm is less than the release time of the first resource, it indicates that it is faster to directly use the data processing algorithm corresponding to the first resource to be released to release the resource, thereby directly deleting the data stored on the first resource to be released with the highest current priority; if the execution time of the first algorithm is not less than the release time of the first resource, it indicates that it is faster to migrate the data stored on the first resource to be released to the disk, thereby migrating the data stored on the first resource to be released with the highest current priority from the memory to the disk.
[0065] Combination Figure 2 and Figure 4 As shown, when the first storage device is a video memory, the second storage device is an internal memory, and the data read and write speed of the internal memory is lower than the data read and write speed of the video memory, it is determined whether the remaining storage resources in the current video memory are sufficient. If the remaining storage resources in the current video memory are sufficient, it indicates that the video memory application is successful; if the remaining storage resources in the current video memory are insufficient, it is necessary to further release the first resource to be released based on the comparison result between the first algorithm execution time and the first resource release time, and then jump to the step of determining whether the remaining storage resources in the current video memory are sufficient. Specifically, it is determined whether the ratio between the first resource release time and the first algorithm execution time is greater than 1, that is, it is determined whether the first algorithm execution time is less than the first resource release time. If the first algorithm execution time is less than the first resource release time, the data stored on the first resource to be released with the highest current priority is directly deleted; if the first algorithm execution time is not less than the first resource release time, it indicates that the speed of migrating the data stored on the first resource to be released with the highest current priority from the video memory to the internal memory is faster, so it is necessary to further determine whether the remaining storage resources in the current memory are sufficient. If the execution time of the first algorithm is not less than the first resource release time, and the remaining storage resources in the current memory are sufficient, the data stored on the first resource to be released with the highest current priority is directly migrated from the video memory to the internal memory.
[0066] If the first algorithm execution time is not less than the first resource release time, and the remaining storage resources in the current memory are insufficient, in the process of migrating the data stored on the first resource to be released from the video memory to the memory, it is necessary to first release some resources in the memory, so in this process, it is necessary to consider the resource release time between the video memory and the memory and the resource release time between the memory and the disk at the same time. Specifically, it is necessary to first determine the second resource to be released from the memory, and determine the second algorithm execution time of the data processing algorithm corresponding to the second resource to be released, and determine the migration time required to migrate the data stored on the second resource to be released from the memory to the disk, so as to obtain the second resource release time corresponding to the second resource to be released, wherein the data reading and writing speed of the disk is lower than the data reading and writing speed of the memory. After obtaining the first algorithm execution time and the first resource release time of the data processing algorithm corresponding to the first resource to be released, and the second algorithm execution time and the second resource release time of the data processing algorithm corresponding to the second resource to be released, the corresponding release method is determined based on the first algorithm execution time, the first resource release time, the second algorithm execution time and the second resource release time, and the corresponding resource to be released is released based on the release method.
[0067] Among them, for determining the second resource to be released, first determine a number of releasable resources from the memory, and determine the amount of data processed per second by the data processing algorithm corresponding to each releasable resource based on the algorithm execution time and resource size of the data processing algorithm corresponding to each releasable resource, and determine the priority corresponding to each releasable resource based on the amount of data processed per second, the priority is directly proportional to the amount of data processed per second, and then determine the resource with the highest priority among the several releasable resources as the second resource to be released.
[0068] It should be noted that the total algorithm execution time is determined based on the sum of the first algorithm execution time and the second algorithm execution time, and the total resource release time is determined based on the sum of the first resource release time and the second resource release time; it is determined whether the ratio of the total resource release time to the total algorithm execution time is greater than 1, that is, it is determined whether the total algorithm execution time is less than the total resource release time. If the total algorithm execution time is less than the total resource release time, it indicates that it is faster to directly delete the data stored on the first resource to be released, so that the data stored on the current first resource to be released is directly deleted from the video memory; if the total algorithm execution time is not less than the total resource release time, it indicates that it is faster to migrate the data stored on the first resource to be released from the video memory to the internal memory, but because the remaining storage resource size in the current internal memory is less than the resource size of the first resource to be released, it is necessary to first release the second resource to be released in the internal memory, and migrate the data stored on the first resource to be released from the video memory to the internal memory when the remaining storage resource size in the internal memory after the current resource is released is not less than the resource size of the first resource to be released.
[0069] Among them, the second resource to be released in the memory is released, see Figure 3 As shown, it is determined whether the ratio between the second resource release time and the second algorithm execution time is greater than 1, that is, it is determined whether the second algorithm execution time is less than the second resource release time. If the second algorithm execution time is less than the second resource release time, the data stored on the current second resource to be released is directly deleted from the memory; if the second algorithm execution time is not less than the second resource release time, the data stored on the second resource to be released is migrated from the memory to the disk.
[0070] like Figure 5 As shown, since the data reading and writing speed of the video memory is greater than the data reading and writing speed of the internal memory, the data reading and writing speed of the internal memory is greater than the data reading and writing speed of the disk, and since the capacity of the video memory is not greater than the capacity of the internal memory, the capacity of the internal memory is not greater than the capacity of the disk. Therefore, in general, when the resources in the first storage device with a fast data reading and writing speed are insufficient, either the data stored on the resources are directly deleted, or the data stored on the resources are migrated from the first storage device to the second storage device with a data reading and writing speed lower than the first storage device. For example, the video memory can migrate data to the internal memory, and the internal memory can migrate data to the disk. At the same time, the internal memory can read data from the disk, and the video memory can read data from the internal memory.
[0071] It can be seen that when the remaining storage resources in the current first storage device are insufficient, the present application releases the resources to be released in the first storage device based on the algorithm execution time and the resource release time. The release method includes migrating the data stored on the resources to be released from the first storage device with a higher read and write speed to the second storage device with a lower read and write speed, so that the storage device with a faster read and write speed is given priority when storing resources, and resource management is realized among multiple storage devices, as well as the resources of the storage device are used to the maximum extent possible while ensuring the normal operation of the application, thereby improving resource utilization.
[0072] See also Figure 6 As shown, an embodiment of the present invention discloses a resource management device, including:
[0073] A request acquisition module 11, used to acquire a resource application request initiated for the service data to be processed of the electronic device;
[0074] The resource determination module 12 is used to determine the first resource to be released from the first storage device if the remaining storage resources in the current first storage device are insufficient, and determine the first algorithm execution time of the data processing algorithm corresponding to the first resource to be released and the first resource release time; the first resource release time is the migration time required for migrating the data stored on the first resource to be released to the second storage device; the second storage device is a storage device with a data reading and writing speed lower than that of the first storage device;
[0075] The resource release module 13 is used to release the first resource to be released using a release method determined based on the execution time of the first algorithm and the release time of the first resource, so as to write the business data to be processed into the first storage device when the remaining storage resources in the first storage device are sufficient after the current resources are released.
[0076] It can be seen that when the remaining storage resources in the current first storage device are insufficient, the present application releases the resources to be released in the first storage device based on the algorithm execution time and the resource release time. The release method includes migrating the data stored on the resources to be released from the first storage device with a higher read and write speed to the second storage device with a lower read and write speed, so that the storage device with a faster read and write speed is given priority when storing resources, and resource management is realized among multiple storage devices, as well as the resources of the storage device are used to the maximum extent possible while ensuring the normal operation of the application, thereby improving resource utilization.
[0077] In some specific embodiments, the resource determination module 12 includes:
[0078] a priority determination submodule, used to determine a number of releasable resources from the first storage device, and determine the priority corresponding to each of the releasable resources;
[0079] The first resource determination unit is used to determine the resource with the highest priority among the plurality of releasable resources as the first resource to be released.
[0080] In some specific embodiments, the priority determination submodule includes:
[0081] The priority determination unit is used to determine the priority corresponding to each of the releasable resources based on the algorithm execution time of the data processing algorithm corresponding to each of the releasable resources and the resource size.
[0082] In some specific embodiments, the resource determination module 12 includes:
[0083] a read / write speed determination unit, configured to determine a target read / write speed based on a historical data read / write speed of the second storage device;
[0084] A release time determination unit is used to determine a first resource release time corresponding to the first resource to be released based on the resource size of the first resource to be released and the target read / write speed.
[0085] In some specific embodiments, the resource release module 13 includes:
[0086] A first deleting unit is configured to determine that the release mode is to directly delete the data if the execution time of the first algorithm is less than the release time of the first resource, and directly delete the data currently stored on the first resource to be released;
[0087] The first migration unit is used to determine the release mode as data migration if the execution time of the first algorithm is not less than the release time of the first resource, and migrate the data stored on the first resource to be released to the second storage device.
[0088] In some specific embodiments, the resource release module 13 includes:
[0089] A second deleting unit is configured to determine that the release mode is to directly delete the data if the execution time of the first algorithm is less than the release time of the first resource, and directly delete the data currently stored on the first resource to be released;
[0090] a second migration unit, configured to directly migrate the data stored on the first resource to be released to the second storage device if the execution time of the first algorithm is not less than the first resource release time and the remaining storage resources in the second storage device are sufficient;
[0091] A second resource determination unit is configured to determine a second resource to be released from the second storage device, and determine a second algorithm execution time of a data processing algorithm corresponding to the second resource to be released and a second resource release time if the first algorithm execution time is not less than the first resource release time and the remaining storage resources in the second storage device are currently insufficient; the second resource release time is the migration time required to migrate the data stored on the second resource to be released to a third storage device; the third storage device is a storage device having a data reading and writing speed lower than that of the second storage device;
[0092] The resource release submodule is used to release the corresponding resources to be released by using a release method determined based on the first algorithm execution time, the first resource release time, the second algorithm execution time and the second resource release time.
[0093] In some specific embodiments, the resource release submodule includes:
[0094] a total time determining unit, configured to determine a corresponding algorithm execution total time based on the first algorithm execution time and the second algorithm execution time, and to determine a corresponding resource release total time based on the first resource release time and the second resource release time;
[0095] A third deleting unit is configured to determine that the release mode is to directly delete the data if the total execution time of the algorithm is less than the total resource release time, and directly delete the data currently stored on the first resource to be released;
[0096] a resource releasing unit, configured to release the second resource to be released by using a release method determined based on the second algorithm execution time and the second resource release time if the total algorithm execution time is not less than the total resource release time;
[0097] The third migration unit is configured to migrate the data stored in the first resource to be released to the second storage device if the remaining storage resource size in the second storage device is not less than the resource size of the first resource to be released.
[0098] In some specific embodiments, the resource release unit is specifically used to: if the execution time of the second algorithm is less than the second resource release time, directly delete the data currently stored on the second resource to be released; if the execution time of the second algorithm is not less than the second resource release time, migrate the data stored on the second resource to be released to the third storage device.
[0099] Furthermore, the present application also discloses an electronic device. Figure 7 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be regarded as any limitation on the scope of use of the present application.
[0100] Figure 7 A schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the resource management method disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0101] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0102] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0103] The operating system 221 is used to manage and control the hardware devices on the electronic device 20 and the computer program 222, which can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the resource management method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks.
[0104] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein the computer program, when executed by a processor, implements the resource management method disclosed above. The specific steps of the method can refer to the corresponding contents disclosed in the above embodiments, and will not be repeated here.
[0105] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0106] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0107] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0108] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0109] The technical solution provided by the present application is introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technicians in this field, according to the idea of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A resource management method, characterized in that: include: Obtaining a resource application request initiated for pending business data of an electronic device; If the remaining storage resources in the current first storage device are insufficient, determining a first resource to be released from the first storage device, and determining a first algorithm execution time of a data processing algorithm corresponding to the first resource to be released and a first resource release time; The first resource release time is the migration time required to migrate the data stored in the first resource to be released to the second storage device; The second storage device is a storage device with a data reading and writing speed lower than that of the first storage device; The first resource to be released is released using a release method determined based on the execution time of the first algorithm and the release time of the first resource, so that the service data to be processed can be written into the first storage device when the remaining storage resources in the first storage device are sufficient after the current resources are released.
2. The resource management method according to claim 1, characterized in that: The determining a first resource to be released from the first storage device includes: Determine a number of releasable resources from the first storage device, and determine the priorities corresponding to the releasable resources respectively; The resource with the highest priority among the plurality of releasable resources is determined as the first resource to be released.
3. The resource management method according to claim 2, characterized in that: The determining the priorities respectively corresponding to the releasable resources includes: The priorities corresponding to the releasable resources are determined based on the algorithm execution time of the data processing algorithms corresponding to the releasable resources and the resource size.
4. The resource management method according to claim 1, characterized in that: Determining a first resource release time corresponding to the first resource to be released includes: Determining a target read / write speed based on a historical data read / write speed of the second storage device; A first resource release time corresponding to the first resource to be released is determined based on the resource size of the first resource to be released and the target read / write speed.
5. The resource management method according to any one of claims 1 to 4, characterized in that: The releasing the first resource to be released by using a release method determined based on the execution time of the first algorithm and the release time of the first resource includes: If the execution time of the first algorithm is less than the release time of the first resource, determining the release mode is to directly delete the data, and directly deleting the data currently stored on the first resource to be released; If the execution time of the first algorithm is not less than the release time of the first resource, the release method is determined to be data migration, and the data stored on the first resource to be released is migrated to the second storage device.
6. The resource management method according to any one of claims 1 to 4, characterized in that: The releasing the first resource to be released by using a release method determined based on the execution time of the first algorithm and the release time of the first resource includes: If the execution time of the first algorithm is less than the release time of the first resource, determining the release mode is to directly delete the data, and directly deleting the data currently stored on the first resource to be released; If the execution time of the first algorithm is not less than the first resource release time, and the remaining storage resources in the second storage device are sufficient, directly migrate the data stored in the first resource to be released to the second storage device; If the execution time of the first algorithm is not less than the first resource release time, and the remaining storage resources in the second storage device are currently insufficient, then determine the second resource to be released from the second storage device, and determine the second algorithm execution time of the data processing algorithm corresponding to the second resource to be released and the second resource release time; the second resource release time is the migration time required to migrate the data stored on the second resource to be released to the third storage device; the third storage device is a storage device with a data reading and writing speed lower than that of the second storage device; The corresponding resources to be released are released using a release method determined based on the first algorithm execution time, the first resource release time, the second algorithm execution time and the second resource release time.
7. The resource management method according to claim 6, characterized in that: The releasing the corresponding resources to be released by using a release method determined based on the first algorithm execution time, the first resource release time, the second algorithm execution time and the second resource release time includes: Determine a corresponding algorithm execution total time based on the first algorithm execution time and the second algorithm execution time, and determine a corresponding resource release total time based on the first resource release time and the second resource release time; If the total execution time of the algorithm is less than the total resource release time, determining the release mode is to directly delete the data, and directly deleting the data currently stored on the first resource to be released; If the total algorithm execution time is not less than the total resource release time, releasing the second resource to be released by using a release method determined based on the second algorithm execution time and the second resource release time; If the remaining storage resource size in the second storage device is not less than the resource size of the first resource to be released, the data stored in the first resource to be released is migrated to the second storage device.
8. The resource management method according to claim 7, characterized in that: The releasing the second resource to be released by using a release method determined based on the execution time of the second algorithm and the release time of the second resource includes: If the execution time of the second algorithm is less than the release time of the second resource, directly deleting the data currently stored on the second resource to be released; If the execution time of the second algorithm is not less than the second resource release time, the data stored on the second resource to be released is migrated to the third storage device.
9. A resource management device, characterized in that: include: A request acquisition module, used to acquire a resource application request initiated for the pending business data of the electronic device; A resource determination module, configured to determine a first resource to be released from the first storage device if the remaining storage resources in the current first storage device are insufficient, and determine a first algorithm execution time of a data processing algorithm corresponding to the first resource to be released and a first resource release time; The first resource release time is the migration time required to migrate the data stored in the first resource to be released to the second storage device; The second storage device is a storage device with a data reading and writing speed lower than that of the first storage device; A resource release module is used to release the first resource to be released using a release method determined based on the execution time of the first algorithm and the release time of the first resource, so as to write the business data to be processed into the first storage device when the remaining storage resources in the first storage device are sufficient after the current resources are released.
10. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the resource management method according to any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that: Used to store a computer program, which, when executed by a processor, implements the resource management method according to any one of claims 1 to 8.