Photographing method, electronic equipment and storage medium

By introducing a shared memory mechanism into electronic devices, captured images can be stored and displayed directly in shared memory, solving the problem of time-consuming encoding and decoding, and improving image display speed and device efficiency.

CN121711560APending Publication Date: 2026-03-20HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411322489.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-20
Publication Date
2026-03-20

AI Technical Summary

Technical Problem

In existing technologies, electronic devices take a long time to encode and decode images after they are captured, which increases device overhead and results in a poor user experience.

Method used

By using a shared memory mechanism, captured images are stored directly in shared memory, and applications can directly retrieve and display them from shared memory, reducing the encoding and decoding process.

Benefits of technology

It speeds up image display, reduces device overhead, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121711560A_ABST
    Figure CN121711560A_ABST
Patent Text Reader

Abstract

The invention provides a photographing method, electronic equipment and a storage medium. The electronic device can add the shared memory, and after the first application calls the camera of the electronic device to shoot the picture, the electronic device can store the picture in the shared memory. When the picture is subsequently displayed on the electronic equipment, the electronic equipment can obtain and display the picture from the shared memory. According to the invention, the encoding and decoding processes are reduced, the picture display speed of the electronic equipment is accelerated, and the cost of the electronic equipment for executing the encoding and decoding processes is also reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of terminal technology, and in particular to a photographing method, electronic device, and storage medium. Background Technology

[0002] With the development of terminal technology, the number of applications installed on electronic devices is increasing. Users can use these applications to take photos / videos, watch movies and TV shows, listen to music, make phone calls, and so on, greatly improving the user experience.

[0003] For example, a user can take a picture using a camera app installed on an electronic device and encode it into a file, saving it in the device's memory. When the user needs to view the captured image, the gallery app can retrieve the file from the device's memory, decode it to obtain the image, and then display it. The user can then view the picture they just took in the gallery app. Generally, after taking a picture, the user will immediately check its quality. As can be seen from the above process, the display process requires encoding and decoding before the electronic device can display the image in the gallery app, which is time-consuming and adds extra overhead to the electronic device. Summary of the Invention

[0004] This application provides a method for taking pictures, an electronic device, and a storage medium. The electronic device can add shared memory; after a first application calls the electronic device's camera to take a picture, the electronic device can save the picture in the shared memory. When the electronic device displays the picture, it can retrieve and display the picture from the shared memory. This reduces the encoding and decoding process, speeds up the image display speed of the electronic device, and also reduces the overhead of the electronic device performing the encoding and decoding process.

[0005] In a first aspect, this application provides a method for taking a picture, the method comprising: an electronic device receiving a user's picture-taking operation; in response to the picture-taking operation, the electronic device acquiring a first image and storing the first image in the shared memory of the electronic device; and the electronic device displaying the first image, wherein the first image is acquired by the electronic device from the shared memory of the electronic device.

[0006] This method allows electronic devices to utilize shared memory. After an application uses the device's camera to capture an image, the device can store the image in shared memory. When displaying the image, the device can retrieve and display it from shared memory. This reduces the encoding and decoding processes, speeds up image display, and minimizes the overhead of encoding and decoding.

[0007] Optionally, the electronic device can receive a user's photo-taking action in a camera application. For example, see [reference needed]. Figures 3A-3C Description in the embodiments.

[0008] Electronic devices can also receive user photo-taking actions in the first application, such as an instant messaging application or a photo editing application. For example, see [reference needed]. Figure 3D-Figure 3N Description in the embodiments.

[0009] For an explanation of how electronic devices store the first image in the shared memory of the electronic device, please refer to [reference needed]. Figure 4 Description in the embodiments.

[0010] Optionally, the electronic device can retrieve and display the first image from its shared memory after receiving the user's action to take a photo and then after receiving the user's action to view the first image. For example, see [reference needed]. Figures 6A-6B , Figures 6C-6D , Figures 6E-6I Description in the embodiments.

[0011] Optionally, the electronic device may also automatically retrieve and display the first image from its shared memory after receiving a user's photo-taking action. For example, see [reference needed]. Figure 3I , Figure 3N Description in the embodiments.

[0012] In conjunction with the first aspect, in one possible implementation, the application in the electronic device accesses and obtains the first image corresponding to the shared memory object stored in the shared memory based on the shared memory object of the first image, whereby the shared memory object is used to indicate the storage location of the first image in the shared content.

[0013] In conjunction with the first aspect, in one possible implementation, the electronic device displays the first image, specifically including: a first application or gallery application in the electronic device obtains a shared memory object through a media library, the shared memory object being used to indicate the storage location of the first image in shared content; the first application or gallery application in the electronic device obtains the first image based on the shared memory object; and the first application displays the first image.

[0014] In this way, the first application or gallery application can retrieve the first image from shared memory through the media library.

[0015] For example, the first application could be an instant messaging application or a photo editing application.

[0016] For example, you can refer to how the first application or gallery application displays the first image. Figure 8A Description in the embodiments.

[0017] In conjunction with the first aspect, in one possible implementation, the first application or gallery application in the electronic device obtains a shared memory object through the media library, specifically including: the first application or gallery application in the electronic device receiving a first operation from the user to view a first image; in response to the first operation, the first application or gallery application in the electronic device obtains a shared memory object through the media library.

[0018] In this way, after receiving the user's request to view the first image, the electronic device can retrieve the first image from its shared memory and display it.

[0019] In conjunction with the first aspect, in one possible implementation, after storing the first image in the shared memory of the electronic device, the method further includes: the media library in the electronic device storing the shared memory object of the first image.

[0020] In this way, after receiving a user's photo-taking action, the electronic device can automatically retrieve and display the first image from the device's shared memory.

[0021] In conjunction with the first aspect, in one possible implementation, the first image stored in shared memory is an unencoded image.

[0022] In conjunction with the first aspect, in one possible implementation, the first image includes any one of the following formats: YUV, RGB, RGBA, and ARGB.

[0023] In conjunction with the first aspect, in one possible implementation, after the electronic device stores the first image in the shared memory of the electronic device, the method further includes: the electronic device encoding the first image into a first file and storing the first file in the memory of the electronic device.

[0024] In this way, after the electronic device stores the first image in its shared memory, it can directly encode the first image into a first file and store it in the memory. This avoids the situation where the first image stored in the shared memory is lost if the electronic device is suddenly turned off before it has stored it in the memory.

[0025] In some embodiments, after the electronic device encodes the first image into a first file and stores it in memory, the electronic device clears the first image stored in the shared memory after the electronic device is powered off.

[0026] In one possible implementation, if the electronic device has cleared the first image stored in the shared memory before it is powered off, the electronic device can automatically decode the first file into the first image and store it in the shared memory after it is powered on.

[0027] In one possible implementation, after the electronic device is powered on, if the electronic device has cleared the first image stored in the shared memory, when the electronic device receives an operation from the user to view the first image, the electronic device decodes the first file into the first image and stores it in the shared memory.

[0028] For example, you can refer to Figure 8B Description in the embodiments.

[0029] In conjunction with the first aspect, in one possible implementation, after the electronic device stores the first image in the shared memory of the electronic device, the method further includes: after the duration of the first image stored in the shared memory of the electronic device reaches a first duration, the electronic device encodes the first image into a first file and stores the first file in the memory of the electronic device.

[0030] In this way, if the user does not delete the first image after the first image stored in the shared memory has exceeded the first time limit, the electronic device can encode the first image into a first file and store it in the memory, that is, permanently save the first file.

[0031] Optionally, after the electronic device stores the first file in the electronic device's memory, the electronic device can also delete the first image stored in the shared memory.

[0032] In this way, electronic devices can promptly clear images stored in shared memory, thereby saving shared memory storage space.

[0033] For example, you can refer to Figure 8B Description in the embodiments.

[0034] In conjunction with the first aspect, in one possible implementation, after the electronic device stores the first image in the shared memory of the electronic device, the method further includes: the electronic device receiving a second operation from the user to save the first image; in response to the second operation, the electronic device encodes the first image into a first file and stores the first file in the memory of the electronic device.

[0035] In this way, after the duration of the first image stored in the shared memory exceeds the first duration, the electronic device can encode the first image into a first file and store it in the memory after receiving the second operation to save the first image.

[0036] Optionally, after the electronic device stores the first file in the electronic device's memory, the electronic device can also delete the first image stored in the shared memory.

[0037] In this way, electronic devices can promptly clear images stored in shared memory, thereby saving shared memory storage space.

[0038] For example, the second operation of saving the first image could be for... Figure 3I The input operation for sending option 3006 is shown. For example, the second operation of saving the first image could be for... Figure 3N The input operation for the save option 3013 shown.

[0039] You can refer to this. Figure 8A Description in the embodiments.

[0040] In conjunction with the first aspect, in one possible implementation, the first file includes either JPEG or HEIF format.

[0041] In conjunction with the first aspect, in one possible implementation, the method further includes: after the duration of the first image stored in the shared memory of the electronic device reaches a first duration, the electronic device deletes the first image stored in the shared memory.

[0042] In this way, once the duration of the first image stored in the shared memory exceeds the first time limit, the electronic device can promptly clear the images stored in the shared memory to save storage space.

[0043] In conjunction with the first aspect, in one possible implementation, after the electronic device displays the first image, the method further includes: the electronic device receiving a third operation from the user to delete the first image; in response to the third operation, the electronic device deleting the first image stored in the shared memory of the electronic device.

[0044] Thus, after the electronic device receives the third operation from the user to delete the first image, the electronic device then deletes the first image stored in the shared memory.

[0045] For example, the third operation to delete the first image could be... Figures 9A-9E The operations within.

[0046] For example, to illustrate how an electronic device deletes the first image stored in shared memory, please refer to [reference needed]. Figure 10 Description in the embodiments.

[0047] In conjunction with the first aspect, in one possible implementation, the method further includes: if the electronic device has encoded the first image into a first file and stored the first file in the memory of the electronic device, in response to the third operation, the electronic device also needs to delete the first file corresponding to the first image stored in the memory of the electronic device.

[0048] For example, to explain how an electronic device can delete the first file corresponding to the first image stored in its memory, please refer to [reference needed]. Figure 11 Description in the embodiments.

[0049] Thus, if the electronic device has already encoded the first image as a first file and stored it in its memory, after receiving the third operation from the user to delete the first image, the electronic device also needs to delete the first file corresponding to the first image stored in its memory. If the electronic device has not encoded the first image as a first file and stored it in its memory, after receiving the third operation from the user to delete the first image, the electronic device only needs to delete the first image stored in its shared memory.

[0050] In conjunction with the first aspect, in one possible implementation, the first application is an application that comes with the electronic device system, such as a gallery application, or the first application is a third-party application, such as an instant messaging application or a photo editing application.

[0051] In conjunction with the first aspect, in one possible implementation, the electronic device includes a camera sub-service; before the first application or gallery application in the electronic device obtains the shared memory object through the media library, the method further includes: the camera sub-service obtaining the shared memory object of the first image in the shared memory and sending the shared memory object to the media library.

