Method and system for optimizing file playing

By introducing moving map analysis SDK tool packages and resource monitoring mechanisms in the movement system, the dynamic diagram analysis and cache strategy are dynamically adjusted according to equipment resource status. Resource utilization and playback effect.

CN119376925APending Publication Date: 2025-01-28FUJIAN TQ ONLINE INTERACTIVE INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411397703.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-09
Publication Date
2025-01-28

AI Technical Summary

Technical Problem

In the case of tight resources, the playback of dynamic pictures is not smooth, and multiple animations will affect each other, resulting in poor overall playback effect.

Method used

By adding a new SDK toolkit for dynamic diagram analysis, the CPU and memory usage of the monitoring equipment use different strategies to analyze and cache by different strategies, including frame -by -frame analysis, reducing cache storage, extending cache failure time And real -time analysis.

Benefits of technology

Effectively utilize resources, reduce playback stutter, improve the fluency and efficiency of moving pictures, and cover a variety of animation scenes and resource conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119376925A_ABST
    Figure CN119376925A_ABST
Patent Text Reader

Abstract

The invention relates to the field of dynamic graph playing optimization, in particular to a file playing optimization method and system, and the method comprises the steps: newly adding an SDK (Software Development Kit) for dynamic graph analysis, and carrying out the analysis and loading cache operation of all dynamic graphs through the SDK; after an application program integrates the SDK toolkit, a monitoring task is automatically added, and the monitoring task monitors the CPU utilization rate and the memory utilization rate of equipment where the application program is located and loads the CPU utilization rate and the memory utilization rate to a local cache; obtaining a CPU residual utilization rate and a memory residual utilization rate according to the CPU utilization rate and the memory utilization rate, judging current CPU and memory states according to the CPU residual utilization rate and the memory residual utilization rate, and playing the dynamic graph file by using different strategies; the dynamic graph can be played by adopting different strategies according to the resource quantity, the resources are reasonably utilized, the occurrence of playing lagging is reduced, and the playing efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of dynamic picture viewing optimization, and in particular to a file playback optimization method and system thereof. Background Art

[0002] In today's Internet systems, there are more and more file playback requirements, such as video playback, such as the playback of various dynamic pictures, especially in social software, where various dynamic pictures are sent. Dynamic pictures usually have large file sizes, and there are many of them in the chat communication process. Under normal circumstances, the playback of various dynamic pictures requires the CPU to parse and calculate the dynamic pictures frame by frame, and then cache the parsed frame data in the memory, and finally achieve frame-by-frame playback to achieve the effect of dynamic viewing.

[0003] At present, the common practice is that the program uses the CPU to parse frame by frame, and then caches all of them in the local memory. However, on most client devices, the CPU and memory are precious resources. When the CPU or memory is tight, still parsing frame by frame in the above way will increase the CPU usage. At the same time, continuing to cache all frame data in the memory will further increase the memory usage. The final result is that when resources are tight, the playback of the entire animated image will not be particularly smooth, and multiple animated images will affect each other. Summary of the invention

[0004] In order to overcome the problems in the prior art that when resources are tight, the playback of the entire animated picture is not smooth and multiple animated pictures affect each other, the purpose of the present invention is to provide an optimization method and system for file playback, which can adopt different strategies to play animated pictures according to the amount of resources, reasonably utilize resources, reduce the occurrence of playback jams, and improve playback efficiency.

[0005] The present invention is implemented by the following scheme:

[0006] A method for optimizing file playback, the method steps are as follows:

[0007] Step 1: Add an SDK toolkit for dynamic image parsing. All dynamic image parsing and loading cache operations are performed by the SDK toolkit;

[0008] Step 2: When the SDK toolkit is integrated into the application, a monitoring task will be automatically added. The monitoring task monitors the CPU usage and memory usage of the device where the application is located and loads them into the local cache;

[0009] Step 3: According to the CPU usage rate and the memory usage rate, obtain the CPU remaining usage rate and the memory remaining usage rate, and judge the current CPU and memory status according to the CPU remaining usage rate and the memory remaining usage rate, wherein the status includes sufficient resources and vacant resources;

[0010] When the CPU and memory resources are sufficient, the animated image will be parsed frame by frame and all cached in the local memory;

[0011] When CPU resources are sufficient and memory resources are insufficient, the cache storage is reduced by increasing CPU analysis. At this time, the frame cache after the analysis of this animated image is reduced. When it is viewed again later, the CPU is used for real-time analysis.

[0012] When CPU resources are vacant and memory resources are sufficient, the cache expiration time is extended to handle dynamic image parsing. At this time, not only all frame data will be cached, but also the expiration time of the frame cache will be extended. By increasing the cache occupancy, the CPU consumption in the future will be reduced.

[0013] When both CPU and memory resources are available, real-time parsing is used to reduce cache time.

[0014] Furthermore, when the remaining usable rates of the CPU and the memory are above 50%, it indicates that the resources are sufficient. When the remaining usable rates of the CPU and the memory are below 50%, it indicates that the resources are vacant.

[0015] Furthermore, the real-time analysis is specifically: using the CPU's intermittent analysis method, only recording the dynamic Figure 1 Part of the frame data is stored in the cache, which can reduce the CPU usage and memory usage, and can also perform dynamic image viewing.

[0016] A file playback optimization system, the system comprising: an SDK toolkit new module, a monitoring module and a dynamic analysis module;

[0017] The SDK toolkit new module is used to add a new SDK toolkit for dynamic image parsing. All dynamic image parsing and loading cache operations are performed by the SDK toolkit;

[0018] The monitoring module is used to automatically add a monitoring task when the application integrates the SDK toolkit. The monitoring task monitors the CPU usage and memory usage of the device where the application is located and loads them into the local cache;

[0019] The dynamic analysis module is used to obtain the CPU remaining utilization rate and the memory remaining utilization rate according to the CPU utilization rate and the memory utilization rate, and judge the current CPU and memory status according to the CPU remaining utilization rate and the memory remaining utilization rate, wherein the status includes sufficient resources and vacant resources;

[0020] When the CPU and memory resources are sufficient, the animated image will be parsed frame by frame and all cached in the local memory;

[0021] When CPU resources are sufficient and memory resources are insufficient, the cache storage is reduced by increasing CPU analysis. At this time, the frame cache after the analysis of this animated image is reduced. When it is viewed again later, the CPU is used for real-time analysis.

[0022] When CPU resources are vacant and memory resources are sufficient, the cache expiration time is extended to handle dynamic image parsing. At this time, not only all frame data will be cached, but also the expiration time of the frame cache will be extended. By increasing the cache occupancy, the CPU consumption in the future will be reduced.

[0023] When both CPU and memory resources are available, real-time parsing is used to reduce cache time.

[0024] Furthermore, when the remaining usable rates of the CPU and the memory are above 50%, it indicates that the resources are sufficient. When the remaining usable rates of the CPU and the memory are below 50%, it indicates that the resources are vacant.

[0025] Furthermore, the real-time analysis is specifically: using the CPU's intermittent analysis method, only recording the dynamic Figure 1 Part of the frame data is stored in the cache, which can reduce the CPU usage and memory usage, and can also perform dynamic image viewing.

[0026] The beneficial effects of the present invention are:

[0027] The present invention provides a method and system for optimizing file playback, and additionally provides a dynamic image parsing SDK toolkit to monitor the amount of resources on the client device. When the CPU and memory resources are sufficient, the processing is performed according to the old logic. When the CPU resources are sufficient and the memory is insufficient, the cache storage is reduced by increasing the CPU parsing. When the CPU resources are vacant and the memory is sufficient, the cache expiration time is extended. When both the CPU and memory resources are vacant, real-time parsing is used to reduce the cache time. Through the above method, the vast majority of dynamic image scenes can be covered, and the dynamic switching strategy can be used to further optimize the display results of the dynamic image, and resources can be reasonably used to improve efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 is a flow chart of the method of the present invention;

[0029] Figure 2 It is a structural block diagram of the system of the present invention. DETAILED DESCRIPTION

[0030] The present invention will be further described below in conjunction with the accompanying drawings.

[0031] See also Figure 1 , a method for optimizing file playback, the method steps are as follows:

[0032] Step 1: Add an SDK toolkit for dynamic image parsing. All dynamic image parsing and loading cache operations are performed by the SDK toolkit;

[0033] Step 2: When the SDK toolkit is integrated into the application, a monitoring task will be automatically added. The monitoring task monitors the CPU usage and memory usage of the device where the application is located and loads them into the local cache;

[0034] Step 3: According to the CPU usage rate and the memory usage rate, obtain the CPU remaining usage rate and the memory remaining usage rate, and judge the current CPU and memory status according to the CPU remaining usage rate and the memory remaining usage rate, wherein the status includes sufficient resources and vacant resources;

[0035] When the CPU and memory resources are sufficient, the animated image will be parsed frame by frame and all cached in the local memory;

[0036] When CPU resources are sufficient and memory resources are insufficient, the cache storage is reduced by increasing CPU analysis. At this time, the frame cache after the analysis of this animated image is reduced. When it is viewed again later, the CPU is used for real-time analysis.

[0037] When CPU resources are vacant and memory resources are sufficient, the cache expiration time is extended to handle dynamic image parsing. At this time, not only all frame data will be cached, but also the expiration time of the frame cache will be extended. By increasing the cache occupancy, the CPU consumption in the future will be reduced.

[0038] When both CPU and memory resources are available, real-time parsing is used to reduce cache time.

[0039] The present invention will be further described below in conjunction with a specific embodiment:

[0040] A method for optimizing file playback, the method comprising the following steps:

[0041] Step 1. First, you need to add a new dynamic image parsing SDK toolkit. For example, if there is a dynamic image, the SDK toolkit will parse it and divide it into 1000 frames, which will generate 1000 pieces of image information.

[0042] Step 2. Assume that a mobile device has an 8-core CPU, 512G memory, and a monitoring program. When the application on the mobile device integrates the SDK toolkit and is in the startup state, a new monitoring task will be added, and the monitoring program will be called to execute the monitoring task; the task will automatically monitor the CPU usage and memory usage of the device where the application is located, and load them into the local cache to facilitate quick reading of monitoring data;

[0043] When the CPU usage does not exceed 400% and the memory usage does not exceed 256G, it means that there are more resources, and the setting level is 1. When the CPU does not exceed 400% and the memory usage exceeds 256G, the setting level is 2. When the CPU exceeds 400% and the memory does not exceed 256G, the setting level is 3. When the CPU exceeds 400% and the memory exceeds 256G, the setting level is 4.

[0044] Step 3. When the memory level is 1, the animation in step 1 will use the CPU to parse the 1000 frames and generate frame images that are completely cached in the local memory. The cache expiration time uses the default time.

[0045] When the memory level is 2, the animation in step 1 will use the CPU to parse the 1000 frames, but only a small number of frames will be saved to the local memory, for example, only the even numbers will be saved to the memory. When the animation needs to be viewed again next time, the odd numbers will be parsed in real time by the CPU, and the even numbers will be read from the cache;

[0046] When the memory level is 3, the animation in step 1 will use the CPU to parse these 1000 frames and cache all frame images in the cache. At the same time, the expiration time of the frame images will be extended. By increasing the cache expiration time, the CPU parsing frequency can be reduced.

[0047] When the memory level is 4, the dynamic image is viewed using real-time analysis, that is, the CPU interval analysis method is used to record only the dynamic image. Figure 1 Part of the frame data is cached; for example, the CPU only parses the odd-numbered frame data and caches these odd-numbered frame data in the local memory. In this way, the CPU usage can be reduced and the memory usage can be reduced. However, because it is a downgrade solution, using part of the frame data will still cause lag, but the animated image viewing function can still be performed without being unable to view.

[0048] See also Figure 2, a file playback optimization system, the system comprising: an SDK toolkit new module, a monitoring module and a dynamic analysis module;

[0049] The SDK toolkit new module is used to add a new SDK toolkit for dynamic image parsing. All dynamic image parsing and loading cache operations are performed by the SDK toolkit;

[0050] The monitoring module is used to automatically add a monitoring task when the application integrates the SDK toolkit. The monitoring task monitors the CPU usage and memory usage of the device where the application is located and loads them into the local cache;

[0051] The dynamic analysis module is used to obtain the CPU remaining utilization rate and the memory remaining utilization rate according to the CPU utilization rate and the memory utilization rate, and judge the current CPU and memory status according to the CPU remaining utilization rate and the memory remaining utilization rate, wherein the status includes sufficient resources and vacant resources;

[0052] When the CPU and memory resources are sufficient, the animated image will be parsed frame by frame and all cached in the local memory;

[0053] When CPU resources are sufficient and memory resources are insufficient, the cache storage is reduced by increasing CPU analysis. At this time, the frame cache after the analysis of this animated image is reduced. When it is viewed again later, the CPU is used for real-time analysis.

[0054] When CPU resources are vacant and memory resources are sufficient, the cache expiration time is extended to handle dynamic image parsing. At this time, not only all frame data will be cached, but also the expiration time of the frame cache will be extended. By increasing the cache occupancy, the CPU consumption in the future will be reduced.

[0055] When both CPU and memory resources are available, real-time parsing is used to reduce cache time.

[0056] In one embodiment of the present invention, when the remaining usable rates of the CPU and memory are above 50%, it indicates that the resources are sufficient, and when the remaining usable rates of the CPU and memory are below 50%, it indicates that the resources are vacant.

[0057] In one embodiment of the present invention, the real-time analysis is specifically: using the CPU's intermittent analysis method, only recording the dynamic Figure 1 Part of the frame data is stored in the cache, which can reduce the CPU usage and memory usage, and can also perform dynamic image viewing.

[0058] The above description is only a preferred embodiment of the present invention. All equivalent changes and modifications made according to the scope of the patent application of the present invention should fall within the scope of the present invention.

Claims

1. A method for optimizing file playback, characterized in that: The method steps are as follows: Step 1: Add an SDK toolkit for dynamic image parsing. All dynamic image parsing and loading cache operations are performed by the SDK toolkit; Step 2: When the SDK toolkit is integrated into the application, a monitoring task will be automatically added. The monitoring task monitors the CPU usage and memory usage of the device where the application is located and loads them into the local cache; Step 3: According to the CPU usage rate and the memory usage rate, obtain the CPU remaining usage rate and the memory remaining usage rate, and judge the current CPU and memory status according to the CPU remaining usage rate and the memory remaining usage rate, wherein the status includes sufficient resources and vacant resources; When the CPU and memory resources are sufficient, the animated image will be parsed frame by frame and all cached in the local memory; When CPU resources are sufficient and memory resources are insufficient, the cache storage is reduced by increasing CPU analysis. At this time, the frame cache after the analysis of this animated image is reduced. When it is viewed again later, the CPU is used for real-time analysis. When CPU resources are vacant and memory resources are sufficient, the cache expiration time is extended to handle dynamic image parsing. At this time, not only all frame data will be cached, but also the expiration time of the frame cache will be extended. By increasing the cache occupancy, the CPU consumption in the future will be reduced. When both CPU and memory resources are available, real-time parsing is used to reduce cache time.

2. The method for optimizing file playback according to claim 1, characterized in that: When the remaining usable rate of CPU and memory is above 50%, it indicates that the resources are sufficient. When the remaining usable rate of CPU and memory is below 50%, it indicates that the resources are vacant.

3. The method for optimizing file playback according to claim 1, characterized in that: The real-time analysis is specifically: using the CPU's intermittent analysis method, only recording a portion of the frame data of the dynamic image into the cache, which can reduce the number of CPU usage and memory usage, and can perform the dynamic image viewing function.

4. A file playback optimization system, characterized in that: The system includes: an SDK toolkit new module, a monitoring module and a dynamic analysis module; The SDK toolkit new module is used to add a new SDK toolkit for dynamic image parsing. All dynamic image parsing and loading cache operations are performed by the SDK toolkit; The monitoring module is used to automatically add a monitoring task when the application integrates the SDK toolkit. The monitoring task monitors the CPU usage and memory usage of the device where the application is located and loads them into the local cache; The dynamic analysis module is used to obtain the CPU remaining utilization rate and the memory remaining utilization rate according to the CPU utilization rate and the memory utilization rate, and judge the current CPU and memory status according to the CPU remaining utilization rate and the memory remaining utilization rate, wherein the status includes sufficient resources and vacant resources; When the CPU and memory resources are sufficient, the animated image will be parsed frame by frame and all cached in the local memory; When CPU resources are sufficient and memory resources are insufficient, the cache storage is reduced by increasing CPU resolution. Reduce the frame buffer after parsing this animated image, and use the CPU for real-time parsing when viewing it again later; When CPU resources are vacant and memory resources are sufficient, the cache expiration time is extended to handle dynamic image parsing. At this time, not only all frame data will be cached, but also the expiration time of the frame cache will be extended. By increasing the cache occupancy, the CPU consumption in the future will be reduced. When both CPU and memory resources are available, real-time parsing is used to reduce cache time.

5. The file playback optimization system according to claim 4, characterized in that: When the remaining usable rate of CPU and memory is above 50%, it indicates that the resources are sufficient. When the remaining usable rate of CPU and memory is below 50%, it indicates that the resources are vacant.

6. The file playback optimization system according to claim 4, characterized in that: The real-time analysis is specifically: using the CPU's intermittent analysis method, only recording a portion of the frame data of the dynamic image into the cache, which can reduce the number of CPU usage and memory usage, and can perform the dynamic image viewing function.