CN106528442B - Cache cleaning method and device - Google Patents
Cache cleaning method and device Download PDFInfo
- Publication number
- CN106528442B CN106528442B CN201610959806.2A CN201610959806A CN106528442B CN 106528442 B CN106528442 B CN 106528442B CN 201610959806 A CN201610959806 A CN 201610959806A CN 106528442 B CN106528442 B CN 106528442B
- Authority
- CN
- China
- Prior art keywords
- multimedia information
- ith
- downloaded
- ith multimedia
- stored
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 31
- 238000004140 cleaning Methods 0.000 title description 13
- 238000005201 scrubbing Methods 0.000 claims abstract description 18
- 238000012217 deletion Methods 0.000 claims abstract description 9
- 230000037430 deletion Effects 0.000 claims abstract description 9
- 238000012545 processing Methods 0.000 claims description 12
- 238000004891 communication Methods 0.000 description 10
- 238000010586 diagram Methods 0.000 description 10
- 230000009286 beneficial effect Effects 0.000 description 5
- 238000005516 engineering process Methods 0.000 description 5
- 230000003287 optical effect Effects 0.000 description 4
- 230000005236 sound signal Effects 0.000 description 4
- 230000008859 change Effects 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 230000001133 acceleration Effects 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 238000007726 management method Methods 0.000 description 2
- 206010037180 Psychiatric symptoms Diseases 0.000 description 1
- 230000009471 action Effects 0.000 description 1
- 230000006978 adaptation Effects 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000011982 device technology Methods 0.000 description 1
- 230000008451 emotion Effects 0.000 description 1
- 238000003384 imaging method Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 230000008569 process Effects 0.000 description 1
- 230000003997 social interaction Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/0223—User address space allocation, e.g. contiguous or non contiguous base addressing
- G06F12/023—Free address space management
- G06F12/0238—Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory
- G06F12/0246—Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory in block erasable memory, e.g. flash memory
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The disclosure relates to a cache scrubbing method and apparatus. The method comprises the following steps: when the content of the ith multimedia information is ready to be played, acquiring the identifier of the ith multimedia information, wherein i is a positive integer greater than 1; determining whether the ith multimedia information is downloaded according to the identifier of the ith multimedia information; and when the ith multimedia information is downloaded, deleting the ith multimedia information and the related record stored in the cache area, and playing the downloaded ith multimedia information. When the content of the current multimedia information is ready to be played, the current multimedia information stored in the cache region can be automatically deleted according to the identification of the current multimedia information, so that the current multimedia information can not be stored repeatedly, the space of the cache region is saved, the deletion task can be directly completed without manual operation of a user, the operation of the user is more convenient, and the user experience is improved.
Description
Technical Field
The present disclosure relates to electronic device technologies, and in particular, to a cache cleaning method and apparatus.
Background
Nowadays, no matter students or office workers, no matter people walk on the road or go to build up a body, opening a music player to listen to music which is listened to once becomes an essential requirement in the life of people, and the music can get rid of loneliness, communicate emotion and exchange thoughts, improve social interaction ability, adapt to the society, and obtain satisfaction, thus being very important.
Disclosure of Invention
The embodiment of the disclosure provides a cache cleaning method and device. The technical scheme is as follows:
according to a first aspect of the embodiments of the present disclosure, there is provided a cache cleaning method, including:
when the content of the ith multimedia information is ready to be played, acquiring the identifier of the ith multimedia information, wherein i is a positive integer greater than 1;
determining whether the ith multimedia information is downloaded according to the identifier of the ith multimedia information;
and when the ith multimedia information is downloaded, deleting the ith multimedia information and the related record stored in the cache area, and playing the downloaded ith multimedia information.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects: when the content of the current multimedia information is ready to be played, the current multimedia information stored in the cache region can be automatically deleted according to the identification of the current multimedia information, so that the current multimedia information can not be stored repeatedly, the space of the cache region is saved, the deletion task can be directly completed without manual operation of a user, the operation of the user is more convenient, and the user experience is improved.
In one embodiment, said determining whether said ith multimedia message has been downloaded based on said identification of said ith multimedia message comprises:
when the corresponding relation between the stored identification and the downloaded multimedia information exists in the downloaded multimedia information corresponding to the identification of the ith multimedia information, determining that the ith multimedia information is downloaded, and taking the corresponding downloaded multimedia information as the downloaded ith multimedia information;
and when the downloaded multimedia information corresponding to the identifier of the ith multimedia information does not exist in the corresponding relation, determining that the ith multimedia information is not downloaded.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects: and determining whether the ith multimedia information is downloaded according to whether the downloaded multimedia information corresponding to the ith multimedia information is stored, thereby ensuring the realizability of deleting the cache.
In one embodiment, before obtaining the identification of the ith multimedia information, the method further includes:
and when the (i-1) th multimedia information is not downloaded, deleting the (i-1) th multimedia information and the related record stored in the cache area.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects: when one multimedia information is played, the multimedia information stored in the cache region is deleted, so that the purpose of saving the space of the cache region is achieved.
In one embodiment, the deleting the ith multimedia information and associated records stored in the buffer area comprises:
determining the playing times of the ith multimedia information;
when the playing times are less than the preset times, deleting the i-1 th multimedia information and the related records stored in the cache area;
and when the playing times are greater than or equal to the preset times, reserving the (i-1) th multimedia information and the related record stored in the cache region.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects: if a certain multimedia information is played for multiple times, and the playing times are more than or equal to the preset times, the user listens or watches in a circulating mode, so that the multimedia information needs to be downloaded repeatedly after the multimedia information is deleted repeatedly, a large number of tasks of the processor are occupied, and therefore the multimedia information stored in the cache area does not need to be deleted, and the burden of the processor is reduced.
In one embodiment, the method further comprises:
downloading the ith multimedia information as the downloaded ith multimedia information;
when the downloading of the ith multimedia information is finished, acquiring the identifier of the ith multimedia information according to the ith multimedia information;
determining whether the ith multimedia information stored in the cache region exists according to the identifier of the ith multimedia information;
and when the ith multimedia information stored in the buffer area exists, deleting the ith multimedia information stored in the buffer area.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects: after downloading a multimedia message, directly deleting the corresponding cache message, thus automatically deleting the cache message from the source, cleaning the cache region as early as possible and saving the space of the cache region.
According to a second aspect of the embodiments of the present disclosure, there is provided a cache cleaning apparatus, including:
the first obtaining module is used for obtaining the identifier of the ith multimedia information when the content of the ith multimedia information is ready to be played, wherein i is a positive integer greater than 1;
a first determining module, configured to determine whether the ith multimedia message has been downloaded according to the identifier of the ith multimedia message;
and the first deleting module is used for deleting the ith multimedia information and the related record stored in the cache area and playing the downloaded ith multimedia information when the ith multimedia information is downloaded.
In one embodiment, the first determining module comprises:
a first determining sub-module, configured to determine that the ith multimedia information is downloaded when there is downloaded multimedia information corresponding to the identifier of the ith multimedia information in a correspondence between the stored identifier and the downloaded multimedia information, and use the corresponding downloaded multimedia information as the downloaded ith multimedia information;
and the second determining submodule is used for determining that the ith multimedia information is not downloaded when the downloaded multimedia information corresponding to the identifier of the ith multimedia information does not exist in the corresponding relation.
In one embodiment, the apparatus further comprises:
and the second deleting module is used for deleting the (i-1) th multimedia information and the related record stored in the cache area when the (i-1) th multimedia information is not downloaded.
In one embodiment, the second deletion module comprises:
a third determining submodule, configured to determine a playing frequency of the ith multimedia information;
the processing submodule is used for deleting the (i-1) th multimedia information and related records stored in the cache area when the playing times are less than the preset times; and when the playing times are greater than or equal to the preset times, reserving the (i-1) th multimedia information and the related record stored in the cache region.
In one embodiment, the apparatus further comprises:
the downloading module is used for downloading the ith multimedia information as the downloaded ith multimedia information;
the second obtaining module is used for obtaining the identifier of the ith multimedia information according to the ith multimedia information when the downloading of the ith multimedia information is finished;
a second determining module, configured to determine whether an ith multimedia message stored in the cache region exists according to the identifier of the ith multimedia message;
the second deletion module is further to: and when the ith multimedia information stored in the buffer area exists, deleting the ith multimedia information stored in the buffer area.
According to a third aspect of the embodiments of the present disclosure, there is provided a cache cleaning apparatus, including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
when the content of the ith multimedia information is ready to be played, acquiring the identifier of the ith multimedia information, wherein i is a positive integer greater than 1;
determining whether the ith multimedia information is downloaded according to the identifier of the ith multimedia information;
and when the ith multimedia information is downloaded, deleting the ith multimedia information and the related record stored in the cache area, and playing the downloaded ith multimedia information.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
FIG. 1 is a flow diagram illustrating a cache scrubbing method in accordance with an exemplary embodiment.
FIG. 2 is a flow diagram illustrating a cache scrubbing method in accordance with an exemplary embodiment.
FIG. 3 is a flow diagram illustrating a method of cache scrubbing in accordance with an exemplary embodiment.
Fig. 4 is a schematic diagram illustrating a cache scrubbing apparatus according to an example embodiment.
Fig. 5 is a schematic diagram illustrating a cache scrubbing apparatus according to an example embodiment.
Fig. 6 is a schematic diagram illustrating a cache scrubbing apparatus according to an example embodiment.
Fig. 7 is a schematic diagram illustrating a cache scrubbing apparatus according to an example embodiment.
Fig. 8 is a schematic diagram illustrating a cache scrubbing apparatus according to an example embodiment.
FIG. 9 is a flowchart illustrating a cache scrubbing method according to an example embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
In the related art, multimedia information such as audio, video and the like has become a choice for people to entertain and live, people's feelings can be expressed by listening and watching audio, video and music through a mobile terminal, and more users listen to and change the multimedia information through the mobile terminal.
Taking music audio as an example, when a user listens to music through a mobile terminal, particularly when listening to music online, the user can automatically store the listened music audio into a local cache, and the user selects favorite music audio from the music audio to download the favorite music audio into a storage area of the mobile terminal, so that the mobile terminal stores two music audio, the cache space is occupied more, and if the user wants to delete the memory of the music audio, the user needs to manually search and delete the music audio.
The problem that this embodiment can solve does: when the content of the current multimedia information is ready to be played, the current multimedia information stored in the cache region can be automatically deleted according to the identification of the current multimedia information, so that the current multimedia information can not be stored repeatedly, the space of the cache region is saved, the deletion task can be directly completed without manual operation of a user, the operation of the user is more convenient, and the user experience is improved.
Example one
Fig. 1 is a flowchart illustrating a cache scrubbing method according to an exemplary embodiment, where the cache scrubbing method is used in a cache scrubbing apparatus, as shown in fig. 1, and includes the following steps 101 to 103:
in step 101, when the content of the ith multimedia message is ready to be played, the identifier of the ith multimedia message is obtained.
Here, i is a positive integer greater than 1. The multimedia information may be audio or video. Each multimedia message has its own unique identification, which may be, for example, an identification number (ID).
In step 102, it is determined whether the ith multimedia message has been downloaded according to the identifier of the ith multimedia message.
Here, the identifier and the downloaded multimedia information have a corresponding relationship, which may facilitate the device to find the corresponding downloaded multimedia information through the identifier.
In step 103, when the ith multimedia message is downloaded, the ith multimedia message and the related record stored in the buffer area are deleted, and the downloaded ith multimedia message is played.
Here, taking multimedia information as an example of audio, when a user selects music for trial listening, the device may buffer the audio of the music in the buffer area, and when the progress of the music exceeds the buffered progress, the music for trial listening may stop, and some audio of the music may have been downloaded, so that some music may have both the buffered audio stored in the buffer area and the downloaded audio. In order to save space, the buffered audio is deleted, and at the same time, the corresponding relation and the related record of the buffered audio are deleted.
In the embodiment, when the content of the current multimedia information is ready to be played, the current multimedia information stored in the cache region can be automatically deleted according to the identifier of the current multimedia information, so that the current multimedia information is prevented from being stored repeatedly, the space of the cache region is saved, the deletion task can be directly completed without manual operation of a user, the operation of the user is more convenient, and the user experience is improved.
In one embodiment, step 102 may comprise:
when the corresponding relation between the stored identification and the downloaded multimedia information exists in the downloaded multimedia information corresponding to the identification of the ith multimedia information, determining that the ith multimedia information is downloaded, and taking the corresponding downloaded multimedia information as the downloaded ith multimedia information; and when the downloaded multimedia information corresponding to the identifier of the ith multimedia information does not exist in the corresponding relation, determining that the ith multimedia information is not downloaded.
In this embodiment, it is determined whether multimedia information has been downloaded only through the correspondence, and similarly, it is also possible to determine whether ith multimedia information exists or not according to whether two pieces of ith multimedia information exist in the device or whether a non-cache area is searched for. The scheme of the present embodiment is not limited thereto.
In one embodiment, prior to step 101, the method further comprises:
when the (i-1) th multimedia information is not downloaded, the (i-1) th multimedia information and the related record stored in the buffer area are deleted.
Here, when playing the next multimedia information, the last multimedia information and related record stored in the buffer area can be deleted, further saving the space of the buffer area.
Taking the trial listening of music as an example, good listening can be downloaded, bad listening can not be repeated, a large amount of music can be cached due to the fact that playing is carried out, particularly, under the WiFi mode (free traffic can be used), the next song is played, the cache of the previous song is cleared, and the space of the mobile phone can be saved.
In one embodiment, the deleting the ith multimedia information and associated records stored in the buffer area comprises:
determining the playing times of the ith multimedia information; when the playing times are less than the preset times, deleting the (i-1) th multimedia information and related records stored in the cache area; and when the playing times are more than or equal to the preset times, reserving the (i-1) th multimedia information and the related record stored in the buffer area.
In one embodiment, the method further comprises:
downloading the ith multimedia information as the downloaded ith multimedia information; when the downloading of the ith multimedia information is finished, acquiring the identifier of the ith multimedia information according to the ith multimedia information; determining whether the ith multimedia information stored in the cache region exists according to the identifier of the ith multimedia information; and when the ith multimedia information stored in the buffer area exists, deleting the ith multimedia information stored in the buffer area.
Similarly, a corresponding relationship between the representation and the multimedia information of the cache region needs to be established, and the corresponding relationship can be stored in the database of the cache region.
Here, an interface switch may be set in the application for playing the multimedia information, and the user may determine whether to start the cache cleaning function by whether to start the switch, and similarly, the device may determine by itself, and may acquire the flow package of the user, and may start the function if the flow package is an unlimited flow package, and may also start the function if the flow package is in a WiFi environment.
Example two
Fig. 2 is a flowchart illustrating a cache cleaning method according to an exemplary embodiment, where the cache cleaning method is used in a mobile terminal, as shown in fig. 2, and includes the following steps 201-203,
in step 201, when the content of the ith multimedia message is ready to be played, it is determined whether the (i-1) th multimedia message has been downloaded. If yes, go to step 203; if not, go to step 202.
Here, i is a positive integer greater than 1. The present embodiment assumes that the ith multimedia information is stored in the buffer area.
In step 202, the i-1 th multimedia information stored in the buffer area is deleted.
In step 203, the ith multimedia message is played according to the ith multimedia message stored in the buffer area.
In this embodiment, when one multimedia message is played, the multimedia message stored in the buffer area is deleted, so as to achieve the purpose of saving the space of the buffer area.
EXAMPLE III
Fig. 3 is a flowchart illustrating a cache scrubbing method according to an exemplary embodiment, which is used in a mobile terminal, as shown in fig. 3, and includes the following steps 301-305,
in step 301, a download instruction of a user is received, where the download instruction is used to instruct downloading of the ith multimedia information.
In step 302, the ith multimedia message is downloaded as the downloaded ith multimedia message according to the download instruction.
In step 303, when the downloading of the ith multimedia message is completed, the identifier of the ith multimedia message is obtained according to the ith multimedia message.
In step 304, it is determined whether the ith multimedia message stored in the buffer area exists according to the identification of the ith multimedia message. If yes, go to step 304; if not, the process is ended.
In step 305, when the ith multimedia information stored in the buffer area exists, the ith multimedia information stored in the buffer area is deleted.
In one embodiment, after a multimedia message is downloaded, the corresponding cache message is deleted directly, so that the cache message is automatically deleted from the source, the cache region is cleaned as early as possible, and the space of the cache region is saved.
The following are embodiments of the disclosed apparatus that may be used to perform embodiments of the disclosed methods.
Example four
Fig. 4 is a block diagram illustrating a cache scrubbing apparatus that may be implemented as part or all of an electronic device via software, hardware, or a combination of both, according to an example embodiment. As shown in fig. 4, the cache cleaning apparatus includes:
a first obtaining module 401, configured to obtain an identifier of an ith multimedia message when content of the ith multimedia message is ready to be played, where i is a positive integer greater than 1.
A first determining module 402, configured to determine whether the ith multimedia message has been downloaded according to the identifier of the ith multimedia message.
A first deleting module 403, configured to delete the ith multimedia message and the related record stored in the cache area when the ith multimedia message is downloaded, and play the downloaded ith multimedia message.
In this embodiment, when the content of the current multimedia information is ready to be played, the current multimedia information stored in the cache region can be automatically deleted according to the identifier of the current multimedia information, so that the current multimedia information is prevented from being stored repeatedly, the space of the cache region is saved, the deletion task can be directly completed without manual operation of a user, the operation of the user is more convenient, and the user experience is improved.
In one embodiment, as shown in fig. 5, the first determining module 402 comprises:
a first determining sub-module 4021, configured to determine that the ith multimedia information is downloaded when there is downloaded multimedia information corresponding to the identifier of the ith multimedia information in a correspondence relationship between the stored identifier and the downloaded multimedia information, and use the corresponding downloaded multimedia information as the downloaded ith multimedia information;
the second determining sub-module 4022 is configured to determine that the ith multimedia information is not downloaded when there is no downloaded multimedia information corresponding to the identifier of the ith multimedia information in the correspondence relationship.
In this embodiment, whether the ith multimedia message is downloaded is determined according to whether the downloaded multimedia message corresponding to the ith multimedia message is stored, so that the realizability of deleting the cache is ensured.
In one embodiment, as shown in fig. 6, the apparatus further comprises:
a second deleting module 404, configured to delete the i-1 th multimedia information and the related record stored in the buffer area when the i-1 th multimedia information is not downloaded.
In this embodiment, when one multimedia message is played, the multimedia message stored in the buffer area is deleted, so as to achieve the purpose of saving the space of the buffer area.
In one embodiment, as shown in fig. 7, the second deleting module 404 includes:
a third determining sub-module 4041, configured to determine the number of times of playing the ith multimedia message;
the processing submodule 4042 is configured to delete the i-1 th multimedia information and the related record stored in the cache region when the playing time is smaller than the preset time; and when the playing times are greater than or equal to the preset times, reserving the (i-1) th multimedia information and the related record stored in the cache region.
In this embodiment, if a certain multimedia message is played for a plurality of times, and the playing number is greater than or equal to the preset number, it indicates that the user is listening or watching in a loop, so that after the multimedia message is deleted repeatedly, the multimedia message is downloaded repeatedly, which will occupy a large amount of tasks of the processor, and therefore, the multimedia message stored in the buffer area may not be deleted, thereby reducing the burden on the processor.
In one embodiment, as shown in fig. 8, the apparatus further comprises:
a downloading module 405, configured to download the ith multimedia message as the downloaded ith multimedia message.
A second obtaining module 406, configured to obtain, according to the ith multimedia message, an identifier of the ith multimedia message when the downloading of the ith multimedia message is completed.
A second determining module 407, configured to determine whether the ith multimedia message stored in the buffer area exists according to the identifier of the ith multimedia message.
The second deleting module 404 is further configured to: and when the ith multimedia information stored in the buffer area exists, deleting the ith multimedia information stored in the buffer area.
In one embodiment, after a multimedia message is downloaded, the corresponding cache message is deleted directly, so that the cache message is automatically deleted from the source, the cache region is cleaned as early as possible, and the space of the cache region is saved.
According to a third aspect of the embodiments of the present disclosure, there is provided a cache cleaning apparatus, including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
when the content of the ith multimedia information is ready to be played, acquiring the identifier of the ith multimedia information, wherein i is a positive integer greater than 1;
determining whether the ith multimedia information is downloaded according to the identifier of the ith multimedia information;
and when the ith multimedia information is downloaded, deleting the ith multimedia information and the related record stored in the cache area, and playing the downloaded ith multimedia information.
The processor may be further configured to:
the determining whether the ith multimedia message is downloaded according to the identifier of the ith multimedia message includes:
when the corresponding relation between the stored identification and the downloaded multimedia information exists in the downloaded multimedia information corresponding to the identification of the ith multimedia information, determining that the ith multimedia information is downloaded, and taking the corresponding downloaded multimedia information as the downloaded ith multimedia information;
and when the downloaded multimedia information corresponding to the identifier of the ith multimedia information does not exist in the corresponding relation, determining that the ith multimedia information is not downloaded.
Before obtaining the identifier of the ith multimedia information, the method further includes:
and when the (i-1) th multimedia information is not downloaded, deleting the (i-1) th multimedia information and the related record stored in the cache area.
The deleting the ith multimedia information and the related record stored in the buffer area comprises:
determining the playing times of the ith multimedia information;
when the playing times are less than the preset times, deleting the i-1 th multimedia information and the related records stored in the cache area;
and when the playing times are greater than or equal to the preset times, reserving the (i-1) th multimedia information and the related record stored in the cache region.
The method further comprises the following steps:
downloading the ith multimedia information as the downloaded ith multimedia information;
when the downloading of the ith multimedia information is finished, acquiring the identifier of the ith multimedia information according to the ith multimedia information;
determining whether the ith multimedia information stored in the cache region exists according to the identifier of the ith multimedia information;
and when the ith multimedia information stored in the buffer area exists, deleting the ith multimedia information stored in the buffer area.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Fig. 9 is a block diagram illustrating an apparatus for cache scrubbing, which is suitable for use in a terminal device, according to an example embodiment. For example, the apparatus 500 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
The apparatus 500 may include one or more of the following components: processing component 502, memory 504, power component 506, multimedia component 508, audio component 510, input/output (I/O) interface 512, sensor component 514, and communication component 516.
The processing component 502 generally controls overall operation of the device 500, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing components 502 may include one or more processors 520 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 502 can include one or more modules that facilitate interaction between the processing component 502 and other components. For example, the processing component 502 can include a multimedia module to facilitate interaction between the multimedia component 508 and the processing component 502.
The memory 504 is configured to store various types of data to support operations at the apparatus 500. Examples of such data include instructions for any application or method operating on device 500, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 504 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The power supply component 506 provides power to the various components of the device 500. The power components 506 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the apparatus 500.
The multimedia component 508 includes a screen that provides an output interface between the device 500 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 an input signal from a 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 boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 508 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the device 500 is in an operating mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 510 is configured to output and/or input audio signals. For example, audio component 510 includes a Microphone (MIC) configured to receive external audio signals when apparatus 500 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 504 or transmitted via the communication component 516. In some embodiments, audio component 510 further includes a speaker for outputting audio signals.
The I/O interface 512 provides an interface between the processing component 502 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 514 includes one or more sensors for providing various aspects of status assessment for the device 500. For example, the sensor assembly 514 may detect an open/closed state of the apparatus 500, the relative positioning of the components, such as a display and keypad of the apparatus 500, the sensor assembly 514 may also detect a change in the position of the apparatus 500 or a component of the apparatus 500, the presence or absence of user contact with the apparatus 500, orientation or acceleration/deceleration of the apparatus 500, and a change in the temperature of the apparatus 500. The sensor assembly 514 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 514 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 514 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 516 is configured to facilitate communication between the apparatus 500 and other devices in a wired or wireless manner. The apparatus 500 may 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 516 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 516 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 500 may 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, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer-readable storage medium comprising instructions, such as the memory 504 comprising instructions, executable by the processor 520 of the apparatus 500 to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
A non-transitory computer readable storage medium, wherein instructions, when executed by a processor of an apparatus 500, enable the apparatus 500 to perform the above cache scrubbing method, the method comprising:
when the content of the ith multimedia information is ready to be played, acquiring the identifier of the ith multimedia information, wherein i is a positive integer greater than 1;
determining whether the ith multimedia information is downloaded according to the identifier of the ith multimedia information;
and when the ith multimedia information is downloaded, deleting the ith multimedia information and the related record stored in the cache area, and playing the downloaded ith multimedia information.
The determining whether the ith multimedia message is downloaded according to the identifier of the ith multimedia message includes:
when the corresponding relation between the stored identification and the downloaded multimedia information exists in the downloaded multimedia information corresponding to the identification of the ith multimedia information, determining that the ith multimedia information is downloaded, and taking the corresponding downloaded multimedia information as the downloaded ith multimedia information;
and when the downloaded multimedia information corresponding to the identifier of the ith multimedia information does not exist in the corresponding relation, determining that the ith multimedia information is not downloaded.
Before obtaining the identifier of the ith multimedia information, the method further includes:
and when the (i-1) th multimedia information is not downloaded, deleting the (i-1) th multimedia information and the related record stored in the cache area.
The deleting the ith multimedia information and the related record stored in the buffer area comprises:
determining the playing times of the ith multimedia information;
when the playing times are less than the preset times, deleting the i-1 th multimedia information and the related records stored in the cache area;
and when the playing times are greater than or equal to the preset times, reserving the (i-1) th multimedia information and the related record stored in the cache region.
The method further comprises the following steps:
downloading the ith multimedia information as the downloaded ith multimedia information;
when the downloading of the ith multimedia information is finished, acquiring the identifier of the ith multimedia information according to the ith multimedia information;
determining whether the ith multimedia information stored in the cache region exists according to the identifier of the ith multimedia information;
and when the ith multimedia information stored in the buffer area exists, deleting the ith multimedia information stored in the buffer area.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements 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 disclosure is limited only by the appended claims.
Claims (10)
1. A cache scrubbing method, comprising:
when the content of the ith multimedia information is ready to be played, acquiring the identifier of the ith multimedia information, wherein i is a positive integer greater than 1; the multimedia information includes: audio or video;
determining whether the ith multimedia information is downloaded according to the identifier of the ith multimedia information;
when the ith multimedia information is downloaded, deleting the ith multimedia information and related records stored in the cache area, and playing the downloaded ith multimedia information;
before obtaining the identifier of the ith multimedia information, the method further includes:
and when the (i-1) th multimedia information is not downloaded, deleting the (i-1) th multimedia information and the related record stored in the cache area.
2. The method of claim 1, wherein said determining whether the ith multimedia message has been downloaded based on the identity of the ith multimedia message comprises:
when the corresponding relation between the stored identification and the downloaded multimedia information exists in the downloaded multimedia information corresponding to the identification of the ith multimedia information, determining that the ith multimedia information is downloaded, and taking the corresponding downloaded multimedia information as the downloaded ith multimedia information;
and when the downloaded multimedia information corresponding to the identifier of the ith multimedia information does not exist in the corresponding relation, determining that the ith multimedia information is not downloaded.
3. The method of claim 1, wherein deleting the ith multimedia information and associated records stored in the buffer area comprises:
determining the playing times of the ith multimedia information;
when the playing times are less than the preset times, deleting the ith multimedia information and the related records stored in the cache region;
and when the playing times are greater than or equal to the preset times, reserving the ith multimedia information and the related records stored in the cache region.
4. The method according to any one of claims 1 to 3, further comprising:
downloading the ith multimedia information as the downloaded ith multimedia information;
when the downloading of the ith multimedia information is finished, acquiring the identifier of the ith multimedia information according to the ith multimedia information;
determining whether the ith multimedia information stored in the cache region exists according to the identifier of the ith multimedia information;
and when the ith multimedia information stored in the buffer area exists, deleting the ith multimedia information stored in the buffer area.
5. A cache flush apparatus, comprising:
the first obtaining module is used for obtaining the identifier of the ith multimedia information when the content of the ith multimedia information is ready to be played, wherein i is a positive integer greater than 1; the multimedia information includes: audio or video;
a first determining module, configured to determine whether the ith multimedia message has been downloaded according to the identifier of the ith multimedia message;
the first deleting module is used for deleting the ith multimedia information and the related records stored in the cache area and playing the downloaded ith multimedia information when the ith multimedia information is downloaded;
the device further comprises:
and the second deleting module is used for deleting the (i-1) th multimedia information and the related record stored in the cache area when the (i-1) th multimedia information is not downloaded.
6. The apparatus of claim 5, wherein the first determining module comprises:
a first determining sub-module, configured to determine that the ith multimedia information is downloaded when there is downloaded multimedia information corresponding to the identifier of the ith multimedia information in a correspondence between the stored identifier and the downloaded multimedia information, and use the corresponding downloaded multimedia information as the downloaded ith multimedia information;
and the second determining submodule is used for determining that the ith multimedia information is not downloaded when the downloaded multimedia information corresponding to the identifier of the ith multimedia information does not exist in the corresponding relation.
7. The apparatus of claim 5, wherein the second deletion module comprises:
a third determining submodule, configured to determine a playing frequency of the ith multimedia information;
the processing submodule is used for deleting the ith multimedia information and the related records stored in the cache area when the playing times are less than the preset times; and when the playing times are greater than or equal to the preset times, reserving the ith multimedia information and the related records stored in the cache region.
8. The apparatus of any one of claims 5 to 7, further comprising:
the downloading module is used for downloading the ith multimedia information as the downloaded ith multimedia information;
the second obtaining module is used for obtaining the identifier of the ith multimedia information according to the ith multimedia information when the downloading of the ith multimedia information is finished;
a second determining module, configured to determine whether an ith multimedia message stored in the cache region exists according to the identifier of the ith multimedia message;
the second deletion module is further to: and when the ith multimedia information stored in the buffer area exists, deleting the ith multimedia information stored in the buffer area.
9. A cache flush apparatus, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
when the content of the ith multimedia information is ready to be played, acquiring the identifier of the ith multimedia information, wherein i is a positive integer greater than 1; the multimedia information includes: audio or video;
determining whether the ith multimedia information is downloaded according to the identifier of the ith multimedia information;
when the ith multimedia information is downloaded, deleting the ith multimedia information and related records stored in the cache area, and playing the downloaded ith multimedia information;
prior to said obtaining the identity of the ith multimedia information, the processor is further configured to:
and when the (i-1) th multimedia information is not downloaded, deleting the (i-1) th multimedia information and the related record stored in the cache area.
10. A computer-readable storage medium having stored thereon computer instructions, which when executed by a processor, perform the steps of the method of any one of claims 1 to 4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610959806.2A CN106528442B (en) | 2016-10-27 | 2016-10-27 | Cache cleaning method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610959806.2A CN106528442B (en) | 2016-10-27 | 2016-10-27 | Cache cleaning method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106528442A CN106528442A (en) | 2017-03-22 |
CN106528442B true CN106528442B (en) | 2020-06-02 |
Family
ID=58326746
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610959806.2A Active CN106528442B (en) | 2016-10-27 | 2016-10-27 | Cache cleaning method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106528442B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107273453B (en) * | 2017-05-31 | 2020-05-12 | Oppo广东移动通信有限公司 | Music playing method, terminal and storage medium |
CN109995836B (en) * | 2017-12-29 | 2021-12-03 | 华为技术有限公司 | Cache decision method and device |
CN109918348B (en) * | 2019-03-26 | 2023-09-19 | 努比亚技术有限公司 | Cleaning method, terminal and computer readable storage medium for application browsing record |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101674370A (en) * | 2009-10-12 | 2010-03-17 | 深圳市五巨科技有限公司 | Audio file audition downloading method and device for mobile terminal |
CN104428744A (en) * | 2014-05-19 | 2015-03-18 | 华为技术有限公司 | Multi-media displaying method, apparatus and equipment |
CN104602223A (en) * | 2014-12-26 | 2015-05-06 | 北京奇虎科技有限公司 | Downloading method and device for audio file of mobile terminal |
CN105430478A (en) * | 2015-11-27 | 2016-03-23 | 青岛海信电器股份有限公司 | Network video buffer play method and device, and television |
CN106021129A (en) * | 2016-04-29 | 2016-10-12 | 努比亚技术有限公司 | Terminal and terminal cache clearing method |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7801964B2 (en) * | 2003-02-14 | 2010-09-21 | Whale Communications Ltd. | System and method for providing conditional access to server-based applications from remote access devices |
CN104243403B (en) * | 2013-06-08 | 2018-09-21 | 华为终端有限公司 | A kind of method and apparatus for supporting to play online |
CN104239157B (en) * | 2014-08-19 | 2017-05-03 | 北京奇虎科技有限公司 | Method and device for optimizing and cleaning data of mobile terminal |
CN105786997A (en) * | 2016-02-19 | 2016-07-20 | 四川长虹电器股份有限公司 | IOS-system-based image caching and compression method |
-
2016
- 2016-10-27 CN CN201610959806.2A patent/CN106528442B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101674370A (en) * | 2009-10-12 | 2010-03-17 | 深圳市五巨科技有限公司 | Audio file audition downloading method and device for mobile terminal |
CN104428744A (en) * | 2014-05-19 | 2015-03-18 | 华为技术有限公司 | Multi-media displaying method, apparatus and equipment |
CN104602223A (en) * | 2014-12-26 | 2015-05-06 | 北京奇虎科技有限公司 | Downloading method and device for audio file of mobile terminal |
CN105430478A (en) * | 2015-11-27 | 2016-03-23 | 青岛海信电器股份有限公司 | Network video buffer play method and device, and television |
CN106021129A (en) * | 2016-04-29 | 2016-10-12 | 努比亚技术有限公司 | Terminal and terminal cache clearing method |
Also Published As
Publication number | Publication date |
---|---|
CN106528442A (en) | 2017-03-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10282561B2 (en) | Method and apparatus for managing application | |
CN111246283B (en) | Video playing method and device, electronic equipment and storage medium | |
US9654621B2 (en) | Methods and devices for prompting calling request | |
CN105898032B (en) | method and device for adjusting prompt tone | |
CN107743244B (en) | Video live broadcasting method and device | |
US11457437B2 (en) | Method and apparatus for configuring information, base station and user equipment | |
US20220291897A1 (en) | Method and device for playing voice, electronic device, and storage medium | |
CN106792173B (en) | Video playing method and device and non-transitory computer readable storage medium | |
CN104618218A (en) | Information reminding method and device | |
CN104539812B (en) | Recommendation information acquisition methods, terminal and server | |
CN105282809A (en) | Network model switching method and apparatus, and terminal equipment | |
CN105407433A (en) | Method and device for controlling sound output equipment | |
CN113613082A (en) | Video playing method and device, electronic equipment and storage medium | |
CN107272896B (en) | Method and device for switching between VR mode and non-VR mode | |
CN104835516A (en) | Music playing method and apparatus, and intelligent terminal | |
CN109246184A (en) | A kind of temporal information acquisition methods, device and readable storage medium storing program for executing | |
CN106528442B (en) | Cache cleaning method and device | |
CN108984098B (en) | Information display control method and device based on social software | |
CN105511739A (en) | Message prompting method and device | |
CN105049763A (en) | Method and device for triggering projection | |
CN107247794B (en) | Topic guiding method in live broadcast, live broadcast device and terminal equipment | |
CN114422854B (en) | Data processing method, device, electronic device and storage medium | |
CN104360875A (en) | Private mode starting method and device | |
CN113691872A (en) | Live broadcast task allocation method and device, electronic equipment and storage medium | |
CN106034214A (en) | Video data recording method and apparatus thereof |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |