Data processing methods and electronic equipment

By creating and maintaining the foreground path only the first time during continuous shooting, the frequent creation and destruction of algorithmic paths are reduced, thus solving the problem of excessive time consumption in continuous shooting and improving performance and accuracy.

CN119743667BActive Publication Date: 2026-03-10HONOR DEVICE 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
2023-09-22
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

During continuous shooting, the frequent creation and destruction of algorithmic pathways leads to poor performance and excessive time consumption for shot2see.

Method used

During continuous shooting, a foreground path is created only during the first shot and remains active until the camera is turned off. A background path is created only when necessary, reducing the frequent creation and destruction of paths.

Benefits of technology

The shot2see time for continuous shooting has been optimized, reducing processing time and improving performance and the accuracy of image data processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119743667B_ABST
    Figure CN119743667B_ABST
Patent Text Reader

Abstract

This application discloses a data processing method and an electronic device. The method further includes: during N consecutive photo captures, in response to the first photo capture operation, creating a foreground path and a first background path and acquiring a first image; N is a positive integer; after processing the data of the first image using the foreground path to obtain a first thumbnail, displaying the first thumbnail; after processing the data of the first image using the first background path to obtain a second image, replacing the first thumbnail with the second image; and after creating the foreground path, ensuring that the foreground path is not destroyed before closing the camera. This application reduces the frequent creation and destruction of algorithmic paths during continuous photo capture, reducing time consumption and improving the performance of shot2see.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computers, and more particularly to data processing methods and electronic devices. Background Technology

[0002] Users can take photos using the camera app on their electronic devices. When a user clicks the shutter button in the camera app, the electronic device sends a shutter request message to the hardware abstraction layer (HAL). The HAL layer creates an algorithm path for this shutter and sends a shutter request message to the hardware device to obtain image data. Then, it uses the algorithm path to process the image data and generate an image to return to the camera app.

[0003] like Figure 1A As shown, the algorithmic processing can be divided into a front-end path and a back-end path. The front-end path is the process of generating thumbnails, while the back-end path is the process of generating images using algorithms. Specifically, in response to a photo-taking operation, the electronic device generates a photo-taking request message and sends it to the HAL layer. The algorithmic path management module of the HAL layer creates a front-end path and a back-end path based on the photo-taking request message, and then further sends the photo-taking request message to the kernel layer. The kernel layer returns image data to the front-end path of the HAL layer, where a thumbnail is generated. Figure 1B As shown, the generated thumbnail can be displayed in the lower left corner of the camera interface, and this thumbnail is also saved. During the foreground processing, image data is also copied to the background processing. Only then does the background processing use algorithms to process the image data. The image that is actually processed by the algorithm often takes a long time. After the algorithm finishes processing, the previously saved thumbnail is updated, and both the foreground and background processing are destroyed.

[0004] In this process, the time from clicking the shutter button to the thumbnail appearing in the lower left corner of the camera interface is called shot2see; the time from the thumbnail appearing to the thumbnail being updated to the image processed by the background process is called see2review. In scenarios with multiple consecutive shots, the algorithm path may be different. Therefore, for each shot, the algorithm path is recreated and destroyed. This results in frequent creation and destruction of the algorithm path during continuous shooting, causing significant time consumption and leading to poor performance of shot2see. Summary of the Invention

[0005] This application provides a data processing method and electronic device that can reduce the frequent creation and destruction of algorithm paths during continuous shooting, thereby reducing time consumption and improving the performance of shot2see.

[0006] In a first aspect, this application provides a data processing method, which further includes: during the process of taking N consecutive photos, in response to the first photo-taking operation, creating a foreground path and a first background path and acquiring a first image; N is a positive integer; after processing the data of the first image using the foreground path to obtain a first thumbnail, displaying the first thumbnail; after processing the data of the first image using the first background path to obtain a second image, replacing the first thumbnail with the second image; after creating the foreground path, keeping the foreground path from being destroyed before closing the camera.

[0007] Based on the method described in the first aspect, during the process of taking N consecutive photos, since the foreground path is the same, the electronic device only needs to create the foreground path when taking the first photo and keep the foreground path resident. That is, the foreground path is not destroyed before the camera is turned off, thereby optimizing the shot2see time for multiple consecutive photos, reducing the frequent creation and destruction of algorithm paths during continuous photos, and improving the performance of shot2see.

[0008] In one possible implementation, the method further includes simultaneously sending the data of the first image to both the foreground path and the first background path. This approach helps to save time.

[0009] In one possible implementation, after replacing the first thumbnail with the second image and before detecting a second photo capture operation, the method further includes destroying the first background path. This approach helps improve the accuracy of image data processing.

[0010] In one possible implementation, the method further includes: during N consecutive photo captures, in response to a second photo capture operation, creating a second background path and acquiring a third image; after processing the data of the third image using the foreground path to obtain a second thumbnail, displaying the second thumbnail; after processing the data of the third image using the second background path to obtain a fourth image, replacing the second thumbnail with the fourth image, and destroying the second background path. Based on this method, the foreground path remains constantly active, and a background path only needs to be created for each photo capture, which helps save time and improve the accuracy of image data processing.

[0011] In one possible implementation, the method further includes: during N consecutive photo captures, in response to a second photo capture operation, acquiring a third image; if the scene type corresponding to the second photo capture operation is different from the scene type corresponding to the first photo capture operation, destroying the first background path and creating a second background path; after processing the data of the third image using the foreground path to obtain a second thumbnail, displaying the second thumbnail; after processing the data of the third image using the second background path to obtain a fourth image, replacing the second thumbnail with the fourth image. Based on this method, the foreground path remains persistent, while the destruction of the first background path created during the first photo capture is delayed. The method determines whether to destroy the first background path based on whether the scene type corresponding to the second photo capture operation is the same as the scene type corresponding to the first photo capture operation. If they are different, the first background path is destroyed and a second background path is recreated; if they are the same, the first background path can be retained for continued use, thereby further saving time.

[0012] In one possible implementation, the method further includes: retaining the first background path when the scene type corresponding to the second photo-taking operation is the same as that corresponding to the first photo-taking operation; displaying the second thumbnail after processing the data of the third image using the foreground path to obtain the second thumbnail; and replacing the second thumbnail with the fifth image after processing the data of the third image using the first background path to obtain the fifth image. This approach can further reduce time consumption.

[0013] In one possible implementation, the method further includes: during N consecutive photo captures, when the first background path is retained M times, the first background path is destroyed; M is less than or equal to N, and M is a positive integer. Based on this method, the accuracy of image data processing can be guaranteed.