[0052] In conjunction with the first aspect, in one possible implementation, the camera sub-service sends the shared memory object of the first image in shared memory to the media library. Specifically, this includes: the camera sub-service encapsulating the shared memory object of the first image in shared memory into a binder instruction; the camera sub-service sending the binder instruction to the media library; and the media library parsing the binder instruction to obtain the shared memory object of the first image in shared memory.

[0053] In this way, the camera sub-service can send the first image in shared memory to the media library across processes via the binder communication mechanism.

[0054] For example, you can refer to Figure 5 Description in the embodiments.

[0055] In conjunction with the first aspect, in one possible implementation, the electronic device includes a media library; the electronic device receives a third operation from a user to delete a first image, specifically including: the electronic device receiving the third operation from a user to delete the first image through a first application or a gallery application; in response to the third operation, the electronic device deletes the first image stored in the shared memory of the electronic device, specifically including: in response to the third operation, the first application or the gallery application sending a deletion instruction to the media library; in response to the deletion instruction, the media library deleting the first image stored in the shared memory of the electronic device.

[0056] For example, to illustrate how an electronic device deletes the first image stored in shared memory, please refer to [reference needed]. Figure 10 Description in the embodiments.

[0057] Secondly, this application provides an electronic device, which includes a memory and a processor; wherein the memory and the processor are coupled, the memory is used to store a computer program, and when the processor executes the computer program, it causes the electronic device to perform a photographing method provided in any possible implementation of the first aspect above.

[0058] Thirdly, this application provides a computer-readable storage medium including instructions that, when executed on an electronic device, cause the electronic device to perform a photographing method provided in any possible implementation of the first aspect above.

[0059] Fourthly, this application provides a chip system including one or more processors, which are used to invoke computer instructions to cause an electronic device to execute a photographing method provided in any possible implementation of the first aspect above.

[0060] Fifthly, this application provides a computer program product containing instructions that, when the computer program product is run on an electronic device, causes the electronic device to execute a photographing method provided in any possible implementation of the first aspect.

[0061] For a description of the beneficial effects in aspects two through five, please refer to the description of the beneficial effects in aspect one; this application will not repeat them here. Attached Figure Description

[0062] Figure 1A This diagram illustrates how a camera application captures and saves images.

[0063] Figure 1B This illustration shows a user viewing the first image taken by the camera app through the gallery app;

[0064] Figure 1C This illustrates a user deleting the first file via the Gallery app;

[0065] Figure 2A A schematic diagram of the hardware structure of an electronic device 100 provided in this application is shown;

[0066] Figure 2B This is a software structure block diagram of the electronic device 100 according to an embodiment of this application;

[0067] Figures 3A-3N The UI diagram shows the first image captured and saved by the electronic device 100;

[0068] Figure 4 A schematic diagram of the method by which electronic device 100 saves a first image in the shared memory of electronic device 100 is shown;

[0069] Figure 5 This diagram illustrates how the camera subservice sends a shared memory object containing the first image to the media library.

[0070] Figures 6A-6B This shows a set of illustrations of viewing the first image in a gallery application;

[0071] Figures 6C-6D A set of schematic diagrams showing the first image viewed in the first application is shown;

[0072] Figures 6E-6I This shows another set of illustrations of viewing the first image in a gallery app;

[0073] Figure 7 This diagram illustrates a method for an electronic device 100 to receive a user's view of a first image in a first application or a gallery application.

[0074] Figure 8A A flowchart illustrating a method for an electronic device 100 to save a first file corresponding to a first image is shown.

[0075] Figure 8B This illustrates a flowchart of a method for saving a first file corresponding to a first image using another electronic device 100.

[0076] Figure 8C This diagram illustrates a method flow diagram of another electronic device 100 receiving a user's view of a first image in a first application or gallery application;

[0077] Figures 9A-9B This illustration shows a user deleting the first image captured by the camera from the first application in the Gallery app.

[0078] Figures 9C-9E This illustration shows the first image captured by the camera when the user deletes the first application.

[0079] Figure 10 A flowchart illustrating a method for an electronic device 100 to receive a user's operation to delete a first image and to delete the first image stored in shared memory;

[0080] Figure 11 A flowchart illustrating a method by which an electronic device 100 receives a user's operation to delete a first image and deletes a first file stored in its memory;

[0081] Figure 12 This is a flowchart illustrating a photographing method provided in this application. Detailed Implementation

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

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

[0084] The term "user interface (UI)" used in the following embodiments of this application refers to the medium interface through which an application or operating system interacts and exchanges information with a user. It realizes the conversion between the internal form of information and the form that the user can accept. The most common form of user interface is the graphical user interface (GUI), which refers to a user interface related to computer operation displayed in a graphical manner. It can be visual interface elements such as text, icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, and widgets displayed on the screen of a wearable device.

[0085] First, we will introduce the process of taking pictures with electronic devices, saving pictures, and viewing pictures by users, using camera and gallery applications as examples.

[0086] Figure 1A This diagram illustrates how a camera application captures and saves images.

[0087] like Figure 1A As shown, electronic device 100 may include an application layer, an application framework layer, and a hardware layer. The application layer may include multiple applications installed on electronic device 100, such as a camera application and a gallery application. The application framework layer may include camera sub-services and a media library. The hardware layer may include a camera and memory.

[0088] The process of capturing and saving the first image using a camera application can be shown in the following steps:

[0089] 1. The camera application receives the user's photo-taking action.

[0090] 2. The camera application sends a photo-taking command to the camera sub-service.

[0091] 3. The camera sub-service sends a photo-taking command to the camera.

[0092] 4. The camera acquires the first image and sends it to the camera sub-service.

[0093] For example, the first image can be in RGB format, RGBA format, YUV format, etc.

[0094] 5. The camera sub-service sends the first image to the camera application.

[0095] 6. The camera application encodes the first image into a first file and sends the first file to the media library.

[0096] Since the data stored in the memory needs to be stored in the form of a file, the first image cannot be stored directly in the memory. The camera application needs to encode the first image into a first file and then store the first file in the memory.

[0097] For example, the first file can be in JPEG format.

[0098] 7. The media library stores the first file in memory.

[0099] In some embodiments, after a user takes a first picture using a camera app, the user can view the first picture in a gallery app.

[0100] Figure 1B This illustration shows a user viewing the first image taken by the camera app through the gallery app.

[0101] 1. The gallery application receives the user's request to view the first image.

[0102] For example, viewing the first image could be done by clicking on the thumbnail of the first image.

[0103] 2. The gallery app sends a viewing command to the media library.

[0104] 3. In response to the view command, the media library retrieves the first file from memory.

[0105] 4. The media library sends the first file to the gallery application.

[0106] 5. The gallery application decodes the first file to obtain the first image and displays the first image.

[0107] from Figures 1A-1B As can be seen, after the camera application captures the first image, it encodes the first image into a first file and saves it in the memory of the electronic device 100.

[0108] Generally, after a camera app takes a picture, the user will immediately check the effect of the first picture.

[0109] When a user needs to view the first image taken, for example when the user clicks on the thumbnail of the first image, the gallery app needs to retrieve the first file from the electronic device's memory, decode the first file to obtain the first image, and then display the first image. The user can then view the first image that was just taken in the gallery app.

[0110] The process of displaying the first image in the aforementioned photo gallery app involves both encoding and decoding, which is time-consuming. After the user clicks on the thumbnail of the first image, the gallery app needs to decode the first file into the first image, and the user has to wait for a period of time before the gallery app can display the first image, resulting in a poor user experience. Furthermore, the aforementioned encoding and decoding processes also increase the overhead of the electronic device.

[0111] In some embodiments, after a user views a first image in a gallery application, if the user is not satisfied with the image's quality, the electronic device 100 can receive a user's request to delete the first image.

[0112] Figure 1C This illustration shows a user deleting the first file through the Gallery app.

[0113] 1. The gallery application receives the user's request to delete the first image.

[0114] 2. The gallery application sends a delete command to the media library.

[0115] 3. The media library sends a deletion command to the storage.

[0116] 4. In response to the delete command, the memory deletes the first file.

[0117] from Figures 1B-1C As can be seen, if a user is not satisfied with the shooting effect of the first image after viewing it, they can choose to delete it. The gallery application can delete the first file stored in the memory through the media library. However, deleting the first file stored in the memory through the media library is a file system I / O operation, which is a time-consuming operation and will increase the overhead of the electronic device by 100%.

[0118] Based on the above analysis, this application provides a method for taking a picture, in which the electronic device 100 can create shared memory. A first application and a gallery application can access the data stored in the shared memory. After the first application takes a picture using the camera, it can save the acquired first image in the shared memory. When the electronic device 100 receives a user's operation to view the first image in the gallery application or the first application, the gallery application or the first application can retrieve the first image from the shared memory and display it.

[0119] In this way, when a user needs to view the first application, the gallery application or the first application can obtain the first image from shared memory without having to retrieve the first file from storage or perform the step of decoding the first file to obtain the first image. This speeds up the process of the gallery application or the first application obtaining the first image and also saves the gallery application or the first application from the steps of obtaining the first image.

[0120] In some embodiments, the electronic device 100 can encode a first image stored in shared memory into a first file and save the first file in memory. This allows the electronic device 100 to permanently save the first file, preventing the loss of the first image stored in shared memory after the electronic device 100 is powered off.

[0121] Optionally, after waiting for a first period of time, if the user does not delete the first image, the electronic device 100 can then encode the first image into a first file and save the first file in its memory. This avoids the situation where the user is dissatisfied with the shooting effect of the first image and needs to delete it; the electronic device 100 only needs to delete the first image stored in the shared memory, saving the electronic device 100 operations.

[0122] In some embodiments, the first image stored in shared memory by the electronic device 100 can be cleared after a first storage period has elapsed, in order to save storage space in the shared memory.

[0123] Figure 2A A schematic diagram of the hardware structure of an electronic device 100 provided in this application is shown.

[0124] Electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, antenna 1, antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a sensor module 180, a display screen 194, a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include one or more sensors, such as a gyroscope sensor 180B, a magnetic sensor 180D, an accelerometer sensor 180E, a proximity sensor 180F, a touch sensor 180K, etc. In some embodiments, the sensor module 180 may also include one or more of the following sensors: a pressure sensor, a barometric pressure sensor, a proximity sensor, a fingerprint sensor, a temperature sensor, an ambient light sensor, a bone conduction sensor, etc.

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

[0126] Processor 110 may include one or more processing units, such as application processors (APs), modem processors, graphics processing units (GPUs), image signal processors (ISPs), controllers, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). These different processing units may be independent devices or integrated into one or more processors.

[0127] The controller can generate operation control signals based on the instruction opcode and timing signals to complete the control of instruction fetching and execution.

[0128] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can directly retrieve it from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system. In some embodiments, the processor 110 may include one or more interfaces, such as a universal serial bus (USB) interface.

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

[0130] The charging management module 140 receives charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 receives charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 receives wireless charging input via the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also supply power to the electronic device via the power management module 141.

