Camera request processing method and related device

By introducing a camera request processing method in the electronic device, the response delay problem when the user changes the camera shooting mode is solved, faster response time is achieved, and user experience is improved.

CN120128790APending Publication Date: 2025-06-10HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311692535.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-08
Publication Date
2025-06-10

AI Technical Summary

Technical Problem

When existing electronic devices change camera shooting mode, there is a response delay, affecting the user experience.

Method used

By introducing a camera request processing method in the electronic device, the method includes issuing a camera request, acquiring an image frame, processing an image frame to match a target camera parameter, and displaying the processed image frame without waiting for the actual image frame to be acquired.

Benefits of technology

Reduces the response delay of users changing shooting mode operations and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120128790A_ABST
    Figure CN120128790A_ABST
Patent Text Reader

Abstract

The invention discloses a camera request processing method and a related device. In the method, the electronic device receives a zoom operation 1 used by a user for switching the zoom magnification of a camera application into zoom1. And in response to the zoom operation 1, the electronic equipment issues a camera request 1, and obtains an image frame 1 based on the camera request 1. Before the electronic device sends and displays the image frame 1, the electronic device receives a zoom operation 2 of the user for switching the zoom magnification of the camera application to zoom2. And under the condition that the zoom magnification of the image frame 1 is inconsistent with the zoom magnification of the zoom operation 2, the electronic equipment processes the image frame 1 to obtain an image frame 2, and the zoom magnification of the image frame 2 is zoom2. The electronic device displays the image frame 2. Therefore, by processing the image frame acquired by the electronic equipment, the zooming chirality of the camera can be optimized, so that the user experience can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of camera frames and electronic technologies, and in particular, to a camera request processing method and related devices. Background Art

[0002] Currently, electronic devices such as mobile phones and tablets all have camera applications. Users can take photos and record videos through the camera applications in their mobile phones. With the continuous development of the photo-taking and video-recording functions of camera applications in electronic devices such as mobile phones, there are more and more shooting modes on electronic devices such as mobile phones. Users can change the shooting mode of the camera in the camera shooting interface, for example, change the current focal length of the camera, or add filters, etc. After the user changes the shooting mode of the camera, in response to the user operation, a preview image frame in the new shooting mode will be displayed in the shooting interface of the electronic device.

[0003] However, when the user changes the camera shooting mode in the camera shooting interface, there will be a delay in the process of the electronic device from perceiving the user operation to displaying the preview image frame in the new shooting mode. For example, the user can change the current zoom ratio of the camera. After the electronic device perceives the user's zoom operation, it takes a response time to display the preview image frame at the new zoom ratio. In this way, there is a response delay between the user operation and the actual camera screen, which affects the user experience.

[0004] Therefore, how to reduce the response delay of the electronic device to the user's operation of changing the shooting mode is an urgent problem to be solved. Summary of the Invention

[0005] This application provides a camera request processing method and related devices. Implementing the camera request processing method provided by the embodiments of this application can reduce the response delay of the electronic device to the user's operation of changing the shooting mode. In this way, the user experience can be improved.

[0006] In a first aspect, this application provides a camera request processing method. This method can be applied to an electronic device equipped with a camera module. The electronic device can include a camera application. This method can include: the first camera application issues a first camera request; the camera module in the electronic device obtains a first image frame according to the camera parameters in the first camera request, and the camera parameters include one or more of the zoom ratio, focus parameters, exposure parameters, and filter parameters; the camera application issues a second camera request; in the case where it is determined that at least one camera parameter corresponding to the first image frame is different from the camera parameter corresponding to the second camera request, the first image frame is processed to obtain a second image frame, the camera parameter corresponding to the first image frame is the camera parameter in the first camera request, and the camera parameter corresponding to the second image frame is the same as the camera parameter in the second camera request; the camera application displays the second image frame.

[0007] In this way, when the camera parameters in the second camera request are inconsistent with those in the first camera request, the electronic device can process the first image frame captured by the camera into a second image frame. The camera parameters of the second image frame are the same as those in the second camera request. In this way, when the camera module in the electronic device has not acquired an image frame according to the second camera request or when the image frame acquired by the camera module in the electronic device according to the camera parameters of the second camera request has not been sent to the upper layer framework of the electronic device (for example, the application framework layer), the electronic device can more quickly display the image frame corresponding to the second camera request in the camera application.

[0008] For example, when the first camera request and the second camera request are used to change the camera zoom ratio, the electronic device can obtain a second image frame with the same zoom ratio as the second camera request by processing the first image frame. Thereby, the followability of camera zoom in the electronic device can be improved.

[0009] Combined with the first aspect, in a possible implementation manner, when it is determined that at least one camera parameter corresponding to the first image frame is different from the camera parameter corresponding to the second camera request, processing the first image frame to obtain a second image frame includes: when it is determined that the zoom ratio corresponding to the first image frame is different from the zoom ratio corresponding to the second camera request, changing the field of view (FOV) in the first image frame to obtain the second image frame. In this way, by changing the FOV of the first image frame, the second image frame can be obtained.

[0010] Combined with the first aspect, in a possible implementation manner, changing the field of view (FOV) in the first image frame to obtain the second image frame includes: multiplying the FOV of the first image frame by a first proportionality coefficient to obtain the second image frame; the first proportionality coefficient is the ratio of the zoom ratio corresponding to the second camera request to the zoom ratio corresponding to the first camera request. In this way, the first proportionality coefficient can be determined by the zoom ratio in the first camera request and the zoom ratio in the second camera request. Then, the FOV of the second image frame can be determined by the first proportionality coefficient.

[0011] Combined with the first aspect, in a possible implementation manner, the FOV of the first image frame is the first FOV, the FOV of the second image frame is the second FOV, and the second FOV is the product of the first FOV and the first proportionality coefficient. In this way, when the FOV of the first image frame and the first proportionality coefficient are determined, the FOV of the second image frame can be obtained.

[0012] In combination with the first aspect, in a possible implementation, the size of the first image frame is the first size. When it is determined that the zoom ratio corresponding to the first image frame is different from the zoom ratio corresponding to the second camera request, the field of view (FOV) in the first image frame is changed to obtain a second image frame. Specifically, it may include: cropping the first image frame from the first size to a second size; the second size is the product of the first size and a second proportionality coefficient, and the second proportionality coefficient is the reciprocal of the first proportionality coefficient; changing the FOV of the first image frame at the second size to the second FOV; scaling the first image frame from the second size to the first size to obtain the second image frame. In this way, through cropping and scaling, the first image frame can be processed into the second image frame.

[0013] In combination with the first aspect, in a possible implementation, before the camera application issues the first camera request, the method may further include: detecting a first operation in which the user changes the zoom ratio of the camera application to a first zoom ratio. In this way, the first camera request issued by the camera application may be in response to the user's zoom operation (i.e., the first operation).

[0014] In combination with the first aspect, in a possible implementation, before the camera application issues the second camera request, the method may further include: detecting a second operation in which the user changes the zoom ratio of the camera application to a second zoom ratio. In this way, the second camera request issued by the camera application may be in response to the user's zoom operation (i.e., the second operation).

[0015] In combination with the first aspect, in a possible implementation, the method may further include: after detecting the first operation, the camera application displays a first preview interface, and the first preview interface includes a zoom ratio control, and the zoom ratio control indicates that the zoom ratio value of the image frame displayed in the first preview interface is the first zoom ratio; after detecting the second operation, the camera application displays a second preview interface, and the second preview interface includes a zoom ratio control, and the zoom ratio control indicates that the zoom ratio value of the image frame displayed in the second preview interface is the second zoom ratio. In this way, the user can know the current zoom ratio from the zoom ratio control in the camera preview interface.

[0016] In combination with the first aspect, in a possible implementation, the second image frame is displayed in the second preview interface, and the first proportionality coefficient is the ratio of the second zoom ratio to the first zoom ratio.

[0017] In combination with the first aspect, in a possible implementation, the electronic device may include a shooting parameter generation module and an image cropping module; obtaining a first image frame according to the camera parameters in the first camera request includes: the shooting parameter generation module extracts the camera parameters in the first camera request and sends them to the camera module; the camera module shoots a first image frame according to the camera parameters in the first camera request; the camera module sends the first image frame to the image cropping module.

[0018] In this way, the electronic device can send the camera request to the camera module through the shooting parameter generation module, and can also obtain the image frame shot by the camera module through the image cropping module.

[0019] In combination with the first aspect, in a possible implementation, after the camera application issues a second camera request, the method may further include: the shooting parameter generation module extracts the camera parameters in the second camera request and sends them to the image cropping module.

[0020] In this way, the electronic device can extract the camera parameters in the camera request through the shooting parameter generation module. And the shooting parameter generation module can send the extracted camera parameters to the image cropping module.

[0021] In combination with the first aspect, in a possible implementation, when it is determined that at least one camera parameter corresponding to the first image frame is different from the corresponding camera parameter in the second camera request, processing the first image frame to obtain a second image frame includes: the image cropping module determines that at least one camera parameter corresponding to the first image frame is different from the corresponding camera parameter in the second camera request; the image cropping module processes the first image frame to obtain a second image frame.

[0022] In this way, the electronic device can compare the camera parameters of the image frame with the camera parameters in the current camera request through the image frame cropping module. And the electronic device can also process the image frame through the image cropping module to process the first image frame into a second image frame.

[0023] In combination with the first aspect, in a possible implementation, the electronic device may further include a rendering process module; after the image cropping module processes the first image frame to obtain a second image frame, the method may further include: the image cropping module sends the second image frame to the rendering process module; the rendering process module displays the second image frame; the camera application displays the second image frame. In this way, the electronic device can send the second image frame to the rendering process module through the image cropping module, display the second image frame through the rendering process module, and can also display the second image frame through the camera application.

[0024] In combination with the first aspect, in a possible implementation, after the camera application sends a second camera request, the method may further include: the camera module in the electronic device obtains a third image frame according to the camera parameters in the second camera request. In this way, the camera module in the electronic device still captures an image frame according to the camera parameters in the second camera request.

[0025] In a second aspect, an electronic device is provided. The electronic device may include one or more cameras, a display, one or more processors, and one or more memories. Among them, the one or more cameras, the display, and the one or more memories are coupled to the one or more processors. The one or more memories are used to store computer program code. The computer program code includes computer instructions. When the one or more processors execute the computer instructions, the electronic device is caused to execute the method involved in any possible implementation in the first aspect.

[0026] In a third aspect, an electronic device is provided. The electronic device may include one or more functional modules, and the one or more functional modules are used for the method involved in any possible implementation in the first aspect.

[0027] In a fourth aspect, a chip system is provided. The chip system is applied to an electronic device. The chip system includes one or more processors, and the processors are used to call computer instructions to cause the electronic device to execute the method involved in any possible implementation in the first aspect.

[0028] In a fifth aspect, a computer-readable storage medium is provided, including instructions. When the instructions run on an electronic device, the electronic device is caused to execute the method involved in any possible implementation in the first aspect.

[0029] In a sixth aspect, a computer program product is provided. When the program product runs on an electronic device, the electronic device is caused to execute the method involved in any possible implementation in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 is a schematic diagram of a user interface provided by an embodiment of the present application;

[0031] Figures 2A - 2C is a set of schematic diagrams of user interfaces provided by an embodiment of the present application;

[0032] Figure 3 is a schematic diagram of the software and hardware architecture of an electronic device provided by an embodiment of the present application;

[0033] Figure 4 is a schematic diagram of the response of an electronic device to a user zoom operation provided by an embodiment of the present application;

[0034] Figure 5A It is a schematic diagram of the software and hardware architecture of an electronic device provided by an embodiment of the present application;

[0035] Figure 5B It is a schematic diagram of the software and hardware architecture of an electronic device provided by an embodiment of the present application;

[0036] Figure 6 It is a schematic diagram of the interaction between software and hardware modules of a camera request processing method provided by an embodiment of the present application;

[0037] Figure 7 It is a schematic diagram of the response of an electronic device to a user's zoom operation provided by an embodiment of the present application;

[0038] Figure 8 It is a schematic diagram for comparing the effective curve of a user's zoom operation provided by an embodiment of the present application;

[0039] Figure 9 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Detailed implementation manners

[0040] Next, the technical solutions in the embodiments of the present application will be clearly and completely described with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are some, but not all, of the embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without making creative efforts shall fall within the protection scope of the present application.

[0041] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments and are not intended to limit the present application. As used in the specification and claims of the present application, the singular forms "a", "an", "the", "above", "said", "this" are intended to include the plural forms as well, unless the context clearly indicates otherwise. The terms "first" and "second" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance or implicitly specifying the number of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more of such features. "First" and "second" etc. are used to distinguish different objects rather than to describe a specific order of the objects. For example, the first object and the second object are used to distinguish different objects rather than to describe a specific order of the objects.

[0042] In the description of the embodiments of the present application, unless otherwise specified, "a plurality of" means two or more. For example, a plurality of processing units means two or more processing units; a plurality of systems means two or more systems.

[0043] In the embodiments of the present application, words such as "exemplary" or "for example" are used to represent examples, illustrations, or explanations. Any embodiment or related solution described as "exemplary" or "for example" in the embodiments of the present application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Rather, the use of words such as "exemplary" or "for example" is intended to present relevant concepts in a specific manner.

[0044] The term "and / or" in the present application is merely a description of the association relationship between associated objects, indicating that three relationships may exist. For example, A and / or B may represent three situations: A exists alone, A and B exist simultaneously, and B exists alone.

[0045] To better understand the technical solutions provided by the present application, before describing the technical solutions of the present application, first, in combination with the accompanying drawings, the electronic device 100 with a photographing function applicable to the present application. In the embodiments of the present application, the electronic device 100 may include, but is not limited to: devices with a photographing function such as mobile phones, tablet computers, smart watches, etc. The embodiments of the present application do not limit the specific form and type of the electronic device 100.

[0046] The term "user interface (UI)" in the following embodiments of the present application is a media interface for interaction and information exchange between an application program or an operating system and a user, which realizes the conversion between the internal form of information and the form acceptable to the user. The user interface is source code written in a specific computer language such as Java, Extensible Markup Language (XML), etc. The interface source code is parsed and rendered on the electronic device and finally presented as content recognizable by the user. The common form of presentation of the user interface is the graphical user interface (GUI), which refers to the user interface related to computer operations displayed in a graphical manner. It may be visible interface elements such as text, icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, Widgets, etc. displayed on the display screen of the electronic device.

[0047] To better understand the technical solutions provided by the present application, before describing the technical solutions of the present application, first, in combination with the accompanying drawings, the electronic device 100 with a photographing function applicable to the present application. In the embodiments of the present application, the electronic device 100 may include, but is not limited to: devices with a photographing function such as mobile phones, tablet computers, smart watches, etc. The embodiments of the present application do not limit the specific form and type of the electronic device 100.

[0048] Currently, there are more and more shooting modes on electronic devices such as mobile phones. Users can change the shooting mode of the camera in the camera shooting interface. For example, they can change the current focal length of the camera, or add camera parameters such as filters, exposure, and focus. In some scenarios, when users change the camera parameters of the camera on an electronic device such as a mobile phone, after the electronic device senses the zoom operation of the user, it takes a relatively long response time to display the preview image frame at the new zoom ratio. In this way, the followability of the camera zoom is poor, affecting the user experience.

[0049] In the embodiments of the present application, the followability of the camera zoom refers to the response of the electronic device to the zoom operation when the user operates the camera zoom, that is, the electronic device displays the preview image frame at the new zoom ratio. The longer the response time of the electronic device, the worse the followability of the camera zoom.

[0050] In the following, taking the electronic device 100 as a mobile phone and the user changing the zoom ratio of the camera in the mobile phone as an example for elaboration.

[0051] Figure 1 、 Figures 2A - 2C Exemplarily, a schematic diagram of the interface related to the user changing the zoom ratio of the camera in the mobile phone is shown.

[0052] Exemplarily, the electronic device 100 may display a desktop 101. In the desktop 101, a page with application icons is displayed. This page includes multiple application icons (for example, settings application icon, app market application icon, gallery application icon, browser application icon, etc.). Below the multiple application icons, a page indicator 104 is also displayed to indicate the positional relationship between the currently displayed page and other pages. Below the page indicator 104, a tray area 102 is displayed. Among them, the tray area 102 includes multiple tray icons, such as a camera application icon 103, a contacts application icon, a phone application icon, and a messages application icon. The tray area 102 remains displayed during page switching. In some embodiments, the above page may also include multiple application icons and a page indicator 104. The page indicator 104 may not be part of the page and exist separately. The above tray icons are also optional, and the embodiments of the present application do not limit this.

[0053] The electronic device 100 can receive an input operation (such as a click) by the user on the camera application icon 103. In response to this input operation, the electronic device 100 can display as Figure 2A the shown shooting interface 200.

[0054] As Figure 2AAs shown in the figure, the shooting interface 200 may include an echo control 203A, a shooting control 203B, a camera switching control 203C, a preview frame 201, a zoom ratio control 202, and controls for one or more shooting modes (for example, a control 204A for the large aperture shooting mode, a control 204B for the night scene shooting mode, a control 204C for the portrait shooting mode, a control 204D for the shooting mode, a control 204E for the video recording mode, a control 204F for the multi-camera video recording mode, and a more mode control 204G).

[0055] Among them, as Figure 2A shown, the control 204D for the shooting mode is selected, and the electronic device 100 is in the shooting mode. A preview image 205 captured by the electronic device 100 through the camera in the shooting mode is displayed in the preview frame 201. The echo control 203A can be used to trigger the display of the captured image or video. The shooting control 203B is used to trigger the saving of the image captured by the camera. The camera switching control 203C can be used to switch the camera of the electronic device 100 for capturing images (for example, switching the front camera to the rear camera, or switching the rear camera to the front camera). The zoom ratio control 202 can be used to set the zoom ratio of the electronic device 100 for taking photos or videos. Among them, the current used zoom ratio (for example, 1x), a common zoom ratio 1 smaller than the current used zoom ratio (for example, 0.6x), and a common zoom ratio 2 larger than the current used zoom ratio (for example, 2x) can be displayed on the zoom ratio control 202.

[0056] The control for the shooting mode can be used to trigger the start of the image processing process corresponding to the shooting mode. For example, the control 204A for the large aperture shooting mode can be used to trigger the camera to capture an image using large aperture parameters. The control 204B for the night scene shooting mode can be used to trigger an increase in the brightness and color richness in the captured image, etc. The control 204C for the portrait shooting mode can be used to trigger the beautification process of the portrait in the captured image by the electronic device 100. The control 204D for the shooting mode can be used to trigger the electronic device 100 to capture an image using default parameters and use the default image processing process to process the image captured by the camera. The control 204E for the video recording mode can be used to trigger the electronic device 100 to record a video through a single camera. The control 204F for the multi-camera video recording mode can be used to trigger the electronic device 100 to record a video through multiple cameras simultaneously. The more mode control 204G can be used to trigger the electronic device 100 to display more controls for shooting modes.

[0057] The electronic device 100 can receive a user's input operation on the zoom ratio control 202 (for example, clicking on the common zoom ratio 2 (for example, 2x)). In response to this input operation, the zoom ratio of the electronic device 100 can be switched from the current used zoom ratio to the common zoom ratio 2.

[0058] Since it takes some time for the electronic device 100 to respond to the user's zoom operation, when the electronic device 100 receives an input operation on the zoom ratio control 202, it takes a period of time to respond before it can display a preview image frame at the new zoom ratio (i.e., the common zoom ratio 2, such as 2x).

[0059] Exemplarily, as Figure 2B shown, Figure 2B in the zoom ratio control 202 in the user interface 210 shown, the currently used zoom ratio is displayed as 2x. The zoom ratio of the preview image 205 displayed in the preview frame 201 is still the previous zoom ratio, which is 1x.

[0060] As Figure 2C shown, after the electronic device 100 responds for a period of time, the preview image 221 obtained after the electronic device 100 switches from the currently used zoom ratio (e.g., 1x) to the common zoom ratio 2 (e.g., 2x) can be displayed in the user interface 220 of the electronic device 100.

[0061] As Figures 2A - 2C shown, the followability of the camera zoom of the electronic device 100 is poor. In this way, the user will perceive the response delay between the user operation and the actual change of the camera screen, thus affecting the user experience.

[0062] Next, the software structure of the electronic device 100 will be described. Before describing the software structure of the electronic device 100, first, the architecture that the software system of the electronic device 100 can adopt will be described.

[0063] Specifically, in practical applications, the software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservices architecture, or a cloud architecture.

[0064] In addition, it can be understood that the software systems used in current mainstream electronic devices include but are not limited to the Windows system, the Android system, and the iOS system. For the convenience of description, in the embodiments of the present application, the Android system with a layered architecture is taken as an example to exemplarily describe the software structure of the electronic device 100.

[0065] In addition, the subsequent processing method for the camera requests provided in the embodiments of the present application is equally applicable to other systems in specific implementations.

[0066] Figure 3 shows a schematic diagram of the software and hardware architecture of the camera service on an electronic device 100 provided in the embodiments of the present application.

[0067] As Figure 3As shown, the software and hardware architecture of the electronic device 100 includes a software system and a hardware layer that, together with the software structure, implements relevant camera services (such as preview, photo taking, video recording, etc.). Among them, the layered architecture divides the software system of the electronic device 100 into several layers, and each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the system is divided into four layers, from top to bottom, namely the application layer, the application framework layer (FWK), the hardware abstraction layer (HAL), and the driver layer.

[0068] The application layer may include a series of application packages. Such as Figure 3 shown, the application package may include a camera application. The camera application can receive a user zoom operation.

[0069] Optionally, the application package may also include applications such as a gallery, a calendar, a call, a map, a navigation, WLAN, Bluetooth, music, video, short message, etc. (which may also be referred to as applications). The embodiments of the present application do not limit this.

[0070] The application framework layer provides application programming interfaces (APIs) and programming frameworks for the application packages in the application layer. The application framework layer includes some predefined functions.

[0071] In some embodiments, a request queue processing module may be included in the application framework layer. Among them, the request queue processing module may include a WaitForRequest module, a SendRequestsBatch module, and a PrepareHardwareAbstractionLayerRequest (which may be abbreviated as PrepareHALRequest) module. Among them, the WaitForRequest module may be used to keep the camera requests to be executed in the request queue module waiting when there is no empty buffer among the N buffer caches allocated to the camera application in the buffer cache area of the electronic device. The PrepareHALRequest module may be used to construct the camera requests of the HAL layer and the output buffers (outputBuffers). When there is an empty buffer among the N buffer caches allocated to the camera application's camera requests, the PrepareHALRequest module may obtain a buffer from the Allocate Buffer interface for the camera requests sent by the camera application. The SendRequestsBatch module may be used to send the Capture requests of the HAL layer constructed by the PrepareHALRequest module to the HAL layer.

[0072] Exemplarily, the above N may be 8, that is, the number of buffers allocated to the camera application's camera requests by the electronic device may be 8. N may also be other values, for example, 7, or 9, etc. The embodiments of the present application do not limit the value of N. The following will be described by taking the value of N as 8 as an example.

[0073] In some embodiments, an Allocate Buffer interface may also be included in the application framework layer. The Allocate Buffer interface is used to allocate caches for the camera requests sent by the camera application. Exemplarily, the AllocateBuffer interface may specify the address of the buffer used to store the camera request for the camera request.

[0074] Among them, the request queue processing module can receive camera requests sent by the camera application through the camera interface. Then, the request queue processing module can obtain the buffer allocated for the camera request from the buffer allocation interface module. The request queue processing module can send the camera request and the buffer address to the camera hardware abstraction layer. Specifically, the waiting request module in the request queue processing module can receive the camera request sent by the camera application through the camera interface. Then, the waiting request module can send the received camera request to the HAL request preparation module. The HAL request preparation module can obtain the buffer used to store the camera request from the buffer allocation interface module. Then, the HAL request preparation module can send the camera request and the buffer address of the camera request to the batch request sending module. The batch request sending module can send the camera request and the buffer address of the camera request to the camera hardware abstraction layer. Optionally, when there is an empty buffer in the buffer area for storing camera requests, the HAL request preparation module can directly receive the camera request sent by the camera application through the camera interface. In the embodiments of the present application, the camera request may include a preview request, a photo-taking request, a video recording request, etc., and the embodiments of the present application do not limit what specific type of request the camera request is.

[0075] In some possible implementation manners, the application framework layer may further include a camera interface. For example, the camera interface may include an image acquisition interface and an interface for continuously acquiring images. The application request receiving module can receive the camera requests sent by the camera application through the camera interface. Specifically, the application request receiving module can receive the photo-taking request sent by the camera application through the image acquisition interface. The application request receiving module can receive the preview request or video recording request sent by the camera application through the interface for continuously acquiring images.

[0076] In some embodiments, the application framework layer may include an image data consumption module. Among them, the image data consumption module can receive the image frames returned by the HAL.

[0077] In some embodiments, the application framework layer may further include a rendering process Surface flinger module. This rendering process module can be used to render and synthesize the image frames to be displayed. Specifically, the image data consumption module can send the image frames returned by the HAL to the rendering process module. After receiving the image frames sent by the image data consumption module, the rendering process module can first render and synthesize the image frames, and then send them to the display for display.

[0078] Optionally, in some examples, the image data consumption module may send the received image frames to the camera application. Then, the camera application may process the received image frames according to some camera algorithms in the camera application, and then send the processed image frames to the rendering process module. Alternatively, the camera application may also directly send the received image frames to the rendering process module.

[0079] Optionally, in some examples, the rendering process module may render and synthesize the received image frames and then send them to the camera application. The camera application may send the rendered and synthesized image frames to the display for display. Alternatively, while sending the rendered and synthesized image frames to the display, the camera application may also send the preview frame size of the camera application to the display.

[0080] In some embodiments, the application framework layer may also be referred to as the application framework layer.

[0081] The hardware abstraction layer HAL is an interface layer located between the application framework layer and the driver layer, providing a virtual hardware platform for the operating system.

[0082] The hardware abstraction layer may include a camera hardware abstraction layer. Among them, the camera hardware abstraction layer may include a receiving FWK request module and a request enqueue module. Among them, the receiving FWK request module may receive the camera requests issued by the request issuing module in the application framework layer. Then, the receiving FWK request module may temporarily store the received camera requests in the request enqueue module. One or more camera requests issued by the application framework layer may be stored in the request enqueue module. The request enqueue module may sequentially send the camera parameters in the stored camera requests to the camera module through the driver layer according to the enqueue order.

[0083] In some embodiments, the hardware abstraction layer may further include a result processing module. Among them, the result processing module may include a buffer filling module and a result feedback module. After the camera obtains an image frame according to the camera parameters in the camera request, the image frame may be sent to the result processing module through the driver layer. The buffer filling module in the result processing module may fill the image frame into the buffer storing the camera request corresponding to the image frame. Then, the result feedback module may also upload the image frame or the buffer address storing the image frame to the application framework layer.

[0084] In the embodiments of the present application, the camera request corresponding to the image frame refers to a camera request that includes the camera parameters for obtaining the image frame. That is, the camera can obtain the image frame according to the camera parameters in the camera request. Exemplarily, if the camera obtains image frame 1 according to the camera parameters in camera request 1, then camera request 1 may be referred to as the camera request corresponding to image frame 1.

[0085] The driver layer is the layer between the hardware and the software. The driver layer includes drivers for various hardware components. The driver layer may include a camera driver, an image processor driver, a display driver, etc. Among them, the camera driver is used to drive the image sensors of one or more cameras in the camera module (e.g., image sensor 1, image sensor 2, etc.) to capture images and drive the image signal processor to preprocess the images. The image processor driver is used to drive the graphics processor to process the images. The display driver is used to drive the display.

[0086] The hardware layer may include a camera module, an image signal processor, a display, etc. The camera module may include image sensors of one or more cameras (e.g., image sensor 1, image sensor 2, etc.). Optionally, the camera module may further include a time of flight (TOF) sensor, a multispectral sensor, etc. The image signal processor may be used to process the image frames captured by the camera module. The display may be used to display the image frames sent by the rendering process module or the camera application.

[0087] Next, in combination with the above system structure, taking zooming as an example, the processing mechanism of the camera request generated by the electronic device 100 based on the user's operation for changing the focal length will be specifically described:

[0088] ①. The electronic device 100 receives the user's operation to start the camera application and issues a camera request 0 for obtaining a preview image.

[0089] After the electronic device 100 receives the user's operation to start the camera application, the electronic device 100 starts the camera application. The camera application may issue a camera request 0 (with a zoom ratio of zoom0) for obtaining a preview image.

[0090] It can be understood that after the camera application in the electronic device 100 is started, it may periodically issue a camera request for obtaining a preview image.

[0091] The zoom ratio at the start of the camera application may be the default zoom ratio of the camera application, e.g., 1.0x.

[0092] After the application framework layer of the electronic device 100 receives the camera request 0 sent by the camera application, it can obtain the buffer address for storing the camera request 0. The application framework layer can also store the camera request in buffer0 corresponding to the buffer address. It can be understood that the number of buffers in the electronic device 100 for storing camera requests is limited. When the camera application sequentially issues multiple camera requests, the application framework layer can sequentially store the multiple camera requests in the buffers. When all the buffers in the buffer area are storing camera requests and there is no empty buffer, the subsequent camera requests issued by the camera application need to wait until the camera request stored in the buffer is processed and the empty buffer is released before they can be stored in the empty buffer.

[0093] Exemplarily, the camera application of the electronic device 100 can issue the camera request 0. The request queue processing module in the application framework layer of the electronic device 100 can receive the camera request 0 through the camera interface. When there is an empty buffer among the N buffers reserved for camera requests in the buffer area of the electronic device 100, the electronic device 100 can send the camera request 0 from the waiting request module in the request queue processing module to the ready HAL request module in the request queue processing module. After the ready HAL request module obtains the buffer address allocated for the camera request by the Allocate Buffer interface, it can store the camera request in the buffer. The ready HAL request module can construct the camera request 0 into a Capture request in the HAL layer and send it to the HAL layer through the batch request sending module.

[0094] Optionally, the HAL layer can also include a camera request waiting module. The batch request sending module can send the camera request 0 to the camera request waiting module in the HAL layer. When the previous camera request processed by the camera hardware abstraction module has been processed, the camera request waiting module can send the camera request 0 to the camera hardware abstraction processing module. Then, the camera hardware abstraction processing module can send the camera parameters in the new camera request 0 and the buffer address of the camera request to the camera module through the driver layer.

[0095] It can be understood that when multiple buffers in the buffer queue of the buffer area are storing camera requests and there is no empty buffer, the request thread module needs to wait until the camera request in the first buffer (for example, buffer0) in the buffer queue is processed. Then, when the first buffer, that is, buffer0, is emptied, the request thread module can obtain the address of the buffer0 and store the camera request 0 in the buffer0.

[0096] It can be understood that after the camera request 0 is stored in the buffer0, the buffer0 can be arranged at the end of the buffer queue. The position of the buffer0 in the buffer queue is not fixed, and the buffers in the buffer queue store camera requests in turn. In the buffer queue, according to the order of storing camera requests, the buffer that stores the camera request first can be arranged in front of the buffer that stores the camera request later. The electronic device 100 can first process the camera request stored in the buffer at the front of the buffer queue, and then process the camera request stored in the buffer at the back of the buffer queue.

[0097] ②. The electronic device 100 turns on the camera and obtains the image frame 0 captured by the camera based on the camera request.

[0098] After the camera driver in the electronic device 100 receives the camera parameter 0, it can drive the electronic device 100 to turn on the camera module. The camera driver can send the camera parameter 0 to the camera module. The camera module can obtain the image frame 0 according to the camera parameter 0. The zoom ratio of the image frame 0 is zoom0.

[0099] In the embodiment of the present application, the camera parameter 0 may include camera internal parameters and camera external parameters. Among them, the camera internal parameters may include parameters such as focal length (for example, the zoom ratio is zoom0), pixel focal length, etc. The camera external parameters may include the transformation relationship between different coordinate systems, for example, the transformation relationship between the world coordinate system and the camera coordinate system. The embodiment of the present application does not limit the specific camera parameters.

[0100] ③. The electronic device 100 sends the image frame 0 captured by the camera to the application framework layer, and the application framework layer renders the image frame 0.

[0101] The electronic device 100 can upload the image frame 0 (the zoom ratio is zoom1) captured by the camera module to the hardware abstraction layer through the camera driver. The hardware abstraction layer can store the image frame 0 in the buffer of the camera request 1. The camera hardware abstraction layer in the hardware abstraction layer can upload the image frame 0 and the buffer address storing the image frame to the HAL frame return data processing module in the application framework layer.

[0102] Optionally, in some examples, the image frame 0 obtained by the camera module can be transmitted to the image signal processor. The image signal processor can preprocess the image frame 0 and upload it to the hardware abstraction layer through the camera driver or the image processor driver. The hardware abstraction layer can store the image frame 0 in buffer0 of the camera request 1. The camera hardware abstraction layer in the hardware abstraction layer can upload the image frame 0 and the address of buffer0 storing the image frame 0 to the image data consumption module in the application framework layer.

[0103] Then, the image data consumption module in the application framework layer can send the image frame and / or the address of buffer0 to the rendering process module for rendering and composition. The rendering process module can send the rendered and composed image frame 0 to the display for display.

[0104] Optionally, in some feasible examples, after the hardware abstraction layer stores the image frame 0 obtained by the camera module in buffer0, it uploads the address of buffer0 to the image data consumption module in the application framework layer. Then, the image data consumption module uploads the address of buffer0 to the camera application. After receiving the address of buffer0, the camera application notifies the rendering process module in the application framework layer to perform rendering and informs the rendering process module of the address of buffer0. The rendering process module can retrieve the image frame 0 from buffer0 and render and compose the image frame 0. Then the rendering process module can send the rendered and composed image frame 0 to the camera application.

[0105] Optionally, in some feasible examples, the rendering process module can also directly render and compose the image frame 0 in buffer0. When the rendering and composition are completed, it can notify the camera application that the rendering and composition have been completed. Then, the camera application can notify the display to display the image frame 0 through the display driver and inform the address of buffer0. The display can retrieve the rendered and composed image frame 0 from buffer0 and display the rendered and composed image frame 0.

[0106] ④. The electronic device 100 displays the image frame 0.

[0107] After receiving the rendered and composed image frame 0, the display of the electronic device 100 can display the image frame 0 (the zoom ratio is zoom0).

[0108] Further, in some examples, when the display successfully displays the image frame 0, the image frame 0 stored in the buffer area of the electronic device and buffer0 storing the camera request for this image frame will be cleared. In this way, the request process in the application framework layer can store another camera request in this buffer0.

[0109] ⑤. The electronic device 100 receives the user's zoom operation 1 and issues a camera request 1.

[0110] In some scenarios, after the camera application is launched, the electronic device 100 can receive the user's zoom operation and then issue a camera request 1. The zoom ratio in the camera request 1 is zoom1. Specifically, the camera application of the electronic device 100 can issue the camera request 1. The request queue processing module in the application framework layer of the electronic device 100 can receive the camera request 1 through the camera interface.

[0111] When there is an empty buffer among the N buffers reserved for camera requests in the buffer area of the electronic device 100, the electronic device 100 can send the camera request 1 from the waiting request module in the request queue processing module to the ready HAL request module in the request queue processing module. After the ready HAL request module obtains the buffer address allocated for the camera request by the Allocate Buffer interface, it can store the camera request in this buffer. The ready HAL request module can construct the camera request 1 into a Capture request in the HAL layer and issue it to the HAL layer through the batch request issuing module.

[0112] Optionally, the HAL layer may also include a camera request waiting module. The batch request issuing module can issue the camera request 1 to the camera request waiting module in the HAL layer. When the previous camera request processed by the camera hardware abstraction module has been processed, the camera request waiting module can send the camera request 1 to the camera hardware abstraction processing module. Then, the camera hardware abstraction processing module can send the camera parameters in the new camera request 1 and the buffer address of this camera request to the camera module through the driver layer.

[0113] The electronic device 100 can process the camera request 1 according to the above steps ② and ③, and obtain the image frame 1 (zoom ratio is zoom1) with the camera according to the camera parameters 1.

[0114] In the embodiments of the present application, the user's zoom operation 1 may include, but is not limited to, the user clicking a new zoom ratio in the user interface of the camera, pinching with two fingers in the user interface of the camera, sliding the zoom bar in the user interface of the camera, and so on. Exemplarily, for the user clicking a new zoom ratio in the user interface of the camera, reference can be made to Figure 2A . As Figure 2A shown, the current zoom ratio displayed in the user interface 200 of the camera is 1x, and the user clicks the zoom ratio 2x. The embodiments of the present application do not limit what specific operation the user's zoom operation is.

[0115] ⑥. The electronic device 100 receives the user's zoom operation 2 and issues a camera request 2.

[0116] Before the electronic device 100 displays the image frame 1, it can receive the user's zoom operation 2. The zoom operation 2 is used to change the zoom ratio of the camera from zoom1 to zoom2. In response to the zoom operation 2, the electronic device 100 can send down the camera request 2, and the zoom ratio in the camera request 2 is zoom2.

[0117] It can be understood that the application framework layer, HAL, driver layer, and hardware layer of the electronic device 100 will first process the camera request 1 according to the above steps ① - ④. Then, when the camera request 2 is sent down, the electronic device 100 will also process the request 2 according to the steps of processing the camera request 1. For example, in some examples, when the camera request 2 is sent down to HAL, the application framework layer of the electronic device 100 can start to process the camera request 2. After the application framework layer finishes processing the camera request 2, it can send down the camera request 2 to HAL. When HAL has not finished processing the camera request 1, the camera request 2 can be temporarily stored in the request queue to be processed in HAL. When HAL finishes processing the camera request 1 and returns the image frame corresponding to the camera request 1 to the application framework layer, HAL can continue to process the camera request 2.

[0118] ⑦. The electronic device 100 displays the image frame obtained according to the zoom operation 1.

[0119] While the electronic device 100 is processing the camera request 2, the electronic device 100 can also display the image frame obtained according to the zoom operation 1, that is, the image frame 1. The zoom ratio of the image frame 1 is zoom1.

[0120] Since the electronic device 100 needs to follow the above process of processing the camera request 0 for each camera request, first, the application framework layer sends down the camera request to HAL. Then, HAL obtains the image frame corresponding to the camera request from the camera. Next, HAL sends the obtained image frame to the application framework layer for display. Finally, the user can see the image frame corresponding to the camera request. Specifically, refer to steps ① - ④. In this way, when the user performs a zoom operation, the electronic device 100 also needs to respond to the user's zoom operation 2 according to the above process of processing the camera request 1. In this way, after the user performs the zoom operation 1 and then performs the zoom operation 2 (for example, clicks to switch the original zoom ratio zoom1 to the new zoom ratio zoom2). The electronic device 100 will not immediately display the image frame with the zoom ratio of zoom2. The electronic device 100 will respond to the zoom operation 1 and then respond to the zoom operation 2. During the process of the electronic device 100 responding to the camera request 2 with the zoom ratio of zoom2, the electronic device 100 will continue to display the image frame with the zoom ratio of zoom1. In this way, the camera zoom followability of the electronic device 100 is poor, affecting the user experience.

[0121] Exemplarily, as Figure 4 shown, the camera application in the electronic device 100 can sequentially send multiple zoom requests to the application framework layer FWK. For example, zoom request 1, zoom request 2, zoom request 3, zoom request 4, and so on. After FWK sequentially receives zoom request 1, zoom request 2, zoom request 3, and zoom request 4, FWK can sequentially send the camera parameters corresponding to each zoom request to HAL, and the camera parameters can include a zoom value. The camera application can send multiple zoom requests after receiving a zoom operation from the user and determine the zoom value (i.e., the value of the zoom ratio) corresponding to each zoom request. Alternatively, the camera application can send a zoom request each time it receives a zoom operation from the user, and the zoom value in the zoom request is determined by the camera application based on the user operation. As Figure 7 shown, the zoom value (i.e., the zoom ratio) corresponding to zoom request 1 can be 1.5x. The zoom value corresponding to zoom request 2 can be 1.6x. The zoom value corresponding to zoom request 3 can be 1.7x. The zoom value corresponding to zoom request 4 can be 1.8x. After the camera parameters corresponding to each zoom request are sent to HAL, HAL can process and return the corresponding image frame. After the camera application sends zoom request 4, HAL only obtains the image frame 1 according to the zoom value in zoom request 1, and the zoom ratio of the image frame 1 is 1.5x. In this way, when the user sets the zoom ratio to 1.8x in the user interface of the camera, the electronic device 100 only displays the image frame with a zoom ratio of 1.5x. In this way, the camera zoom followability of the electronic device 100 is poor, resulting in a poor user experience.

[0122] In order to reduce the follow-up latency of camera-related parameters (such as zoom, focus, exposure, filter), and improve the user experience, an embodiment of the present application provides a camera request processing method, which may include: The electronic device 100 receives a zoom operation 1 of the user, and the zoom operation 1 is used to switch the zoom ratio of the camera application to zoom1. In response to the zoom operation 1, the electronic device 100 issues a camera request 1, and obtains an image frame 1 based on the camera request 1. The zoom ratio of the image frame 1 is zoom1. Before the electronic device 100 sends the image frame 1 for display, the electronic device 100 receives a zoom operation 2 of the user, and the zoom operation 2 is used to switch the zoom ratio of the camera application to zoom2. When the electronic device 100 sends the image frame 1 for display, the zoom ratio of the image frame 1 is compared with the current zoom ratio. When the zoom ratio of the image frame 1 is inconsistent with the current zoom ratio, the electronic device 100 processes the image frame 1 to obtain an image frame 2, and the zoom ratio of the image frame 2 is zoom2. The electronic device 100 displays the image frame 2. In this way, by processing the image frame obtained by the electronic device 100, the follow-up performance of the camera zoom can be optimized, thereby improving the user experience.

[0123] Figure 5A Exemplarily, a schematic diagram of the software and hardware architecture of the camera service on another electronic device provided by the embodiment of the present application is shown.

[0124] As Figure 5A shown, the software and hardware architecture of the electronic device 100 includes a software system and a hardware layer that together implement related camera services (such as preview, taking pictures, video recording, etc.). Among them, the layered architecture divides the software system of the electronic device 100 into several layers, and each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the system is divided into four layers, from top to bottom, namely the application layer, the application framework layer (FWK), the hardware abstraction layer (HAL), and the drive layer.

[0125] The application layer may include a series of application packages. As Figure 5A shown, the application package may include a camera application.

[0126] Optionally, the application package may further include application programs such as a gallery, a calendar, a call, a map, a navigation, WLAN, Bluetooth, music, video, and short message (which may also be referred to as an application). The embodiment of the present application does not limit this.

[0127] The application framework layer provides application programming interfaces (APIs) and programming frameworks for application packages in the application layer. The application framework layer includes some predefined functions.

[0128] As Figure 5A shown, the application framework layer further includes a shooting parameter generation module, a request queue processing module, an allocation buffer interface, a result processing module, an image cropping module, a vsync signal monitoring module, a display thread, a timer, a buffer manager, and a rendering process surface flinger.

[0129] Among them, the shooting parameter generation module is used to generate a smooth adjustment curve based on the initial shooting parameters and the target shooting parameters sent by the camera application when it detects that the user adjusts the shooting parameters. And determine one or more transitional shooting parameters based on the frame return time of the image frame and the smooth adjustment curve.

[0130] The shooting parameter generation module is further used to send a transitional shooting parameter to the HAL layer when it monitors that the HAL layer uploads an image frame to the result processing module, and the HAL layer then sends the transitional shooting parameter to the camera module, so that the camera module can obtain the image frame based on the transitional shooting parameter.

[0131] In some embodiments, the shooting parameter generation module may also be located in the HAL layer, and this application does not limit the location of the shooting parameter generation module.

[0132] For the request queue processing module and the allocation buffer interface, reference can be made to Figure 3 the description in, and this application will not elaborate here.

[0133] The image cropping module is used to crop or scale the obtained image frame based on the camera parameters of the current camera request and the camera parameters of the obtained image frame.

[0134] The result processing module is used to receive the image frame and the shooting parameters of the image frame sent by the HAL layer, or the buffer address storing the image frame and the shooting parameters of the image frame.

[0135] The result processing module is further used to send the image frame and the shooting parameters of the image frame, or the buffer address storing the image frame and the shooting parameters of image frame A to the image cropping module.

[0136] In some embodiments, the result processing module is further used to store the image frame and the shooting parameters of the image frame, or the buffer address storing the image frame and the shooting parameters of the image frame in the buffer manager.

[0137] A buffer manager, which is used to store the image frames to be displayed or the buffer addresses of the image frames to be displayed.

[0138] The buffer manager is further used to send the stored image frames or the buffer addresses storing the image frames to the display thread when the display thread acquires the image frames.

[0139] A display thread, which is used to determine the timing of acquiring the next image frame to be displayed from the buffer manager based on the vsync signal period or the period of the timer.

[0140] Specifically, in a possible implementation, the display thread can be used to acquire the next image frame to be displayed from the buffer manager after an interval of m vsync signal periods from the time when the previous image frame was displayed, and send the acquired image frame to be displayed to the camera application. The camera application can send the acquired image frame to be displayed to the rendering process module.

[0141] Optionally, in a possible implementation, the display thread can also acquire the next image frame to be displayed from the buffer manager after an interval of the display period of the timer from the time when the previous image frame was displayed, and send the acquired image frame to be displayed to the camera application. The camera application can send the acquired image frame to be displayed to the rendering process module.

[0142] A vsync signal monitoring module, which is used to monitor the vsync signal period in the rendering process and send the vsync signal period to the display process.

[0143] The timer can be used to send a timer period signal to the display thread. Among them, the period of the timer can be determined by the screen refresh frame rate of the electronic device.

[0144] A rendering process module, which is used to render the image frames sent by the camera application and send the rendering result (i.e., the rendered image frame) to the camera application, and the camera application can display the rendering result.

[0145] In some embodiments, the application framework layer can also be referred to as the application framework layer.

[0146] The hardware abstraction layer HAL, the driver layer, and the hardware layer can refer to Figure 3 the description therein, which will not be elaborated here.

[0147] Combined with the software and hardware framework of the electronic device 100 provided above Figure 5A involved in this application embodiment, Figure 5B it shows the interaction of relevant modules involved in this application embodiment and the specific data flow of the electronic device for processing camera requests in order to improve the responsiveness of camera zoom requests.

[0148] As shown in Figure 5B , the application framework layer may include a shooting parameter generation module, a request queue processing module, and an image cropping module. Among them, the request queue processing module may include a waiting request module, a preparation HAL request module, and a batch request sending module. Among them, the request queue processing module may refer to the above Figure 3 description, which will not be elaborated here.

[0149] In some embodiments, the shooting parameter generation module may also send control parameters obtained from the camera request (for example, resolution, zoom ratio, frame rate, etc.) or transitional shooting parameters generated based on the control parameters in the camera request to the image cropping module. The shooting parameter generation module may also refer to Figure 5A description.

[0150] In a possible implementation, the image cropping module may send the image frame to the rendering process module. Before the image cropping module sends the image frame to the rendering process module, the image cropping module may also obtain the camera parameters in the current camera request from the shooting parameter generation module. The image cropping module may compare the control parameters in the image frame to be displayed with the control parameters included in the current camera request. When the control parameters in the image frame to be displayed are inconsistent with the control parameters included in the current camera request, the image cropping module may process the image frame to be displayed to obtain a processed image frame, and the control parameters in the processed image frame are the same as the control parameters included in the current camera request. Then, the image cropping module may send the processed image frame to the rendering process module. When the control parameters in the image frame to be displayed are consistent with the control parameters included in the current camera request, the image cropping module may directly send the image frame to be displayed to the rendering process module.

[0151] In some embodiments, the application framework layer may further include a rendering process module. The rendering process module may refer to the above Figure 3 description, which will not be elaborated here.

[0152] The hardware abstraction layer HAL, the driver layer, and the hardware layer may refer to Figure 3 description, which will not be elaborated here.

[0153] Next, in combination with the above system structure, taking zooming as an example, the processing mechanism of the camera request generated by the electronic device 100 based on the user's operation for changing the focal length will be specifically described:

[0154] ①. The electronic device 100 receives the user's operation to start the camera application and issues a camera request 0 for obtaining a preview image.

[0155] ②. The electronic device 100 turns on the camera and obtains the image frame 0 captured by the camera based on the camera request.

[0156] The above steps ① and ② can refer to the descriptions of steps ① and ② above Figure 3 and will not be elaborated here.

[0157] ③. The electronic device 100 sends the image frame 0 captured by the camera to the application framework layer, and the application framework layer renders the image frame 0.

[0158] The electronic device 100 sends the image frame 0 captured by the camera to the image cropping module in the application framework layer. The image cropping module can obtain the control parameters included in the camera parameters of the current camera request from the shooting parameter generation module. In some scenarios, since the electronic device 100 does not receive user operations, such as operations to change the camera zoom ratio, during the process from the start of the camera application on the electronic device 100 to the acquisition of the image frame 0 by the electronic device 100 and the display of the image frame 0. Therefore, the control parameters of the current frame obtained by the image cropping module are the same as the control parameters in the image frame, and the image cropping module can send the image frame 0 to the rendering process module. The rendering process module can render the image frame 0.

[0159] ④. The electronic device 100 displays the image frame 0.

[0160] Step ④ can refer to the description of step ④ above Figure 3 and will not be elaborated here.

[0161] ⑤. The electronic device 100 receives the zoom operation 1 from the user and issues the camera request 1.

[0162] ⑥. The electronic device 100 receives the zoom operation 2 from the user and issues the camera request 2.

[0163] Steps ⑤ and ⑥ can refer to the descriptions of steps ⑤ and ⑥ above Figure 3 and will not be elaborated here.

[0164] Exemplarily, the zoom operation 1 can be that the user sets the zoom ratio of the camera application to zoom1. Correspondingly, the zoom ratio in the camera parameters carried in the camera request 1 is zoom1. The zoom operation 2 can be that the user changes the zoom ratio of the camera application from zoom1 to zoom2. Correspondingly, the zoom ratio in the camera parameters carried in the camera request 2 is zoom2.

[0165] ⑦. The electronic device 100 obtains the image frame 1 corresponding to the camera request 1, determines that the control parameters in the image frame 1 are inconsistent with the camera parameters of the current camera request, and processes the image frame 1 into the image frame 2.

[0166] The electronic device 100 can process the camera request 1 and obtain the image frame 1 corresponding to the camera request 1. How the electronic device 100 obtains the image frame 1 can refer to the description of how the electronic device 100 obtains the image frame 0 in steps ①-③ above, which will not be elaborated here. Figure 3 in the above steps ①-③, the description of the electronic device 100 obtaining the image frame 0, which will not be elaborated here.

[0167] After the HAL of the electronic device 100 sends the obtained image frame 1 to the image cropping module in the application framework layer, the image cropping module can determine whether the control parameters (such as the zoom ratio) of the image frame 1 are consistent with the control parameters in the current camera request (such as the camera request 2). Since the zoom ratio of the image frame 1 is zoom1 and the zoom ratio in the camera request 2 is zoom2, the image cropping module can determine that the control parameters of the image frame 1 are inconsistent (also referred to as different) from the control parameters in the current camera request. Then, the image cropping module can process the image frame 1 to obtain the image frame 2. The size of the image frame 2 is the same as that of the image frame 1, and the control parameters in the image frame 2 are consistent with the control parameters in the current camera request. For example, if the current camera request is the camera request 2 and the zoom ratio in the camera request 2 is zoom2, then the zoom ratio of the image frame 2 is also zoom2.

[0168] In the embodiment of the present application, the current camera request refers to the camera request issued by the electronic device 100 at the moment closest to the time when the HAL returns the image frame to the image cropping module in the application framework layer before the electronic device 100 sends the image frame obtained by the HAL for display.

[0169] ⑧. The electronic device 100 displays the image frame 2.

[0170] The electronic device 100 can display the image frame 2. Specifically, after the image cropping module processes the image frame 1 to obtain the image frame 2, the image cropping module can send the image frame 2 to the rendering process module. The rendering process module can render and synthesize the image frame 2, and then send the rendered and synthesized image frame 2 to the display through the display driver. The display can display the image frame 2.

[0171] It is understandable that after the HAL finishes processing the camera requests sent to the HAL before Camera Request 2, the HAL will send the camera parameters in Camera Request 2 to the camera module through the camera driver. The camera module can capture an image frame according to the camera parameters in Camera Request 2 and send the image frame to the HAL layer. The HAL layer uploads it to the image cropping module. The image cropping module needs to determine whether the camera parameters of the image frame are consistent with the camera parameters in the current camera request. If they are consistent, the image cropping module directly sends the image frame to the rendering process module. If they are inconsistent, the image cropping module processes the image frame. For the specific processing process, reference can be made to the process of processing Image Frame 1 into Image Frame 2 by the image cropping module, which will not be elaborated here.

[0172] The following combines Figure 5A and Figure 5B The software and hardware frameworks shown are used as an example where the user changes the current zoom ratio on the shooting interface of the camera application after the camera application is launched, and a camera request processing method provided in the embodiments of the present application is introduced in detail.

[0173] Figure 6 FIG. shows a schematic diagram of the interaction between software and hardware modules of a camera request processing method in an embodiment of the present application.

[0174] As Figure 6 shown, the electronic device 100 may include a camera application, an application framework layer (FWK), a hardware abstraction layer (HAL), and a hardware layer. Among them, the application framework layer may include a shooting parameter generation module 610, an image cropping module 620, and a rendering process module 630. The hardware abstraction layer may include a camera hardware abstraction layer 640. The hardware layer may include a camera module and a display.

[0175] Among them, when processing a camera request, the interaction process between the software and hardware modules of the electronic device 100 may include the following steps:

[0176] S601. Detect an operation to start the camera and start the camera application.

[0177] The electronic device 100 may detect an operation to start the camera. For example, as Figure 1 shown, the user can click on the camera application icon 103. In response to this user operation, the camera application is started, and the shooting interface of the camera application is displayed, such as Figure 2A the shooting interface 200 shown.

[0178] S602. The camera application sends Camera Request 0 (zoom ratio is zoom0) to the shooting parameter generation module 610.

[0179] After the camera application is launched, the camera application can send multiple camera requests for obtaining preview image frames to the application framework layer. Among them, the multiple camera requests can include camera request 0. The zoom ratio corresponding to camera request 0 can be zoom0.

[0180] zoom0 can be the default zoom ratio after the camera application is launched. For example, 1x. zoom0 can also be the zoom ratio set by the user before closing the camera application last time. This application embodiment does not make any limitation in this regard. This application embodiment also does not make any limitation on the specific value of zoom0.

[0181] The camera application can send camera request 0 to the shooting parameter generation module 610 in the application framework layer.

[0182] The shooting parameter generation module 610 can obtain the control parameters in camera request 0. Or when detecting that the user adjusts the shooting parameters, generate a smooth adjustment curve based on the initial shooting parameters and the target shooting parameters sent by the camera application. And determine one or more transition control parameters based on the frame return time of the image frame and the smooth adjustment curve.

[0183] S603a. The shooting parameter generation module 610 sends the current zoom ratio zoom0 to the image cropping module 620.

[0184] In a possible implementation manner, the shooting parameter generation module 610 can obtain the current zoom ratio zoom0 from camera request 0 and send the zoom ratio zoom0 to the image cropping module 620. It can be understood that what the shooting parameter generation module 610 sends to the image cropping module 620 is not only the zoom ratio 0, but also all the control parameters in camera request 0 can be sent to the image cropping module 620.

[0185] Optionally, in a possible implementation manner, the shooting parameter generation module 610 can obtain camera parameter 0 from camera request 0. Camera parameter 0 can include external camera parameters and internal camera parameters (which can also be called control parameters). The shooting parameter generation module 610 can send camera parameter 0 or the control parameters in camera parameter 0 to the image cropping module 620.

[0186] S603b. The shooting parameter generation module 610 sends camera request 0 (with a zoom ratio of zoom0) to the camera hardware abstraction layer 640.

[0187] Exemplarily, refer to Figure 5B , in the shooting parameter generation module 610, camera request 0 (with a zoom ratio of zoom0) can be sent to the request queue processing module. Then, the request queue processing module can send camera request 0 to the camera hardware abstraction layer 640.

[0188] Optionally, in a possible implementation, the shooting parameter generation module 610 may extract the camera parameter 0 from the camera request 0, and then send the camera parameter 0 to the camera hardware abstraction layer 640 through the request queue processing module.

[0189] It can be understood that the embodiments of the present application do not limit the execution order of the above steps S603a and S603b. After the shooting parameter generation module 610 extracts the camera parameter 0 from the camera request 0, the shooting parameter generation module 610 may also first send the camera parameter 0 to the image cropping module 620. Then, the shooting parameter generation module 610 sends the camera parameter 0 or the camera request 0 to the camera hardware abstraction layer 640. Optionally, after the shooting parameter generation module 610 extracts the camera parameter 0 from the camera request 0, it may first send the camera parameter 0 or the camera request 0 to the camera hardware abstraction layer 640. Then, the shooting parameter generation module 610 sends the camera parameter 0 to the image cropping module 620. The embodiments of the present application do not limit this.

[0190] S604. The camera hardware abstraction layer 640 extracts the camera parameter 0 in the camera request 0.

[0191] In the case where the shooting parameter generation module 610 directly sends the camera request 0 to the camera hardware abstraction layer 640 through the request queue processing module, the camera hardware abstraction layer 640 may extract the camera parameter 0 in the camera request 0.

[0192] Optionally, in a possible implementation, when the shooting parameter generation module 610 extracts the camera parameter 0 from the camera request 0 and then sends the camera parameter 0 to the camera hardware abstraction layer 640 through the request queue processing module, the camera hardware abstraction layer may not execute step S604. That is to say, this step S604 is an optional step.

[0193] S605. The camera hardware abstraction layer 640 sends the camera parameter 0 to the camera module.

[0194] S606. The camera module acquires the image frame 0 (zoom ratio is zoom0) according to the camera parameter 0.

[0195] S607. The camera module sends the image frame 0 (zoom ratio is zoom0) to the camera hardware abstraction layer 640.

[0196] The camera hardware abstraction layer 640 can send camera parameter 0 to the camera driver. After receiving camera parameter 0, the camera driver can drive the electronic device 100 to turn on the camera module. The camera driver can send camera parameter 0 to the camera module. The camera module can obtain image frame 0 according to camera parameter 0. The zoom ratio of this image frame 0 is zoom0. The camera module can send image frame 0 to the camera hardware abstraction layer through the camera driver.

[0197] S608. The camera hardware abstraction layer sends image frame 0 (with a zoom ratio of zoom0) to the image cropping module 620.

[0198] The camera hardware abstraction layer can send image frame 0 to the image cropping module 620.

[0199] S609. The image cropping module 620 determines that the zoom ratio of image frame 0 is consistent with the current zoom ratio and displays image frame 0.

[0200] S610. The image cropping module 620 sends image frame 0 (with a zoom ratio of zoom0) to the rendering process module 630 for display.

[0201] S611. The rendering process module 630 sends image frame 0 (with a zoom ratio of zoom0) to the display for display.

[0202] S612. The display displays image frame 0 (with a zoom ratio of zoom0).

[0203] After receiving image frame 0, the image cropping module 620 can compare the zoom ratio in image frame 0 with the zoom ratio in the current camera request. In some scenarios, after the camera application is started, if there is no user zoom operation, the camera application can continuously send camera requests for obtaining preview image frames periodically according to the default zoom ratio. Before the image consumption data module obtains image frame 0, the image cropping module 620 can obtain the zoom ratio in the current camera request. Since the zoom ratio in the camera application has not changed, the image cropping module can determine that the zoom ratio of image frame 0 is consistent with the zoom ratio in the current camera request. Then, the image cropping module can send this image frame 0 to the rendering process module 630 for display. That is, the image cropping module sends image frame 0 to the rendering process module 630.

[0204] After receiving image frame 0, the rendering process module 630 can render and synthesize image frame 0 and send the rendered and synthesized image frame 0 to the display through the display driver. The display can display the rendered and synthesized image frame 0.

[0205] S613. The camera application detects that the user performs zoom operation 1 to change the zoom ratio of the camera application to zoom1.

[0206] S614. In response to zoom operation 1, the camera application sends camera request 1 (with a zoom ratio of zoom1) to the shooting parameter generation module 610.

[0207] The camera application can detect zoom operation 1 in which the user changes the zoom ratio of the camera application to zoom1. In response to this zoom operation 1, the camera application can send camera request 1 to the shooting parameter generation module 610.

[0208] Steps S613 and S614 can refer to the description of step ⑤ above Figure 3 and will not be elaborated here.

[0209] S615a. The shooting parameter generation module 610 sends the current zoom ratio zoom1 to the image cropping module 620.

[0210] The shooting parameter generation 610 can send the current zoom ratio zoom1 to the image cropping module 620. Step S615a can refer to the description in step S603a above and will not be elaborated here.

[0211] S615b. The shooting parameter generation module 610 sends camera request 1 (with a zoom ratio of zoom1) to the camera hardware abstraction layer 640.

[0212] Exemplarily, see Figure 5B , the shooting parameter generation module 610 can send camera request 1 (with a zoom ratio of zoom1) to the request queue processing module. Then, the request queue processing module can send camera request 1 to the camera hardware abstraction layer 640.

[0213] Optionally, in a possible implementation, the shooting parameter generation module 610 can extract camera parameter 1 from camera request 1, and then send camera parameter 1 to the camera hardware abstraction layer 640 through the request queue processing module.

[0214] It can be understood that the embodiments of the present application do not limit the execution order of the above steps S615a and S615b. After the shooting parameter generation module 610 extracts camera parameter 1 from camera request 1, the shooting parameter generation module 610 can also first send camera parameter 1 to the image cropping module 620. Then, the shooting parameter generation module 610 sends camera parameter 1 or camera request 1 to the camera hardware abstraction layer 640. Optionally, after the shooting parameter generation module 610 extracts camera parameter 1 from camera request 1, it can first send camera parameter 1 or camera request 1 to the camera hardware abstraction layer 640. Then, the shooting parameter generation module 610 sends camera parameter 1 to the image cropping module 620. The embodiments of the present application do not limit this.

[0215] S616. The camera hardware abstraction layer 640 extracts the camera parameter 1 in the camera request 1.

[0216] In the case where the shooting parameter generation module 610 directly sends the camera request 1 to the camera hardware abstraction layer 640, the camera hardware abstraction layer 640 can extract the camera parameter 1 in the camera request 1.

[0217] Optionally, in a possible implementation, when the shooting parameter generation module 610 extracts the camera parameter 1 from the camera request 1 and then sends the camera parameter 1 to the camera hardware abstraction layer 640, the camera hardware abstraction layer may not execute step S604. That is to say, this step S604 is an optional step.

[0218] S617. The camera hardware abstraction layer 640 sends the camera parameter 1 to the camera module.

[0219] S618. The camera module acquires the image frame 1 (the zoom ratio is zoom1) according to the camera parameter 1.

[0220] S619a. The camera module sends the image frame 1 (the zoom ratio is zoom1) to the camera hardware abstraction layer 640.

[0221] The camera hardware abstraction layer 640 can send the camera parameter 1 to the camera driver. After receiving the camera parameter 1, the camera driver can drive the electronic device 100 to turn on the camera module. The camera driver can send the camera parameter 1 to the camera module. The camera module can acquire the image frame 1 according to the camera parameter 1. The zoom ratio of this image frame 1 is zoom1. The camera module can send the image frame 1 to the camera hardware abstraction layer through the camera driver.

[0222] S619b. The camera application detects that the user performs the zoom operation 2 to change the zoom ratio of the camera application to zoom2.

[0223] S619c. In response to the zoom operation 2, the camera application sends the camera request 2 (the zoom ratio is zoom2) to the shooting parameter generation module 610.

[0224] S619d. The shooting parameter generation module 610 sends the current zoom ratio zoom2 to the image cropping module 620.

[0225] The camera application can detect that the user performs the zoom operation 2 to change the zoom ratio of the camera application to zoom2. In response to this zoom operation 2, the camera application can send the camera request 2 to the shooting parameter generation module 610. The shooting parameter generation module 610 can send the current zoom ratio zoom2 to the image cropping module 620.

[0226] It can be understood that the shooting parameter generation module 610 can send all the control parameters in the camera request 2 to the image cropping module 620. The control parameters of the camera request 2 include the current zoom ratio zoom2.

[0227] Steps S619b and S619c can refer to the description of step ⑥ above, which will not be elaborated here. Step S619d can refer to the description in step S603a above, which will not be elaborated here. Figure 3 It can be understood that the embodiments of the present application do not limit the execution order of steps S619a and S619b. That is to say, the electronic device 100 can detect the user's zoom operation 2 before the camera module sends the image frame 1 to the camera hardware abstraction layer. The electronic device 100 can also detect the user's zoom operation 2 at any moment after step S614 and before step S619a. The embodiments of the present application do not limit this.

[0228]

[0229] Optionally, the user may not input the zoom operation 2. The camera application can sequentially send the camera request 1 and the camera request 2 after detecting the user's zoom operation 1. The camera application can also determine the corresponding zoom ratio value in the camera request 1 and the corresponding zoom ratio value in the camera request 2 based on the zoom operation 1. The embodiments of the present application do not limit this.

[0230] S620. The camera hardware abstraction layer 640 sends the image frame 1 (with a zoom ratio of zoom1) to the image cropping module 620.

[0231] The camera hardware abstraction layer can send the image frame 1 to the image cropping module 620.

[0232] S621. The image cropping module 620 determines that the zoom ratio of the image frame 1 is inconsistent with the current zoom ratio, and processes the image frame 1 into an image frame 2 (with a zoom ratio of zoom2).

[0233] After receiving the image frame 1, the image cropping module 620 can compare the zoom ratio in the image frame 1 with the zoom ratio in the current camera request. Before the image cropping module 620 obtains the image frame 1, the image cropping module 620 can obtain the zoom ratio in the current camera request. Since the zoom ratio in the camera application changes from zoom1 to zoom2, the image cropping module 620 can determine that the zoom ratio of the image frame 1 is inconsistent with the zoom ratio in the current camera request. Then, the image cropping module 620 can process the image frame 1 into an image frame 2, and the zoom ratio of the image frame 2 is zoom2.

[0234] ​In a possible implementation, the image cropping module 620 processes the image frame 1 into the image frame 2, which may include: the image cropping module 620 crops the image frame 1 to obtain the image frame 3; then, the image cropping module 620 scales the image frame 3 to obtain the image frame 2.

[0235] Further, in a possible implementation, the relationship between the field of view (FOV) and size of the image frame 3 and the FOV and size of the image frame 1 can be seen in the following formulas:

[0236] FOV of the image frame 3 = FOV of the image frame 1 (Formula 1)

[0237] Size of the image frame 3 = Size of the image frame 1 * (Zoom magnification value of the image frame 1 / Zoom magnification value of the current user operation) (Formula 2)

[0238] As shown in Formula 1 above, the FOV of the cropped image frame (i.e., the image frame 3) is equal to the FOV of the original image (i.e., the image frame 1).

[0239] In Formula 2, "*" represents the multiplication sign and " / " represents the division sign. When cropping the image frame 1, the electronic device 100 can multiply the size of the image frame 1 by the proportionality coefficient 0 to obtain the size of the image frame 3. This proportionality coefficient 0 is determined by the zoom magnification value of the image frame 1 and the zoom magnification value of the current user operation. Specifically, the proportionality coefficient 0 is equal to the zoom magnification value of the image frame 1 divided by the zoom magnification value of the current user operation. When the zoom magnification value of the image frame 1 (e.g., zoom1) is equal to the zoom magnification value of the current user operation (e.g., zoom operation 2) (e.g., zoom2), the size of the image frame 3 is equal to the size of the image frame 1. When the zoom magnification value of the image frame 1 is greater than the zoom magnification value of the current user operation, the size of the image frame 3 is greater than the size of the image frame 1. When the zoom magnification value of the image frame 1 is less than the zoom magnification value of the current user operation, the size of the image frame 3 is less than the size of the image frame 1.

[0240] Further, in a possible implementation, the relationship between the field of view (FOV) and size of the image frame 2 and the FOV and size of the image frame 3 can be seen in the following formulas:

[0241] FOV of the image frame 2 = FOV of the image frame 3 * (Zoom magnification value of the current user operation / Zoom magnification value of the image frame 1) (Formula 3) Size of the image frame 2 = Size of the image frame 3 * (Zoom magnification value of the current user operation / Zoom magnification value of the image frame 1) (Formula 4)

[0242] As shown in Formula 3 and Formula 4, the FOV of Image Frame 2 is obtained by multiplying the FOV of Image Frame 3 by Scaling Factor 1, and the size of Image Frame 2 is also obtained by multiplying Image Frame 3 by Scaling Factor 1. Scaling Factor 1 is equal to the zoom magnification value of the current user operation divided by the zoom magnification value of Image Frame 1. Scaling Factor 0 and Scaling Factor 1 are reciprocals of each other.

[0243] Further, in a possible implementation, based on the above Formula 1, Formula 2, Formula 3, and Formula 4, the relationship between the field of view (FOV) and size of Image Frame 2 and the FOV and size of Image Frame 1 can be determined. The specific relationship between the field of view (FOV) and size of Image Frame 2 and the FOV and size of Image Frame 1 can be seen in the following formulas:

[0244] FOV of Image Frame 2 = FOV of Image Frame 1 * (zoom magnification value of the current user operation / zoom magnification value of Image Frame 1) (Formula 5)

[0245] Size of Image Frame 2 = Size of Image Frame 1 (Formula 6)

[0246] As shown in the above Formulas 5 and 6, compared with the original image, i.e., Image Frame 1, when the zoom magnification value of the current user operation is different from the zoom magnification value of Image Frame 1, the FOV of Image Frame 2 is different from the FOV of Image Frame 1. The FOV of Image Frame 2 can be determined by the FOV of Image Frame 1, the zoom magnification value of the current user operation, and the zoom magnification value of Image Frame 1.

[0247] It can be understood that the FOV of Image Frame 2 is the same as the FOV of the image frame obtained by the electronic device 100 according to the zoom magnification value of the current user operation. Exemplarily, taking the current user operation as the above Camera Request 2 and the zoom magnification value of the current user operation as zoom2 as an example. The FOV of Image Frame 2 is the same as the FOV of the image frame obtained by the electronic device 100 according to zoom2. Therefore, in the embodiments of the present application, the zoom magnification value of Image Frame 2 can also be referred to as zoom2.

[0248] S622. The Image Cropping Module 620 sends Image Frame 2 (with a zoom magnification of zoom2) to the Rendering Process Module 630.

[0249] S623. The Rendering Process Module 630 sends Image Frame 2 (with a zoom magnification of zoom2) to the display.

[0250] S624. The display displays Image Frame 2 (with a zoom magnification of zoom2).

[0251] The Image Cropping Module 620 can send Image Frame 2 to the Rendering Process Module 630 for display. That is, the Image Cropping Module sends Image Frame 2 to the Rendering Process Module 630.

[0252] After receiving the image frame 2, the rendering process module 630 can render and synthesize the image frame 2, and send the rendered and synthesized image frame 2 to the display through the display driver. The display can display the rendered and synthesized image frame 2.

[0253] It can be understood that after the HAL of the electronic device 100 finishes processing the camera request 1 and returns the image frame 1. The HAL can process the camera request 2 and obtain the image frame corresponding to the camera request 2. Specifically, the HAL will send the camera parameters in the camera request 2 to the camera module through the camera driver. The camera module can capture an image frame according to the camera parameters in the camera request 2 and send the image frame to the HAL layer. The HAL layer uploads it to the image cropping module. The image cropping module needs to determine whether the camera parameters of the image frame are consistent with the camera parameters in the current camera request. If they are consistent, the image cropping module directly sends the image frame to the rendering process module. If they are inconsistent, the image cropping module processes the image frame. For the specific processing process, reference can be made to the process of the image cropping module processing the image frame 1 into the image frame 2, which will not be elaborated here.

[0254] The electronic device 100 can process the camera request 2 according to the process of processing the camera request 1 as described above, which will not be elaborated here.

[0255] It can be understood that after the electronic device 100 receives the user's zoom operation 1 and before receiving the user's zoom operation 2, the electronic device 100 can receive one or more zoom operations. In response to the one or more zoom operations, the electronic device 100 can issue one or more camera requests. The electronic device 100 can process the one or more camera requests according to the process of processing the camera request 1 as described above.

[0256] In this way, through the method provided by the embodiments of the present application, when the user performs a zoom operation in the camera application of the electronic device 100, the electronic device 100 does not wait for the HAL to obtain the image frame corresponding to the zoom operation from the camera module according to the zoom operation and then display the image frame corresponding to the zoom operation. Instead, directly at the application framework layer, the image frame output by the electronic device at other zoom ratios before the zoom operation is processed to obtain a processed image frame. The zoom ratio of the processed image frame is the same as the zoom ratio of the current zoom operation. Then, the electronic device 100 can display the processed image frame. In this way, the followability of camera zoom can be improved. The user can see the image frame with the zoom ratio corresponding to the zoom operation faster, thereby improving the user experience.

[0257] Exemplarily, such as Figure 7As shown, the camera application in the electronic device 100 can sequentially send multiple zoom requests to the application framework layer FWK. For example, zoom request 1, zoom request 2, zoom request 3, zoom request 4, and so on. After FWK sequentially receives zoom request 1, zoom request 2, zoom request 3, and zoom request 4, FWK can sequentially send the camera parameters corresponding to each zoom request to HAL. The camera parameters can include the zoom value. The camera application can send multiple zoom requests after receiving a zoom operation from the user and determine the zoom value (i.e., the value of the zoom ratio) corresponding to each zoom request. Alternatively, the camera application can send a zoom request each time it receives a zoom operation from the user. The zoom value in the zoom request is determined by the camera application based on the user operation. As Figure 7 shown, the zoom value (i.e., the zoom ratio) corresponding to zoom request 1 can be 1.5x. The zoom value corresponding to zoom request 2 can be 1.6x. The zoom value corresponding to zoom request 3 can be 1.7x. The zoom value corresponding to zoom request 4 can be 1.8x. After the camera parameters corresponding to each zoom request are sent to HAL, HAL can process and return the corresponding image frame. After the camera application sends zoom request 4, HAL obtains image frame 1 according to the zoom value in zoom request 1, and the zoom ratio of image frame 1 is 1.5x. The electronic device 100 can crop and scale image frame 1 according to the latest zoom value, i.e., the zoom ratio 1.8x, to obtain image frame 2. The zoom ratio corresponding to image frame 2 is 1.8x. In this way, when the user sets the zoom ratio to 1.8x in the user interface of the camera, the user can see the image frame with a zoom ratio of 1.8x in the camera application faster, thereby improving the user experience.

[0258] In some examples, zoom request 1 can be camera request 1 in the above text, and zoom request 4 can be camera request 2 in the above text.

[0259] Figure 8 shows a schematic diagram of the effective curve of the zoom operation on the user corresponding to the camera request processing method provided in the embodiment of the present application and the camera request processing method in the prior art. As Figure 8 shown, curve 1 is a user point tangent Bezier curve generated according to different zoom operations (selecting different zoom ratios) of the user at different times. Curve 2 is a curve graph obtained by the effective time of the camera request processing method provided in the embodiment of the present application for the user's zoom operation. Curve 3 is a curve graph obtained by the effective time of the zoom operation on the user in the prior art. As Figure 8As shown, after the user inputs a zoom operation on the electronic device 100, according to the camera request processing method provided in the embodiments of the present application, the electronic device 100 can display an image frame corresponding to the zoom ratio of the zoom operation in approximately 65 ms (ms: time unit, representing milliseconds). In the prior art, the electronic device 100 needs to first process the camera requests before the zoom operation, and then process the camera requests issued in response to the zoom operation. The electronic device 100 needs to wait for the HAL to return the image frame obtained by the camera module according to the zoom ratio corresponding to the zoom operation before it can display the image frame corresponding to the zoom ratio of the zoom operation. From the time the electronic device 100 receives the user's zoom operation to the time it displays the image frame corresponding to the zoom ratio of the zoom operation, it takes approximately 180 ms. Compared with the prior art, the camera request processing method provided in the embodiments of the present application can improve the responsiveness of camera zooming.

[0260] In the embodiments of the present application, the first camera request may be one or more of camera request 1 and zoom request 1. The second camera request may be one or more of camera request 2 and zoom request 4. The first zoom ratio may be one or more of zoom1 and 1.5x. The second zoom ratio may be one or more of zoom2 and 1.8x. The first image frame may be image frame 1. The second image frame may be image frame 2. The first image frame under the second size may be image frame 3.

[0261] It can be understood that the application scenario of the camera request processing method provided in the embodiments of the present application is not limited to the scenario where the user changes the camera zoom ratio, and can also be applicable to the scenario where the user changes the shooting mode of the camera through other operations. For example, when the user inputs operations such as adding filters, turning on or off exposure, and setting focus in the camera, the electronic device can process the camera requests issued in response to the above user operations in the camera according to the camera request processing method shown above. Figure 6 By the camera request processing method provided in the embodiments of the present application, the electronic device can reduce the response delay for the user to change the shooting mode operation. In this way, the user experience can be improved.

[0262] The following introduces the exemplary electronic device 100 provided in the embodiments of the present application.

[0263] Figure 9 is a schematic structural diagram of the electronic device 100 provided in the embodiments of the present application.

[0264] The following takes the electronic device 100 as an example to specifically illustrate the embodiments. It should be understood that the electronic device 100 may have more or fewer components than those shown in the figure, may combine two or more components, or may have different component configurations. The various components shown in the figure may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application specific integrated circuits.

[0265] The electronic device 100 may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone interface 170D, 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. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light 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.

[0266] It can be understood that the structure schematically shown in the embodiments of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than those shown in the figure, or combine certain components, or split certain components, or have different component arrangements. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0267] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors.

[0268] Among them, the controller may be the nerve center and command center of the electronic device 100. The controller may generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching and executing instructions.

[0269] A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory may save the instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use the instruction or data again, it can directly call it from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0270] In some embodiments, the processor 110 may include one or more interfaces. The 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.

[0271] The I2C interface is a two-way synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple groups of I2C buses. The processor 110 may be respectively coupled to the touch sensor 180K, charger, flash, camera 193, etc. through different I2C bus interfaces. For example, the processor 110 may be coupled to the touch sensor 180K through the I2C interface, enabling the processor 110 to communicate with the touch sensor 180K through the I2C bus interface to implement the touch function of the electronic device 100.

[0272] The I2S interface can be used for audio communication. In some embodiments, the processor 110 may include multiple groups of I2S buses. The processor 110 may be coupled to the audio module 170 through the I2S bus to implement communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 may transmit audio signals to the wireless communication module 160 through the I2S interface to implement the function of answering a call through a Bluetooth headset.

[0273] The PCM interface can also be used for audio communication to sample, quantize, and encode analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 may be coupled through the PCM bus interface. In some embodiments, the audio module 170 may also transmit audio signals to the wireless communication module 160 through the PCM interface to implement the function of answering a call through a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.

[0274] The UART interface is a general-purpose serial data bus for asynchronous communication. This bus can be a two-way communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is generally used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function. In some embodiments, the audio module 170 may transmit audio signals to the wireless communication module 160 through the UART interface to implement the function of playing music through a Bluetooth headset.

[0275] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate through the CSI interface to implement the shooting function of the electronic device 100. The processor 110 and the display screen 194 communicate through the DSI interface to implement the display function of the electronic device 100.

[0276] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 to the camera 193, the display screen 194, the wireless communication module 160, the audio module 170, the sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0277] The SIM interface can be used to communicate with the SIM card interface 195 to implement the function of transmitting data to the SIM card or reading data from the SIM card.

[0278] The USB interface 130 is an interface that conforms to the USB standard specification. Specifically, it can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used for data transmission between the electronic device 100 and peripheral devices. It can also be used to connect headphones to play audio through the headphones. This interface can also be used to connect other electronic devices, such as AR devices, etc.

[0279] It can be understood that the interface connection relationship between the modules illustrated in the embodiments of the present invention is only for illustrative purposes and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 can also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

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

[0281] 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 the inputs from the battery 142 and / or the charging management module 140 and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, the wireless communication module 160, etc.

[0282] The wireless communication function of the electronic device 100 can be implemented by antenna 1, antenna 2, the mobile communication module 150, the wireless communication module 160, the modulation and demodulation processor, and the baseband processor, etc.

[0283] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization rate of the antennas. For example, antenna 1 can be multiplexed as the diversity antenna of the wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0284] The mobile communication module 150 can provide solutions for wireless communications such as 2G / 3G / 4G / 5G applied to the electronic device 100. The mobile communication module 150 can include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves by antenna 1, perform filtering, amplification, etc. on the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor and convert it into electromagnetic waves through antenna 1 for radiation. In some embodiments, at least some functional modules of the mobile communication module 150 can be provided 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 can be provided in the same device.

[0285] The modulation and demodulation processor can include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. Subsequently, the demodulator transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is transmitted to the application processor. The application processor outputs sound signals through an audio device (not limited to speaker 170A, receiver 170B, etc.), or displays images or videos through the display screen 194. In some embodiments, the modulation and demodulation processor can be an independent device. In some other embodiments, the modulation and demodulation processor can be independent of the processor 110 and be provided in the same device as the mobile communication module 150 or other functional modules.

[0286] The wireless communication module 160 may provide solutions for wireless communications applied to the electronic device 100, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite systems (GNSSs), frequency modulation (FM), near field communication (NFC), infrared (IR), etc. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering processing on the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 may also receive signals to be sent from the processor 110, perform frequency modulation and amplification on them, and convert them into electromagnetic waves through the antenna 2 for radiation.

[0287] 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 a network and other devices through wireless communication technologies. The wireless communication technologies may include Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time-Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technologies, etc. The GNSS may include Global Positioning System (GPS), Global Navigation Satellite System (GLONASS), BeiDou Navigation Satellite System (BDS), Quasi-Zenith Satellite System (QZSS), and / or Satellite Based Augmentation Systems (SBAS).

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

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

[0290] The electronic device 100 can implement the shooting function through the ISP, the camera 193, the video codec, the GPU, the display screen 194, and the application processor, etc.

[0291] The ISP is used to process the data fed back by the camera 193. For example, when taking a photo, the shutter is opened, and the light passes through the lens and is transmitted to the camera photosensitive element. The optical signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. The ISP can also perform algorithm optimization on the noise, brightness, and color of the image. The ISP can also optimize parameters such as the exposure and color temperature of the shooting scene. In some embodiments, the ISP can be set in the camera 193.

[0292] The camera 193 is used to capture static images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV, etc. format. In some embodiments, the electronic device 100 may include one or N cameras 193, where N is a positive integer greater than 1.

[0293] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform and the like on the frequency point energy.

[0294] The video codec is used to compress or decompress digital videos. The electronic device 100 can support one or more video codecs. In this way, the electronic device 100 can play or record videos in multiple coding formats, such as: Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0295] The NPU is a neural-network (NN) computing processor. By learning from the biological neural network structure, such as learning from the transmission mode between human brain neurons, it can quickly process the input information and can also continuously self-learn. Through the NPU, applications such as intelligent cognition of the electronic device 100 can be realized, such as: image recognition, face recognition, speech recognition, text understanding, etc.

[0296] 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 implement the data storage function. For example, files such as music and videos are saved in the external memory card.

[0297] The internal memory 121 can be used to store computer-executable program code, and the executable program code includes instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 can include a program storage area and a data storage area. Among them, the program storage area can store the operating system, applications required for at least one function (such as face recognition function, fingerprint recognition function, mobile payment function, etc.). The data storage area can store the data created during the use of the electronic device 100 (such as face information template data, fingerprint information template, etc.). In addition, the internal memory 121 can include high-speed random access memory and can also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.

[0298] The electronic device 100 can implement audio functions through the audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and the application processor, etc. Such as music playback, recording, etc.

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

[0300] The speaker 170A, also known as the "loudspeaker", is used to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or hands-free calls through the speaker 170A.

[0301] The receiver 170B, also known as the "earpiece", is used to convert an audio electrical signal into a sound signal. When the electronic device 100 answers a call or a voice message, the voice can be listened to by bringing the receiver 170B close to the human ear.

[0302] The microphone 170C, also known as the "microphone" or "transmitter", is used to convert a sound signal into an electrical signal. When making a call or sending a voice message, the user can speak by bringing the mouth close to the microphone 170C to input the sound signal into the microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In some other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also implement a noise reduction function. In some other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the sound source, and implement functions such as directional recording.

[0303] The headphone jack 170D is used to connect a wired headphone. The headphone jack 170D can be a USB interface 130, or a 3.5 mm open mobile terminal platform (OMTP) standard interface, or a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0304] The pressure sensor 180A is used to sense pressure signals and can convert pressure signals into electrical signals. In some embodiments, the pressure sensor 180A may be disposed on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor may include at least two parallel plates having conductive materials. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure based on the change in capacitance. When a touch operation acts on the display screen 194, the electronic device 100 detects the intensity of the touch operation according to the pressure sensor 180A. The electronic device 100 can also calculate the position of the touch based on the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities may correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, the instruction to view short messages is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, the instruction to create a new short message is executed.

[0305] The gyroscope sensor 180B can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., the x, y, and z axes) can be determined by the gyroscope sensor 180B. The gyroscope sensor 180B can be used for anti-shake shooting. Exemplarily, when the shutter is pressed, the gyroscope sensor 180B detects the angle of jitter of the electronic device 100, calculates the distance that the lens module needs to compensate according to the angle, and makes the lens offset the jitter of the electronic device 100 through reverse movement to achieve anti-shake. The gyroscope sensor 180B can also be used for navigation and somatosensory game scenarios.

[0306] The barometric pressure sensor 180C is used to measure barometric pressure. In some embodiments, the electronic device 100 calculates the altitude based on the barometric pressure value measured by the barometric pressure sensor 180C to assist in positioning and navigation.

[0307] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip leather case. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 can detect the opening and closing of the flip according to the magnetic sensor 180D. Furthermore, according to the detected opening and closing state of the leather case or the opening and closing state of the flip, features such as automatic flip unlocking are set.

[0308] The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in various directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the electronic device and is applied to applications such as horizontal and vertical screen switching and pedometers.

[0309] A distance sensor 180F is used to measure distance. The electronic device 100 can measure distance through infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure distance to achieve rapid focusing.

[0310] The proximity light sensor 180G may include, for example, a light-emitting diode (LED) and a light detector, such as a photodiode. The light-emitting diode may be an infrared light-emitting diode. The electronic device 100 emits infrared light outward through the light-emitting diode. The electronic device 100 uses the photodiode to detect the infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 can use the proximity light sensor 180G to detect that the user holds the electronic device 100 close to the ear for a call, so as to automatically turn off the screen to achieve the purpose of power saving. The proximity light sensor 180G can also be used for automatic unlocking and locking of the leather case mode and pocket mode.

[0311] The ambient light sensor 180L is used to sense the ambient light brightness. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the sensed ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in the pocket to prevent accidental touch.

[0312] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to achieve fingerprint unlocking, access application locks, fingerprint photography, fingerprint answering calls, etc.

[0313] The temperature sensor 180J is used to detect temperature. In some embodiments, the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 reduces the performance of the processor located near the temperature sensor 180J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to avoid abnormal shutdown of the electronic device 100 caused by low temperature. In other some embodiments, when the temperature is lower than yet another threshold, the electronic device 100 boosts the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.

[0314] The touch sensor 180K, also known as the "touch panel". The touch sensor 180K can be disposed on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also known as the "touch control screen". The touch sensor 180K is used to detect touch operations acting thereon or nearby. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In some other embodiments, the touch sensor 180K can also be disposed on the surface of the electronic device 100, at a different position from that of the display screen 194.

[0315] The keys 190 include a power-on key, volume keys, etc. The keys 190 can be mechanical keys or touch keys. The electronic device 100 can receive key inputs and generate key signal inputs related to the user settings and function control of the electronic device 100.

[0316] The motor 191 can generate vibration prompts. The motor 191 can be used for incoming call vibration prompts and can also be used for touch vibration feedback. For example, touch operations on different applications (such as taking pictures, playing audio, etc.) can correspond to different vibration feedback effects. Touch operations on different regions of the display screen 194 can also correspond to different vibration feedback effects for the motor 191. Different application scenarios (such as time reminder, receiving messages, alarm clock, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.

[0317] The indicator 192 can be an indicator light and can be used to indicate the charging state, power change, and can also be used to indicate messages, missed calls, notifications, etc.

[0318] The SIM card interface 195 is used to connect the SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to achieve contact and separation from the electronic device 100. The electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to achieve functions such as calls and data communication.

[0319] It can be understood that the structure schematically shown in the embodiments of the present invention does not constitute a specific limitation on the electronic device 100. Figure 9The illustrated electronic device 100 is merely an example. In some other embodiments of the present application, the electronic device 100 may include more or fewer components than those shown in the figure, or combine certain components, or split certain components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0320] As described above, the above embodiments are only used to illustrate the technical solutions of the present application and are not intended to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the various embodiments of the present application.

[0321] As used in the above embodiments, depending on the context, the term "when..." may be interpreted to mean "if...", or "after...", or "in response to determining...", or "in response to detecting...". Similarly, depending on the context, the phrase "when determining..." or "if detecting (the stated condition or event)" may be interpreted to mean "if determining...", or "in response to determining...", or "when detecting (the stated condition or event)", or "in response to detecting (the stated condition or event)".

[0322] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (such as coaxial cable, fiber optic, digital subscriber line) or wirelessly (such as infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that includes one or more available media integrated. The available medium may be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid-state drive), etc.

[0323] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by relevant hardware instructed by a computer program. This program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above method embodiments. The foregoing storage medium includes various media that can store program codes, such as ROM, random access memory (RAM), magnetic disks, or optical discs.

Claims

1. A method for processing camera requests, characterized in that, the method is applied to an electronic device equipped with a camera module, the electronic device includes a camera application, and the method includes: the first camera application issues a first camera request; the camera module in the electronic device obtains a first image frame according to the camera parameters in the first camera request, and the camera parameters include one or more of a zoom ratio, a focus parameter, an exposure parameter, and a filter parameter; the camera application issues a second camera request; in the case where it is determined that at least one camera parameter corresponding to the first image frame is different from the camera parameter corresponding to the second camera request, the first image frame is processed to obtain a second image frame, the camera parameter corresponding to the first image frame is the camera parameter in the first camera request, and the camera parameter corresponding to the second image frame is the same as the camera parameter in the second camera request; the camera application displays the second image frame.

2. The method according to claim 1, characterized in that, the step of processing the first image frame to obtain a second image frame in the case where it is determined that at least one camera parameter corresponding to the first image frame is different from the camera parameter corresponding to the second camera request includes: in the case where it is determined that the zoom ratio corresponding to the first image frame is different from the zoom ratio corresponding to the second camera request, changing the field of view (FOV) in the first image frame to obtain a second image frame.

3. The method according to claim 2, characterized in that, the step of changing the field of view (FOV) in the first image frame to obtain a second image frame includes: multiplying the field of view (FOV) of the first image frame by a first proportionality coefficient to obtain the second image frame; the first proportionality coefficient is the ratio of the zoom ratio corresponding to the second camera request to the zoom ratio corresponding to the first camera request.

4. The method according to claim 3, characterized in that, the FOV of the first image frame is the first FOV, the FOV of the second image frame is the second FOV, and the second FOV is the product of the first FOV and the first proportionality coefficient.

5. The method according to claim 4, characterized in that, the size of the first image frame is the first size, and in the case where it is determined that the zoom ratio corresponding to the first image frame is different from the zoom ratio corresponding to the second camera request, the step of changing the field of view (FOV) in the first image frame to obtain a second image frame specifically includes: cropping the first image frame from the first size to a second size; the second size is the product of the first size and a second proportionality coefficient, and the second proportionality coefficient is the reciprocal of the first proportionality coefficient; changing the first image frame from the first FOV to the second FOV at the second size; scaling the first image frame from the second size to the first size to obtain the second image frame.

6. The method according to claim 5, characterized in that, before the camera application issues the first camera request, the method further includes: Detect a first operation in which the user changes the zoom ratio of the camera application to a first zoom ratio; Before the camera application issues a second camera request, the method further includes: Detect a second operation in which the user changes the zoom ratio of the camera application to a second zoom ratio.

7. The method according to claim 6, wherein, the method further includes: After detecting the first operation, the camera application displays a first preview interface, and the first preview interface includes a zoom ratio control, and the zoom ratio control indicates that the zoom ratio value of the image frame displayed in the first preview interface is the first zoom ratio; After detecting the second operation, the camera application displays a second preview interface, and the second preview interface includes the zoom ratio control, and the zoom ratio control indicates that the zoom ratio value of the image frame displayed in the second preview interface is the second zoom ratio.

8. According to claim 7, wherein, The second image frame is displayed in the second preview interface, and the first proportionality coefficient is the ratio of the second zoom ratio to the first zoom ratio.

9. The method according to any one of claims 1-8, wherein, The electronic device includes a shooting parameter generation module and an image cropping module; The obtaining of the first image frame according to the camera parameters in the first camera request includes: The shooting parameter generation module extracts the camera parameters in the first camera request and sends them to the camera module; The camera module shoots a first image frame according to the camera parameters in the first camera request; The camera module sends the first image frame to the image cropping module.

10. The method according to claim 9, wherein, After the camera application issues a second camera request, the method further includes: The shooting parameter generation module extracts the camera parameters in the second camera request and sends them to the image cropping module.

11. The method according to claim 10, wherein, In the case where it is determined that at least one camera parameter corresponding to the first image frame is different from the corresponding camera parameter in the second camera request, processing the first image frame to obtain a second image frame includes: The image cropping module determines that at least one camera parameter corresponding to the first image frame is different from the corresponding camera parameter in the second camera request; The image cropping module processes the first image frame to obtain a second image frame.

12. The method according to claim 11, wherein, The electronic device further includes a rendering process module; after the image cropping module processes the first image frame to obtain a second image frame, the method further includes: The image cropping module sends the second image frame to the rendering process module; The rendering process module displays the second image frame; The camera application displays the second image frame.

13. The method according to any one of claims 10-12, wherein, After the camera application issues a second camera request, the method further includes: The camera module in the electronic device obtains a third image frame according to the camera parameters in the second camera request.

14. An electronic device, characterized in that, it includes a camera, one or more processors, and one or more memories; wherein, the camera, the one or more memories are coupled to the one or more processors, the one or more memories are used to store computer program code, the computer program code includes computer instructions, when the one or more processors execute the computer instructions, the method described in any one of claims 1-13 is executed.

15. A chip system, the chip system is applied to an electronic device, the chip system includes one or more processors, characterized in that, the processor is used to call computer instructions to execute the method described in any one of claims 1-13.

16. A computer-readable storage medium, including instructions, characterized in that, when the instructions run on an electronic device, the method described in any one of claims 1-13 is executed.