[0014] Secondly, this application provides a data processing apparatus, which may be an electronic device, a device within an electronic device, or a device compatible with an electronic device. The data processing apparatus may also be a chip system, capable of executing the methods performed by the electronic device in the first aspect. The functions of the data processing apparatus can be implemented in hardware or by hardware executing corresponding software. The hardware or software includes one or more units corresponding to the aforementioned functions. These units may be software and / or hardware. The operations performed by the data processing apparatus and its beneficial effects are described in the first aspect and their effects; repetitions will not be repeated.

[0015] Thirdly, this application provides an electronic device including one or more processors and one or more memories. The one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program code, including computer instructions, which, when executed by the one or more processors, cause the electronic device to perform the data processing method in any possible implementation of the first aspect described above.

[0016] Fourthly, this application provides a data processing apparatus that includes functions or units for performing the methods described in any of the first aspects.

[0017] Fifthly, this application provides a computer-readable storage medium storing a computer program, the computer program including program instructions that, when executed on an electronic device, cause the electronic device to perform the data processing method in any possible implementation of the first aspect described above.

[0018] Sixthly, this application provides a computer program product that, when run on a computer, causes the computer to execute the data processing method in any possible implementation of the first aspect described above. Attached Figure Description

[0019] Figure 1A This is a schematic diagram of an image data processing method based on a front-end path and a back-end path provided in an embodiment of this application;

[0020] Figure 1B This is a schematic diagram illustrating a method of taking a picture and displaying a thumbnail, provided in an embodiment of this application;

[0021] Figure 2 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application;

[0022] Figure 3 This is a software structure block diagram of an electronic device provided in an embodiment of this application;

[0023] Figure 4 This is a flowchart illustrating a data processing method based on a software structure provided in an embodiment of this application;

[0024] Figure 5 This is a schematic diagram of another image data processing method based on a front-end path and a first back-end path provided in an embodiment of this application;

[0025] Figure 6 This is a flowchart illustrating a data processing method provided in an embodiment of this application;

[0026] Figure 7This is a flowchart illustrating another data processing method provided in an embodiment of this application;

[0027] Figure 8 This is a schematic diagram of the structure of a data processing device provided in an embodiment of this application;

[0028] Figure 9 This is a schematic diagram of the structure of a chip provided in an embodiment of this application. Detailed Implementation

[0029] The technical solutions in the embodiments of this application will be clearly and thoroughly described below with reference to the accompanying drawings. In the description of the embodiments of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B; the word "and / or" in the text is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Furthermore, in the description of the embodiments of this application, "multiple" refers to two or more than two.

[0030] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.

[0031] The term "user interface (UI)" used in the following embodiments of this application refers to the medium interface through which an application or operating system interacts and exchanges information with the user. It realizes the conversion between the internal form of information and the form that the user can accept. The user interface is source code written in a specific computer language such as Java or Extensible Markup Language (XML). The interface source code is parsed and rendered on the terminal device, ultimately presenting content that the user can recognize. A common form of user interface is the graphical user interface (GUI), which refers to a user interface related to computer operation displayed graphically. It can be visible interface elements such as text, icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, and widgets displayed on the terminal device's screen.

[0032] To facilitate understanding of the solutions provided in the embodiments of this application, the relevant concepts involved in the embodiments of this application are introduced below:

[0033] 1. Thumbnail

[0034] A thumbnail is a small snapshot, a low-quality preview of the original image after compression. It's an image generated by a specific algorithm that can represent digital images, videos, and articles; it usually contains hyperlinks to the full-size image. For example... Figure 1B As shown, a thumbnail is displayed in the lower left corner of the camera interface and is also saved. Users can click on the thumbnail to jump to the album to view the full-size image. Since the thumbnail is only a low-quality preview, the image is not clear in the album at this time. The thumbnail needs to be updated later to display a clearer, higher-quality image.

[0035] 2. shot2see

[0036] Users can take photos using the camera app on their electronic devices. When a user clicks the shutter button in the camera app, the electronic device sends a shutter request message to the hardware abstraction layer (HAL). The HAL layer creates an algorithm path for this shutter and sends a shutter request message to the hardware device to obtain image data. Then, it uses the algorithm path to process the image data and generate an image to return to the camera app.

[0037] like Figure 1A As shown, the algorithmic processing can be divided into a front-end path and a back-end path. The front-end path is the process of generating thumbnails, while the back-end path is the process of generating images using algorithms. Specifically, in response to a photo-taking operation, the electronic device generates a photo-taking request message and sends it to the HAL layer. The algorithmic path management module of the HAL layer creates a front-end path and a back-end path based on the photo-taking request message, and then further sends the photo-taking request message to the kernel layer. The kernel layer returns image data to the front-end path of the HAL layer, where a thumbnail is generated. Figure 1B As shown, the generated thumbnail can be displayed in the lower left corner of the camera interface, and this thumbnail is also saved. During the foreground processing, image data is also copied to the background processing. Only then does the background processing use algorithms to process the image data. The image that is actually processed by the algorithm often takes a long time. After the algorithm finishes processing, the previously saved thumbnail is updated, and only then can a clearer, higher-quality image be viewed. At this point, both the foreground and background processing are destroyed.

[0038] In this process, the time from clicking the shutter button to the thumbnail appearing in the lower left corner of the camera interface is called shot2see; the time from the thumbnail appearing to the thumbnail being updated to the image processed by the background process is called see2review. In scenarios with multiple consecutive shots, the algorithm path may be different. Therefore, for each shot, the algorithm path is recreated and destroyed. This results in frequent creation and destruction of the algorithm path during continuous shooting, causing significant time consumption and leading to poor performance of shot2see.

[0039] Therefore, in order to reduce the frequent creation and destruction of algorithm paths during continuous shooting, reduce time consumption, and improve the performance of shot2see, this application provides a data processing method and an electronic device. In a specific implementation, the data processing method mentioned above can be executed by an electronic device 100. The electronic device 100 can be a mobile phone, tablet computer, laptop computer, or wearable electronic device with wireless communication capabilities (such as a smartwatch), but is not limited to these. The electronic device 100 is equipped with a display screen and can have a preset application (APP) installed, such as a camera APP. Users can take photos through the camera APP.

[0040] The hardware structure of electronic device 100 is described below. Please refer to [link / reference]. Figure 2 , Figure 2 This is a schematic diagram of the hardware structure of the electronic device 100 provided in the embodiments of this application.

[0041] Electronic device 100 may include processor 110, external memory interface 120, internal memory 121, universal serial bus (USB) interface 130, charging management module 140, power management module 141, battery 142, antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, display screen 194, and 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.