[0131] The power management module 141 connects the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, providing power to the processor 110, internal memory 121, display screen 194, and wireless communication module 160, etc. The power management module 141 can also monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage current, impedance). In some other embodiments, the power management module 141 may also be located within the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may be located in the same device.

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

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

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

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

[0136] 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, enabling electronic device 100 to communicate with networks and other devices via wireless communication technology. The wireless communication technology 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 the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the BeiDou Navigation Satellite System (BDS), the Quasi-Zenith Satellite System (QZSS), and / or satellite-based augmentation systems (SBAS).

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

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

[0139] Internal memory 121 may include one or more random access memory (RAM) and one or more non-volatile memory (NVM).

[0140] The random access memory can be directly read and written by the processor 110. It can be used to store executable programs (such as machine instructions) of the operating system or other running programs, as well as user and application data.

[0141] Non-volatile memory can also store executable programs and user and application data, and can be pre-loaded into random access memory for direct reading and writing by the processor 110.

[0142] The external memory interface 120 can be used to connect to external non-volatile memory, thereby expanding the storage capacity of the electronic device 100. The external non-volatile memory communicates with the processor 110 through the external memory interface 120 to perform data storage functions. For example, music, video, and other files can be stored in the external non-volatile memory.

[0143] Electronic device 100 can implement audio functions, such as making calls and recording, through audio module 170, speaker 170A, receiver 170B, microphone 170C, and application processor.

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

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

[0146] The receiver 170B, also known as the "earpiece," is used to convert audio electrical signals into sound signals. When the electronic device 100 answers a telephone call or voice message, the receiver 170B can be brought close to the ear to listen to the voice.

[0147] Microphone 170C, also known as a "microphone" or "voice transducer," is used to convert sound signals into electrical signals. When making a phone call or sending a voice message, the user can speak by bringing their mouth close to microphone 170C, inputting the sound signal into microphone 170C. Electronic device 100 may have at least one microphone 170C. In some embodiments, electronic device 100 may have two microphones 170C, which, in addition to collecting sound signals, can also perform noise reduction. In other embodiments, electronic device 100 may also have three, four, or more microphones 170C, which can collect sound signals, reduce noise, identify the sound source, and perform directional recording, etc.

[0148] The gyroscope sensor 180B can be used to determine the motion attitude of the electronic device 100. In some embodiments, the gyroscope sensor 180B can determine the angular velocity of the electronic device 100 about three axes (i.e., the x, y, and z axes). The gyroscope sensor 180B can be used for image stabilization. For example, when the shutter is pressed, the gyroscope sensor 180B detects the angle of the shake of the electronic device 100, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to counteract the shake of the electronic device 100 by moving in the opposite direction, thus achieving image stabilization. The gyroscope sensor 180B can also be used in navigation and motion-sensing game scenarios.

[0149] 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 cover.

[0150] The 180E accelerometer can detect the magnitude of acceleration of electronic device 100 in various directions (typically three axes). When electronic device 100 is stationary, it can detect the magnitude and direction of gravity. It can also be used to identify the posture of electronic devices and applied to applications such as screen orientation switching and pedometers.

[0151] A distance sensor 180F is used to measure distance. Electronic device 100 can measure distance via infrared or laser. In some embodiments, during a shooting scene, electronic device 100 can utilize the distance sensor 180F to measure distance for rapid focusing.

[0152] Touch sensor 180K, also known as a "touch device," can be located on display screen 194. The touch sensor 180K and display screen 194 together form a touchscreen, also known as a "touchscreen." Touch sensor 180K detects touch operations applied to or near it. 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 display screen 194. In other embodiments, touch sensor 180K may also be located on the surface of electronic device 100, in a different position than display screen 194.

[0153] In some embodiments, the electronic device 100 may further include one or more of buttons, a motor, and an indicator. Buttons may include a power button, volume buttons, etc. Buttons may be mechanical buttons or touch buttons. The electronic device 100 can receive button input and generate key signal inputs related to user settings and function control of the electronic device 100. The motor may generate vibration cues. The indicator may be an indicator light, which can be used to indicate charging status, battery level changes, and can also be used to indicate messages, missed calls, notifications, etc.

[0154] The SIM card interface 195 is used to connect the SIM card.

[0155] The software system of electronic device 100 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture.

[0156] Figure 2B This is a software structure block diagram of an electronic device 100 according to an embodiment of this application.

[0157] A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, from top to bottom, these layers are the application layer, application framework layer, system libraries, and kernel layer.

[0158] The application layer can include a series of application packages.

[0159] like Figure 2B As shown, the application package may include applications such as the first application and the gallery application.

[0160] The first application can be a camera application installed on the electronic device 100, or it can be a third-party application installed on the electronic device 100, such as an instant messaging application or a photo editing application. The first application can receive user input to call the camera of the electronic device 100 to take a picture and obtain the first image.

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

[0162] like Figure 2B As shown, the application framework layer can include camera sub-services, media libraries, shared memory modules, etc.

[0163] The camera sub-service can receive the photo-taking command sent by the first application, and then send the photo-taking command to the camera so that the camera can capture the first image.

[0164] The camera sub-service can also receive the first image returned by the camera and save it in shared memory via the shared memory module. The camera sub-service is also used to retrieve the shared memory object of the first image in shared memory and transfer this object to the media library via a cross-process service.

[0165] When the first application or the gallery application receives a user's command to view the first image captured by the camera of the electronic device 100, the first application or the gallery application can send a command to the media library. In response to this command, the media library can send the shared memory object of the first image to the first application or the gallery application. The first application or the gallery application can then retrieve the first image from shared memory based on the shared memory object of the first image through the shared memory module and display the first image.

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

[0167] A system library can include multiple functional modules. For example, a media library.

[0168] The kernel layer is the layer between hardware and software. At a minimum, the kernel layer contains display drivers, camera drivers, audio drivers, and sensor drivers. The camera driver enables the camera to capture images.

[0169] The hardware layer may include, but is not limited to, cameras and memory. The camera is used to capture images based on the photo-taking command sent by the camera sub-service. The memory is used to store the corresponding files for the images.

[0170] like Figure 2B As shown, the method by which the first application receives a user's photo-taking action and saves the first image in shared memory includes, but is not limited to, the following steps:

[0171] 1. The first application receives the user's photo-taking action.

[0172] 2. The first application sends a photo-taking command to the camera sub-service.

[0173] 3. The camera sub-service sends a photo-taking command to the camera.

[0174] 4. In response to the photo-taking command, the camera acquires the first image and sends it to the camera sub-service.

[0175] 5. The camera sub-service sends the first image to the shared memory module.

[0176] 6. The camera sub-service saves the first image in shared memory through the shared memory module.

[0177] 7. The camera sub-service obtains the shared memory object of the first image and sends the shared memory object of the first image to the media library.

[0178] like Figure 2B As shown, the methods by which the gallery application receives a user's action to view the first image and displays the first image include, but are not limited to, the following steps:

[0179] 8. The gallery application receives the user's request to view the first image.

[0180] 9. The Gallery app sends a viewing command to the Media Library.

[0181] 10. In response to the view command, the media library sends the shared memory object of the first image to the gallery application.

[0182] In response to the shared memory object of the first image, the gallery application retrieves the first image from shared memory based on the shared memory object of the first image and displays the first image.

[0183] Optionally, users can view the first image not only through the gallery app, but also through the first app.

[0184] The following section provides a detailed description of the photography method mentioned in this application, using UI diagrams and flowcharts.

[0185] 1. The application calls the camera of electronic device 100 to capture the first image and saves the first image to shared memory.

[0186] Optionally, the first image can be image data or video data; this application does not limit this. Image data can be data acquired by the electronic device 100 in photo mode, and video data can be data acquired by the electronic device 100 in video recording mode. The following embodiments of this application will only use image data as an example for illustration.

[0187] For example, the application can be a camera app or a third-party app, such as an instant messaging app or a photo editing app.

[0188] Figures 3A-3N The UI diagram shows the first image captured and saved by the electronic device 100.

[0189] in, Figures 3A-3C The UI diagram shows how the electronic device 100 captures and saves the first image through a camera application.

[0190] like Figure 3A As shown, the electronic device 100 can display a desktop, on which a page containing application icons is displayed. This page includes multiple application icons (e.g., settings application icon, app store application icon, gallery application icon, browser application icon, etc.). Below the multiple application icons, a page indicator is also displayed to indicate the positional relationship between the currently displayed page and other pages. Below the page indicator, a tray area is displayed. The tray area includes multiple tray icons, such as camera application icon, contacts application icon, phone application icon, and messaging application icon. The tray area remains displayed when switching pages. In some embodiments, the page may also include multiple application icons and a page indicator. The page indicator may not be part of the page and may exist independently. The tray icons are also optional, and this embodiment does not limit this.

[0191] Electronic device 100 can receive user input (e.g., a click) on a camera application icon, and in response to this input, electronic device 100 can display, for example... Figure 3B The user interface shown. Figure 3B This is a user interface for shooting and display services provided by an electronic device 100 according to an embodiment of this application, and can also be called a shooting preview interface.

[0192] like Figure 3B As shown, the preview interface may include a mode bar 101, shooting controls 102, a preview window 103, a playback control 104, a quick function area 105, and a focus adjustment option 106.

[0193] The mode bar 101 may include multiple shooting mode options, such as "Night Scene," "Portrait," "Photo," and "Video." Different shooting modes provide users with different shooting effects. Users can select any of the multiple shooting modes to shoot according to different needs. For example, "Photo" can be the default shooting mode for taking photos. "Video" is used for recording videos. "Night Scene" mode is suitable for shooting scenes with low light, such as at night. "Portrait" mode is suitable for shooting scenes where the subject is a person. Electronic device 100 may also provide more shooting modes, such as "Large Aperture," "Movie," and "Professional," which will not be listed here.

[0194] The electronic device 100 can detect user operations performed on the shooting mode options in the mode bar 101, and change the currently used shooting mode according to the user operations. These user operations include, for example, left / right swipes. For instance, when the device detects a left swipe (left swipe) on the mode bar 101, causing the cursor to stop at the "Portrait" option, the electronic device 100 can switch to "Portrait" mode. By default, the electronic device 100 first uses "Photo" mode.

[0195] The shooting control 102 is used to trigger a photo capture. The electronic device 100 can detect whether there is a user operation on the shooting control 102, such as a click. When in photo capture mode and a user operation on the shooting control 102 is detected, the electronic device 100 can generate a photo capture command. The electronic device 100 can acquire the image reported by the camera with the corresponding timestamp according to the photo capture command and save the image. Similarly, when in video recording mode and a user operation on the shooting control 102 is detected, the electronic device 100 can generate a video capture command. The electronic device 100 can acquire the video data reported by the camera with the corresponding timestamp according to the video capture command and save the video data.

[0196] The preview window 103 can be used to display images reported by the camera in real time. In different shooting modes, the electronic device 100 can process the images reported by the camera to improve the image display effect. For example, in "portrait" mode, the electronic device 100 can blur the background in the image reported by the camera to highlight the portrait. Here, the preview window 103 can display images processed by image processing algorithms corresponding to different shooting modes in real time, allowing users to perceive the shooting effects corresponding to different shooting modes in real time.

