Image processing method, storage medium, electronic device and program product
By detecting user deletion commands in electronic devices and generating cancellation commands, the problem of users being unable to delete images being processed in a timely manner is solved, ensuring that images are completely deleted and improving user experience and efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HONOR DEVICE CO LTD
- Filing Date
- 2024-10-11
- Publication Date
- 2026-04-21
AI Technical Summary
When electronic devices are processing images, users may not be able to delete images that are undergoing the second stage of processing in a timely manner, resulting in invalid deletions. This is especially true when the device's power consumption, temperature, or memory is high, which affects the user experience.
By detecting the user's deletion command, a corresponding cancellation command is generated and timed, and the process is canceled or waited for the second stage of processing. This ensures that a second image is not generated after deleting one image, or that both images are deleted together after they are generated, thus avoiding invalid deletion.
It enables complete image deletion under high load conditions on electronic devices, avoiding repetitive operations and improving user experience and deletion efficiency.
Smart Images

Figure CN121908110A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to an image processing method, storage medium, electronic device, and program product. Background Technology
[0002] When users take pictures using electronic devices such as mobile phones, if the power consumption, temperature, or memory of the electronic device are high, in order to improve the display speed and image quality of the electronic device, the electronic device can use a dumping technique to process the acquired image data in two stages. For example, a simpler first-stage processing is used to generate a segment image to improve the display speed, and then a more complex second-stage processing is used to generate a second segment image. The second segment image is then used to replace the first segment image to improve the image quality of the displayed image.
[0003] For example, when taking a picture, an electronic device can capture multiple sub-images with different exposure values. Then, it can perform a first-stage processing on the multiple sub-images, such as selecting any one of the multiple sub-images as a segment image and displaying the segment image, thereby improving the display speed of the electronic device. Then, it can perform a second-stage processing on the multiple sub-images, such as performing high dynamic range (HDR) fusion on the multiple sub-images to generate a two-segment image, and replacing the first segment image with the two-segment image to display the two-segment image, thereby improving the image quality of the electronic device.
[0004] However, if a user wants to delete an image generated using dumping technology (such as a single-segment image and a two-segment image), and the image currently displayed on the electronic device is a single-segment image generated in the first stage of processing, while the electronic device is undergoing the second stage of processing and has not yet generated a two-segment image, the user can only delete the single-segment image generated in the completed first stage of processing. Because the electronic device is in the second stage of processing and has not yet generated a two-segment image, the user cannot delete the two-segment image. Thus, once the electronic device completes the second stage of processing and generates the two-segment image, it will continue to display the two-segment image, rendering the deletion invalid. Summary of the Invention
[0005] This invention provides an image processing method, a storage medium, an electronic device, and a program product.
[0006] In a first aspect, the present invention provides an image processing method applied to an electronic device, the method comprising: detecting a shooting command and acquiring first image data captured by a camera; performing a first stage processing on the first image data to generate and display a first image; detecting a first deletion command corresponding to the first image, deleting the first image, and canceling the second stage processing on the first image data, or deleting the second image generated by performing the second stage processing on the first image data.
[0007] In one possible implementation of the first aspect described above, the method further includes: upon detecting a first deletion instruction, generating a first cancellation instruction corresponding to the second stage processing and performing a cancellation timer; and canceling the second stage processing of the first image data, or deleting the second image generated by the second stage processing of the first image data, including: deleting only the first image if a successful execution result of the first cancellation instruction is detected within the cancellation time period; deleting both the first image and the second image if a failed execution result of the first cancellation instruction is detected within the cancellation time period; and deleting only the first image if no execution result of the first cancellation instruction is detected within the cancellation time period.
[0008] In this embodiment, after the electronic device completes the first-stage processing of the acquired data (corresponding to an example of the first image data) to generate and display a segment image (corresponding to an example of the first image), if the electronic device detects a user's deletion operation on the segment image, the electronic device cancels the second-stage processing of the acquired data and deletes the segment image. It is understood that since the second-stage processing is canceled, a second segment image will not be generated after deleting the segment image, thus ensuring complete deletion of the image. Alternatively, the electronic device acquires the second segment image generated by the second-stage processing (corresponding to an example of the second image) and deletes both the segment image and the second segment image together. It is understood that when the second-stage processing is in progress, or when the processing has ended and a second segment image has been generated but the segment image has not been replaced, it is difficult to cancel the second-stage processing. That is, the electronic device can acquire the second segment image before deleting both the segment image and the second segment image together, avoiding invalid deletion where only the segment image is deleted without deleting the second segment image.
[0009] In one possible implementation of the first aspect above, the method further includes: processing the first image data through a first processing flow, wherein the first processing flow includes: performing a first processing on the first image data to generate and display a third image, wherein the third image corresponds to a thumbnail of the first image data; performing a first-stage processing on the first image data to generate a first image, deleting the third image, and displaying the first image; generating a processing task to perform a second-stage processing on the first image data; wherein the processing time of the first processing is less than the processing time of the first-stage processing, and the processing time of the first-stage processing is less than the processing time of the second-stage processing.
[0010] In one possible implementation of the first aspect above, the method further includes: when generating the third image, loading target information into the image information corresponding to the third image, wherein the target information is used to mark the processing of the first image data using the first processing flow; and generating the first image and deleting the third image includes: loading target information into the image information corresponding to the first image.
[0011] In one possible implementation of the first aspect above, processing the first image data through a first processing flow includes: the electronic device processing the first image data through the first processing flow in a target scene, wherein the target scene includes at least one of the following: the running memory of the electronic device is greater than or equal to a first memory threshold; the operating temperature of the electronic device is greater than or equal to a first temperature threshold; and the operating power consumption of the electronic device is greater than or equal to a first power consumption threshold.
[0012] In one possible implementation of the first aspect above, the method further includes: processing the first image data through a second processing flow, wherein the second processing flow includes: performing a first-stage processing on the first image data to generate and display a first image, wherein the first image corresponds to a thumbnail of the first image data; generating a processing task to perform a second-stage processing on the first image data; wherein the processing time of the first-stage processing is less than the processing time of the second-stage processing.
[0013] In one possible implementation of the first aspect described above, the first deletion instruction is further configured to delete a fourth image while deleting the first image, wherein the fourth image is an image generated by performing a second-stage processing on the second image data, and the method further includes: deleting the fourth image.
[0014] In a second aspect, embodiments of the present invention provide a computer-readable storage medium storing instructions that, when executed on an electronic device, cause the electronic device to implement any of the image processing methods provided by the first aspect and various possible implementations of the first aspect.
[0015] Thirdly, embodiments of the present invention provide an electronic device comprising: a memory for storing instructions executed by one or more processors of the electronic device; and a processor, one of the processors of the electronic device, for executing the instructions stored in the memory to implement any of the image processing methods provided by the first aspect and various possible implementations of the first aspect.
[0016] Fourthly, embodiments of the present invention provide a program product including instructions that, when executed by an electronic device, enable the electronic device to implement any of the image processing methods provided in the first aspect and various possible implementations of the first aspect. Attached Figure Description
[0017] Figure 1 According to some embodiments of the present invention, an example schematic diagram of a shooting interface 11 is shown;
[0018] Figure 2 According to some embodiments of the present invention, an example schematic diagram of a picture interface 12 is shown;
[0019] Figure 3A According to some embodiments of the present invention, an example schematic diagram of an operating interface 13 is shown;
[0020] Figure 3B According to some embodiments of the present invention, an example schematic diagram of another user interface 13 is shown;
[0021] Figure 4A According to some embodiments of the present invention, an example schematic diagram of a picture interface 141 is shown;
[0022] Figure 4B According to some embodiments of the present invention, an example schematic diagram of a picture interface 142 is shown;
[0023] Figure 4C According to some embodiments of the present invention, an example schematic diagram of a picture interface 143 is shown;
[0024] Figure 5A According to some embodiments of the present invention, a schematic diagram of the frame of an electronic device 100 is shown;
[0025] Figure 5B An interactive flowchart is shown according to some embodiments of the present invention;
[0026] Figure 5C According to some embodiments of the present invention, an example schematic diagram of a picture interface 15 is shown;
[0027] Figure 6 According to some embodiments of the present invention, an example schematic diagram of another user interface 13 is shown;
[0028] Figure 7 According to some embodiments of this application, an execution flowchart of a gallery application layer 1001 is shown;
[0029] Figure 8 According to some embodiments of this application, an execution flowchart of a framework layer 10002 is shown;
[0030] Figure 9 According to some embodiments of this application, an execution flowchart of a hardware abstraction layer 1003 is shown;
[0031] Figure 10 According to some embodiments of this application, an execution flowchart of another hardware abstraction layer 1003 is shown;
[0032] Figure 11 According to some embodiments of this application, a hardware structure diagram of an electronic device 100 is shown. Detailed Implementation
[0033] The illustrative embodiments of the present invention include, but are not limited to, an image processing method, a storage medium, an electronic device, and a program product.
[0034] The following is in conjunction with the appendix Figures 1 to 11 The technical solution of the present invention will be described.
[0035] In some embodiments, users can take photos using the camera function of electronic devices such as mobile phones.
[0036] For example, such as Figure 1 As shown, when using mobile phone 10, the user can take pictures through the camera application on mobile phone 10. For example, when mobile phone 10 detects that the user clicks on the camera application on mobile phone 10, mobile phone 10 opens the camera application and displays the shooting interface 11. Subsequently, when mobile phone 10 detects that the user clicks on control 10A, mobile phone 10 captures image data through the camera and generates a captured image based on the captured image data (hereinafter referred to as captured data), and then stores the captured image to the gallery application.
[0037] In some embodiments, during the process of generating a captured image, the electronic device may first generate a thumbnail based on the acquired data and display the thumbnail on the corresponding shooting interface; in this case, the captured image stored in the gallery application is a thumbnail. It is understood that the thumbnail has a lower resolution, and its main function is to quickly display the corresponding captured image on the shooting interface in response to the user's shooting operation, so that the user knows that the shooting has been completed.
[0038] Furthermore, the electronic device performs preset target processing on the collected data to generate a real image, and replaces the previously generated thumbnail with the real image; at this point, the captured image stored in the gallery application is the real image. It can be understood that the real image has a higher resolution, and its resolution is greater than that of the thumbnail. The main function of the real image is to improve the image quality of the captured image so that users can see more image details.
[0039] In other words, during the shooting process, the electronic device first displays a thumbnail to let the user know the shooting progress, and then replaces the thumbnail with the real image so that the user can see more image details. The real image can be understood as representing the final image displayed by the electronic device.
[0040] In some embodiments, the target processing performed by the above-mentioned electronic device on the collected data may include automatic exposure adjustment, white balance correction, basic sharpening, HDR fusion, intelligent scene recognition, etc., and there are no specific limitations.
[0041] For example, such as Figure 1As shown, after the user clicks on control 10A, the mobile phone 10 generates a thumbnail based on the collected data and displays the thumbnail in the lower left corner of the shooting interface 11. It can be understood that when the user sees the thumbnail corresponding to the shot displayed in the lower left corner of the shooting interface 11, the user knows that the shot has been taken and can view the corresponding image through the gallery application on the mobile phone 10.
[0042] Furthermore, such as Figure 2 As shown, when phone 10 detects that the user clicks on the Gallery app on phone 10, phone 10 opens the Gallery app and displays the image interface 12. It can be understood that... Figure 2 In the image interface 12 shown, if the mobile phone 10 has not yet completed the target processing and generated a real image, the image interface 12 displays a thumbnail, for example... Figure 2 In Figure 1 A is Figure 1 The thumbnail generated by mobile phone 10 based on the collected data; if mobile phone 10 has completed target processing and generated a real image, then the image interface 12 displays the real image, for example. Figure 2 In Figure 1 A is Figure 1 The image generated by the Chinese mobile phone 10 based on the collected data.
[0043] In some embodiments, when the electronic device is operating under conditions of high power consumption, high temperature, or high memory, in order to improve the display speed and image quality of the images displayed by the electronic device, the electronic device may use a dumping technique to process the collected data in two stages.
[0044] For example, such as Figure 1 As shown, when the mobile phone 10 takes a picture through the camera, the mobile phone 10 can capture multiple sub-images with different exposure values. Then, the mobile phone 10 first performs thumbnail processing on the multiple sub-images, such as generating a thumbnail based on any one sub-image (such as a sub-image with an exposure value of 0), and displays the thumbnail on the shooting interface 11 so that the user can know the shooting progress; at this time, the captured images stored and displayed by the gallery application are thumbnails.
[0045] Furthermore, when the phone 10 is under conditions of high power consumption, high temperature, or high memory, such as when the phone 10 is running other applications such as video applications or game applications in the background, or when the phone 10 is continuously taking multiple images, the phone 10 can use dump technology to process the collected data in two stages.
[0046] For example, the phone 10 first performs a first-stage processing on multiple sub-images, such as basic sharpening of the sub-image with an exposure value of 0, to generate a segment image, which replaces the previously generated thumbnail. At this point, the image stored and displayed in the gallery app is a segment image. This simple processing improves image display speed while maintaining image quality. Further, the phone 10 performs a second-stage processing on the multiple sub-images, such as complex processing like HDR compositing, to generate a second segment image, which replaces the previously generated segment image. At this point, the image stored and displayed in the gallery app is a second segment image. This complex processing further improves image quality, ensuring the image displays more detail.
[0047] It's understandable that simple processing typically has a shorter processing time, but the resulting image quality is usually lower; while complex processing typically has a longer processing time, but the resulting image quality is usually higher. In other words, when electronic devices are operating at high power consumption, high temperature, or high memory usage, simple processing can improve the image display speed, while complex processing can improve the image display quality.
[0048] It is understood that the foregoing examples of simple and complex processing are merely examples of embodiments of this application. In other embodiments, simple and complex processing may also be other processing methods. For example, simple processing may be automatic exposure adjustment, white balance correction, etc., and complex processing may be portrait beautification processing, intelligent scene recognition, etc., without any specific limitations.
[0049] It is understood that electronic devices can execute thumbnail processing, first-stage processing, and second-stage processing simultaneously, or sequentially. For example, the processing time for thumbnail processing is typically shorter than the processing time for the first-stage processing, and the processing time for the first-stage processing is typically shorter than the processing time for the second-stage processing. That is, whether executed synchronously or sequentially, thumbnail processing, first-stage processing, and second-stage processing are usually performed by the same device, and the order of image generation time should be: thumbnail generation time, first-stage processing time, and second-stage processing time.
[0050] To more clearly describe the embodiments of this application, the aforementioned target processing is referred to as one-stage processing, the images generated by one-stage processing are collectively referred to as true images, the images generated by the first stage processing in two-stage processing are collectively referred to as one-stage images, and the images generated by the second stage processing in two-stage processing are collectively referred to as two-stage images.
[0051] In some embodiments, users can delete any one or more images in the gallery application.
[0052] For example, such as Figure 2 and Figure 3A As shown, when the user long-presses image 1A on the image interface 12, the phone 10... Figure 2 The image interface shown in picture 12 switches to Figure 3A The operation interface 13 is shown, and the image selected by the user by long-pressing is marked in the operation interface 13, such as image 1A. It can be understood that the user can select one or more images in the operation interface 13 to perform operations such as sharing, saving, editing, and deleting.
[0053] For example, such as Figure 3A As shown, users can click the controls corresponding to operations such as share, favorite, edit, and delete to perform corresponding operations on image 1A in the operation interface 13. For example, when the phone 10 detects that the user clicks control 10B, it can delete image 1A from the gallery application.
[0054] For example, such as Figure 3A and Figure 3B As shown, after image 1A has been selected, the user can click on images 1B, 1C, and 1D to select images 1C through 1D. Then, the user can click on the controls corresponding to operations such as share, favorite, edit, and delete to perform the corresponding operations on images 1A through 1D in the operation interface 13. For example, as... Figure 3B As shown, when the mobile phone 10 detects that the user clicks on image 1B, images 1C to 1D, and clicks on control 10B, it can perform multi-select deletion of images 1A to 1D to delete them in batches from the gallery application.
[0055] In some embodiments, after the electronic device performs a first-stage processing on the acquired data to generate a segment image, it can automatically delete the thumbnail generated by the thumbnail processing; after the electronic device performs a second-stage processing on the acquired data to generate a two-segment image, it can automatically delete the segment image generated by the first-stage processing. However, the electronic device can only perform deletion operations on images that have already been generated.
[0056] For example, such as Figure 3A As shown, with Figure 3A Taking image 1A as an example, which is a two-segment image, when phone 10 detects that the user clicks control 10B, it deletes the two-segment image from the gallery application. It can be understood that since image 1A is a two-segment image, phone 10 has already deleted the previously generated thumbnail and single segment when generating the two-segment image. In other words, after deleting the two-segment image, phone 10 will not generate or display any new images. For example, after the user deletes image 1A (the two-segment image), phone 10 will delete the image from the gallery application. Figure 3A The operation interface 13 shown is switched to display as Figure 4A The photo interface 141 is shown; in the photo interface 141, image 1A is completely deleted.
[0057] However, see continue Figure 3A As shown, if Figure 3A Image 1A is a single segment image, and phone 10 is currently in the second stage of processing, having not yet generated the corresponding second segment image. At this time, if phone 10 detects a user clicking control 10B, it can only delete the single segment image from the gallery application. Since phone 10 is in the second stage of processing and hasn't generated the second segment image, it cannot delete the second segment image. Subsequently, after phone 10 completes the second stage of processing and generates the second segment image, it will continue to display the second segment image in the gallery application's interface, resulting in an invalid deletion. The user needs to perform a repeated deletion operation to remove the second segment image. For example, after the user deletes image 1A (the single segment image), phone 10... Figure 3A The operation interface 13 shown is switched to display as Figure 4B The photo interface 142 shown; in the photo interface 142, image 1A has not been deleted, which means that image 1A in the photo interface 142 is a two-segment image.
[0058] Specifically, for users who take continuous photos using the mobile phone 10, capture multiple images, and then select and delete multiple images (as mentioned above)... Figure 3B When a user selects and deletes multiple images (as described), they are deleting multiple single-segment images, but the phone 10 is still in the second stage of processing and has not yet generated multiple second-segment images. Therefore, after the user deletes the single-segment images, once the phone 10 completes the second stage of processing and generates the second-segment images, it will continue to display the second-segment images, rendering the deletion ineffective. The user needs to repeat the process to completely delete the images, which is cumbersome. For example, if... Figure 3B As shown, images 1A and 1B are a single segment, and images 1C and 1D are two segments. After the user selects and deletes multiple images from 1A to 1D, the phone 10... Figure 3B The operation interface 13 shown is switched to display as Figure 4C The photo interface 143 is shown; in the photo interface 143, images 1A and 1B have not been deleted. It can be understood that images 1A and 1B in the photo interface 142 are two-segment images.
[0059] It is understood that the aforementioned mobile phone 10 is only an example of an electronic device in the embodiments of this application; in other embodiments, the electronic device may also be any terminal with image processing function such as a wearable device or a tablet computer, or a server with image processing function, etc., and there are no specific limitations.
[0060] It is understood that the aforementioned shooting scenario is only an example of an application scenario in the embodiments of this application; in other embodiments, the application scenario may also include a recording scenario, such as an electronic device performing two-stage processing on video frame images in the captured video to generate a cover image corresponding to the video file; or, the electronic device may also perform two-stage processing on images captured in any scenario such as a monitoring scenario, a third-party application download image scenario, or a webpage display image scenario, etc., without any specific limitations.
[0061] As mentioned earlier, in scenarios where electronic devices perform two-stage processing on collected data, if the electronic device is in the second stage of processing and detects a user's deletion command, the electronic device can only delete one segment of the image generated by the completed first stage of processing, and cannot delete the two segments of the image generated after the completion of the second stage of processing.
[0062] Therefore, this application proposes an image processing method. In this method, during the shooting process, after the electronic device completes the first stage processing of the acquired data (corresponding to an example of the first image data) to generate and display a segment image (corresponding to an example of the first image), if the electronic device detects a user's deletion operation on the segment image, the electronic device cancels the second stage processing of the acquired data and deletes the segment image. It can be understood that since the second stage processing is canceled, that is, no second segment image will be generated after deleting the segment image, the complete deletion of the image can be ensured; or, the electronic device obtains the second segment image generated by the second stage processing (corresponding to an example of the second image) and deletes the segment image and the second segment image together. It can be understood that when the second stage processing is in progress, or when the processing has ended and the second segment image has been generated but has not replaced the segment image, it is difficult to cancel the second stage processing. That is, the electronic device can obtain the second segment image and then delete the segment image and the second segment image together to avoid invalid deletion of only the segment image without deleting the second segment image.
[0063] In some embodiments, when the electronic device detects that a user has deleted a segment of an image, a first cancellation instruction corresponding to the second stage of processing is generated, and a cancellation timer is started.
[0064] If the electronic device detects the successful execution result of the first cancellation instruction within the timeout period (an example of the corresponding cancellation period), it means that when the electronic device detects the user's deletion operation on a segment of the graph, the processing status of the second stage is in the waiting state. Based on the first cancellation instruction, the second stage processing can be directly cancelled, ensuring that no more segments of the graph will be generated after the second stage processing is cancelled. In this way, the electronic device can delete only one segment of the graph.
[0065] If the electronic device detects the failure of the first cancellation instruction within the timeout period, it means that when the electronic device detects the user's deletion operation on a segment image, the processing status of the second stage is either in progress or in the process of generating a second segment image but not replacing the first segment image. Therefore, the second stage processing cannot be cancelled based on the first cancellation instruction. In this case, if the processing status of the second stage is in progress, the electronic device can wait for the second stage processing to complete and generate the second segment image before obtaining the second segment image and deleting both the first and second segments together. Alternatively, if the processing status of the second stage is in the process of generating a second segment image but not replacing the first segment image, the electronic device can obtain the second segment image and delete both the first and second segments together, ensuring complete deletion of the image.
[0066] If the electronic device does not detect the execution result of the first cancellation instruction within the timeout period, it indicates that there may be an error in the second stage of processing and the two-segment graph will not be generated. To avoid the electronic device waiting indefinitely and causing abnormal deletion process, the electronic device can directly delete one segment of the graph to ensure deletion efficiency.
[0067] In some embodiments, the timeout period can be set as the maximum processing time for the electronic device to perform a second stage of processing on the acquired data to generate and display two image segments. See the description of the timeout period below for details, which will not be repeated here.
[0068] In some embodiments, in the above image processing method, when the electronic device is operating under conditions of high power consumption, high temperature, or high memory, such as when the electronic device's operating memory is greater than or equal to a preset first memory threshold, or when the electronic device's operating temperature is greater than or equal to a preset first temperature threshold, or when the electronic device's operating power consumption is greater than or equal to a preset first power consumption threshold, the electronic device can process the acquired data through a two-stage processing (corresponding to an example of the first processing flow). For example, before performing the first stage processing on the acquired data, the electronic device can also perform thumbnail processing on the acquired data (corresponding to an example of the first processing) to generate thumbnails (corresponding to an example of the third image). After generating a segment image through the first stage processing of the acquired data, the previously generated thumbnail is replaced with a segment image, such as deleting the thumbnail after generating a segment image. The specific process can be found in the description of the two-stage processing in the text, and will not be repeated here.
[0069] In other embodiments, in the above image processing method, when the electronic device is operating at low power consumption, temperature, or memory levels—for example, when the electronic device's RAM is less than a first memory threshold, its operating temperature is less than a first temperature threshold, or its power consumption is less than a first power consumption threshold—the electronic device can process the acquired data through a single-stage processing (corresponding to an example of the second processing flow). Specifically, the first stage processing is thumbnail processing, and the second stage processing is target processing. See the descriptions of various single-stage processing methods for details, which will not be elaborated upon here.
[0070] It is understandable that electronic devices can determine whether to use two-stage or one-stage processing based on any one or at least two of the following factors: RAM, operating temperature, and RAM. There are no specific restrictions on which one is used.
[0071] The following example of a two-stage processing method illustrates the embodiments of this application.
[0072] Figure 5A A framework diagram of an electronic device 100 is shown according to some embodiments of this application. Figure 5A As shown, the electronic device 100 includes an Android application package (APK) 1001 (hereinafter referred to as the gallery application layer 1001), a framework layer (FW) 1002, and a hardware abstraction layer (HAL) 1003.
[0073] The following example of multiple-selection deletion illustrates the embodiments of this application.
[0074] In some embodiments, the gallery application layer 1001 responds to a user's deletion operation and determines the multiple images to be deleted corresponding to multi-select deletion. It then determines which images among the multiple images to be deleted will be processed in a single step and which will be processed in a two-step process. The specific determination process and the execution flow of the gallery application layer 1001 will be described in detail below and will not be repeated here.
[0075] For example, if it is determined that the image to be deleted uses a single-step processing method, and the current image is a genuine image (corresponding to the example of the fourth image), then the image library application layer 1001 directly deletes the genuine image. This can be understood as follows: since the current image is a genuine image, meaning the electronic device deleted the previously generated thumbnail when generating the genuine image, deleting the genuine image at this point can be considered a complete deletion of the current image. It can also be understood that electronic devices typically perform single-step processing when parameters such as power consumption, temperature, or memory are low; that is, single-step processing is usually faster. Thus, after generating a thumbnail, the electronic device can quickly generate a genuine image and replace the previously generated thumbnail.
[0076] For example, if it is determined that the image to be deleted is processed in two stages, such as the current image being a segment generated by the first stage of processing, then the image library application layer 1001 sends a two-stage cancellation instruction to the frame layer 1002 (an example corresponding to the first cancellation instruction), and determines the deletion process of the corresponding image based on the return result of the frame layer 1002.
[0077] In some embodiments, the framework layer 1002 responds to a two-stage cancellation command from the gallery application layer 1001 by integrating information about the image to be deleted, which uses a two-stage processing method. For example, the framework layer 1002 performs the following integrations: parsing the resource list, integrating the image name, calling the lower-level interface, and filling in the results. It then sends the integrated information to the hardware abstraction layer 1003 and returns the corresponding result to the gallery application layer 1001 based on the result returned by the hardware abstraction layer 1003. The specific integration process and the execution flow of the framework layer 1002 will be described in detail below and will not be repeated here.
[0078] In some embodiments, the hardware abstraction layer 1003 is used to determine the processing status of the second-stage processing of the image to be deleted in response to the integration information of the framework layer 1002, to determine whether to perform cancellation processing, and to return the execution result to the framework layer 1002. For example, the hardware abstraction layer 1003 first notifies the HAL agent based on the received integration information, then obtains the processing status of the second-stage processing of the image to be deleted, and determines whether the two-segment image has been reported to the FW.
[0079] When the processing status of the second stage is "awaiting processing," it means that the two-segment graph has not yet been generated, i.e., it has not been reported to the server (FW). Therefore, the second stage processing can be directly cancelled, ensuring that no more two-segment graphs will be generated after cancellation, indicating that the cancellation command was executed successfully. Subsequently, the corresponding two-segment processing result is returned to the library application layer 1001 through the framework layer 1002. At this point, the library application layer 1001 only needs to delete one segment of the graph.
[0080] When the processing status of the second stage is "processing," it means that the two-segment diagram has not yet been generated, i.e., the two-segment diagram has not been reported to the server (FW). Furthermore, since the second stage processing is in progress, it cannot be canceled; the cancellation command fails. Subsequently, the corresponding two-segment processing result is returned to the library application layer 1001 through the framework layer 1002. At this point, the library application layer 1001 can wait for the second stage processing to complete and produce the two-segment diagram before retrieving it and deleting both the first and second segment diagrams together.
[0081] When the processing status of the second stage is "processing completed," it indicates that a two-segment image has been generated and reported to the database (FW). Since the second stage processing is complete, it cannot be canceled; the cancellation command fails. It can be understood that although the second stage processing is complete and the two-segment image is returned, the image corresponding to the deletion operation is a single-segment image. Therefore, although the two-segment image is returned, it has not yet replaced the single-segment image, and the image library application stores both the single-segment and two-segment images simultaneously. Subsequently, the frame layer 1002 returns the corresponding two-segment processing result to the image library application layer 1001. At this point, the image library application layer 1001 can obtain the two-segment image and delete both the single-segment and two-segment images simultaneously.
[0082] The specific execution flow of the hardware abstraction layer 1003 will be described in detail below, and will not be repeated here.
[0083] It is understood that the above is an example of multi-select deletion. In other embodiments, the process of thumbnail processing, first-stage processing, and second-stage processing may include: when the electronic device takes a picture, the camera application sends the collected data to the gallery application layer 1001. The gallery application layer 1001 sends the collected data to the frame layer 1002 and the hardware abstraction layer 1003 and notifies them to perform corresponding processing, such as thumbnail processing, single-segment processing, first-stage processing, and second-stage processing. Subsequently, the hardware abstraction layer 1003 performs thumbnail processing / single-segment processing / first-stage processing / second-stage processing based on the collected data, and returns the corresponding thumbnail / real image / single-segment image / two-segment image to the gallery application layer 1001 through the frame layer 1002 so that the thumbnail / real image / single-segment image / two-segment image can be displayed on the interface corresponding to the gallery application.
[0084] Combination Figure 5A , Figure 5B An interactive flowchart is shown according to some embodiments of this application. Figure 5B As shown, the process includes:
[0085] S501: The image library application layer 1001 detected a deletion operation and determined the image to be deleted.
[0086] In some embodiments, for example Figure 3B As shown, the user selects image 1A to... Figure 1 After D, click control 10B to adjust image 1A to... Figure 1 D performs a deletion operation. At this time, the image library application layer 1001 detects the deletion operation and determines the image to be deleted, such as image 1A to... Figure 1 D, and iterate through all the images to be deleted to determine which images are processed in one segment and which are processed in two segments.
[0087] For example, the image library application layer 1001 can determine whether a corresponding image to be deleted should be processed in a single step by using a preset tag field in the image to be deleted. The specific process can be found in the description below regarding the generation of thumbnails by the hardware abstraction layer 1003, and will not be repeated here.
[0088] S502A: For images to be deleted, a two-stage processing method is adopted. The image library application layer 1001 sends a two-stage cancellation command to the frame layer 1002.
[0089] In some embodiments, when the gallery application layer 1001 determines that the image to be deleted is processed in two stages, it sends a two-stage cancellation instruction to the frame layer 1002 based on the image to be deleted that is processed in two stages. For example Figure 3B As shown, images 1A and 1B are processed in two stages, while images 1C and 1D are processed in one stage. Therefore, the image library application layer 1001 sends a two-stage cancellation command to the frame layer 1002 based on images 1A and 1B.
[0090] In some embodiments, when the gallery application layer 1001 determines that the image to be deleted is processed in a single step, the corresponding image to be deleted is deleted directly, such as directly deleting image 1C and image 1D.
[0091] S502B: Image library application layer 1001 obtains the timeout period. If no return result is received within the timeout period, the image to be deleted is deleted.
[0092] In some embodiments, when the gallery application layer 1001 sends a two-stage cancellation command to the frame layer 1002, the gallery application layer 1001 obtains a preset timeout. If no return result is received from the frame layer 1002 within the preset timeout, the gallery application layer 1001 determines that the lower layer execution has failed (such as a second-stage processing execution error), and no more two-stage images will be returned. The images to be deleted will be deleted directly, such as directly deleting images 1A and 1B. This avoids the gallery application layer 1001 waiting indefinitely, causing the deletion process to be abnormal. For the specific timeout setting, please refer to the description of the timeout in the gallery application layer 1001 below, which will not be repeated here.
[0093] S503: Frame layer 1002 responds to the two-stage cancellation command, obtains and integrates the image information of the image to be deleted to obtain integrated information.
[0094] In some embodiments, the framework layer 1002 responds to the two-stage cancellation instruction from the gallery application layer 1001 by parsing the resource list, integrating image names, calling lower-level interfaces, and filling in results, in order to integrate the image information of the images to be deleted using the two-stage processing, and obtain integrated information.
[0095] S504: The framework layer 1002 sends a two-stage cancellation instruction and integration information to the hardware abstraction layer 1003.
[0096] In some embodiments, the framework layer 1002 sends the integrated information and the two-stage cancellation instruction to the hardware abstraction layer 1003.
[0097] S505: Hardware Abstraction Layer 1003 obtains integration information and determines whether the two-stage task corresponding to the image to be deleted in the integration information is in the task queue.
[0098] In some embodiments, the hardware abstraction layer 1003 obtains the image to be deleted using two-stage processing based on integrated information, and determines whether the two-stage tasks (such as the second-stage processing) corresponding to the image to be deleted using two-stage processing are in the task queue.
[0099] S506A: Corresponding to the two tasks in the queue, the hardware abstraction layer 1003 obtains the task processing status.
[0100] In some embodiments, if the hardware abstraction layer 1003 determines that the two tasks are in the task queue, it indicates that the two tasks have not been completed and obtains the processing status corresponding to the two tasks.
[0101] S507A: Corresponding to the task processing state of waiting for processing, the hardware abstraction layer 1003 executes a two-stage cancellation instruction to cancel the two-stage task and returns the execution result 1 to the framework layer 1002.
[0102] In some embodiments, when the hardware abstraction layer 1003 determines that the processing status of the two-stage task is waiting to be processed, it executes a two-stage cancellation instruction to directly cancel the two-stage task, avoids the subsequent generation of the two-stage graph, and returns the execution result 1 to the framework layer 1002.
[0103] S507B: Corresponding to the task processing status being processed, the two-stage cancellation instruction failed to execute. After the hardware abstraction layer 1003 waits for the two-stage task to complete and generate the two-stage diagram, the hardware abstraction layer 1003 returns the two-stage diagram and execution result 2 to the framework layer 1002.
[0104] In some embodiments, when the hardware abstraction layer 1003 determines that the processing status of the two-stage task is "in progress", the two-stage task cannot be cancelled at this time. It is necessary to wait for the two-stage task to complete and generate the two-stage diagram before returning the two-stage diagram and execution result 2 to the framework layer 1002, that is, the cancellation command failed to execute.
[0105] S507C: Corresponds to the task processing status being completed. The two-stage cancellation instruction failed to execute, and the hardware abstraction layer 1003 returns the execution result 3 to the framework layer 1002.
[0106] In some embodiments, when the hardware abstraction layer 1003 determines that the processing status of the two-stage task is that the processing has ended, since the two-stage task has ended, it cannot be canceled and the two-stage graph generated by the two-stage task has been returned but has not replaced the first stage graph, that is, the cancellation command execution fails, and the execution result 3 is returned to the framework layer 1002.
[0107] It is understood that the hardware abstraction layer 1003 can directly obtain the processing status of the two tasks, such as the processing status of waiting to be processed, in progress, or processing completed. In some other embodiments, the hardware abstraction layer 1003 may also first determine whether the processing status of the two tasks is waiting to be processed, and if it is not waiting to be processed, then determine whether the processing status of the two tasks is processing, and if it is not processing, then determine whether the processing status of the two tasks is processing completed. No specific restrictions are imposed.
[0108] S506B: This corresponds to the second-stage task not being in the queue. The second-stage cancellation instruction failed to execute, and the hardware abstraction layer 1003 returned the execution result 4 to the framework layer 1002.
[0109] In some embodiments, if the hardware abstraction layer 1003 determines that the two-stage task is not in the task queue, it means that the two-stage task has been completed, the two-stage task cannot be cancelled, and the two-stage graph generated by the two-stage task has been returned but has not replaced the first-stage graph. That is, the cancellation command execution failed, and the execution result 4 is returned to the framework layer 1002.
[0110] S508: The framework layer 1002 returns execution result 1 / execution result 2 and bisection graph / execution result 3 / execution result 4 to the library application layer 1001.
[0111] In some embodiments, after receiving the execution result returned by the hardware abstraction layer 1003, the framework layer 1002 forwards the corresponding execution result to the library application layer 1001.
[0112] S509: The image library application layer 1001 determines the deletion process of the image to be deleted based on the execution result.
[0113] In some embodiments, when the gallery application layer 1001 receives execution result 1, it indicates that the two-segment task has been successfully cancelled, and no new two-segment images will be returned. The images to be deleted can be deleted directly, for example, images 1A and 1B can be deleted directly. When the gallery application layer 1001 receives execution results 2 / 3 / 4, it indicates that the two-segment task has been successfully cancelled. After waiting for the two-segment images to be returned, the images to be deleted and the two-segment images can be deleted. Figure 1 For example, delete images 1A and 1B, as well as the corresponding two-segment images of images 1A and 1B.
[0114] It's understandable that when the image library application layer 1001 receives execution result 1, since the second-stage task is canceled (meaning no second-stage image will be generated after deleting the image to be deleted), the complete deletion of the image can be ensured. However, when the image library application layer 1001 receives execution results 2 / 3 / 4, it waits for the second-stage task to complete and generate the second-stage image before deleting both the image to be deleted and the second-stage image together. This avoids invalid deletion where only the image to be deleted is removed, resulting in the second-stage image not being deleted. For example... Figure 3B and 5C As shown, after deleting images 1A to 1D through the process shown in 5B, mobile phone 10 then... Figure 3B The operation interface 13 shown is switched to display as Figure 5C Photo interface 15 is shown; in photo interface 15, images 1A to 1D are deleted.
[0115] The following combination Figure 5A and Figure 5B ,pass Figure 6 and Figure 7 The example illustrates the execution flow of the gallery application layer 1001.
[0116] In some embodiments, when the gallery application layer 1001 detects a user's deletion operation on one or more images, the gallery application displays a "deleting" progress bar. For example, as Figure 6 As shown, after the user clicks control 10B, a progress bar indicating "deleting" is displayed on the corresponding operation interface 13. For example, this progress bar only counts the number of images generated using the two-stage processing method that have not yet returned a two-stage image; each returned image is deleted, and the progress of the progress bar is displayed accordingly.
[0117] In some embodiments, the gallery application layer 1001 is configured with a cancel two-stage execution interface and a timeout acquisition interface. The gallery application layer 1001 sends a two-stage cancellation command to the framework layer 1002 through the cancel two-stage execution interface. Simultaneously, the gallery application layer 1001 can acquire a preset timeout through the timeout acquisition interface. After the gallery application layer 1001 sends the two-stage cancellation command to the framework layer 1002, if no execution result is received from the framework layer 1002 within the preset timeout period, the gallery application layer 1001 determines that the second-stage processing has failed, and no more two-stage images will be returned. It then directly deletes one stage image, thereby preventing the gallery application layer 1001 from waiting indefinitely and causing deletion process anomalies.
[0118] For example, the preset timeout period can be the maximum processing time for an image to be processed in the second stage, from the gallery application layer 1001 calling the frame layer 1002, then from the frame layer 1002 calling the hardware abstraction layer 1003, then from the hardware abstraction layer 1003 returning to the frame layer 1002, and finally from the frame layer 1002 returning to the gallery application layer 1001.
[0119] Figure 7 According to some embodiments of this application, an execution flowchart of a gallery application layer 1001 is shown.
[0120] In some embodiments, such as Figure 7 As shown, after detecting the user's deletion operation, the gallery application layer 1001 responds to the deletion operation by starting (S701) execution. Figure 7 Process. For example, the image library application layer 1001 can obtain all images to be deleted based on the deletion operation (S702), and then sequentially traverse all the obtained images to be deleted (S703) to determine which images among all the images to be deleted are processed in a single step and which images are processed in a two-step step (S704). The process ends when the traversal is complete, that is, when the image library application layer 1001 has completed the detection of all images to be deleted (S708).
[0121] Furthermore, during the traversal process, when the image library application layer 1001 determines that the image to be deleted is processed in two stages (for dumping), it sends an instruction to the frame layer 1002 to cancel the two-stage execution (S705), and determines whether the cancellation was successful based on the return result of the frame layer 1002 (S706).
[0122] For example, if the frame layer 1002 returns a cancellation success result, it means that the second stage processing was successfully cancelled and no more two-segment images will be generated. Then the image library application layer 1001 can directly delete one segment image or thumbnail (S707) and end the process (S708).
[0123] For example, if the frame layer 1002 returns a cancellation failure, it means that the second stage of processing cancellation failed and the two-segment graph may continue to be generated. In this case, the graph library application layer 1001 can obtain the waiting timeout time (S709) and determine whether to return the graph based on the waiting timeout time (S710).
[0124] For example, if the library application layer 1001 receives the two-segment graph generated after the second stage of processing is completed within the waiting timeout period, it deletes all returned graphs (S711), such as the one-segment graph and the two-segment graph, and ends the process (S708).
[0125] For example, if the library application layer 1001 does not receive the two-segment image generated after the second stage processing is completed within the waiting timeout period, then delete one segment of the image or thumbnail (S707) and end the process (S708).
[0126] The following combination Figure 5A and Figure 5B ,pass Figure 8 The example illustrates the execution flow of framework layer 1002.
[0127] In some embodiments, FW10002 responds to a two-stage cancellation command from the gallery application layer 1001 by integrating information about images that require deletion and are processed in two stages. For example, the framework layer 1002 is configured with a synchronous interface that returns a value. The framework layer 1002 uses this interface to send integration information to the hardware abstraction layer 1003 to notify the hardware abstraction layer 1003 to cancel the second-stage processing.
[0128] Figure 8 According to some embodiments of this application, an execution flowchart of FW10002 is shown.
[0129] In some embodiments, such as Figure 8 As shown, after receiving information about images that require deletion using a two-stage processing method, FW10002 identifies the names of the images to be deleted (e.g., image name 1, image name 2, ..., image name n) from the Uniform Resource Identifiers (URIs) of the images (e.g., URI 1, URI 2, ..., URI n) according to the order of the images to be deleted, such as the order in which the user clicked to delete or the sorting order of the images in the gallery, and puts the names of the images to be deleted into a list in order; then, it reverses the names of the images to be deleted (e.g., image name n, ..., image name 2, image name 1) and concatenates them into a single string (e.g., image name n, image name n-1, ..., image name 2, image name 1), so that it can send integration information to the Hardware Abstraction Layer 1003 through a single string, reducing the number of communications between the Framework Layer 1002 and the Hardware Abstraction Layer 1003.
[0130] It's understandable that in the Hardware Abstraction Layer 1003, the task queue is structured like a stack, with higher priority at the top and lower priority at the bottom. During execution, the Hardware Abstraction Layer 1003 typically retrieves a task from the top of the stack for each iteration. Therefore, based on the Last-In-First-Out (LIFO) property of a stack, the aforementioned FW10002's reversal of the image names to be deleted ensures that the image priorities remain unchanged; that is, the Hardware Abstraction Layer 1003 can execute tasks according to the order in which the images to be deleted are processed.
[0131] Furthermore, the hardware abstraction layer 1003 can retrieve tasks from the task queue based on the received string, check their execution status, perform corresponding operations, and return the execution result. For example, if the hardware abstraction layer 1003 returns "fail," it means that the processing status of the second stage is "processing," and the second-stage cancellation instruction cannot be executed; if the hardware abstraction layer 1003 returns "success," it means that the second-stage cancellation instruction has been executed, i.e., the second stage processing has been cancelled, and no second-stage images will be returned subsequently. After receiving the execution result returned by the hardware abstraction layer 1003, the FW10002 encapsulates the URIs of the failed images in one list and the URIs of the successful images in another list, and returns them to the image library application layer 1001 so that the image library application layer 1001 can perform the corresponding deletion process.
[0132] The following combination Figure 5A and Figure 5B ,pass Figure 9 The example illustrates the execution flow of the hardware abstraction layer 1003.
[0133] In some embodiments, the process of the hardware abstraction layer 1003 performing the second-stage processing may include: when the hardware abstraction layer 1003 receives a request to perform the second-stage processing, it generates a corresponding processing task, inserts the processing task into a task queue, and marks the processing status of the processing task as ready; when the environment meets the conditions for the second-stage processing, such as when the processing task is at the top of the task stack, the hardware abstraction layer 1003 reads the processing task from the task queue and marks the processing status of the processing task as processing, at which time the processing task is still in the task queue; subsequently, when the hardware abstraction layer 1003 completes the execution of the processing task, that is, when the second-stage processing completes the production of the two-segment diagram, it deletes the processing task from the task queue, or marks the processing status of the processing task as processed.
[0134] In some embodiments, the hardware abstraction layer 1003 is configured with a process query interface. When the hardware abstraction layer 1003 receives a string sent by the FW10002, it can query the processing status of the corresponding second-stage processing based on the image name to be deleted in the string through the process query interface.
[0135] Figure 9 According to some embodiments of this application, an execution flowchart of a hardware abstraction layer 1003 is shown.
[0136] In some embodiments, such as Figure 9 As shown, after the hardware abstraction layer 1003 receives the string sent by FW10002, it initially (S901) wants to... Figure 9Process. For example, the hardware abstraction layer 1003 first notifies the HAL agent (S902), and then queries the HAL agent to see if the image task whose image name needs to be deleted is in the task queue (S903).
[0137] For example, if it is not present, it means that the second stage of processing has been completed and the second stage of processing cannot be cancelled, that is, the cancellation command execution failed (S904), and the process ends (S905); if it is present, it means that the second stage of processing has not been completed, the task processing status is obtained (S906), and it is determined whether the status is ready (S907).
[0138] For example, if the status is ready, that is, the task is waiting to be processed (ready), then the task and data are deleted (S907), the command execution is canceled (S908), no second-segment graphs will be returned subsequently, the process ends (S905), and the execution result is returned to the graph library application layer 1001 through the framework layer 1002. The graph library application layer 1001 can directly delete a segment of the graph.
[0139] Or, for example, if the state is not ready, then determine whether the state is in progress (S909).
[0140] For example, if the status is in progress (i.e., the task is being processed), the second stage of processing cannot be canceled at this time. It is necessary to wait for the second stage of processing to complete and return the two-segment diagram. That is, the cancellation command execution failed (S904), the process ends (S905), and the execution result is returned to the library application layer 1001 through the framework layer 1002. The library application layer 1001 deletes the first segment diagram and the returned two-segment diagram at the same time.
[0141] Or, for example, if the state is not in progress, then determine whether the state is finished (S910).
[0142] For example, if the status is "completed", that is, the task is "processed", the second stage of processing has been completed and the two-segment diagram has been returned. This means that the command execution failed (S904), the process ends (S905), and the execution result is returned to the library application layer 1001 via the framework layer 1002. The library application layer 1001 deletes the first segment diagram and the returned two-segment diagram at the same time.
[0143] It is understandable that, regardless of whether it is a one-stage or two-stage processing method, thumbnail processing must be performed first to generate a thumbnail. Therefore, during the thumbnail generation process, the hardware abstraction layer 1003 can add a corresponding tag field (an example of target information) to the image information field of the thumbnail (an example of image information). This field is encapsulated into a structure array, serialized, and then assembled into the thumbnail before being returned to the upper layers (such as the frame layer 1002 and the image library application layer 1001). The tag field indicates whether the subsequent processing of the thumbnail is one-stage or two-stage. Furthermore, when a thumbnail is subsequently replaced by a one-stage image, the tag field in the thumbnail is loaded into the image information of the corresponding one-stage image, so that when deleting a one-stage image, the tag field in the one-stage image determines whether one-stage or two-stage processing should be used.
[0144] For example, such as Figure 10 As shown, after detecting a photo-taking operation, the gallery application layer 1001 generates a photo-taking task and forwards it to the hardware abstraction layer 1003 via the framework layer 1002. The hardware abstraction layer 1003 generates a thumbnail through thumbnail processing, and in the process of generating the thumbnail, it generates thumbnail data, encapsulates accompanying information, serializes the accompanying information, packages the thumbnail, and uploads the thumbnail to the gallery application layer 1001 via the framework layer 1002. Subsequently, the gallery application layer 1001 obtains thumbnail information based on the received thumbnail, parses the thumbnail data, and displays the thumbnail.
[0145] It is understandable that the thumbnail information obtained by the image library application layer 1001 includes a tag field, and this tag field is continuously loaded into the segment image when the thumbnail is replaced. Therefore, when the image library application layer 1001 detects a user's deletion operation, it can determine whether the image to be deleted is subject to two-stage processing based on the tag field attached to the image. For example, if the image to be deleted has a tag field, it is determined that the image to be deleted is subject to two-stage processing; if the image to be deleted does not have a tag field, it is determined that the image to be deleted is subject to one-stage processing.
[0146] Figure 11 According to some embodiments of this application, a hardware structure diagram of an electronic device 100 is shown.
[0147] like Figure 11As shown, the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal USB interface 130, a charging management module 140, a power management module 141, a battery module 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.
[0148] Processor 110 may include one or more processing units, such as an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, memory, a video codec, etc. These different processing units may be independent devices or integrated into one or more processors.
[0149] The controller can serve as the central nervous system and command center of the electronic device 100. The controller can generate operation control signals based on the instruction opcode and timing signals to control the fetching and execution of instructions. Specifically, the image processing method executed by the electronic device 100 in this embodiment can be executed by the processor 110.
[0150] In some embodiments, the processor 110 may include one or more interfaces. Interfaces may include inter-integrated circuit (I2C) interfaces, inter-integrated circuit sound (I2S) interfaces, pulse code modulation (PCM) interfaces, etc. 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.
[0151] The charging management module 140 receives charging input from the charger. The power management module 141 connects to the battery module 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery module 142 and / or the charging management module 140 to power the processor 110, internal memory 121, external memory, display 194, etc.
[0152] The wireless communication function of electronic device 100 can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor, and baseband processor.
[0153] Antennas 1 and 2 are used to transmit and receive electromagnetic wave signals. Mobile communication module 150 can provide wireless communication solutions, including 2G / 3G / 4G / 5G, for use on electronic device 100. Wireless communication module 160 can provide wireless communication solutions, including wireless local area networks (WLANs) (such as Wireless Fidelity (Wi-Fi) networks), Bluetooth, and Global Navigation Satellite System (GNSS), for use on electronic device 100.
[0154] 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, connecting the display screen 194 and the application processor.
[0155] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. In some embodiments, electronic device 100 may include one or N displays screens 194, where N is a positive integer greater than 1.
[0156] 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.
[0157] 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.
[0158] Electronic device 100 can perform audio functions through audio module 170, such as music playback and recording.
[0159] Buttons 190 include a power button, volume buttons, etc. Buttons 190 can be mechanical buttons or touch-sensitive buttons. A motor 191 can generate vibration feedback. An indicator 192 can be an indicator light. A SIM card interface 195 can be used to connect a SIM card.
[0160] It is understood that the structure illustrated in this application does not constitute a specific limitation on the electronic device 100. In other embodiments, 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.
[0161] In some embodiments, this application also provides a computer-readable medium storing program code that, when run on a computer, causes the computer to perform the methods described above.
[0162] In some embodiments, this application also provides a computer program product comprising: computer program code that, when run on a computer, causes the computer to perform the methods described above.
[0163] In the accompanying drawings, some structural or methodological features may be shown in a specific arrangement and / or order. However, it should be understood that such a specific arrangement and / or order may not be necessary. Rather, in some embodiments, these features may be arranged in a manner and / or order different from that shown in the illustrative drawings. Furthermore, the inclusion of structural or methodological features in a particular figure does not imply that such features are required in all embodiments, and in some embodiments, these features may be omitted or may be combined with other features.
[0164] It should be noted that the units / modules mentioned in the various device embodiments of the present invention are all logical units / modules. Physically, a logical unit / module can be a physical unit / module, a part of a physical unit / module, or a combination of multiple physical units / modules. The physical implementation of these logical units / modules themselves is not the most important factor; the combination of functions implemented by these logical units / modules is the key to solving the technical problem proposed by the present invention. Furthermore, to highlight the innovative aspects of the present invention, the above-described device embodiments of the present invention have not introduced units / modules that are not closely related to solving the technical problem proposed by the present invention. This does not mean that the above-described device embodiments do not contain other units / modules.
[0165] It should be noted that in the examples and description of this patent, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one" does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0166] Although the invention has been illustrated and described with reference to certain preferred embodiments thereof, those skilled in the art will understand that various changes in form and detail may be made therein without departing from the scope of the invention.
Claims
1. An image processing method applied to electronic devices, characterized in that, include: Upon detecting a shooting command, the first image data captured by the camera is obtained; The first image data is processed in the first stage to generate and display the first image; Upon detecting a first deletion command corresponding to the first image, the first image is deleted, and Cancel the second-stage processing of the first image data, or delete the second image generated by the second-stage processing of the first image data.
2. The method according to claim 1, characterized in that, The method further includes: Upon detecting the first deletion instruction, a first cancellation instruction corresponding to the second stage of processing is generated, and a cancellation timer is started; Furthermore, canceling the second-stage processing of the first image data, or deleting the second image generated by the second-stage processing of the first image data, includes: If the successful execution result of the first cancellation instruction is detected within the cancellation period, only the first image is deleted; If the failure of the first cancellation instruction is detected within the cancellation period, the first image and the second image are deleted. If no execution result of the first cancellation instruction is detected within the cancellation time, only the first image is deleted.
3. The method according to claim 1 or 2, characterized in that, The method further includes: The first image data is processed through a first processing flow, wherein the first processing flow includes: The first image data is processed in a first way to generate and display a third image, wherein the third image corresponds to a thumbnail of the first image data; The first image data is processed in the first stage to generate the first image, the third image is deleted, and the first image is displayed. Generate a processing task that performs the second stage processing on the first image data; Wherein, the processing time of the first process is less than the processing time of the first stage process, and the processing time of the first stage process is less than the processing time of the second stage process.
4. The method according to claim 3, characterized in that, The method further includes: When generating the third image, target information is loaded into the image information corresponding to the third image, wherein the target information is used to mark that the first image data is processed using the first processing flow; Furthermore, generating the first image and deleting the third image includes: The target information is loaded into the image information corresponding to the first image.
5. The method according to claim 3, characterized in that, The processing of the first image data through the first processing flow includes: In a target scene, the electronic device processes the first image data through a first processing flow, wherein the target scene includes at least one of the following: The electronic device's operating memory is greater than or equal to a first memory threshold; The operating temperature of the electronic device is greater than or equal to a first temperature threshold. The power consumption of the electronic device is greater than or equal to a first power consumption threshold.
6. The method according to claim 1 or 2, characterized in that, The method further includes: The first image data is processed through a second processing procedure, wherein the second processing procedure includes: The first image data is processed in the first stage to generate and display the first image, wherein the first image corresponds to a thumbnail of the first image data; Generate a processing task that performs the second stage processing on the first image data; The processing time of the first stage is less than the processing time of the second stage.
7. The method according to claim 1 or 2, characterized in that, The first deletion instruction is further configured to delete a fourth image simultaneously with the first image, wherein the fourth image is an image generated by performing a second-stage processing on the second image data, and The method further includes: Delete the fourth image.
8. A computer-readable storage medium, characterized in that, The readable storage medium stores instructions that, when executed on an electronic device, cause the electronic device to perform the method of any one of claims 1 to 7.
9. An electronic device, characterized in that, include: Memory is used to store instructions executed by one or more processors of an electronic device; And a processor, one of the processors of the electronic device, for executing instructions stored in the memory to implement the method of any one of claims 1 to 7.
10. A program product, characterized in that, The program product includes instructions that, when executed on an electronic device, cause the electronic device to perform the method of any one of claims 1 to 7.