[0042] It is understood that the structures illustrated in the embodiments of the present invention 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.

[0043] 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.

[0044] 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.

[0045] 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 directly retrieve it from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system. The processor 110 retrieves the instructions or data stored in the memory, causing the electronic device 100 to execute the data processing method performed by the electronic device in the following method embodiments.

[0046] 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.

[0047] The charging management module 140 is used to receive charging input from the charger. The charger can be a wireless charger or a wired charger.

[0048] The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to power the processor 110, internal memory 121, external memory, display 194, camera 193, and wireless communication module 160, etc. In some other embodiments, the power management module 141 may also be located in the processor 110.

[0049] 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.

[0050] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with tuning switches.

[0051] The mobile communication module 150 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 may be housed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be housed in the same device.

[0052] A modem processor may include a modulator and a demodulator. The modulator modulates the low-frequency baseband signal to be transmitted into a mid-to-high frequency signal. The demodulator demodulates the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After processing by the baseband processor, the low-frequency baseband signal is transmitted to the application processor.

[0053] The wireless communication module 160 can provide solutions for wireless communication applications on the electronic device 100, including wireless local area networks (WLAN) (such as Wi-Fi networks), Bluetooth (BT), BLE broadcasting, global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.

[0054] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, so that electronic device 100 can communicate with networks and other devices through wireless communication technology.

[0055] 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.

[0056] 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.

[0057] Electronic device 100 can perform shooting functions through an ISP, camera 193, video codec, GPU, display 194, and application processor. The ISP processes data fed back from the camera 193. The camera 193 captures still images or video. The digital signal processor processes digital signals, including digital image signals and other digital signals. The video codec compresses or decompresses digital video. Electronic device 100 can support one or more video codecs.

[0058] 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.

[0059] 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.

[0060] 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 a sound playback function), etc. The data storage area may store data created during the use of electronic device 100 (such as audio data), etc. Furthermore, internal memory 121 may include high-speed random access memory and may also include non-volatile memory, such as flash memory devices.

[0061] 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.

[0062] The audio module 170 is used to convert digital audio information into analog audio signals for output, and also to convert analog audio input into digital audio signals. The audio module 170 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 170 may be located in the processor 110, or some functional modules of the audio module 170 may be located in the processor 110.

[0063] A speaker 170A, also called a "loudspeaker," is used to convert audio electrical signals into sound signals. A receiver 170B, also called a "handpiece," is used to convert audio electrical signals into sound signals. A microphone 170C, also called a "microphone" or "voice transducer," is used to convert sound signals into electrical signals. A headphone jack 170D is used to connect wired headphones. A pressure sensor 180A is used to sense pressure signals and can convert the pressure signals into electrical signals. In some embodiments, the pressure sensor 180A may be located on the display screen 194. A gyroscope sensor 180B can be used to determine the motion posture of the electronic device 100. A barometric pressure sensor 180C is used to measure barometric pressure. A magnetic sensor 180D includes a Hall effect sensor. An accelerometer 180E can detect the magnitude of the acceleration of the electronic device 100 in various directions (generally three axes). A distance sensor 180F is used to measure distance. A proximity sensor 180G may include, for example, a light-emitting diode (LED) and a photosensor. An ambient light sensor 180L is used to sense ambient light intensity. A fingerprint sensor 180H is used to collect fingerprints. Temperature sensor 180J is used to detect temperature. Touch sensor 180K, also known as a "touch panel," can be located on display screen 194. The touch sensor 180K and display screen 194 together form a touchscreen, also known as a "touch screen." Touch sensor 180K detects touch operations applied to or near it. Bone conduction sensor 180M can acquire vibration signals. Buttons 190 include power button, volume buttons, etc. Motor 191 can generate vibration prompts. Indicator 192 can be an indicator light, used to indicate charging status, battery level changes, messages, missed calls, notifications, etc. SIM card interface 195 is used to connect a SIM card.

[0064] Furthermore, an operating system runs on top of the aforementioned components. Examples include iOS and Android. The operating system of electronic device 100 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application embodiment uses the layered architecture Android system as an example to exemplify the software structure of electronic device 100. It should be noted that although this application embodiment uses the Android system as an example for illustration, its basic principles are equally applicable to electronic devices with other operating systems.

[0065] Figure 3 This is a software structure block diagram of the electronic device 100 according to an embodiment of this application. The software structure adopts a layered architecture, which divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. In this embodiment, the operating system (taking the Android system, which runs on an AP as an example) can be divided into six layers, from top to bottom: application layer (APP), application framework layer (FWK), Android runtime and system library, hardware abstraction layer (HAL), kernel layer, and hardware layer.

[0066] The application layer can include a series of application packages. For example... Figure 3 As shown, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and SMS. The application layer may also include a system UI, which displays the interface of the electronic device, such as the camera interface. In this embodiment, "camera" refers to the camera application.

[0067] 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. For example... Figure 3 As shown, the application framework layer may include a window manager, content provider, view system, phone manager, resource manager, notification manager, camera service, etc., and this application embodiment does not impose any limitations on this.

[0068] The window manager is used to manage windowed applications. It can retrieve screen size, determine the presence of a status bar, lock the screen, and capture screenshots, among other things.

[0069] Content providers store and retrieve data, making that data accessible to applications. This data may include videos, images, audio, made and received phone calls, browsing history and bookmarks, phone books, etc.

[0070] 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.

[0071] The phone manager is used to provide communication functions for electronic device 100. For example, it manages call status (including connection and disconnection).

[0072] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.

[0073] 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.

[0074] The camera service is the core process module of the camera framework. It mainly provides API interface functions to the application layer and calls the camera hardware abstraction layer through HIDL (hardware interface definition language).

[0075] The Android runtime consists of core libraries and a virtual machine. The Android runtime is responsible for scheduling and managing the Android system.

[0076] The core library consists of two parts: one part is the functionalities that need to be called by the Java language, and the other part is the Android core library.

[0077] The application layer and application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.

[0078] System libraries can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), etc.

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

[0080] The media library supports playback and recording of various common audio and video formats, as well as still image files. It also supports multiple audio and video encoding formats.

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

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

[0083] The Hardware Abstraction Layer (HAL) is an interface layer located between the operating system kernel and the hardware circuitry, its purpose being to abstract the hardware. It hides the platform-specific hardware interface details, providing the operating system with a virtual hardware platform. For example, the HAL encapsulates Linux kernel drivers, providing an interface to the upper layers and shielding them from the implementation details of the lower-level hardware. Figure 3 As shown, the hardware abstraction layer can include Wi-Fi HAL, audio HAL, camera HAL, etc. Among them, the camera HAL is the core software framework of the camera, and it can include algorithm path management modules, path modules, etc.