[0197] The playback control 104 can be used to browse thumbnails of captured images. When a user action is detected on the playback control 104, the electronic device 100 can also display the original image corresponding to the thumbnail. In some embodiments, when the electronic device 100 receives a user action on the playback control 104, if the gallery application process is not running, the electronic device 100 can launch the gallery application process, allowing the electronic device 100 to jump to the gallery application to display the original image corresponding to the thumbnail.

[0198] The quick access area 105 may include controls for the main character recording mode, AI scene recognition, flash, color mode, and settings. The main character recording mode control can be used to trigger the electronic device 100 to identify the main character among multiple people in the preview screen when enabled. The AI ​​scene recognition control can be used to trigger the electronic device 100 to identify the shooting scene in the preview screen when enabled; currently, the AI ​​scene recognition control is disabled. The flash control can be used to trigger the electronic device 100 to turn the flash on or off. The color mode control can be used to trigger the electronic device 100 to process the image captured by the camera using a color filter. The settings control can be used to set the shooting parameters of the electronic device 100 (e.g., image size, image storage format, etc.), enable the "automatic capture" function of the electronic device 100, etc.

[0199] The focus adjustment option 106 shows several zoom ratio options, such as 0.5x zoom ratio, 1x zoom ratio, 2.5x zoom ratio, and 10x zoom ratio.

[0200] The current zoom level is 1x. Preview window 103 displays image frames captured by electronic device 100 at a 1x zoom level.

[0201] For example, such as Figure 3B As shown, the electronic device 100 can receive user input operations on the shooting control 102, such as a click operation. In response to the user's input operation, the electronic device 100 can obtain a first image based on the camera. For example, the first image can be an image reported by the camera with a corresponding timestamp obtained by the electronic device 100 according to the shooting command.

[0202] After acquiring the first image, the electronic device 100 also saves the first image in the shared memory of the electronic device 100.

[0203] For example, such as Figure 3C As shown, the electronic device 100 is also used to generate a thumbnail of the first image and display the thumbnail of the first image. Figure 3C The playback control 104 shown.

[0204] In some embodiments, a user can operate within an instant messaging application to enable the instant messaging application to access the camera of the electronic device 100 to acquire a first image and send the first image to a contact.

[0205] Figure 3D-Figure 3N The UI diagram shows how an electronic device 100 takes and saves a first image via an instant messaging application.

[0206] For example, such as Figure 3D As shown, the electronic device 100 displays a desktop. For Figure 3D For the description, please refer to Figure 3A The description in the text. Figure 3D and Figure 3A The difference is that, Figure 3D The desktop shown also includes icons for instant messaging applications.

[0207] like Figure 3D As shown, the electronic device 100 can receive user input operations on the icon of an instant messaging application, such as a click operation. In response to the user's input operation, the electronic device 100 can display... Figure 3E The user interface shown. Figure 3E The user interface shown includes multiple dialog boxes.

[0208] For example, such as Figure 3E As shown, the electronic device 100 can receive user input for one of the dialog boxes, such as a click operation. In response to the user's input, the electronic device 100 can display... Figure 3F The user interface shown.

[0209] For example, such as Figure 3F As shown, Figure 3F The user interface shown includes chat messages sent by multiple members in the group chat. Figure 3F The user interface shown also includes function option 3001, which allows users to send pictures and videos to multiple members in the group chat, initiate video calls, etc.

[0210] For example, such as Figure 3F As shown, the electronic device 100 can receive user input for the function option 3001, such as a click operation. In response to the user's input, the electronic device 100 can display... Figure 3G The function block 3002 is shown.

[0211] For example, such as Figure 3GAs shown, the function box 3002 includes options such as photo, take picture / video, initiate video call, send location, send red envelope, transfer money, voice input, and view favorites. Users can use the photo option to send pictures saved in the gallery application to multiple members in the group chat. Users can also use the take picture / video option to call the camera of electronic device 100 to take pictures / videos and send them to multiple members in the group chat. Users can also use the initiate video call option to establish a video call connection with one or more members in the group chat. Users can also use the send location option to send the location information of electronic device 100 to multiple members in the group chat. Users can also use the send red envelope option to send red envelopes to multiple members in the group chat. Users can also use the transfer money option to transfer money to a member in the group chat. Users can also use the voice input option to have electronic device 100 capture the user's voice output through the microphone and send the user's voice output to multiple members in the group chat. Users can also use the view favorites option to view pictures, videos, voice messages, text messages, files, etc., saved on electronic device 100.

[0212] like Figure 3G As shown, the electronic device 100 can receive user input operations regarding the option to capture pictures / videos, such as a click operation. In response to the user's input operation, the electronic device 100 can display... Figure 3H The shooting interface shown. Figure 3H The shooting interface shown includes a real-time preview image 3003 captured by the camera of the electronic device 100 and a shooting control 3004.

[0213] like Figure 3H As shown, the electronic device 100 can receive user input operations on the shooting control 3004, such as a click operation. In response to the user's input operation, the electronic device 100 can display a first image captured by its camera. For example, the first image could be... Figure 3I The image shown is 3005.

[0214] If the user is satisfied with the captured image 3005, the electronic device 100 can receive the user's input operation for the send option 3006, such as a click operation. In response to the user's input operation, the electronic device 100 can send image 3005 to multiple members in the group chat and display it. Figure 3J The user interface shown.

[0215] like Figure 3J As shown, Figure 3JThe user interface shown includes image 3007, which instructs the local user "Leo" to send an image to multiple members in a group chat. Optionally, image 3007 can be a thumbnail of image 3005. The electronic device 100 can receive the user's click on image 3007 and display image 3007.

[0216] Optional, in display Figure 3I After the user interface shown is accessed, the electronic device 100 can save the image 3005 in the shared memory of the electronic device 100. After the electronic device 100 receives the user's input operation for the send option 3006, the electronic device 100 then encodes the image 3005 into a file and saves it in the memory of the electronic device 100.

[0217] Optional, in display Figure 3I After the user interface shown, the electronic device 100 can save only the image 3005 in the shared memory of the electronic device 100.

[0218] Optionally, after receiving input from the user regarding the sending option 3006, the electronic device 100 may also save the first image in the shared memory of the electronic device 100.

[0219] In some embodiments, if the user is not satisfied with the shooting effect of image 3005, the electronic device 100 receives the user's feedback. Figure 3I After the user confirms that they will not send pictures 3005 to multiple members in the group chat, the electronic device 100 may not save the first picture in the shared memory of the electronic device 100.

[0220] In some embodiments, the user can operate within the Meitu app to enable the Meitu app to access the camera of the electronic device 100 to obtain a first image and save the first image in the shared memory of the electronic device 100.

[0221] Electronic device 100 can take a first picture through the Meitu app and optimize the first picture, such as by adding filters, so that the effect of the first picture taken by electronic device 100 through the Meitu app meets the user's expectations.

[0222] Figures 3K-3N The UI image shown is of the first image captured and saved by the electronic device 100 through the Meitu app.

[0223] For example, such as Figure 3K As shown, the electronic device 100 displays a desktop. For Figure 3K For the description, please refer to Figure 3A The description in the text. Figure 3K and Figure 3AThe difference is that, Figure 3K The desktop shown also includes an icon for the Meitu app.

[0224] like Figure 3K As shown, the electronic device 100 can receive user input operations on the Meitu app icon, such as a click operation. In response to the user's input operation, the electronic device 100 can display... Figure 3L The user interface shown. Figure 3L The user interface shown includes multiple shooting mode options and shooting controls 3008. These shooting mode options may include, but are not limited to, camera shooting options, image retouching options, mirrorless camera mode shooting options, retro film shooting options, ultra-high-definition portrait shooting options, trendy photo booth shooting options, ID photo shooting options, and AI emoji shooting options.

[0225] For example, such as Figure 3E As shown, the electronic device 100 can receive user input operations on the shooting control 3008, such as a click operation. In response to the user's input operation, the electronic device 100 can display... Figure 3M The shooting interface shown.

[0226] like Figure 3M As shown, the shooting interface may include a shooting control 3009, a preview image 3010, and several other shooting mode options. The electronic device 100 can receive user input operations on the shooting control 3009, such as a click operation. In response to the user's input operation, the electronic device 100 can display... Figure 3N The image preview interface shown.

[0227] like Figure 3N As shown, the image preview interface may include image 3011, which may be an image captured by the electronic device 100 using a camera. The image preview interface also includes a return option 3012, a save option 3013, and several other image editing options. The user can use the return option 3012 to make the electronic device 100 display... Figure 3M The shooting interface is shown. Users can save images 3011 via save option 3013.

[0228] In some embodiments, after acquiring image 3011, electronic device 100 can save image 3011 to shared memory of electronic device 100. For example... Figure 3N As shown, the electronic device 100 can receive user input operations for the save option 3013, such as a click operation. In response to the user's input operation, the electronic device 100 can encode the image 3011 into a file and save the file in the memory of the electronic device 100.

[0229] In some embodiments, such as Figure 3N As shown, the electronic device 100 can receive user input operations for the save option 3013, such as a click operation. In response to the user's input operation, the electronic device 100 then saves the image 3011 to the shared memory and storage of the electronic device 100.

[0230] In some embodiments, when electronic device 100 receives user requests... Figure 3M After inputting the shooting control 3009 shown, the electronic device 100 can save the image 3011 to the shared memory of the electronic device 100, encode the image 3011 into a file, and save the file in the memory of the electronic device 100.

[0231] Optionally, after the electronic device 100 receives input from the user regarding the save option 3013, the electronic device 100 can display it again. Figure 3M The shooting interface shown.

[0232] Figure 4 A schematic diagram of the method by which electronic device 100 saves a first image in the shared memory of electronic device 100 is shown.

[0233] like Figure 4 As shown, the electronic device 100 may include an application layer, an application framework layer, a system library, and a hardware layer. The application layer includes a first application, the application framework layer includes a camera sub-service, a shared memory module, and a media library, and the hardware layer includes a camera and memory.

[0234] The method by which electronic device 100 saves the first image in the shared memory of electronic device 100 includes, but is not limited to, the following steps:

[0235] S401, The first application receives user input for taking photos.

[0236] For example, the first application can be a camera application, which receives the user's action of taking a photo. Figure 3B The input operation shown is for the shooting control 102.

[0237] For example, the first application could be an instant messaging application, and the first application could receive the user's action of taking a photo. Figure 3H The input operation shown is for the shooting control 3004.

[0238] For example, the first application could be a photo editing app, which receives the user's action of taking a photo. Figure 3E The input operation shown is for the shooting control 3008.

[0239] S402, The first application sends a photo-taking command to the camera sub-service.

[0240] S403, the camera sub-service sends a photo-taking command to the camera.

[0241] In response to a user's action to take a photo, the first application can send a photo-taking command to the camera sub-service, which then sends a photo-taking command to the camera. This photo-taking command instructs the camera to turn on and capture an image.

