CN117919693A - Resource management method, device and computer equipment - Google Patents

Resource management method, device and computer equipment Download PDF

Info

Publication number
CN117919693A
CN117919693A CN202410165595.XA CN202410165595A CN117919693A CN 117919693 A CN117919693 A CN 117919693A CN 202410165595 A CN202410165595 A CN 202410165595A CN 117919693 A CN117919693 A CN 117919693A
Authority
CN
China
Prior art keywords
resource
resources
unloading
queue
category
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410165595.XA
Other languages
Chinese (zh)
Inventor
邵明
李云龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Lilith Interactive Entertainment Network Technology Co ltd
Original Assignee
Shanghai Lilith Interactive Entertainment Network Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Lilith Interactive Entertainment Network Technology Co ltd filed Critical Shanghai Lilith Interactive Entertainment Network Technology Co ltd
Priority to CN202410165595.XA priority Critical patent/CN117919693A/en
Publication of CN117919693A publication Critical patent/CN117919693A/en
Pending legal-status Critical Current

Links

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/30Interconnection arrangements between game servers and game devices; Interconnection arrangements between game devices; Interconnection arrangements between game servers
    • A63F13/35Details of game servers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5083Techniques for rebalancing the load in a distributed system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present application relates to a resource management method, apparatus, computer device, storage medium and computer program product. The method comprises the following steps: acquiring resources from a resource set to be unloaded in an application program; wherein the application program is an running application program; determining the resource category of the resource according to the association relation between the identification information of the resource and the resource category; the resource category comprises a first category and a second category, wherein the first category of resources comprises resources which need to call other resources during processing, and the second category of resources comprises resources which do not need to call other resources during processing; and adding the resources to an unloading queue under the condition that the resource class is the second class, and unloading the resources in the unloading queue according to the queue sequence. By adopting the method, the stability of the application program can be improved, and the picture blocking of the application program can be effectively reduced.

Description

Resource management method, device and computer equipment
Technical Field
The present application relates to the field of computer technology, and in particular, to a resource management method, apparatus, computer device, storage medium, and computer program product.
Background
With the continuous updating version of game software, the game content is more and more, the data volume of game resources is also increasing, and the memory size occupied by the game software when being installed and operated for the first time is far exceeded, and even exceeds the memory size of game operation equipment, so that unnecessary resources in the game operation process need to be unloaded from the memory. In the related art, in the game running process, when unnecessary resources are found, unloading operations are simultaneously performed on all the unnecessary resources in the period where the current frame is located, so that when the number of resources which are unloaded simultaneously by the current frame is large, a long time is taken, and a game picture is blocked.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a resource management method, apparatus, computer device, computer readable storage medium, and computer program product, in response to the above-described technical problems.
In a first aspect, the present application provides a resource management method. The method comprises the following steps:
Acquiring resources from a resource set to be unloaded in an application program; wherein the application program is an running application program;
Determining the resource category of the resource according to the association relation between the identification information of the resource and the resource category; the resource category comprises a first category and a second category, wherein the first category of resources comprises resources which need to call other resources during processing, and the second category of resources comprises resources which do not need to call other resources during processing;
If the resource class is the second class, adding the resource to an unloading queue, and unloading the resource in the unloading queue according to the queue sequence; wherein the resources in the offload queue include the resources and historically added resources of a second class.
In one embodiment, unloading the resources in the unloading queue according to the queue order includes:
acquiring a preset number of resources of a second category from the unloading queue at intervals of a preset period;
and unloading the second-class resources until all the second-class resources in the unloading queue are completely unloaded.
In one embodiment, at each preset interval, acquiring a preset number of resources of the second category from the offloading queue further includes:
acquiring the total resource quantity of the resources of the second category in the unloading queue;
And determining the preset quantity according to a preset unloading proportion and the total resource quantity.
In one embodiment, the determining the preset number according to the preset unloading proportion and the total resource amount includes:
Expanding a preset unloading proportion to a target unloading proportion under the condition that the total resource amount is larger than a preset threshold value;
And determining the preset quantity according to the target unloading proportion and the total resource quantity.
In one embodiment, after determining the resource class of the resource, the method further includes:
and unloading the resource in the current preset period under the condition that the resource class is the first class.
In one embodiment, the current preset period includes a period of a current frame, and unloading the resource in the preset period includes:
and unloading the resources in the period of the current frame.
In one embodiment, the unloading the resources in the unloading queue according to the queue order includes:
Unloading a preset number of resources of a second category from the unloading queue according to the queue sequence in the period of playing the current frame;
And continuously unloading the preset number of the second-class resources from the unloading queue according to the queue sequence in the period of playing the next frame until all the second-class resources in the unloading queue are completely unloaded.
In one embodiment, before the resource is obtained from the resource set to be offloaded in the application program, the method further includes:
analyzing the reference relation of the resource from the resource table to generate a record file;
and loading the record file, and acquiring the association relation between the identification information of the resource and the resource category from the record file.
In a second aspect, the application further provides a resource management device. The device comprises:
The resource acquisition module is used for acquiring resources from a resource set to be unloaded in the application program; wherein the application program is an running application program;
the resource classification module is used for determining the resource category of the resource according to the association relation between the identification information of the resource and the resource category; the resource category comprises a first category and a second category, wherein the first category of resources comprises resources which need to call other resources during processing, and the second category of resources comprises resources which do not need to call other resources during processing;
the resource unloading module is used for adding the resources to an unloading queue and unloading the resources in the unloading queue according to the queue sequence under the condition that the resource class is the second class; wherein the resources in the offload queue include the resources and historically added resources of a second class.
In one embodiment, the resource offloading module includes:
the resource unloading sub-module is used for acquiring a preset number of resources of a second category from the unloading queue every interval preset time period;
And the resource unloading sub-module is further used for unloading the second-class resources until all the second-class resources in the unloading queue are completely unloaded.
In one embodiment, the resource offloading submodule includes:
A resource quantity determination submodule, configured to obtain a total resource quantity of resources of a second category in the offload queue;
And the unloading rate determining submodule is used for determining the preset quantity according to the preset unloading proportion and the total resource quantity.
In one embodiment, the unloading rate determination submodule is further configured to:
Expanding a preset unloading proportion to a target unloading proportion under the condition that the total resource amount is larger than a preset threshold value;
And determining the preset quantity according to the target unloading proportion and the total resource quantity.
In one embodiment, the resource classification module is further configured to:
and unloading the resource in the current preset period under the condition that the resource class is the first class.
In one embodiment, the resource offloading submodule is further configured to:
And unloading the resource in the period of the current frame under the condition that the resource class is the first class.
In one embodiment, the resource offloading module is further to:
Unloading a preset number of resources of a second category from the unloading queue according to the queue sequence in the period of playing the current frame;
And continuously unloading the preset number of the second-class resources from the unloading queue according to the queue sequence in the period of playing the next frame until all the second-class resources in the unloading queue are completely unloaded.
In one embodiment, the resource acquisition sub-module includes:
the resource classification sub-module is used for analyzing the reference relation of the resources from the resource table and generating a record file;
The resource classification sub-module is further configured to load the record file, and obtain an association relationship between the identification information of the resource and the resource class from the record file.
In a third aspect, the present application also provides a computer device. The computer device comprises a memory storing a computer program and a processor implementing the resource management method according to any of the embodiments of the present disclosure when the processor executes the computer program.
In a fourth aspect, the present application also provides a computer-readable storage medium. The computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements a resource management method as described in any of the embodiments of the present disclosure.
In a fifth aspect, the present application also provides a computer program product. The computer program product comprises a computer program which, when executed by a processor, implements the resource management method according to any of the embodiments of the present disclosure.
The resource management method, the device, the computer equipment, the storage medium and the computer program product are used for classifying the acquired resources needing to be unloaded by utilizing the association relation between the identification information of the resources and the resource types, and adding the resources to an unloading queue under the condition that the resources are of the types which do not need to call other resources, and unloading the resources in the unloading queue according to the queue sequence. The resources are unloaded in batches and in sequence, so that the number of resources which are unloaded by the application program once is reduced, the delay of the application program caused by excessive resources unloaded by once is avoided, the occurrence of the blocking of the application program is reduced, and the stability and the response speed of the application program are improved.
Drawings
FIG. 1 is a flow diagram of a method of resource management in one embodiment;
FIG. 2 is a flow diagram of second class resource offloading in one embodiment;
FIG. 3 is a schematic diagram of a first process for confirming a predetermined number in one embodiment;
FIG. 4 is a schematic diagram of a second process for verifying a predetermined number in one embodiment;
FIG. 5 is a flowchart of acquiring association between identification information and resource categories in one embodiment;
FIG. 6 is a diagram of a reference relationship between resources in one embodiment;
FIG. 7 is a flow diagram of one implementation of a resource management method in one embodiment;
FIG. 8 is a block diagram of a resource management device in one embodiment;
Fig. 9 is a first internal structural diagram of a computer device in one embodiment.
Fig. 10 is a second internal structural diagram of a computer device in one embodiment.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
In one embodiment, as shown in fig. 1, there is provided a resource management method, including the steps of:
Step S100, acquiring resources from a resource set to be unloaded in an application program; wherein the application program is an running application program.
In an exemplary embodiment, when an application resource is constructed, a corresponding identifier can be established for the resource, wherein the identifier is one of identification information, and the identifier has an association relationship with a resource category; for example, when the identifier is 0, the resource is a resource that requires calling another resource during processing, and when the identifier is 1, the resource is a resource that does not require calling another resource during processing.
In an exemplary embodiment, the running application may include an application that plays an animation or picture frame by frame, such as game software, video software, or the like. In an exemplary embodiment, the running application may include an application for editing a file, for example, software for editing a picture, a document for writing a word, or the like, and in the case that the application is a word, when a user edits a large document for a long time, a large number of editing histories and temporary files may be generated, and a large number of plug-ins, macros, or other customizing functions may be involved, thereby generating a large amount of unloading data.
In an exemplary embodiment, the set of resources may include a plurality of resources in an application that need to be offloaded; in the case that the application is a frame-by-frame playing application, the resources to be offloaded may include a video frame file used in history, a buffer file used for temporary playing after video playing, and the like, for example, in the case that the application is a game, the resources to be offloaded may include an animation after playing in the game, a previous scene after the game enters a scene, an object model generated in a middle of the game in a state, a texture, and the like.
Step S200, determining the resource category of the resource according to the association relation between the identification information of the resource and the resource category; the resource category comprises a first category and a second category, wherein the resources of the first category comprise resources which need to call other resources during processing, and the resources of the second category comprise resources which do not need to call other resources during processing.
In an exemplary embodiment, the first class of resources may include resources that would call other resources in the course of being called. In an exemplary embodiment, the first class of resources may include resources that are comprised of other resources.
In an exemplary embodiment, the first class of resources may include resources of a first class that call other first classes of resources when the resources are processed, for example, the resource a may call the resource B during processing, where the resource a is a first class of resources and the resource B is a second class of resources, in which case the resource C may call the resource a during processing, where the resource a calls the resource B, and the resources a and C are both the first class of resources and the resource B is a second class of resources, because the resource a calls the resource B.
In an exemplary embodiment, the second class of resources may include being invoked by a plurality of first class of resources; for example, the resource a may call the resource B during the processing, and the resource C may call the resource B during the processing.
Step S300, adding the resources to an unloading queue and unloading the resources in the unloading queue according to the queue sequence under the condition that the resource class is the second class; wherein the resources in the offload queue include the resources and historically added resources of a second class.
In one exemplary embodiment, the queue order of the offload queue may include ordering according to a time order added to the offload queue, and in another exemplary embodiment, the queue order may further include ordering according to an application program a utilization rate of the resource, and a resource with a lower utilization rate is preferentially offloaded.
In an exemplary embodiment, in case the resource class is the first class, the resource may be offloaded in the current preset period, for example, in case the resource class is the first class, the resource may be offloaded in the period of the current frame. In another exemplary embodiment, the resource is offloaded within the current one second if the resource class is the first class.
In an exemplary embodiment, the historically added second-class resource may include adding other resources to the offload queue after adding the resource to the offload queue, where the resource is not offload, the resource being the historically added second-class resource. That is, due to the limitation of the unloading speed of the resources in the unloading queue, there may be resources of the second class to be unloaded, which are generated in different periods, in the unloading queue, and the resources which have not been unloaded, that is, the resources of the second class which are added historically, are generated in advance.
In an exemplary embodiment, the unloading queue may include that the unloading queue has a preset capacity, the adding of the unloading queue is stopped when the unloading queue is full, after the unloading queue unloads the resource, the unloading queue is detected, and the resource to be unloaded is added to the unloading queue; in another exemplary embodiment, in the case that the capacity of the unloading queue is full, directly unloading the resources required to be added to the unloading queue within the current preset period; in another exemplary embodiment, adding the resource to the offload queue may include adding tag information to the resource, where the tag information is the queue order of the determining the offload queue, and where the offload queue only records the tag information, there is no capacity restriction.
In the resource management method, the acquired resources to be unloaded are classified by utilizing the association relation between the identification information of the resources and the resource types, and the resources are added to an unloading queue under the condition that the resources are of the types which do not need to call other resources, and the resources in the unloading queue are unloaded according to the queue sequence. The resources are unloaded in batches and in sequence, so that the number of resources which are unloaded by the application program once is reduced, the delay of the application program caused by excessive resources unloaded by once is avoided, the occurrence of the blocking of the application program is reduced, and the stability and the response speed of the application program are improved.
In one embodiment, as shown in fig. 2, step S300 includes:
Step S301, obtaining a preset number of resources of the second category from the offloading queue at intervals of a preset period.
In an exemplary embodiment, the preset time period per interval may include a determination according to a type of an application program, and in the case where the application program is a program of an application played frame by frame such as a game or a video, the preset time period per interval may include each frame or several frames, etc. Where the application is an application for editing a file, the preset time periods per interval may include a time period of preset editing, for example, where an application for processing an image, the preset time periods per interval may include unloading historical operation record data according to a few seconds per interval, or the like.
In an exemplary embodiment, the preset number may be adjusted according to the amount of resources of the application and the amount of resources to be offloaded.
Step S302, unloading the second class of resources until all the second class of resources in the unloading queue are completely unloaded.
In an exemplary embodiment, the unloading of all the resources of the second class until all the resources of the second class in the unloading queue is completed may include unloading a preset number of resources from the unloading queue in the queue order in a current preset period, and continuing to unload a preset number of resources of the second class from the unloading queue in the queue order in a next preset period until all the resources of the unloading queue are completely unloaded.
In one exemplary embodiment, in the case that all resources in the unload queue are unloaded, periodically detecting whether there are newly added resources in the unload queue, and if so, continuing to unload the resources.
In this embodiment, by unloading a preset number of resources of the second category from the unloading queue at preset intervals, the amount of resources unloaded for a period of time can be reduced by using multiple periods of time to unload the resources, so that the memory pressure during processing for a period of time is reduced, program blocking caused by unloading a large amount of resources for a period of time is avoided, the stability and performance of the program are improved, and the response speed and fluency of the application program are also improved.
In one embodiment, as shown in fig. 3, step S301 includes:
step S311, obtaining the total resource amount of the resources of the second class in the offloading queue.
In an exemplary embodiment, the total resource amount of the second class of resources in the offloading queue may include, in a case where the offloading queue has a preset capacity, the total resource amount including the amount of resources added to the offloading queue and the second class of resources that are not added to the offloading queue and need to be deleted; in another exemplary embodiment, in a case where the offload queue does not have a preset capacity, the total resource amount is an amount of resources of a second category in the offload queue.
Step S312, determining the preset quantity according to the preset unloading proportion and the total resource quantity.
In an exemplary embodiment, the preset unloading ratio may include an adjustment according to a preset period of time; the unloading ratio is set to a smaller value in the case where the preset period is short, and is set to a larger value in the case where the preset period is long.
In this embodiment, the preset number is determined by the total resource amount of the second class of resources in the unloading queue and the preset unloading proportion, so that the number of each unloading can be dynamically determined, the load change of the system can be better adapted, accumulation of unloading resources caused by too small unloading number is effectively avoided, and the stability of the system is improved.
In one embodiment, as shown in fig. 4, step S311 includes:
Step S321, expanding the preset unloading proportion to a target unloading proportion under the condition that the total resource amount is larger than a preset threshold value.
In one exemplary embodiment, the total amount of resources in the offload queue may be periodically detected, and in the event that the total amount of resources is greater than a preset threshold, the preset offload ratio is expanded to the target offload ratio.
Step S322, determining the preset number according to the target unloading proportion and the total resource amount.
In this embodiment, the preset unloading ratio is enlarged and the preset number is determined by using the total resource amount when the total resource amount in the unloading queue is greater than the preset threshold. The method can enable the preset quantity to be more matched with the quantity of resources in the unloading queue, and control the unloading proportion through comparison of the total quantity of resources and a preset threshold value, so that the system is more flexible, can be better suitable for different scales and environments, further reduces unloading resource accumulation caused by too small unloading quantity, further improves the stability of the system, and meanwhile improves the efficiency and response speed of the system.
In one embodiment, as shown in fig. 5, step S100 includes:
s101, analyzing the reference relation of the resources from a resource table to generate a record file;
In an exemplary embodiment, the reference relationship of the resolved resource may be utilized to determine the class of the resource, where the reference relationship of the resource may include that the resource needs to call other resources when processing, that the resource contains other resources, and the like, that the resource needs to call other resources or that the resource containing other resources is the resource of the first class when processing, and that the resource does not need to call other resources or that the resource does not contain other resources is the resource of the second class when processing.
In an exemplary embodiment, the categories of all the resources may be determined according to the resolved reference relationship of the resources, and a record file may be generated according to the categories of all the resources, where the record file includes the categories of all the resources, and the resources that need to reference other resources are the resources of the first category when the resources are processed, and the resources that do not need to reference other resources are the resources of the second category when the resources are processed; for example: when processing the resource A, the resource B and the resource C need to be referenced, and at this time, the resource A is a first class of resource, and the resource B and the resource C are a second class of resource; when processing A, resource B and resource C need to be referred to, and when processing B, resource D and resource E need to be referred to, at this time, resource A and resource B are resources of a first category, and resource C, resource D and resource E are resources of a second category. In another exemplary embodiment, the reference relationship of the resource may be as shown in fig. 6, where all nodes shown in fig. 6 are resources, and the model includes a material, a mesh, and an animation controller, where the material includes a shader, a map 1, and a map 2, and the animation controller includes an animation 1, an animation 2, and an animation 3; for example, the animation controller may be used to play the animation, and the animation controller may call the animation 1, the animation 2, and the animation 3 to control to play the animation 1, the animation 2, or the animation 3, where the model, the material, and the animation controller are resources of a first class, and the shader, the map 1, the map 2, the grid, the animation 1, the animation 2, and the animation 3 are resources of a second class.
Step S102, loading the record file, and acquiring the association relationship between the identification information of the resource and the resource category from the record file.
In an exemplary embodiment, the identification information of the resource may include determining the resource category according to the identification information, for example, when the identification information is "0", the corresponding resource is a resource that does not call other resources when processing, when the identification information is "1", the corresponding resource is a resource that needs to call other resources when processing, and so on; in another exemplary embodiment, the identification information of the resource may include how many resources need to be invoked when processing, e.g., when the identification information is "8," it is indicated that there are 8 resources that need to be invoked when processing, etc.
In this embodiment, the reference relationship of the resource is resolved through the resource table, and the association relationship between the identification information of the resource and the resource category is obtained according to the record file. The association relation between the resource identification information and the category can be rapidly determined. By recording the file, the frequent access to the system resource table is reduced, the system load is reduced, and the stability of the system is improved.
In an exemplary embodiment, an implementation manner of the resource management method may be as shown in fig. 7, including:
the device starts to run the application program;
determining resources to be offloaded;
Reading a resource data class file, and judging whether the resource to be unloaded needs to call other resources when being processed;
under the condition that the resource needs to call other resources when being processed, unloading operation is executed;
Under the condition that the resource does not need to call other resources when being processed, the resource is added to an unloading queue;
judging whether the unloading queue is empty or not, taking out a resource from the unloading queue under the condition that the unloading queue is not empty, executing unloading operation and deleting the resource from the unloading queue;
in the case where the unload queue is empty, the unloading is ended.
In this embodiment, the application program may include video software including a picture playing function, game software, and the like; software for editing pictures, documents for composing text, etc. may also be included; the resource data category file can be used for storing whether attribute parameters of other data are called when the data are processed, namely, the category of the storage resource; the adding the resource to the unload queue may include adding tag information to the resource, where the tag information is the queue order of the determined unload queue, and in this case, the unload queue does not actually store the resource itself, but stores tag information corresponding to the resource, that is, the queue order; under the condition that the unloading queue is not empty, detecting whether resources exist in the unloading queue or not every frame, and taking out one resource from the unloading queue and unloading if the resources exist in the unloading queue; in the case where the queue is empty, the offloading is completed, and whether the offloading queue is empty may be periodically detected to determine whether there are newly enqueued resources.
It should be understood that, although the steps in the flowcharts related to the embodiments described above are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts described in the above embodiments may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least some of the other steps or stages.
Based on the same inventive concept, the embodiment of the application also provides a resource management device for realizing the above-mentioned resource management method. The implementation of the solution provided by the device is similar to the implementation described in the above method, so the specific limitation in one or more embodiments of the resource management device provided below may refer to the limitation of the resource management method hereinabove, and will not be repeated herein.
In one embodiment, as shown in fig. 8, there is provided a resource management device 100 including: a resource acquisition module 101, a resource classification module 102, and a resource offloading module 103, wherein:
The resource acquisition module is used for acquiring resources from a resource set to be unloaded in the application program; wherein the application program is an running application program;
the resource classification module is used for determining the resource category of the resource according to the association relation between the identification information of the resource and the resource category; the resource category comprises a first category and a second category, wherein the first category of resources comprises resources which need to call other resources during processing, and the second category of resources comprises resources which do not need to call other resources during processing;
the resource unloading module is used for adding the resources to an unloading queue and unloading the resources in the unloading queue according to the queue sequence under the condition that the resource class is the second class; wherein the resources in the offload queue include the resources and historically added resources of a second class.
In one embodiment, the resource offloading module comprises: a resource offloading sub-module, wherein:
the resource unloading sub-module is used for acquiring a preset number of resources of a second category from the unloading queue every interval preset time period;
And the resource unloading sub-module is further used for unloading the second-class resources until all the second-class resources in the unloading queue are completely unloaded.
In one embodiment, the resource offloading submodule includes: a resource quantity determination sub-module and an offload rate determination sub-module, wherein:
A resource quantity determination submodule, configured to obtain a total resource quantity of resources of a second category in the offload queue;
And the unloading rate determining submodule is used for determining the preset quantity according to the preset unloading proportion and the total resource quantity.
In one embodiment, the unloading rate determination submodule is further configured to:
Expanding a preset unloading proportion to a target unloading proportion under the condition that the total resource amount is larger than a preset threshold value;
And determining the preset quantity according to the target unloading proportion and the total resource quantity.
In one embodiment, the resource offloading submodule is further to:
and unloading the resource in the current preset period under the condition that the resource class is the first class.
In one embodiment, the resource offloading submodule is further to:
And unloading the resource in the period of the current frame under the condition that the resource class is the first class.
In one embodiment, the resource offloading sub-module is further to:
Unloading a preset number of resources of a second category from the unloading queue according to the queue sequence in the period of playing the current frame;
And continuously unloading the preset number of the second-class resources from the unloading queue according to the queue sequence in the period of playing the next frame until all the second-class resources in the unloading queue are completely unloaded.
In one embodiment, the resource acquisition sub-module includes: a resource classification sub-module, wherein:
the resource classification sub-module is used for analyzing the reference relation of the resources from the resource table and generating a record file;
The resource classification sub-module is further configured to load the record file, and obtain an association relationship between the identification information of the resource and the resource class from the record file.
The respective modules in the above-described resource management apparatus may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a server, such as a cloud server, a centralized deployment server, a local server, etc., and the internal structure thereof may be as shown in fig. 9. The computer device includes a processor, a memory, an Input/Output interface (I/O) and a communication interface. The processor, the memory, and the input/output interface are connected through a system bus, the communication interface may be connected to the system bus through the input/output interface, or the communication interface may be directly connected to the system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is used to store offload resource data. The input/output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a resource management method.
In one embodiment, a computer device is provided, and the computer device may be a client, such as a smart phone, a tablet computer, a notebook computer, a desktop computer, an automobile-mounted intelligent terminal, etc., and the internal structure diagram thereof may be shown in fig. 10. The computer device includes a processor, a memory, an input/output interface, a communication interface, a display unit, and an input means. The processor, the memory, and the input/output interface are connected through a system bus, the communication interface, the display unit, and the input device are connected through the input/output interface to the system bus, or the communication interface may be directly connected to the system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The input/output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless mode can be realized through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. The computer program is executed by a processor to implement a resource management method. The display unit of the computer device is used for forming a visual picture, and can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, can also be a key, a track ball or a touch pad arranged on the shell of the computer equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
It will be appreciated by those skilled in the art that the structures shown in fig. 9 and 10 are merely block diagrams of portions of structures associated with aspects of the application and are not intended to limit the computer device to which aspects of the application may be applied, and that a particular computer device may include more or fewer components than those shown, or may combine certain components, or may have a different arrangement of components.
It should be noted that, the user information (including but not limited to user equipment information, user personal information, etc.) and the data (including but not limited to data for analysis, stored data, presented data, etc.) related to the present application are information and data authorized by the user or sufficiently authorized by each party, and the collection, use and processing of the related data need to comply with the related laws and regulations and standards of the related country and region.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, database, or other medium used in embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high density embedded nonvolatile Memory, resistive random access Memory (ReRAM), magneto-resistive random access Memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric Memory (Ferroelectric Random Access Memory, FRAM), phase change Memory (PHASE CHANGE Memory, PCM), graphene Memory, and the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, and the like. By way of illustration, and not limitation, RAM can be in various forms such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), etc. The databases referred to in the embodiments provided herein may include at least one of a relational database and a non-relational database. The non-relational database may include, but is not limited to, a blockchain-based distributed database, and the like. The processor referred to in the embodiments provided in the present application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, or the like, but is not limited thereto.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The foregoing examples illustrate only a few embodiments of the application and are described in detail herein without thereby limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of the application should be assessed as that of the appended claims.