[0084] The algorithm path management module is used to create foreground and background paths; it can also interact with the kernel layer, for example, by sending photo request messages to the kernel layer or receiving image data returned by the kernel layer. The path module includes foreground and background paths. The foreground path is the process of generating thumbnails, and the background path is the process of using algorithms to process and generate images.

[0085] The kernel layer is the layer between hardware and software. It is the core of an operating system, the first layer of software extension based on the hardware, providing the most basic functions of the operating system. It is the foundation for the operating system's operation, responsible for managing system processes, memory, device drivers, files, and network systems, and determining the system's performance and stability. The kernel layer can include display drivers, audio drivers, camera drivers, sensor drivers, image signal processing drivers, etc. Among them, the camera driver is the driver layer for camera devices, primarily responsible for interaction with the hardware.

[0086] The hardware layer includes displays, cameras, sensors, image signal processors (ISPs), etc.

[0087] Based on the above software structure, this application provides a flowchart illustrating a data processing method based on the software structure. For example... Figure 4 As shown, the data processing method includes the following steps S401 to S408. Optionally, the data processing method further includes step S409. Wherein:

[0088] S401. During the process of taking N consecutive photos, the camera application responds to the first photo-taking operation by generating a photo-taking request message.

[0089] In this embodiment, continuous shooting refers to taking photos by continuously clicking the shutter button in the camera application, and the time interval between two consecutive photos is less than or equal to a first preset threshold. This can be understood as the time interval between two consecutive photos being within a very small range (i.e., the first preset threshold) during N consecutive photo taking attempts. Here, N is a positive integer. For example, assuming N is 5 and the first preset threshold is 2 seconds, the time interval between two consecutive photos is less than 2 seconds during 5 consecutive photo taking attempts.

[0090] During the process of taking N consecutive photos, for the first photo, the user can click the photo button in the camera application. At this time, the camera application in the APP layer responds to the user's first photo-taking operation and generates a photo-taking request message.

[0091] S402, the camera application sends the photo-taking request message to the algorithm path management module. Correspondingly, the algorithm path management module receives the photo-taking request message from the camera application.

[0092] In this embodiment, the camera application further sends a photo-taking request message to the algorithm path management module of the HAL layer through the APP layer and FWK layer. It should be noted that the sending and receiving between modules is actually implemented through functions.

[0093] S403. The algorithm path management module creates a foreground path and a first background path based on the photo-taking request message, and sends the photo-taking request message to the camera driver. Correspondingly, the camera driver receives the photo-taking request message from the algorithm path management module.

[0094] In this embodiment, the algorithm path management module creates a foreground path and a first background path for the first photo-taking operation based on the photo-taking request message. The foreground path is the process of generating thumbnails, which may include a thumbnail module (for generating thumbnails) and a callback module (for returning thumbnails to the APP layer). The first background path is the process of generating an image using algorithms, which may include a first algorithm module, a second algorithm module, a third algorithm module, and a callback module (for returning the processed image to the APP layer). Simultaneously, the algorithm path management module also sends the photo-taking request message to the camera driver in the kernel layer. It should be noted that different background paths need to be created to process image data for different scene types during photo taking. For example, for scenes involving people, beauty algorithms may be applied in the background path; for scenes involving objects, scene color correction algorithms and contrast enhancement algorithms may be applied in the background path, etc., without limitation.

[0095] S404, The camera driver captures the first image based on the photo capture request message.

[0096] In this embodiment of the application, after the camera driver receives the photo-taking request message, it can use the camera to capture a first image for this photo-taking operation based on the photo-taking request message.

[0097] Optionally, the data of the first image is the data obtained by the camera driver processing the first image using an image signal processor. That is, after the camera driver acquires the original image, it will also process the image signal processor in the kernel layer to obtain the processed data of the first image.

[0098] S405, the camera driver simultaneously sends the data of the first image to both the foreground path and the first background path. Correspondingly, the foreground path and the first background path simultaneously receive the data of the first image from the camera driver.

[0099] In this embodiment, the camera driver further sends the data of the first image to both the foreground path and the first background path simultaneously for processing. Alternatively, the camera driver can send the data of the first image to the foreground path and the first background path sequentially, but the time interval between sending the data to the foreground path and the first background path must be less than or equal to a second preset threshold. That is, the data of the first image acquired by the first background path is not copied from the foreground path, but is directly sent to the first background path by the camera driver; simultaneously, to reduce time consumption, the time interval between sending the data of the first image to the foreground path and the first background path by the camera driver needs to be controlled within a very small range (i.e., the second preset threshold).

[0100] For example, the camera driver can send the data of the first image to both the foreground path and the first background path simultaneously for processing; it can also send the data of the first image to the foreground path first, and then send the data of the first image to the first background path, wherein the time interval between sending the data of the first image to the foreground path and the first background path is less than or equal to 0.5 seconds; or it can send the data of the first image to the first background path first, and then send the data of the first image to the foreground path, wherein the time interval between sending the data of the first image to the first background path and the foreground path is less than or equal to 0.5 seconds, and there is no limitation here.

[0101] S406. After processing the data of the first image using the foreground path to obtain a first thumbnail, the foreground path sends the first thumbnail to the camera application. Accordingly, the camera application receives the first thumbnail from the foreground path and displays the first thumbnail.

[0102] In this embodiment, after the foreground path receives the data of the first image, the thumbnail module processes the data to obtain the first thumbnail; finally, the callback module returns the first thumbnail to the camera application, so that the first thumbnail can be displayed in the camera application. Figure 1B As shown, the first thumbnail can be displayed in the lower left corner of the camera interface and will also be saved. Users can click on the thumbnail to jump to the album to view the full-size image. Since the thumbnail is only a low-quality preview, a clear image cannot be seen in the album at this time. The thumbnail will need to be updated later to display a clearer, higher-quality image.

[0103] S407. After processing the data of the first image using the first background path to obtain the second image, the first background path sends the second image to the camera application. Accordingly, the camera application receives the second image from the first background path and replaces the first thumbnail with the second image.

[0104] In this embodiment, after the first backend channel receives the data of the first image, it processes the data of the first image sequentially using the first algorithm module, the second algorithm module, and the third algorithm module to obtain the second image. Finally, the second image is returned to the camera application through the callback module, so that the previously saved first thumbnail can be replaced with the second image. The user can click on the thumbnail to jump to the album to view the full-size image. The image displayed at this time is the image after updating the thumbnail, i.e., the second image, thus displaying a clearer, higher-quality image.