[0242] S404, In response to the photo capture command, the camera acquires the first image.

[0243] In response to a photo-taking command, the camera of electronic device 100 is activated and captures a first image. For example, reflected light from the subject passes through the lens, is refracted on the lens, and then converges onto the image sensor. The image sensor converts the light signal into an analog electrical signal. This analog electrical signal is bypassed from the image sensor and sensor front-end (SFE), then output via a digital-to-analog converter to produce a raw digital image, such as a RAW image. Electronic device 100 then processes the raw digital image to obtain the first image, which is an image that electronic device 100 can display; for example, the first image can be in RGB format, RGBA format, YUV format, etc.

[0244] S405, the camera sends the first image to the camera sub-service.

[0245] S406, the camera sub-service sends the first image to the shared memory module.

[0246] S407, the shared memory module sends the first image to the shared memory.

[0247] S408, save the first image in shared memory.

[0248] After capturing the first image, the camera can send the first image to the camera sub-service. The camera sub-service can then send the first image to the shared memory via the shared memory module and save it in the shared memory.

[0249] S409. Shared memory sends the shared memory object of the first image to the shared memory module.

[0250] S410, the shared memory module sends the shared memory object of the first image to the camera sub-service.

[0251] S411, the camera sub-service sends the shared memory object of the first image to the media library.

[0252] After the camera sub-service saves the first image to shared memory, the camera sub-service can obtain the shared memory object of the first image and send the shared memory object of the first image to the media library.

[0253] Optionally, the shared memory object of the first image can refer to the storage location of the first image in shared memory, such as the physical address of the first image in shared memory.

[0254] Optionally, the shared memory object of the first image can also be a file descriptor (FD) of the first image. The electronic device 100 can map the file descriptor of the first image based on its physical address in shared memory. Different data stored in shared memory have different physical addresses, and therefore different file descriptors.

[0255] The camera sub-service or media library can obtain the physical address of the first image in shared memory based on the file descriptor of the first image, and then obtain the first image based on the physical address of the first image in shared memory.

[0256] In this way, the data size of the file descriptor of the first image is less than the data size of the physical address of the first image in shared memory. The camera sub-service can send the file descriptor of the first image to the media library, thereby reducing the amount of data sent by the camera sub-service to the media library.

[0257] In some embodiments, after acquiring the first image, the camera sub-service can also send the first image to the first application, allowing the first application to display the first image. Thus, after receiving a user's photo-taking action, the first application does not need to receive a user's request to view the first image; it can automatically display the first image, allowing the user to preview the shooting effect. For example, see [reference needed]. Figure 3I or Figure 3N Example.

[0258] It should be noted that, Figure 4 The method steps and their execution order are used only to explain this application and do not constitute a limitation.

[0259] Figure 5 This diagram illustrates how the camera subservice sends the first image to the media library using a shared memory object.

[0260] like Figure 5 As shown, the electronic device 100 may include an application framework layer. The application framework layer includes a camera sub-service and a shared memory module, and the system library includes a media library.

[0261] The method by which electronic device 100 sends a shared memory object of the first image to a media library includes, but is not limited to, the following steps:

[0262] S501, the camera sub-service and the media library establish a cross-process communication connection.

[0263] Optionally, the media library can initiate the cross-process communication connection to the camera sub-service, or the camera sub-service can initiate the cross-process communication connection to the media library.

[0264] Optionally, after the media library is started, the media library can proactively initiate a cross-process communication connection with the camera sub-service. Alternatively, after the camera sub-service is started, the camera sub-service can proactively initiate a cross-process communication connection with the media library.

[0265] Optionally, after the electronic device 100 is powered on, the camera sub-service can establish a cross-process communication connection with the media library.

[0266] Optionally, after the first application receives the user's photo-taking action, the camera sub-service can establish a cross-process communication connection with the media library.

[0267] This application does not limit the timing of establishing cross-process communication connections between the camera subservice and the media library.

[0268] For example, the inter-process communication mechanism can be the Binder communication mechanism. Other mechanisms are also possible, and this application does not limit the scope of such mechanisms.

[0269] S502, the camera sub-service encapsulates the shared memory object of the first image into a binder instruction.

[0270] S503, the camera sub-service sends binder commands to the shared memory module.

[0271] S504, the shared memory module sends binder commands to the media library.

[0272] S505: The media library parses the binder instruction and obtains the shared memory object of the first image.

[0273] After obtaining the shared memory object of the first image, the camera sub-service can encapsulate the shared memory object of the first image into a binder instruction through the shared memory module, and send the binder instruction to the media library via inter-process communication. The media library can parse the binder instruction to obtain the shared memory object of the first image.

[0274] Figure 5 The method shown enables the camera subservice to send the shared memory object of the first image to the media library across processes.

[0275] 2. Electronic device 100 receives a user's view of the first image in the first application or gallery application.

[0276] After the first application receives the user's photo-taking operation and calls the camera to obtain the first image, and saves the first application in the shared memory of the electronic device 100, the electronic device 100 can receive the user's operation to view the first image.

[0277] Figures 6A-6B This shows a set of illustrations of viewing the first image in a gallery application.

[0278] For example, the first application could be a camera application. The first image could be... Figure 3C The original image of the thumbnail displayed in the playback control 104 shown.

[0279] refer to Figures 3A-3C As described in the embodiment, after the first application receives the user's photo-taking operation, acquires the first image, and saves the first image in shared memory, the first application can display... Figure 6A The shooting interface shown is... Figure 6A The playback control 104 in the shooting interface shows a thumbnail of the first image.

[0280] like Figure 6A As shown, the electronic device 100 can receive user input operations on the playback control 104, such as a click operation. In response to the user's input operation, the electronic device 100 can display... Figure 6B The user interface of the gallery application shown.

[0281] like Figure 6B As shown, the user interface includes image 7001, which can be... Figure 6A The thumbnail displayed in the middle of the view control 104 corresponds to the original image.

[0282] like Figure 6B As shown, the user interface includes not only image 7001, but also multiple image editing options, such as a return option, a share option, a favorite option, an edit option, a delete option, and more options. Users can use the return option to return to the camera application's shooting preview interface. Users can use the share option to share image 7001 to other applications on electronic device 100 or to other electronic devices. Users can use the favorite option to save image 7001 to their favorites on electronic device 100. Users can use the edit option to edit image 7001, such as cropping, rotating, adding filters and effects, etc. Users can use the delete option to delete image 7001. Users can perform other further operations on image 7001 using the more options.

[0283] Figures 6C-6D A set of schematic diagrams showing the first image viewed in the first application is shown.

[0284] For example, the first application could be an instant messaging application. The first image could be... Figure 3I The image shown is 3005.

[0285] refer to Figure 3D-Figure 3J As described in the embodiment, after the first application receives the user's photo-taking operation, acquires the first image, and saves the first image in shared memory, the first application can display... Figure 6C The user interface shown is Figure 6C The user interface shown contains image 3007, which can be a thumbnail of the first image.

[0286] like Figure 6C As shown, the electronic device 100 can receive user input operations on the image 3007, such as a click operation. In response to the user's input operation, the electronic device 100 can display... Figure 6D The user interface of the first application is shown.

[0287] like Figure 6D As shown, the user interface includes image 7002, which can be... Figure 6C The image shown is the original image corresponding to image 3007. Image 7002 is an image captured by the camera of electronic device 100.

[0288] Figures 6E-6I This shows another set of illustrations of viewing the first image in a gallery app.

[0289] For example, the first application could be the Meitu app. The first image could be... Figure 3N The image shown is 3011.

[0290] refer to Figures 3K-3N As described in the embodiment, after the first application receives the user's photo-taking operation, acquires the first image, and saves the first image in shared memory, the first application can display... Figure 3M or Figure 3N The user interface shown. Afterwards, the user can view the first image taken by the first application in the gallery application.

[0291] like Figure 6E As shown, the electronic device 100 can receive and respond to a user's swipe-up operation on the display screen, stop displaying the user interface of the first application, and display... Figure 6F The desktop shown.

[0292] like Figure 6F As shown, the electronic device 100 can respond to user input operations on the gallery application's icons, such as a click operation, and the electronic device 100 can display... Figure 6G The gallery interface shown. Figure 6GThe gallery interface shown includes multiple album category names, such as "All Photos", "Videos", "Camera", and "Buzz Shots".

[0293] like Figure 6G As shown, the electronic device 100 can respond to user input operations regarding "all photos," such as a click operation, and the electronic device 100 can display... Figure 6H The image preview interface shown is a collection of thumbnails for multiple images, such as thumbnail 7072, which can be a thumbnail of image 3011.

[0294] like Figure 6H As shown, the electronic device 100 can respond to user input operations on the thumbnail 7072, such as a click operation, and the electronic device 100 can display... Figure 6I The user interface of the gallery application shown. Figure 6I The user interface of the gallery application shown is... Figure 6B The user interface of the gallery app shown is similar, the difference being that... Figure 6I The user interface of the gallery application shown includes image 3011.

[0295] Figure 7 A schematic flowchart illustrating a method for an electronic device 100 to receive a user's view of a first image in a first application or a gallery application is shown.

[0296] like Figure 7 As shown, the electronic device 100 may include an application layer, an application framework layer, and a system library. The application layer includes a gallery application / first application, the application framework layer includes shared memory, and the system library includes a media library.

[0297] The method by which electronic device 100 receives information about a user viewing a first image in a first application or gallery application includes, but is not limited to, the following steps:

[0298] S701A, Gallery Application / First Application receives user actions to view the first image.

[0299] For example, the first application could be a camera application, and the gallery application could receive the user's action to view the first image. Figure 6A The input operation shown is for the playback control 104.

[0300] For example, the first application could be an instant messaging application, and the first application could receive user actions to view the first image. Figure 6C The input operation shown is for image 3007.

[0301] For example, the first application could be a Meitu app, and the gallery app could receive user input to view the first image. Figure 6H The input operation shown is for thumbnail 7072.

[0302] In some embodiments, S701A may not be executed. After the first application receives the user's photo-taking operation, the first application can directly acquire and display the first image, allowing the user to view the shooting effect of the first image in a timely manner.

[0303] For example, when the first application is an instant messaging application, such as Figure 3H and Figure 3I As shown, after the electronic device 100 receives input from the user regarding the shooting control 3004, the instant messaging application can acquire and display the first image. The first image can be... Figure 3I The image shown is 3005.

[0304] For example, when the first application is a Meitu app, such as Figure 3M and Figure 3N As shown, after the electronic device 100 receives input from the user onto the shooting control 3008, the Meitu application can acquire and display the first image. The first image can be... Figure 3N The image shown is 3011.

[0305] S702A, the Gallery app / first app sends a viewing command to the Media Library.

[0306] S703A, the media library sends the shared memory object of the first image to the gallery application / first application.

[0307] S704A, the gallery application / first application retrieves the first image based on the shared memory object of the first image.

[0308] Optionally, the gallery app / first app can retrieve the first image from shared memory based on the shared memory object of the first image via the shared memory module.

[0309] S705A, Gallery app / First app displays the first image.

[0310] In response to a viewing command sent by the gallery app / first app, the media library can obtain the shared memory object of the first image and send it to the gallery app / first app. The gallery app / first app can then retrieve the first image from the shared memory of the electronic device 100 based on the shared memory object of the first image.

[0311] After retrieving the first image, the gallery app / first app can display the first image.

[0312] For example, the first application could be a camera application, and the first image displayed by the gallery application could be... Figure 6B The image shown is 7001.

[0313] For example, the first application could be an instant messaging application, and the first image displayed by the instant messaging application could be... Figure 6D The image shown is 7002.

[0314] For example, the first application could be a Meitu app, and the first image displayed by the gallery app could be... Figure 6I The image shown is 3011.

[0315] pass Figure 7 The method shown allows the first application to save the first image in shared memory. When a user needs to view the image's capture effect, the first application or gallery application can retrieve and display the first image from the shared memory, allowing the user to view the capture effect within the first application or gallery application. When the first application or gallery application receives a user's request to view the first image, it can directly retrieve the first image from the shared memory of the electronic device 100, without needing to retrieve the first file from the storage device. On one hand, retrieving the first image from shared memory is faster and eliminates the need to decode the first file to obtain the first image, thus speeding up the display of the first image by the first application or gallery application. On the other hand, retrieving the first image from shared memory, without needing to decode the first file, also saves power consumption for the electronic device 100.

[0316] In some embodiments, after the electronic device 100 is powered off, the first image stored in the shared memory of the electronic device 100 is cleared, and the user cannot view the first image. To prevent the first image stored in the shared memory from being cleared, the electronic device 100 can encode the first image into a first file and save the first file to the memory. The first file stored in the memory will not be cleared after the electronic device 100 is powered off.

[0317] In some embodiments, after the electronic device 100 receives a user's photo-taking operation and stores the first image in shared memory, the electronic device 100 can automatically encode the first image into a first file and save the first file to the memory.

[0318] In some embodiments, after the duration of the first image shared in the internal storage of the electronic device 100 reaches a first duration, the electronic device 100 encodes the first image into a first file and saves the first file to the memory.

[0319] In other embodiments, after the first application receives the user's photo-taking operation and detects the user's operation to save the first image, the electronic device 100 encodes the first image into a first file and saves the first file to the memory.

[0320] The timing of saving the first file will be explained in detail below.

[0321] 1. After receiving the user's operation to save the first image, the electronic device 100 encodes the first image into a first file and saves the first file to the memory.

[0322] Figure 8A A flowchart illustrating a method for an electronic device 100 to save a first file corresponding to a first image is shown.

[0323] like Figure 8A As shown, the electronic device 100 may include an application layer, an application framework layer, and a hardware layer. The application layer includes a first application, the application framework layer includes a media library, and the hardware layer includes memory and shared memory.

[0324] The method by which electronic device 100 saves the first file corresponding to the first image includes, but is not limited to, the following steps:

[0325] S801A, the first application receives the user's operation to save the first image.

[0326] After receiving the user's photo-taking action and acquiring the first image, the first application can display the first image.

[0327] For example, the first application could be a Meitu app, and the first image could be... Figure 3N The image shown is 3011.

[0328] After the first image is displayed in the first application, the user can preview its appearance. Once the user is satisfied with the first image, the first application can accept the user's request to save it.

[0329] For example, the user action of saving the first image could be... Figure 3N The input operation shown is for save option 3013.

[0330] S802A, the first application sends a save command to the media library.

[0331] S803A, the media library obtains the first image based on the shared memory object of the first image.

[0332] In response to a user action to save the first image, the first application can send a save command to the media library.

[0333] After receiving the save command, the media library can retrieve the first image based on the shared memory object of the first image.

[0334] Optionally, the media library can obtain the first image through the shared memory module based on the shared memory object of the first image.

[0335] S804A, the media library encodes the first image into the first file.

[0336] S805A, the media library sends the first file to the storage.

[0337] S806A, the memory stores the first file.

[0338] Since the data stored in the memory needs to be stored in the form of a file, the first image cannot be stored directly in the memory. The camera application needs to encode the first image into a first file and then store the first file in the memory.

[0339] For example, the first file can be in JPEG format.

[0340] pass Figure 8A The method shown allows the electronic device 100 to determine whether to encode the first image into a first file and save it in memory based on user input. If the user confirms saving the first image, the electronic device 100 then encodes the first image into a first file and saves it in memory. If the user confirms not to save the first image, the electronic device 100 does not need to encode the first image into a first file, nor does it need to save the first file in memory. This avoids a situation where, if the user is dissatisfied with the effect of the first image, the electronic device 100 has already encoded the first image into a first file and saved it in memory, and then the electronic device 100 needs to perform a file read I / O operation to delete the first file stored in memory. Figure 8A The method shown can save power consumption of electronic device 100.

[0341] Optionally, after the electronic device 100 stores the first file corresponding to the first image in the memory, the electronic device 100 may delete the first image stored in the shared memory.

[0342] Optionally, after the electronic device 100 stores the first file corresponding to the first image in the memory, the electronic device 100 may not delete the first image stored in the shared memory. After the duration of the first image stored in the shared memory reaches the first duration, the electronic device 100 may delete the first image stored in the shared memory.

[0343] Optionally, after the electronic device 100 stores the first file corresponding to the first image in the memory, the electronic device 100 may not delete the first image stored in the shared memory. After receiving the user's operation to delete the first image, the electronic device 100 deletes the first image stored in the shared memory and simultaneously deletes the first file corresponding to the first image stored in the memory.

[0344] 2. After the first image is stored in the shared memory or after the duration of the first image stored in the shared memory reaches the first duration, the electronic device 100 encodes the first image into a first file and saves the first file to the memory.

[0345] Figure 8B A flowchart illustrating a method for another electronic device 100 to save a first file corresponding to a first image is shown.

[0346] like Figure 8B As shown, the electronic device 100 may include an application framework layer and a hardware layer. The application framework layer includes a media library, and the hardware layer includes memory and shared memory.

[0347] The method by which electronic device 100 saves the first file corresponding to the first image includes, but is not limited to, the following steps:

[0348] S801B: After the duration of the first image stored in shared memory exceeds a first duration, the media library retrieves the first image based on the shared memory object of the first image.

[0349] S802 B, The media library encodes the first image into a first file.

[0350] S803 B, The media library sends the first file to the storage.

[0351] S804 B, The memory stores the first file.

[0352] Once the duration of the first image stored in shared memory exceeds a certain duration, the media library can retrieve the first image from the shared memory based on the shared memory object of the first image, encode the first image into a first file, and store the first file in the storage.

[0353] For example, the first duration could be 20 seconds.

[0354] In this way, if the user performs the operation of deleting the first image within the first time period, the electronic device 100 only needs to delete the first image stored in the shared memory. Since the first file has not yet been stored in the memory, the electronic device 100 does not need to access the memory, which reduces the I / O operations of the electronic device 100 in reading the file from the memory and saves the power consumption of the electronic device 100.

[0355] Optionally, S801B can be omitted. After the electronic device 100 stores the first image in shared memory or the media library receives the shared memory object of the first image sent by the camera sub-service, the camera sub-service can encode the first image into a first file and store the first file in memory. This avoids the situation where the first image stored in the shared memory of the electronic device 100 is cleared after the electronic device 100 is suddenly turned off.

[0356] Optionally, after the electronic device 100 stores the first file corresponding to the first image in the memory, the electronic device 100 may delete the first image stored in the shared memory.

[0357] Optionally, after the electronic device 100 stores the first file corresponding to the first image in the memory, the electronic device 100 may not delete the first image stored in the shared memory. After receiving the user's operation to delete the first image, the electronic device 100 deletes the first image stored in the shared memory and simultaneously deletes the first file corresponding to the first image stored in the memory.

[0358] In some embodiments, if the duration of the first image stored in the shared memory of the electronic device 100 exceeds a first duration, the electronic device 100 has cleared the first image stored in the shared memory, and the electronic device 100 cannot retrieve the first image from the shared memory. The electronic device 100 can retrieve the first file from the memory and decode the first file to obtain the first image.

[0359] Figure 8C A flowchart illustrating a method by which another electronic device 100 receives a user's view of a first image in a first application or gallery application is shown.

[0360] like Figure 8C As shown, the electronic device 100 may include an application layer, an application framework layer, and a hardware layer. The application layer includes a gallery application / first application, the application framework layer includes a media library, and the hardware layer includes memory.

[0361] The method by which electronic device 100 receives information about a user viewing a first image in a first application or gallery application includes, but is not limited to, the following steps:

[0362] S801C, Gallery Application / First Application receives user input to view the first image.

[0363] For example, the first application could be a camera application, and the gallery application could receive the user's action to view the first image. Figure 6A The input operation shown is for the playback control 104.

[0364] For example, the first application could be an instant messaging application, and the first application could receive user actions to view the first image. Figure 6C The input operation shown is for image 3007.

[0365] For example, the first application could be a Meitu app, and the gallery app could receive user input to view the first image. Figure 6H The input operation shown is for thumbnail 7072.

[0366] S802C, the Gallery app / first app sends a viewing command to the Media Library.

[0367] S803C, the media library retrieves the first file from the memory.

[0368] The S804C and media library decode the first file to obtain the first image.

[0369] S805C, the media library sends the first image to the gallery application / first application.

[0370] S806C, Gallery app / First app displays the first image.

[0371] In response to a viewing command sent by the gallery app / first app, the media library can retrieve the first file from its storage, decode the first file, and obtain the first image. The media library then sends the first image to the gallery app / first app.

[0372] After retrieving the first image, the gallery app / first app can display the first image.

[0373] For example, the first application could be a camera application, and the first image displayed by the gallery application could be... Figure 6B The image shown is 7001.

[0374] For example, the first application could be an instant messaging application, and the first image displayed by the first application could be... Figure 6D The image shown is 7002.

[0375] For example, the first application could be a Meitu app, and the first image displayed by the gallery app could be... Figure 6I The image shown is 3011.

[0376] pass Figure 8C The method shown allows the first application or gallery application to retrieve the first file from storage and decode it to obtain the first image when the user needs to view the shooting effect of the first image. The user can then view the shooting effect of the first image within the first application or gallery application. This way, even if the first image stored in shared memory is accessed, the first application or gallery application can still retrieve the first file from storage and decode it to obtain the first image.

[0377] 3. Electronic device 100 receives a first image stored in shared memory and / or a first file stored in memory that the user has deleted.

[0378] In some embodiments, after the duration of a first image stored in the shared memory of the electronic device 100 reaches a first duration, the electronic device 100 may delete the first image stored in the shared memory of the electronic device 100 to save storage space in the shared memory of the electronic device 100.

[0379] In other embodiments, after the first image is displayed in the gallery application or the first application, and if the user is dissatisfied with the shooting effect of the first image, the electronic device 100 may receive a message from the user deleting the first image stored in the shared memory and / or the first file stored in the memory.

[0380] In some embodiments, a user can delete the first image captured by the camera in the gallery app.

[0381] In other embodiments, the user may also delete the first image captured by the camera in the first application.

[0382] 1. The user deletes the first image obtained by the first application using the camera in the Gallery app.

[0383] Figures 9A-9B This illustration shows a user deleting the first image captured by the camera in the first application within the Gallery app.

[0384] For example, the first application could be a camera app or a photo editing app.

[0385] like Figure 9A As shown, the electronic device 100 displays a user interface for a gallery application, which displays image 9001. Image 9001 can be... Figure 6B The image shown, 7001, could also be... Figure 6H Image 3011 is shown. The user interface also includes a delete option.

[0386] like Figure 9B As shown, the electronic device 100 can receive and respond to user input operations for the delete option, such as a click operation. In response to the user's input operation, the electronic device 100 can stop displaying image 9001 and display... Figure 9B The image 9002 shown can be an image adjacent to image 9001.

[0387] In response to the input operation for the delete option, the electronic device 100 also needs to delete the first image stored in the shared memory and delete the first file corresponding to the first image stored in the memory.

[0388] 2. The user deletes the first image obtained by the camera from the first application.

[0389] Figures 9C-9E This illustration shows the first image captured by the camera when the user deletes the first application.

[0390] For example, the first application could be an instant messaging application.

[0391] like Figure 9C As shown, the electronic device 100 displays a user interface for a first application. Figure 9C The user interface shown contains image 3007, which can be a thumbnail of the first image.

[0392] like Figure 9C As shown, the electronic device 100 can receive and respond to user input operations on the image 3007, such as a long press operation. In response to the user's input operation, the electronic device 100 can display... Figure 9D The prompt bar 9003 shown displays multiple options, such as copy, forward, favorite, delete, multi-select, and quote. Users can use the copy option to save image 3007 to the clipboard of electronic device 100. Users can use the forward option to send image 3007 to other contacts or contacts in other group chats. Users can use the favorite option to save image 3007 to the favorites folder of the first application. Users can use the delete option to delete... Figure 9C Image 3007 is displayed within the user interface shown. Users can select it using multiple options. Figure 9C The user interface shown displays one or more chat logs. Users can reference image 3007 using the quoting option.

[0393] like Figure 9D As shown, the electronic device 100 can receive and respond to user input operations such as a click operation to delete an option in the prompt bar 9003. In response to the user's input operation, the electronic device 100 can stop displaying image 3007 and display... Figure 9E The user interface shown is Figure 9E Image 3007 is not included in the user interface shown.

[0394] In response to the input operation for the delete option, the electronic device 100 also needs to delete the first image stored in the shared memory and delete the first file corresponding to the first image stored in the memory.

[0395] In some embodiments, when the electronic device 100 receives an operation from a user to delete the first image, if the electronic device 100 has not yet encoded the first image into a first file and stored it in the memory, the electronic device 100 only needs to delete the first image stored in the shared memory.

[0396] Figure 10The diagram illustrates a method flow diagram of an electronic device 100 receiving a user's operation to delete a first image and deleting the first image stored in shared memory.

[0397] like Figure 10 As shown, the electronic device 100 may include an application layer, an application framework layer, and a hardware layer. The application layer includes a gallery application / first application, the application framework layer includes a media library, and the hardware layer includes shared memory.

[0398] The method by which electronic device 100 receives a user's operation to delete a first image and deletes the first image stored in shared memory includes, but is not limited to, the following steps:

[0399] S1001A, Gallery application / First application displays the first image.

[0400] For example, the first application could be a camera application, and the first image displayed by the gallery application could be... Figure 6B The image shown is 7001.

[0401] For example, the first application could be an instant messaging application, and the first image displayed by the first application could be... Figure 6D The image shown is 7002.

[0402] For example, the first application could be a Meitu app, and the first image displayed by the gallery app could be... Figure 6I The image shown is 3011.

[0403] S1002A, Gallery application / First application receives user operation to delete the first image.

[0404] For example, when the first application is a camera app or a photo editing app, the user action of deleting the first image can be... Figure 9D The input action shown is for the delete option.

[0405] For example, when the first application is an instant messaging application, the user operation of deleting the first image can be... Figure 9B The input action shown is for the delete option.

[0406] S1003A, the gallery application / first application sends a deletion command to the media library.

[0407] S1004A, the media library sends a delete command to the shared memory.

[0408] Optionally, the media library can send deletion commands to the shared memory via the shared memory module.

[0409] S1005A, delete the first image from shared memory.

[0410] In response to a user action to delete the first image, the gallery app / first app can send a delete command to the media library. In response to the delete command, the media library can delete the first image stored in shared memory.

[0411] Optionally, if the duration of the first image stored in the shared memory reaches a certain duration and the first image has been automatically deleted from the shared memory, the electronic device 100 may choose not to perform the deletion operation when it receives a user's request to delete the first image. Figure 10 The example shown.

[0412] In some embodiments, when the electronic device 100 receives an operation from a user to delete the first image, if the electronic device 100 has already encoded the first image into a first file and stored it in the memory, the electronic device 100 needs to delete not only the first image stored in the shared memory, but also the first file corresponding to the first image stored in the memory.

[0413] Figure 11 The diagram illustrates a method flow diagram of an electronic device 100 receiving a user's operation to delete a first image and deleting a first file stored in its memory.

[0414] like Figure 11 As shown, the electronic device 100 may include an application layer, an application framework layer, and a hardware layer. The application layer includes a gallery application / first application, the application framework layer includes a media library, and the hardware layer includes memory.

[0415] The method by which electronic device 100 receives a user's operation to delete a first image and deletes a first file stored in its memory includes, but is not limited to, the following steps:

[0416] S1101A, Gallery application / First application displays the first image.

[0417] S1102A, Gallery application / First application receives user operation to delete the first image.

[0418] For a description of S1101A-S1102A, please refer to the description in S1001A-S1002A. This application will not repeat it here.

[0419] S1103A, the gallery application / first application sends a deletion command to the media library.

[0420] S1104A, the media library sends a delete command to the memory.

[0421] S1105A, Delete the first file from the memory.

[0422] In response to a user's action to delete the first image, the gallery app / first app can send a delete command to the media library. In response to the delete command, the media library can delete the first file stored in its memory.

[0423] Optionally, if the electronic device 100 has not yet encoded the first image into a first file and stored it in the memory, for example, if the duration of the first image stored in the shared memory has not reached the first duration or the user has not performed the operation of saving the first image, the electronic device 100 may not perform the operation when it receives a user operation to delete the first image. Figure 11 The example shown.

[0424] Figure 12 This is a flowchart illustrating a photographing method provided in this application.

[0425] S1201, The electronic device receives the user's photo-taking operation.

[0426] S1202, In response to the photo-taking operation, the electronic device acquires a first image and stores the first image in the shared memory of the electronic device.

[0427] S1203. The electronic device displays a first image, which is obtained by the electronic device from the shared memory of the electronic device.

[0428] This method allows electronic devices to utilize shared memory. After an application uses the device's camera to capture an image, the device can store the image in shared memory. When displaying the image, the device can retrieve and display it from shared memory. This reduces the encoding and decoding processes, speeds up image display, and minimizes the overhead of encoding and decoding.

[0429] Optionally, the electronic device can receive a user's photo-taking action in a camera application. For example, see [reference needed]. Figures 3A-3C Description in the embodiments.

[0430] Electronic devices can also receive user photo-taking actions in the first application, such as an instant messaging application or a photo editing application. For example, see [reference needed]. Figure 3D-Figure 3N Description in the embodiments.

[0431] For an explanation of how electronic devices store the first image in the shared memory of the electronic device, please refer to [reference needed]. Figure 4 Description in the embodiments.

[0432] Optionally, the electronic device can retrieve and display the first image from its shared memory after receiving the user's action to take a photo and then after receiving the user's action to view the first image. For example, see [reference needed]. Figures 6A-6B , Figures 6C-6D , Figures 6E-6I Description in the embodiments.

[0433] Optionally, the electronic device may also automatically retrieve and display the first image from its shared memory after receiving a user's photo-taking action. For example, see [reference needed]. Figure 3I , Figure 3N Description in the embodiments.

[0434] In one possible implementation, the application in the electronic device accesses and retrieves the first image corresponding to the shared memory object stored in the shared memory based on the shared memory object of the first image. The shared memory object is used to indicate the storage location of the first image in the shared content.

[0435] In one possible implementation, the electronic device displays a first image, specifically including: a first application or gallery application in the electronic device obtaining a shared memory object through a media library, the shared memory object indicating the storage location of the first image in shared content; the first application or gallery application in the electronic device obtaining the first image based on the shared memory object; and the first application or gallery application displaying the first image.

[0436] In this way, the first application or gallery application can retrieve the first image from shared memory through the media library.

[0437] For example, the first application could be an instant messaging application or a photo editing application.

[0438] For example, you can refer to how the first application or gallery application displays the first image. Figure 8A Description in the embodiments.

[0439] In one possible implementation, the first application or gallery application in the electronic device obtains a shared memory object through a media library, specifically including: the first application or gallery application in the electronic device receiving a first operation from a user to view a first image; in response to the first operation, the first application or gallery application in the electronic device obtains a shared memory object through a media library.

[0440] In this way, after receiving the user's request to view the first image, the electronic device can retrieve the first image from its shared memory and display it.

[0441] In one possible implementation, after storing the first image in the shared memory of the electronic device, the method further includes: the media library in the electronic device storing the shared memory object of the first image.

[0442] In this way, after receiving a user's photo-taking action, the electronic device can automatically retrieve and display the first image from the device's shared memory.

[0443] In one possible implementation, the first image stored in shared memory is an unencoded image.

[0444] In one possible implementation, the first image includes any one of the following formats: YUV, RGB, RGBA, and ARGB.

[0445] In one possible implementation, after the electronic device stores the first image in the shared memory of the electronic device, the method further includes: the electronic device encoding the first image into a first file and storing the first file in the memory of the electronic device.

[0446] In this way, after the electronic device stores the first image in its shared memory, it can directly encode the first image into a first file and store it in the memory. This avoids the situation where the first image stored in the shared memory is lost if the electronic device is suddenly turned off before it has stored it in the memory.

[0447] In some embodiments, after the electronic device encodes the first image into a first file and stores it in memory, the electronic device clears the first image stored in the shared memory after the electronic device is powered off.

[0448] In one possible implementation, if the electronic device has cleared the first image stored in the shared memory before it is powered off, the electronic device can automatically decode the first file into the first image and store it in the shared memory after it is powered on.

[0449] In one possible implementation, after the electronic device is powered on, if the electronic device has cleared the first image stored in the shared memory, when the electronic device receives an operation from the user to view the first image, the electronic device decodes the first file into the first image and stores it in the shared memory.

[0450] For example, you can refer to Figure 8B Description in the embodiments.