Claims (12)

1. A method of resource management, the method comprising:
Acquiring resources from a resource set to be unloaded in an application program; wherein the application program is an running application program;
Determining the resource category of the resource according to the association relation between the identification information of the resource and the resource category; the resource category comprises a first category and a second category, wherein the first category of resources comprises resources which need to call other resources during processing, and the second category of resources comprises resources which do not need to call other resources during processing;
If the resource class is the second class, adding the resource to an unloading queue, and unloading the resource in the unloading queue according to the queue sequence; wherein the resources in the offload queue include the resources and historically added resources of a second class.
2. The method of claim 1, wherein offloading resources in the offload queue in queue order comprises:
acquiring a preset number of resources of a second category from the unloading queue at intervals of a preset period;
and unloading the second-class resources until all the second-class resources in the unloading queue are completely unloaded.
3. The method of claim 2, wherein obtaining a preset number of resources of the second category from the offload queue at each of the preset time periods further comprises:
acquiring the total resource quantity of the resources of the second category in the unloading queue;
And determining the preset quantity according to a preset unloading proportion and the total resource quantity.
4. A method according to claim 3, wherein said determining said preset number according to a preset offload fraction and said total resource amount comprises:
Expanding a preset unloading proportion to a target unloading proportion under the condition that the total resource amount is larger than a preset threshold value;
And determining the preset quantity according to the target unloading proportion and the total resource quantity.
5. The method of claim 1, further comprising, after determining the resource class of the resource:
and unloading the resource in the current preset period under the condition that the resource class is the first class.
6. The method of claim 5, wherein the current preset time period comprises a time period of a current frame, and wherein offloading the resource for the preset time period comprises:
and unloading the resources in the period of the current frame.
7. The method of claim 6, wherein offloading the resources in the offload queue in queue order comprises:
Unloading a preset number of resources of a second category from the unloading queue according to the queue sequence in the period of playing the current frame;
And continuously unloading the preset number of the second-class resources from the unloading queue according to the queue sequence in the period of playing the next frame until all the second-class resources in the unloading queue are completely unloaded.
8. The method of claim 1, further comprising, prior to said obtaining resources from the set of resources in the application that need to be offloaded:
analyzing the reference relation of the resource from the resource table to generate a record file;
and loading the record file, and acquiring the association relation between the identification information of the resource and the resource category from the record file.
9. A resource management apparatus, the apparatus comprising:
The resource acquisition module is used for acquiring resources from a resource set to be unloaded in the application program; wherein the application program is an running application program;
the resource classification module is used for determining the resource category of the resource according to the association relation between the identification information of the resource and the resource category; the resource category comprises a first category and a second category, wherein the first category of resources comprises resources which need to call other resources during processing, and the second category of resources comprises resources which do not need to call other resources during processing;
the resource unloading module is used for adding the resources to an unloading queue and unloading the resources in the unloading queue according to the queue sequence under the condition that the resource class is the second class; wherein the resources in the offload queue include the resources and historically added resources of a second class.
10. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any one of claims 1 to 8 when the computer program is executed.
11. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 8.
12. A computer program product comprising a computer program, characterized in that the computer program, when executed by a processor, implements the steps of the method of any one of claims 1 to 8.
CN202410165595.XA 2024-02-05 2024-02-05 Resource management method, device and computer equipment Pending CN117919693A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410165595.XA CN117919693A (en) 2024-02-05 2024-02-05 Resource management method, device and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410165595.XA CN117919693A (en) 2024-02-05 2024-02-05 Resource management method, device and computer equipment

Publications (1)

Publication Number Publication Date
CN117919693A true CN117919693A (en) 2024-04-26

Family

ID=90770237

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410165595.XA Pending CN117919693A (en) 2024-02-05 2024-02-05 Resource management method, device and computer equipment

Country Status (1)

Country Link
CN (1) CN117919693A (en)

Similar Documents

Publication Publication Date Title
CN117919693A (en) Resource management method, device and computer equipment
CN116578410A (en) Resource management method, device, computer equipment and storage medium
CN116204311A (en) Pod cluster capacity expansion and contraction method and device, computer equipment and storage medium
CN115221852A (en) Vxe-table based dynamic calculation table implementation method, device and computer equipment
CN112286448A (en) Object access method and device, electronic equipment and machine-readable storage medium
CN114528045B (en) Plug-in operation method, device, computer equipment and storage medium
CN113900826B (en) Data processing method, apparatus, computer device, storage medium, and program product
CN115809956B (en) Graphics processor performance analysis method, device, computer equipment and storage medium
CN118312310A (en) Dynamic capacity expansion method, system, terminal and medium for task machine of BIM system
CN116737140A (en) Business component construction method, device, computer equipment and storage medium
CN118484233A (en) Task processing method, device, computer equipment and storage medium
CN118628105A (en) Resource transfer data processing method, device, computer equipment and storage medium
CN117667865A (en) Data distributed storage method, device, equipment and medium
CN118193083A (en) Software resource loading method and device, computer equipment and storage medium
CN118034885A (en) Task processing method, device, computer equipment and storage medium
CN118608746A (en) Detection frame screening method, detection frame screening device, computer equipment and storage medium
CN117648484A (en) Content recommendation method, device, computer equipment and storage medium
CN117667445A (en) Message consumption resource expansion and contraction method and device, storage medium and computer equipment
CN118245449A (en) File processing method, device, computer equipment and storage medium
CN116843477A (en) Financial product purchasing method, device, computer equipment and storage medium
CN118113530A (en) Chip fault positioning method, device, computer equipment and storage medium
CN116700969A (en) Task processing method, device, computer equipment and storage medium
CN118338003A (en) Video decoding method, apparatus, computer device, readable storage medium, and program product
CN117436832A (en) Method, device, computer equipment, medium and product for processing business mail
CN117112886A (en) Popularization information processing method, device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination