CN107656699A - Picture call method and device - Google Patents

Picture call method and device Download PDF

Info

Publication number
CN107656699A
CN107656699A CN201710712580.0A CN201710712580A CN107656699A CN 107656699 A CN107656699 A CN 107656699A CN 201710712580 A CN201710712580 A CN 201710712580A CN 107656699 A CN107656699 A CN 107656699A
Authority
CN
China
Prior art keywords
memory
region
bitmap
picture set
picture
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.)
Granted
Application number
CN201710712580.0A
Other languages
Chinese (zh)
Other versions
CN107656699B (en
Inventor
王秀强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhiche Shanghai Industrial Co ltd
Original Assignee
Shanghai Car Sound Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Car Sound Intelligent Technology Co Ltd filed Critical Shanghai Car Sound Intelligent Technology Co Ltd
Priority to CN201710712580.0A priority Critical patent/CN107656699B/en
Publication of CN107656699A publication Critical patent/CN107656699A/en
Application granted granted Critical
Publication of CN107656699B publication Critical patent/CN107656699B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0614Improving the reliability of storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0643Management of files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/0652Erasing, e.g. deleting, data cleaning, moving of data to a wastebasket
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device

Abstract

The embodiments of the invention provide a kind of picture call method and device, this method to include:If detect need call picture set, from be locally stored it is middle extraction picture set, wherein, picture set includes an at least pictures;Whether memory size needed for detection picture set exceedes predetermined threshold;If it is not, then caching picture set into system specified memory region, application program is set to call picture set from system specified memory region;If so, then picture set is cached into the region of memory being pre-created;In region of memory, establishment and the one-to-one bitmap file of every pictures in picture set, so that application program calls bitmap file from region of memory;If monitoring closing application program, empty and releasing memory region, delete message bit pattern, wherein, message bit pattern is the information that is generated during establishment bitmap file.So as to solve the problems, such as that the system exception that possibility occurs reports an error, the stability of system is improved, and improve Consumer's Experience.

Description

Picture call method and device
Technical field
The present embodiments relate to the communications field, more particularly to a kind of picture call method and device.
Background technology
Currently, developing rapidly with mobile terminal, requirement of the people to the processing speed and stability of mobile terminal Also more and more higher.Prior art is improves the operating efficiency that picture calls, typically by the way of caching.Should specifically, working as When needing to use the picture of network side with program, mobile terminal stores picture to local, and the picture in being locally stored is entered Row is called, and in invoked procedure, picture is extracted and cached into internal memory by mobile terminal, then the picture in caching is applied to In application program, application program is again next time in use, still using the picture in caching.
But prior art is due to committed memory, therefore, it would be possible to cause internal memory to overflow (Out Of Memory, OOM) The problem of.To prevent the problem, scheme is usually used by prior art:Caching is periodically removed, that is, utilizes system source life side Method reclaims to picture.But after picture is recovered, the reference that program corresponds to the picture is not eliminated.Therefore, when Application program is according to reference, when calling the picture again, because the picture has been recovered, so, it will cause abnormal report an error. But if not reclaimed to picture, OOM problems can be caused.
Therefore, for that in the picture call method of prior art, due to scheme imperfection, Installed System Memory may be caused to overflow May either lead to system abnormity the problem of reporting an error, and not yet propose effective solution at present.
The content of the invention
The embodiment of the present invention provides a kind of picture call method, to solve in the picture call method of prior art, due to Scheme imperfection, Installed System Memory may be caused to overflow or may lead to system abnormity the problem of reporting an error.
In order to solve the above problems, the invention discloses a kind of picture call method, methods described includes:
If detect need call picture set, from be locally stored it is middle extraction picture set, wherein, wrapped in picture set Include an at least pictures;
Whether memory size needed for detection picture set exceedes predetermined threshold;
If it is not, then caching picture set into system specified memory region, make application program from system specified memory area Picture set is called in domain;
If so, then picture set is cached into the region of memory being pre-created;
In region of memory, establishment and the one-to-one bitmap file of every pictures in picture set, so that application program Bitmap file is called from region of memory;And
If monitoring closing application program, simultaneously releasing memory region is emptied, and, message bit pattern is deleted, wherein, bitmap The information that is generated when information is creates bitmap file.
According to another aspect of the present invention, there is provided a kind of picture calling device, described device include:
Extraction module, if for detect need call picture set, from be locally stored it is middle extraction picture set, its In, picture set includes an at least pictures;
Detection module, for detecting whether memory size needed for picture set exceedes predetermined threshold;
First cache module, for if it is not, then cache picture set into system specified memory region, making application program Picture set is called from system specified memory region;
Second caching is if so, then cache picture set into the region of memory being pre-created;
Creation module, in region of memory, create with picture set per the one-to-one bitmap file of pictures, So that application program calls bitmap file from region of memory;And
Release module, if for monitoring closing application program, simultaneously releasing memory region is emptied, and, delete bitmap Information, wherein, the information that is generated when message bit pattern is creates bitmap file.
Compared with prior art, the technical scheme in the present invention, by the way that the region of memory being pre-created is emptied simultaneously Release, so as to effectively prevent the generation of Installed System Memory overflow problem.And the present invention is led to during picture is called Cross and picture set and related resource are cached in special region of memory, it is data cached so as to not generated in local cache, and After picture use, the region of memory being pre-created is emptied and discharged, and deletes related message bit pattern, and then at it When its application program calls the picture once again, deleted region of memory will not be directed to, therefore, is ensureing picture calling On the premise of efficiency, the problem of possible system exception occurred reports an error is efficiently solved, improves the stability of system, and Improve Consumer's Experience.
Brief description of the drawings
In order to illustrate the technical solution of the embodiments of the present invention more clearly, below by institute in the description to the embodiment of the present invention The accompanying drawing needed to use is briefly described, it should be apparent that, drawings in the following description are only some implementations of the present invention Example, for those of ordinary skill in the art, without having to pay creative labor, can also be according to these accompanying drawings Obtain other accompanying drawings.
Fig. 1 is a kind of one of flow chart of picture call method of the embodiment of the present invention;
Fig. 2 is the two of the flow chart of a kind of picture call method of the embodiment of the present invention;
Fig. 3 is a kind of one of structured flowchart of picture calling device of the embodiment of the present invention;
Fig. 4 is the two of the structured flowchart of a kind of picture calling device of the embodiment of the present invention;
Fig. 5 is the three of the structured flowchart of a kind of picture calling device of the embodiment of the present invention;
Fig. 6 is the four of the structured flowchart of a kind of picture calling device of the embodiment of the present invention.
Embodiment
In order to facilitate the understanding of the purposes, features and advantages of the present invention, it is below in conjunction with the accompanying drawings and specific real Applying mode, the present invention is further detailed explanation.
Embodiment one
Reference picture 1, a kind of flow chart of picture call method of the embodiment of the present invention is shown, can specifically included following Step:
Step 101, if detect need call picture set, from be locally stored it is middle extraction picture set, wherein, picture Set includes an at least pictures.
Specifically, in an embodiment of the present invention, the method in the embodiment of the present invention can be applied to mobile terminal or other Equipment, such as:Flat board, PC etc..
By taking mobile terminal as an example, in one embodiment, if after user opens application program, it can be triggered by mobile terminal User instruction, with indicate application program be locally stored using mobile terminal in an at least pictures.Mobile terminal receives user After instruction, you can determine that current mobile terminal needs the picture set transferred.
In another embodiment, mobile terminal also can be automatic to trigger picture call flow according to rule set in advance. Illustrate:After operating personnel preset application program A startups, at least pictures being locally stored are transferred automatically.Then, move Dynamic terminal is after detecting that application program A starts, it is determined that is currently needed for an at least pictures described in calling.
Specifically, in an embodiment of the present invention, mobile terminal detect be currently needed for calling picture set when, then from The middle at least pictures for extracting and specifying are locally stored, to form picture set.
Step 102, whether memory size needed for detection picture set exceedes predetermined threshold.
Specifically, in an embodiment of the present invention, it is pre- whether memory size needed for mobile terminal detection picture set exceedes Determine threshold value.In an embodiment of the present invention, predetermined threshold can be by user according to the actual requirements, i.e. the factor such as equipment disposal ability is entered Row is set, and the present invention is not limited this.
Step 103, if it is not, then caching picture set into system specified memory region, application program is made to refer to from system Determine to call picture set in region of memory.
Specifically, in an embodiment of the present invention, if mobile terminal detect memory size needed for picture set not less than Predetermined threshold, then using the technical scheme in prior embodiment, i.e. picture set is cached to the internal memory specified to system In region, in follow-up processing procedure, application program can directly call the picture set from system specified memory region.
Step 104, if so, then caching picture set into the region of memory being pre-created.
Specifically, in an embodiment of the present invention, if mobile terminal detects that memory size needed for picture set exceedes in advance Determine threshold value, then cache picture set into the region of memory being pre-created.In an embodiment of the present invention, in mobile terminal System detectio to exist wait cache picture set (i.e. size more than predetermined threshold picture set) when, by the wound in internal memory Build one piece of region of memory.In one embodiment, system can be created when creating the region of memory according to the size of picture set Build region of memory.In another embodiment, operating personnel can set region of memory size in advance, then system is according to operating personnel Setting, create region of memory.In yet another embodiment, position of the region of memory in internal memory can be selected at random by system, The present invention is not limited this.
Step 105, in region of memory, establishment and the one-to-one bitmap file of every pictures in picture set, so that Application program calls bitmap file from region of memory.
Specifically, in an embodiment of the present invention, mobile terminal carries out follow-up operation in the region of memory of establishment, tool Body is:Mobile terminal creates and the one-to-one bitmap file of every pictures according to every pictures in picture set.The bitmap File can have specified format, such as:Drawable forms, so that application program can be directly from the region of memory being pre-created Middle calling bitmap file.
Step 106, if monitoring closing application program, simultaneously releasing memory region is emptied, and, message bit pattern is deleted, Wherein, the information that is generated when message bit pattern is creates bitmap file.
Specifically, in an embodiment of the present invention, mobile terminal monitors the state of application program in real time, if monitoring to apply Stop, then mobile terminal will empty the region of memory, i.e. the picture set in region of memory, bitmap file etc. are deleted Remove.Meanwhile mobile terminal also deletes the message bit pattern generated during to creating the bitmap file.The bitmap is believed Breath includes but is not limited to:Bitmap object, the bitmap object are used for adduction relationship of the identification application to the bitmap file.
Technical scheme in the embodiment of the present invention, by being emptied and being discharged the region of memory being pre-created, so as to The generation of Installed System Memory overflow problem can effectively be prevented.And the present invention is during picture is called, by by pictures Close and related resource is cached in special region of memory, it is data cached so as to not generated in local cache, and used in picture After, the region of memory being pre-created is emptied and discharges, and related message bit pattern is deleted, and then in other application program When calling the picture once again, deleted region of memory will not be directed to, therefore, is ensureing the premise of picture calling efficiency Under, the problem of possible system exception occurred reports an error is efficiently solved, improves the stability of system, and improve user Experience.
Embodiment two
Reference picture 2, a kind of flow chart of picture call method of the embodiment of the present invention is shown, can specifically included following Step:
Step 201, if detect need call picture set, from be locally stored it is middle extraction picture set.
Specifically, in an embodiment of the present invention, the method in the embodiment of the present invention can be applied to mobile terminal or other Equipment, such as:Flat board, PC etc..By taking mobile terminal as an example, in one embodiment, if after user opens application program, it can pass through Mobile terminal trigger user instruction, with indicate application program be locally stored using mobile terminal at least one.Mobile terminal After receiving user instruction, you can determine that current mobile terminal needs to transfer picture.
In another embodiment, mobile terminal also can be automatic to trigger picture call flow according to rule set in advance. Illustrate:It is automatic to transfer picture set after operating personnel preset application program A startups.Then, mobile terminal is detecting After application program A starts, it is determined that be currently needed for calling at least pictures in mobile terminal.
Specifically, mobile terminal detect need call mobile terminal in an at least pictures in the case of, the shifting Dynamic terminal foundation inquires about target storage space in being locally stored.The target storage space is used for storage resource file.At one In embodiment, inquiring about the mode of target storage space can be:Identification information according to memory space is searched.At another In embodiment, inquiring about the mode of target storage space can also be:Searched according to the content in memory space.In the present invention Embodiment in, resource file includes but is not limited to:The media class file such as picture, animation.
Mobile terminal extracts an at least pictures, and forms picture set.
Step 202, whether memory size needed for detection picture set exceedes predetermined threshold.
Specifically, in an embodiment of the present invention, it is pre- whether memory size needed for mobile terminal detection picture set exceedes Determine threshold value.If so, into step 203.If it is not, after can then being carried out according to the cache way in prior embodiment to picture Continuous processing.That is, picture set is cached in the region of memory specified to system, in follow-up processing procedure, application program The picture set can be directly called from system specified memory region.
In an embodiment of the present invention, predetermined threshold can be by user according to the actual requirements, i.e. the factor such as equipment disposal ability It is configured, the present invention is not limited this.
Step 203, picture set is cached into the region of memory being pre-created.
Specifically, in an embodiment of the present invention, if mobile terminal detects that memory size needed for picture set exceedes in advance Determine threshold value, then cache picture set into the region of memory being pre-created.In an embodiment of the present invention, in mobile terminal System detectio to exist wait cache picture set (i.e. size more than predetermined threshold picture set) when, by the wound in internal memory Build one piece of region of memory.In one embodiment, system can be created when creating the region of memory according to the size of picture set Build region of memory.In another embodiment, operating personnel can set region of memory size in advance, then system is according to operating personnel Setting, create region of memory.In yet another embodiment, position of the region of memory in internal memory can be selected at random by system, The present invention is not limited this.
Step 204, according to picture set, at least one intermediate bitmap file is created.
Specifically, in an embodiment of the present invention, mobile terminal can create every according to each pictures in picture set The one-to-one intermediate bitmap file of one pictures.The intermediate bitmap file can be generated by following sentence:
Bitmap bmp=BitmapFactory.decodeResource (res, R.drawable.test)
Step 205, at least one bitmap object is generated.
Specifically, in an embodiment of the present invention, mobile terminal generation and each one-to-one position of intermediate bitmap file Figure object.In an embodiment of the present invention, bitmap object is used to identify intermediate bitmap file.That is, bitmap object is intermediate bitmap The index of file, application program can find bitmap file (due to intermediate bitmap file in subsequent step according to the bitmap object Bitmap file is encapsulated as, therefore, when application program is called according to bitmap object, what is found is bitmap file) to right The bitmap file answered is called." bmp " in above-mentioned sentence is the bitmap object in the embodiment of the present invention.
Step 206, according at least one bitmap object, at least one intermediate bitmap file is packaged, with obtain with Bitmap file corresponding to each intermediate bitmap file.
Specifically, in an embodiment of the present invention, step 206 specifically includes:
Step 2061, encapsulation sentence is called.
Step 2062, according at least one bitmap object, by encapsulating sentence by least one intermediate bitmap file Each intermediate bitmap Document encapsulation is into the bitmap file with drawable forms.
Specifically, the intermediate bitmap file of each generation is packaged by mobile terminal, it is set to be encapsulated as that there are specified lattice The bitmap file of formula, i.e. drawable forms.Further, in the embodiment of the present invention, mobile terminal seals intermediate bitmap file Fill as BitmapDrawable forms.So as to enable applications to directly use the bitmap file, the place of application program is improved Manage efficiency.Specifically, encapsulation process can be realized by following sentence:
Pngdrawable=new BitmapDrawable (bmp);
I.e., in an embodiment of the present invention, mobile terminal according to bitmap object (bmp) by intermediate bitmap Document encapsulation into BitmapDrawable form.
Then, application program can call bitmap file by referencing function.It can specifically be realized by following sentence:
tv.setBackgroundDrawable(pngdrawable)。
Therefore, there is above-described embodiment visible, the picture call method in the embodiment of the present invention calls picture set, and dynamic The region of memory for caching picture set and the bitmap object associated with the picture set, bitmap file etc. is created, with And after this application call, it will empty all resources in region of memory and delete the resource and correspondingly Adduction relationship etc..As can be seen here, the present invention is new by each call, being generated in the region of memory being pre-created Resource, so as to avoid in the picture call method of prior art, utilize:GetResources () .getDrawable (id) language Sentence, by image cache to local, and will occur cache resources during application call, and cause next application program In invoked procedure, the problem of being returned directly to cache resources, thus trigger system exception.Specific delet method is as follows:
Step 207, if monitoring closing application program, simultaneously releasing memory region is emptied, and, message bit pattern is deleted, Wherein, the information that is generated when message bit pattern is creates bitmap file.
Specifically, in an embodiment of the present invention, if monitoring closing application program, according at least one bitmap pair As positioning region of memory.Then, mobile terminal empties simultaneously releasing memory region.
Specifically, in an embodiment of the present invention, step 207 specifically includes:
Sub-step 2071, if detecting closing application program, delete picture set and the position for being cached in local memory Map file.
Specifically, in an embodiment of the present invention, mobile terminal monitors the state of application program in real time, if monitoring to apply Stop, then mobile terminal the bitmap file in local memory, that is, cached and picture set are deleted.
Specifically, the mobile terminal in the embodiment of the present invention deletes bitmap file by following sentence:
Pngdrawable=null;
And the picture set in caching is deleted by following sentence:
bitmap.recycle();
Sub-step 2072, delete at least one bitmap object.
Specifically, in an embodiment of the present invention, mobile terminal will also delete at least one bitmap object of generation, then its If its application program calls the picture set again, because bitmap object is deleted, then application program will re-use this Picture call method in inventive embodiments regenerates bitmap file, and can not be found according to the bitmap object deleted In the region of memory being pre-created, and the problem of trigger system exception to report an error.Bitmap object is deleted by following sentence:
Bitmap=null
Sub-step 2073, it is empty the referencing function used during application call bitmap file.
Specifically, in an embodiment of the present invention, mobile terminal will also be empty the reference of application program extraction bitmap file Function, so as to the problem of further avoiding system exception from reporting an error.Specifically, it may be accomplished by being empty reference letter Number:
tv.setBackgroundDrawable(null);
In addition, in a preferred embodiment of the invention, mobile terminal can also remove the rubbish of application, example Such as:Registration table, adduction relationship etc..In another embodiment, mobile terminal can carry out overall garbage-cleaning, i.e. cleaning application Layer, the rubbish of bottom.So as to clear up information that may be related to the bitmap file of generation, system exception is further reduced The risk to report an error, improves the stability of a system.
In summary, the technical scheme in the embodiment of the present invention, by the way that the region of memory being pre-created is emptied simultaneously Release, so as to effectively prevent the generation of Installed System Memory overflow problem.And the present invention is led to during picture is called Cross and picture set and related resource are cached in special region of memory, it is data cached so as to not generated in local cache, and After picture use, the region of memory being pre-created is emptied and discharged, and deletes related message bit pattern, and then at it When its application program calls the picture once again, deleted region of memory will not be directed to, therefore, is ensureing picture calling On the premise of efficiency, the problem of possible system exception occurred reports an error is efficiently solved, improves the stability of system, and Improve Consumer's Experience.
Embodiment three
Reference picture 3, shows a kind of structured flowchart of picture calling device of the embodiment of the present invention, and the device specifically can be with Including with lower module:
Extraction module 301, if for detect need call picture set, from be locally stored it is middle extraction picture set, Wherein, picture set includes an at least pictures.
Detection module 302, for detecting whether memory size needed for picture set exceedes predetermined threshold.
First cache module 303, for if it is not, then cache picture set into system specified memory region, making application Program calls picture set from system specified memory region.
Second cache module 304, for if so, then caching picture set into the region of memory being pre-created;
Creation module 305, in region of memory, creating and the one-to-one bitmap text of every pictures in picture set Part, so that application program calls bitmap file from region of memory;And
Release module 306, if for monitoring closing application program, simultaneously releasing memory region is emptied, and, delete position Figure information, wherein, the information that is generated when message bit pattern is creates bitmap file.
Reference picture 4, in of the invention one has the embodiment of choosing, on the basis of Fig. 3, creation module 305 is further Including:
Submodule 3051 is created, for according to picture set, creating at least one intermediate bitmap file, at least one centre Bitmap file corresponds with the picture in picture set.
Submodule 3052 is generated, for generating at least one bitmap object, wherein, at least one bitmap object and at least one Individual intermediate bitmap file corresponds, also, each bitmap object is used to identify corresponding intermediate bitmap file.
Submodule 3053 is encapsulated, for according at least one bitmap object, being sealed at least one intermediate bitmap file Dress, to obtain bitmap file corresponding with each intermediate bitmap file.
In addition, in of the invention one has the embodiment of choosing, encapsulation submodule 3053 is further used for:
Call encapsulation sentence.
According at least one bitmap object, by encapsulating sentence by among each at least one intermediate bitmap file Bitmap file is packaged into the bitmap file with drawable forms.
Reference picture 5, in of the invention one has the embodiment of choosing, on the basis of Fig. 3, release module 306 is further Including:
Submodule 3061 is positioned, if for monitoring closing application program, according at least one bitmap object, in positioning Deposit region.
Submodule 3062 is discharged, for emptying simultaneously releasing memory region.
Reference picture 6, in of the invention one has the embodiment of choosing, on the basis of Fig. 3, release module 306 is further Including:
First deletes submodule 3063, if for monitoring closing application program, deletes the figure for being cached in region of memory Piece set and bitmap file.
Second deletes submodule 3064, for deleting region of memory.
3rd deletes submodule 3065, for deleting at least one bitmap object.
Submodule 3066 is empty, the referencing function used during for being empty application call bitmap file.
In summary, the device in the embodiment of the present invention, by being emptied and being discharged the region of memory being pre-created, So as to effectively prevent the generation of Installed System Memory overflow problem.And it is of the invention during picture is called, by that will scheme Piece set and related resource are cached in special region of memory, data cached so as to not generated in local cache, and in picture After use, the region of memory being pre-created is emptied and discharged, and deletes related message bit pattern, and then in other application When program calls the picture once again, deleted region of memory will not be directed to, therefore, is ensureing picture calling efficiency Under the premise of, the problem of possible system exception occurred reports an error is efficiently solved, improves the stability of system, and improve Consumer's Experience.
For apparatus embodiments, because it is substantially similar to embodiment of the method, so description is fairly simple, it is related Part illustrates referring to the part of embodiment of the method.
Each embodiment in this specification is described by the way of progressive, what each embodiment stressed be with The difference of other embodiment, between each embodiment identical similar part mutually referring to.
The embodiment of the present invention can be described in the general context of computer executable instructions, example Such as program module.Usually, program module include performing particular task or realize the routine of particular abstract data type, program, Object, component, data structure etc..The present invention can also be put into practice in a distributed computing environment, in these Distributed Calculation rings In border, by performing task by communication network and connected remote processing devices.In a distributed computing environment, program mould Block can be located in the local and remote computer-readable storage medium including storage device.
Finally, it is to be noted that, herein, such as first and second or the like relational terms be used merely to by One entity or operation make a distinction with another entity or operation, and not necessarily require or imply these entities or operation Between any this actual relation or order be present.Moreover, term " comprising ", "comprising" or its any other variant meaning Covering including for nonexcludability, so that process, method, commodity or equipment including a series of elements not only include that A little key elements, but also the other element including being not expressly set out, or also include for this process, method, commodity or The intrinsic key element of equipment.In the absence of more restrictions, the key element limited by sentence "including a ...", is not arranged Except other identical element in the process including the key element, method, commodity or equipment being also present.
A kind of picture call method provided by the present invention and device are described in detail above, it is used herein Specific case is set forth to the principle and embodiment of the present invention, and the explanation of above example is only intended to help and understands this The method and its core concept of invention;Meanwhile for those of ordinary skill in the art, according to the thought of the present invention, specific There will be changes in embodiment and application, in summary, this specification content should not be construed as to the present invention's Limitation.

Claims (10)

  1. A kind of 1. picture call method, it is characterised in that including:
    If detecting needs to call picture set, from the middle extraction picture set is locally stored, wherein, the picture set Include an at least pictures;
    Detect whether memory size needed for the picture set exceedes predetermined threshold;
    If it is not, then caching the picture set into system specified memory region, application program is set to be specified from the system interior Deposit and the picture set is called in region;
    If so, then the picture set is cached into the region of memory being pre-created;
    In the region of memory, establishment and the one-to-one bitmap file of every pictures in the picture set, so that described Application program calls institute's bitmap file from the region of memory;And
    If monitoring the closing application program, empty and discharge the region of memory, and, message bit pattern is deleted, wherein, The information that is generated when institute's bitmap information is creates institute's bitmap file.
  2. 2. according to the method for claim 1, it is characterised in that it is described in the region of memory, create and the picture Specifically included in set per pictures the step of one-to-one bitmap file:
    According to the picture set, create at least one intermediate bitmap file, at least one intermediate bitmap file with it is described Picture in picture set corresponds;
    At least one bitmap object is generated, wherein, at least one bitmap object and at least one intermediate bitmap file Correspond, also, each bitmap object is used to identify corresponding intermediate bitmap file;
    According at least one bitmap object, at least one intermediate bitmap file is packaged, with acquisition and each Bitmap file corresponding to intermediate bitmap file.
  3. 3. according to the method for claim 2, it is characterised in that it is described according at least one bitmap object, to described The step of at least one intermediate bitmap file is packaged, specifically includes:
    Call encapsulation sentence;
    , will be every at least one intermediate bitmap file by the encapsulation sentence according at least one bitmap object One intermediate bitmap Document encapsulation is into the bitmap file with drawable forms.
  4. 4. according to the method for claim 2, it is characterised in that if described monitor the closing application program, empty And discharge the region of memory, and, delete message bit pattern the step of, specifically include:
    If monitoring the closing application program, according at least one bitmap object, the region of memory is positioned;
    Empty and discharge the region of memory.
  5. 5. according to the method for claim 2, it is characterised in that if described monitor the closing application program, empty And discharge the region of memory, and, delete message bit pattern the step of, specifically include:
    If monitoring the closing application program, the picture set for being cached in the region of memory and bitmap text are deleted Part;
    Delete the region of memory;And
    Delete at least one bitmap object;And
    It is empty the referencing function used during the application call institute bitmap file.
  6. A kind of 6. picture calling device, it is characterised in that including:
    Extraction module, if needing to call picture set for detecting, from the middle extraction picture set is locally stored, its In, the picture set includes an at least pictures;
    Detection module, for detecting whether memory size needed for the picture set exceedes predetermined threshold;
    First cache module, for if it is not, then cache the picture set into system specified memory region, making application program The picture set is called from the system specified memory region;
    Second cache module, for if so, then caching the picture set into the region of memory being pre-created;
    Creation module, in the region of memory, creating and the one-to-one bitmap of every pictures in the picture set File, so that the application program calls institute's bitmap file from the region of memory;And
    Release module, if for monitoring the closing application program, empty and discharge the region of memory, and, delete Message bit pattern, wherein, the information that is generated when institute's bitmap information is creates institute's bitmap file.
  7. 7. device according to claim 6, it is characterised in that the creation module further comprises:
    Submodule is created, for according to the picture set, creating at least one intermediate bitmap file, at least one centre Bitmap file corresponds with the picture in the picture set;
    Submodule is generated, for generating at least one bitmap object, wherein, at least one bitmap object and described at least one Individual intermediate bitmap file corresponds, also, each bitmap object is used to identify corresponding intermediate bitmap file;
    Submodule is encapsulated, for according at least one bitmap object, being sealed at least one intermediate bitmap file Dress, to obtain bitmap file corresponding with each intermediate bitmap file.
  8. 8. device according to claim 7, it is characterised in that the encapsulation submodule is further used for:
    Call encapsulation sentence;
    , will be every at least one intermediate bitmap file by the encapsulation sentence according at least one bitmap object One intermediate bitmap Document encapsulation is into the bitmap file with drawable forms.
  9. 9. device according to claim 7, it is characterised in that the release module further comprises:
    Submodule is positioned, if for monitoring the closing application program, according at least one bitmap object, positions institute State region of memory;
    Submodule is discharged, for emptying and discharging the region of memory.
  10. 10. device according to claim 7, it is characterised in that the release module further comprises:
    First deletes submodule, if for monitoring the closing application program, deletes the figure for being cached in the region of memory Piece set and institute's bitmap file;
    Second deletes submodule, for deleting the region of memory;And
    3rd deletes submodule, for deleting at least one bitmap object;And
    Submodule is empty, the referencing function used during for being empty the application call institute bitmap file.
CN201710712580.0A 2017-08-18 2017-08-18 Picture calling method and device Active CN107656699B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710712580.0A CN107656699B (en) 2017-08-18 2017-08-18 Picture calling method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710712580.0A CN107656699B (en) 2017-08-18 2017-08-18 Picture calling method and device

Publications (2)

Publication Number Publication Date
CN107656699A true CN107656699A (en) 2018-02-02
CN107656699B CN107656699B (en) 2020-11-10

Family

ID=61127715

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710712580.0A Active CN107656699B (en) 2017-08-18 2017-08-18 Picture calling method and device

Country Status (1)

Country Link
CN (1) CN107656699B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110032421A (en) * 2019-04-18 2019-07-19 腾讯科技(深圳)有限公司 The management method of atlas, device, terminal and storage medium in memory

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080069465A1 (en) * 2006-09-15 2008-03-20 Nec Electronics Corporation Processing data supply method and image processing apparatus
CN101226549A (en) * 2008-01-25 2008-07-23 中兴通讯股份有限公司 Method and device for loading picture resource in embedded system
EP2053840A2 (en) * 2007-10-25 2009-04-29 Canon Kabushiki Kaisha Recording apparatus and method for controlling the recording apparatus
CN102662615A (en) * 2012-03-23 2012-09-12 安科智慧城市技术(中国)有限公司 Embedded equipment and picture displaying method and system of embedded equipment
CN103885753A (en) * 2014-03-03 2014-06-25 广州金山网络科技有限公司 Management method and device for caching images and client side
CN104267996A (en) * 2014-09-29 2015-01-07 广州金山网络科技有限公司 Image resource processing method, device and terminal
CN104657378A (en) * 2013-11-20 2015-05-27 青岛海信移动通信技术股份有限公司 File cache method and device
CN105046640A (en) * 2015-05-14 2015-11-11 深圳市美贝壳科技有限公司 Picture memory managing method and apparatus
CN105373471A (en) * 2014-08-29 2016-03-02 腾讯科技(深圳)有限公司 Detection method and apparatus for memory leak bug
CN105912480A (en) * 2016-04-01 2016-08-31 乐视控股(北京)有限公司 Cache management method, device and mobile terminal
CN106802955A (en) * 2017-01-19 2017-06-06 济南浪潮高新科技投资发展有限公司 A kind of image data caching method

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080069465A1 (en) * 2006-09-15 2008-03-20 Nec Electronics Corporation Processing data supply method and image processing apparatus
EP2053840A2 (en) * 2007-10-25 2009-04-29 Canon Kabushiki Kaisha Recording apparatus and method for controlling the recording apparatus
CN101226549A (en) * 2008-01-25 2008-07-23 中兴通讯股份有限公司 Method and device for loading picture resource in embedded system
CN102662615A (en) * 2012-03-23 2012-09-12 安科智慧城市技术(中国)有限公司 Embedded equipment and picture displaying method and system of embedded equipment
CN104657378A (en) * 2013-11-20 2015-05-27 青岛海信移动通信技术股份有限公司 File cache method and device
CN103885753A (en) * 2014-03-03 2014-06-25 广州金山网络科技有限公司 Management method and device for caching images and client side
CN105373471A (en) * 2014-08-29 2016-03-02 腾讯科技(深圳)有限公司 Detection method and apparatus for memory leak bug
CN104267996A (en) * 2014-09-29 2015-01-07 广州金山网络科技有限公司 Image resource processing method, device and terminal
CN105046640A (en) * 2015-05-14 2015-11-11 深圳市美贝壳科技有限公司 Picture memory managing method and apparatus
CN105912480A (en) * 2016-04-01 2016-08-31 乐视控股(北京)有限公司 Cache management method, device and mobile terminal
CN106802955A (en) * 2017-01-19 2017-06-06 济南浪潮高新科技投资发展有限公司 A kind of image data caching method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110032421A (en) * 2019-04-18 2019-07-19 腾讯科技(深圳)有限公司 The management method of atlas, device, terminal and storage medium in memory

Also Published As

Publication number Publication date
CN107656699B (en) 2020-11-10

Similar Documents

Publication Publication Date Title
CN103346912B (en) Method, device and system for conducting warning correlation analysis
US20170302543A1 (en) Method and Device for Managing Virtualized Network Function
US8649427B2 (en) Image processor, image generator and computer program
CN108259200B (en) A kind of physical network function PNF moving method and relevant device
CN104639361A (en) Network service template management method and device
CN103716356A (en) Storage process operation method, device and system based on Web
CN104572460A (en) Memory leak detecting method and memory leak detecting device
CN105516266B (en) A kind of business monitoring method, system and relevant device
CN107209695A (en) System, virtualization control device, the methods and procedures for controlling virtualization control device
CN106161076A (en) Virtual network function extended method and device
CN106888233A (en) Data update system and method
WO2019001312A1 (en) Method and apparatus for realizing alarm association, and computer readable storage medium
CN103309796A (en) Monitoring method and device of component object model (COM) object
CN104503863A (en) Kernel mode and user mode data exchange method used for virtual container system disaster recovery
CN108769207B (en) Cloud platform resource monitoring method and system
CN106549796A (en) Resource control method and host node that a kind of firmware space is downloaded
CN103885753A (en) Management method and device for caching images and client side
CN100499497C (en) Method and system for quick processing warning
CN111090495A (en) Node management method, device, equipment, storage medium and system
CN109885612A (en) The synchronization take-effective method and device of block chain intelligence contract
CN107066341B (en) Event routing framework and method between software modules
CN107656699A (en) Picture call method and device
CN105933154A (en) Management method of cloud calculation resources
CN110737503B (en) Management method and device for container service snapshot
CN104054308B (en) Application layer resources selection method, device and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20220805

Address after: 200131 building C, No. 888, Huanhu West 2nd Road, Lingang New District, Pudong New Area, Shanghai

Patentee after: Zhiche (Shanghai) Industrial Co.,Ltd.

Address before: 200335 rooms 904-906, building a, Hongqiao International Science and Technology Plaza, 999 Jinzhong Road, Changning District, Shanghai

Patentee before: SHANGHAI VCYBER INTELLIGENCE TECHNOLOGY CO.,LTD.