[0451] In one possible implementation, after the electronic device stores the first image in the shared memory of the electronic device, the method further includes: after the duration of the first image stored in the shared memory of the electronic device reaches a first duration, the electronic device encodes the first image into a first file and stores the first file in the memory of the electronic device.

[0452] In this way, if the user does not delete the first image after the first image stored in the shared memory has exceeded the first time limit, the electronic device can encode the first image into a first file and store it in the memory, that is, permanently save the first file.

[0453] Optionally, after the electronic device stores the first file in the electronic device's memory, the electronic device can also delete the first image stored in the shared memory.

[0454] In this way, electronic devices can promptly clear images stored in shared memory, thereby saving shared memory storage space.

[0455] For example, you can refer to Figure 8B Description in the embodiments.

[0456] In one possible implementation, after the electronic device stores the first image in the shared memory of the electronic device, the method further includes: the electronic device receiving a second operation from the user to save the first image; in response to the second operation, the electronic device encodes the first image into a first file and stores the first file in the memory of the electronic device.

[0457] In this way, after the duration of the first image stored in the shared memory exceeds the first duration, the electronic device can encode the first image into a first file and store it in the memory after receiving the second operation to save the first image.

[0458] Optionally, after the electronic device stores the first file in the electronic device's memory, the electronic device can also delete the first image stored in the shared memory.

[0459] In this way, electronic devices can promptly clear images stored in shared memory, thereby saving shared memory storage space.

[0460] For example, the second operation of saving the first image could be for... Figure 3I The input operation for sending option 3006 is shown. For example, the second operation of saving the first image could be for... Figure 3N The input operation for the save option 3013 shown.

[0461] You can refer to this. Figure 8A Description in the embodiments.

[0462] In one possible implementation, the first file can be either jpeg or heif format.

[0463] In one possible implementation, the method further includes: after the duration of the first image stored in the shared memory of the electronic device reaches a first duration, the electronic device deletes the first image stored in the shared memory.

[0464] In this way, once the duration of the first image stored in the shared memory exceeds the first time limit, the electronic device can promptly clear the images stored in the shared memory to save storage space.

[0465] In one possible implementation, after the electronic device displays the first image, the method further includes: the electronic device receiving a third operation from the user to delete the first image; in response to the third operation, the electronic device deletes the first image stored in the shared memory of the electronic device.

[0466] Thus, after the electronic device receives the third operation from the user to delete the first image, the electronic device then deletes the first image stored in the shared memory.

[0467] For example, the third operation to delete the first image could be... Figures 9A-9E The operations within.

[0468] For example, to illustrate how an electronic device deletes the first image stored in shared memory, please refer to [reference needed]. Figure 10 Description in the embodiments.

[0469] In one possible implementation, the method further includes: if the electronic device has encoded the first image into a first file and stored the first file in the memory of the electronic device, in response to the third operation, the electronic device also needs to delete the first file corresponding to the first image stored in the memory of the electronic device.

[0470] For example, to explain how an electronic device can delete the first file corresponding to the first image stored in its memory, please refer to [reference needed]. Figure 11 Description in the embodiments.

[0471] Thus, if the electronic device has already encoded the first image as a first file and stored it in its memory, after receiving the third operation from the user to delete the first image, the electronic device also needs to delete the first file corresponding to the first image stored in its memory. If the electronic device has not encoded the first image as a first file and stored it in its memory, after receiving the third operation from the user to delete the first image, the electronic device only needs to delete the first image stored in its shared memory.

[0472] In one possible implementation, the first application is an application that comes with the electronic device system, such as a gallery application. Alternatively, the first application may be a third-party application, such as an instant messaging application or a photo editing application.

[0473] In one possible implementation, the electronic device includes a camera sub-service; before the first application or gallery application in the electronic device obtains the shared memory object through the media library, the method further includes: the camera sub-service obtaining the shared memory object of the first image in the shared memory and sending the shared memory object to the media library.

[0474] In one possible implementation, the camera sub-service sends the shared memory object of the first image in shared memory to the media library. Specifically, this includes: the camera sub-service encapsulating the shared memory object of the first image in shared memory into a binder instruction; the camera sub-service sending the binder instruction to the media library; and the media library parsing the binder instruction to obtain the shared memory object of the first image in shared memory.

[0475] In this way, the camera sub-service can send the first image in shared memory to the media library across processes via the binder communication mechanism.

[0476] For example, you can refer to Figure 5 Description in the embodiments.

[0477] In one possible implementation, the electronic device includes a first application and a media library; the electronic device receives a third operation from a user to delete a first image, specifically including: the electronic device receiving the third operation from the user to delete the first image through the first application or the gallery application; in response to the third operation, the electronic device deletes the first image stored in the shared memory of the electronic device, specifically including: in response to the third operation, the first application or the gallery application sends a deletion instruction to the media library; in response to the deletion instruction, the media library deletes the first image stored in the shared memory of the electronic device.

[0478] For example, to illustrate how an electronic device deletes the first image stored in shared memory, please refer to [reference needed]. Figure 10 Description in the embodiments.

[0479] This application provides an electronic device, which includes a memory and a processor; wherein the memory and the processor are coupled, the memory is used to store computer programs, and when the processor executes and calls the computer programs, the electronic device performs... Figure 12 This illustrates a method of taking a photograph.

[0480] This application provides a computer-readable storage medium, including instructions that, when executed on an electronic device, cause the electronic device to perform... Figure 12 This illustrates a method of taking a photograph.

[0481] This application provides a chip system, which includes one or more processors, the processors being used to invoke computer instructions to cause an electronic device to perform... Figure 12 This illustrates a method of taking a photograph.

[0482] This application provides a computer program product containing instructions that, when executed on an electronic device, causes the electronic device to perform... Figure 12 This illustrates a method of taking a photograph.

[0483] The various embodiments of this application can be combined arbitrarily to achieve different technical effects.

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

[0485] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.

[0486] In summary, the above description is merely an embodiment of the technical solution of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made based on the disclosure of this application should be included within the scope of protection of this application.

Claims

1. A method for taking photos, characterized in that, The method includes: The electronic device receives the user's photo-taking action; In response to the photo-taking operation, the electronic device acquires a first image and stores the first image in the shared memory of the electronic device; The electronic device displays the first image, which is retrieved from the shared memory of the electronic device.

2. The method according to claim 1, characterized in that, The application in the electronic device accesses and retrieves the first image corresponding to the shared memory object stored in the shared memory according to the shared memory object of the first image. The shared memory object is used to indicate the storage location of the first image in the shared content.

3. The method according to claim 1 or 2, characterized in that, The electronic device displays the first image, specifically including: The first application or gallery application in the electronic device obtains the shared memory object through the media library, and the shared memory object is used to indicate the storage location of the first image in the shared content; The first application in the electronic device or the gallery application obtains the first image based on the shared memory object; The first application or the gallery application displays the first image.

4. The method according to claim 3, characterized in that, The first application or the gallery application in the electronic device obtains a shared memory object through the media library, specifically including: The first application of the electronic device or the gallery application receives a first operation from the user to view the first image; In response to the first operation, the first application in the electronic device or the gallery application obtains the shared memory object through the media library.

5. The method according to claim 3 or 4, characterized in that, After storing the first image in the shared memory of the electronic device, the method further includes: The media library in the electronic device stores a shared memory object of the first image.

6. The method according to any one of claims 1-5, characterized in that, The first image stored in the shared memory is an unencoded image.

7. The method according to any one of claims 1-6, characterized in that, The first image includes any one of the following formats: YUV, RGB, RGBA, and ARGB.

8. The method according to any one of claims 1-7, characterized in that, After the electronic device stores the first image in the shared memory of the electronic device, the method further includes: The electronic device encodes the first image into a first file and stores the first file in the memory of the electronic device.

9. The method according to any one of claims 1-7, characterized in that, After the electronic device stores the first image in the shared memory of the electronic device, the method further includes: After the duration of the first image stored in the shared memory of the electronic device reaches a first duration, the electronic device encodes the first image into a first file and stores the first file in the memory of the electronic device.

10. The method according to any one of claims 1-7, characterized in that, After the electronic device stores the first image in the shared memory of the electronic device, the method further includes: The electronic device receives a second operation from the user to save the first image; In response to the second operation, the electronic device encodes the first image into a first file and stores the first file in the memory of the electronic device.

11. The method according to any one of claims 8-10, characterized in that, The first file can be either JPEG or HEIF format.

12. The method according to any one of claims 1-11, characterized in that, The method further includes: After the duration of the first image stored in the shared memory of the electronic device reaches a first duration, the electronic device deletes the first image stored in the shared memory.

13. The method according to any one of claims 1-11, characterized in that, After the electronic device displays the first image, the method further includes: The electronic device receives a third operation from the user to delete the first image; In response to the third operation, the electronic device deletes the first image stored in the shared memory of the electronic device.

14. The method according to claim 13, characterized in that, The method further includes: If the electronic device has already encoded the first image into a first file and stored the first file in the memory of the electronic device, in response to the third operation, the electronic device also needs to delete the first file corresponding to the first image stored in the memory of the electronic device.

15. The method according to claim 3 or 4, characterized in that, The first application is either a built-in application of the electronic device system or a third-party application.

16. The method according to any one of claims 1-15, characterized in that, The electronic device includes a camera sub-service; in response to the photo-taking operation, the electronic device acquires a first image and stores the first image in the shared memory of the electronic device, specifically including: In response to the photo-taking operation, the camera sub-service acquires the first image; The camera sub-service stores the first image in the shared memory.

17. The method according to claim 4, characterized in that, The electronic device includes a camera sub-service; before the first application or the gallery application in the electronic device obtains the shared memory object through the media library, the method further includes: The camera sub-service obtains the shared memory object of the first image in the shared memory and sends the shared memory object to the media library.

18. The method according to claim 17, characterized in that, The camera sub-service sends the first image from the shared memory object in the shared memory to the media library, specifically including: The camera sub-service encapsulates the first image into a binder instruction in the shared memory object in the shared memory. The camera sub-service sends the binder command to the media library; The media library parses the binder instruction to obtain the shared memory object of the first image in the shared memory.

19. The method according to claim 13 or 14, characterized in that, The electronic device includes a media library; the electronic device receives a third operation from the user to delete the first image, specifically including: The electronic device receives the third operation from the user to delete the first image through the first application or the gallery application; In response to the third operation, the electronic device deletes the first image stored in the shared memory of the electronic device, specifically including: In response to the third operation, the first application or the gallery application sends a deletion command to the media library; In response to the deletion command, the media library deletes the first image stored in the shared memory of the electronic device.

20. An electronic device, characterized in that, The electronic device includes a memory and a processor; wherein the memory and the processor are coupled, the memory is used to store a computer program, and when the processor executes the computer program, the electronic device performs the method of any one of claims 1-19.

21. A computer-readable storage medium comprising instructions, characterized in that, When the instructions are executed on an electronic device, the electronic device performs the method of any one of claims 1-19.

22. A computer program product containing instructions, characterized in that, When the computer program product is run on an electronic device, it causes the electronic device to perform the method of any one of claims 1-19.