An image processing method, apparatus, and electronic device

By creating a parallel queue in the camera to perform image storage tasks, the problems of camera lag and inability to take pictures were solved, resulting in faster image processing speed and higher storage performance.

CN120704811BActive Publication Date: 2026-04-03HUAWEI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-25
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

In existing technologies, the native storage logic of Android open-source projects causes camera shooting tasks to be executed serially, resulting in the inability to release the memory of real images, increasing CPU load and storage power consumption, and causing problems such as camera lag and inability to take pictures.

Method used

By creating a first queue and a second queue in parallel, the first and second operations on the image are executed respectively, and the memory is released in a timely manner after the operation is completed. The parallel queue method is used to execute time-consuming operations, thereby reducing storage time and improving storage performance.

Benefits of technology

It effectively avoids camera lag and inability to take photos, improves the processing speed and efficiency of image storage, and reduces the waiting time for storage tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120704811B_ABST
    Figure CN120704811B_ABST
Patent Text Reader

Abstract

This application provides an image processing method, apparatus, and electronic device. The image processing method, executable by the electronic device, includes: acquiring multiple images, including a first image and a second image; creating multiple queues, including a first queue and a second queue; the electronic device performing a first operation on the multiple images based on the first queue, and performing a second operation on the multiple images based on the second queue; performing the first operation on the first image; after completing the first operation, releasing the memory occupied by the first queue during image processing and outputting the result of the first operation; and performing the second operation based on the result of the first operation; after completing the second operation, releasing the memory occupied by the second queue during the processing of the result of the first operation. This application reduces storage time by promptly releasing the memory occupied during image processing, significantly improving storage performance and thus avoiding problems such as camera lag and inability to take photos.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing, and more particularly to an image processing method, apparatus, and electronic device. Background Technology

[0002] Users today have increasingly higher performance demands for electronic devices, especially camera capabilities. For example, when a user presses the shutter button, they expect the photo to be processed immediately after being taken, to be visible on the camera interface, and to quickly preview the final image through a thumbnail. The final image should be tangible, editable, and shareable by the user.

[0003] The native storage logic of the Android Open Source Project (AOSP) is as follows: When a user presses the shutter button to take a picture, the application layer sends a photo-taking command to the underlying layer. The underlying layer takes the picture, processes the image data, and returns a thumbnail and the actual image to the application layer. The application layer writes the thumbnail and the actual image to the media library, checks the photos after writing, updates the media library with the latest actual image information, and finally deletes the thumbnail to release memory. Because AOSP's native storage logic processes each photo-taking task serially, each process in the storage task is interdependent and must wait for the previous process to complete before the next process can execute. After multiple photos are taken, the multiple storage tasks for multiple photos are also executed serially, leading to task backlog. This results in the inability to release memory for the actual image, and the increased application memory usage increases the load on the central processing unit (CPU) and storage power consumption, causing camera lag and photo-taking failures. Summary of the Invention

[0004] This application provides an image processing method, apparatus, and electronic device that reduces storage time by timely releasing memory occupied by time-consuming tasks, thereby significantly improving storage performance and minimizing camera lag and inability to take photos.

[0005] In a first aspect, an image processing method is provided, comprising: an electronic device acquiring multiple images, the multiple images including a first image and a second image; the electronic device creating multiple queues, the multiple queues including a first queue and a second queue; the electronic device performing a first operation on the multiple images based on the first queue; the electronic device performing a second operation on the multiple images based on the second queue; the electronic device performing the first operation on the first image; after completing the first operation, releasing the memory occupied by the first queue when processing the first image and outputting a first operation result; the electronic device continuing to perform the first operation on the second image and outputting a second operation result; the electronic device performing the second operation based on the first operation result; after completing the second operation, releasing the memory occupied by the second queue when processing the first operation result; the electronic device continuing to perform the second operation on the second operation result.

[0006] It should be noted that the image storage task can specifically include write operations, check operations, update operations, and delete operations. The write operation is used to write the image data of the real image and thumbnail into the media library. The check operation is used to determine the correctness of the image data of the real image and thumbnail written into the media library. The update operation is used to update the image data of the real image. The delete operation is used to delete the image data of the thumbnail.

[0007] For example, the first operation may include a write operation, and the second operation may include an update operation; or, the first operation may include a write operation and a check operation, and the second operation may include an update operation. It is understood that the first queue and the second queue are memory spaces; the first queue can be used to store write operation tasks for different images or to store write and check operation tasks for different images, and the second queue can be used to store update operation tasks for different images.

[0008] For example, if the time taken by the electronic device to perform a first operation on the first image exceeds a preset threshold, and the time taken by the electronic device to perform a second operation on the first image also exceeds the preset threshold, both the first and second operations can be considered time-consuming operations. When time-consuming operations exist, task stacking may occur, leading to camera lag or inability to take pictures. This application, by promptly releasing the memory space occupied during the first and second operations, can reduce storage time, thereby accelerating processing and improving task execution efficiency.

[0009] In this embodiment, the image storage task is broken down into a first queue and a second queue in parallel. Time-consuming operations are executed in parallel through the parallel queues, without blocking the main storage task. After the first or second operation is completed on the image, the memory occupied by the first queue and the second queue when processing the image is released in a timely manner, which can reduce storage time and greatly improve storage performance, thereby minimizing the occurrence of camera lag and inability to take pictures.

[0010] In one possible implementation, the multiple images are multiple images captured in a burst shooting scene. The burst shooting scene can be, for example, a scene of taking multiple consecutive photos or a long-press burst shooting scene.

[0011] In one possible implementation, the first operation includes a write operation, and the second operation includes an update operation. The electronic device performing the first operation on the first image includes: writing the true image data of the first image into a media library; the electronic device performing the second operation based on the result of the first operation includes: updating the true image data of the first image in the media library to obtain the updated true image data of the first image. It should be understood that the updated true image data is the true image data of the first image with complete information.

[0012] In one possible implementation, the plurality of queues further includes a third queue, and the electronic device performs the deletion operation of the plurality of images based on the third queue. The electronic device performing the first operation on the first image further includes: writing the thumbnail data of the first image into a media library; after updating the real image data of the first image in the media library and obtaining the updated real image data of the first image, the method further includes: deleting the thumbnail data of the first image in the media library.

[0013] It should be noted that when writing real images and thumbnails to the media library, electronic devices can perform the writing operations separately according to the order in which the real image data and thumbnail data are obtained by the application layer. For example, if the underlying layer uploads the thumbnail data to the application layer first, the thumbnail can be written to the media library first, and then the real image data can be written to the media library after it is uploaded to the application layer. Alternatively, if the underlying layer uploads the real image data to the application layer first, the real image can be written to the media library first, and then the thumbnail data can be written to the media library after it is uploaded to the application layer. The operation of writing real images and thumbnails to the media library can be performed separately; that is, these two operations can be executed independently.

[0014] It should be understood that after the electronic device completes the write operation of the first image's true image, it will release the memory occupied by the first queue when processing the first image's true image. Subsequently, the electronic device can continue to execute the write operation of the second image's true image based on the first queue, without waiting for the first image's true image to complete the write, update, or other operations before executing the write operation of the second image's true image. This saves the time that the second image has to wait for the first image to be completely processed before it can be processed, thereby speeding up the processing speed in the image storage process, reducing storage time, and improving storage performance.

[0015] In one possible implementation, the plurality of queues further includes the third queue. After the electronic device performs the second operation based on the first operation result, the method further includes: the electronic device performs the third operation based on the first operation result, and after the third operation is completed, the memory occupied by the third queue during the third operation of processing the first image is released.

[0016] For example, the first operation is a write operation, the second operation is an update operation, and the third operation can be a delete operation.

[0017] In this embodiment of the application, after performing the first and second operations on the image, a third operation on the image can also be performed. After performing the third operation on the image, the memory occupied by the third queue when processing the image is released in a timely manner, thereby reducing storage time and greatly improving storage performance, and thus minimizing the occurrence of camera lag and inability to take pictures.

[0018] In one possible implementation, the plurality of queues further includes a fourth queue, upon which the electronic device performs the inspection operation on the plurality of images.

[0019] For example, after the electronic device performs the first operation on the first image and before the electronic device performs the second operation based on the result of the first operation, the method further includes: performing the inspection operation on the real image data of the first image in the media library, and after the inspection operation is performed, releasing the memory occupied by the fourth queue when processing the inspection operation of the real image data of the first image.

[0020] For example, after the electronic device performs the first operation on the first image and before the electronic device performs the second operation based on the result of the first operation, the method further includes: performing the inspection operation on the thumbnail data of the first image in the media library, and after the inspection operation is performed, releasing the memory occupied by the fourth queue when processing the inspection operation of the thumbnail data of the first image.

[0021] In this embodiment, after an image is written to the media library, the written image data can be checked to ensure its correctness (including real image data and thumbnail data). Furthermore, by executing time-consuming operations such as writing, checking, updating, and deleting in parallel, memory can be released promptly during processing, reducing memory pressure and thus minimizing storage time and improving storage performance.

[0022] In another possible implementation, the first operation further includes a checking operation: after writing the original image data of the first image into the media library, the method further includes performing the checking operation on the original image data of the first image in the media library to ensure the correctness of the original image data of the first image written into the media library.

[0023] For example, the first operation further includes a checking operation. After writing the thumbnail data of the first image into the media library, the method further includes performing the checking operation on the thumbnail data of the first image in the media library to ensure the correctness of the thumbnail data of the first image written into the media library.

[0024] Once the electronic device has completed the write and check operations for the first image based on the first queue, the memory occupied by the first queue during the write and check operations for the first image can be released.

[0025] In one possible implementation, the checking operation includes a read operation, a verification operation, and a rewrite operation. The checking operation on the real image data of the first image written to the media library includes: performing a read operation on the real image data of the first image in the media library; performing a verification operation on the image obtained by the read operation and the real image data of the first image in the media library; and if it is determined that the image obtained by the read operation is different from the real image data of the first image in the media library, then performing the rewrite operation.

[0026] For example, the inspection operation on the thumbnail data of the first image written to the media library includes: reading out the thumbnail data of the first image in the media library; verifying the image obtained by the readout operation against the thumbnail data of the first image in the media library; and if it is determined that the image obtained by the readout operation is different from the thumbnail data of the first image in the media library, then performing the rewrite operation.

[0027] In one possible implementation, the method further includes: the electronic device performing the first operation and / or the second operation on the plurality of images by calling a batch processing interface. The first operation can be a write operation, or a write and check operation; the second operation can be an update operation.

[0028] For example, the electronic device can also perform a third and / or fourth operation on multiple images by calling a batch processing interface. The third operation can be a deletion operation, and the fourth operation can be an inspection operation.

[0029] It should be understood that the above checks ensure that the image data (including real image data and thumbnail data) stored in the media library is accurate and complete, avoiding problems such as black spots in images or inability to load images.

[0030] In one possible implementation, when the plurality of images meet a preset rule, the electronic device performs the first operation and / or the second operation on the plurality of images by calling a batch processing interface. The preset rule includes any one of the following: the time interval between the capture of the plurality of images is less than a first threshold, the number of the plurality of images is greater than a second threshold, and the similarity of the plurality of images is greater than a third threshold.

[0031] For example, when the multiple images meet the preset rules, the electronic device performs the third operation and / or the fourth operation on the multiple images by calling the batch processing interface.

[0032] In the embodiments of this application, for example, in the image storage task of multiple consecutive photos or long-press burst shooting scenarios, the multiple storage tasks accumulated in the first queue or the second queue can be processed uniformly by batch update, that is, multiple images can be processed simultaneously, thereby reducing the number of times to establish a connection with the database, reducing the storage task time, reducing binder calls and frequent IPC communication.

[0033] In a second aspect, an image processing apparatus is provided, comprising: an acquisition module for acquiring multiple images, the multiple images including a first image and a second image; a processing module for creating multiple queues, the multiple queues including a first queue and a second queue, wherein the processing module performs a first operation on the multiple images based on the first queue, and performs a second operation on the multiple images based on the second queue; the processing module is further configured to perform the first operation on the first image, and after completing the first operation, release the memory occupied by the first queue when processing the first image, and output a first operation result; the processing module is further configured to continue performing the first operation on the second image and output a second operation result; the processing module is further configured to perform the second operation based on the first operation result, and after completing the second operation, release the memory occupied by the second queue when processing the first operation result; the processing module is further configured to continue performing the second operation on the second operation result.

[0034] In conjunction with the second aspect, in some implementations of the second aspect, the multiple images are multiple images captured in a burst shooting scene. The burst shooting scene can be, for example, a scene of taking multiple consecutive photos or a long-press burst shooting scene.

[0035] In conjunction with the second aspect, in some implementations of the second aspect, the first operation includes a write operation, the second operation includes an update operation, and the processing module is further configured to: write the real image data of the first image into a media library; update the real image data of the first image in the media library, and obtain the updated real image data of the first image.

[0036] In conjunction with the second aspect, in some implementations of the second aspect, the plurality of queues further includes a third queue, and the processing module performs the deletion operation of the plurality of images based on the third queue. The processing module is further configured to: write the thumbnail data of the first image into the media library; after updating the real image data of the first image in the media library and obtaining the updated real image data of the first image, the processing module is further configured to: delete the thumbnail data of the first image in the media library.

[0037] In conjunction with the second aspect, in some implementations of the second aspect, the plurality of queues further includes a fourth queue. The processing module performs the inspection operation on the plurality of images based on the fourth queue. After performing the first operation on the first image and before performing the second operation based on the result of the first operation, the processing module is further configured to: perform the inspection operation on the real image data of the first image written in the media library; and after performing the inspection operation, release the memory occupied by the fourth queue when processing the inspection operation on the real image data of the first image.

[0038] For example, after performing the first operation on the first image and before performing the second operation based on the result of the first operation, the processing module is further configured to: perform the inspection operation on the thumbnail data of the first image written in the media library, and after performing the inspection operation, release the memory occupied by the fourth queue when processing the inspection operation of the thumbnail data of the first image.

[0039] In conjunction with the second aspect, in some implementations of the second aspect, the first operation further includes a checking operation, and the processing module is further configured to: perform the checking operation on the real image data of the first image in the media library to ensure the correctness of the real image data of the first image written into the media library.

[0040] For example, in addition to the write operation, the first operation also includes a check operation, and the processing module is further configured to: perform the check operation on the thumbnail data of the first image in the media library to ensure the correctness of the thumbnail data of the first image written to the media library.

[0041] In conjunction with the second aspect, in some implementations of the second aspect, the checking operation includes a read operation, a verification operation, and a rewrite operation. The processing module is further configured to: perform a read operation on the real image data of the first image in the media library; perform a verification operation on the image data obtained by the read operation and the real image data of the first image in the media library; if it is determined that the image data obtained by the read operation is different from the real image data of the first image in the media library, then perform the rewrite operation.

[0042] For example, the inspection operation includes a read operation, a verification operation, and a rewrite operation. The processing module is further configured to: perform a read operation on the thumbnail data of the first image in the media library; perform a verification operation on the image data obtained by the read operation and the thumbnail data of the first image in the media library; and if it is determined that the image data obtained by the read operation is different from the thumbnail data of the first image in the media library, then perform the rewrite operation.

[0043] In conjunction with the second aspect, in some implementations of the second aspect, the processing module is further configured to: perform the first operation and / or the second operation on the plurality of images by calling a batch processing interface.

[0044] For example, the processing module is further configured to: perform the inspection operation and / or the deletion operation on the plurality of images by calling the batch processing interface.

[0045] In conjunction with the second aspect, in some implementations of the second aspect, when the plurality of images meet preset rules, the processing module performs the first operation and / or the second operation on the plurality of images by calling a batch processing interface. The preset rules include any one of the following: the time interval between the capture of the plurality of images is less than a first threshold, the number of the plurality of images is greater than a second threshold, and the similarity of the plurality of images is greater than a third threshold.

[0046] For example, when the plurality of images satisfy the preset rules, the processing module performs inspection and / or deletion operations on the plurality of images by calling a batch processing interface. In a third aspect, an electronic device is provided, comprising: one or more processors; one or more memories; the one or more memories storing one or more computer programs, the one or more computer programs including instructions that, when executed by the one or more processors, cause the electronic device to perform the methods described in the first aspect and any possible implementation thereof.

[0047] Fourthly, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a computer, causes the computer to implement the methods described in the first aspect and any possible implementation thereof.

[0048] Fifthly, a computer program product containing instructions is provided, which, when run on a computer, causes the computer to perform the methods described in the first aspect and any possible implementation thereof.

[0049] In a sixth aspect, a chip is provided, including a processor for reading instructions stored in a memory, wherein when the processor executes the instructions, the chip implements the methods of the first aspect and any possible implementation thereof.

[0050] It should be noted that the beneficial effects of the second to sixth aspects mentioned above can be referred to the beneficial effects of the first aspect mentioned above, and will not be repeated here. Attached Figure Description

[0051] Figure 1 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.

[0052] Figure 2 This is a software structure block diagram of an electronic device provided in an embodiment of this application.

[0053] Figure 3 A diagram of an image storage architecture for a software system based on a dual-frame structure is shown.

[0054] Figure 4 A diagram of an image storage architecture for a software system based on a single-frame structure is shown.

[0055] Figure 5 The process of serially processing multiple storage task queues is illustrated.

[0056] Figure 6 This is a schematic flowchart of an image processing method provided in an embodiment of this application.

[0057] Figure 7This is a schematic flowchart of another image processing method provided in the embodiments of this application.

[0058] Figure 8 This is a schematic diagram of a parallel processing of multiple task queues provided in an embodiment of this application.

[0059] Figure 9 This is a schematic flowchart of another image processing method provided in the embodiments of this application.

[0060] Figure 10 This is a schematic diagram of another parallel processing of multiple task queues provided in an embodiment of this application.

[0061] Figure 11 This is a schematic flowchart of another image processing method provided in the embodiments of this application.

[0062] Figure 12 This is a schematic diagram of another parallel processing of multiple task queues provided in an embodiment of this application.

[0063] Figure 13 This is a schematic diagram of an image processing apparatus provided in an embodiment of this application.

[0064] Figure 14 This is a schematic diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0065] The technical solutions in this application will now be described with reference to the accompanying drawings.

[0066] The terminology used in the following embodiments is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. As used in the specification and appended claims of this application, the singular expressions “a,” “an,” “the,” “the,” “the,” and “this” are intended to also include expressions such as “one or more,” unless the context clearly indicates otherwise. It should also be understood that in the following embodiments of this application, “at least one” and “one or more” refer to one, two, or more than two. The term “and / or” is used to describe the relationship between related objects, indicating that three relationships may exist; for example, A and / or B can indicate: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character “ / ” generally indicates that the preceding and following related objects are in an “or” relationship.

[0067] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0068] Figure 1 A schematic diagram of the structure of electronic device 100 is shown. Electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, antenna 1, antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0069] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0070] Processor 110 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0071] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to the instruction opcode and timing signals to complete the control of fetching and executing instructions.

[0072] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0073] In some embodiments, the processor 110 may include one or more interfaces. Interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0074] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI) and a display serial interface (DSI). In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to enable the electronic device 100 to capture images. The processor 110 and the display screen 194 communicate via the DSI interface to enable the electronic device 100 to display images.

[0075] USB port 130 is a USB standard compliant interface, specifically a Mini USB port, Micro USB port, USB Type-C port, etc. USB port 130 can be used to connect a charger to charge electronic device 100, and can also be used for data transfer between electronic device 100 and peripheral devices. It can also be used to connect headphones for audio playback. This interface can also be used to connect other electronic devices, such as AR devices.

[0076] It is understood that the interface connection relationships between the modules illustrated in the embodiments of this application are merely illustrative and do not constitute a structural limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.

[0077] The wireless communication function of electronic device 100 can be realized through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor, etc.

[0078] Electronic device 100 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.

[0079] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Mini LED, a MicroLED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, electronic device 100 may include one or N displays 194, where N is a positive integer greater than 1.

[0080] Electronic device 100 can perform shooting functions through ISP, camera 193, video codec, GPU, display 194 and application processor.

[0081] The ISP (Image Signal Processor) is used to process data fed back from the camera 193. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing, transforming it into an image visible to the naked eye. The ISP can also perform algorithmic optimization of image noise, brightness, and skin tone. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be set in the camera 193.

[0082] Camera 193 is used to capture still images or videos. An object is projected onto a photosensitive element by generating an optical image through the lens. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then passed to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into image signals in standard RGB, YUV, or other formats. In some embodiments, the electronic device 100 may include one or N cameras 193, where N is a positive integer greater than 1.

[0083] Digital signal processors (DSPs) are used to process digital signals. Besides digital image signals, they can also process other digital signals. For example, when electronic device 100 selects a frequency, the DSP can perform Fourier transforms on the frequency energy.

[0084] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. Thus, electronic device 100 can play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0085] NPU stands for Neural-Network (NN) Computing Processor. By drawing inspiration from the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it can quickly process input information and continuously learn on its own.

[0086] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to perform data storage functions.

[0087] Internal memory 121 can be used to store computer executable program code, which includes instructions. Processor 110 executes various functional applications and data processing of electronic device 100 by running the instructions stored in internal memory 121. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of electronic device 100 (such as audio data, phonebook, etc.). Furthermore, internal memory 121 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.

[0088] Electronic device 100 can implement audio functions, such as music playback and recording, through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor.

[0089] Buttons 190 include a power button, volume buttons, etc. Buttons 190 can be mechanical buttons or touch-sensitive buttons. Electronic device 100 can receive button input and generate key signal inputs related to user settings and function control of electronic device 100.

[0090] Motor 191 can generate vibration alerts. Motor 191 can be used for incoming call vibration alerts or for touch vibration feedback.

[0091] Indicator 192 can be an indicator light, used to indicate charging status, power changes, or to indicate messages, missed calls, notifications, etc.

[0092] The software system of electronic device 100 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application embodiment uses a layered architecture software system as an example to exemplify the software structure of electronic device 100.

[0093] It is understood that the interface connection relationships between the modules illustrated in the embodiments of this application are merely illustrative and do not constitute a structural limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.

[0094] Figure 2 This is a software structure block diagram of an electronic device 100 according to an embodiment of this application. The layered architecture divides the software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the software system is divided into four layers, from top to bottom: the application (app) layer, the application framework layer, the Android runtime and system libraries, and the kernel layer. The application layer may include a series of application packages.

[0095] like Figure 2 As shown, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and SMS.

[0096] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.

[0097] like Figure 2 As shown, the application framework layer may include a window manager, activity manager, package manager, resource manager, view system, phone manager, notification manager, etc.

[0098] The resource manager service (RMS) provides applications with various resources, such as localized strings, icons, images, layout files, video files, and so on.

[0099] The window manager, also known as the window manager service (WMS), is used to manage window programs. The window manager can obtain the screen size, determine if a status bar is present, lock the screen, and capture screenshots, among other things.

[0100] Activity Manager, also known as Activity Manager Service (AMS), manages all application processes in the system.

[0101] Package manager, also known as package manager service (PMS), is responsible for functions such as application installation and uninstallation, component query and matching, and permission management.

[0102] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon could include views for displaying text and views for displaying images.

[0103] The notification manager allows applications to display notifications in the status bar. These notifications can be used to deliver informational messages and can disappear automatically after a short pause, requiring no user interaction. For example, the notification manager can be used to notify users of completed downloads or message alerts. The notification manager can also display notifications as icons or scrolling text in the top status bar, such as notifications from background applications, or as dialog boxes on the screen. Examples include displaying text messages in the status bar, emitting sounds, vibrating electronic devices, and flashing indicator lights.

[0104] The system library can include multiple functional modules. For example: surface manager, media library, 3D graphics processing library (e.g., OpenGL ES), 2D graphics engine (e.g., SGL), etc.

[0105] The Surface Manager is used to manage the display subsystem and provides the blending of 2D and 3D layers for multiple applications.

[0106] The media library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.

[0107] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0108] A 2D graphics engine is a graphics engine for 2D drawing.

[0109] In addition, the system library may also include status monitoring service modules, such as a physical status recognition module for analyzing and recognizing user gestures; and a sensor service module for monitoring sensor data uploaded by various sensors at the hardware layer to determine the physical status of the electronic device 100.

[0110] The kernel layer is the layer between the hardware layer and the software layer. The kernel layer contains at least display drivers, camera drivers, audio drivers, and sensor drivers; it can also be called the driver layer. The hardware layer can include various sensors, such as… Figure 1 The various sensors introduced in the text.

[0111] The following combination Figure 3 and Figure 4 This application provides a detailed description of two image storage architectures involved in its embodiments. Among them, Figure 3 The image storage architecture diagram of a software system based on a dual-frame structure is shown. Figure 4 A diagram of the image storage architecture of a software system based on a single-frame structure is shown.

[0112] Figure 3 and Figure 4 The camera software framework shown may include an application layer, a service framework (FWK) layer, and a hardware abstraction layer (HAL).

[0113] The application layer is Figure 2 The application layer, as shown, is the top layer of the software system. It contains various user applications, such as the camera and browser. The main task of the application layer is to provide users with interactive interfaces and functions. It implements various application functions by calling the APIs of the FWK layer. The camera application located in the application layer can call the interfaces provided by the Android Open Source Project (AOSP). The AOSP interfaces are the general application interfaces provided by the software for camera applications. These interfaces will operate and transfer data with the camera service of the FWK layer through cross-process interaction technology (binder).

[0114] The Firewall (FWK) layer is an intermediate layer located between the application layer and the Hardware Access Layer (HAL), acting as a bridge between them. It interacts with the camera application above and the HAL layer below. It provides a series of services and APIs to support application layer development. The FWK layer contains the core libraries and runtime environment of the software system, providing various system services (such as window management and resource management), access to device functions (such as camera, sensors, and network), and other system-level functions (such as multimedia and data storage).

[0115] The HAL layer is the interface layer between the FWK layer and the hardware. The software defines the protocols and interfaces for communication between the FWK layer services and the HAL layer. The HAL layer defines standard interfaces for hardware vendors to implement, eliminating the need for software to consider the underlying driver implementation. Through the defined HAL layer architecture, cross-process communication with the camera service is handled via an Interface Description Language (HIDL) interface, while actual camera operations are issued via the standard HAL3 interface. The HAL layer provides software abstraction interfaces for various hardware devices (such as cameras, audio, Bluetooth, etc.), allowing them to be used by the upper FWK layer and application layer.

[0116] In summary, the application layer provides the user interface and functionality, the Fireworks Control (FWK) layer provides system services and APIs for the application layer, and the Hardware Access Layer (HAL) layer provides the communication interface between the FWK layer and hardware devices. This hierarchical structure gives the software system high scalability and compatibility, while also facilitating application development and hardware device adaptation.

[0117] During each shot, AOSP's native storage logic is as follows: When the user presses the shutter button to take a picture, the application layer sends a shooting command to the hardware layer. The hardware layer (lower layer) takes the picture and processes the image data (such as through the algorithm provided by the ALGO interface), and then returns a thumbnail and the real image to the application layer. The application layer writes the thumbnail and the real image to the media library (such as MediaLibrary), and after writing, it checks the picture and updates the latest real image information to the media library. Finally, the thumbnail picture is deleted to release memory.

[0118] It should be understood that this application does not limit the order in which thumbnails and real images are written to the media library. For example, if the underlying layer uploads the thumbnails to the application layer first, then the thumbnails are written to the media library first, and subsequently, after the real images are uploaded to the application layer, they are written to the media library. Alternatively, if the underlying layer uploads the real images to the application layer first, then the real images can be written to the media library first, and subsequently, after the thumbnails are uploaded to the application layer, they are written to the media library. The writing order of thumbnails and real images can be determined based on the specific order in which they are uploaded to the application layer.

[0119] In camera applications, "real images" refer to the raw images captured by the camera, preserving all the details and information captured by the camera sensor. These real images typically have high resolution and image quality, suitable for post-processing, editing, or printing. Thumbnails are small images generated by compressing and scaling real images. Thumbnails are often used for previews or indexes in camera application interfaces for quick browsing and selection of images. Due to their small size, thumbnails occupy less storage space and also speed up image loading. Therefore, real images and thumbnails in camera applications focus on providing high-quality raw images and convenient image browsing functionality.

[0120] It should be understood that in the HAL layer of software, ALGO is an abbreviation for "Algorithm," referring to the algorithm interface in the Hardware Abstraction Layer. Through the ALGO interface, hardware manufacturers can expose and register the algorithm processors of their chips. Layers and applications can use these algorithm processors to perform complex tasks such as image processing and signal processing. The ALGO interface provides some standard algorithm APIs, such as FFT, IDCT, and H.264 encoders, and also provides extended support for custom algorithms, allowing manufacturers to customize their own specific algorithms. For example, when a user takes a photo in a low-light scene, they can use the lighting algorithms and color adjustment algorithms provided by the ALGO interface to process the photo.

[0121] It should be noted that, as Figure 3 As shown, in a dual-frame architecture, the image storage procedure (also known as the real storage service) refers to the storage service used by the camera application when saving image data to the media library. In a dual-frame architecture, the real storage service is executed at the camera application layer. For example, the image storage procedure (i.e., the real storage service) can include write, check, update, and delete operations, all of which can be executed at the camera application layer. The check can include read, verification (SHA), and re-write. SHA is a verification algorithm used to check whether the read image data matches the written image data; if they do not match, the re-write process must be performed; if they match, the re-write process is not required.

[0122] like Figure 4As shown, in a single-framework architecture, the image storage process (i.e., the real storage service) is executed in the FWK layer. This means that operations such as writing, reading, verification (SHA), rewriting, updating, and deleting in the image storage process can be performed at the FWK layer. For example, the application layer can include a write interface. When the application layer receives image data from the underlying layer (such as the HAL layer), it can use the write interface to call the real storage service located in the FWK layer to perform write, read, verification (SHA), rewriting, updating, and deleting operations.

[0123] It's important to note that, regardless of whether it's a dual-frame or single-frame setup, the existing solution (i.e., AOSP's native storage logic) processes each capture request sequentially after the camera issues a capture command. Furthermore, within each capture task, the processing flow depends on the completion of the previous capture task. When the capture command is issued from the application layer, the application layer sends the relevant parameters (such as mode name, resolution, focal length, and exposure value) to the underlying layer along with the capture task. The underlying ISP outputs the image, processes it using appropriate algorithms, and returns the generated real image data to the application layer. The application layer then writes the image to the media library, checks and verifies the written file, updates the image information in the media library, and finally deletes thumbnails (such as cached data) and other related data from the entire storage process, releasing the corresponding memory. Because AOSP's native storage logic processes each capture task serially, each process within the storage task is interdependent and must wait for the previous process to complete before executing the next process (e.g., image generation – writing – checking – updating – cache deletion). After taking multiple photos, the multiple storage tasks for these photos are executed serially, which can lead to task backlog. This can prevent the release of memory for the actual images, and the increased application memory usage can increase the CPU load and storage power consumption, resulting in camera lag and the inability to take photos.

[0124] like Figure 5 As shown, Figure 5This illustrates the process of serially processing multiple storage task queues. The storage task queue (i.e., saveTaskQueue) comprises N storage tasks processed serially, and the image storage procedure (i.e., real storage service) within each storage task is also executed serially. For example, there may be N storage tasks, denoted as: Storage Task 1, Storage Task 2, ..., Storage Task X. Storage Task 1 is a storage task for image 1 (e.g., JPEG 1), and includes the following processes: writing and checking image 1, updating image 1 information in the media library, and deleting the cache; Storage Task 2 is a storage task for image 2 (e.g., JPEG 2), and also includes the following processes: writing and checking image 2, updating image 2 information in the media library, and deleting the cache; ...; Storage Task X is a storage task for image X (e.g., JPEG X), and also includes the following processes: writing and checking image X, updating image X information in the media library, and deleting the cache. Storage tasks 1 through X are executed sequentially, and the processing within each storage task is also executed sequentially. This means that memory space is only released and the subsequent storage task for image 2 is executed only after the storage task for image 1 is completed. This implies that after multiple shots, the sequential storage tasks can lead to task stacking, memory not being released, and system lag.

[0125] Therefore, this application provides an image processing method that optimizes the photo storage process, reduces the dependence on each storage task, optimizes redundant processes, and releases memory space in a timely manner so that each storage task can be completed quickly, thereby improving storage performance, optimizing camera storage performance, and improving user experience.

[0126] Figure 6 This is a schematic flowchart of an image processing method 200 provided in an embodiment of this application. Figure 6 As shown, the image processing method 200 includes steps 210 to 240.

[0127] Step 210: The electronic device acquires multiple images, including a first image and a second image.

[0128] For example, in combination Figure 3 and Figure 4As we know, when a user clicks the shutter button to take a picture, the application layer sends a photo-taking command to the underlying layer (such as the camera). After taking the picture, the underlying layer returns multiple images (e.g., X images) to the application layer. Each image includes the image data of the actual image (i.e., the actual image data) and the image data of the thumbnail (i.e., the thumbnail data). It should be noted that the order in which the underlying layer returns the actual image data and thumbnail data to the application layer is not limited. For example, the underlying layer can first obtain the actual image data and return it to the application layer, and then return the thumbnail data obtained subsequently to the application layer. Alternatively, the underlying layer can first obtain the thumbnail data, then return the thumbnail data to the application layer, and then return the actual image data obtained subsequently to the application layer.

[0129] For example, multiple images are multiple images captured in a burst shooting scene. A burst shooting scene can be, for example, a scene of taking multiple consecutive photos or a long-press burst shooting scene.

[0130] For example, when a user takes multiple photos in burst mode, the application layer can receive multiple image data. This image data can include the actual image data and the corresponding thumbnail image data. In other words, the application layer can receive multiple actual image data and multiple thumbnail data. Here, "burst shooting" can refer to long-press burst shooting or rapid burst shooting. For instance, when the time interval between consecutive clicks of the shutter button by the user is less than or equal to a preset threshold (such as 500ms), it can be considered a burst shooting scenario.

[0131] It should be noted that the multiple images acquired by the application layer may include a first image, a second image, and so on. For example, the first image and the second image may include any of the following: an 80-point image, a 100-point image, a 101-point image, and a 102-point image, which are not limited in this application.

[0132] Step 220: The electronic device creates multiple queues, including a first queue and a second queue.

[0133] It should be noted that the multiple queues involved in the embodiments of this application are all memory spaces, which can be used to store different image operation tasks, such as write operation tasks, check operation tasks, update operation tasks, delete operation tasks, etc.

[0134] The first queue is a memory space used to store the first operation tasks for different images. The electronic device can execute the first operation on multiple images based on the first queue. The second queue is a memory space used to store the second operation tasks for different images. The electronic device can execute the second operation on multiple images based on the second queue.

[0135] For example, if the time taken by the electronic device to perform a first operation on the first image exceeds a preset threshold, and the time taken by the electronic device to perform a second operation on the first image also exceeds a preset threshold, both the first and second operations can be considered time-consuming operations. When time-consuming operations exist, task stacking may occur, leading to camera lag or inability to take pictures. This application, by promptly releasing the memory space occupied during the first and second operations, can reduce storage time, thereby accelerating processing and improving task execution efficiency.

[0136] In some embodiments, the first queue can be a write queue as described below, the first operation includes a write operation, and the first queue is used to store write operation tasks for different images. The write operation task may include writing real images and writing thumbnails. In other embodiments, the first queue can be a write and check queue as described below, the first operation includes a write operation and a check operation, and the first queue is used to store write and check operation tasks for different images. The write operation task may include writing real images and writing thumbnails; the check operation task may include checking real images written to the media library and checking thumbnails written to the media library. The second queue can be an update queue as described below, the second operation is an update operation, and the second queue is used to store update operation tasks for different images. The update operation task includes updating real images written to the media library.

[0137] In some embodiments, the plurality of queues may further include a third queue for storing third operation (such as deletion) tasks for different images. This third queue may be the delete queue referred to below. The deletion task includes deleting thumbnails written to the media library.

[0138] In some embodiments, where the first queue is a write queue, i.e., the first queue is used to store write operation tasks for different images, the plurality of queues may further include a fourth queue for storing fourth operation (such as inspection operation) tasks for different images. This fourth queue may be a check queue as described below. The inspection operation tasks may include inspection operations on real images written to the media library and inspection operations on thumbnails written to the media library. Exemplarily, the inspection operation may include a read operation, a verification operation, and a re-write operation.

[0139] Step 230: The electronic device performs a first operation on the first image. After completing the first operation, it releases the memory occupied by the first queue during the processing of the first image and outputs the result of the first operation. Subsequently, the electronic device continues to perform the first operation on the second image and outputs the result of the second operation.

[0140] In some embodiments, the first queue can be a write queue, which can be used to store write tasks for different images. The first operation includes a write operation, which is mainly used to perform image write operations. Specifically, the write operation can include writing real images and writing thumbnails.

[0141] For example, an electronic device performing a first operation on a first image may include: the electronic device writing the real image data of the first image into a media library, and the first output operation result may include the real image data of the first image written into the media library. Similarly, an electronic device performing a first operation on a second image may include: the electronic device writing the real image data of the second image into a media library, and may output a second operation result, which may include the real image data of the second image written into the media library.

[0142] For example, an electronic device performing a first operation on a first image may include: the electronic device writing thumbnail data of the first image into a media library, and the result of the first operation may include the thumbnail data of the first image written into the media library. Similarly, an electronic device performing a first operation on a second image may include: the electronic device writing thumbnail data of the second image into a media library, and may output a second operation result, which may include the thumbnail data of the second image written into the media library.

[0143] It should be noted that when electronic devices write real images and thumbnails to the media library, the writing operations can be performed separately according to the order in which the real image data and thumbnail data are obtained by the application layer. For example, if the underlying layer uploads the thumbnail data to the application layer first, the thumbnails can be written to the media library first, and then the real image data can be written to the media library after it is uploaded to the application layer. Alternatively, if the underlying layer uploads the real image data to the application layer first, the real image can be written to the media library first, and then the thumbnail data can be written to the media library after it is uploaded to the application layer. The operation of writing real images to the media library and the operation of writing thumbnails to the media library can be performed separately; that is, the real image writing operation and the thumbnail writing operation can be performed independently.

[0144] After the electronic device finishes writing the real image of the first image, it releases the memory occupied by the first queue when processing the real image of the first image. Subsequently, the electronic device can continue to write the real image of the second image based on the first queue, without waiting for the first image to complete the writing, updating and other operations before writing the real image of the second image. This saves the time that the second image has to wait for the first image to be completely processed before it can be processed, thereby speeding up the processing speed in the image storage process, reducing storage time and improving storage performance.

[0145] In some embodiments, the first queue can be a write and check queue, which can be used to store different image write and check tasks. The first operation includes a write operation and a check operation. This step is mainly used to perform image write and check operations. Specifically, the image write and check operations can include real image write and check operations and thumbnail write and check operations.

[0146] For example, performing a write and check operation on a first image in the first queue may include: the electronic device writing the true image data of the first image into a media library; and performing a check operation on the true image data of the first image written into the media library, wherein the first operation result may be the checked true image data of the first image. Similarly, performing a write and check operation on a second image in the first queue may include: the electronic device writing the true image data of the second image into a media library; and performing a check operation on the true image data of the second image written into the media library, wherein the first operation result may be the checked true image data of the first image.

[0147] For example, performing a write and check operation on a first image in the first queue may include: the electronic device writing thumbnail data of the first image to a media library; and performing a check operation on the thumbnail data of the first image written to the media library, wherein the result of the first operation may be the checked thumbnail data of the first image. Similarly, performing a write and check operation on a second image in the first queue may include: the electronic device writing thumbnail data of the second image to a media library; and performing a check operation on the thumbnail data of the second image written to the media library, wherein the result of the first operation may be the checked thumbnail data of the first image.

[0148] It should be noted that the writing and checking of the actual image data and the writing and checking of the thumbnail data can be performed separately. For example, the electronic device can first write the actual image data of the first image into the media library and perform a checking operation, and then write the thumbnail data of the first image into the media library and perform a checking operation. The final result includes the actual image data of the first image correctly written into the media library and the thumbnail data of the first image.

[0149] After the electronic device completes the write and check operations for the first image, it releases the memory occupied by the first queue during the write and check operations for the first image. Subsequently, the electronic device can continue to execute the write and check operations for the second image based on the first queue, without waiting for the first image to complete the write, check, update, and delete operations before executing the write and check operations for the second image. This saves the time that the second image has to wait for the first image to be completely processed before it can be processed, thereby speeding up the processing speed in the image storage process, reducing storage time, and improving storage performance.

[0150] For example, the inspection operation may include read, SHA, and re-write operations. Specifically, after the write operation is completed for each image, the image data written to the media library can also be inspected.

[0151] In one example, the image data of the image written to the media library can first be read out; the image obtained from the readout operation can be compared with the image data written to the media library; if it is determined that the image obtained from the readout operation is different from the image data written to the media library, a rewrite operation is performed. In this embodiment, after the image data is written to the media library, the written image data can also be checked. If the written image data is completely correct, subsequent image update operations are then performed to ensure the correctness of the image data written to the media library.

[0152] In one example, the thumbnail data of the images written to the media library can first be read out; the image obtained from the readout operation can be compared with the thumbnail data of the images written to the media library; if it is determined that the thumbnail data of the image obtained from the readout operation is different from the thumbnail data of the images written to the media library, a rewrite operation is performed. In this embodiment, after the thumbnail data of the images is written to the media library, the written thumbnail data can also be checked. If the written thumbnail data is completely correct, the subsequent thumbnail deletion operation is then performed to ensure the correctness of the thumbnail data of the images written to the media library.

[0153] For example, after the electronic device completes the first operation on the first image and passes the result of the first operation to the second queue, it also performs the first operation on the second image. For instance, after the real image data of the first image is written, the system can switch to the second queue to perform an update operation on the real image data of the first image, while simultaneously, the electronic device can perform subsequent write operations on the second image based on the first queue. As another example, after the real image data of the first image is written and checked, the system can switch to the second queue to perform an update operation on the real image data of the first image, while simultaneously, the electronic device can perform subsequent write and check operations on the second image based on the first queue. This pipelined processing method can release memory promptly, reduce memory pressure, and decrease storage time, thereby improving storage performance.

[0154] In some embodiments, the electronic device may perform a first operation on multiple images by calling a batch processing interface.

[0155] For example, if the multiple images acquired in step 210 meet the preset rules, the electronic device can call the batch processing interface to perform the first operation on the multiple images simultaneously. That is, the electronic device can simultaneously perform the writing operation of multiple images or the writing and checking operation of multiple images simultaneously. The preset rules may include any of the following: the time interval between the capture of the multiple images is less than a first threshold, the number of multiple images is greater than a second threshold, or the similarity of the multiple images is greater than a third threshold. In this embodiment, the electronic device only needs to call the binder once and perform one IPC communication when processing multiple images, instead of performing multiple binder calls and IPC communications. This reduces binder calls and frequent IPC communications, decreases storage task time, and reduces CPU pressure.

[0156] Step 240: The electronic device executes a second operation based on the result of the first operation. After the second operation is completed, the memory occupied by the second queue during the processing of the result of the first operation is released. Subsequently, the electronic device continues to execute the second operation on the result of the second operation.

[0157] For example, the second queue can be an update queue, which can be used to store update tasks for different images. The second operation includes an update operation, which is mainly used to perform an update operation on the real image. It should be understood that the real image data written to the media library through the write operation is not real image data with complete image information. Therefore, it is necessary to perform an update operation on the real image data written to the media library to obtain updated real image data. The update operation here may include, for example, updating parameter information such as the image's shooting time, location, and resolution.

[0158] For example, the electronic device performing a second operation based on the first operation result may include: updating the real image data of the first image written to the media library, and obtaining the updated real image data of the first image. The first operation result can be the real image data of the first image written to the media library. It should be understood that the updated real image data of the first image is the real image data of the first image with complete information. Furthermore, after the electronic device completes the update operation of the real image data of the first image, it will release the memory occupied by the second queue when processing the result of the first operation. At the same time, the write operation of the second image is also completed. The electronic device can continue to perform the second operation (such as the update operation) of the second image based on the second queue, without waiting for the first image to complete the write, update, or delete operations before performing the write and update operations of the second image. This saves the time that the second image has to wait serially for the first image to be fully processed before it can be processed, thereby speeding up the processing speed in the image storage process, reducing storage time, and improving storage performance.

[0159] For example, the electronic device performing the second operation on the result of the second operation may include: updating the real image data of the second image written to the media library, and obtaining the updated real image data of the second image. The result of the second operation may be the real image data of the second image written to the media library. Furthermore, after the electronic device completes the update operation on the real image data of the second image, it releases the memory occupied by the second queue when processing the result of the second operation, which can reduce storage time and speed up image storage.

[0160] In some embodiments, the electronic device may perform a second operation on multiple images by calling a batch processing interface.

[0161] For example, if the multiple images acquired in step 210 meet the preset rules, the electronic device can call the batch processing interface to perform the second operation on the multiple images simultaneously. That is, the electronic device can simultaneously perform the update operation of the real images of multiple images. The preset rules may include any of the following: the time interval between the capture of the multiple images is less than a first threshold, the number of the multiple images is greater than a second threshold, or the similarity of the multiple images is greater than a third threshold. In this embodiment, the electronic device only needs to call the binder once and perform one IPC communication when processing multiple images, instead of performing multiple binder calls and IPC communications. This reduces binder calls and frequent IPC communications, decreases storage task time, and reduces CPU pressure.

[0162] In some embodiments, after step 240 is completed, the following step may also be performed: the electronic device performs a third operation (such as a deletion operation) based on the result of the first operation. For example, the electronic device performs deletion operations on multiple images based on a third queue. Specifically, the electronic device may delete the thumbnail data of the first image in the media library. It should be noted that after the electronic device completes the deletion task of the thumbnail data of the first image, it can release the memory space occupied in the third queue during the deletion task of the first image's thumbnail data. Furthermore, after the update operation on the true image data of the second image is completed, the third operation (such as a deletion operation) can continue to be performed on the second image to delete the thumbnail data of the second image in the media library.

[0163] For example, an electronic device can perform a third operation on multiple images by calling a batch processing interface.

[0164] For example, if the multiple images acquired in step 210 meet preset rules, the electronic device can simultaneously perform a third operation on multiple images; that is, the electronic device can simultaneously perform the deletion operation of thumbnail data for multiple images. The preset rules may include any of the following: the time interval between the capture of multiple images is less than a third threshold, the number of multiple images is greater than a second threshold, or the similarity of multiple images is greater than a third threshold. In this embodiment, the electronic device only needs to call the binder once and perform one IPC communication when processing the deletion operation of multiple images, instead of performing multiple binder calls and IPC communications. This reduces binder calls and frequent IPC communications, decreases storage time, and reduces CPU pressure.

[0165] In some embodiments, when the first queue is used to store write operation tasks for different images, after step 230 is executed and before step 240 is executed, the following steps may also be executed: the electronic device may perform a fourth operation (such as an inspection operation) on the first image written to the media library based on the fourth queue; after the inspection operation is executed, the memory occupied by the fourth queue when processing the inspection operation of the first image is released; furthermore, the electronic device may continue to perform a fourth operation (such as an inspection operation) on the second image.

[0166] For example, an electronic device can perform a fourth operation on multiple images by calling a batch processing interface.

[0167] For example, if the multiple images acquired in step 210 meet the preset rules, the electronic device can simultaneously perform the fourth operation on the multiple images; that is, the electronic device can simultaneously perform the inspection operation on multiple images. The preset rules may include any of the following: the time interval between the capture of the multiple images is less than a fourth threshold, the number of the multiple images is greater than a second threshold, or the similarity of the multiple images is greater than a fourth threshold. In this embodiment, the electronic device only needs to call the binder once and perform one IPC communication when processing the inspection operation on multiple images, eliminating the need for multiple binder calls and IPC communications. This reduces binder calls and frequent IPC communications, decreases storage time, and reduces CPU pressure.

[0168] In image storage procedures or real storage services, images can be written, updated, and deleted, ultimately completing the image storage process and storing the image in the media library (hereinafter referred to as...). Figure 7 and Figure 8 (Detailed introduction); it also allows writing, checking, updating, and deleting operations on images, ultimately storing the image in the media library. The writing and checking operations can be performed sequentially (see below for details). Figure 9 and Figure 10 (Detailed introduction), and can also be executed in parallel (the following combines...) Figure 11 and Figure 12 (Detailed introduction).

[0169] Figure 7 This is a schematic flowchart of another image processing method 300 provided in an embodiment of this application. It should be understood that this image processing procedure can be executed at the application layer (see reference). Figure 3 It can also be executed at the FWK layer (see reference). Figure 4 This application does not limit the scope of the image processing method 300. The image processing method 300 may include steps 310 to 350, which will be described in detail below.

[0170] Step 310: Acquire multiple image data. This image data includes both the actual image data and the thumbnail image data.

[0171] For example, in combination Figure 3 and Figure 4As we know, when a user clicks the shutter button to take a picture, the application layer sends a photo-taking command to the underlying layer (such as the camera). After taking the picture, the underlying layer returns the application layer with the actual image data (i.e., real image data) and the thumbnail image data (i.e., thumbnail data). It should be noted that the order in which the underlying layer returns the real image data and thumbnail data to the application layer is not limited. For example, the underlying layer can first obtain the real image data and return it to the application layer, and then return the thumbnail data obtained subsequently to the application layer. Alternatively, the underlying layer can first obtain the thumbnail data, then return the thumbnail data to the application layer, and then return the actual image data obtained subsequently to the application layer.

[0172] For example, multiple images are multiple images captured in a burst shooting scene. A burst shooting scene can be, for example, a scene of taking multiple consecutive photos or a long-press burst shooting scene.

[0173] For example, when a user takes multiple photos in burst mode (e.g., image 1, image 2, ..., image X), the application layer can receive multiple image data. This image data can include the image data of the actual image and the image data of the corresponding thumbnail. In other words, the application layer can receive image data of multiple actual images and multiple thumbnail images. Here, "burst shooting" can refer to long-press burst shooting or rapid burst shooting. For example, when the time interval between consecutive clicks of the shutter button is less than or equal to 500ms, it can be considered a burst shooting scenario.

[0174] It should be noted that the real image data involved in this application can be image data of the following types: such as 80-point images, 100-point images, 101-point images and 102-point images, etc., without limitation.

[0175] Step 320: Create write queues, update queues, and delete queues.

[0176] The write queue is the first queue mentioned above, which can be used to store write operation tasks for different images; the update queue is the second queue mentioned above, which can be used to store update operation tasks for different images; and the delete queue is the third queue mentioned above, which can be used to store delete operation tasks for different images.

[0177] For example, write, update, and delete operations can all be considered time-consuming tasks. That is, the time taken for the electronic device to perform a write operation on an image, the time taken for the electronic device to perform an update operation on an image, and the time taken for the electronic device to perform a delete operation on an image all exceed a preset threshold. When time-consuming tasks exist, task stacking may occur, leading to camera lag or inability to take pictures. This application, by promptly releasing the memory space occupied during the first and second operations, can reduce storage time, thereby accelerating processing and improving task execution efficiency.

[0178] Compared to Figure 5 Specifically, the storage task queue provided in this application may include a parallel write queue, update queue, and delete queue. The write queue can be used to store write tasks for multiple images, such as writing real images and thumbnails to a media library; the update queue can be used to store update tasks for multiple images, such as updating the image data of real images; and the delete queue can be used to store delete tasks for multiple images, such as deleting the image data of thumbnails.

[0179] For example, such as Figure 8 As shown, Figure 8 The diagram illustrates parallel write, update, and delete queues. Each queue includes an entry point and an exit point, and image processing is performed sequentially along the direction of the hollow arrows shown. For example, the write queue has a length of N, the update queue has a length of M, and the delete queue has a length of P, where N, M, and P can be the same or different. In other words, the write queue can hold write tasks for N images, the update queue can hold update tasks for M images, and the delete queue can hold delete tasks for P images.

[0180] In some embodiments, the electronic device can process write, update, and delete operations on an image one at a time based on the write queue, update queue, and delete queue.

[0181] For example, such as Figure 8As shown, in the write queue, the write operation for image 1 can be executed first in write 1. After the write operation for image 1 is completed, the memory of write 1 is released. Then, the write operation for image 2 is executed in write 2. After the write operation for image 2 is completed, the memory of write 2 is released, and then the write operations for subsequent images are executed in sequence. After the corresponding write operation for an image is completed in the write queue, the real image of the image can be passed to the update queue for update operation. The update operation for the real image of image 1 is executed in update 1. After the update operation for the real image of image 1 is completed, the memory of update 1 is released. At the same time, after the write operation for image 2 is completed, the update operation for the real image of image 2 is executed in update 2. After the update operation for the real image of image 2 is completed, the memory of update 2 is released, and then the update operations for the real images of subsequent images are executed in sequence. After an image completes its update operation in the update queue, the thumbnail of image 1 can be deleted in delete 1. Once the deletion of image 1's thumbnail is complete, the memory allocated to delete 1 is released. Simultaneously, after the update operation for image 2 is completed, the thumbnail of image 2 is deleted in delete 2. Once the deletion of image 2's thumbnail is complete, the memory allocated to delete 2 is released, and so on. The thumbnail deletion operations for subsequent images are then executed sequentially. The write queue, update queue, and delete queue can process images in a pipeline-like manner. Once each queue completes its operation, the memory space occupied during image processing can be released immediately, thereby accelerating image storage processing, reducing storage time, and improving storage performance.

[0182] In other embodiments, the electronic device can simultaneously execute write tasks or write operations for N images based on a write queue, simultaneously execute update tasks or update operations for M images based on an update queue, and simultaneously execute delete tasks or delete operations for P images based on a delete queue.

[0183] In one example, when the write queue is full, no enqueue operation can be performed. This means that the memory space for writes 1 through N is occupied, and image writing operations are ongoing, preventing the addition of new images and the execution of subsequent image writing operations. However, when a position in the write queue is empty, a new image can be added, allowing processing of subsequent images to continue. For example, if write n is empty, subsequent image writing operations can be performed at position write n.

[0184] In one example, when the update queue is full, no enqueue operation can be performed. This means that memory space for updates 1 through M is occupied, as subsequent image operations are being executed, preventing the addition of new images and the continuation of subsequent image operations. However, when a position in the update queue is empty, new images can be added, allowing processing of subsequent images to continue. For example, if update m is empty, subsequent image operations can be performed at position update m.

[0185] In one example, when the delete queue is full, no enqueue operation can be performed. That is, the memory space for delete 1 through delete P is occupied, as all operations are performing image deletions, preventing the addition of new images and the continuation of subsequent image deletions. However, when a position in the delete queue is empty, a new image can be added, allowing processing of subsequent images to continue. For example, if delete p is empty, subsequent image deletions can be performed at position delete p.

[0186] Step 330: Perform a write operation on the acquired multiple image data and save the multiple image data to the media library.

[0187] In some embodiments, the electronic device can simultaneously perform a write operation on an image (such as a first image) based on a write queue, writing the true image data and thumbnail data of the first image to the media library. After the electronic device completes the write operation on the first image, the write queue releases the memory occupied during the processing of the first image and passes the first operation result of the first image to the update queue. Simultaneously, the electronic device can process the write operation on subsequent images (such as a second image). That is, after the electronic device completes the corresponding write operation, it can immediately release the memory space occupied during image processing, thereby accelerating the processing speed in the image storage process, reducing storage time, and improving storage performance. It should be understood that the write operation on the first image can include the write operation on the true image of the first image and the write operation on the thumbnail of the first image; the specific details can be found in step 230, and will not be repeated here.

[0188] For example, such as Figure 8As shown, once the write operation for image n at a certain position (e.g., write n) in the write queue is complete, the memory for write n can be released, allowing the electronic device to perform subsequent image write operations on write n. Furthermore, after the write operation for the actual image of image n is complete, the update operation for the actual image of image n can be performed in the update queue. Similarly, after the write operation for the thumbnail of image n and the update operation for the actual image of image n are complete, the deletion operation for the thumbnail of image n can be performed in the delete queue. It should be understood that this parallel queue approach allows memory to be released immediately after image writing, reducing the memory usage time for a single image capture and enabling faster processing of multiple consecutive image capture tasks, resulting in greater memory savings.

[0189] In some embodiments, the electronic device can simultaneously perform write operations on multiple acquired image data. For example, if a user acquires X image data, all X image data can be added to a write queue (i.e., the write queue), and write operations on X image data can be performed simultaneously. That is, the length of the write queue is N, and N≥X, thus allowing simultaneous processing of write operations on X image data. For example, in image storage tasks involving multiple consecutive photos or long-press burst shooting scenarios, the accumulated multiple image write tasks in the write queue can be updated uniformly using a batch update method, thereby reducing multiple connections to the database, reducing binder calls, and frequent IPC communication.

[0190] In some embodiments, an electronic device can perform write operations on multiple images by calling a batch processing interface.

[0191] For example, images acquired in the same batch can be processed in batches for writing operations based on preset rules. In other words, if multiple images meet the preset rules, the electronic device can perform writing operations on multiple images by calling the batch processing interface. These preset rules include, but are not limited to, the following: the time interval between the capture of multiple images is less than a preset threshold; the number of images (i.e., the number of images to be processed) exceeds a preset threshold; and the similarity of multiple images is greater than a preset threshold. For instance, when multiple images are captured in a continuous shooting scenario or a long-press burst shooting scenario, and the number of images to be written is large, the batch processing interface can be called to perform writing operations on multiple images.

[0192] For example, if the number of images to be processed, X, is 10, and the queue length N of the write queue is 10, then 10 images can be written in batches by calling the batch processing interface. By adding the images to be processed to the write queue, the electronic device can simultaneously execute the write operation for 10 images. This way, processing 10 images only requires one binder call and one IPC communication, instead of 10 binder calls and 10 IPC communications. This reduces binder calls and frequent IPC communications, decreases storage time, and reduces CPU load.

[0193] For example, if the number of images to be processed, X, is 100, and the length of the write queue, N, is 10, then the batch processing interface can be called to first perform batch write operations on images 1-10. After the 10 images in the write queue have been written, the memory space of the write queue is released. Then, the batch processing interface is called again to perform batch write operations on images 11-20. After the 10 images in the write queue have been written, the memory space of the write queue is released, and then the batch write operations on subsequent images can continue. In this case, on the one hand, the binder calls and frequent IPC communication during the image writing process can be reduced, thus reducing storage time. On the other hand, by releasing the memory space of the write queue in a timely manner, image writing can be accelerated, storage time can be reduced, and storage performance can be improved.

[0194] It should be understood that after writing multiple image data, these images can be stored in a media library. The image data stored in the media library can include both actual images and thumbnail images. The thumbnail images written to the media library are for quick viewing by the user. However, the information in the actual images stored in the media library through the write operation may be incomplete, requiring subsequent update operations to ensure that the final actual images stored in the media library have complete image information.

[0195] Step 340: Update the image data of multiple real images to obtain multiple real image data with complete information.

[0196] It should be understood that step 330 completes the writing operation of multiple image data, writing multiple image data (including multiple real image data and multiple thumbnail image data) into the media library. After completing the writing operation in step 330, the image data of the multiple real images (i.e., real image data) can also be updated to obtain multiple real image data with the latest complete information. This update operation may include, for example, updating parameters such as the shooting time, location, and resolution of the photos.

[0197] In some embodiments, the electronic device can simultaneously perform an update operation on one image (such as a real image of the first image) based on an update queue, thereby obtaining real image data of the first image with complete information. After the update operation on the real image of the first image is completed, the update queue releases the memory occupied during the processing of the update operation on the real image of the first image, and the update queue can then process update operations on subsequent images (such as a real image of the second image).

[0198] It should be understood that once the write operation of the first image is completed, space can be released to process the write operation of the second image. Similarly, once the update operation of the first image's true image is complete, the space occupied during image processing can be released immediately. Simultaneously, once the write operation of the second image is complete, the update operation of the second image's true image can begin, and subsequent image processing follows a similar process. This saves the time spent waiting for the first image to be fully processed before processing the second image, as well as the time spent on the write operation of the second image, thereby accelerating the processing speed during image storage, reducing storage time, and improving storage performance.

[0199] For example, such as Figure 8 As shown, once the update operation for the true image of image m at a certain position in the update queue (such as update m) is completed, the memory of update m can be released, allowing update m to perform update operations for subsequent images. Furthermore, after the update operation for the true image of image m is completed, the thumbnail of image m can be deleted from the delete queue.

[0200] It should be understood that the update queue can store the updated Uniform Resource Identifier (URI) of the image and the corresponding values ​​field (such as shooting time, mode, resolution and other related parameters). The URI can identify the storage path or storage location of the image.

[0201] In some embodiments, an electronic device can simultaneously update M images (real images). For example, if a user acquires X image data, all X image data can be added to the write queue and written simultaneously. After the write operation is completed, the data can be transferred to the update queue, which can process update operations on X images simultaneously. That is, the length of the update queue is M, and M≥X, so it can process X image data and perform write operations on X images simultaneously. For example, in image storage tasks involving multiple consecutive photos or long-press burst shooting scenarios, the multiple storage tasks accumulated in the update queue can be updated uniformly using batch updates, thereby reducing multiple connections to the database, reducing binder calls, and frequent IPC communication.

[0202] In some embodiments, an electronic device can perform update operations on multiple images by calling a batch processing interface.

[0203] For example, images acquired in the same batch can be processed in batches based on preset rules for update operations. That is, if multiple images meet the preset rules, the electronic device can perform update operations on multiple images by calling the batch processing interface. These preset rules include, but are not limited to, the following: the time interval between the capture of multiple images is less than a preset threshold; the number of images to be processed exceeds a preset threshold; and the similarity of multiple images is greater than a preset threshold. For instance, when multiple images are captured in a continuous shooting scenario or a long-press burst shooting scenario, and the number of images to be updated is large, the batch processing interface can be called to perform update operations on multiple images.

[0204] For example, if the number of images to be processed, X, is 10, and the queue length M of the update queue is 10, then the update operation can be performed on 10 images by calling the batch processing interface, i.e., 10 images can be updated in batches. By adding the images to be processed to the update queue, the electronic device can perform update operations on 10 images simultaneously in the update queue. In this way, processing 10 images only requires one binder call and one IPC communication, instead of 10 binder calls and 10 IPC communications, which can reduce binder calls and frequent IPC communications, and reduce CPU load.

[0205] For example, if the number of images to be processed, X, is 100, and the queue length M of the update queue is 10, then the batch processing interface can be called to first perform batch update operations on images 1-10. After the 10 images in the update queue have completed their update operations, the memory space of the update queue is released. Then, the batch processing interface is called again to perform batch update operations on images 11-20. After the 10 images in the update queue have completed their update operations, the memory space of the update queue is released, and then the batch update operations on subsequent images are performed. In this case, on the one hand, the binder calls and frequent IPC communication during the image update process can be reduced, thus reducing storage time. On the other hand, by releasing the memory space of the write queue in a timely manner, image updates can be accelerated, storage time can be reduced, and storage performance can be improved.

[0206] Step 350: Delete multiple thumbnails.

[0207] In some embodiments, after the update of the true image of the first image is completed, the electronic device can simultaneously perform a deletion operation on an image (such as a thumbnail of the first image) based on the deletion queue. That is, it deletes the thumbnail data of the first image from the media library, and at the same time, it can release the memory occupied by the deletion queue when processing the deletion operation of the thumbnail of the first image. The deletion queue can then process the deletion operation of subsequent images (such as thumbnails of the second image). In other words, after the deletion queue completes its corresponding operation, it can immediately release the memory space occupied during image processing, thereby accelerating the processing speed in the image storage process, reducing storage time, and improving storage performance.

[0208] For example, such as Figure 8 As shown, when the image at a certain position in the delete queue (such as delete p) is deleted, the memory of delete p can be released, so that delete p can perform subsequent image deletion operations, thereby reducing memory pressure and improving storage performance.

[0209] It should be understood that the delete queue can store the URI data of image thumbnails. When a deletion operation is performed, the location of the thumbnail can be found based on the URI data, and then the thumbnail can be deleted.

[0210] In some embodiments, the electronic device can perform deletion operations on multiple thumbnails simultaneously. Once the real image data has been updated through step 340, the image data of the thumbnail corresponding to the real image can be deleted from the delete queue. This reduces memory pressure and avoids wasting storage space, thereby improving storage efficiency and enhancing the user experience. Multiple deletion tasks accumulated in the delete queue can be deleted in batches, further reducing the need for multiple database connections, binder calls, and frequent IPC communication.

[0211] In some embodiments, an electronic device can perform deletion operations on multiple images by calling a batch processing interface.

[0212] For example, images acquired in the same batch can be processed in batches for deletion based on preset rules. That is, if multiple images meet the preset rules, the electronic device can perform deletion operations on multiple images by calling the batch processing interface. These preset rules include, but are not limited to, the following: the time interval between the capture of multiple images is less than a preset threshold; the number of images to be processed exceeds a preset threshold; and the similarity of multiple images is greater than a preset threshold. For instance, when multiple images are captured in a continuous shooting scenario or a long-press burst shooting scenario, and the number of images to be deleted is large, the batch processing interface can be called to perform deletion operations on multiple images.

[0213] For example, if the number of thumbnails to be deleted, X, is 10, and the length of the delete queue, P, is 10, then an update operation can be performed on 10 images by calling the batch processing interface, which means that 10 images can be deleted in batches. The images to be processed are added to the delete queue, and the electronic device can perform the deletion operation of 10 images simultaneously in the delete queue. In this way, processing 10 images only requires one call to binder and one IPC communication, instead of 10 binder calls and 10 IPC communications, which can reduce binder calls and frequent IPC communications, and reduce CPU pressure.

[0214] For example, if the number of images to be processed, X, is 100, and the length of the delete queue, M, is 10, then the batch processing interface can be called to first perform batch deletion operations on images 1-10. After the deletion of these 10 images, the memory space of the delete queue is released. Then, the batch processing interface is called again to perform batch deletion operations on images 11-20. After the deletion of these 10 images, the memory space of the delete queue is released, and then the batch deletion operations continue to be performed on subsequent images. In this scenario, on the one hand, the binder calls and frequent IPC communication during image deletion can be reduced, thus reducing storage time. On the other hand, by promptly releasing the memory space of the write queue, image deletion can be accelerated, further reducing storage time and improving storage performance.

[0215] It should be noted that, in this embodiment, write, update, and delete operations can all be performed in batches by calling the batch processing interface. For example, after the write task in the write queue has completed batch processing, the electronic device can call the batch processing interface to process the update task in the update queue; after the image update operation is completed, the electronic device can call the batch processing interface to process the delete task in the delete queue.

[0216] exist Figure 7 and Figure 8 In the image processing method shown, the writing queue, updating queue, and deleting queue can be executed in parallel, which can quickly complete the storage tasks of multiple images and store the images in the media library. Compared with the serial execution method, the solution of this application can release memory in a timely manner, reduce memory pressure, reduce storage time, and thus improve storage performance.

[0217] The above combination Figure 7 and Figure 8 This application provides a detailed description of an image processing method based on its embodiments. Figure 7 and Figure 8 In this process, parallel writing, updating, and deleting operations are performed on the image, ultimately storing the image in the media library to complete the image storage service. In some other embodiments, after the image is written, a checking operation can be performed to determine if the image data has been correctly written to the media library. If the image data is correctly written, subsequent update and deletion operations can be performed; if the image data is incorrectly written, a rewrite operation is required before subsequent update and deletion operations can be performed. The writing and checking operations can be performed sequentially. For more details, please refer to [link to relevant documentation]. Figure 9 and Figure 10 The description in the text.

[0218] Figure 9 This is a schematic flowchart of another image processing method 400 provided in an embodiment of this application. It should be understood that this image processing procedure can be executed at the application layer (see reference). Figure 3 It can also be executed at the FWK layer (see reference). Figure 4 This application does not limit the scope of the image processing method 400. The image processing method 400 may include steps 410 to 450, which will be described in detail below.

[0219] Step 410: Acquire multiple image data. This image data includes both the actual image data and the thumbnail image data.

[0220] For details on this step, please refer to step 310, which will not be repeated here.

[0221] Step 420: Create write and check queues, update queues, and delete queues.

[0222] The write and check queue, update queue, and delete queue are parallel queues. The write and check queue is the first queue mentioned above, which can be used to store write and check operation tasks for different images; the update queue is the second queue mentioned above, which can be used to store update operation tasks for different images; and the delete queue is the third queue mentioned above, which can be used to store delete operation tasks for different images.

[0223] For example, write and check operations, update operations, and delete operations can all be considered time-consuming tasks. That is, the time taken for the electronic device to perform a write and check operation on an image, the time taken for the electronic device to perform an update operation on an image, and the time taken for the electronic device to perform a delete operation on an image all exceed a preset threshold. When time-consuming tasks exist, task stacking may occur, leading to camera lag or inability to take pictures. This application reduces storage time by promptly releasing memory space occupied during different operation tasks, thereby accelerating processing and improving task execution efficiency.

[0224] It should be noted that the description of the write and check queue can be found in the description of the write queue in step 320. The difference between the write and check queue and the write queue in step 320 lies in whether a check operation is performed on the written image data after the image write operation is completed. It should be understood that the check operation can include read, SHA, and rewrite operations. After the write and check operations are completed, the data is then added to the subsequent update queue.

[0225] Understandably, the write and check queue can be used to store write and check operation tasks for different images, and the write and check operations can be executed serially. That is, after each image data write operation is completed, the written image data is checked to verify whether the data written to the media library is completely correct. If the written image data is completely correct, the memory space of the write and check queue is released, and then subsequent update and deletion operations are performed.

[0226] For example, such as Figure 10 As shown, Figure 10 The diagram shows parallel write and check queues, update queues, and delete queues. The lengths of the write and check queues can be [missing information - likely related to queue lengths]. Figure 8 The write queues shown have equal lengths of N; the update queue has a length of M; and the delete queue has a length of P. N, M, and P can be the same or different. In some examples, the write and check queues can store write and check operations for N images, the update queue can store update operations for M images, and the delete queue can store delete operations for P images.

[0227] The update queue and delete queue can be referred to in the relevant description in step 320, and will not be repeated here.

[0228] Step 430: Perform write and check operations on the acquired multiple image data, and save the multiple image data to the media library.

[0229] In this step, after the image is written, a check operation can be performed to determine whether the image data has been correctly written to the media library. The write and check operations are executed sequentially; that is, after an image is written, a check operation is performed. Only after both the write and check operations are completed is the memory space of the write and check queues released, and the image is then moved to the subsequent update queue for update operations.

[0230] For example, the inspection operation may include a read operation, a verification operation, and a re-write operation. Specifically, firstly, a read operation is performed on the first image written to the media library; then, a verification operation is performed on the image obtained from the read operation and the first image written to the media library; after passing the verification operation, it is determined whether the written image data and the read image data are completely identical. If it is determined that the written image data and the read image data are completely identical, it means that the image data has been correctly written to the media library, and subsequent update and deletion operations can be performed; if it is determined that the written image data and the read image data are different, it means that the image data has been incorrectly written to the media library, and a re-write operation is required. After the re-write operation is completed, subsequent update and deletion operations are performed.

[0231] It should be understood that the inspection operation of the first image may include the inspection operation of the true image of the first image and the inspection operation of the thumbnail of the first image. For details, please refer to step 230, which will not be repeated here.

[0232] It should be noted that the specific details of this step can be found in step 330, and the write operation in step 330 can be replaced with the write and check operations described above.

[0233] Step 440: Update the image data of multiple real images to obtain multiple real image data with complete information.

[0234] Step 450: Delete multiple thumbnails.

[0235] Steps 440 and 450 above can be referred to as steps 340 and 350 respectively, and will not be described again here.

[0236] It should be noted that, in the embodiments of this application, write and check operations, update operations, and delete operations can all be performed in batches by calling the batch processing interface. For example, after the write and check tasks in the write and check queue have completed batch processing, the electronic device can call the batch processing interface to process the update tasks in the update queue. After the image update operation is completed, the electronic device can call the batch processing interface to process the delete tasks in the delete queue.

[0237] exist Figure 9 and Figure 10 In the image processing method shown, after the image is written to the media library, the written image data can be checked to ensure its correctness. Furthermore, by using parallel execution of write and check queues, update queues, and delete queues, memory can be released promptly during processing, reducing memory pressure and storage time, thereby improving storage performance.

[0238] The above combination Figure 7 and Figure 8 , Figure 9 and Figure 10 This application provides a detailed description of two image processing methods provided in its embodiments. Figure 7 and Figure 8 In this process, parallel write, update, and delete operations are performed on the image, ultimately storing the image in the media library to complete the image storage service. Figure 9 and Figure 10 In this process, parallel write and check operations, update operations, and deletion operations are mainly performed on the image, ultimately storing the image in the media library to complete the image storage service. It should be noted that... Figure 9 and Figure 10 In this implementation, write and check operations are performed sequentially. In other embodiments, write, check, update, and delete operations can be performed on the image separately. These operations can be processed in parallel. For details, please refer to [link to relevant documentation]. Figure 11 and Figure 12 The description in the text.

[0239] Figure 11 This is a schematic flowchart of another image processing method 500 provided in an embodiment of this application. It should be understood that this image processing procedure can be executed at the application layer (see reference). Figure 3 It can also be executed at the FWK layer (see reference). Figure 4 This application does not limit the scope of the image processing method 500. The image processing method 500 may include steps 510 to 560, which will be described in detail below.

[0240] Step 510: Acquire multiple image data. This image data includes both the actual image data and the thumbnail image data.

[0241] For details on this step, please refer to step 310, which will not be repeated here.

[0242] Step 520: Create a write queue, check a queue, update a queue, and delete a queue.

[0243] The write queue, check queue, update queue, and delete queue are parallel queues. The write queue, also known as the first queue, is used to store write operation tasks for different images; the check queue, also known as the fourth queue, is used to store check operation tasks for different images; the update queue, also known as the second queue, is used to store update operation tasks for different images; and the delete queue, also known as the third queue, is used to store delete operation tasks for different images.

[0244] For example, write, check, update, and delete operations can all be considered time-consuming tasks. This means that the time taken for the electronic device to write an image, update an image, and delete an image all exceed a preset threshold. When time-consuming tasks exist, task stacking may occur, leading to camera lag or inability to take pictures. This application addresses this by promptly releasing memory space occupied during different tasks, reducing storage time, accelerating processing, and improving task execution efficiency. After completing multiple image write operations, the written image data can be transferred to a check queue for post-write checks. These checks may include read, SHA, and rewrite operations. After the checks are completed, the checked image data is then transferred to the subsequent update queue.

[0245] For example, such as Figure 12 As shown, Figure 12 The diagram illustrates parallel write, check, update, and delete queues. The write queue has a length of N, the check queue has a length of Q, the update queue has a length of M, and the delete queue has a length of P. N, Q, M, and P can be the same or different. That is, the write queue can hold write tasks for N images, the check queue can hold check tasks for Q images, the update queue can hold update tasks for M images, and the delete queue can hold delete tasks for P images.

[0246] It should be noted that the descriptions for writing to the queue, updating the queue, and deleting from the queue can be found in step 320 and will not be repeated here. The following mainly introduces the relevant content of checking the queue.

[0247] In some embodiments, the electronic device may process the inspection operation of one image at a time based on a check queue. For example, such as Figure 12 As shown, after the image inspection operation at position 1 in the check queue is completed, the memory of check 1 can be released. At the same time, check 1 can perform subsequent image inspection operations. In addition, the image data at position 1 can be filled into position 1 in the update queue to perform subsequent image update operations.

[0248] In some embodiments, the electronic device can simultaneously perform inspection tasks or inspection operations on Q images based on a check queue, that is, perform image inspection operations in a batch processing manner.

[0249] For example, when the check queue is full, no enqueue operation can be performed. That is, the memory space for checks 1 through 2 is occupied, and image checks are being performed on all of them; therefore, no new images can be added, and subsequent image checks cannot be performed. However, when a position in the check queue is empty, a new image can be added, and subsequent image checks can continue. For example, if check 2 is empty, image checks can be performed at position check 2. After the check is completed, the memory for check 2 is released to allow for subsequent image checks.

[0250] Step 530: Perform a write operation on the acquired multiple image data and save the multiple image data to the media library.

[0251] For details on this step, please refer to step 330, which will not be repeated here.

[0252] Step 540: Perform an inspection operation on the multiple image data saved in the media library to determine the correctness of the image data saved in the media library.

[0253] It should be understood that step 530 completes the writing operation of multiple image data, writing multiple image data (including multiple real image data and multiple thumbnail image data) into the media library. After completing the writing operation in step 530, a check operation can be performed on the multiple image data to determine the correctness of the image data stored in the media library. In other words, the check operation ensures that all image data stored in the media library is correct.

[0254] In some embodiments, the electronic device can simultaneously perform an inspection operation on one image (such as the first image) based on an inspection queue to determine the correctness of the image data stored in the media library. After the electronic device completes the inspection operation on the first image, it can release the memory occupied by the inspection queue during the processing of the first image. Simultaneously, the electronic device can check the correctness of subsequent images based on the inspection queue. That is, after the electronic device completes the corresponding inspection operation, it can immediately release the memory space occupied during image processing, thereby accelerating the processing speed during image storage, reducing storage time, and improving storage performance. It should be understood that the inspection operation on the first image may include an inspection operation on the actual image of the first image and an inspection operation on the thumbnail of the first image. For details, please refer to step 230, which will not be repeated here.

[0255] For example, such as Figure 12As shown, once the inspection operation for image p at a certain position (e.g., check q) in the check queue is completed, the memory of check q can be released, allowing the electronic device to perform subsequent image inspection operations at check q. Furthermore, after the inspection operation for the true image of image p is completed, an update operation for the true image of image p can be performed in the update queue. Similarly, after the inspection operation for the thumbnail of image p and the update operation for the true image of image p are completed, a deletion operation for the thumbnail of image p can be performed in the delete queue.

[0256] In some embodiments, the electronic device can simultaneously check Q images based on a check queue. For example, if a user acquires X image data, all X image data can be added to the write queue and written simultaneously. After the write operation is completed, the data can be transferred to the check queue, which can simultaneously process update operations for X (X≤Q) images. That is, the length of the check queue is Q, and Q≥X, so it can process X image data and perform check operations on X images simultaneously. For example, in image storage tasks involving multiple consecutive photos or long-press burst shooting scenarios, the multiple storage tasks accumulated in the check queue can be updated uniformly using a batch update method, thereby reducing multiple connections to the database, reducing binder calls, and frequent IPC communication.

[0257] In some embodiments, an electronic device can perform inspection operations on multiple images by calling a batch processing interface.

[0258] For example, images acquired in the same batch can be processed in batches based on preset rules for inspection. In other words, if multiple images meet the preset rules, the electronic device can perform write operations on multiple images by calling the batch processing interface. These preset rules include, but are not limited to, the following: the time interval between the capture of multiple images is less than a preset threshold; the number of images to be processed exceeds a preset threshold; and the similarity of multiple images is greater than a preset threshold. For instance, when multiple images are captured in a continuous shooting scenario or a long-press burst shooting scenario, and the number of images to be inspected is large, the batch processing interface can be called to perform inspection operations on multiple images.

[0259] For example, if the number of images to be processed, X, is 10, and the queue length, Q, is 10, then the batch processing interface can be used to perform inspection operations on all 10 images simultaneously. By adding the images to be processed to the check queue, the electronic device can perform inspection operations on all 10 images at the same time. This way, processing 10 images only requires one binder call and one IPC communication, instead of 10 binder calls and 10 IPC communications, reducing binder calls and frequent IPC communications, thus reducing CPU load.

[0260] For example, if the number of images to be processed, X, is 100, and the length of the check queue, N, is 10, then the batch processing interface can be called to first perform batch checks on images 1-10. After the 10 images in the check queue have completed their checks, the memory space of the check queue is released. Then, the batch processing interface is called again to perform batch checks on images 11-20. After the 10 images in the check queue have completed their checks, the memory space of the check queue is released, and then the batch checks on subsequent images can continue. In this way, on the one hand, the binder calls and frequent IPC communication during the image checking process can be reduced, thus reducing storage time. On the other hand, by releasing the memory space of the check queue in a timely manner, image checking can be accelerated, storage time can be reduced, and storage performance can be improved.

[0261] Step 450: Update the image data of multiple real images to obtain multiple real image data with complete information.

[0262] Step 460: Delete multiple thumbnails.

[0263] Steps 450 and 460 above can be referred to as steps 340 and 350 respectively, and will not be described again here.

[0264] It should be noted that, in the embodiments of this application, write operations, check operations, update operations, and delete operations can all be performed in batches by calling the batch processing interface. For example, after the write tasks in the write queue have completed batch processing, the electronic device can call the batch processing interface to process the check tasks in the check queue; after the image check operation has been completed, the electronic device can call the batch processing interface to process the update tasks in the update queue; and after the image update operation has been completed, the electronic device can call the batch processing interface to process the delete tasks in the delete queue.

[0265] exist Figure 11 and Figure 12In the image processing method shown, after the image is written to the media library, the written image data can be checked to ensure its correctness. Furthermore, by using a parallel execution method of write queue, check queue, update queue, and delete queue, compared to... Figure 9 or Figure 10 The processing method shown can further reduce memory pressure and improve storage performance.

[0266] The above text combined Figures 1 to 12 The method embodiments of this application are described in detail below, in conjunction with... Figure 13 and Figure 14 The apparatus embodiments of this application are described below. It should be understood that the descriptions of the method embodiments correspond to the descriptions of the apparatus embodiments; therefore, any parts not described in detail can be referred to the foregoing method embodiments.

[0267] Figure 13 This application provides an image processing apparatus 1000 that can possess the functions of the electronic device described in the above method embodiments and can be used to execute the steps performed by the electronic device in the above method embodiments. This function can be implemented in hardware, or in software, or in hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions.

[0268] In one possible implementation, the device 1000 may include an acquisition module 1010 and a processing module 1020, which are coupled to each other.

[0269] The acquisition module 1010 can be used to acquire multiple image data, such as the aforementioned acquisition of multiple real image data and multiple thumbnail data.

[0270] The processing module 1020 is used to support the electronic device in performing the processing actions in the above method embodiments, such as writing, checking, updating and deleting the acquired image data.

[0271] Optionally, the image processing apparatus 1000 may also include a storage unit 1030 for storing real image data or thumbnail data.

[0272] Figure 14 An electronic device 2000 provided in this application embodiment is shown in the figure. The electronic device 2000 includes at least one processor 2100 and a transceiver 2200. The processor 2100 is coupled to a memory 2300 and is used to execute instructions stored in the memory 2300 to control the transceiver 2200 to transmit and / or receive signals.

[0273] Optionally, the electronic device 2000 also includes a memory 2300 for storing instructions.

[0274] In some embodiments, the processor 2100 and the memory 2300 can be combined into a single processing device, with the processor 2100 executing program code stored in the memory 2300 to achieve the aforementioned functions. In specific implementations, the memory 2300 can be integrated into the processor 2100 or independent of it.

[0275] In some embodiments, transceiver 2200 may include a receiver (or receiver unit) and a transmitter (or transmitter unit).

[0276] The transceiver 2200 may further include an antenna, and the number of antennas may be one or more. The transceiver 2200 may be a communication interface or an interface circuit.

[0277] When the electronic device 2000 is a chip, the chip includes a transceiver module and a processing module. The transceiver module can be an input / output circuit or a communication interface; the processing module can be a processor, microprocessor, or integrated circuit integrated on the chip.

[0278] This embodiment also provides a computer-readable storage medium storing computer instructions. When the computer instructions are executed on an electronic device, the electronic device performs the aforementioned method steps to implement the image processing method described above.

[0279] This embodiment also provides a computer program product that, when run on a computer, causes the computer to perform the aforementioned steps to implement the image processing method described above.

[0280] Furthermore, embodiments of this application also provide an apparatus, which may specifically be a chip, component, or module. The apparatus may include a connected processor and a memory. The memory stores computer execution instructions. When the apparatus is running, the processor can execute the computer execution instructions stored in the memory to cause the chip to perform the image processing methods described in the above method embodiments.

[0281] In this embodiment, the electronic device, computer-readable storage medium, computer program product or chip are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can be referred to the beneficial effects of the corresponding methods provided above, and will not be repeated here.

[0282] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0283] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0284] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0285] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0286] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0287] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0288] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. An image processing method, characterized in that, include: An electronic device acquires multiple images, including a first image and a second image; The electronic device creates multiple queues, including a first queue and a second queue. The electronic device performs a first operation on the multiple images based on the first queue, and performs a second operation on the multiple images based on the second queue. The electronic device performs the first operation on the first image. After the first operation is completed, it releases the memory occupied by the first queue when processing the first image and outputs the first operation result. The electronic device then continues to perform the first operation on the second image and outputs the second operation result. The electronic device performs the second operation based on the first operation result. After the second operation is completed, the memory occupied by the second queue when processing the first operation result is released, and the electronic device continues to perform the second operation on the second operation result. Wherein, the first operation includes a write operation, the second operation includes an update operation, and the electronic device performing the first operation on the first image includes: Write the real image data of the first image into the media library; The electronic device performs the second operation based on the first operation result, including: Update the real image data of the first image in the media library to obtain the updated real image data of the first image.

2. The method according to claim 1, characterized in that, The plurality of queues further includes a third queue, and the electronic device performs the deletion operation on the plurality of images based on the third queue. The electronic device performing the first operation on the first image further includes: Write the thumbnail data of the first image into the media library; After updating the real image data of the first image in the media library and obtaining the updated real image data of the first image, the method further includes: Delete the thumbnail data of the first image from the media library.

3. The method according to claim 2, characterized in that, The plurality of queues further includes a fourth queue, upon which the electronic device performs the inspection operation on the plurality of images. After the electronic device performs the first operation on the first image, and before the electronic device performs the second operation based on the result of the first operation, the method further includes: The inspection operation is performed on the real image data of the first image in the media library. After the inspection operation is completed, the memory occupied by the fourth queue during the inspection operation of the real image data of the first image is released.

4. The method according to claim 2, characterized in that, The first operation further includes an inspection operation, after the real image data of the first image is written into the media library, the method further includes: The inspection operation is performed on the real image data of the first image in the media library.

5. The method according to claim 3 or 4, characterized in that, The inspection operation includes a read operation, a verification operation, and a rewrite operation. The inspection operation performed on the real image data of the first image written to the media library includes: Perform a readout operation on the real image data of the first image in the media library; The image data obtained from the readout operation is compared with the real image data of the first image in the media library. If it is determined that the image data obtained by the readout operation is different from the real image data of the first image in the media library, then the rewrite operation is performed.

6. The method according to any one of claims 1 to 4, characterized in that, The method further includes: The electronic device performs the first operation and / or the second operation on the plurality of images by calling a batch processing interface.

7. The method according to claim 6, characterized in that, When the multiple images meet the preset rules, the electronic device performs the first operation and / or the second operation on the multiple images by calling the batch processing interface. The preset rules include any one of the following: the shooting time interval of the multiple images is less than a first threshold, the number of the multiple images is greater than a second threshold, and the similarity of the multiple images is greater than a third threshold.

8. The method according to any one of claims 1 to 4, characterized in that, The multiple images are multiple images taken in a continuous shooting scene.

9. An image processing apparatus, characterized in that, include: The acquisition module is used to acquire multiple images, including a first image and a second image; A processing module is used to create multiple queues, including a first queue and a second queue. The processing module performs a first operation on the multiple images based on the first queue, and performs a second operation on the multiple images based on the second queue. The processing module is further configured to perform the first operation on the first image, and after the first operation is completed, release the memory occupied by the first queue when processing the first image, and output the first operation result. The processing module is further configured to continue performing the first operation on the second image and output the second operation result; The processing module is further configured to perform the second operation based on the first operation result, and after the second operation is completed, release the memory occupied by the second queue when processing the first operation result; The processing module is further configured to continue performing the second operation on the result of the second operation; The first operation includes a write operation, the second operation includes an update operation, and the processing module is further configured to: Write the real image data of the first image into the media library; Update the real image data of the first image in the media library to obtain the updated real image data of the first image.

10. The apparatus according to claim 9, characterized in that, The plurality of queues also includes a third queue, and the processing module performs the deletion operation on the plurality of images based on the third queue. The processing module is further configured to: write the thumbnail data of the first image into a media library; After updating the real image data of the first image in the media library and obtaining the updated real image data of the first image, the processing module is further configured to: delete the thumbnail data of the first image in the media library.

11. The apparatus according to claim 10, characterized in that, The plurality of queues further includes a fourth queue. The processing module performs inspection operations on the plurality of images based on the fourth queue. After performing the first operation on the first image and before performing the second operation based on the result of the first operation, the processing module is further configured to: The inspection operation is performed on the real image data of the first image written to the media library. After the inspection operation is completed, the memory occupied by the fourth queue during the inspection operation of the real image data of the first image is released.

12. The apparatus according to claim 10, characterized in that, The first operation also includes an inspection operation, and the processing module is further configured to: perform the inspection operation on the real image data of the first image in the media library.

13. The apparatus according to claim 11 or 12, characterized in that, The inspection operation includes a read operation, a verification operation, and a rewrite operation. The processing module is also used for: Perform a readout operation on the real image data of the first image in the media library; The image data obtained from the readout operation is compared with the real image data of the first image in the media library. If it is determined that the image data obtained by the readout operation is different from the real image data of the first image in the media library, then the rewrite operation is performed.

14. The apparatus according to any one of claims 9 to 12, characterized in that, The processing module is also used for: The first operation and / or the second operation are performed on the multiple images by calling the batch processing interface.

15. The apparatus according to claim 14, characterized in that, When the multiple images meet the preset rules, the processing module performs the first operation and / or the second operation on the multiple images by calling the batch processing interface. The preset rules include any one of the following: the shooting time interval of the multiple images is less than a first threshold, the number of the multiple images is greater than a second threshold, and the similarity of the multiple images is greater than a third threshold.

16. The apparatus according to any one of claims 9 to 12, characterized in that, The multiple images are multiple images taken in a continuous shooting scene.

17. An electronic device, characterized in that, include: One or more processors; One or more memory units; The one or more memories store one or more computer programs, the one or more computer programs including instructions that, when executed by the one or more processors, cause the electronic device to perform the method as described in any one of claims 1 to 8.

18. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by a computer, causes the computer to perform the method as described in any one of claims 1 to 8.

19. A computer program product containing instructions, characterized in that, When the computer program product is run on a computer, it causes the computer to perform the method as described in any one of claims 1 to 8.

20. A chip, characterized in that, The device includes a processor and a memory, wherein the processor is configured to read instructions stored in the memory, and when the processor executes the instructions, causes the chip to implement the method of any one of claims 1 to 8.

Citation Information

Patent Citations

  • Double-queue asynchronous image processing method and device

    CN112487034A

  • Shooting method

    CN117119285A