The present invention relates to the computer technology, and more particularly, to an image management method, mobile terminal and computer storage medium.
With the development of mobile internet, the mobile internet has been accepted by more and more internet users, and becomes one of essential ways to access internet for most users. Mobile internet has been widely used not only in user's daily leisure and entertainment, but also in the work.
The internet-connected device, mobile terminals such as mobile phone and tablet computer are used frequently by mobile internet users. Users can send or receive images through mobile phone and tablet computer. However, due to the little memory space used for image processing in these mobile terminals, errors often occur when the user manipulates the image, making the manipulation inefficient.
Therefore, there is a need to provide an image management method which can save memory space.
Furthermore, there is also a need to provide a mobile terminal which can save memory space.
Still further, there is also a need to provide a computer storage medium which can save memory space.
An image management method, includes:
A mobile terminal, includes:
A computer storage medium with computer-executable instructions stored to control a computer to execute an image management method, the method includes:
According to the method, mobile terminal and computer storage medium, the free memory size of the memory space is determined if less than the threshold in the process of getting images, if yes, the memory space is released. In this way, the memory space could be saved so as to provide enough space for the image processing, which reduces the incidence of errors and improves the efficiency of manipulating the image.
Step S10, receiving images. In this embodiment, during the process of image sending and receiving manipulation, receive the image sent from other users, and obtain the identification assigned to the received image. The identification can give the image a unique identifier, which could be assigned uniformly by the backend server. For example, the image identification could be unique information such as identification code and identification name. For instance, when other users click “Send” button to send out the image which could be obtained through photographing or selected from locally stored images, receive the image as well as the identification assigned to the image.
Step S30, caching the received images to a memory space. In this embodiment, take the image identification as the index and cache the received images to a memory space. Furthermore, identification code could also be taken as the key value or name of the images cached to memory space. In Step S30, receive the image information, including encoding/decoding format, size, storage space, compression ratio and generated time of the image. Then cache the received images as well as their information to the memory space.
Step S50, determining if free memory size of the memory space is less than the threshold, if yes, go to Step S70. In this embodiment, query whether the situation that free space of memory is not enough occurs, i.e., detect the usage of memory space. When free memory size of the memory space is less than the set threshold, consider that the situation of insufficient memory occurs.
In an embodiment, the specific procedure of Step S50 is: detect the memory space allocated for image processing and the overall memory usage, when free memory size of the memory space is less than the threshold, consider that the situation of insufficient memory occurs. In another embodiment, the specific procedure of Step S50 is: detect the trigger event of image processing manipulation, such as displaying, saving, editing, deleting, optimizing and sending/receiving of the image; obtain the memory space allocated for image processing and the overall memory usage when the event of image processing manipulation happens; when free memory size of the memory space is less than the set threshold, consider that the situation of insufficient memory occurs.
Step S70, releasing the memory space. In this embodiment, when memory doesn't have enough space, there is a need to release the image cached to memory and extend the free memory.
In a preferred embodiment, when the memory doesn't have enough space, release the memory space occupied by the image with the least access. Specifically, the procedure of releasing the memory space is: calculate the weight of each image cached to the memory space according to its access status and size; compare all the images' weights to obtain an image with the minimum weight; delete an image with the minimum weight.
The access status of the image includes number N of user's view, time T for user's last view and so on. Assign weight W for the image saved in memory space, comprising the following parts: number N of user's view, time T for user's last view, image size S. Every time caching the image to memory space or the manipulation of viewing image triggered by user, one or a few value of the above parts comprising the weight would be changed. The weight W is calculated by the following formula:
W=a*N−b*(t−T)+c*S
Wherein, a, b and c are constants obtained based on experience; t is the current time.
Compare all the images' weights in the memory space, and image with the minimum weight is the image accessed the least.
In another embodiment of the invention, after caching the received images to the memory space, the method further includes: saving the image in memory space to local disk. In this embodiment, the image is saved to local disk at regular time in order to release the memory space. Furthermore, the user could also save the image to local disk manually when viewing the image.
In other embodiments of the invention, after receiving the images, the method includes: returning the image identification. In this embodiment, return the identification assigned to the image to user sending the image, and notify the user whether the image has been sent out successfully.
In Step S201, respond to a user action, determining whether the manipulated image exists according to the image identification, if yes, go to Step S203, if not, go to Step S205. In this embodiment, the user triggers the manipulation of viewing image. At this moment, firstly, determine whether the manipulated image exists, if yes, there is no need to initiate a request to receive the image through internet, only need to search and display the manipulated image, if not, then initiate a request to receive the image through internet.
In Step S203, search and display the manipulated image. In Step S205, receive the image as well as the identification assigned to the image.
In Embodiment 3,
In Step S301, determine whether the manipulated image exists in files cached to the memory space according to the image identification, if yes, go to Step S305, if not, go to Step S303. In this embodiment, the files cached to memory space are saved by taking the image identification as the index. Determine whether there is a image with the same identification exists in memory space according to the image identification, if yes, search the manipulated image in memory space, refresh and display the image, if not, then query whether the manipulated image exists in local disk.
In Step S303, determine whether the manipulated image exists in local disk, if yes, go to Step S305, if not, go to Step S307. In this embodiment, determine whether the manipulated image exists in local files according to the image identification, if yes, search image with the same identification in local disk, refresh and display the image, if not, then request to receive the manipulated image as well as the identification assigned to the image.
In Step S305, search and display the manipulated image.
In Step S307, request to receive the manipulated image as well as the identification assigned to the image.
Furthermore, in Embodiment 4, it is also necessary to provide a mobile terminal. As shown in
Receiving module 10 is configured to receive images. In this embodiment, receiving module 10 receives the identification assigned to the received image. The identification can give the image a unique identifier, for example, the image identification could be unique information such as identification code and identification name. When other users click “Send” button to send out the image which could be obtained through photographing or selected from locally stored images, the server receives the image and assigns corresponding identification for the image.
The memory space 30 is configured to cache the received images. In this embodiment, the memory space 30 takes the image identification as the index and cache the received image. Furthermore, the identification code could also be taken as the key value or name of the image cached to memory space. When the image is saved, the image information is saved as well, which includes encoding/decoding format, size, storage space, compression ratio and generated time of the image. Then the received image as well as its information is cached to the memory space 30.
The memory control module 50 is configured to determine if free memory size of the memory space is less than the threshold, if yes, releases the memory space. The memory control module 50 queries whether the situation of insufficient memory occurs, i.e., detects the usage of memory space. The situation of insufficient memory is considered to occur when the unused memory space 30 is less than the set threshold.
In an embodiment, the memory control module 50 detects the memory space allocated for image processing and the overall memory usage. When the free memory size is less than the threshold, the situation of insufficient memory is considered to occur. Besides, in another embodiment, the memory control module 50 is configured to detect the trigger event of image processing manipulation, such as displaying, saving, editing, deleting, optimizing and sending/receiving of the image; obtain the memory space allocated for image processing and the overall memory usage when the event of image processing manipulation happens; when the free memory size is less than the set threshold, consider that the situation of insufficient memory occurs.
When the memory doesn't have enough space, the memory control module 50 releases the memory space occupied by the image with the least access. Specifically, the memory control module 50 calculates the weight of every image cached to the memory space 30 according to its access status and size; compares all the images' weights to obtain an image with the minimum weight; deletes an image with the minimum weight. The access status of the image includes number N of user's view, time T for user's last view, etc.
The memory control module 50 assigns weight W for the image saved in the memory space 30, comprising the following parts: number N of user's view, time T for user's last view, image size S. Every time the image is cached to memory space or the manipulation of viewing image is triggered by user, one or a few value of the above parts comprising the weight would be changed. The weight W is calculated by the following formula:
W=a*N−b*(t−T)+c*S
Wherein, a, b and c are constants obtained based on experience; t is the current time.
Compare all the images' weights in the memory space 30, and image with the minimum weight is the image accessed the least.
In another embodiment of the invention, the mobile terminal 30 further includes a local storage module configured to save the image in memory space to local disk. In this embodiment, the local storage module saves the image in the memory space 30 to local disk at regular time, in order to release the image cached to the memory space 30. Furthermore, the user could also save the image to local disk manually when viewing the image.
In other embodiments of the invention, the server returns the image identification to user sending the image. In this embodiment, the server returns the identification assigned to the image to user sending the image, and notify the user whether the image has been sent out successfully.
The query module 60 is configured to respond to a user action, determine whether the manipulated image exists according to the image identification, if yes, notify the refresh module 70, if not, notify the receiving module 10. In this embodiment, the user triggers the manipulation of viewing image. The query module 60 firstly responds to the user action, determines whether the manipulated image exists according to the image identification, if yes, there is no need to initiate a request to receive the image through internet, the refresh module 70 only needs to search and display the manipulated image, if not, the receiving module 10 only needs to initiate a request to receive the image through internet.
The refresh module 70 is configured to search and display the manipulated image.
The receiving module 10 is also configured to receive the identification assigned to the received image.
The cache file query unit 61 is configured to determine whether the manipulated image exists in files cached to the memory space according to the image identification, if yes, notify the refresh module, if not, notify the local disk query unit 63. In this embodiment, the cache file query unit 61 determines whether there is a image with the same identification existing in memory space according to the image identification, if yes, the refresh module 70 searches the manipulated image in the memory space 30, refreshes and displays the image, if not, then the local disk query unit 63 queries whether the manipulated image exists in local disk.
The local disk query unit 63 is configured to determine whether the manipulated image exists in local disk according to the image identification, if yes, notify the refresh module 70 to search and display the manipulated image, if not, notify the receiving module 10 to request to receive the manipulated image. In this embodiment, the local disk query unit 63 determines whether the manipulated image exists in local disk according to the image identification, if yes, the refresh module 70 searches image with the same identification in local disk, refreshes and displays the image, if not, requests to receive the manipulated image.
In the above image management method and mobile terminal, each image processed by the server would be assigned to a unique image identification by the server. When saving the received image to memory space, mobile terminal takes the identification as the key value or name of the image. Server searches the image needed to view in memory space through its identification, if there is not the image in the memory space, then searches the image in local disk according to the identification, if the server finds the same image in memory space, then it is the image that user needs to view.
When sending the image, the mobile terminal will receive image's identification code distributed by the server and get the notice about whether the image has been sent out successfully.
The invention also provides a computer storage medium with computer-executable instructions stored to control a computer to execute the above image management method, the specific steps of the image management method have been described in the above.
The image management method and system could be applied to mobile terminals, such as smart mobile phone, tablet computer and other mobile terminals with little memory space. Using the image management method and system, the client of mobile terminal could receive and display images.
According to the method, mobile terminal and computer storage medium, the free memory size is determined if less than the threshold in the process of getting image, if yes, the memory space is released. In this way, the memory space could be saved so as to provide enough for the image processing, which reduces the incidence of errors and improves the efficiency during manipulating the image.
It should be emphasized that the above-described embodiments of the present invention, are merely possible examples of implementations. Many variations and modifications may be made to the above-described embodiments of the invention without departing substantially from the spirit and principles of the invention. All such modifications and variations are intended to be included herein within the scope of this disclosure and the present invention and protected by the following claims.
Number | Date | Country | Kind |
---|---|---|---|
CN 201110028536.0 | Jan 2011 | CN | national |
This application is a continuation of International Application No. PCT/CN2011/083976, filed Dec. 14, 2011, which claims priority to Chinese Application No. CN 201110028536.0, filed Jan. 26, 2011, entitled IMAGE MANAGEMENT METHOD, MOBILE TERMINAL AND COMPUTER STORAGE MEDIUM, both of which are hereby being fully incorporated by reference.
Number | Date | Country | |
---|---|---|---|
Parent | PCT/CN2011/083976 | Dec 2011 | US |
Child | 13950690 | US |