Data processing method, device, terminal, and storage medium

By dynamically determining and releasing cache space, it solves the problems of poor fluency and cache waste caused by insufficient cache in high refresh rate displays, achieves more efficient cache space utilization, and improves display effects and terminal performance.

CN113342516BInactive Publication Date: 2024-09-03BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110524559.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-05-13
Publication Date
2024-09-03
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Because the processing rate of high-refresh rate displays cannot keep up with the refresh rate of high-resolution images, problems such as frame loss or screen tearing occur. Existing technologies are difficult to effectively solve the poor fluency and waste of cache space caused by insufficient cache.

Method used

By dynamically determining the active cache space in the storage queue and releasing free cache space, the cache space usage is optimized according to the needs of the images to be displayed to ensure reasonable allocation and utilization of the cache space.

Benefits of technology

It reduces the poor display fluency caused by insufficient cache, reduces the waste of cache space, and improves the display effect and terminal performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113342516B
    Figure CN113342516B
Patent Text Reader

Abstract

The present disclosure is about a data processing method and device, terminal, and storage medium. The method includes: determining the active cache space in the storage queue according to the cache space required for the picture to be displayed; determining the free cache space in the storage queue other than the active cache space; if the free cache space exists, releasing the free cache space; and using the active cache space to cache the data of the picture to be displayed. Through the technical solution of the embodiment of the present disclosure, the cache space to be used is dynamically determined according to the display requirements corresponding to the picture data to be displayed, which reduces the poor display fluency caused by insufficient cache on the one hand, and reduces the waste of cache space on the other hand.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to information processing technology, and in particular to a data processing method and device, a terminal, and a storage medium. Background Art

[0002] With the development demand for multifunctional and high-performance smart terminals, the smoothness and clarity of the display screen are one of the key points for improving the performance of smart terminals. The screen display function based on Android and other systems usually uses cache space to synthesize the screen data, and the display reads the data in the cache to realize the screen display. In addition, in order to pursue the screen display effect and eye protection effect, high refresh rate display screens have become the mainstream development trend. However, for high refresh rate display screens, it is often easy to cause frame loss or screen tearing due to the fact that the processing rate of high-resolution images cannot keep up with the refresh rate of the display screen. Summary of the invention

[0003] The present invention provides a data processing method and device, a terminal, and a storage medium.

[0004] According to a first aspect of an embodiment of the present disclosure, a method for processing data is provided, the method comprising:

[0005] Determine the active buffer space in the storage queue according to the buffer space required for the picture to be displayed;

[0006] Determining free cache space in the storage queue other than the active cache space;

[0007] If the free cache space exists, releasing the free cache space;

[0008] The active buffer space is used to buffer data of the to-be-displayed picture to be displayed.

[0009] In some embodiments, determining the active cache space in the storage queue according to the cache space required for the picture to be displayed includes:

[0010] If the amount of buffer space in the current storage queue is greater than or equal to the amount of buffer space required for the picture to be displayed, the active buffer space is determined in the buffer space in the current storage queue.

[0011] In some embodiments, if the free cache space exists, releasing the free cache space comprises:

[0012] If the free cache space exists and the free cache space meets a predetermined idle state condition, the free cache space is released.

[0013] In some embodiments, the idle state condition includes: the idle duration of the idle cache space;

[0014] If the free cache space exists and the free cache space satisfies a predetermined idle state condition, releasing the free cache space comprises:

[0015] If the free cache space exists and the idle time length of the free cache space is greater than or equal to a predetermined time length threshold, the free cache space is released.

[0016] In some embodiments, if the free cache space exists and the idle time of the free cache space is greater than or equal to a predetermined time threshold, releasing the free cache space includes:

[0017] If it is detected that there is the free cache space, then start timing;

[0018] In response to the timing duration being greater than or equal to a predetermined duration threshold, the free cache space is released.

[0019] In some embodiments, the idle state condition includes: a ratio of the idle cache space to the storage queue;

[0020] If the free cache space exists and the free cache space satisfies a predetermined idle state condition, releasing the free cache space comprises:

[0021] If the free cache space exists, and the proportion of the free cache space to the storage queue is greater than or equal to a predetermined proportion threshold, the free cache space is released.

[0022] In some embodiments, determining the active cache space in the storage queue according to the cache space required for the picture to be displayed includes:

[0023] If the amount of buffer space in the current storage queue is less than the amount of buffer space required for the picture to be displayed, increasing the buffer space in the storage queue;

[0024] The cache space in the current storage queue and the increased cache space are determined as the active cache space.