[0105] S408. After creating the foreground path in the algorithm path management module, ensure that the foreground path is not destroyed before turning off the camera.

[0106] In this embodiment, although the algorithm path may differ in the scenario of taking multiple photos in succession, the processing path for generating thumbnails (i.e., the foreground path) is the same. Therefore, the foreground path can be kept resident during the process of taking multiple photos in succession. That is, after being created in the first photo process and before the camera is closed, the foreground path is kept from being destroyed, which can optimize the shot2see time for multiple consecutive photos. The foreground path is destroyed after the camera is closed, which reduces the time spent on frequently creating and destroying the algorithm path.

[0107] S409, The algorithm path management module destroys the first backend path.

[0108] In this embodiment, since the foreground path remains unchanged in scenarios with multiple consecutive photos, it can be kept constantly active. However, the background path varies significantly. For example, the scene type for the first photo might be a person, while the scene type for the second photo might be scenery, requiring different algorithms for the background path. Keeping the first background path constantly active would reduce the accuracy of image data processing. Therefore, after the camera application replaces the first thumbnail with the second image, the algorithm path management module needs to destroy the first background path. In subsequent photo-taking processes, a new background path needs to be created for the current photo request message to ensure the accuracy of image data processing by the background path in subsequent photo-taking processes.

[0109] In one possible implementation, the method further includes: during the process of taking N consecutive photos, in response to the camera application closing the camera, the algorithm path management module destroys the foreground path. That is, the foreground path is kept resident after its creation until the camera application is closed, at which point the algorithm path management module destroys the foreground path.

[0110] In general, such as Figure 5As shown, in response to the first photo capture operation, the camera application generates a photo capture request message and sends it to the algorithm path management module in the HAL layer. The algorithm path management module creates a foreground path and a first background path based on this photo capture request message and sends the message to the camera driver in the kernel layer. The camera driver captures a first image based on the message; this first image data can be data obtained by the camera driver processing the first image using an image signal processor. Then, the camera driver simultaneously sends the first image data to both the foreground path (including the thumbnail module and callback module) and the first background path (including the first algorithm module, second algorithm module, third algorithm module, and callback module). After processing the first image data using the foreground path to obtain a first thumbnail, the foreground path sends the first thumbnail to the camera application; after processing the first image data using the first background path to obtain a second image, the first background path sends the second image to the camera application. The camera application receives the second image from the first background path and replaces the first thumbnail with the second image. After the algorithm path management module creates the foreground path, it ensures that the foreground path is not destroyed before the camera is closed. Additionally, the algorithm path management module can also destroy the first background path. Based on this approach, by keeping the foreground path constantly active during continuous shooting, the frequent creation and destruction of algorithm paths can be reduced, thus optimizing the shot2see time for multiple consecutive shots and improving shot2see performance.

[0111] 1. During the continuous taking of multiple photos, for each photo, ensure that the foreground path is not destroyed, and destroy the background path after each photo is taken.

[0112] Based on the above, a data processing method provided by an embodiment of this application will be further described in detail below. For example... Figure 6 As shown, the data processing method includes the following steps S601 to S604. Figure 6 The method shown can be implemented by the aforementioned electronic device. Alternatively, Figure 6 The method shown can be executed by a chip in an electronic device, but this application does not limit the implementation. Figure 6 The method will be explained using an electronic device as the executing entity.

[0113] S601. During the process of taking N consecutive photos, the electronic device responds to the first photo-taking operation, creates a foreground path and a first background path, and acquires the first image.

[0114] In this embodiment, continuous shooting refers to continuously clicking the shutter button in the camera application to take a picture, and the time interval between two consecutive shots is less than or equal to a first preset threshold. This can be understood as the time interval between two consecutive shots being within a very small range during N consecutive shots, where N is a positive integer. For example, assuming N is 5 and the first preset threshold is 2 seconds, the time interval between two consecutive shots is less than 2 seconds during 5 consecutive shots.

[0115] During the process of taking N consecutive photos, for the first photo, the user clicks the shutter button in the camera app. The electronic device responds to this first photo-taking action by creating a foreground path and a first background path to capture the first image. Here, the foreground path is the process of generating the thumbnail; the first background path is the process of using algorithms to process and generate the image. It should be noted that different background paths are needed to process the image depending on the scene type during the photo-taking process. For example, for photos of people, beauty algorithms will be applied in the background path; for photos of scenery, color correction algorithms and contrast enhancement algorithms will be applied, etc., without further limitation.

[0116] In the software architecture of an electronic device, the application layer includes the camera application; the application framework layer includes system services; the hardware abstraction layer includes the algorithm path management module and the path module, where the path module includes the foreground path and the background path; and the kernel layer includes the camera driver. During the continuous taking of N photos, when the electronic device responds to the first photo-taking operation by creating the foreground path and the first background path and acquiring the first image, the specific implementation method can be referred to in steps S401 to S404 above, namely:

[0117] During the process of taking N consecutive photos, the camera application responds to the first photo-taking operation by generating a photo-taking request message; the camera application sends the photo-taking request message to the algorithm path management module, and the algorithm path management module receives the photo-taking request message from the camera application; the algorithm path management module creates a foreground path and a first background path based on the photo-taking request message, and sends the photo-taking request message to the camera driver, and the camera driver receives the photo-taking request message from the algorithm path management module; the camera driver acquires the first image based on the photo-taking request message.

[0118] In one possible implementation, the method further includes: the electronic device simultaneously sending the data of the first image to both the foreground path and the first background path. That is, the data of the first image acquired by the first background path is not copied from the foreground path, but is directly sent to the first background path by the electronic device. Sending the data of the first image simultaneously to both the foreground and background paths reduces processing time. Of course, the electronic device can also send the data of the first image to the foreground and background paths sequentially for processing, but the time interval between sending the data to the foreground and background paths must be less than or equal to a second preset threshold. This can be understood as controlling the time interval between sending the data of the first image to the foreground and background paths within a very small range (i.e., the second preset threshold) to reduce processing time.

[0119] For example, the electronic device can simultaneously send the data of the first image to both the foreground path and the first background path for processing; or it can send the data of the first image to the foreground path first, and then send the data of the first image to the first background path, wherein the time interval between sending the data of the first image to the foreground path and the first background path is less than or equal to 0.5 seconds; or it can send the data of the first image to the first background path first, and then send the data of the first image to the foreground path, wherein the time interval between sending the data of the first image to the first background path and the foreground path is less than or equal to 0.5 seconds; no limitation is made here.

[0120] The specific implementation process can be referred to in step S405 above, that is, the camera driver sends the data of the first image to both the foreground path and the first background path simultaneously. Correspondingly, the foreground path and the first background path simultaneously receive the data of the first image from the camera driver.

[0121] S602. After the electronic device processes the data of the first image using the front-end path to obtain the first thumbnail, it displays the first thumbnail.

[0122] In this embodiment, the foreground path may include a thumbnail module (for generating thumbnails) and a callback module (for returning the thumbnail to the camera application). After receiving the data of the first image, the foreground path processes the data of the first image in the thumbnail module to obtain the first thumbnail; finally, the callback module returns the first thumbnail to the camera application, so that the first thumbnail can be displayed in the camera application, such as... Figure 1B As shown, the first thumbnail can be displayed in the lower left corner of the camera interface and will also be saved. Users can click on the thumbnail to jump to the album to view the full-size image. Since the thumbnail is only a low-quality preview, a clear image cannot be seen in the album at this time. The thumbnail will need to be updated later to display a clearer, higher-quality image.

[0123] The specific implementation process can be referred to in step S406 above, that is, after processing the data of the first image using the foreground path to obtain the first thumbnail, the foreground path sends the first thumbnail to the camera application. Accordingly, the camera application receives the first thumbnail from the foreground path and displays the first thumbnail.

[0124] S603. After the electronic device processes the data of the first image using the first background path to obtain the second image, the first thumbnail is replaced with the second image.

[0125] In this embodiment, the first backend path may include a first algorithm module, a second algorithm module, a third algorithm module, and a callback module (used to return the processed image to the camera application). After receiving the data of the first image, the first backend path processes the data of the first image sequentially using the first algorithm module, the second algorithm module, and the third algorithm module to obtain the second image; finally, the callback module returns the second image to the camera application, thus replacing the previously saved first thumbnail with the second image; the user can click on the thumbnail to jump to the album to view the full-size image, and the image displayed at this time is the image updated from the thumbnail, i.e., the second image, thereby displaying a clearer, higher-quality image.

[0126] The specific implementation process can be referred to in step S407 above, that is, after processing the data of the first image using the first background path to obtain the second image, the first background path sends the second image to the camera application. Accordingly, the camera application receives the second image from the first background path and replaces the first thumbnail with the second image.

[0127] In one possible implementation, the first thumbnail is stored in a thumbnail list. Before the electronic device replaces the first thumbnail with the second image, the method further includes: the electronic device searching the thumbnail list for a first thumbnail that matches the second image, where the first thumbnail has the highest similarity to the second image. That is, after the electronic device processes the data of the first image using a foreground path to obtain the first thumbnail, the first thumbnail can be stored in a thumbnail list. After the electronic device processes the data of the first image using a first background path to obtain the second image, the similarity between each thumbnail in the thumbnail list and the second image is calculated, and the thumbnail with the highest similarity (i.e., the first thumbnail) is replaced with the second image.

[0128] S604. After the electronic device creates a foreground path, keep the foreground path from being destroyed before turning off the camera.

[0129] In this embodiment, although the algorithm path may differ in the scenario of taking multiple photos in succession, the processing path for generating thumbnails (i.e., the foreground path) is the same. Therefore, the foreground path can be kept resident during the process of taking multiple photos in succession. That is, after being created in the first photo process and before the camera is closed, the foreground path is kept from being destroyed, which can optimize the shot2see time for multiple consecutive photos. The foreground path is destroyed after the camera is closed, which reduces the time spent on frequently creating and destroying the algorithm path.

[0130] The specific implementation process can be referred to in step S408 above, that is, after the algorithm path management module creates the foreground path, the foreground path is kept from being destroyed before the camera is turned off.

[0131] In one possible implementation, after the electronic device replaces the first thumbnail with the second image, and before detecting a second photo capture operation, the method further includes: the electronic device destroying the first background path. This can be understood as follows: since the foreground path is indistinguishable in scenarios with multiple consecutive photos, it can remain active; however, the background paths differ significantly. If the first background path is also kept active, it would reduce the accuracy of image data processing. Therefore, after the camera application replaces the first thumbnail with the second image, the electronic device needs to destroy the first background path and recreate the background path for the current photo capture request in subsequent photo capture processes, thereby ensuring the accuracy of image data processing by the background path in subsequent photo capture processes. The specific implementation process can be referred to in step S409 above, i.e., the algorithm path management module destroys the first background path.

[0132] In one possible implementation, the method further includes: during the process of taking N consecutive photos, in response to the camera being closed, destroying the foreground path. That is, the foreground path is kept persistent after its creation until the camera application is closed, at which point the electronic device destroys the foreground path.

[0133] In one possible implementation, the method further includes: during the process of taking N consecutive photos, the electronic device responds to the second photo-taking operation by creating a second background path and acquiring a third image; after the electronic device processes the data of the third image using the foreground path to obtain a second thumbnail, it displays the second thumbnail; after the electronic device processes the data of the third image using the second background path to obtain a fourth image, it replaces the second thumbnail with the fourth image and destroys the second background path.

[0134] This can be understood as follows: During the process of taking N consecutive photos, when the user clicks the shutter button in the camera application for the first time, the electronic device responds to the first photo-taking operation by creating a foreground path and a first background path and capturing the first image. After the electronic device processes the data of the first image using the foreground path to obtain the first thumbnail, it displays the first thumbnail. After the electronic device processes the data of the first image using the first background path to obtain the second image, it replaces the first thumbnail with the second image. The electronic device keeps the foreground path active and destroys the first background path. When the user clicks the shutter button in the camera application a second time, the electronic device responds to the second photo-taking operation, at which point it needs to create a second background path and capture the third image. Similarly (refer to steps S602 and S603 above), after the electronic device processes the data of the third image using the foreground path to obtain the second thumbnail, it displays the second thumbnail. After the electronic device processes the data of the third image using the second background path to obtain the fourth image, it replaces the second thumbnail with the fourth image and destroys the second background path. In this way, during the process of taking N consecutive photos, the foreground path is kept running until the camera is turned off, and the background path is created only for each photo. The foreground path is destroyed only when the camera is turned off, which reduces the time spent on frequently creating and destroying algorithm paths.

[0135] As can be seen, based on the method described in this application, during the process of taking N consecutive photos, since the foreground path is the same, the electronic device only needs to create the foreground path when taking the first photo, and keep the foreground path resident. That is, the foreground path is not destroyed before the camera is turned off, thereby optimizing the shot2see time for multiple consecutive photos, reducing the frequent creation and destruction of algorithm paths during continuous photos, and improving the performance of shot2see.

[0136] Second, during the continuous taking of multiple photos, for each photo, the foreground path is kept intact and the background path is destroyed after a delay after each photo is taken.

[0137] Based on the above, another data processing method provided by the embodiments of this application will be described in further detail below. For example... Figure 7 As shown, the data processing method includes the following steps S701 to S708. Figure 7 The method shown can be implemented by the aforementioned electronic device. Alternatively, Figure 7 The method shown can be executed by a chip in an electronic device, but this application does not limit the implementation. Figure 7 The method will be explained using an electronic device as the executing entity.

[0138] S701. During the process of taking N consecutive photos, the electronic device responds to the first photo-taking operation, creates a foreground path and a first background path, and acquires the first image.

[0139] Where N is a positive integer.

[0140] S702. After the electronic device processes the data of the first image using the front-end path to obtain the first thumbnail, it displays the first thumbnail.

[0141] S703. After the electronic device processes the data of the first image using the first background path to obtain the second image, the first thumbnail is replaced with the second image.

[0142] S704. After the electronic device creates a foreground path, keep the foreground path from being destroyed before turning off the camera.

[0143] The specific implementation methods of steps S701 to S704 can be referred to the specific implementation methods of steps S601 to S604 above, and will not be repeated here.

[0144] S705. During the process of taking N consecutive photos, the electronic device responds to the second photo-taking operation and acquires the third image.

[0145] S706. If the scene type corresponding to the second photo-taking operation is different from the scene type corresponding to the first photo-taking operation, the electronic device destroys the first background path and creates a second background path.

[0146] S707. After the electronic device processes the data of the third image using the front-end path to obtain the second thumbnail, it displays the second thumbnail.

[0147] S708. After the electronic device processes the data of the third image using the second background path to obtain the fourth image, the second thumbnail is replaced with the fourth image.

[0148] In this embodiment, during N consecutive photo captures, when the user clicks the camera button in the camera application for the first time, the electronic device responds to the first photo capture operation by creating a foreground path and a first background path and capturing a first image. After the electronic device processes the data of the first image using the foreground path to obtain a first thumbnail, it displays the first thumbnail. After the electronic device processes the data of the first image using the first background path to obtain a second image, it replaces the first thumbnail with the second image. The electronic device keeps the foreground path active. At this time, the first background path is not destroyed temporarily. When the user clicks the camera button in the camera application a second time, the electronic device responds to the second photo capture operation and captures a third image. If the scene type corresponding to the second photo capture operation is different from the scene type corresponding to the first photo capture operation, then it is considered that the scene type has changed (e.g., from a scene with people to a scene with objects). At this time, the electronic device needs to destroy the first background path and create a second background path. Similarly (refer to steps S602 and S603 above), after the electronic device processes the data of the third image using the foreground path to obtain a second thumbnail, it displays the second thumbnail. After the electronic device processes the data of the third image using the second background path to obtain a fourth image, it replaces the second thumbnail with the fourth image.

[0149] This can be understood as follows: during the process of taking N consecutive photos, not only can the foreground path remain active, but the destruction of the background path can also be delayed. That is, after the current photo is taken, the first background path is not destroyed temporarily. If the scene type of the next photo is different from that of the current photo, it is considered that the scene type has changed and the background path used is different. Therefore, the first background path created the first time needs to be destroyed and the second background path needs to be recreated to ensure the accuracy of image processing.

[0150] In one possible implementation, the method further includes: when the scene type corresponding to the second photo-taking operation is the same as the scene type corresponding to the first photo-taking operation, the electronic device retains the first background path; after the electronic device processes the data of the third image using the foreground path to obtain the second thumbnail, it displays the second thumbnail; after the electronic device processes the data of the third image using the first background path to obtain the fifth image, it replaces the second thumbnail with the fifth image.

[0151] This can be understood as follows: during N consecutive photo captures, not only can the foreground path remain active, but the destruction of the background path can also be delayed. That is, after the current photo capture ends, the first background path is not destroyed temporarily. In the next photo capture, if the scene type is the same as the current one, it is considered that the scene type has not changed, and the first background path can be retained and reused without creating a new one. Similarly (refer to steps S602 and S603 above), after the electronic device processes the data of the third image using the foreground path to obtain the second thumbnail, the second thumbnail is displayed; after the electronic device processes the data of the third image using the first background path to obtain the fifth image, the second thumbnail is replaced with the fifth image. Based on this method, time consumption can be further saved, reducing the frequent creation and destruction of algorithm paths during continuous photo capture, thus improving the performance of shot2see.

[0152] In one possible implementation, the method further includes: during N consecutive photo captures, when the first background path is retained M times, the electronic device destroys the first background path; M is less than or equal to N, and M is a positive integer. This can be understood as follows: during N consecutive photo captures, when the number of times the first background path is retained reaches a preset value (i.e., M), it is considered that the first background path has been created and used for a long time. To ensure the accuracy of image data processing, the first background path needs to be destroyed at this time, so that the background path can be recreated during the next photo capture.

[0153] As can be seen, based on the method described in this application, during N consecutive photo captures, since the foreground path remains unchanged, the electronic device only needs to create the foreground path during the first photo capture and keep it resident. That is, the foreground path is not destroyed before the camera is closed, thereby optimizing the shot2see time for multiple consecutive photos. This reduces the frequent creation and destruction of algorithm paths during continuous photo capture, improving the performance of shot2see. At the same time, the electronic device can also delay the destruction of the first background path created during the first photo capture. The destruction of the first background path is determined based on whether the scene type corresponding to the second photo capture operation is the same as that corresponding to the first photo capture operation. If they are different, the first background path is destroyed and the second background path is recreated. If they are the same, the first background path can be retained for continued use, thereby further saving time.

[0154] Please see Figure 8 , Figure 8 A schematic diagram of the structure of a data processing apparatus 800 according to an embodiment of this application is shown. Figure 8 The data processing device shown can be an electronic device, a device within an electronic device, or a device that can be used in conjunction with an electronic device. Figure 8The data processing apparatus shown may include a processing unit 801 and a display unit 802. Wherein:

[0155] Processing unit 801 is used to create a foreground path and a first background path and acquire a first image in response to the first image capture operation during the process of taking N consecutive photos; N is a positive integer.

[0156] Display unit 802 is used to display the first thumbnail after processing the data of the first image using the front-end path to obtain the first thumbnail;

[0157] The processing unit 801 is used to replace the first thumbnail with the second image after processing the data of the first image using the first background path to obtain the second image;

[0158] Processing unit 801 is used to prevent the foreground path from being destroyed after it is created and before the camera is turned off.

[0159] In one possible implementation, the method further includes sending the data of the first image simultaneously to the foreground path and the first background path.

[0160] In one possible implementation, after replacing the first thumbnail with the second image and before detecting a second photo capture operation, the method further includes destroying the first background path.

[0161] In one possible implementation, the method further includes: during the process of taking N consecutive photos, in response to the second photo-taking operation, creating a second background path and acquiring a third image; after processing the data of the third image using the foreground path to obtain a second thumbnail, displaying the second thumbnail; after processing the data of the third image using the second background path to obtain a fourth image, replacing the second thumbnail with the fourth image, and destroying the second background path.

[0162] In one possible implementation, the method further includes: during the process of taking N consecutive photos, in response to the second photo-taking operation, acquiring a third image; if the scene type corresponding to the second photo-taking operation is different from the scene type corresponding to the first photo-taking operation, destroying the first background path and creating a second background path; after processing the data of the third image using the foreground path to obtain a second thumbnail, displaying the second thumbnail; after processing the data of the third image using the second background path to obtain a fourth image, replacing the second thumbnail with the fourth image.

[0163] In one possible implementation, the method further includes: retaining the first background path when the scene type corresponding to the second photo-taking operation is the same as the scene type corresponding to the first photo-taking operation; displaying the second thumbnail after processing the data of the third image using the foreground path to obtain the second thumbnail; and replacing the second thumbnail with the fifth image after processing the data of the third image using the first background path to obtain the fifth image.

[0164] In one possible implementation, the method further includes: during the process of taking N consecutive photos, when the first background path is retained M times, the first background path is destroyed; M is less than or equal to N, and M is a positive integer.

[0165] For cases where the data processing device can be a chip or a chip system, please refer to [link / reference]. Figure 9 The diagram shows the structure of the chip. Figure 9 The chip 900 shown includes a processor 901 and an interface 902. Optionally, it may also include a memory 903. The number of processors 901 can be one or more, and the number of interfaces 902 can be multiple.

[0166] For cases where the chip is used to implement the electronic device in the embodiments of this application:

[0167] The interface 902 is used to receive or output signals;

[0168] The processor 901 is used to perform data processing operations of the electronic device.

[0169] It is understood that some optional features in the embodiments of this application can be implemented independently in certain scenarios without relying on other features, such as the current solution on which they are based, to solve the corresponding technical problems and achieve the corresponding effects. Alternatively, they can be combined with other features as needed in certain scenarios. Accordingly, the data processing apparatus given in the embodiments of this application can also implement these features or functions, which will not be elaborated here.

[0170] It should be understood that the processor in the embodiments of this application can be an integrated circuit chip with signal processing capabilities. In implementation, the steps of the above method embodiments can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor described above can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0171] It is understood that the memory in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM). It should be noted that the memory used in the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0172] This application also provides a computer-readable storage medium storing a computer program, the computer program including program instructions that, when executed on an electronic device, implement the functions of any of the above method embodiments.

[0173] This application also provides a computer program product that, when run on a computer, enables the computer to perform the functions of any of the above method embodiments.

[0174] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., high-density digital video discs (DVDs)), or semiconductor media (e.g., solid-state disks (SSDs)).

[0175] 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. A data processing method, characterized by, The method comprises: In the process of taking pictures continuously for N times, in response to a first photographing operation, creating a foreground pass and a first background pass and collecting a first image; N is a positive integer; the foreground pass is an execution link for generating a thumbnail image, and the first background pass is an execution link for processing a generated image by using an algorithm; After processing data of the first image by using the foreground pass to obtain a first thumbnail image, displaying the first thumbnail image; After processing data of the first image by using the first background pass to obtain a second image, replacing the first thumbnail image with the second image; After the foreground pass is created, the foreground pass is kept from being destroyed before the camera is closed.

2. The method of claim 1, wherein, The method further comprises: Simultaneously sending data of the first image to the foreground pass and the first background pass.

3. The method according to claim 1 or 2, characterized in that, After the first thumbnail image is replaced with the second image, before a second photographing operation is detected, the method further comprises: Destroying the first background pass.

4. The method of claim 3, wherein, The method further comprises: In the process of taking pictures continuously for N times, in response to the second photographing operation, creating a second background pass and collecting a third image; After processing data of the third image by using the foreground pass to obtain a second thumbnail image, displaying the second thumbnail image; After processing data of the third image by using the second background pass to obtain a fourth image, replacing the second thumbnail image with the fourth image and destroying the second background pass.

5. The method according to claim 1 or 2, characterized in that, The method further comprises: In the process of taking pictures continuously for N times, in response to a second photographing operation, collecting a third image; In a case where a scene type corresponding to the second photographing operation is different from a scene type corresponding to the first photographing operation, destroying the first background pass and creating a second background pass; After processing data of the third image by using the foreground pass to obtain a second thumbnail image, displaying the second thumbnail image; After processing data of the third image by using the second background pass to obtain a fourth image, replacing the second thumbnail image with the fourth image.

6. The method of claim 5, wherein, The method further comprises: In a case where a scene type corresponding to the second photographing operation is the same as a scene type corresponding to the first photographing operation, keeping the first background pass; After processing data of the third image by using the foreground pass to obtain a second thumbnail image, displaying the second thumbnail image; After processing data of the third image by using the first background pass to obtain a fifth image, replacing the second thumbnail image with the fifth image.

7. The method of claim 6, wherein, The method further comprises: In the process of taking pictures continuously for N times, when the first background pass is kept for M times, destroying the first background pass; M is less than or equal to N, and M is a positive integer.

8. An electronic device, comprising: Comprise: One or more processors, one or more memories; wherein the one or more memories are coupled with the one or more processors, and configured to store computer program codes, the computer program codes comprising computer instructions, when the one or more processors execute the computer instructions, cause the electronic device to perform the method according to any one of claims 1-7.

9. A chip, characterized by An apparatus comprising a processor and an interface coupled to the processor; the interface configured to receive or output signals, and the processor configured to execute code instructions to cause the method according to any one of claims 1-7 to be performed.

10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program comprises program instructions, when the program instructions are executed on an electronic device, cause the electronic device to perform the method according to any one of claims 1-7.

Citation Information

Patent Citations

  • Image processor, image processing method, photographing device and electronic equipment

    CN110300240A

  • Image display method and electronic device

    WO2022127787A1