Picture sharing method and related apparatus

By prioritizing the generation and display of full-quality images, the problem of sharing delays and failures when electronic devices process multiple images is solved, improving the success rate of image sharing and user experience.

CN119906719BActive Publication Date: 2026-06-30HUAWEI TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HUAWEI TECH CO LTD
Filing Date
2024-09-23
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

When electronic devices process multiple images, the inability to obtain a full-quality image in a timely manner can lead to image sharing failures or delays, impacting the user experience.

Method used

By adjusting the acquisition quality of the target image, prioritizing the generation of full-quality images, and displaying prompts during the generation process, the image quality is adaptively adjusted to adapt to device load conditions, ensuring timely sharing of high-quality images.

Benefits of technology

It improved the success rate of image sharing, reduced waiting time, enhanced the user experience, and ensured a rapid response to user sharing operations under different load conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119906719B_ABST
    Figure CN119906719B_ABST
Patent Text Reader

Abstract

A method and related apparatus for sharing images are disclosed. In this method, an electronic device may be configured with an image sharing strategy. When a user shares an image through the electronic device, after the user selects a target image, the electronic device can share a target quality image of the target image based on the image sharing strategy. The image quality of the target quality image may include at least a first quality and a second quality. The electronic device can flexibly select the image quality of the target quality image based on the image sharing strategy and the load of the electronic device. This can avoid situations where image sharing fails due to the target quality image not being generated or where image sharing takes too long.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application. The original application has the application number 202411336914.5 and the original application date is September 23, 2024. The invention title is "A method and related device for sharing pictures". The entire contents of the original application are incorporated herein by reference. Technical Field

[0002] This application relates to the field of terminal and communication technology, and in particular to a method and related apparatus for sharing images. Background Technology

[0003] After acquiring image data, electronic devices can first generate thumbnails of the corresponding images, and then process the image data to obtain medium-quality and full-quality images of the images.

[0004] When a user shares an image via an electronic device, the device can display a thumbnail of the image. The user can select the thumbnail to share the image. Normally, the electronic device shares a full-quality image, allowing the user to zoom in and view details. However, in some scenarios, if the electronic device acquires multiple images consecutively and generates a thumbnail for one image but not a full-quality image, it may be unable to respond to the user's share request and thus fail to acquire the full-quality image in a timely manner. This can lead to image sharing failures or excessively long waiting times, negatively impacting the user experience.

[0005] Therefore, it is worth considering how to solve the problems of image loss or sharing delays that occur when users share multiple images on electronic devices. Summary of the Invention

[0006] This application provides an image sharing method and related apparatus. Using this method, the problems of image loss or sharing delay caused by users sharing multiple images when processing them on electronic devices can be solved.

[0007] In a first aspect, this application provides an image sharing method applied to an electronic device. The method includes: in response to a first operation, selecting a first image, the electronic device including a first quality image of the first image; in response to a second operation, sharing a target quality image of the first image based on an image sharing strategy, wherein the image quality of the target quality image of the first image is higher than or equal to that of the first quality image of the first image, the image sharing strategy being a strategy for determining the image quality of the target quality image, the image quality including at least a first quality and a second quality, the first quality being lower than the second quality, the image corresponding to the first quality being the first quality image of the image, and the image corresponding to the second quality being the second quality image of the image.

[0008] By implementing the image sharing method provided in the first aspect above, electronic devices can adjust the acquisition quality of the target image when a user shares it through an application, thereby enabling the application to share images of the appropriate quality in a timely manner. This avoids situations where the application fails to retrieve images from the file system or takes too long to retrieve images, ensuring a better user experience when sharing images.

[0009] The first quality map can be a medium quality map as described in the following embodiments. The second quality map can be a full quality map as described in the following embodiments. The first quality can include the resolution of the first quality map, and the second quality can include the resolution of the second quality map.

[0010] In conjunction with the first aspect, the response to the second operation, sharing a target quality image of the first image based on an image sharing strategy, includes: in response to the second operation and provided that the electronic device does not include a second quality image of the first image, generating a second quality image of the first image; and sharing the second quality image of the first image.

[0011] In this way, electronic devices can prioritize the generation of target images, ensuring that a full-quality image of the target image is generated immediately when the application accesses the file system. This guarantees the quality of shared images while preventing image sharing failures caused by third-party applications failing to retrieve the image. This increases the success rate of users sharing full-quality images, reduces waiting time, and improves the user experience.

[0012] In conjunction with the first aspect, after generating the second quality image of the first image, the method further includes: generating the second quality image of the second image, wherein the generation time of the first quality image of the second image is earlier than the generation time of the first quality image of the first image.

[0013] In this way, when sharing a target image, electronic devices can prioritize generating a full-quality image of the target image, while suspending the generation of other images, thus improving the response speed to user sharing operations.

[0014] In conjunction with the first aspect, before generating a second quality image of the first image, the method further includes: displaying a first prompt, the first prompt indicating that the electronic device is generating a second quality image of the first image.

[0015] In this way, electronic devices can notify users that the image is being generated when a full-quality image is being generated, avoiding misunderstandings and repeated operations while users are waiting.

[0016] In conjunction with the first aspect, the response to the second operation, sharing the target quality image of the first image based on an image sharing strategy, includes: in response to the second operation and the electronic device including a second quality image of the first image, determining the second quality image of the first image as the target quality image of the first image; and sharing the second quality image of the first image.

[0017] In this way, when the electronic device detects that a full-quality image of the target image has been generated, it can directly share the full-quality image, improving the response speed to user sharing operations.

[0018] In conjunction with the first aspect, the response to the second operation, sharing the target quality image of the first image based on an image sharing strategy, includes: in response to the second operation and when the electronic device does not include a second quality image of the first image, determining the first quality image of the first image as the target quality image of the first image; and sharing the first quality image of the first image.

[0019] In this way, electronic devices can use a fast sharing strategy to select the highest quality image from the already generated images of the target image for sharing when the highest quality image of the target image has not yet been generated. This ensures that the electronic device can quickly respond to the user's sharing operation and successfully share the image to the target while maintaining a certain image quality, thus guaranteeing the user's experience.

[0020] In conjunction with the first aspect, in response to the second operation, before sharing the target quality image of the first image based on the image sharing strategy, the method further includes: in response to the third operation, selecting a third image, wherein the electronic device includes the first quality image of the third image but does not include the second quality image of the third image; the method further includes: in response to the second operation, sharing the first quality image of the third image.

[0021] In this way, electronic devices can support users to share multiple images at once and adaptively adjust the target sharing quality of multiple images. When the electronic device's load condition only supports the priority generation of full-quality images of a portion of the target images, the electronic device can make full use of its own performance to maximize the number of full-quality images in the shared target images, while ensuring that other images in the target images can also be shared as medium-quality images.

[0022] In conjunction with the first aspect, the load of the electronic device is lower than or equal to a first threshold, which is the highest value at which the electronic device operates under low load.

[0023] In this way, electronic devices can adaptively adjust the image quality of shared images based on their own load conditions, allowing them to prioritize generating full-quality images of the target image even under lower loads. This fully utilizes the idle capacity of the electronic device, ensuring a good user experience when sharing images.

[0024] For example, the first threshold can be determined by the utilization rate of the central processing unit and graphics processing unit of the electronic device.

[0025] In conjunction with the first aspect, the load on the electronic device is higher than or equal to the second threshold, which is the minimum value for the electronic device to operate under high load.

[0026] In this way, electronic devices can adaptively adjust the image quality of shared pictures based on their own load conditions, ensuring that at least browsable images can be shared under varying load scenarios. This avoids image sharing failures due to high device load or the target image not being generated, thus guaranteeing a better user experience.

[0027] For example, the second threshold may be determined by the utilization rate of the central processing unit and graphics processing unit of the electronic device, and the second threshold is higher than or equal to the first threshold described above.

[0028] In conjunction with the first aspect, the first quality image of the first image includes a first index for indicating the first quality image of the first image.

[0029] In this way, electronic devices can distinguish different images and images of different qualities through image indexes, and can correctly obtain the target image through image indexes.

[0030] In a second aspect, this application provides an electronic device, including: a memory, a processor, and a computer program stored in the memory, the processor executing the computer program to implement the method as described in the first aspect.

[0031] Thirdly, this application provides a computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the method described in the first aspect.

[0032] Fourthly, this application provides a chip system applied to an electronic device, characterized in that the chip system includes one or more processors for invoking computer instructions to cause the electronic device to perform the method described in the first aspect.

[0033] Fifthly, this application provides a computer program product comprising a computer program that, when executed by a processor, implements the method as described in the first aspect.

[0034] Understandably, the electronic device provided in the second aspect, the computer-readable storage medium provided in the third aspect, the chip system provided in the fourth aspect, and the computer program product provided in the fifth aspect are all used to execute the method provided in this application. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects in the corresponding methods, and will not be repeated here. Attached Figure Description

[0035] Figure 1A This is a schematic diagram of the camera interface of the electronic device 100 provided in this application embodiment;

[0036] Figure 1B This is a schematic diagram of the photo album interface of the electronic device 100 provided in this application embodiment;

[0037] Figure 1C This is a large-view schematic diagram of the interface of the electronic device 100 provided in the embodiments of this application;

[0038] Figure 1D This is a magnified scene diagram of the electronic device 100 provided in the embodiments of this application;

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

[0040] Figure 3 This is a schematic diagram illustrating the image generation process of the electronic device 100 provided in this application embodiment;

[0041] Figure 4A This is a schematic diagram of the media index interface of the electronic device 100 provided in the embodiments of this application;

[0042] Figure 4B This is a schematic diagram of the third-party application chat interface of the electronic device 100 provided in this application embodiment;

[0043] Figure 5 This is a schematic diagram of another software structure of the electronic device 100 provided in the embodiments of this application;

[0044] Figure 6 This is a schematic diagram illustrating the process of sharing images based on a fast sharing strategy by the electronic device 100 provided in this application embodiment;

[0045] Figure 7 This is a schematic diagram illustrating the process of sharing images based on a high-quality sharing strategy by the electronic device 100 provided in this application embodiment;

[0046] Figure 8A This is a priority diagram of image generation by an electronic device 100 according to an embodiment of this application;

[0047] Figure 8BThis is a priority diagram of image generation by another electronic device 100 provided in this application embodiment;

[0048] Figure 9 This is a schematic diagram illustrating the process of an electronic device 100 sharing images based on a balanced sharing strategy, as provided in an embodiment of this application.

[0049] Figure 10 This is a schematic diagram of the application permission management interface of the electronic device 100 provided in this application embodiment;

[0050] Figure 11 This is a schematic diagram of the image sharing strategy management interface of the electronic device 100 provided in this application embodiment;

[0051] Figure 12 This is a schematic diagram illustrating the process of sharing images using an electronic device 100 provided in an embodiment of this application;

[0052] Figure 13 This is a schematic diagram of the hardware structure of the electronic device 100 provided in the embodiments of this application. Detailed Implementation

[0053] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0054] The terminology used in the following embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. As used in the specification and appended claims of this application, the singular expressions “a,” “an,” “the,” “the,” “the,” and “this” are intended to include the plural expressions as well, unless the context clearly indicates otherwise. 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. “First” and “second,” etc., are used to distinguish different objects, not to describe a particular order of objects. For example, a first object and a second object are used to distinguish different objects, not to describe a particular order of objects.

[0055] In the description of the embodiments in this application, unless otherwise stated, "multiple" means two or more. For example, multiple processing units refer to two or more processing units; multiple systems refer to two or more systems.

[0056] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or related scheme described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.

[0057] The term "and / or" in this application is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent three cases: A existing alone, A and B existing simultaneously, and B existing alone.

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

[0059] To better understand the technical solution provided in this application, before describing the technical solution, we will first refer to the accompanying drawings to explain the applicable electronic device 100 with photographic function. This application does not limit the specific form or type of the electronic device 100.

[0060] First, the relevant terms used in this application, such as thumbnail, medium quality map, and full quality map, will be introduced with reference to the accompanying drawings.

[0061] In some examples, after acquiring the raw image data of an image, the electronic device 100 can immediately generate a thumbnail corresponding to that image. Then, the electronic device 100 can process the raw image data to obtain a medium-quality image and a full-quality image of the image.

[0062] Among them, thumbnails are low-resolution, high-compression images with small file sizes, which can be used by users to preview and select images, saving storage space and allowing for fast loading and display of image options on electronic device 100; medium-quality images are images with medium resolution and compression rates, and their size matches the screen of electronic device 100, making them suitable for viewing on the screen, while occupying less storage space than full-quality images, and can be used by users to browse image content; full-quality images are images with the highest resolution and lowest compression rate, providing the best image detail, which can be used by users to zoom in and view image details, but occupy the most storage space.

[0063] Taking the acquisition of images by electronic device 100 through photography as an example, in one possible implementation, after acquiring the raw image data of an image, electronic device 100 can immediately generate a thumbnail corresponding to the image. The user can then view the thumbnail in a relevant application. Then, based on the raw image data, electronic device 100 can continue to generate medium-quality and full-quality images of the image.

[0064] For example, electronic device 100 can take photos via a camera application, and in response to the user opening the camera application, electronic device 100 can display a photo-taking interface. Figure 1A As shown, the electronic device 100 can display a user interface 100A, which can be referred to as the camera interface of the electronic device 100. The user interface 100A may include controls 101, 102, and a scene 103. Control 101 can be used to trigger the electronic device 100 to acquire image data. Control 102 can be used to open the photo album application of the electronic device 100.

[0065] Electronic device 100 can receive user clicks on control 101 to acquire raw image data of scene 103. After completing image data acquisition, electronic device 100 can generate a thumbnail including scene 103. Electronic device 100 can display this thumbnail on control 102. Electronic device 100 can also receive user clicks on control 102 to display the user interface 100B of the photo album.

[0066] like Figure 1B As shown, after receiving a user's click on control 102, electronic device 100 can display user interface 100B, which may include thumbnails 104. These thumbnails 104 may include the content of the scene 103. The thumbnails 104 can be used by the user to preview the content of the photo.

[0067] When electronic device 100 receives a click on thumbnail 104, it can display something like... Figure 1CThe user interface 100C is shown. The user interface 100C may include a medium-quality image 105. The size of the medium-quality image 105 matches the screen of the electronic device 100, allowing the user to quickly browse photo content. The medium-quality image 105 is larger than the thumbnail 104, and its resolution is also greater. The user can zoom in on the image by using a two-finger drag operation in the user interface 100C.

[0068] like Figure 1D As shown, when the electronic device 100 receives a two-finger drag operation input by the user, it can display a user interface 100D. The user interface 100D can display a full-quality image 106. This full-quality image 106 allows the user to zoom in and out to view photo details.

[0069] That is, when taking a picture, the electronic device 100 can generate a thumbnail, a medium-quality image, and a full-quality image for each photo. The thumbnail's image quality is lower than the medium-quality image, and the medium-quality image's image quality is lower than the full-quality image. Image quality can be measured by one or more of the following: resolution, compression ratio, size, sharpness, image detail, degree of algorithmic optimization, etc. In one possible implementation, the lower the compression ratio and the higher the resolution of an image, the higher its image quality can be considered.

[0070] After electronic device 100 generates a full-quality image, the full-quality image can be shared through an application. (See reference.) Figure 2 , Figure 2 An exemplary schematic diagram of the software structure of electronic device 100 is shown. The following, in conjunction with the software block diagram, uses the example of a third-party application sharing images to illustrate the workflow of image sharing by electronic device 100. Figure 2 As shown, the electronic device 100 may include an application layer, a system service layer, and a kernel layer.

[0071] The application layer of electronic device 100 may include a camera application and third-party applications. The camera application can be used to display an interactive photo-taking interface. The third-party applications can be used by the user to view and share the photos taken.

[0072] The system service layer can include camera services and image optimization services. Camera services can coordinate the resources of electronic device 100 to fulfill the user's photo-taking request. Image optimization services can optimize the raw image data during segmented photo-taking, performing operations such as whitening, face slimming, color correction, and sharpness adjustment, providing users with better-looking photos.

[0073] The kernel layer can include a camera driver and a file system. The camera driver can be used to acquire images from the camera hardware of electronic device 100 and provide the raw image data to image optimization services. The file system can be used to store image files of different qualities generated during segmented shooting.

[0074] The process by which electronic device 100 acquires and shares images through the aforementioned modules is shown below.

[0075] S201. Electronic device 100 sends a photo-taking command to the camera service via a camera application.

[0076] For example, the camera application of electronic device 100 can provide users with a photo preview and parameter adjustment interface. When the user inputs a photo-taking operation through the camera application, in response to the operation, the camera application can send a photo-taking command to the camera service.

[0077] S202. The camera service calls the camera driver to acquire raw image data for the picture.

[0078] After receiving a photo-taking command, the camera service can acquire raw image data through the camera driver. The camera driver can then transmit the acquired raw image data to the camera service. Upon receiving the raw image data, the camera service can also instruct the camera application that image data acquisition is complete, and the camera application can then notify the user that the photo has been taken.

[0079] S203. The camera service generates thumbnails corresponding to the images based on the original image data and saves the thumbnails to the file system.

[0080] After the camera service collects the raw image data of a photo, it can first generate a thumbnail of the photo and save it to the file system. It should be understood that if the camera service collects the raw image data of multiple images at once, the camera service can generate a thumbnail for each image after the raw image data of each image is collected. The electronic device 100 can display the thumbnails in the image library. Users can access the corresponding images through the thumbnails. The images for user browsing can be generated by the electronic device 100 in the following step S205.

[0081] S204. The camera service sends the raw image data to the image optimization service.

[0082] The camera service can send raw image data to the image optimization service and send image optimization requests to the image optimization service.

[0083] S205. The image optimization service optimizes the original image data and saves the corresponding medium-quality and full-quality images to the file system.

[0084] The image optimization service can process image optimization requests sent by the camera service in sequence, generate medium-quality and full-quality images of the photos, and save them to the file system.

[0085] In one possible implementation, the electronic device 100 can use different folder structures in the file system to distinguish different quality images of the same image. For example, the electronic device 100 can create three folders under the folder storing the image: one folder can be used to store thumbnails, another folder can be used to store medium-quality images, and the full-quality images can be stored in the third folder.

[0086] For example, the electronic device 100 can also use different file extensions, filename prefixes, or suffixes to distinguish different quality images of the same picture. For example, the electronic device 100 can assign a unique image index, such as a string of numbers, to each different quality image of a photograph when taking the picture. The electronic device 100 can then retrieve the image of the corresponding quality from the photograph using the corresponding image index.

[0087] This application does not limit the specific method by which the electronic device 100 distinguishes and stores different quality images of the same picture.

[0088] S206. Third-party applications obtain a full-quality map from the file system.

[0089] When a user opens a third-party application to view an image, the application can display thumbnails of the image stored in the file system. In response to the user selecting a thumbnail, the application can send an image access request to the file system to retrieve the full-quality image. This full-quality image can then be sent to the target for sharing, enabling image sharing.

[0090] In one possible implementation, the image access request initiated by the third-party application to the file system may include an image index, which may carry the extension of the full-quality image to uniquely indicate the full-quality image of a certain image. The third-party application can directly obtain the full-quality image of the image through the image index.

[0091] Alternatively, the image index can simply indicate the general category of the image. Through this index, third-party applications can access the image's thumbnail, medium-quality image, and full-quality image. In image-sharing scenarios, third-party applications can, by default, access the full-quality image file in the file system. For example, when a third-party application accesses the folder storing the image through the image index, it only retrieves the image from the folder storing full-quality images. This application does not limit the specific content of the image index or the specific method by which third-party applications obtain full-quality images.

[0092] In the above process, the electronic device 100 can generate images of different qualities in stages. While this helps shorten the user's perceived time to complete taking a photo and improves the user experience in scenarios such as continuous shooting while ensuring image quality, the generation time and storage time of images of different qualities vary. Therefore, when a user shares photos via a third-party application after taking a series of photos, if the corresponding quality image has not yet been generated or stored in the file system, and the third-party application directly accesses the file system, image sharing may fail. If the third-party application waits for the target image to exist in the file system before accessing it, and the target image's generation order is low, it will prolong the third-party application's response time to the user's sharing operation, also affecting the user experience.

[0093] For reference Figure 3 , Figure 3 An exemplary schematic diagram of the image generation process of electronic device 100 is shown.

[0094] like Figure 3 As shown, the electronic device 100 can receive a user's burst shooting operation and continuously capture five photos: photo A, photo B, photo C, photo D, and photo E. The electronic device 100 can generate images of these five photos of different qualities in the order they were captured.

[0095] During the image data processing process, the electronic device 100 can receive a user's request to open a third-party application and share an image. The media index of the third-party application is displayed, showing thumbnails stored in the file system for the user to select the image they wish to share. After the user selects a thumbnail, the third-party application can retrieve the corresponding full-quality image from the file system and share it with the target device or the target application.

[0096] However, if the electronic device 100 has not yet generated a full-quality image corresponding to the image selected by the user for sharing, the third-party application will be unable to obtain the full-quality image of the target photo from the file system, which will cause the image sharing to fail.

[0097] For example, you can refer to Figure 3 In the case of photo D shown, when electronic device 100 receives a user's request to share photo D, although it generates a thumbnail for photo D, it does not generate a full-quality image of photo D. Thus, while electronic device 100 can display the thumbnail of photo D in the media index, third-party applications cannot obtain the full-quality image of photo D from the file system when the user selects to share it. This results in the user completing the action of sharing photo D, but the third-party application failing to share photo D, impacting the user experience.

[0098] One specific scenario for sharing photos via a third-party application of electronic device 100 can be referenced. Figure 4A and Figure 4B .

[0099] like Figure 4A As shown, when the electronic device 100 receives an operation from a user to open a third-party application and share a picture, it can display the media index of the third-party application. The electronic device 100 can display, for example,... Figure 4A The user interface 400A is shown. User interface 400A may include thumbnails 401, 402, 403, 404, 405, and a control 406. These five thumbnails can respectively correspond to the aforementioned... Figure 3 The control 406 can be used to send the thumbnails of photos A through E selected by the user. Thumbnail 404 can be a thumbnail of photo D. The electronic device 100 can select photo D in response to the user's click on thumbnail 404. Then, the electronic device 100 can complete the image sending operation in response to the user's click on control 406. However, since a full-quality image of photo D is not generated and stored in the file system, the electronic device 100 can display as follows: Figure 4B The user interface shown is 400B.

[0100] like Figure 4B As shown, in one possible implementation, the electronic device 100 can display a user interface 400B. The user interface 400B can be a chat window interface of the third-party application. The user interface 400B can include a prompt 407. The prompt 407 can be used to inform the user that the message failed to send. The prompt 407 can also be in the form of text, an image, etc., and this embodiment does not limit the specific form of the prompt 407.

[0101] To address the issues of photo sharing failures and excessively long waiting times described above, this application provides a photo sharing method. In this method, users can set photo sharing strategies for each application, and the electronic device 100 can be configured with an image selection service. This image selection service can intercept direct access to the file system by applications on the electronic device 100 and, based on the photo sharing strategy set by the application, interact with the file system and image optimization services to change the acquisition quality or generation order of the target image, thereby promptly returning images of appropriate quality to the application. This avoids situations where applications fail to access images from the file system or experience excessively long access times. Applications on the electronic device 100 can include third-party applications and system-built-in applications. This application does not limit the specific applications for sharing images on the electronic device 100.

[0102] The following describes the process of sharing images by electronic device 100 through a third-party application, taking the example of an electronic device 100 having an image selection service.

[0103] like Figure 5 As shown in the embodiments of this application, the electronic device 100 may include an application layer, a system service layer, and a kernel layer, exemplarily.

[0104] The application layer of electronic device 100 may include camera applications and third-party applications. The system service layer may include camera services, image optimization services, and image selection services. The kernel layer may include camera drivers and the file system.

[0105] For information regarding camera applications, third-party applications, camera services, image optimization services, camera drivers, and file systems for electronic device 100, please refer to the above content. Figure 2 The description will not be repeated here.

[0106] and Figure 2 The difference lies in the fact that the system service layer of electronic device 100 may also include an image selection service. This service can receive image access requests from third-party applications and provide them with an access interface to the file system. This access interface may include parameters such as image index, image sharing strategy, and return value. After determining the parameters of the image index and image sharing strategy, the image selection service can perform corresponding operations based on the third-party application's image sharing strategy and send a return value to the application. This return value may include information such as the target image and the access result. The specific operations performed by the image selection service can be found in the following description. Figures 6-9 The description will not be elaborated here. It should be understood that... Figure 5 The software functional module division shown is for illustrative purposes only; electronic device 100 may include more or fewer software modules. In practice, electronic device 100 may not include the image selection service, but it can still perform the operations performed by the image selection service described below.

[0107] S501. Electronic device 100 sends a photo-taking command to the camera service via a camera application.

[0108] The relevant content of step S501 can be found in the above content. Figure 2 The description of step S201 will not be repeated here.

[0109] S502. The camera service calls the camera driver to acquire raw image data.

[0110] The relevant content for step S502 can be found in the above content. Figure 2 The description of step S202 will not be repeated here.

[0111] S503. The camera service generates thumbnails corresponding to the images based on the raw image data and saves the thumbnails to the file system.

[0112] The relevant content for step S503 can be found in the above content. Figure 2 The description of step S203 will not be repeated here.

[0113] The S504 camera service sends the raw image data to the image optimization service.

[0114] The relevant content for step S504 can be found in the above content. Figure 2 The description of step S204 will not be repeated here.

[0115] S505. Image optimization service optimizes the original image data and saves the corresponding medium-quality and full-quality images.

[0116] The relevant content for step S505 can be found in the above content. Figure 2 The description of step S205 will not be repeated here.

[0117] Next, we will introduce the sharing process that includes image selection services.

[0118] S506. Third-party applications access target images according to the specified sharing policy.

[0119] When a user shares an image through a third-party application, the image selection service can receive access requests from the third-party application. In some instances, the access request from the third-party application may carry the target image index, image sharing strategy, etc. The image selection service can determine the image sharing strategy of the third-party application through the access request. In other examples, the electronic device 100 may include application lists for fast sharing strategies, high-quality sharing strategies, and balanced sharing strategies. The image selection service can obtain the image sharing strategy adopted by the third-party application by querying the application list. The image selection service can determine the target image to be returned based on the image sharing strategy of the third-party application. The image sharing strategy of the third-party application can be preset in advance or set by the user when sharing the image. This application embodiment does not limit the specific setting node of the image sharing strategy of the third-party application or the specific method by which the image selection service determines the image sharing strategy of the third-party application.

[0120] S507. The image selection service checks whether the target image exists in the file system.

[0121] The image selection service can determine whether a full-quality image of the target image selected by the user exists in the file system. If it does, the image selection service can retrieve the full-quality image of the target image from the file system and send it to the third-party application, which can then share the full-quality image.

[0122] S508. The image selection service instructs the image optimization service to generate target images on demand.

[0123] If the image selection service fails to detect or acquire the target image in step S507, it can perform corresponding operations based on the image sharing strategy of the third-party application. For example, in one possible implementation, the image selection service can instruct the image optimization service to prioritize the generation of the target image. The image optimization service can then prioritize the generation of the target image, processing its original image data first to generate a full-quality or medium-quality image of the target image.

[0124] In another possible implementation, the image selection service can retrieve alternative images from the file system to replace the target image and return them to the third-party application. The operations performed by the image selection service can depend on the image storage in the file system and the third-party application's image sharing strategy. In some examples, the third-party application's image sharing strategy may include: fast sharing, high-quality sharing, and balanced sharing. Specifically, when the third-party application adopts a fast sharing strategy, the image selection service can return the highest-quality image already existing in the file system. When the third-party application adopts a high-quality sharing strategy, the image selection service can instruct the image optimization service to prioritize generating a full-quality image of the target image and return that full-quality image to the third-party application. When the third-party application adopts a balanced sharing strategy, the image selection service can make a comprehensive judgment based on the load of the image optimization service of the electronic device 100 and return an image of appropriate quality to the third-party application.

[0125] S509. The image selection service retrieves the target image from the file system and returns it to the third-party application.

[0126] The image selection service can retrieve images of appropriate quality based on the image sharing strategy set by the third-party application and return them to the application. The different quality images that the image selection service can retrieve may include thumbnails, medium-quality images, and full-quality images, as mentioned above.

[0127] Therefore, the images obtained by third-party applications of electronic device 100 are affected by the image sharing strategy and the image generation status in the file system. The image sharing strategy in this solution is described below using user-shared photo D as an example. The image generation status of electronic device 100 in the following process can be referenced above. Figure 3 The situation shown in the figure.

[0128] Figure 6 An exemplary flowchart is shown when a third-party application adopts a fast sharing strategy.

[0129] like Figure 6 As shown, electronic device 100 may include third-party applications, an image selection service, and a file system. The process when a third-party application adopts a quick sharing strategy may include the following steps.

[0130] S601. The image selection service processes the raw image data of photo B.

[0131] At this moment, the camera module of electronic device 100 has sent the raw image data of the photo to the image optimization service. The image optimization service is processing the data sequentially and is generating a full-quality image of photo B.

[0132] S602. The third-party application of the electronic device 100 receives the user's operation of sharing photo D, and sends an image access request 1 based on the fast sharing strategy.

[0133] Third-party applications can be configured with a fast sharing strategy. When a user shares photo D, the third-party application can send an image access request 1, which may include the index of photo D and the fast sharing strategy.

[0134] S603. The image selection service receives image access request 1, determines that the image index is the index of photo D, and sets the sharing strategy to fast sharing.

[0135] The image selection service can obtain image access request 1 sent by the third-party application and determine that the image index in image access request 1 is the index of photo D, and the image sharing strategy is the fast sharing strategy. The image selection service can perform corresponding operations based on the index of photo D and the fast sharing strategy. For specific operations, please refer to the operations of steps S604 to S606 in the following content.

[0136] When the image selection service determines that the image sharing strategy is the fast sharing strategy and the image index is the index of photo D, the image selection service can interact with the file system of electronic device 100 to detect the image generation status of photo D.

[0137] S604. The image selection service queries photo D in the file system to determine if a thumbnail and a medium-quality image of photo D exist, but a full-quality image of photo D does not exist.

[0138] The image selection service determines the image generation status by querying images of different qualities existing in the file system. The image selection service can query related images of photo D in the file system based on photo D's image index. The image generation status of photo D can be referenced as described above. Figure 3As shown in the diagram, when the image selection service determines that the highest quality image of the generated photo D is a medium-quality image, and the sharing strategy is a fast sharing strategy, the image selection service can choose to obtain the medium-quality image of photo D.

[0139] S605. The image selection service of electronic device 100 retrieves a medium-quality image of photo D from the file system.

[0140] S606. The image selection service of electronic device 100 returns image access result 1 to a third-party application, and image access result 1 includes a medium-quality image of photo D.

[0141] After the image selection service obtains the medium-quality image of photo D from the file system, it can return image access result 1 of photo D to the third-party application. Image access result 1 can include the medium-quality image of photo D.

[0142] Optionally, the image access result 1 may also include information such as the image quality and file identifier of the quality image in photo D. The file identifier of the quality image in photo D can be used to identify the quality image in the file system, and the electronic device 100 can read and write the quality image of photo D through this file identifier.

[0143] The image access result 1 can also be used to indicate whether the image access request was successful. When the request is successful, image access result 1 can include the image and parameters described above. When the request fails, image access result 1 can also include invalid parameters, internal errors, and other data.

[0144] S607. Third-party applications of electronic device 100 acquire and share medium-quality images of photo D.

[0145] After a third-party application of electronic device 100 obtains a medium-quality image of photo D, it can share the medium-quality image to the sharing target.

[0146] In this way, the third-party applications of electronic device 100, based on a fast sharing strategy, can guarantee successful sharing of images to the target. Generally, considering the browsability of images and the relatively fast generation speed of medium-quality images, the file system should generally contain at least a medium-quality image of the photo when a user shares it after taking a picture.

[0147] Therefore, the fast sharing strategy can be set to retrieve the highest quality image from the medium-quality and full-quality images of the target image in the file system. If a full-quality image of the target image exists in the file system, it can be returned normally.

[0148] If a full-quality image of the target image does not exist in the file system, but a medium-quality image of the target image does exist, the medium-quality image can be returned to the third-party application.

[0149] When the file system does not contain either a full-quality image or a medium-quality image of the target image, the image selection service can wait for the medium-quality image of the target image to be generated before returning it to the third-party application.

[0150] In this way, third-party applications can respond instantly to users' image sharing operations and immediately send a browsable image to the sharing target. In some examples, the fast sharing strategy can also be set to include a thumbnail. When the file system does not contain medium-quality and full-quality images of the target image, the image selection service can directly obtain a thumbnail of the target image and return it to the third-party application for sharing. The lower limit of image access quality for the fast sharing strategy can be set by the user, and this embodiment does not limit this.

[0151] Third-party applications can also access photo D based on high-quality sharing strategies. Figure 7 An exemplary flowchart illustrates a process when a third-party application employs a quality-sharing strategy. For example... Figure 7 As shown, electronic device 100 may include third-party applications, image selection services, image optimization services, and a file system. The process when a third-party application adopts a high-quality sharing strategy may include the following steps.

[0152] S701. The image selection service processes the raw image data of photo B.

[0153] S702. The third-party application of electronic device 100 receives the user's operation of sharing photo D, and sends an image access request 2 based on a high-quality sharing strategy.

[0154] When a third-party application of electronic device 100 adopts a high-quality sharing strategy, the generated image access request 2 may include the image index of photo D and the high-quality sharing strategy.

[0155] S703. The image selection service of electronic device 100 receives image access request 2, determines that the image index is the index of photo D, and sets the sharing strategy to high-quality sharing.

[0156] The image selection service can receive image access request 2 and provide an image access interface for third-party applications. After the image selection service obtains the index and high-quality sharing strategy of photo D from image access request 2, and determines the two parameters of image index and image sharing strategy, the image selection service can perform corresponding operations based on the image D index and high-quality sharing strategy. Specific operations can be found in the description of steps S704-S708 below, and will not be repeated here.

[0157] S704. The image selection service of electronic device 100 queries photo D in the file system and detects that a full-quality image of photo D does not exist in the file system.

[0158] The image generation process for photo D in the file system can be referenced above. Figure 3 As shown in the diagram, electronic device 100 has generated a thumbnail and a medium-quality image of photo D and stored them in the file system, but has not generated a full-quality image of photo D.

[0159] S705. The image selection service of electronic device 100 indicates that the image optimization service should prioritize the generation of a full-quality image of photo D.

[0160] If a full-quality image of photo D is not detected in the file system, the image selection service can send an instruction to the image optimization service based on a high-quality sharing strategy, instructing the image optimization service to prioritize generating a full-quality image of photo D.

[0161] S706. The image optimization service of electronic device 100 interrupts the processing of the original image data of photo B and generates a full-quality image of photo D.

[0162] When a third-party application adopts a high-quality sharing strategy, it can send an image access request, including the quality sharing strategy, to the image selection service. After confirming that the sharing strategy in the access request is a quality sharing strategy, the image selection service can first check whether a full-quality image of the target image exists in the file system. Based on the image index of photo D in the image access request, the image selection service detects that a full-quality image of photo D does not exist in the file system.

[0163] like Figure 3 As shown, at this time, only the full-quality image of photo A exists in the file system. However, according to the generation order, the image optimization service of electronic device 100 will first generate the full-quality images of photo B and photo C, and then generate the full-quality image of photo D.

[0164] When third-party applications adopt a high-quality sharing strategy, the image selection service can instruct the image optimization service to prioritize generating a full-quality image of photo D. The image optimization service can then prioritize the image generation task for photo D over photos B and C.

[0165] like Figure 8A As shown, under normal circumstances, the image optimization service of electronic device 100 can generate images according to the order in which they were taken, that is, in the order of photo A, photo B, photo C, photo D, and photo E. If images are generated according to this taking order, third-party applications need to wait for the full-quality images of photos B and C to be generated before they can obtain the full-quality image of photo D, which may result in excessively long waiting times for users.

[0166] Therefore, the image selection service can instruct the image optimization service to change the order of image generation tasks. The order of image generation tasks can be adjusted as follows: Figure 8BAs shown, the image optimization service can interrupt the processing of the original image data of photo B, prioritize the generation of a full-quality image of photo D, and then process the remaining images according to the order in which they were taken.

[0167] The above only concerns the order of photo generation tasks. Optionally, for the same photo, taking photo D as an example, if the thumbnail and medium-quality image of photo D have not yet been generated, the image optimization service can still prioritize generating the full-quality image of photo D for sharing, and then generate the thumbnail and medium-quality image of photo D later. This allows the electronic device 100 to respond more quickly to user sharing operations.

[0168] Optionally, during the process of generating a full-quality image of photo D by the image optimization service, a prompt message is displayed on the display interface of the electronic device 100. This prompt message can be used to inform the user that a full-quality image of photo D is being generated.

[0169] S707. The image optimization service of electronic device 100 stores a full-quality image of photo D to the file system.

[0170] After the full-quality image of photo D is generated, the image optimization service can store the full-quality image of photo D in the file system.

[0171] S708. The image selection service of electronic device 100 retrieves a full-quality image of photo D from the file system.

[0172] After the image optimization service stores a full-quality image of photo D in the file system, the image selection service can retrieve the full-quality image of photo D from the file system based on the image index of photo D.

[0173] S709. The image selection service of electronic device 100 returns image access result 2 to a third-party application, which includes a full-quality image of photo D.

[0174] After the full-quality image of photo D is stored in the file system, the image selection service can obtain this full-quality image. Then, the image selection service can return image access result 2 to the third-party application. Image access result 2 may include the full-quality image of photo D, and may also include data such as image quality and file identifier. Image access result 2 can also be used to indicate whether the image access request was successful. For details, please refer to the description of step S606 above, which will not be repeated here.

[0175] S710. Electronic device 100 third-party applications acquire and share full-quality images of photo D.

[0176] After obtaining the full-quality image of photo D, the third-party application can complete the sharing operation of photo D and send the full-quality image of photo D to the sharing target.

[0177] In this way, electronic device 100 can prioritize the generation of the target image, ensuring that a full-quality image of the target image is generated immediately when the application accesses the file system. This guarantees the quality of the shared image while preventing image sharing failures caused by third-party applications failing to acquire the image. This increases the success rate of users sharing full-quality images, reduces waiting time, and improves the user experience.

[0178] In some examples, third-party applications on electronic device 100 can also employ a balanced sharing strategy for image access. When a balanced sharing strategy is adopted, the image selection service will determine the load of electronic device 100. When the load is low, the image selection service can prioritize full-quality images; when the load is high, the image selection service can prioritize the highest-quality image currently available, or it can prioritize medium-quality images.

[0179] Figure 9 This diagram illustrates the process of how an electronic device 100 shares images using a balanced sharing strategy under different load conditions.

[0180] like Figure 9 As shown, the access process under low load may include the following steps.

[0181] S901. The third-party application of electronic device 100 receives the user's operation of sharing photo D, and sends an image access request 3 based on the balanced sharing strategy.

[0182] When the third-party application's image sharing strategy is a balanced sharing strategy, upon receiving a user's operation to share photo D, an image access request 3 can be generated and sent to the image selection service, including the balanced sharing strategy and the index of photo D.

[0183] S902. The image selection service of electronic device 100 receives image access request 3, determines that the image index is the index of photo D, and sets the sharing strategy to balanced sharing.

[0184] The specific process of the third-party application receiving user operations and generating access requests, and the image selection service receiving and confirming the content of the access request, can be found in the descriptions of steps S602 and S603 above, and will not be repeated here. The sharing strategy for image access request 3 is balanced sharing.

[0185] S903. The image selection service of electronic device 100 queries photo D and detects that a full-quality image of photo D does not exist in the file system.

[0186] The image selection service can also check if a full-quality image of photo D exists in the file system. If it does not exist, the next step can be performed.

[0187] It should be understood that the image sharing strategy in this application embodiment works in scenarios where a full-quality image of the target image does not exist in the file system. If a full-quality image already exists, the third-party application can directly obtain the full-quality image for sharing.

[0188] S904. The image selection service of electronic device 100 determines whether the load of electronic device 100 is lower than a preset threshold.

[0189] Once the electronic device 100 determines that the sharing strategy is balanced sharing, the load status of the electronic device 100 can be confirmed.

[0190] If the electronic device 100 is currently handling few tasks and its resources are idle, the image selection service can confirm that the electronic device 100 is under low load.

[0191] In one possible implementation, the electronic device 100 may include a central processing unit (CPU), a graphics processing unit (GPU), etc. The electronic device 100 can use the CPU and GPU to handle image optimization and image generation tasks. However, the CPU and GPU of the electronic device 100 are also used to handle other tasks. If there are many tasks, the CPU and GPU utilization will be high, and the electronic device 100 may not be able to generate the target image in a timely manner. The image selection service can determine the load of the electronic device 100 by measuring the CPU and GPU utilization.

[0192] For example, the image selection service can detect CPU and GPU utilization. When the CPU utilization is lower than a preset threshold 1, and / or the GPU utilization is lower than a preset threshold 2, the image selection service can determine that the CPU and GPU utilization are low, and at this time, the image selection service can determine that the load of the electronic device 100 is lower than the preset threshold. At this time, the electronic device 100 can promptly allocate resources for processing image optimization tasks and image generation tasks, and can support the image optimization service to perform operations such as prioritizing the generation of target full-quality images. The preset thresholds 1 and 2 can be pre-stored in the electronic device 100, or they can be generated in real time by the electronic device 100 based on the device's operating status during operation.

[0193] In some examples, when the load of electronic device 100 is below a preset threshold, electronic device 100 may perform the following process.

[0194] S905. The image selection service of electronic device 100 indicates that the image optimization service should prioritize the generation of full-quality images of photo D.

[0195] S906. The image optimization service of electronic device 100 increases the priority of the image generation task of photo D, and prioritizes the generation of full-quality images of photo D.

[0196] Since the image optimization service has a low load and can generate a full-quality image of photo D in a timely manner, the image selection service can instruct the image optimization service to increase the priority of the image generation task for photo D.

[0197] For details on steps S905 and S906, please refer to the description of steps S705 and S706 above, which will not be repeated here.

[0198] After the full-quality image of photo D is generated, the third-party application of electronic device 100 can obtain the full-quality image through the process of steps S907-S910 as described below, and send it to the sharing target. For the specific process, please refer to the description of steps S707-S710 above, which will not be repeated here.

[0199] S907. The image optimization service of electronic device 100 stores full-quality images of photo D to the file system.

[0200] S908. The image selection service of electronic device 100 retrieves a full-quality image of photo D from the file system.

[0201] S909. The image selection service of electronic device 100 returns image access result 2 to a third-party application, image access result 2 including a full-quality image of photo D.

[0202] S910. Third-party applications of electronic device 100 acquire and share full-quality images of photo D.

[0203] When the image selection service detects that the electronic device 100 is simultaneously performing image optimization or image generation tasks other than those for burst photos, it can determine the CPU and GPU utilization of the electronic device 100.

[0204] When the CPU utilization rate exceeds a preset threshold 1, and / or the GPU utilization rate exceeds a preset threshold 2, the image selection service can determine that the CPU and GPU utilization rates are high, and the image selection service can determine that the load on electronic device 100 is higher than the preset threshold. At this time, electronic device 100 has difficulty allocating resources in a timely manner to process the full-quality image generation task of photo D.

[0205] Alternatively, in some examples, the image selection service can detect that the task of generating a full-quality image of photo D is relatively complex. For example, generating a full-quality image of photo D requires processing through multiple image algorithms and takes a long time. That is, when the task of generating a full-quality image of photo D itself will cause the load of electronic device 100 to increase, this situation can also be identified as the load of electronic device 100 being higher than a preset threshold.

[0206] In some examples, when the load on electronic device 100 exceeds a preset threshold, electronic device 100 may perform the following process.

[0207] S911. The image selection service of electronic device 100 retrieves a medium-quality image of photo D from the file system.

[0208] If a full-quality image of photo D is difficult to generate in a timely manner, but a medium-quality image of photo D already exists in the file system, the image selection service can choose to obtain the medium-quality image of photo D instead of the full-quality image based on a balanced sharing strategy.

[0209] S912. The image selection service of electronic device 100 returns image access result 1 to a third-party application, and image access result 1 includes a medium-quality image of photo D.

[0210] S913. Third-party applications of electronic device 100 acquire and share medium-quality images of photo D.

[0211] Finally, the third-party application can promptly send a medium-quality image of photo D to the sharing target. This enables a rapid response to user sharing operations and avoids user waiting caused by the time-consuming process of generating a full-quality image of photo D.

[0212] In this way, the electronic device 100 can adaptively adjust the image quality of the shared images according to its own load, ensuring that the electronic device 100 can at least share browsable images under different load conditions. This avoids image sharing failures caused by high load or the target image not being generated.

[0213] In one possible implementation, the image sharing strategy can also be applied to scenarios where users share multiple images at once. The following will continue with... Figure 3 The image generation status shown illustrates a scenario where a user shares multiple images at once.

[0214] 1. Third-party applications of electronic devices 100 share multiple images based on a quick sharing strategy.

[0215] In some examples, third-party applications can employ a fast-sharing strategy. If a third-party application receives an operation from a user to share multiple images, it can use an image selection service to retrieve the highest-quality images generated for each image for sharing. For instance, after receiving an operation from a user to share photos A, C, and E, the third-party application can send an image access request including the indexes of photo A, C, and E, as well as the fast-sharing strategy. The image selection service intercepts this access request and determines the image generation status of photos A, C, and E in the file system. Figure 3As shown, a full-quality image of photo A has been generated, a medium-quality image of photo C has been generated, but a full-quality image has not been generated. Neither a medium-quality nor a full-quality image of photo E has been generated. Therefore, the image selection service can retrieve the highest quality image from the generated photos and return it, namely the full-quality image of photo A, the medium-quality image of photo C, and a thumbnail of photo E, and return these images to the third-party application. Alternatively, if the lower limit for image access quality in the quick-share strategy is medium-quality images, the image selection service, after retrieving the full-quality image of photo A and the medium-quality image of photo C, can also instruct the image optimization service to accelerate the generation of the medium-quality image of photo E, quickly generating a medium-quality image of photo E to return to the third-party application.

[0216] 2. Third-party applications of electronic devices 100 share multiple images based on a high-quality sharing strategy.

[0217] In other examples, third-party applications can also employ high-quality sharing strategies. If a third-party application receives an operation from a user to share multiple images, it can instruct the image optimization service to prioritize generating full-quality images of those images through the image selection service. For instance, after receiving an operation from a user to share photos A, C, and E, the third-party application can send an image access request including the indexes of photo A, photo C, and photo E, as well as a high-quality sharing strategy. The image selection service intercepts this request and, based on the high-quality sharing strategy, checks whether full-quality images of photos A, C, and E exist in the file system. Figure 3 As shown in the image generation status, when the image selection service detects that the full-quality image of photo A has been generated, but the full-quality images of photos C and E have not been generated, it can instruct the image optimization service to adjust the priority of the image generation tasks of photos C and E to be placed before that of photo B, and to generate the full-quality images of photos C and E first.

[0218] 3. Third-party applications of electronic device 100 share multiple images based on a balanced sharing strategy.

[0219] In other examples, third-party applications can also employ a balanced sharing strategy. If a third-party application receives an operation from a user to share multiple images, it can comprehensively adjust the priority of image generation tasks through an image selection service. For example, after receiving an operation from a user to share photos A, C, and E, the third-party application can send an image access request that includes the indexes of photo A, photo C, and photo E, as well as the balanced sharing strategy.

[0220] After intercepting the request, the image selection service detects the load on electronic device 100 based on its load balancing strategy. If the load on electronic device 100 is detected to be high, the image selection service can adjust the priority of image generation tasks with generation speed as the target.

[0221] During multi-image sharing, the image selection service can allocate the ratio of full-quality images to medium-quality images in the shared images based on the specific load of the electronic device 100. For example, if the electronic device 100's load only supports generating full-quality images of three images in a timely manner, the image selection service can select three images from the target images to generate full-quality images. For the remaining target images, if a full-quality image already exists, the image selection service can retrieve that full-quality image; if no full-quality image has been generated, the image selection service can retrieve a medium-quality image.

[0222] For example, the image selection service detects that a full-quality image of photo A has been generated, a medium-quality image of photo C has been generated, and neither a medium-quality nor a full-quality image of photo E has been generated. In this case, the image selection service can determine that the full-quality image of photo A can be directly shared, that although a full-quality image of photo C has not been generated, its quality image can also be used for sharing, and that no shareable image exists for photo E, while the electronic device 100 is under high load. Therefore, the image selection service can prioritize obtaining the full-quality image of photo A and the medium-quality image of photo C, and instruct the image optimization service to prioritize generating either a full-quality or medium-quality image of photo E. The image selection service can choose not to process the full-quality image generation task for photo C, and only obtain the medium-quality image of photo C to return to the third-party application. This reduces user waiting time caused by the busy image optimization service, while ensuring that at least all selected images can be successfully shared.

[0223] If the image selection service detects that the load on electronic device 100 is low, meaning the image optimization service can prioritize generating target images without affecting other functions, the image selection service can prioritize the image generation tasks of photos C and E before photo B, and obtain full-quality images of photos C and E. Optionally, the image selection service can also determine the workload of a user sharing multiple images at once. If generating full-quality images of all target images takes too long or requires a lot of image optimization resources, the image selection service can selectively obtain medium-quality images of some images and return them to the third-party application. This application embodiment does not limit the specific execution strategy of the balanced sharing strategy.

[0224] As mentioned above, the image sharing strategy adopted by third-party applications can be set by the user, and each third-party application can only use one image sharing strategy at a time. Figure 10 and Figure 11 An exemplary diagram illustrates a user settings application's image sharing strategy.

[0225] like Figure 10As shown, the electronic device 100 can display a user interface 1000, which can serve as an application permission management interface for the electronic device 100. The user interface 1000 may include a control 1001. This control 1001 can be used to open the application's image sharing policy management interface. The electronic device 100 can respond to a user's click on the control 1001, displaying, as shown... Figure 11 The user interface 1100 is shown. User interface 1100 may include controls 1101, 1102, and 1103. These three controls are used to set the application to adopt a fast sharing, high-quality sharing, and balanced sharing strategy, respectively. For example, electronic device 100 can respond to the user's operation on control 1102 to set the application's image sharing strategy to a high-quality sharing strategy. Thus, when a user shares an image through the application, the application can prioritize obtaining the full-quality image of the target image through an image selection service.

[0226] In this way, electronic device 100 can determine the target quality of the shared images through image sharing strategies. Figure 12 An exemplary schematic diagram of the process of sharing pictures by an electronic device 100 is shown.

[0227] like Figure 12 As shown, the process of sharing pictures by electronic device 100 may include the following steps.

[0228] S1201. In response to the first operation, the first image is selected, and the electronic device 100 includes a first quality image of the first image.

[0229] This first action allows the user to open the application's media index interface and select the first image within it. For detailed instructions, please refer to the section above. Figure 4A The description will not be repeated here.

[0230] The first quality map of the first image can be the medium quality map described in the above embodiments. The first quality map of the first image may include a first index, which can be used to indicate that the image corresponds to the first image and that the image quality of the image is first quality.

[0231] S1202. In response to the second operation, share the target quality image of the first image based on the image sharing strategy.

[0232] The second operation can be an action performed by the user clicking the send control, for example, such as... Figure 4A As shown, the user's click operation on control 406 after selecting an image can be referred to as the second operation. The image quality of the target quality image can be either a first quality or a second quality. The second quality is higher than the first quality. The second quality image of the first image can be the full quality image described in the above embodiments.

[0233] The image sharing strategy can be set by the user or it can be the default setting of the electronic device 100. The image sharing strategy can include a fast sharing strategy, a high-quality sharing strategy, and a balanced sharing strategy.

[0234] When the image sharing strategy is a fast sharing strategy, the target quality image of the first image shared by the electronic device 100 can be either the first quality image or the second quality image of the first image.

[0235] When the image sharing strategy is a high-quality sharing strategy, the target quality image of the first image shared by the electronic device 100 may include the second quality image of the first image.

[0236] When the image sharing strategy is a balanced sharing strategy, the target quality image of the first image shared by the electronic device 100 can be either the first quality image of the first image or the second quality image of the first image.

[0237] The specific process for electronic devices to share the target quality image of the first image based on different image sharing strategies can be found in the above content. Figure 6 , Figure 7 and Figure 9 The description will not be repeated here.

[0238] The following describes an exemplary electronic device 100 provided in an embodiment of this application.

[0239] Figure 13 This is a schematic diagram of the hardware structure of the electronic device 100 provided in the embodiments of this application.

[0240] The following detailed description uses electronic device 100 as an example. It should be understood that electronic device 100 may have more or fewer components than shown in the figures, may combine two or more components, or may have different component configurations. The various components shown in the figures can be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application-specific integrated circuits.

[0241] Electronic device 100 may include: processor 110, external memory interface 120, internal memory 121, antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, sensor module 180, camera 193, display screen 194, etc. Sensor module 180 may include pressure sensor 180A, proximity sensor 180F, fingerprint sensor 180H, touch sensor 180K, ambient light sensor 180L, etc.

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

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

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

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

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

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

[0248] The modem processor may include a modulator and a demodulator. The modulator modulates the low-frequency baseband signal to be transmitted into a mid-to-high frequency signal. The demodulator demodulates the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After processing by the baseband processor, the low-frequency baseband signal is transmitted to the application processor. The application processor displays images or videos via the display screen 194. In some embodiments, the modem processor may be a separate device. In other embodiments, the modem processor may be independent of the processor 110 and may be housed within the same device as the mobile communication module 150 or other functional modules.

[0249] 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, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.

[0250] 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). In some examples, electronic device 100 can share images with other devices via wireless communication module 160 or mobile communication module 150.

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

[0252] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a miniature LED, a microLED, a quantum dot light-emitting diode (QLED), etc. In some examples, display screen 194 of electronic device 100 can be used to display user interfaces such as chat interfaces, image selection interfaces, and application permission management interfaces for third-party applications.

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

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

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

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

[0257] The external storage interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, music, video, and other files can be saved on the external memory card.

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

[0259] Pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. In some embodiments, pressure sensor 180A can be disposed on display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, and capacitive pressure sensors. A capacitive pressure sensor may include at least two parallel plates with conductive material. When force is applied to pressure sensor 180A, the capacitance between the electrodes changes. Electronic device 100 determines the pressure intensity based on the change in capacitance. When a touch operation is applied to display screen 194, electronic device 100 detects the intensity of the touch operation based on pressure sensor 180A. Electronic device 100 can also calculate the touch position based on the detection signal from pressure sensor 180A. In some embodiments, touch operations applied to the same touch position but with different touch operation intensities can correspond to different operation commands. For example, when a touch operation with an intensity less than a first pressure threshold is applied to the SMS application icon, a command to view an SMS is executed. When a touch operation with an intensity greater than or equal to the first pressure threshold is applied to the SMS application icon, a command to create a new SMS is executed.

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

[0261] The ambient light sensor 180L is used to sense the ambient light intensity. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the sensed ambient light intensity. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures.

[0262] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can utilize the characteristics of the collected fingerprints to achieve fingerprint unlocking, accessing application locks, taking photos with fingerprints, answering calls with fingerprints, etc.

[0263] Touch sensor 180K, also known as a "touch panel," can be located on display screen 194. The touch sensor 180K and display screen 194 together form a touchscreen, also known as a "touch screen." Touch sensor 180K detects touch operations applied to or near it. 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.

[0264] This application also provides an electronic device that may include a memory, a processor, and a computer program stored in the memory. The processor executes the computer program to implement the method executed on the electronic device side (central control device, hub device, smart home device, etc.) as described in any of the above embodiments.

[0265] This application also provides a chip system including at least one processor for implementing the methods executed on the electronic device side in any of the above embodiments. In one possible design, the chip system further includes a memory for storing program instructions and data, the memory being located within or outside the processor.

[0266] A chip system can consist of chips or include chips and other discrete components.

[0267] Optionally, there may be one or more processors in the chip system. The processor can be implemented in hardware or software. When implemented in hardware, the processor can be a logic circuit, integrated circuit, etc. When implemented in software, the processor can be a general-purpose processor, implemented by reading software code stored in memory.

[0268] Optionally, the chip system may contain one or more memories. These memories may be integrated with the processor or disposed separately; this application does not limit this. For example, the memory may be a non-transient processor, such as a read-only memory (ROM), which may be integrated with the processor on the same chip or disposed on different chips. This application does not specifically limit the type of memory or the arrangement of the memory and processor.

[0269] For example, the chip system may be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a central processor unit (CPU), a network processor (NP), a digital signal processor (DSP), a micro controller unit (MCU), a programmable logic device (PLD), or other integrated chips.

[0270] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the method executed on the electronic device side in any of the above embodiments.

[0271] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the method executed on the electronic device side as in any of the above embodiments.

[0272] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

[0273] As used in the above embodiments, depending on the context, the term "when..." can be interpreted as meaning "if...", "after...", "in response to determining...", or "in response to detecting...". Similarly, depending on the context, the phrase "when determining..." or "if (the stated condition or event) is interpreted as meaning "if determining...", "in response to determining...", "when (the stated condition or event) is detected", or "in response to detecting (the stated condition or event)".

[0274] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another 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 that a computer can access 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 drive), etc.

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

Claims

1. A picture sharing method, characterized by, The method is applied to an electronic device, and the method includes: First shooting operation detected; Generate a first-quality image of the first image; In response to a first sharing operation in a first application, it is determined that a second quality image of the first image has not been generated, and the sharing strategy of the first application indicates that a second quality image of the first image should be generated and returned first, wherein the quality of the second quality image of the first image is higher than that of the first quality image of the first image. Generate a second quality image of the first image; Share a second quality image of the first image; A second quality image of the second image is generated, wherein the electronic device generates the first quality image of the second image earlier than the electronic device generates the first quality image of the first image, and the quality of the second quality image of the second image is higher than that of the first quality image of the second image.

2. The method of claim 1, wherein, The method further includes: A second shooting operation has been detected; Generate the first quality image of the third image; In response to a second sharing operation in the second application, if it is determined that a second quality image of the third image has not been generated, and the sharing strategy of the second application indicates that the highest quality image of the third image has been generated, then the first quality image of the third image is shared. A second quality image of the third image is generated, wherein the quality of the second quality image of the third image is higher than that of the first quality image of the third image.

3. The method according to claim 1 or 2, characterized in that, The method further includes responding to the first sharing operation of the first application after: Detect whether a second quality image exists for the first image.

4. The method of claim 1, wherein, The time interval between the first sharing operation and the first shooting operation is less than a first duration, and the first duration is less than the time required to generate the second quality image of the first image.

5. The method of claim 4, wherein, Before generating a second quality image of the first image, the method further includes: A first prompt is displayed, indicating that the electronic device is generating a second quality image of the first image.

6. The method according to claim 5, characterized in that, Generating a second quality image of the first image specifically includes: If the load of the electronic device is detected to be lower than or equal to a first threshold, a second quality image of the first image is generated, where the first threshold is the highest value at which the electronic device operates under low load.

7. The method according to claim 2, characterized in that, The first quality image of the third image is shared, specifically including: In response to the second sharing operation, if the load of the electronic device is detected to be higher than or equal to a second threshold, a first quality image of the third image is shared, where the second threshold is the minimum value for high load operation of the electronic device.

8. The method according to any one of claims 4-7, characterized in that, The first quality image of the first image includes a first index, which is used to indicate the first quality image of the first image.

9. An electronic device, characterized in that, include: A memory, a processor, and a computer program stored on the memory, wherein the processor executes the computer program to implement the method as described in any one of claims 1-8.

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

11. A chip system applied to an electronic device, characterized in that, The chip system includes one or more processors, which are configured to invoke computer instructions to cause the electronic device to perform the method as described in any one of claims 1-8.

12. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the method as described in any one of claims 1-8.