[0025] In some embodiments, the sum of the amount of the active cache space and the amount of the free cache space is less than or equal to a predetermined amount threshold of the storage queue;

[0026] The storage queue is a circular queue.

[0027] According to a second aspect of an embodiment of the present disclosure, a data processing device is provided, the device comprising:

[0028] A first determining module, used to determine the active cache space in the storage queue according to the cache space required for the picture to be displayed;

[0029] A second determining module, configured to determine free cache space in the storage queue other than the active cache space;

[0030] A release module, used to release the free cache space if the free cache space exists;

[0031] The cache module is used to cache the data of the to-be-displayed picture by using the active cache space.

[0032] In some embodiments, the first determining module includes:

[0033] The first determining submodule is configured to determine the active buffer space in the buffer space in the current storage queue if the amount of buffer space in the current storage queue is greater than or equal to the amount of buffer space required for the picture to be displayed.

[0034] In some embodiments, the release module comprises:

[0035] The first release submodule is configured to release the free cache space if the free cache space exists and the free cache space meets a predetermined idle state condition.

[0036] In some embodiments, the idle state condition includes: the idle duration of the idle cache space;

[0037] The first release submodule is specifically used for:

[0038] If the free cache space exists and the idle time length of the free cache space is greater than or equal to a predetermined time length threshold, the free cache space is released.

[0039] In some embodiments, the first release submodule is specifically used to:

[0040] If it is detected that there is the free cache space, then start timing;

[0041] In response to the timing duration being greater than or equal to a predetermined duration threshold, the free cache space is released.

[0042] In some embodiments, the idle state condition includes: a ratio of the idle cache space to the storage queue;

[0043] The first release submodule is specifically used to:

[0044] If the free cache space exists, and the proportion of the free cache space to the storage queue is greater than or equal to a predetermined proportion threshold, the free cache space is released.

[0045] In some embodiments, the first determining module includes:

[0046] An increasing submodule, for increasing the buffer space in the storage queue if the amount of buffer space in the current storage queue is less than the amount of buffer space required for the picture to be displayed;

[0047] The second determining submodule is used to determine the cache space in the current storage queue and the added cache space as the active cache space.

[0048] In some embodiments, the sum of the amount of the active cache space and the amount of the free cache space is less than or equal to a predetermined amount threshold of the storage queue;

[0049] The storage queue is a circular queue.

[0050] According to a third aspect of an embodiment of the present disclosure, a terminal is provided, the terminal comprising at least: a processor and a memory for storing executable instructions that can be run on the processor, wherein:

[0051] When the processor is used to run the executable instructions, the executable instructions execute the steps in any of the above-mentioned data processing methods.

[0052] A fourth aspect of the embodiments of the present disclosure is a non-temporary computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, implement the steps in any of the above-mentioned data processing methods.

[0053] The technical solution provided by the embodiments of the present disclosure may include the following beneficial effects: through the technical solution of the embodiments of the present disclosure, the cache space to be used is dynamically determined according to the display requirements corresponding to the picture data to be displayed, which on the one hand reduces the poor display fluency caused by insufficient cache, and on the other hand reduces the waste of cache space.

[0054] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0056] Figure 1A data processing method according to an exemplary embodiment is shown in FIG. Figure 1 ;

[0057] Figure 2 A data processing method according to an exemplary embodiment is shown in FIG. Figure 2 ;

[0058] Figure 3 A data processing method according to an exemplary embodiment is shown in FIG. Figure 3 ;

[0059] Figure 4 is a basic framework schematic diagram of Android graphic display according to an exemplary embodiment;

[0060] Figure 5 is a schematic diagram of the principle of the "Butter Plan" according to an exemplary embodiment;

[0061] Figure 6 is a schematic diagram showing a situation where a three-cache mechanism has insufficient cache according to an exemplary embodiment;

[0062] Figure 7 is a schematic diagram of the structure of a dynamic cache queue according to an exemplary embodiment;

[0063] Figure 8 is a schematic diagram showing the principle of delayed recycling in a dynamic cache queue according to an exemplary embodiment;

[0064] Fig. 9 is a structural block diagram of a data processing device according to an exemplary embodiment;

[0065] Fig.10 The figure is a block diagram of a physical structure of a terminal according to an exemplary embodiment. DETAILED DESCRIPTION

[0066] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of devices and methods consistent with some aspects of the present invention as detailed in the appended claims.

[0067] Figure 1 is a flow chart of a distance measurement method according to an exemplary embodiment. Figure 1 As shown, the method is applied to a first device, comprising:

[0068] Step S101, determining the active cache space in the storage queue according to the cache space required for the picture to be displayed;

[0069] Step S102, determining free cache space in the storage queue except the active cache space;

[0070] Step S103: if the free cache space exists, release the free cache space;

[0071] Step S104: Utilize the active buffer space to buffer the data of the to-be-displayed picture.

[0072] In systems such as Android, the graphics on the screen need to be drawn and synthesized in the cache before they can be displayed. The principle can be understood as a "producer-consumer model": after the client produces a buffer, the buffer space enters the cache queue and waits for synthesis. In the display system, it generally includes three parts: CPU (Central Processing Unit), GPU (Graphics Processing Unit) and display. The CPU is responsible for calculating the frame data and passing the calculated data to the GPU. The GPU renders the graphics data and then stores it in the cache, and the display screen displays the data in the cache.

[0073] Since the refresh rate of the display screen is fixed, for example, a display screen with a refresh rate of 60Hz corresponds to 16.6ms to display one frame of the picture, that is, within these 16.6ms, one frame of the picture is displayed by reading the data in the cache row by row or column by column. If the frame rate of the data update in the cache is consistent with the refresh rate, the display screen can continuously display new pictures, thereby achieving a smooth display effect. However, due to the different data complexity of different pictures, the CPU and GPU read, write and process the data and complete it in full accordance with the duration of the screen refresh cycle, which is uncontrollable. Therefore, it may happen that some data in the cache is rewritten before it is displayed, resulting in the data in the cache not being the same frame, or the data in the cache has been displayed, but the next frame of data has not been written to the cache, resulting in subsequent display anomalies such as screen tearing or frame loss.

[0074] In some embodiments, a double buffer or triple buffer approach may be used to reduce display anomalies such as screen tearing or frame loss.

[0075] For example, under the dual buffer mechanism, buffer space is provided for drawing and displaying respectively. The GPU writes a frame of image data into the corresponding standby buffer. The display reads the data in the corresponding display buffer and displays it. When the screen is refreshed, if the standby buffer of the new frame is ready, the data in the display buffer can be overwritten to display the next frame.

[0076] However, since the double buffering only exchanges data after the next frame of data is ready, if the processing time of the previous frame of data in the backup buffer exceeds the preset time, or the CPU fails to provide data to the GPU in time, the data in the display buffer cannot be updated, resulting in the next frame of data not being displayed normally, thus causing frame loss. In other words, although the double buffering mechanism can reduce screen tearing, it may still cause frame loss.

[0077] To this end, a cache space can be added on the basis of double buffering, that is, a triple buffering mechanism can be adopted, so that the CPU, GPU and display can all use the corresponding cache space, thereby further reducing frame drops. However, in complex data processing scenarios, when the cache space cannot be freed up, it will lead to insufficient subsequent cache space, further leading to subsequent frame drops. In addition, this method always occupies three cache spaces, which will cause cache waste when processing simple pictures.

[0078] In the disclosed embodiment, the active cache space can be dynamically determined by the cache space required for the picture to be displayed. The active cache space is the cache space used to process the corresponding picture to be displayed. If the picture to be displayed is a complex picture (large amount of data, complex processing, etc.), more cache space is required, for example: three caches are required or four cache spaces are used when the three-cache mechanism still has insufficient cache, that is, three or four active cache spaces are determined. If the picture to be displayed is a simpler picture and less cache space is required, one or two active cache spaces are determined.

[0079] Here, the storage queue may be a pre-set queue, and the storage space of the queue may be dynamically determined, that is, the number of cache spaces of the storage queue is variable. In some embodiments, the number of cache spaces of the storage queue may be within a predetermined range, for example, greater than 3 and less than 5 cache spaces.

[0080] It should be noted that the above-mentioned picture to be displayed can be a single frame, multiple frames, or a specific display scene. For example, when entering certain high-resolution or complex image application scenarios (for example, game scenes or high-definition movie playback scenes, etc.), it is considered that the picture to be displayed requires more cache space for processing.

[0081] In the embodiment of the present disclosure, it is also possible to determine whether there is free cache space other than the active space in the storage queue. The free cache space is not used for displaying the current picture to be displayed. Therefore, if there is free cache space, the free cache space can be released and only the active cache space in the storage queue is retained.

[0082] In this way, by dynamically determining the active cache space in the storage queue and releasing the free cache space, on the one hand, the cache space demand required for picture display can be met, reducing problems such as frame drops due to insufficient cache; on the other hand, it can reduce the waste of cache space and is suitable for terminals with different hardware bases.

[0083] In some embodiments, determining the active cache space in the storage queue according to the cache space required for the picture to be displayed includes:

[0084] If the amount of buffer space in the current storage queue is greater than or equal to the amount of buffer space required for the picture to be displayed, the active buffer space is determined in the buffer space in the current storage queue.

[0085] In the embodiment of the present disclosure, if the amount of cache space in the current storage queue can meet the amount of cache space required for the picture to be displayed, that is, the amount of cache space already in the current storage queue is greater than or equal to the required amount of cache space, there is no need to apply for new cache space. Therefore, the existing cache space in the current storage queue can be determined as the active cache space to meet the usage requirements of the picture to be displayed.

[0086] That is to say, when the cache space of the storage queue can meet the display requirements of subsequent pictures, there is no need to add cache space in the storage queue, so there is no need to frequently apply for memory, which improves processing efficiency.

[0087] In some embodiments, if the free cache space exists, releasing the free cache space comprises:

[0088] If the free cache space exists and the free cache space meets a predetermined idle state condition, the free cache space is released.

[0089] If there is free cache space, the free cache space can be released, thereby improving the utilization of the cache. However, frequently releasing and applying for cache space may bring additional processing burden. Therefore, in an embodiment of the present disclosure, the release of the free cache space can be triggered when the free cache space meets a predetermined idle state condition. When the free cache space does not meet the predetermined idle state condition, the free cache space is not released. Exemplarily, the release of the free cache space can be triggered when the number of free cache spaces reaches a certain threshold, or when the idle time of the free cache space reaches a certain threshold, or when the proportion of the free cache space is greater than a predetermined threshold.

[0090] In this way, the free cache space can be kept in the storage queue for a short time, so as to be used by subsequent pictures to be displayed, thereby reducing the processing burden caused by frequent application and release of cache space.

[0091] In some embodiments, the idle state condition includes: the idle duration of the idle cache space;

[0092] like Figure 2 As shown, in the above step S103, if the free cache space exists and the free cache space meets a predetermined idle state condition, releasing the free cache space includes:

[0093] Step S201: If the free cache space exists and the idle time length of the free cache space is greater than or equal to a predetermined time length threshold, the free cache space is released.

[0094] Here, the idle state condition may be an idle time. When the idle time of the idle cache space is greater than or equal to a predetermined time threshold, it indicates that the idle cache space has not been used for a long period of time, and the current display screen may be in a low-quality display (such as the control interface of the application, static images, and the display of the main screen interface, etc.), which does not require a large amount of cache space. Therefore, the release of the idle cache space can be triggered at this time, thereby reducing the occupancy of the cache space and improving the performance of the terminal.

[0095] In some embodiments, if the free cache space exists and the idle time of the free cache space is greater than or equal to a predetermined time threshold, releasing the free cache space includes:

[0096] If it is detected that there is the free cache space, then start timing;

[0097] In response to the timing duration being greater than or equal to a predetermined duration threshold, the free cache space is released.

[0098] Here, the idle time of the free cache space can be determined by a timer. When the free cache space is detected, the timer starts, and when the timer duration is greater than or equal to the predetermined duration threshold, the cache space is still in an idle state, which means that the cache space does not need to be used for a long period of time, and therefore, the release of the free cache space can be triggered at this time.

[0099] In some embodiments, if new free cache space appears after the timing starts, that is, the original active cache space is also free, when the above timing duration is greater than or equal to the predetermined duration, the new free cache space can be released at the same time, that is, all the free cache space when the release is triggered will be released.

[0100] Exemplarily, the load of the storage queue is monitored by a lightweight monitoring thread. When it is found that the amount of cache space applied for is less than the amount of cache space actually used in the storage queue, a timer can be triggered. After the timer expires for 15 seconds, the currently unused free cache space is reclaimed and released.

[0101] In this way, there is no need to time each cache space. Only one timing process is needed to control the amount of free cache space to be maintained within a certain level.

[0102] In some embodiments, the idle state condition includes: a ratio of the idle cache space to the storage queue;

[0103] like Figure 3 As shown, in the above step S103, if the free cache space exists and the free cache space meets a predetermined idle state condition, releasing the free cache space includes:

[0104] Step S301: If the free cache space exists and the proportion of the free cache space to the storage queue is greater than or equal to a predetermined proportion threshold, the free cache space is released.

[0105] In the disclosed embodiment, the idle state condition may also be the ratio of free cache space to storage queue. If the ratio is high, it means that most of the cache space in the storage queue is not used, so the cache space can be released. According to the recent space-time theory, the characteristics of the most recent event are often similar to the characteristics of the next event. Therefore, it can be considered that a complex working condition is not easy to suddenly change to a complex working condition after it becomes a simple working condition. Therefore, when it is detected that the proportion of the active cache space of the load in the storage queue is lower than a predetermined threshold, the recycling mechanism can be triggered to release the free cache space; or, when it is detected that the proportion of the free cache space in the storage queue is greater than or equal to the predetermined ratio threshold, the free cache space is released.

[0106] In one embodiment, triggering the release of cache space may be releasing all current cache space, thereby eliminating the need to repeatedly apply for or release cache space and effectively improving the utilization of cache resources.

[0107] In some embodiments, determining the active cache space in the storage queue according to the cache space required for the picture to be displayed includes:

[0108] If the amount of buffer space in the current storage queue is less than the amount of buffer space required for the picture to be displayed, increasing the buffer space in the storage queue;

[0109] The cache space in the current storage queue and the increased cache space are determined as the active cache space.

[0110] Here, the active buffer space in the storage queue is determined according to the picture to be displayed. If the buffer space in the current storage queue is insufficient, new buffer space needs to be added to the storage queue, and the newly added buffer space and the existing buffer space in the storage queue are used together as the active buffer space.

[0111] That is to say, the amount of cache space in the storage queue can be applied for according to demand. When the amount of cache space in the storage queue is insufficient, new cache space needs to be applied for.

[0112] Of course, if there is free cache space in the storage queue during subsequent use, the free cache space can also be released. In this way, a storage queue with dynamic cache space is realized.

[0113] In some embodiments, the sum of the amount of the active cache space and the amount of the free cache space is less than or equal to a predetermined amount threshold of the storage queue;

[0114] The storage queue is a circular queue.

[0115] The cache space of the above storage queue is dynamically determined according to the picture to be displayed, but the total amount of cache space in the storage queue can be agreed upon by a predetermined number threshold, thereby reducing the impact of the storage queue on the use of cache by other processes. Of course, the predetermined number threshold can be a value greater than or equal to 3. If the predetermined number threshold is less than 3, it is difficult for the storage queue to dynamically change the cache space.

[0116] In the disclosed embodiment, the amount of cache space of the storage queue can be determined according to the hardware conditions of the terminal. If the total storage space of the terminal is large, the amount of cache space of the storage queue can be predetermined as a large value; and if the total storage space of the terminal is small, the amount of cache space of the storage queue can be predetermined as a small value. In addition, the predetermined amount threshold of the storage queue can also be determined according to the type of the terminal. For example, if the terminal is a low-end product for displaying simple pictures, or a non-intelligent product, there is no need to set a large predetermined amount threshold; and if the terminal is a high-end intelligent product that supports complex and high-performance applications, a large predetermined amount threshold can be set.

[0117] In addition, the storage queue in the embodiment of the present disclosure can be a circular queue, so that the active cache space can be a discontinuous cache space, and the free cache space can also be a discontinuous cache space. Therefore, the positions of the free cache space and the active cache space do not affect their use, and it is convenient for the dynamic change of the cache space.

[0118] The present disclosure also provides the following examples:

[0119] The basic framework of Android graphics display is as follows Figure 4 As shown, the process of displaying the screen can be understood as a "producer-consumer model", and its process includes: after the client, that is, the producer produces the cache, the cache enters the cache queue and waits for SurfaceFlinger (display synthesis system), that is, the consumer, to wait for synthesis. Here, the phonemes that may affect the fluency include: the client is slow to draw, causing the display synthesis system to be unable to wait for the cache synthesis to be sent to the display, which is ultimately reflected in frame drops or application running jams; or the display synthesis system is slow to synthesize and send to the display, causing the cache queue to reach its maximum capacity. At this time, the client cannot complete the action of requesting a free cache area (dequeue buffer), resulting in frame drops.

[0120] In this regard, the disclosed embodiment can increase the frequency of the CPU and GPU to speed up the efficiency of application-side production and display synthesis system-side synthesis, making the system run more smoothly. At the same time, the application interface can be optimized to further increase the production efficiency of the application side.

[0121] However, it is easier to increase the production efficiency of the application side than to increase the synthesis efficiency of the display synthesis system side, and it is cheaper and more convenient to increase the CPU frequency or simplify the complexity of the application than to increase the GPU frequency. Therefore, the implementation scheme will improve the fluency, but it is easy to fall into the synthesis bottleneck of the display synthesis system side. Due to the synthesis efficiency of the display synthesis system side, the produced cache cannot be synthesized and sent to the display in time.

[0122] In another embodiment, the Android graphics display solution can be introduced as follows Figure 5 The "Butter Plan" shown here relieves the synthesis pressure on the display synthesis system side by increasing the amount of cache space. Figure 5 A three-cache mechanism is used, such as Figure 5 As shown in the figure, cache space B times out during synthesis, causing it to not be displayed in time and affecting the entire subsequent sequence. However, due to the existence of the cache system, although C's drawing synthesis time is relatively long, it does not cause further frame loss.

[0123] Through the above Figure 5 The method in reduces the synthesis pressure on the display synthesis system, but this solution requires configuring the capacity of the fixed cache queue in the configuration file, which means that the same resources will be used for any situation, resulting in resource waste or insufficient resources. Figure 6 In the case shown, insufficient cache occurs, which exacerbates the subsequent frame loss rate. At the same time, it is not convenient to have to prepare a fixed cache space before compiling.

[0124] In the disclosed embodiment, based on the mechanisms of dynamic application, delayed recovery and distributed recovery, a high-performance buffer system that can adapt to different situations is proposed, which effectively reduces costs while reducing deployment difficulty and improves usage performance. It can effectively alleviate the synthesis pressure on the display synthesis system side and improve the smoothness of the system.

[0125] like Figure 7 As shown, in the embodiment of the present disclosure, a circular linked list with an upper capacity limit of R is used as a cache queue, where the value of R is greater than or equal to 3. If the cache spaces No. 0 to No. n-1 are all in use, that is, active cache spaces, and the number of active cache spaces in the queue does not reach the above-mentioned maximum capacity R, a new cache space n can be applied for drawing synthesis.

[0126] In actual applications, not every interface is a complex interface that requires multiple cache spaces. Therefore, in order to avoid wasting resources by using too much cache space on a relatively simple interface, the embodiments of the present disclosure also provide the following two cache recovery mechanisms.

[0127] First, delayed recovery mechanism:

[0128] like Figure 8 As shown, when creating a cache queue, an additional lightweight monitoring thread can be created. The monitoring thread is responsible for monitoring the load of the cache queue. When it is found that the amount of cache space applied for is less than the amount of cache space actually used, that is, the active cache space in the queue is less than the total amount of cache space, a timing device can be triggered. The timing device waits for a predetermined period of time, such as 15 seconds, and then reclaims the unloaded cache space, that is, the free cache space, to release the cache space for use by other processes.

[0129] This recycling mechanism preserves the cache space to the greatest extent, reduces the probability of applying for cache space when new complex conditions (such as game screens to be displayed) reappear, and enhances performance to the greatest extent. However, this solution consumes relatively large amounts of memory, and often results in resource waste.

[0130] Second, distribution recovery mechanism:

[0131] Unlike the delayed recycling mechanism, the distributed recycling mechanism is simple to deploy and saves resources. According to the recent space-time theory, the characteristics of the most recent event are often very similar to the characteristics of the next event. Therefore, it can be considered that after a complex working condition becomes a simple working condition, it is not easy to suddenly change to a complex working condition. Based on this, the free cache space can be recycled when the load rate is detected to be lower than the predetermined threshold, which improves resource utilization.

[0132] The disclosed embodiments can effectively improve the smoothness of application operation and reduce the frame loss rate of the application during use during actual application.

[0133] In addition, by deploying the above different recycling schemes, different benefits can also be brought. Deploying a delayed recycling scheme can greatly improve the fluency; deploying distributed recycling can achieve a relative balance between resource utilization and fluency. Therefore, the schemes in the above embodiments can select different methods according to the hardware conditions in actual applications, so as to achieve better use effects.

[0134] Fig. 9 is a structural block diagram of a data processing device according to an exemplary embodiment. Fig. 9 As shown, the device 900 includes:

[0135] A first determining module 901 is used to determine the active cache space in the storage queue according to the cache space required for the picture to be displayed;

[0136] A second determining module 902 is used to determine free cache space in the storage queue except the active cache space;

[0137] A release module 903 is used to release the free cache space if there is the free cache space;

[0138] The cache module 904 is used to cache the data of the to-be-displayed picture by using the active cache space.

[0139] In some embodiments, the first determining module includes:

[0140] The first determining submodule is configured to determine the active buffer space in the buffer space in the current storage queue if the amount of buffer space in the current storage queue is greater than or equal to the amount of buffer space required for the picture to be displayed.

[0141] In some embodiments, the release module comprises:

[0142] The first release submodule is configured to release the free cache space if the free cache space exists and the free cache space meets a predetermined idle state condition.

[0143] In some embodiments, the idle state condition includes: the idle duration of the idle cache space;

[0144] The first release submodule is specifically used for:

[0145] If the free cache space exists and the idle time length of the free cache space is greater than or equal to a predetermined time length threshold, the free cache space is released.

[0146] In some embodiments, the first release submodule is specifically used to:

[0147] If it is detected that there is the free cache space, then start timing;

[0148] In response to the timing duration being greater than or equal to a predetermined duration threshold, the free cache space is released.

[0149] In some embodiments, the idle state condition includes: a ratio of the idle cache space to the storage queue;

[0150] The first release submodule is specifically used for:

[0151] If the free cache space exists, and the proportion of the free cache space to the storage queue is greater than or equal to a predetermined proportion threshold, the free cache space is released.

[0152] In some embodiments, the first determining module includes:

[0153] An increasing submodule, for increasing the buffer space in the storage queue if the amount of buffer space in the current storage queue is less than the amount of buffer space required for the picture to be displayed;

[0154] The second determining submodule is used to determine the cache space in the current storage queue and the added cache space as the active cache space.

[0155] In some embodiments, the sum of the active cache space and the free cache space is less than or equal to a predetermined threshold number of the storage queue.

[0156] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0157] Fig.10 1 is a block diagram of a terminal 1000 according to an exemplary embodiment. For example, the terminal 1000 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0158] Reference Fig.10 The terminal 1000 may include one or more of the following components: a processing component 1001, a memory 1002, a power component 1003, a multimedia component 1004, an audio component 1005, an input / output (I / O) interface 1006, a sensor component 1007, and a communication component 1008.

[0159] The processing component 1001 generally controls the overall operation of the terminal 1000, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 1001 may include one or more processors 1010 to execute instructions to complete all or part of the steps of the above method. In addition, the processing component 1001 may also include one or more modules to facilitate the interaction between the processing component 1001 and other components. For example, the processing component 1001 may include a multimedia module to facilitate the interaction between the multimedia component 1004 and the processing component 1001.

[0160] The memory 1010 is configured to store various types of data to support operations at the terminal 1000. Examples of such data include instructions for any application or method operating on the terminal 1000, contact data, phone book data, messages, pictures, videos, etc. The memory 1002 may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as a static random access memory (SRAM), an electrically erasable programmable read-only memory (EEPROM), an erasable programmable read-only memory (EPROM), a programmable read-only memory (PROM), a read-only memory (ROM), a magnetic memory, a flash memory, a magnetic disk, or an optical disk.

[0161] The power supply component 1003 provides power to various components of the terminal 1000. The power supply component 1003 may include: a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the terminal 1000.

[0162] The multimedia component 1004 includes a screen that provides an output interface between the terminal 1000 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 1004 includes a front camera and / or a rear camera. When the terminal 1000 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and / or the rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0163] The audio component 1005 is configured to output and / or input audio signals. For example, the audio component 1005 includes a microphone (MIC), and when the terminal 1000 is in an operation mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 1010 or sent via the communication component 1008. In some embodiments, the audio component 1005 also includes a speaker for outputting audio signals.

[0164] I / O interface 1006 provides an interface between processing component 1001 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.

[0165] The sensor assembly 1007 includes one or more sensors for providing various aspects of status assessment for the terminal 1000. For example, the sensor assembly 1007 can detect the open / closed state of the terminal 1000, the relative positioning of the components, such as the display and keypad of the terminal 1000, and the sensor assembly 1007 can also detect the position change of the terminal 1000 or a component of the terminal 1000, the presence or absence of contact between the user and the terminal 1000, the orientation or acceleration / deceleration of the terminal 1000, and the temperature change of the terminal 1000. The sensor assembly 1007 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 1007 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 1007 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0166] The communication component 1008 is configured to facilitate wired or wireless communication between the terminal 1000 and other devices. The terminal 1000 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 1008 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 1008 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology or other technologies.

[0167] In an exemplary embodiment, terminal 1000 can be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above methods.

[0168] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 1002 including instructions, and the instructions can be executed by a processor 1010 of a terminal 1000 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0169] The embodiments of the present disclosure also provide a non-temporary computer-readable storage medium. When the instructions in the storage medium are executed by the processor of the mobile terminal, the mobile terminal can execute the method provided by any of the above embodiments.

