WO2017152764A1 - 一种图片处理方法、装置和智能终端 - Google Patents

一种图片处理方法、装置和智能终端 Download PDF

Info

Publication number
WO2017152764A1
WO2017152764A1 PCT/CN2017/074621 CN2017074621W WO2017152764A1 WO 2017152764 A1 WO2017152764 A1 WO 2017152764A1 CN 2017074621 W CN2017074621 W CN 2017074621W WO 2017152764 A1 WO2017152764 A1 WO 2017152764A1
Authority
WO
WIPO (PCT)
Prior art keywords
target
memory
picture
processing request
target image
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.)
Ceased
Application number
PCT/CN2017/074621
Other languages
English (en)
French (fr)
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.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Publication of WO2017152764A1 publication Critical patent/WO2017152764A1/zh
Priority to US16/121,960 priority Critical patent/US10679321B2/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/60Memory management
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09GARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
    • G09G2360/00Aspects of the architecture of display systems
    • G09G2360/12Frame memory handling

Definitions

  • the present application relates to the field of information processing technologies, and in particular, to a picture processing method, a picture processing apparatus, and an intelligent terminal.
  • UI User Interface
  • APP Application Program
  • the image processing process of an existing solution may specifically include:
  • Step 1 Loading the local image into the first memory, and converting the local image into a corresponding image content according to the image format;
  • Step 2 upload the converted picture content to the second memory of the graphics processor
  • Step 3 The graphics processor processes the picture according to the picture content in the second memory, and outputs the corresponding processing result to the smart terminal;
  • Step 4 When the application corresponding to the local picture exits, destroy all the memory used by the application.
  • the existing scheme destroys all the memory used by the application when the corresponding application of the local image exits, and can save the loading of the local image to the first memory when repeatedly loading the same local image. the process of.
  • the first memory and the second memory will consume more and more system memory, thereby affecting the overall performance of the smart terminal.
  • the above problem of consuming system memory will seriously affect the performance of intelligent terminals.
  • other applications cannot be started, etc., here, other applications may be applications other than the application corresponding to the local picture.
  • the technical problem to be solved by the embodiments of the present application is to provide a picture processing method, which can greatly reduce the pressure of the system memory and improve the memory utilization, thereby improving the overall performance of the smart terminal.
  • the embodiment of the present application further provides an image processing apparatus and an intelligent terminal, which are used to ensure implementation and application of the foregoing method.
  • a picture processing method including:
  • the target memory occupied by the target image is released; wherein the target memory is used to record the memory copy corresponding to the target image.
  • the method further includes:
  • the step of releasing the target memory occupied by the target picture includes: releasing the target memory occupied by the target picture when the target picture is not being used by other processing requests.
  • the step of determining whether the target picture is being used by another processing request includes:
  • the number of times the target picture is processed for use is the first preset value, it is determined that the target picture is not being used by other processing requests.
  • the number of times the target picture is processed for use is updated by the following steps:
  • the number of times the target picture is used for the processing request is reduced by a set amount.
  • the number of times the target picture is processed for use is updated by the following steps:
  • the unique identifier is an identifier generated according to the current processing request corresponding to the target image, and different target images correspond to different unique identifiers;
  • the number of occurrences of the corresponding unique identifier is reduced by the set amount.
  • the number of times the target picture is processed by the processing request is obtained by the following steps:
  • the step of determining whether the target picture is being used by another processing request includes:
  • the target picture has a preset flag, it is determined that the target picture is not being used by other processing requests.
  • the method further includes:
  • the target picture is reloaded to the corresponding target memory.
  • the method further includes:
  • the target image is reloaded to the corresponding target memory.
  • the present application further discloses a picture processing apparatus, including:
  • a release module configured to release a target memory occupied by the target image after outputting a current processing request corresponding to the image content of the target image to the graphics processor, where the target memory is used to record the memory corresponding to the target image copy.
  • the device further includes:
  • a determining module configured to determine whether the target image is being used by another processing request after outputting the current processing request corresponding to the graphic content of the target image to the graphics processor;
  • the release module includes:
  • the release submodule is configured to release the target memory occupied by the target image when the target picture is not being used by other processing requests.
  • the determining module includes:
  • the first determining submodule is configured to determine that the target picture is not being used by another processing request when the number of times the target picture is used by the processing request is a first preset value.
  • the device further includes:
  • a first update module configured to update the number of times the target image is processed by the request:
  • the first update module includes:
  • a recording submodule for recording the number of times the target picture is processed for use when the target picture is to be used by the current processing request
  • the first update submodule is configured to reduce the number of times the target picture is used by the processing request by a set amount after successfully outputting the picture content corresponding to the target picture of the current processing request to the graphics processor.
  • the device further includes:
  • a second update module configured to update the number of times the target image is processed by the request:
  • the second update module includes:
  • a second update submodule configured to add a unique identifier to the identifier set and update the number of occurrences of the unique identifier to the second when the unique identifier is not present in the identifier set for the received current processing request a preset value, where the unique identifier is an identifier generated according to the current processing request corresponding to the target image, and different target images correspond to different unique identifiers;
  • a third update submodule configured to increase, according to the received current processing request, a number of occurrences of the unique identifier by a set amount when the unique identifier thereof appears in the identifier set, The number of times the target image was processed for the request;
  • a fourth update submodule configured to reduce the number of occurrences of the corresponding unique identifier by a set amount after successfully outputting the current content to the graphics processor corresponding to the target image.
  • the device further includes:
  • An obtaining module configured to acquire the number of times the target image is processed by the processing request:
  • the obtaining module includes:
  • the finding submodule is configured to perform a search in the mapping relationship between the identifier of the target memory and the number of times the target image is processed by the processing request according to the identifier of the target memory, to obtain the number of times the target memory is used by the target image to be processed. .
  • the determining module includes:
  • the second determining submodule is configured to determine that the target picture is not being used by other processing requests when the target picture has a preset flag.
  • the device further includes:
  • a first determining module configured to determine, before acquiring the picture content of the target picture, whether a memory copy corresponding to the target picture exists in the target memory occupied by the target picture;
  • the reloading module is configured to reload the target image to the corresponding target memory when the memory copy corresponding to the target image does not exist in the target memory.
  • the device further includes:
  • a second determining module configured to determine, when the memory copy corresponding to the target image does not exist in the target memory, whether the identifier of the target memory and/or the current processing request meets a preset rule
  • the reloading module includes:
  • a submodule configured to reload the target image to the corresponding target memory when the identifier of the target memory and/or the current processing request meets a preset rule.
  • the present application discloses a smart terminal including a memory and one or more programs, wherein one or more programs are stored in a memory and configured to be executed by one or more processors
  • One or more programs contain instructions for doing the following:
  • the target memory occupied by the target image is released; wherein the target memory is used to record the memory copy corresponding to the target image.
  • the embodiments of the present application include the following advantages:
  • the image content of the target image is released, and the target memory occupied by the target image is released; wherein the target memory is used to record the memory copy corresponding to the target image.
  • the method of releasing the target memory occupied by the target image in the embodiment of the present application can release the system memory in time for the current application or other application to make the memory is destroyed when the application exits. Therefore, the pressure on the system memory can be greatly reduced, and the memory utilization can be improved, thereby improving the overall performance of the smart terminal.
  • the embodiment of the present application can also be applied to an intelligent terminal with limited system memory (for example, a smart terminal with a system memory of 1 G or 512 M). In this case, the operation capability of the smart terminal under extreme conditions can be improved.
  • an intelligent terminal with limited system memory for example, a smart terminal with a system memory of 1 G or 512 M. In this case, the operation capability of the smart terminal under extreme conditions can be improved.
  • the embodiment of the present application may release the target memory occupied by the target image when the target image is not being used by other processing requests; wherein the target image is not being used by other processing requests, and may be used to represent the target image.
  • the memory copy is not being used by other processing requests. Since it can avoid repeatedly loading the target image when processing other processing requests, it can greatly reduce the pressure of the system memory and improve the memory without affecting the efficiency of image processing. Utilization rate.
  • FIG. 1 is a schematic structural diagram of an application environment of an information processing method of the present application
  • FIG. 2 is a flow chart of steps of a second embodiment of a picture processing method according to the present application.
  • FIG. 3 is a flow chart showing the steps of a third embodiment of a picture processing method according to the present application.
  • FIG. 4 is a flow chart showing the steps of a fourth embodiment of a picture processing method according to the present application.
  • FIG. 5 is a structural block diagram of Embodiment 2 of a picture processing apparatus according to the present application.
  • FIG. 6 is a structural block diagram of an embodiment of a smart terminal of the present application.
  • the graphics processor usually only recognizes the transformed graph. Slice content (such as texture content), but can not identify the memory copy corresponding to the image recorded in the first memory, that is, the graphics processor does not have the need for the above memory copy.
  • the embodiment of the present application creatively proposes to release the corresponding target memory during the running process of the target image corresponding application, specifically, after outputting the current processing request corresponding to the image content of the target image to the graphics processor, releasing the The target memory occupied by the target image; wherein the target memory is used to record the memory copy corresponding to the target image; and the method for destroying the memory when the application exits with respect to the existing solution, the release target image in the embodiment of the present application
  • the use of the target memory can release the system memory in time for the current application or other applications, thus greatly reducing the pressure on the system memory and improving the memory utilization, thereby improving the overall performance of the smart terminal.
  • the target memory needs to be consumed by 3145728 bytes; and the foregoing application is applied to the embodiment of the present application.
  • the memory can be released during the running of the target image corresponding application (such as the desktop program), thus greatly reducing the pressure on the system memory and improving the memory utilization.
  • the present application provides a first embodiment of the image processing method.
  • the first embodiment of the method may include: releasing the target memory occupied by the target image after outputting the current processing request corresponding to the image content of the target image to the graphics processor.
  • the target memory can be used to record a memory copy corresponding to the target picture.
  • client 100 and server 200 can be located in a wired or wireless network through which client 100 interacts with server 200.
  • the client 100 and the server 200 can run on the same smart terminal, and the client 100 performs data interaction with the server 200 through an IPC (Inter-Process Communication) manner.
  • the client 100 and the server 200 can run in the same process of the same smart terminal, and the client 100 performs data interaction with the server 200 through the inter-thread communication manner.
  • the server 200 is located in a rendering thread of an application
  • the client 100 may be located in a GUI (Graphical User Interface) thread of the application.
  • GUI Graphic User Interface
  • the above intelligent terminals specifically include but are not limited to: smart phones, tablet computers, e-book readers, MP3 (Moving Picture Experts Group Audio Layer III) player, MP4 (Dynamic Video experts compress standard audio layers, including portable players, laptop computers, on-board computers, desktop computers, set-top boxes, smart TVs, wearable devices, and more.
  • MP3 Motion Picture Experts Group Audio Layer III
  • MP4 Dynamic Video experts compress standard audio layers, including portable players, laptop computers, on-board computers, desktop computers, set-top boxes, smart TVs, wearable devices, and more.
  • the data interaction process between the client 100 and the server 200 may specifically include the following steps:
  • Step A1 The client 100 sends a processing request to the server 200, and carries information such as picture parameter information (such as width, height, unit pixel number, and the like) and address information of the target picture in the processing request;
  • picture parameter information such as width, height, unit pixel number, and the like
  • Step A2 After receiving the processing request, the server 200 may apply for and generate a corresponding target memory according to the picture parameter information.
  • the foregoing target memory may specifically include: a picture container.
  • the container is a common design pattern of computer software object-oriented design, and the picture container can be used to represent the memory copy corresponding to the target image and the object of the image attribute.
  • Step A3 The server 200 reads the target picture according to the address information and stores the memory copy in the target memory.
  • Step A4 The server 200 converts the target image into a corresponding picture content according to a picture format.
  • the server 200 may generate a texture assembler and convert the target image into a corresponding texture content by using the texture assembler. It can be understood that the embodiment of the present application is specific to the image content and The specific acquisition process of the image content is not limited.
  • Step A5 the server 200 outputs the converted picture content to the graphics processor
  • Step A6 The server 200 releases the target memory after successfully outputting the converted picture content to the graphics processor.
  • Step A7 The server 200 processes the image content by using a graphics processor, and outputs the corresponding processing result to the smart terminal.
  • the process of processing the image content by the graphics processor may include: rendering the image memory to obtain a corresponding rendering result, etc., it may be understood that the embodiment of the present application processes the graphics processor.
  • the specific process of the above picture content is not limited.
  • the target memory can be released during the running process of the target image corresponding application (such as a desktop program), thereby greatly reducing the pressure of the system memory and improving the memory utilization.
  • the embodiment of the present application can also be applied to an intelligent terminal with limited system memory (for example, a smart terminal with a system memory of 1 G or 512 M). In this case, the operation capability of the smart terminal under extreme conditions can be improved.
  • an intelligent terminal with limited system memory for example, a smart terminal with a system memory of 1 G or 512 M. In this case, the operation capability of the smart terminal under extreme conditions can be improved.
  • FIG. 2 a flow chart of the steps of the second embodiment of the image processing method of the present application is shown, which may specifically include the following steps:
  • Step 201 After outputting the current processing request corresponding to the picture content of the target picture to the graphics processor, determine whether the target picture is being used by another processing request; wherein the target memory is used to record the memory corresponding to the target picture. copy;
  • Step 202 Release the target memory occupied by the target picture when the target picture is not being used by other processing requests.
  • the embodiment may release the target memory occupied by the target image when the target image is not being used by other processing requests; wherein the target image is being used by other processing requests to be used to represent the foregoing
  • the memory copy corresponding to the target image is being used elsewhere. Request for use. If the target memory occupied by the target image is released when the target image is being used by other processing requests, the target image needs to be repeatedly loaded into the corresponding target memory when processing other processing requests.
  • the above-mentioned repeated loading is easy to increase the time of the picture processing, and the efficiency of the picture processing is easily reduced. Therefore, when the target picture is not being used by other processing requests, the target memory occupied by the target picture can be released in the embodiment. Under the premise of not affecting the efficiency of image processing, the pressure on system memory is greatly reduced, and the memory utilization can be improved.
  • the determining scheme 1 it may be determined according to the number of times the target picture is processed to be used, whether the target picture is being used by another processing request, and accordingly, the step of determining whether the target picture is being used by another processing request.
  • the method may include: determining that the target picture is not being used by another processing request when the number of times the target picture is processed for use is a first preset value.
  • the number of times the target picture is processed for use may be obtained by the following steps: the identifier of the target memory and the number of times the target picture is processed for use according to the identifier of the target memory
  • the search is performed in the mapping relationship to obtain the number of times the target memory is used by the target image to be processed. The above lookup can increase the speed of acquisition of the number of times the target picture is processed for use.
  • a picture container of a target picture may be assigned a random number as an ID (Identity) of the picture container, and the ID of the picture container is bound to the number of times the target picture is used by the processing request to obtain The mapping between the identity of the target memory and the number of times the target image is processed for use.
  • ID Identity
  • the number of times the target picture is processed for use may be updated by the following steps:
  • Step B1 recording the number of times the target picture is processed for use when the target picture is to be used by the current processing request
  • Step B2 After successfully outputting the picture content corresponding to the target picture of the current processing request to the graphics processor, reduce the number of times the target picture is used by the processing request by a set amount.
  • the corresponding variable may be set for the number of times the target picture is used for processing, for example, the first preset value of the variable may be set to zero, and after receiving the current processing request, the target image is generated.
  • the processing of the step B1 may include: adding a set amount of the value of the corresponding variable to the target image for the current processing request; and successfully outputting the image content corresponding to the target image of the current processing request. After the processing to the graphics processor, it indicates that the processing request using the target picture is processed, that is, the memory copy of the target picture is not required for the processing request, so the corresponding target picture can be requested for the current processing request, and the value of the corresponding variable is Reduce the amount of settings.
  • parameters such as address information carried in the current processing request may be matched with the address information of the variable to obtain a variable corresponding to the current processing request. It can be understood that the specific acquisition process of the variable corresponding to the current processing request is not limited in the embodiment of the present application.
  • the first preset value of the above variable is only zero as an application example of the present application.
  • the first preset value of the variable may also be a non-zero value, and the current value of the variable is When the first preset value is the same, it may be determined that the target picture is not being used by other processing requests. It can be understood that the specific representation manner of the number of times the target picture is used for processing the request is not limited in the embodiment of the present application.
  • the value corresponding to the set amount may be used to indicate the value of the corresponding variable of the primary processing request, and may be a value of 1, 2, etc., and the specific value corresponding to the set amount is not limited in the embodiment of the present application.
  • the number of times the target picture is processed for use may be updated by the following steps:
  • Step C1 For the received current processing request, when the unique identifier does not appear in the identifier set, add the unique identifier to the identifier set, and update the occurrence number of the unique identifier to a second preset value;
  • the identifier is generated according to the identifier generated by the current processing request corresponding to the target image, and different target images correspond to different unique identifiers;
  • the difference between the second preset value and the first preset value may be the set amount, and it may be understood that the first preset value and the second preset are used in the embodiment of the present application.
  • the specific values of the set value and the set amount are not limited.
  • Step C2 For the received current processing request, when the unique identifier appears in the identifier set, increase the number of occurrences of the unique identifier by a set amount, and use the number of occurrences as the target image to be processed. The number of uses;
  • Step C3 After successfully outputting the picture content corresponding to the target picture of the current processing request to the graphics processor, reduce the number of occurrences by a set amount.
  • the corresponding unique identifier may be generated according to the information of the corresponding target image, and the different target images correspond to different unique identifiers, and the same target image corresponds to the same unique identifier; An update of the number of times the target picture is processed for use by the request is implemented based on the unique code.
  • the above-mentioned unique identifier may be generated by using an algorithm such as a GUID (globally unique identifier). It can be understood that the embodiment of the present application does not limit the specific generation process of the unique identifier.
  • the process of updating the number of times the target picture is processed to be used for the request may specifically include:
  • Step D1 The server generates an identifier set in the initialization phase; and generates an ID generator at the same time.
  • the ID generator is used to provide a uniquely identified generation service to all clients;
  • Step D2 The client sends the information of the target picture to the ID generator, so that the ID generator generates a corresponding unique identifier according to the information of the target picture.
  • Step D3 The client sends a processing request to the server, where the processing request carries a unique identifier corresponding to the target image.
  • Step D4 The server determines, according to the received current processing request, whether the unique identifier appears in the identifier set.
  • Step D5 When the foregoing unique identifier does not appear in the identifier set, add the foregoing unique identifier to the identifier set, and update the occurrence number of the unique identifier to a second preset value;
  • Step D6 When the foregoing unique identifier appears in the identifier set, increase the number of occurrences of the unique identifier by a set amount;
  • Step D7 After successfully outputting the picture content corresponding to the target picture of the current processing request to the graphics processor, reduce the number of occurrences of the corresponding unique identifier by a set amount.
  • the step of determining whether the target picture is being used by another processing request may specifically include: determining that the target picture is not being used by another processing request when the target picture has a preset flag.
  • the determining scheme 2 can mark the picture that meets the preset condition by the preset mark.
  • the foregoing picture that meets the preset condition may specifically include: a picture that is used once by the unique application in the entire life cycle.
  • the desktop The program usually performs a processing operation only for the target image corresponding to the desktop background, so the target image corresponding to the desktop background can be used as the image that is used once by the unique application throughout the life cycle.
  • the developer of the application may carry a corresponding preset mark when uploading the image, so that the user of the application performs the recognition of the image according to the preset mark. It can be understood that the specific generation process of the preset mark is not limited in the embodiment of the present application.
  • the above is a detailed description of whether the target picture is being used by other processing requests.
  • the determining scheme 2 is described in detail. It can be understood that those skilled in the art can adopt the above determining scheme 1 - determining any one of the schemes 2 according to actual application requirements. Or, other determining schemes for whether the target picture is being used by other processing requests may also be adopted.
  • the specific determining scheme of the present application for whether the target picture is being used by other processing requests is not limited.
  • the embodiment may release the target memory occupied by the target image when the target image is not being used by other processing requests; wherein the target image is not being used by other processing requests, and may be used to represent the target image corresponding to the target image.
  • the memory copy is not being used by other processing requests. Since it can avoid repeatedly loading the above target image when processing other processing requests, it can greatly reduce the pressure of system memory and improve memory utilization without affecting the efficiency of image processing. rate.
  • FIG. 3 a flow chart of the steps of the third embodiment of the image processing method of the present application is shown, which may specifically include the following steps:
  • Step 301 Before obtaining the picture content of the target picture, determining whether the memory copy corresponding to the target picture exists in the target memory occupied by the target picture; wherein the target memory is used to record the memory corresponding to the target picture copy;
  • Step 302 When the memory copy corresponding to the target picture does not exist in the target memory, reload the target picture to the corresponding target memory.
  • Step 303 After outputting the picture content corresponding to the target picture of the current processing request to the graphics processor, release the target memory occupied by the target picture.
  • the process of obtaining the image content of the target image is generally: reading a memory copy corresponding to the target image from the target memory, and acquiring the image content of the target image according to the memory copy, such as by using a texture assembler according to the memory copy. Generate corresponding texture content and so on.
  • the embodiment of the present application may determine whether the memory copy corresponding to the target picture exists in the target memory occupied by the target picture, and does not exist in the target memory.
  • the target image is reloaded into the corresponding target memory to obtain the corresponding image content according to the memory copy in the target memory; the above-mentioned abnormality processing for the target image can improve the image.
  • the robustness and stability of the treatment may be determined whether the memory copy corresponding to the target picture exists in the target memory occupied by the target picture, and does not exist in the target memory.
  • the texture assembler before the texture content of the target image is generated by the texture assembler, it may be determined whether a memory copy corresponding to the target image exists in the image container occupied by the target image; for example, The ID of the picture container reads the content from the picture container. If the read content is empty, or the read content is garbled, the memory copy corresponding to the target picture does not exist in the picture container, so The target image is loaded into a corresponding image container, and the texture assembler is regenerated, and the corresponding texture content is generated by the texture assembler according to the content in the image container. It should be noted that when the read content is legal, a texture assembler may be generated and corresponding texture content is generated according to the read content by the texture assembler.
  • the method may further include: determining, when the memory copy corresponding to the target picture does not exist in the target memory, determining the identifier of the target memory and/or the current Handling whether the request conforms to a preset rule; the identifier and/or location of the target memory When the current processing request conforms to the preset rule, the target image is reloaded to the corresponding target memory.
  • the preset rule may be a rule for measuring the identifier of the target memory and/or the validity of the current processing request, for example, the first preset rule may be used to measure whether the identifier of the target memory is legal, and the second preset rule is used. It can be used to measure whether the current processing request corresponds to the identifier of the requesting party, and so on. When the identifier of the target memory and the current processing request are legal, the current processing request may be considered as a valid processing request, and therefore, the current processing request may be reprocessed.
  • the current processing request may be considered as an invalid processing request, and therefore, the current processing request may be discarded, but may not The current processing request is processed again.
  • the embodiment of the present application determines whether there is a memory copy corresponding to the target picture in the target memory occupied by the target picture, and the target does not exist in the target memory.
  • the memory copy corresponding to the picture is copied, the target picture is reloaded to the corresponding target memory; the above-mentioned measures for the exception processing of the target picture can improve the robustness and stability of the picture processing.
  • FIG. 4 a flow chart of the steps of the fourth embodiment of the image processing method of the present application is shown, which may specifically include the following steps:
  • Step 401 Receive a current processing request, where the current processing request may include information of a target picture.
  • Step 402 Apply and generate a corresponding picture container according to the information of the target picture.
  • the target image and the image container may have a one-to-one relationship
  • Step 403 Load the target image to the image container according to the information of the target image.
  • Step 404 Generate a texture assembler, read a content copy of the target image from the image container by using the texture assembler, and generate corresponding texture content according to the content copy;
  • Step 405 Output the texture content corresponding to the target image of the current processing request to the graphics processor.
  • Step 406 after the current processing request corresponding to the texture content of the target picture is successfully output to the graphics processor, determine whether the target picture is being used by other processing requests, and if not, proceed to step 407;
  • Step 407 Release the picture container occupied by the target picture when the target picture is not being used by another processing request.
  • Step 408 The graphics processor performs processing of the target image according to the texture content stored in the local video memory.
  • Step 409 The graphics processor outputs the processing result of the target picture to the smart terminal, to display the target picture on the smart terminal.
  • Step 410 determining whether the application corresponding to the current processing request exits, and if so, executing step 411;
  • the application corresponding to the current processing request may be exited by whether the main process of the application exists or whether the user closes the instruction for the application.
  • Step 411 releasing the picture container and the texture assembler.
  • the picture container may be released when the application corresponding to the current processing request exits according to the flow of the existing solution.
  • the present application provides a first embodiment of the image processing apparatus.
  • the specific embodiment of the apparatus may include:
  • a release module configured to release a target memory occupied by the target image after outputting a current processing request corresponding to the image content of the target image to the graphics processor, where the target memory is used to record the memory corresponding to the target image copy.
  • FIG. 5 a structural block diagram of a second embodiment of a picture processing apparatus of the present application is shown, which may specifically include the following modules:
  • a determining module 501 configured to determine whether the target image is being used by another processing request after outputting the current processing request corresponding to the graphic content of the target image to the graphics processor;
  • the release module 502 is configured to release the target memory occupied by the target image after outputting the current processing request corresponding to the image content of the target image to the graphics processor, where the target memory is used to record the target image Memory copy
  • the release module 502 may specifically include:
  • the release submodule 521 is configured to release the target memory occupied by the target image when the target picture is not being used by other processing requests.
  • the determining module 501 may specifically include:
  • the first determining submodule is configured to determine that the target picture is not being used by another processing request when the number of times the target picture is used by the processing request is a first preset value.
  • the apparatus may further include:
  • a first update module configured to update the number of times the target image is processed by the request:
  • the first update module includes:
  • a recording submodule for recording the number of times the target picture is processed for use when the target picture is to be used by the current processing request
  • the first update submodule is configured to reduce the number of times the target picture is used by the processing request by a set amount after successfully outputting the picture content corresponding to the target picture of the current processing request to the graphics processor.
  • the apparatus may further include:
  • a second update module configured to update the number of times the target image is processed by the request:
  • the second update module may specifically include:
  • a second update submodule configured to add a unique identifier to the identifier set and update the number of occurrences of the unique identifier to the second when the unique identifier is not present in the identifier set for the received current processing request a preset value, where the unique identifier is an identifier generated according to the current processing request corresponding to the target image, and different target images correspond to different unique identifiers;
  • a third update submodule configured to increase, according to the received current processing request, a number of occurrences of the unique identifier by a set amount when the unique identifier thereof appears in the identifier set, The number of times the target image was processed for the request;
  • a fourth update submodule configured to reduce the number of occurrences of the corresponding unique identifier by a set amount after successfully outputting the current content to the graphics processor corresponding to the target image.
  • the apparatus may further include:
  • An obtaining module configured to acquire the number of times the target image is processed by the processing request:
  • the acquiring module may specifically include:
  • the finding submodule is configured to perform a search in the mapping relationship between the identifier of the target memory and the number of times the target image is processed by the processing request according to the identifier of the target memory, to obtain the number of times the target memory is used by the target image to be processed. .
  • the determining module 501 may specifically include:
  • a second determining submodule configured to determine the target when the target picture has a preset mark The target image is not being used by other processing requests.
  • the apparatus may further include:
  • a first determining module configured to determine, before acquiring the picture content of the target picture, whether a memory copy corresponding to the target picture exists in the target memory occupied by the target picture;
  • the reloading module is configured to reload the target image to the corresponding target memory when the memory copy corresponding to the target image does not exist in the target memory.
  • the apparatus may further include:
  • a second determining module configured to determine, when the memory copy corresponding to the target image does not exist in the target memory, whether the identifier of the target memory and/or the current processing request meets a preset rule
  • the reloading module may specifically include:
  • a submodule configured to reload the target image to the corresponding target memory when the identifier of the target memory and/or the current processing request meets a preset rule.
  • the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.
  • the method may include at least one memory 601, a display 602, at least one processor 603, and at least one input unit 604.
  • the input unit 604 can be configured to receive numeric or character information input by a user, and a control signal.
  • the input unit 604 may include a touch screen 641, which may collect a touch operation on or near the user (such as an operation of the user using a finger, a stylus, or the like on the touch screen 641 using any suitable object or accessory. ), and drive the corresponding connection device according to a preset program.
  • the input unit 604 can also include He inputs devices such as physical keyboards, function keys (such as volume control buttons, switch buttons, etc.), mice, and so on.
  • the display 602 may specifically include a display panel.
  • the display panel may be configured in the form of a liquid crystal display (LCD) or an organic light-emitting diode (OLED).
  • the touch screen 641 can cover the display panel to form a touch display screen, and when the touch display screen detects a touch operation on or near it, it is transmitted to the processor 603 to perform corresponding processing.
  • the processor 603 after calling the program stored in the memory 601, and/or the module, and/or the data, the processor 603 outputs the picture content corresponding to the target picture to the graphics processor after the current processing request is performed. And releasing the target memory occupied by the target image; wherein the target memory is used to record a memory copy corresponding to the target image.
  • embodiments of the embodiments of the present application can be provided as a method, apparatus, or computer program product. Therefore, the embodiments of the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Moreover, embodiments of the present application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
  • computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • the computer device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
  • the memory may include non-persistent memory, random access memory (RAM), and/or non-volatile memory in a computer readable medium, such as read only memory (ROM) or flash memory.
  • RAM random access memory
  • ROM read only memory
  • Memory is an example of a computer readable medium.
  • Computer readable media includes both permanent and non-persistent, removable and non-removable media.
  • Information storage can be implemented by any method or technology. The information can be computer readable instructions, data structures, modules of programs, or other data.
  • Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic randomness Access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, CD-ROM Read-Only Memory (CD-ROM), Digital Versatile Disc (DVD) or other optical storage, magnetic cassette, magnetic tape storage or other magnetic storage device or any other non-transportable medium that can be used for storage to be accessed by computing devices Information.
  • computer readable media does not include non-persistent computer readable media, such as modulated data signals and carrier waves.
  • Embodiments of the present application are described with reference to flowcharts and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the present application. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG.
  • These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor or other programmable data processing terminal device to produce a machine such that instructions are executed by a processor of a computer or other programmable data processing terminal device
  • Means are provided for implementing the functions specified in one or more of the flow or in one or more blocks of the flow chart.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the instruction device implements the functions specified in one or more blocks of the flowchart or in a flow or block of the flowchart.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Information Transfer Between Computers (AREA)
  • Facsimiles In General (AREA)

Abstract

一种图片处理方法、装置和智能终端,其中,该方法具体包括:在将当前处理请求对应的目标图片的图片内容输出至图形处理器后,确定所述目标图片是否正被其他处理请求使用,其中,所述目标内存用于记录所述目标图片对应的内存拷贝(201);在所述目标图片未被其他处理请求使用时,释放所述目标图片所占用的目标内存(202)。上述方法能够大大减轻系统内存的压力并且提高内存利用率,从而能够提高智能终端的整体性能。

Description

一种图片处理方法、装置和智能终端 技术领域
本申请涉及信息处理技术领域,特别是涉及一种图片处理方法、一种图片处理装置和一种智能终端。
背景技术
随着手机、平板电脑、智能电视等智能终端的不断普及,UI(用户界面,User Interface)在APP(应用程序,Application Program)的人机交互中起到了重要的作用。目前,智能终端在构建/绘制UI的过程中需要处理大量的本地图片,例如将本地图片设置为桌面背景,或者将本地图片设置为应用程序的图标等。
一种现有方案的图片处理流程具体可以包括:
步骤1、将本地图片装载至第一内存,并按照图片格式将该本地图片转化为对应的图片内容;
步骤2、将转化好的图片内容上传至图形处理器的第二内存;
步骤3、图形处理器依据该第二内存中的图片内容处理图片,并将对应的处理结果输出到智能终端;
步骤4、在该本地图片对应的应用程序退出时,销毁该应用程序所用到的所有内存。
可以看出,现有方案在该本地图片对应的应用程序退出时,销毁该应用程序所用到的所有内存的做法,能够在重复装载同一张本地图片时、省去将本地图片装载至第一内存的过程。
然而,随着智能终端所处理的本地图片的不断增多,上述第一内存和上述第二内存将消耗越来越多的系统内存,从而对智能终端的整体性能造成影响。特别是对于系统内存较为有限的智能终端(如系统内存为1G或512M的智能终端),上述消耗系统内存的问题将严重智能终端的性能,例 如使得其他应用程序无法启动等,这里,其他应用程序可以为除了该本地图片对应的应用程序之外的应用程序。
发明内容
本申请实施例所要解决的技术问题是提供一种图片处理方法,能够大大减轻系统内存的压力,以及能够提高内存利用率,从而能够提高智能终端的整体性能。
相应的,本申请实施例还提供了一种图片处理装置和一种智能终端,用以保证上述方法的实现及应用。
为了解决上述问题,本申请公开了一种图片处理方法,包括:
在将当前处理请求对应目标图片的图片内容输出至图形处理器后,释放所述目标图片所占用的目标内存;其中,所述目标内存用于记录所述目标图片对应的内存拷贝。
可选地,所述方法还包括:
在将当前处理请求对应目标图片的图片内容输出至图形处理器后,确定所述目标图片是否正被其他处理请求使用;
所述释放所述目标图片所占用的目标内存的步骤,包括:在所述目标图片未正被其他处理请求使用时,释放所述目标图片所占用的目标内存。
可选地,所述确定所述目标图片是否正被其他处理请求使用的步骤,包括:
在所述目标图片被处理请求使用的次数为第一预设值时,确定所述目标图片未正被其他处理请求使用。
可选地,通过如下步骤更新所述目标图片被处理请求使用的次数:
在所述目标图片将被当前处理请求使用时,记录所述目标图片被处理请求使用的次数;
在将当前处理请求对应目标图片的图片内容成功输出至图形处理器后,将所述目标图片被处理请求使用的次数减少设定量。
可选地,通过如下步骤更新所述目标图片被处理请求使用的次数:
针对接收到的当前处理请求,当其唯一标识未在标识集合中出现时,将其唯一标识添加至标识集合,并将所述唯一标识的出现次数更新为第二预设值;其中,所述唯一标识为依据所述当前处理请求对应目标图片生成的标识,不同目标图片对应不同的唯一标识;
针对接收到的当前处理请求,当其唯一标识在所述标识集合中出现时,将所述唯一标识的出现次数增加设定量,以所述出现次数作为所述目标图片被处理请求使用的次数;
在将当前处理请求对应目标图片的图片内容成功输出至图形处理器后,将相应唯一标识的出现次数减少设定量。
可选地,通过如下步骤获取所述目标图片被处理请求使用的次数:
依据所述目标内存的标识,在目标内存的标识与目标图片被处理请求使用的次数的映射关系中进行查找,以得到所述目标内存对应目标图片被处理请求使用的次数。
可选地,所述确定所述目标图片是否正被其他处理请求使用的步骤,包括:
在所述目标图片具有预置标记时,确定所述目标图片未正被其他处理请求使用。
可选地,所述方法还包括:
在获取目标图片的图片内容前,判断所述目标图片所占用的目标内存中是否存在所述目标图片对应的内存拷贝;
在所述目标内存中不存在所述目标图片对应的内存拷贝时,重新将所述目标图片装载至对应的目标内存。
可选地,所述方法还包括:
在所述目标内存中不存在所述目标图片对应的内存拷贝时,判断所述目标内存的标识和/或所述当前处理请求是否符合预置规则;
在所述目标内存的标识和/或所述当前处理请求符合预置规则时,重新将所述目标图片装载至对应的目标内存。
另一方面,本申请还公开了一种图片处理装置,包括:
释放模块,用于在将当前处理请求对应目标图片的图片内容输出至图形处理器后,释放所述目标图片所占用的目标内存;其中,所述目标内存用于记录所述目标图片对应的内存拷贝。
可选地,所述装置还包括:
确定模块,用于在将当前处理请求对应目标图片的图片内容输出至图形处理器后,确定所述目标图片是否正被其他处理请求使用;
所述释放模块,包括:
释放子模块,用于在所述目标图片未正被其他处理请求使用时,释放所述目标图片所占用的目标内存。
可选地,所述确定模块,包括:
第一确定子模块,用于在所述目标图片被处理请求使用的次数为第一预设值时,确定所述目标图片未正被其他处理请求使用。
可选地,所述装置还包括:
第一更新模块,用于更新所述目标图片被处理请求使用的次数:
所述第一更新模块,包括:
记录子模块,用于在所述目标图片将被当前处理请求使用时,记录所述目标图片被处理请求使用的次数;以及
第一更新子模块,用于在将当前处理请求对应目标图片的图片内容成功输出至图形处理器后,将所述目标图片被处理请求使用的次数减少设定量。
可选地,所述装置还包括:
第二更新模块,用于更新所述目标图片被处理请求使用的次数:
所述第二更新模块,包括:
第二更新子模块,用于针对接收到的当前处理请求,当其唯一标识未在标识集合中出现时,将其唯一标识添加至标识集合,并将所述唯一标识的出现次数更新为第二预设值;其中,所述唯一标识为依据所述当前处理请求对应目标图片生成的标识,不同目标图片对应不同的唯一标识;
第三更新子模块,用于针对接收到的当前处理请求,当其唯一标识在所述标识集合中出现时,将所述唯一标识的出现次数增加设定量,以所述出现次数作为所述目标图片被处理请求使用的次数;以及
第四更新子模块,用于在将当前处理请求对应目标图片的图片内容成功输出至图形处理器后,将相应唯一标识的出现次数减少设定量。
可选地,所述装置还包括:
获取模块,用于获取所述目标图片被处理请求使用的次数:
所述获取模块,包括:
查找子模块,用于依据所述目标内存的标识,在目标内存的标识与目标图片被处理请求使用的次数的映射关系中进行查找,以得到所述目标内存对应目标图片被处理请求使用的次数。
可选地,所述确定模块,包括:
第二确定子模块,用于在所述目标图片具有预置标记时,确定所述目标图片未正被其他处理请求使用。
可选地,所述装置还包括:
第一判断模块,用于在获取目标图片的图片内容前,判断所述目标图片所占用的目标内存中是否存在所述目标图片对应的内存拷贝;
重新装载模块,用于在所述目标内存中不存在所述目标图片对应的内存拷贝时,重新将所述目标图片装载至对应的目标内存。
可选地,所述装置还包括:
第二判断模块,用于在所述目标内存中不存在所述目标图片对应的内存拷贝时,判断所述目标内存的标识和/或所述当前处理请求是否符合预置规则;
所述重新装载模块,包括:
装载子模块,用于在所述目标内存的标识和/或所述当前处理请求符合预置规则时,重新将所述目标图片装载至对应的目标内存。
再一方面,本申请公开了一种智能终端,包括有存储器,以及一个或者一个以上的程序,其中一个或者一个以上程序存储于存储器中,且经配置以由一个或者一个以上处理器执行所述一个或者一个以上程序包含用于进行以下操作的指令:
在将当前处理请求对应目标图片的图片内容输出至图形处理器后,释放所述目标图片所占用的目标内存;其中,所述目标内存用于记录所述目标图片对应的内存拷贝。
与现有技术相比,本申请实施例包括以下优点:
本申请实施例在将当前处理请求对应目标图片的图片内容输出至图形处理器后,释放所述目标图片所占用的目标内存;其中,所述目标内存用于记录所述目标图片对应的内存拷贝;相对于现有方案在应用程序退出时销毁内存的做法,本申请实施例中上述释放目标图片所占用的目标内存的做法,可以及时地释放系统内存以供当前应用程序或者其他应用程序使 用,因此,能够大大减轻系统内存的压力,以及能够提高内存利用率,从而能够提高智能终端的整体性能。
另外,本申请实施例还可以适用于系统内存较为有限的智能终端(如系统内存为1G或512M的智能终端),此种情况下,将能够提高智能终端在极端条件下的运行能力。
再者,本申请实施例可以在确定目标图片未正被其他处理请求使用时,释放所述目标图片所占用的目标内存;其中,目标图片未正被其他处理请求使用可用于表征上述目标图片对应的内存拷贝未正被其他处理请求使用,由于可以避免在处理其他处理请求时重复装载上述目标图片,因此能够在不影响图片处理的效率的前提下,大大减轻系统内存的压力,以及能够提高内存利用率。
附图说明
图1是本申请的一种信息处理方法的应用环境的结构示意图;
图2是本申请的一种图片处理方法实施例二的步骤流程图;
图3是本申请的一种图片处理方法实施例三的步骤流程图;
图4是本申请的一种图片处理方法实施例四的步骤流程图;
图5是本申请的一种图片处理装置实施例二的结构框图;以及
图6是本申请的一种智能终端实施例的结构框图。
具体实施方式
为使本申请的上述目的、特征和优点能够更加明显易懂,下面结合附图和具体实施方式对本申请作进一步详细的说明。
现有方案在本地图片对应的应用程序退出时,销毁该应用程序所用到的所有内存的做法,容易导致所消耗的系统内存随着所处理的本地图片的增多而增加,从而对智能终端的整体性能造成影响。
本申请实施例经研究发现,图形处理器通常仅仅能够识别转化好的图 片内容(如纹理内容),而无法识别第一内存中记录的、图片对应的内存拷贝,也即,图形处理器并不存在对于上述内存拷贝的需求。
因此,本申请实施例创造性地提出,在目标图片对应应用程序的运行过程中释放对应的目标内存,具体地,在将当前处理请求对应目标图片的图片内容输出至图形处理器后,释放所述目标图片所占用的目标内存;其中,所述目标内存用于记录所述目标图片对应的内存拷贝;相对于现有方案在应用程序退出时销毁内存的做法,本申请实施例中上述释放目标图片所占用的目标内存的做法,可以及时地释放系统内存以供当前应用程序或者其他应用程序使用,因此,能够大大减轻系统内存的压力,以及能够提高内存利用率,从而能够提高智能终端的整体性能。
在本申请的一种应用示例中,假设目标图片的大小为1024×768×4byte,则若将该目标图片设置为桌面背景,则需要消耗3145728byte的目标内存;而应用本申请实施例,上述目标内存能够在目标图片对应应用程序(如桌面程序)的运行过程中得到释放,因此能够大大减轻系统内存的压力,以及能够提高内存利用率。
方法实施例一
本申请提供了一种图片处理方法实施例一,该方法实施例一具体可以包括:在将当前处理请求对应目标图片的图片内容输出至图形处理器后,释放所述目标图片所占用的目标内存;其中,所述目标内存可用于记录所述目标图片对应的内存拷贝。
本申请实施例提供的图片处理方法可应用于图1所示的应用环境中。如图1所示,客户端100与服务器200可以位于有线或无线网络中,通过该有线或无线网络,客户端100与服务器200进行数据交互。或者,客户端100与服务器200可以运行在同一智能终端上,通过IPC(进程间通信,Inter-Process Communication)方式,客户端100与服务器200进行数据交互。或者,客户端100与服务器200可以运行在同一智能终端的同一进程中,通过线程间通信方式,客户端100与服务器200进行数据交互,例 如,在上述服务器200位于某应用程序的渲染线程时,上述客户端100可以位于该应用程序的GUI(图形用户接口,Graphical User Interface)线程。可以理解,本申请实施例对于客户端100与服务器200的数据交互方式不加以限制。
在实际应用中,上述智能终端具体包括但不限:智能手机、平板电脑、电子书阅读器、MP3(动态影像专家压缩标准音频层面3,Moving Picture Experts Group Audio Layer III)播放器、MP4(动态影像专家压缩标准音频层面4,Moving Picture Experts Group Audio Layer IV)播放器、膝上型便携计算机、车载电脑、台式计算机、机顶盒、智能电视机、可穿戴设备等等。
在本申请的一种可选实施例中,客户端100与服务器200之间的数据交互过程具体可以包括如下步骤:
步骤A1、客户端100向服务器200发送处理请求,并在该处理请求中携带目标图片的图片参数信息(如宽、高、单位像素位数等信息)和地址信息等信息;
步骤A2、服务器200在接收到该处理请求后,可以依据该图片参数信息申请并生成对应的目标内存;
在本申请的一种可选实施例中,上述目标内存具体可以包括:图片容器。其中,容器为计算机软件面向对象设计的一个常用设计模式,图片容器可用于表示存储目标图片对应的内存拷贝以及图片属性的对象。
步骤A3、服务器200依据该地址信息读取目标图片并将其内存拷贝存放于上述目标内存中;
步骤A4、服务器200按照图片格式将该目标图片转化为对应的图片内容;
在本申请的一种可选实施例中,服务器200可以生成纹理装配器,并通过该纹理装配器将该目标图片转化为对应的纹理内容,可以理解,本申请实施例对于具体的图片内容及该图片内容的具体获取过程不加以限制。
步骤A5、服务器200将转化好的图片内容输出至图形处理器;
步骤A6、服务器200在将转化好的图片内容成功输出至图形处理器后,释放上述目标内存;
步骤A7、服务器200通过图形处理器处理上述图片内容,并将对应的处理结果输出到智能终端。
在本申请的一种可选实施例中,图形处理器处理上述图片内容的过程可以包括:对上述图片内存进行渲染以得到对应的渲染结果等,可以理解,本申请实施例对于图形处理器处理上述图片内容的具体过程不加以限制。
综上,应用本申请实施例,上述目标内存能够在目标图片对应应用程序(如桌面程序)的运行过程中得到释放,因此能够大大减轻系统内存的压力,以及能够提高内存利用率。
另外,本申请实施例还可以适用于系统内存较为有限的智能终端(如系统内存为1G或512M的智能终端),此种情况下,将能够提高智能终端在极端条件下的运行能力。
方法实施例二
参照图2,示出了本申请的一种图片处理方法实施例二的步骤流程图,具体可以包括如下步骤:
步骤201、在将当前处理请求对应目标图片的图片内容输出至图形处理器后,确定所述目标图片是否正被其他处理请求使用;其中,所述目标内存可用于记录所述目标图片对应的内存拷贝;
步骤202、在所述目标图片未正被其他处理请求使用时,释放所述目标图片所占用的目标内存。
相对于方法实施例一,本实施例可以在所述目标图片未正被其他处理请求使用时,释放所述目标图片所占用的目标内存;其中,目标图片正被其他处理请求使用可用于表征上述目标图片对应的内存拷贝正被其他处 理请求使用。由于在所述目标图片正被其他处理请求使用的情况下、若释放所述目标图片所占用的目标内存,则在处理其他处理请求时需要将所述目标图片重复装载至对应的目标内存,而上述重复装载容易增加图片处理的时间、以及容易降低图片处理的效率;因此,本实施例在所述目标图片未正被其他处理请求使用时,释放所述目标图片所占用的目标内存,能够在不影响图片处理的效率的前提下,大大减轻系统内存的压力,以及能够提高内存利用率。
本申请实施例可以提供目标图片是否正被其他处理请求使用的如下确定方案:
确定方案1、
确定方案1中,可以依据所述目标图片被处理请求使用的次数,确定所述目标图片是否正被其他处理请求使用,相应地,所述确定所述目标图片是否正被其他处理请求使用的步骤,具体可以包括:在所述目标图片被处理请求使用的次数为第一预设值时,确定所述目标图片未正被其他处理请求使用。
在本申请的一种可选实施例中,可以通过如下步骤获取所述目标图片被处理请求使用的次数:依据所述目标内存的标识,在目标内存的标识与目标图片被处理请求使用的次数的映射关系中进行查找,以得到所述目标内存对应目标图片被处理请求使用的次数。上述查找可以提高所述目标图片被处理请求使用的次数的获取速度。
例如,可以为某目标图片的图片容器分配一个随机数,作为该图片容器的ID(标识,Identity),并将该图片容器的ID与该目标图片被处理请求使用的次数进行绑定,以得到目标内存的标识与目标图片被处理请求使用的次数的映射关系。
本申请实施例可以提供所述目标图片被处理请求使用的次数的如下更新方案:
更新方案1、
更新方案1中,可以通过如下步骤更新所述目标图片被处理请求使用的次数:
步骤B1、在所述目标图片将被当前处理请求使用时,记录所述目标图片被处理请求使用的次数;
步骤B2、在将当前处理请求对应目标图片的图片内容成功输出至图形处理器后,将所述目标图片被处理请求使用的次数减少设定量。
在实际应用中,可以针对目标图片被处理请求使用的次数设置对应的变量,例如可以设定该变量的第一预设值为零,则在接收到当前处理请求后,说明产生了使用目标图片的一次处理请求,则上述步骤B1的记录过程可以包括:针对当前处理请求对应目标图片,将其对应的变量的值增加设定量;以及,在将当前处理请求对应目标图片的图片内容成功输出至图形处理器后,说明使用目标图片的一次处理请求被处理完毕,也即该次处理请求已不需要目标图片的内存拷贝,故可以针对当前处理请求对应目标图片,将其对应的变量的值减少设定量。
需要说明的是,对于接收到的当前处理请求,可以将当前处理请求中携带的地址信息等参数与上述变量的地址信息进行匹配,以获得当前处理请求所对应的变量。可以理解,本申请实施例对于当前处理请求所对应的变量的具体获取过程不加以限制。
另外,需要说明的是,上述变量的第一预设值为零只是作为本申请的应用示例,实际上,上述变量的第一预设值还可以为非零值,则在上述变量的当前值与第一预设值相同时,可以确定所述目标图片未正被其他处理请求使用。可以理解,本申请实施例对于所述目标图片被处理请求使用的次数的具体表征方式不加以限制。
另外,上述设定量对应的值可以用于表示一次处理请求对应变量的值,其可以为1、2等数值,本申请实施例对于上述设定量对应的具体数值也不加以限制。
更新方案2、
更新方案2中,可以通过如下步骤更新所述目标图片被处理请求使用的次数:
步骤C1、针对接收到的当前处理请求,当其唯一标识未在标识集合中出现时,将其唯一标识添加至标识集合,并将所述唯一标识的出现次数更新为第二预设值;其中,上述唯一标识为依据所述当前处理请求对应目标图片生成的标识,不同目标图片对应不同的唯一标识;
在本申请的一种应用示例中,上述第二预设值与第一预设值的差值可以为上述设定量,可以理解,本申请实施例对于上述第一预设值、第二预设值和设定量的具体数值不加以限制。
步骤C2、针对接收到的当前处理请求,当其唯一标识在所述标识集合中出现时,将所述唯一标识的出现次数增加设定量,以所述出现次数作为所述目标图片被处理请求使用的次数;
步骤C3、在将当前处理请求对应目标图片的图片内容成功输出至图形处理器后,将所述出现次数减少设定量。
在实际应用中,可以针对接收到的当前处理请求,依据其对应目标图片的信息生成对应的唯一标识,其中,不同目标图片对应不同的唯一标识,相同目标图片对应相同的唯一标识;由此可以基于唯一码实现目标图片被处理请求使用的次数的更新。
在实际应用中,可以采用GUID(全局唯一标识符,globally unique identifier)等算法生成上述唯一标识。可以理解,本申请实施例对于唯一标识的具体生成过程不加以限制。
在本申请的一种应用示例中,上述更新所述目标图片被处理请求使用的次数的过程具体可以包括:
步骤D1、服务器在初始化阶段,生成标识集合;同时生成ID发生器, 该ID发生器用于向所有客户端提供唯一标识的生成服务;
步骤D2、客户端向该ID发生器发送目标图片的信息,以使该ID发生器依据该目标图片的信息生成对应的唯一标识;
步骤D3、客户端向服务器发送处理请求,其中,该处理请求中携带有目标图片对应的唯一标识;
步骤D4、服务器针对接收到的当前处理请求,判断其唯一标识是否在标识集合中出现;
步骤D5、当上述唯一标识未在标识集合中出现时,将上述唯一标识添加至标识集合,并将所述唯一标识的出现次数更新为第二预设值;
步骤D6、当上述唯一标识在标识集合中出现时,将所述唯一标识的出现次数增加设定量;
步骤D7、在将当前处理请求对应目标图片的图片内容成功输出至图形处理器后,将相应唯一标识的出现次数减少设定量。
以上对目标图片被处理请求使用的次数的更新方案进行了详细介绍,可以理解,本领域技术人员可以根据实际应用需求,采用各种方式表征和更新目标图片被处理请求使用的次数,本申请实施例对于目标图片被处理请求使用的次数的具体更新方案不加以限制。
确定方案2、
确定方案2中,所述确定所述目标图片是否正被其他处理请求使用的步骤,具体可以包括:在所述目标图片具有预置标记时,确定所述目标图片未正被其他处理请求使用。
相对于确定方案1依据所述目标图片被处理请求使用的次数,在线确定目标图片是否正被其他处理请求使用,确定方案2可以通过预置标记对符合预置条件的图片进行提前标记。
在实际应用中,上述符合预置条件的图片具体可以包括:被唯一应用程序在整个生命周期中使用一次的图片。例如,在智能终端启动后,桌面 程序通常仅针对桌面背景对应的目标图片执行一次处理操作,因此,桌面背景对应的目标图片可作为被唯一应用程序在整个生命周期中使用一次的图片。
另外,在实际应用中,应用程序的开发者可以在上传图片时携带对应的预置标记,以使应用程序的使用者依据该预置标记进行图片的识别。可以理解,本申请实施例对于该预置标记的具体产生过程不加以限制。
以上对目标图片是否正被其他处理请求使用的确定方案1-确定方案2进行了详细介绍,可以理解,本领域技术人员可以根据实际应用需求,采用上述确定方案1-确定方案2中的任一,或者,还可以采用目标图片是否正被其他处理请求使用的其他确定方案,本申请实施例对于目标图片是否正被其他处理请求使用的具体确定方案不加以限制。
综上,本实施例可以在确定目标图片未正被其他处理请求使用时,释放所述目标图片所占用的目标内存;其中,目标图片未正被其他处理请求使用可用于表征上述目标图片对应的内存拷贝未正被其他处理请求使用,由于可以避免在处理其他处理请求时重复装载上述目标图片,因此能够在不影响图片处理的效率的前提下,大大减轻系统内存的压力,以及能够提高内存利用率。
方法实施例三
参照图3,示出了本申请的一种图片处理方法实施例三的步骤流程图,具体可以包括如下步骤:
步骤301、在获取目标图片的图片内容前,判断所述目标图片所占用的目标内存中是否存在所述目标图片对应的内存拷贝;其中,所述目标内存可用于记录所述目标图片对应的内存拷贝;
步骤302、在所述目标内存中不存在所述目标图片对应的内存拷贝时,重新将所述目标图片装载至对应的目标内存;
步骤303、在将当前处理请求对应目标图片的图片内容输出至图形处理器后,释放所述目标图片所占用的目标内存。
本申请实施例中,获取目标图片的图片内容的过程通常为,从目标内存中读取目标图片对应的内存拷贝,并依据该内存拷贝获取目标图片的图片内容,如通过纹理装配器依据内存拷贝生成对应的纹理内容等。
然而,在实际应用中,通常会存在多个客户端竞争使用服务器、应用程序本身存在不可预期的异常退出等情况,上述情况下容易因异常操作而导致的内存拷贝被异常释放;而在内存拷贝被异常释放的情况下,将无法从目标内存中准确读取目标图片对应的内存拷贝,从而导致目标图片的异常处理。
针对上述情况,本申请实施例可以在获取目标图片的图片内容前,判断所述目标图片所占用的目标内存中是否存在所述目标图片对应的内存拷贝,并在所述目标内存中不存在所述目标图片对应的内存拷贝时,重新将所述目标图片装载至对应的目标内存,以依据所述目标内存中内存拷贝获取对应的图片内容;上述针对目标图片的异常处理的措施,能够提高图片处理的健壮性和稳定性。
在本申请的一种应用示例中,在通过纹理装配器生成目标图片的纹理内容前,可以判断所述目标图片所占用的图片容器中是否存在所述目标图片对应的内存拷贝;例如,可以依据该图片容器的ID从该图片容器中读取内容,若读取内容为空,或者读取内容为乱码,则可以认为该图片容器中不存在所述目标图片对应的内存拷贝,故可以重新将所述目标图片装载至对应的图片容器,重新生成纹理装配器,并通过该纹理装配器依据图片容器中内容生成对应的纹理内容。需要说明的是,在读取内容合法时,可以生成纹理装配器并通过该纹理装配器依据读取内容生成对应的纹理内容。
在本申请的一种可选实施例中,所述方法还可以包括:在所述目标内存中不存在所述目标图片对应的内存拷贝时,判断所述目标内存的标识和/或所述当前处理请求是否符合预置规则;在所述目标内存的标识和/或所 述当前处理请求符合预置规则时,重新将所述目标图片装载至对应的目标内存。
其中,上述预置规则可以为用于衡量目标内存的标识和/或所述当前处理请求的合法性的规则,如第一预置规则可用于衡量目标内存的标识是否合法,第二预置规则可用于衡量所述当前处理请求对应请求方的标识是否合法等。在所述目标内存的标识和所述当前处理请求合法时,可以认为所述当前处理请求为有效的处理请求,因此,可以重新对当前处理请求进行处理。
需要说明的是,在所述目标内存的标识和所述当前处理请求中一者不合法时,可以认为所述当前处理请求为无效的处理请求,因此,可以丢弃该当前处理请求,而可以不重新对该当前处理请求进行处理。
综上,本申请实施例在获取目标图片的图片内容前,判断所述目标图片所占用的目标内存中是否存在所述目标图片对应的内存拷贝,并在所述目标内存中不存在所述目标图片对应的内存拷贝时,重新将所述目标图片装载至对应的目标内存;上述针对目标图片的异常处理的措施,能够提高图片处理的健壮性和稳定性。
方法实施例四
参照图4,示出了本申请的一种图片处理方法实施例四的步骤流程图,具体可以包括如下步骤:
步骤401、接收当前处理请求;其中,所述当前处理请求中可以包括目标图片的信息;
步骤402、依据所述目标图片的信息,申请并生成对应的图片容器;
其中,目标图片与图片容器可以为一对一的关系;
步骤403、依据所述目标图片的信息,将所述目标图片装载至上述图片容器;
步骤404、生成纹理装配器,通过该纹理装配器从上述图片容器中读取目标图片的内容拷贝,并依据该内容拷贝生成对应的纹理内容;
步骤405、将当前处理请求对应目标图片的纹理内容输出至图形处理器;
步骤406、在将当前处理请求对应目标图片的纹理内容成功输出至图形处理器后,确定所述目标图片是否正被其他处理请求使用,若否,则执行步骤407;
步骤407、在所述目标图片未正被其他处理请求使用时,释放所述目标图片所占用的图片容器;
步骤408、图形处理器依据本地显存中存储的纹理内容进行目标图片的处理;
步骤409、图形处理器将目标图片的处理结果输出到智能终端,以在该智能终端上显示该目标图片;
步骤410、判断当前处理请求对应的应用程序是否退出,若是,则执行步骤411;
其中,可以通过应用程序的主进程是否存在、是否接收到用户针对应用程序的关闭指令等方式,判断当前处理请求对应的应用程序是否退出。
步骤411、释放所述图片容器和所述纹理装配器。
需要说明的是,在步骤406的判断结果为否时,可以按照现有方案的流程,在当前处理请求对应的应用程序退出时释放图片容器。
需要说明的是,对于方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请实施例并不受所描述的动作顺序的限制,因为依据本申请实施例,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作并不一定是本申请实施例所必须的。
装置实施例一
本申请提供了一种图片处理装置实施例一,该装置实施例一具体可以包括:
释放模块,用于在将当前处理请求对应目标图片的图片内容输出至图形处理器后,释放所述目标图片所占用的目标内存;其中,所述目标内存用于记录所述目标图片对应的内存拷贝。
装置实施例二
参照图5,示出了本申请的一种图片处理装置实施例二的结构框图,具体可以包括如下模块:
确定模块501,用于在将当前处理请求对应目标图片的图片内容输出至图形处理器后,确定所述目标图片是否正被其他处理请求使用;
释放模块502,用于在将当前处理请求对应目标图片的图片内容输出至图形处理器后,释放所述目标图片所占用的目标内存;其中,所述目标内存用于记录所述目标图片对应的内存拷贝;
其中,所述释放模块502,具体可以包括:
释放子模块521,用于在所述目标图片未正被其他处理请求使用时,释放所述目标图片所占用的目标内存。
在本申请的一种可选实施例中,所述确定模块501,具体可以包括:
第一确定子模块,用于在所述目标图片被处理请求使用的次数为第一预设值时,确定所述目标图片未正被其他处理请求使用。
在本申请的另一种可选实施例中,所述装置还可以包括:
第一更新模块,用于更新所述目标图片被处理请求使用的次数:
所述第一更新模块,包括:
记录子模块,用于在所述目标图片将被当前处理请求使用时,记录所述目标图片被处理请求使用的次数;以及
第一更新子模块,用于在将当前处理请求对应目标图片的图片内容成功输出至图形处理器后,将所述目标图片被处理请求使用的次数减少设定量。
在本申请的再一种可选实施例中,所述装置还可以包括:
第二更新模块,用于更新所述目标图片被处理请求使用的次数:
所述第二更新模块,具体可以包括:
第二更新子模块,用于针对接收到的当前处理请求,当其唯一标识未在标识集合中出现时,将其唯一标识添加至标识集合,并将所述唯一标识的出现次数更新为第二预设值;其中,所述唯一标识为依据所述当前处理请求对应目标图片生成的标识,不同目标图片对应不同的唯一标识;
第三更新子模块,用于针对接收到的当前处理请求,当其唯一标识在所述标识集合中出现时,将所述唯一标识的出现次数增加设定量,以所述出现次数作为所述目标图片被处理请求使用的次数;以及
第四更新子模块,用于在将当前处理请求对应目标图片的图片内容成功输出至图形处理器后,将相应唯一标识的出现次数减少设定量。
在本申请的又一种可选实施例中,所述装置还可以包括:
获取模块,用于获取所述目标图片被处理请求使用的次数:
所述获取模块,具体可以包括:
查找子模块,用于依据所述目标内存的标识,在目标内存的标识与目标图片被处理请求使用的次数的映射关系中进行查找,以得到所述目标内存对应目标图片被处理请求使用的次数。
在本申请的一种可选实施例中,所述确定模块501,具体可以包括:
第二确定子模块,用于在所述目标图片具有预置标记时,确定所述目 标图片未正被其他处理请求使用。
在本申请的另一种可选实施例中,所述装置还可以包括:
第一判断模块,用于在获取目标图片的图片内容前,判断所述目标图片所占用的目标内存中是否存在所述目标图片对应的内存拷贝;
重新装载模块,用于在所述目标内存中不存在所述目标图片对应的内存拷贝时,重新将所述目标图片装载至对应的目标内存。
在本申请的又一种可选实施例中,所述装置还可以包括:
第二判断模块,用于在所述目标内存中不存在所述目标图片对应的内存拷贝时,判断所述目标内存的标识和/或所述当前处理请求是否符合预置规则;
则所述重新装载模块,具体可以包括:
装载子模块,用于在所述目标内存的标识和/或所述当前处理请求符合预置规则时,重新将所述目标图片装载至对应的目标内存。
对于装置实施例而言,由于其与方法实施例基本相似,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。
智能终端实施例
参照图6,示出了本申请一种智能终端实施例的结构框图,具体可以包括:至少一个存储器601、显示器602、至少一个处理器603和至少一个输入单元604。
其中,该输入单元604可用于接收用户输入的数字或字符信息,以及控制信号。具体地,本申请实施例中,该输入单元604可以包括触摸屏641,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触摸屏641上的操作),并根据预先设定的程式驱动相应的连接装置。当然,除了触摸屏641,输入单元604还可以包括其 他输入设备,如物理键盘、功能键(比如音量控制按键、开关按键等)、鼠标等。
显示器602具体可以包括显示面板,可选的,可以采用液晶显示器(Liquid Crystal Display,LCD)或有机发光二极管(Organic Light-Emitting Diode,OLED)等形式来配置显示面板。其中,触摸屏641可以覆盖显示面板,形成触摸显示屏,当该触摸显示屏检测到在其上或附近的触摸操作后,传送给处理器603以执行相应的处理。
在本申请实施例中,通过调用存储该存储器601内的程序,和/或,模块,和/或,数据,处理器603在将当前处理请求对应目标图片的图片内容输出至图形处理器后,释放所述目标图片所占用的目标内存;其中,所述目标内存用于记录所述目标图片对应的内存拷贝。
本说明书中的各个实施例均采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似的部分互相参见即可。
本领域内的技术人员应明白,本申请实施例的实施例可提供为方法、装置、或计算机程序产品。因此,本申请实施例可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
在一个典型的配置中,所述计算机设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机 存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括非持续性的电脑可读媒体(transitory media),如调制的数据信号和载波。
本申请实施例是参照根据本申请实施例的方法、终端设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理终端设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理终端设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理终端设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理终端设备上,使得在计算机或其他可编程终端设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程终端设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
尽管已描述了本申请实施例的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例做出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本申请实施例范围的所有变更和修改。
最后,还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者终端设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者终端设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者终端设备中还存在另外的相同要素。
以上对本申请所提供的一种图片处理方法、一种图片处理装置和一种智能终端,进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。

Claims (19)

  1. 一种图片处理方法,其特征在于,包括:
    在将当前处理请求对应目标图片的图片内容输出至图形处理器后,释放所述目标图片所占用的目标内存;其中,所述目标内存用于记录所述目标图片对应的内存拷贝。
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    在将当前处理请求对应目标图片的图片内容输出至图形处理器后,确定所述目标图片是否正被其他处理请求使用;
    所述释放所述目标图片所占用的目标内存的步骤,包括:在所述目标图片未正被其他处理请求使用时,释放所述目标图片所占用的目标内存。
  3. 根据权利要求2所述的方法,其特征在于,所述确定所述目标图片是否正被其他处理请求使用的步骤,包括:
    在所述目标图片被处理请求使用的次数为第一预设值时,确定所述目标图片未正被其他处理请求使用。
  4. 根据权利要求3所述的方法,其特征在于,通过如下步骤更新所述目标图片被处理请求使用的次数:
    在所述目标图片将被当前处理请求使用时,记录所述目标图片被处理请求使用的次数;
    在将当前处理请求对应目标图片的图片内容成功输出至图形处理器后,将所述目标图片被处理请求使用的次数减少设定量。
  5. 根据权利要求3所述的方法,其特征在于,通过如下步骤更新所述目标图片被处理请求使用的次数:
    针对接收到的当前处理请求,当其唯一标识未在标识集合中出现时, 将其唯一标识添加至标识集合,并将所述唯一标识的出现次数更新为第二预设值;其中,所述唯一标识为依据所述当前处理请求对应目标图片生成的标识,不同目标图片对应不同的唯一标识;
    针对接收到的当前处理请求,当其唯一标识在所述标识集合中出现时,将所述唯一标识的出现次数增加设定量,以所述出现次数作为所述目标图片被处理请求使用的次数;
    在将当前处理请求对应目标图片的图片内容成功输出至图形处理器后,将相应唯一标识的出现次数减少设定量。
  6. 根据权利要求3至5中任一所述的方法,其特征在于,通过如下步骤获取所述目标图片被处理请求使用的次数:
    依据所述目标内存的标识,在目标内存的标识与目标图片被处理请求使用的次数的映射关系中进行查找,以得到所述目标内存对应目标图片被处理请求使用的次数。
  7. 根据权利要求2所述的方法,其特征在于,所述确定所述目标图片是否正被其他处理请求使用的步骤,包括:
    在所述目标图片具有预置标记时,确定所述目标图片未正被其他处理请求使用。
  8. 根据权利要求1至5中任一所述的方法,其特征在于,所述方法还包括:
    在获取目标图片的图片内容前,判断所述目标图片所占用的目标内存中是否存在所述目标图片对应的内存拷贝;
    在所述目标内存中不存在所述目标图片对应的内存拷贝时,重新将所述目标图片装载至对应的目标内存。
  9. 根据权利要求8所述的方法,其特征在于,所述方法还包括:
    在所述目标内存中不存在所述目标图片对应的内存拷贝时,判断所述目标内存的标识和/或所述当前处理请求是否符合预置规则;
    在所述目标内存的标识和/或所述当前处理请求符合预置规则时,重新将所述目标图片装载至对应的目标内存。
  10. 一种图片处理装置,其特征在于,包括:
    释放模块,用于在将当前处理请求对应目标图片的图片内容输出至图形处理器后,释放所述目标图片所占用的目标内存;其中,所述目标内存用于记录所述目标图片对应的内存拷贝。
  11. 根据权利要求10所述的装置,其特征在于,所述装置还包括:
    确定模块,用于在将当前处理请求对应目标图片的图片内容输出至图形处理器后,确定所述目标图片是否正被其他处理请求使用;
    所述释放模块,包括:
    释放子模块,用于在所述目标图片未正被其他处理请求使用时,释放所述目标图片所占用的目标内存。
  12. 根据权利要求11所述的装置,其特征在于,所述确定模块,包括:
    第一确定子模块,用于在所述目标图片被处理请求使用的次数为第一预设值时,确定所述目标图片未正被其他处理请求使用。
  13. 根据权利要求12所述的装置,其特征在于,所述装置还包括:
    第一更新模块,用于更新所述目标图片被处理请求使用的次数:
    所述第一更新模块,包括:
    记录子模块,用于在所述目标图片将被当前处理请求使用时,记录所述目标图片被处理请求使用的次数;以及
    第一更新子模块,用于在将当前处理请求对应目标图片的图片内容成功输出至图形处理器后,将所述目标图片被处理请求使用的次数减少设定 量。
  14. 根据权利要求12所述的装置,其特征在于,所述装置还包括:
    第二更新模块,用于更新所述目标图片被处理请求使用的次数:
    所述第二更新模块,包括:
    第二更新子模块,用于针对接收到的当前处理请求,当其唯一标识未在标识集合中出现时,将其唯一标识添加至标识集合,并将所述唯一标识的出现次数更新为第二预设值;其中,所述唯一标识为依据所述当前处理请求对应目标图片生成的标识,不同目标图片对应不同的唯一标识;
    第三更新子模块,用于针对接收到的当前处理请求,当其唯一标识在所述标识集合中出现时,将所述唯一标识的出现次数增加设定量,以所述出现次数作为所述目标图片被处理请求使用的次数;以及
    第四更新子模块,用于在将当前处理请求对应目标图片的图片内容成功输出至图形处理器后,将相应唯一标识的出现次数减少设定量。
  15. 根据权利要求12至14中任一所述的装置,其特征在于,所述装置还包括:
    获取模块,用于获取所述目标图片被处理请求使用的次数:
    所述获取模块,包括:
    查找子模块,用于依据所述目标内存的标识,在目标内存的标识与目标图片被处理请求使用的次数的映射关系中进行查找,以得到所述目标内存对应目标图片被处理请求使用的次数。
  16. 根据权利要求11所述的装置,其特征在于,所述确定模块,包括:
    第二确定子模块,用于在所述目标图片具有预置标记时,确定所述目标图片未正被其他处理请求使用。
  17. 根据权利要求9至14中任一所述的装置,其特征在于,所述装置 还包括:
    第一判断模块,用于在获取目标图片的图片内容前,判断所述目标图片所占用的目标内存中是否存在所述目标图片对应的内存拷贝;
    重新装载模块,用于在所述目标内存中不存在所述目标图片对应的内存拷贝时,重新将所述目标图片装载至对应的目标内存。
  18. 根据权利要求17所述的装置,其特征在于,所述装置还包括:
    第二判断模块,用于在所述目标内存中不存在所述目标图片对应的内存拷贝时,判断所述目标内存的标识和/或所述当前处理请求是否符合预置规则;
    所述重新装载模块,包括:
    装载子模块,用于在所述目标内存的标识和/或所述当前处理请求符合预置规则时,重新将所述目标图片装载至对应的目标内存。
  19. 一种智能终端,其特征在于,包括有存储器,以及一个或者一个以上的程序,其中一个或者一个以上程序存储于存储器中,且经配置以由一个或者一个以上处理器执行所述一个或者一个以上程序包含用于进行以下操作的指令:
    在将当前处理请求对应目标图片的图片内容输出至图形处理器后,释放所述目标图片所占用的目标内存;其中,所述目标内存用于记录所述目标图片对应的内存拷贝。
PCT/CN2017/074621 2016-03-10 2017-02-23 一种图片处理方法、装置和智能终端 Ceased WO2017152764A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US16/121,960 US10679321B2 (en) 2016-03-10 2018-09-05 Efficient release of target memory

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610136920.5A CN107180405A (zh) 2016-03-10 2016-03-10 一种图片处理方法、装置和智能终端
CN201610136920.5 2016-03-10

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/121,960 Continuation-In-Part US10679321B2 (en) 2016-03-10 2018-09-05 Efficient release of target memory

Publications (1)

Publication Number Publication Date
WO2017152764A1 true WO2017152764A1 (zh) 2017-09-14

Family

ID=59788983

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/074621 Ceased WO2017152764A1 (zh) 2016-03-10 2017-02-23 一种图片处理方法、装置和智能终端

Country Status (3)

Country Link
US (1) US10679321B2 (zh)
CN (1) CN107180405A (zh)
WO (1) WO2017152764A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109151545B (zh) * 2018-08-24 2021-08-10 Tcl移动通信科技(宁波)有限公司 一种视频播放界面的图片保存方法、移动终端及存储介质
CN109918233B (zh) * 2019-03-06 2021-02-26 珠海金山网络游戏科技有限公司 一种数据处理方法、装置、计算设备及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101226470A (zh) * 2007-01-18 2008-07-23 环达电脑(上海)有限公司 嵌入式系统界面的图片资源管理方法
CN103077014A (zh) * 2012-12-25 2013-05-01 深圳Tcl新技术有限公司 基于界面生命周期回收图片的方法和装置
CN104267996A (zh) * 2014-09-29 2015-01-07 广州金山网络科技有限公司 一种图片资源处理方法、装置及终端
CN104423949A (zh) * 2013-09-02 2015-03-18 联想(北京)有限公司 一种信息处理方法以及电子设备
CN105354041A (zh) * 2014-08-20 2016-02-24 西安慧泽知识产权运营管理有限公司 一种图片资源管理方法

Family Cites Families (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100300972B1 (ko) * 1997-09-19 2001-09-03 윤종용 텍스춰매핑수행장치및텍스춰캐시의데이터억세스방법
WO2001095257A1 (en) 2000-06-08 2001-12-13 Imagination Technologies Limited Tiling and compression for rendering 3d images
KR100420857B1 (ko) * 2001-07-12 2004-03-02 학교법인연세대학교 3차원 렌더링 프로세서의 픽셀 레스터라이재이션 처리방법 및 장치
JP3991836B2 (ja) * 2002-10-04 2007-10-17 富士ゼロックス株式会社 画像形成装置
JP4340120B2 (ja) 2002-10-29 2009-10-07 株式会社リコー 画像形成装置、記憶領域取得方法
US20040169885A1 (en) 2003-02-28 2004-09-02 Mellor Douglas J. Memory management
US20060083442A1 (en) * 2004-10-15 2006-04-20 Agfa Inc. Image archiving system and method
US8874853B2 (en) * 2010-06-04 2014-10-28 International Business Machines Corporation Local and global memory request predictor
US8731067B2 (en) 2011-08-31 2014-05-20 Microsoft Corporation Memory management for video decoding
CN103457973B (zh) * 2012-06-01 2016-04-27 深圳市腾讯计算机系统有限公司 一种图片上传方法、系统、图片上传客户端及网络服务器
US9396115B2 (en) * 2012-08-02 2016-07-19 International Business Machines Corporation Rewind only transactions in a data processing system supporting transactional storage accesses
US10085016B1 (en) * 2013-01-18 2018-09-25 Ovics Video prediction cache indexing systems and methods
US8874835B1 (en) * 2014-01-16 2014-10-28 Pure Storage, Inc. Data placement based on data properties in a tiered storage device system
JP6398963B2 (ja) * 2015-12-14 2018-10-03 コニカミノルタ株式会社 画像形成装置および画像形成装置で実行されるプログラム

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101226470A (zh) * 2007-01-18 2008-07-23 环达电脑(上海)有限公司 嵌入式系统界面的图片资源管理方法
CN103077014A (zh) * 2012-12-25 2013-05-01 深圳Tcl新技术有限公司 基于界面生命周期回收图片的方法和装置
CN104423949A (zh) * 2013-09-02 2015-03-18 联想(北京)有限公司 一种信息处理方法以及电子设备
CN105354041A (zh) * 2014-08-20 2016-02-24 西安慧泽知识产权运营管理有限公司 一种图片资源管理方法
CN104267996A (zh) * 2014-09-29 2015-01-07 广州金山网络科技有限公司 一种图片资源处理方法、装置及终端

Also Published As

Publication number Publication date
US10679321B2 (en) 2020-06-09
US20190066258A1 (en) 2019-02-28
CN107180405A (zh) 2017-09-19

Similar Documents

Publication Publication Date Title
CN113110848B (zh) 跨应用实例的标识符
US9363334B2 (en) Event service for local client applications through local server
WO2017124961A1 (zh) 一种界面处理方法、装置和智能终端
CN104011698B (zh) 基于从相应的主应用程序数据导出的标识符来访问补充数据
US20120144406A1 (en) Wait on address synchronization interface
WO2020042769A1 (zh) 图像信息的传输方法、装置、存储介质及电子设备
CN108958429A (zh) 一种散热控制方法、系统及设备和存储介质
EP2754058A1 (en) Storage and communication de-duplication
WO2026021502A1 (zh) 界面交互方法、装置、设备和存储介质
TWI716822B (zh) 事務因果序的校正方法及裝置、電子設備
US8725696B2 (en) Providing access to media content in multiple locations
WO2017152764A1 (zh) 一种图片处理方法、装置和智能终端
CN117348805A (zh) 一种硬盘管理方法、装置、设备及机器可读存储介质
CN107037945A (zh) 一种焦点处理方法、装置和智能终端
CN107506494A (zh) 文件处理方法、移动终端及计算机可读存储介质
WO2025256532A1 (zh) 发布内容的方法、装置、设备和存储介质
WO2026026818A1 (zh) 生成虚拟资源的方法、装置、设备和存储介质
WO2025261520A1 (zh) 交互方法、装置、设备和存储介质
CN115550735B (zh) 一种显示设备和媒资更新方法
CN110673827B (zh) 基于安卓系统的资源调用方法及装置、电子设备
CN117893398A (zh) 用于特效交互的方法、装置、设备和存储介质
US11797358B2 (en) Method and system for performing application programming interface calls between heterogeneous applications and cloud service providers
CN117369866A (zh) 参数校验方法、装置、设备及存储介质
HK1244341A (zh) 一種圖片處理方法、裝置和智能終端
HK1244341A1 (zh) 一种图片处理方法、装置和智能终端

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17762450

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 17762450

Country of ref document: EP

Kind code of ref document: A1