[0170] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not disclosed in this disclosure. The specification and examples are to be considered exemplary only, and the true scope and spirit of the present invention are indicated by the following claims.

[0171] It should be understood that the present invention is not limited to the exact construction that has been described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.

Claims

1. A data processing method, It is characterized in that The method comprises: Determine the active buffer space in the storage queue according to the buffer space required for the picture to be displayed; Determining free cache space in the storage queue other than the active cache space; If the free cache space exists and the free cache space meets a predetermined idle state condition, releasing the free cache space; Utilizing the active buffer space to buffer the data of the to-be-displayed picture to be displayed; The idle state condition includes: the idle time of the idle cache space; if the idle cache space exists and the idle cache space meets the predetermined idle state condition, releasing the idle cache space includes: If the free cache space exists and the idle time length of the free cache space is greater than or equal to a predetermined time length threshold, the free cache space is released.

2. The method according to claim 1, It is characterized in that The step of determining the active cache space in the storage queue according to the cache space required for the picture to be displayed includes: If the amount of buffer space in the current storage queue is greater than or equal to the amount of buffer space required for the picture to be displayed, the active buffer space is determined in the buffer space in the current storage queue.

3. The method according to claim 1, It is characterized in that If the free cache space exists and the idle time of the free cache space is greater than or equal to a predetermined time threshold, releasing the free cache space includes: If it is detected that there is the free cache space, then start timing; In response to the timing duration being greater than or equal to a predetermined duration threshold, the free cache space is released.

4. The method according to claim 1, It is characterized in that The idle state condition includes: the proportion of the idle cache space to the storage queue; If the free cache space exists and the free cache space satisfies a predetermined idle state condition, releasing the free cache space comprises: If the free cache space exists, and the proportion of the free cache space to the storage queue is greater than or equal to a predetermined proportion threshold, the free cache space is released.

5. The method according to claim 1, It is characterized in that The step of determining the active cache space in the storage queue according to the cache space required for the picture to be displayed includes: If the amount of buffer space in the current storage queue is less than the amount of buffer space required for the picture to be displayed, increasing the buffer space in the storage queue; The cache space in the current storage queue and the increased cache space are determined as the active cache space.

6. The method according to any one of claims 1 to 5, It is characterized in that The sum of the active cache space and the free cache space is less than or equal to a predetermined threshold of the storage queue; The storage queue is a circular queue.

7. A data processing device, It is characterized in that The device comprises: A first determining module, used to determine the active cache space in the storage queue according to the cache space required for the picture to be displayed; A second determining module, configured to determine free cache space in the storage queue other than the active cache space; A release module, used to release the free cache space if the free cache space exists; A cache module, used for caching data of the to-be-displayed picture by using the active cache space; Wherein, the release module comprises: A first release submodule, configured to release the free cache space if the free cache space exists and the free cache space satisfies a predetermined idle state condition; The idle state condition includes: the idle time of the idle cache space; the first release submodule is specifically used to: If the free cache space exists and the idle time length of the free cache space is greater than or equal to a predetermined time length threshold, the free cache space is released.

8. The device according to claim 7, It is characterized in that The release module comprises: The first release submodule is configured to release the free cache space if the free cache space exists and the free cache space meets a predetermined idle state condition.

9. The device according to claim 7, It is characterized in that The first release submodule is specifically used to: If it is detected that there is the free cache space, then start timing; In response to the timing duration being greater than or equal to a predetermined duration threshold, the free cache space is released.

10. The device according to claim 7, It is characterized in that The idle state condition includes: the proportion of the idle cache space to the storage queue; The first release submodule is specifically used to: If the free cache space exists, and the proportion of the free cache space to the storage queue is greater than or equal to a predetermined proportion threshold, the free cache space is released.

11. The device according to claim 7, It is characterized in that The first determining module includes: An increasing submodule, for increasing the buffer space in the storage queue if the amount of buffer space in the current storage queue is less than the amount of buffer space required for the picture to be displayed; The second determining submodule is used to determine the cache space in the current storage queue and the added cache space as the active cache space.

12. The device according to any one of claims 7 to 11, It is characterized in that The sum of the active cache space and the free cache space is less than or equal to a predetermined threshold of the storage queue; The storage queue is a circular queue.

13. A terminal, It is characterized in that The terminal comprises at least: a processor and a memory for storing executable instructions that can be run on the processor, wherein: When the processor is used to run the executable instructions, the executable instructions execute the steps in the data processing method provided in any one of claims 1 to 6.

14. A non-transitory computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, implement the steps in the data processing method provided in any one of claims 1 to 6.