Wallpaper generation method, device, storage medium, and program product

CN123030254APending Publication Date: 2026-11-03HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510577874.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-30
Publication Date
2026-11-03

AI Technical Summary

Technical Problem

In existing technologies, users have limited options for setting wallpapers, which makes it difficult to meet personalized needs. Users need to manually select wallpapers from the image library pre-installed on their electronic devices.

Method used

Electronic devices select target image sets from a preset image set according to image filtering rules, and generate personalized, diverse, and high-quality target wallpapers by combining them with wallpaper templates. The rules include the number of subjects to be filtered, resolution, date, tags, and aesthetic ratings, and the JSON file is used for efficient parsing and filtering.

Benefits of technology

It improves the flexibility and efficiency of wallpaper generation, recommends personalized, diverse, and high-quality wallpapers, enhances user experience, and reduces the user's workload.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123030254A_ABST
    Figure CN123030254A_ABST
Patent Text Reader

Abstract

The application discloses a wallpaper generation method and device, a storage medium and a program product, and belongs to the technical field of terminals. The method comprises the following steps: determining a first target image set in a preset image set according to a first image screening rule. One or more target wallpapers are generated according to the first target image set and one or more wallpaper templates. The first image screening rule comprises at least one of the following multiple screening rules: the number of subjects in the image is less than or equal to a subject number threshold; the resolution of the image is greater than or equal to a resolution threshold; the date of the image is within a preset date range; the label of the target in the image does not belong to a preset label blacklist, or the label of the target in the image belongs to a preset label whitelist; the aesthetic score of the image is greater than or equal to a first aesthetic score threshold; and the image is the one with the highest aesthetic score in multiple similar images. The application can generate target wallpapers that are relatively in line with user preferences and have good visual effects, thereby improving user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] With the rapid development of terminal technology, mobile phones, tablets, and other electronic devices are now ubiquitous, bringing great convenience to people's daily lives. Users often enhance the aesthetics of their electronic devices by setting lock screen and desktop wallpapers. However, the current methods for setting wallpapers are relatively limited; users can generally only manually select images from the device's pre-installed image library, which fails to meet users' personalized needs. Summary of the Invention

[0003] This application provides a wallpaper generation method, device, storage medium, and program product, which helps to recommend personalized, diverse, and high-quality wallpapers to users. The technical solution is as follows:

[0004] Firstly, a wallpaper generation method is provided. In this method, an electronic device determines a first target image set within a preset image set according to a first image filtering rule. The first target image set includes one or more target images. Based on the first target image set and one or more wallpaper templates, one or more target wallpapers are generated.

[0005] In this application, the target image set can also be called a selected photo set, such as a first target image set which can also be called a first selected photo set, and a second target image set which can also be called a second selected photo set. Target images can also be called selected photos. Target wallpapers can also be called selected wallpapers.

[0006] A preset image set may include one or more images. The images in the preset image set are images obtained through user operations, such as taking a picture, taking a screenshot, or saving an image.

[0007] The first image filtering rule includes at least one of the following filtering rules: the number of subjects in the image is less than or equal to the number of subjects threshold; the resolution of the image is greater than or equal to the resolution threshold; the date of the image is within a preset date range; the label of the target in the image does not belong to the preset label blacklist, or the label of the target in the image belongs to the preset label whitelist; the aesthetic score of the image is greater than or equal to the first aesthetic score threshold; and the image is the one with the highest aesthetic score among multiple similar images.

[0008] If the number of subjects in an image is less than or equal to a subject number threshold, it indicates that the image has a relatively small number of subjects. Too many subjects can lead to a cluttered image and a lack of focus; a moderate number of subjects helps to highlight the subject. Therefore, images with fewer subjects can generate wallpapers with better visual effects. If the image resolution is greater than or equal to a resolution threshold, it indicates that the image has a high resolution. High-resolution images ensure clarity and rich detail. Therefore, high-resolution images can generate wallpapers with better visual effects. Images stored within a preset date range are images that the user has recently been interested in; therefore, wallpapers generated based on these images can, to some extent, meet the user's aesthetic needs. If the target's tag in an image is not on a preset tag blacklist, or if the target's tag in an image is on a preset tag whitelist, it means that the target in the image can appear in the wallpaper, and therefore, the image can be used to generate wallpaper. If the image's aesthetic score is greater than or equal to a first aesthetic score threshold, it indicates that the image has a high aesthetic score, that is, a high level of visual appeal. Therefore, images with high aesthetic scores can generate wallpapers with high quality and visual appeal. In the case of multiple similar images, to avoid generating wallpapers that are too similar, the image with the highest aesthetic score is selected from these multiple similar images to generate the wallpaper. This approach can result in higher quality wallpapers while also mitigating the problem of wallpaper duplication or excessive similarity to some extent.

[0009] In this application, the images in the preset image set are those that the user is relatively interested in. The first target image set, selected from the preset image set according to the first image filtering rules, consists of images that are of good quality and of interest to the user. Therefore, one or more target wallpapers generated based on the first target image set and one or more wallpaper templates are wallpapers that relatively match user preferences and have good visual effects. This not only improves the flexibility and efficiency of wallpaper generation but also allows for subsequent recommendations of these personalized, diverse, and high-quality wallpapers to the user, enhancing the user experience.

[0010] In one possible approach, the operation of the electronic device to determine the first target image set in the preset image set according to the first image filtering rule can be as follows: when the state of the electronic device meets the preset conditions, the first target image set in the preset image set is determined according to the first image filtering rule.

[0011] For example, the preset conditions include at least one of the following: the electronic device is in a screen-off state; the electronic device's battery level is greater than or equal to a battery threshold; the electronic device is charging; or the electronic device is in an idle period.

[0012] If an electronic device is in a screen-off state, it means the user is unlikely to use it. Furthermore, electronic devices are typically in a low-power mode when the screen is off. Therefore, background tasks performed in this state consume minimal power and will not disturb the user.

[0013] The battery level of an electronic device refers to its current remaining power, usually expressed as a percentage. If the battery level is greater than or equal to a certain threshold, the device has sufficient power. Therefore, performing background tasks in this state generally will not deplete the battery.

[0014] If an electronic device is charging, the power required for task execution can usually be provided by the charger and will not consume battery power. Therefore, performing background tasks in this situation generally will not cause the battery to drop rapidly.

[0015] Idle periods are the time periods allowed to execute background tasks, either by system default or manually set by the user. Idle periods are times when users are unlikely to use electronic devices. Executing background tasks during idle periods has minimal disruption to the user.

[0016] In one possible approach, the operation of determining the first target image set in the preset image set according to the first image filtering rule can be as follows: if the time difference between the current time and the time of the last execution of the target wallpaper generation task is greater than or equal to a first time duration threshold, the first target image set in the preset image set is determined according to the first image filtering rule.

[0017] In this application, by controlling the time interval reasonably, not only can the poor user experience or unnecessary disturbance caused by frequent updates be avoided to a certain extent, but device performance and resource utilization can also be optimized. At the same time, this also ensures that the target wallpaper does not change too frequently, but maintains a certain update rhythm.

[0018] In one possible approach, for any two images in a preset image set, image features of each image are acquired to obtain two image features. If the similarity between the two image features is greater than or equal to a first similarity threshold, the two images are determined to be similar images. If the similarity between the two image features is less than the first similarity threshold, and if the similarity between the two image features is greater than or equal to a second similarity threshold and the time interval between the shooting times of the two images is less than or equal to a second time interval threshold, or if the similarity between the two image features is greater than or equal to the second similarity threshold and the two images were shot at the same location, or if the time interval between the shooting times of the two images is less than or equal to the second time interval threshold and the two images were shot at the same location, then the two images are determined to be similar images.

[0019] If the similarity between the features of the two images is greater than or equal to the second similarity threshold, and the time interval between the capture times of the two images is less than or equal to the second time interval threshold, it indicates that the two images are similar images captured within a short period of time. For example, they are very likely images taken multiple times by the user of the same object within a short period of time. Therefore, the two images can be determined to be similar images.

[0020] If the similarity between the features of the two images is greater than or equal to the second similarity threshold, and the two images were taken at the same location, it indicates that the two images are similar images taken at the same location. For example, they are very likely images taken multiple times by the user at the same location. Therefore, the two images can be determined to be similar images.

[0021] The two images were taken at the same location within a short period of time, meaning the time interval between their captures is less than or equal to the second time threshold. This indicates that the two images are similar images captured at the same location within a short period of time. For example, they could be images taken multiple times by the user at the same location within a short timeframe. Therefore, the two images can be identified as similar.

[0022] In one possible approach, the first image filtering rules are described through an image filtering file, which is a JSON file. JSON files have a simple and efficient format, with straightforward syntax rules, making data parsing more efficient. Therefore, when the image filtering file is a JSON file, it can be parsed relatively quickly to obtain the various information needed when filtering images.

[0023] In one possible approach, the operation of determining the first target image set in the preset image set according to the first image filtering rule can be: creating one or more filters according to the first image filtering rule; filtering the preset image set through the one or more filters to obtain the first target image set.

[0024] In this way, by using the chain of responsibility pattern to filter images in the preset image set through each filter in turn, multi-dimensional and multi-level filtering of images can be achieved, and the first target image set in the preset image set can be quickly and accurately selected.

[0025] In one possible approach, the operation of generating one or more target wallpapers based on a first target image set and one or more wallpaper templates can be: generating one or more target wallpapers based on the first target image set and wallpaper generation rules. Here, the wallpaper generation rules include n sets of slot rules, where n is a positive integer.

[0026] Each of the n slot rules includes one or more tag identifiers and one or more rule identifiers. Tag identifiers indicate the tags the image should have, and rule identifiers indicate the wallpaper template to be used. This allows for flexible association between rule identifiers and wallpaper templates. When it's necessary to adjust the wallpaper templates indicated by multiple slot rules in batches, only the wallpaper template identifier corresponding to the rule identifier needs to be adjusted, without needing to adjust each slot rule individually. This greatly improves the flexibility and efficiency of configuration.

[0027] Alternatively, any one of the n slot rules may include one or more tag identifiers, one or more rule identifiers, and a depth requirement; the depth requirement indicates that the image should achieve a depth effect. Thus, the tag identifiers are used to filter images, the rule identifiers are used to specify wallpaper templates, and the depth requirement is used to further filter images, ensuring that the generated wallpaper meets both thematic requirements and visual appeal.

[0028] In one possible approach, the wallpaper generation rule may also include one or more of the following: main tag, sub-tag, wallpaper template information, wallpaper selection rule, number of first wallpapers, number of second wallpapers, number of preset wallpaper groups, slot filling rule, group filling rule, new image insertion rule, and second aesthetic score threshold.

[0029] Wallpaper template information is used to indicate the correspondence between rule identifiers and wallpaper template identifiers; wallpaper selection rules are used to indicate the rules for selecting at least one set of wallpapers to be displayed from multiple sets of wallpapers; the first wallpaper quantity is the minimum limit value for the number of wallpapers in a set of wallpapers; the second wallpaper quantity is the maximum limit value for the number of wallpapers in a set of wallpapers; the preset number of wallpaper sets is the maximum limit value for the number of wallpaper sets; the slot filling rule is used to indicate the filling rules for the remaining slots when the number of wallpapers in a set of wallpapers is less than the second wallpaper quantity; the group filling rule is used to indicate the filling rules for the remaining groups when the number of wallpaper sets is less than the preset number of wallpaper sets; the new image insertion rule is used to indicate the insertion rules for new images; the second aesthetic score threshold is the aesthetic score threshold that the new image must meet.

[0030] For example, wallpaper generation rules are described through a wallpaper generation file, which is a JSON file. JSON files have a simple and efficient format, with straightforward syntax rules and more efficient data parsing. Therefore, when the wallpaper generation file is a JSON file, it can be parsed quickly to obtain the various information needed when generating the wallpaper.

[0031] In one possible approach, the operation of generating one or more target wallpapers based on the first target image set and the wallpaper generation rules can be: traversing n sets of slot rules in the wallpaper generation rules; for the currently traversed set of slot rules, generating a set of target images based on that set of slot rules and the first target image set.

[0032] In one possible approach, the operation of generating a set of target images based on the set of slot rules and the first target image set can be as follows: traverse each slot rule in the set of slot rules; for the currently traversed slot rule, let i = 1; filter out all images corresponding to the i-th tag identifier in the slot rule from the first target image set to obtain a second image set; determine the specified image from the second image set; let j = 1; if the specified image matches the wallpaper template indicated by the j-th rule identifier in the slot rule, generate a target image based on the specified image and the wallpaper template.

[0033] In one possible approach, where the slot rule does not include depth of field requirements, a two-dimensional matrix is ​​generated based on the transparent areas of each layer in the wallpaper template, excluding the original layer, the cutout layer, and the clock layer. Based on the face region in the specified image, the two-dimensional matrix, and the clock region in the wallpaper template, it is determined whether face occlusion exists. If face occlusion exists, it is determined that the specified image does not match the wallpaper template; if face occlusion does not exist, it is determined that the specified image matches the wallpaper template.

[0034] For example, the operation of determining whether there is face occlusion based on the face region in the specified image, the two-dimensional matrix, the clock region and the small window region in the wallpaper template can be as follows: determine whether the face region is completely below the clock region, and determine whether the face region overlaps with the non-transparent region indicated by the two-dimensional matrix; if the face region is completely below the clock region and the face region does not overlap with the non-transparent region, determine that there is no face occlusion; otherwise, determine that there is face occlusion.

[0035] If the face area is completely below the clock area and does not overlap with the non-transparent area, it means that the face is not obscured by the clock or any other non-transparent area, and therefore it can be determined that there is no face obscuration.

[0036] In one possible approach, if the slot rule includes a depth-of-field requirement and the wallpaper template includes a color background layer, it is determined whether there is a subject misalignment based on the subject area in the specified image, the clock area, the edge area, and the bottom area in the wallpaper template; if the subject misalignment exists, it is determined that the specified image does not match the wallpaper template; if the subject misalignment does not exist, it is determined that the specified image matches the wallpaper template.

[0037] For example, the operation of determining whether there is a subject misalignment based on the subject area in the specified image, the clock area, the edge area, and the bottom area in the wallpaper template can be as follows: determining whether the subject area is completely below the clock area, determining whether the subject area overlaps with the edge area, and determining whether the subject area completely covers the bottom area; if the subject area is not completely below the clock area, overlaps with the edge area, and completely covers the bottom area, it is determined that there is no subject misalignment; otherwise, it is determined that there is a subject misalignment.

[0038] If the main subject area is not completely below the clock area, overlaps with the edge area, and completely covers the bottom area, it indicates that at least a portion of the main subject is above the bottom of the clock area. Furthermore, the main subject extends to the edge of the wallpaper and fills the bottom of the wallpaper. Therefore, it can be determined that the proportions of the main subject are relatively harmonious and blend well with the edge of the wallpaper. Thus, it can be confirmed that there is no subject imbalance.

[0039] In one possible approach, a new image set is determined from a preset image set; a second target image set is determined from the new image set according to a second image filtering rule, the second image filtering rule including some of the filtering rules in the first image filtering rule; and one or more target wallpapers are generated based on the second target image set and one or more wallpaper templates.

[0040] In this application, target wallpapers can be generated by referring to images added to the preset image set compared to the previous target wallpaper generation task, thereby achieving incremental updates of the target wallpaper. This not only yields target wallpapers that better meet user needs but also saves processing resources and time, improving wallpaper generation efficiency.

[0041] In addition, the second image filtering rule includes some of the filtering rules from the first image filtering rule, meaning the second image filtering rule is more lenient than the first. This is done to use as many recently added images as possible to generate the target wallpaper. Because users are generally more interested in recently added images, and these images are those that users have been interested in recently, the target wallpaper generated based on these newly added images can better match the user's recent preferences.

[0042] In one possible approach, the operation of generating one or more target wallpapers based on a second target image set and one or more wallpaper templates can be as follows: determining a fourth image set in the second target image set based on a second aesthetic score threshold; traversing the images in the fourth image set in descending order of aesthetic scores; for a currently traversed image, determining a target wallpaper template based on the target's label identifier in the image; and generating a target image based on the image and the target wallpaper template if the image matches the target wallpaper template.

[0043] In this application, for the second target image set, the corresponding target wallpaper template can be directly determined based on the target's label in the image to generate the target wallpaper. This allows for the generation of target wallpapers based on recently added images with high aesthetic scores, i.e., those with good visual effects, aiming to improve user wallpaper satisfaction.

[0044] Secondly, a wallpaper generation apparatus is provided, which has the function of implementing the wallpaper generation method described in the first aspect. The wallpaper generation apparatus includes at least one module for implementing the wallpaper generation method provided in the first aspect.

[0045] Thirdly, an electronic device is provided, comprising: one or more processors, and a memory; the memory is coupled to the one or more processors, the memory being used to store computer program code including computer instructions, the one or more processors invoking the computer instructions to cause the electronic device to perform the wallpaper generation method provided in the first aspect.

[0046] Fourthly, a chip system is provided for use in an electronic device, the chip system including one or more processors for invoking computer instructions to cause the electronic device to execute the wallpaper generation method provided in the first aspect.

[0047] Fifthly, a computer-readable storage medium is provided, the computer-readable storage medium including instructions that, when executed on an electronic device, cause the electronic device to perform the wallpaper generation method provided in the first aspect.

[0048] In a sixth aspect, a computer program product is provided that, when the computer program product is run on an electronic device, causes the electronic device to execute the wallpaper generation method provided in the first aspect.

[0049] The technical effects achieved by the second, third, fourth, fifth, and sixth aspects mentioned above are similar to those achieved by the corresponding technical means in the first aspect mentioned above, and will not be repeated here. Attached Figure Description

[0050] Figure 1 This is a schematic diagram illustrating an example of entering a wallpaper editing interface provided in this application embodiment;

[0051] Figure 2 This is a schematic diagram of entering a lock screen style interface provided in an embodiment of this application;

[0052] Figure 3 This is a schematic diagram illustrating the display position of a wallpaper according to an embodiment of this application;

[0053] Figure 4 This is a schematic diagram illustrating the switching of multiple wallpapers provided in an embodiment of this application;

[0054] Figure 5 This is a schematic diagram of a multi-layer structure provided in an embodiment of this application;

[0055] Figure 6 This is a schematic diagram of another type of multiple layers provided in an embodiment of this application;

[0056] Figure 7 This is a schematic diagram of a wallpaper provided in an embodiment of this application;

[0057] Figure 8 This is a schematic diagram of a selected wallpaper provided in an embodiment of this application;

[0058] Figure 9 This is a schematic diagram of a layer in a selected wallpaper provided in an embodiment of this application;

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

[0060] Figure 11 This is a block diagram of a software system for an electronic device provided in an embodiment of this application;

[0061] Figure 12 This is a block diagram of a software system for another electronic device provided in an embodiment of this application;

[0062] Figure 13 This is a flowchart of a wallpaper generation method provided in an embodiment of this application;

[0063] Figure 14 This is a schematic diagram of an image filtering file provided in an embodiment of this application;

[0064] Figure 15 This is a schematic diagram of multiple filters provided in an embodiment of this application;

[0065] Figure 16 This is a schematic diagram of a wallpaper generation file provided in an embodiment of this application;

[0066] Figure 17 This is a schematic diagram of a wallpaper file provided in an embodiment of this application;

[0067] Figure 18 This is a schematic diagram of a two-dimensional matrix provided in an embodiment of this application;

[0068] Figure 19 This is a flowchart of another wallpaper generation method provided in the embodiments of this application. Detailed Implementation

[0069] In the following description, specific details such as particular system architectures and technologies are set forth for illustrative purposes and not for limiting purposes, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details.

[0070] It should be understood that, when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or collections thereof. The terms "comprising," "including," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.

[0071] It should be understood that "one or more" as mentioned in this application refers to one, two, or more, and "multiple" as mentioned in this application refers to two or more. In the description of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B. The "and / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone.

[0072] To facilitate a clear description of the technical solutions of this application, the terms "first" and "second" are used to distinguish identical or similar items with essentially the same function and effect. Those skilled in the art will understand that the terms "first" and "second" do not limit the quantity or execution order, and that the terms "first" and "second" do not necessarily imply that they are different.

[0073] The terms "one embodiment" or "some embodiments" used in this application mean that one or more embodiments of this application include the specific features, structures, or characteristics described in that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this application do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized.

[0074] With the continuous development of terminal technology, electronic devices such as mobile phones and tablets are becoming increasingly popular, bringing great convenience to people's daily lives. Users can set wallpapers for the lock screen and desktop of their electronic devices to enhance their aesthetics. However, currently, changing the wallpaper on an electronic device often requires users to manually select an image from the device's preset pictures or those managed by a gallery application. This limited wallpaper setting method fails to meet users' personalized needs.

[0075] Therefore, this application provides a wallpaper generation method. In this method, an electronic device can generate multiple selected wallpapers based on one or more high-quality images managed by a gallery application, combined with one or more preset wallpaper templates. Each selected wallpaper is generated based on an image and a wallpaper template. Users can choose a preferred wallpaper from these multiple selected wallpapers and set it as the wallpaper of their electronic device, such as as a lock screen wallpaper and / or desktop wallpaper. The lock screen wallpaper is the wallpaper displayed on the lock screen of the electronic device, which is the interface displayed when the electronic device is locked. The desktop wallpaper is the wallpaper displayed on the desktop of the electronic device.

[0076] In this embodiment, the electronic device can automatically analyze and select high-quality images, eliminating the need for users to manually browse through numerous images to find their ideal wallpaper, thus saving time and effort. Furthermore, the images managed by the gallery application are generally obtained by users through actions such as taking photos, saving, or screenshotting, and these images tend to align with the user's aesthetic preferences to a certain extent. Therefore, generating curated wallpapers based on these images and wallpaper templates allows wallpaper recommendations to better match user preferences and enhance personalization. Thus, the function of providing curated wallpapers based on images and wallpaper templates managed by the gallery application can recommend personalized, diverse, and visually appealing wallpapers to users, thereby improving the convenience and intelligence of wallpaper selection, reducing the user's operational burden, and enhancing the user experience.

[0077] In some implementations, the selected wallpapers provided in this application can be displayed in a wallpaper editing interface. The wallpaper editing interface can be accessed in various ways, which will be discussed below. Figures 1 to 2 This will be illustrated by example.

[0078] The following is combined Figure 1 The first possible approach is illustrated by example:

[0079] like Figure 1 As shown in (a), the electronic device displays interface 21. Interface 21 can display icons for multiple applications, such as file management, video, calculator, and weather applications. Optionally, interface 21 can be referred to as the main interface or desktop. Subsequently, the electronic device receives operations applied to interface 21. Figure 1 (a) In the example of the two-finger pinching operation, the response to this operation is as follows: Figure 1 As shown in (b), the electronic device can display interface 22. Interface 22 is a desktop editing interface. Interface 22 can display controls for editing the desktop, such as desktop card controls, wallpaper and personalization controls 221, desktop settings controls, etc. Subsequently, the electronic device receives an operation applied to the wallpaper and personalization controls 221 and responds to that operation, such as... Figure 1 As shown in (c), the electronic device can display interface 23. Interface 23 is a wallpaper editing interface. Interface 23 can display a return control 231, a completion control 232, and a desktop wallpaper page 233, as well as related functional controls for editing the desktop wallpaper, such as theme controls, wallpaper controls, icon style controls, desktop layout controls, and transition effect controls. The desktop wallpaper page 233 is used to preview the edited desktop wallpaper. Users can then... Figure 1 Use the desktop wallpaper page 233 and related function controls in interface 23 (c) to edit the desktop wallpaper.

[0080] With the desktop wallpaper page 233 displayed on interface 23, if the user wants to edit the lock screen wallpaper, they can manipulate interface 23 to display the lock screen wallpaper page 234. In this case, the electronic device receives an operation performed on interface 23. Figure 1 (c) In this example, taking the right swipe operation as an example, in response to this operation, such as Figure 1 As shown in (d), the electronic device can display a lock screen wallpaper page 234 on interface 23, as well as related functional controls for editing the lock screen wallpaper, such as lock screen style controls 235, artificial intelligence (AI) style controls, personalized decoration controls, depth-of-field effect controls, etc. The lock screen wallpaper page 234 is used to preview the edited lock screen wallpaper. Users can then... Figure 1 Use the lock screen wallpaper page 234 and related function controls in interface 23 (d) to edit the lock screen wallpaper.

[0081] As an example, desktop wallpaper page 233 and lock screen wallpaper page 234 can exist in a paginated format, and the two can be switched by swiping. For example, in Figure 1 The interface 23 shown in (c) displays a desktop wallpaper page 233. After the user swipes to the right on interface 23, as shown in (c), the desktop wallpaper page 233 appears. Figure 1 As shown in (d), the lock screen wallpaper page 234 can be displayed in interface 23. Similarly, if the user... Figure 1 Slide the interface 23 shown in (d) to the left, and it will appear as follows: Figure 1 As shown in (c), the desktop wallpaper page 233 can be displayed in interface 23.

[0082] When the lock screen wallpaper page 234 is displayed on interface 23, if the electronic device receives an operation applied to the lock screen style control 235, it responds to the operation, such as... Figure 1 As shown in (e), the electronic device can display a pop-up window 24 on interface 23. For example, the electronic device can pop up the pop-up window 24 from the bottom of interface 23. The pop-up window 24 can display multiple controls, such as a photo selection control, a avatar lock screen control, more wallpaper controls, etc., and can also display thumbnails 241 of multiple wallpaper templates, thumbnails 242 of multiple featured wallpapers, etc. Users can view the thumbnails 242 of multiple featured wallpapers and select their favorite featured wallpaper from them.

[0083] Suppose the electronic device receives an operation that acts on a thumbnail 242 of a selected wallpaper, and in response to the operation, such as Figure 1As shown in (f), the electronic device can close pop-up 24 and display the featured wallpaper on the lock screen wallpaper page 234. This allows the user to view the display effect of the featured wallpaper and decide whether to set it as the lock screen wallpaper. Subsequently, if the electronic device receives an operation on the completion control 232, it can set the featured wallpaper as the lock screen wallpaper in response to that operation.

[0084] It should be noted that the operations received by the electronic device in this application embodiment on the content displayed by the electronic device (such as interface, icon, thumbnail, image, control or option, etc.) can be voice operation, gesture operation (such as click, long press or swipe, etc.) or motion operation (such as device shaking or air gesture, etc.), etc., and this application embodiment does not limit them.

[0085] The following is combined Figure 2 The second possible approach is illustrated by example:

[0086] like Figure 2 As shown in (a), the electronic device displays interface 31. Interface 31 is a lock screen. Subsequently, the electronic device receives an operation applied to interface 31. Figure 2 (a) In the example of the two-finger pinching operation, the response to this operation is as follows: Figure 2 As shown in (b), the electronic device can display interface 32. Interface 32 is a lock screen style interface. Interface 32 can display a thumbnail 321 of the currently used lock screen wallpaper.

[0087] As an example, users can jump to the above text via thumbnail 321. Figure 1 The interface 23 shown in the embodiment allows for wallpaper editing. For example, when an electronic device receives an operation on thumbnail 321, in response to this operation, the electronic device can display the aforementioned... Figure 1 Interface 23, shown in (d) above, allows users to select a featured wallpaper to set as their lock screen wallpaper. For detailed instructions, please refer to the text above. Figure 1 The relevant descriptions in the implementation methods will not be repeated here.

[0088] As another example, users can operate Figure 2 The interface 32 shown in (b) is configured to display wallpapers recommended to the user. For example, the electronic device receives an operation performed on interface 32. Figure 2 (b) Taking the swipe-up operation as an example, in response to this operation, such as Figure 2As shown in (c), the electronic device can display thumbnails 241 of multiple wallpaper templates, thumbnails 242 of multiple selected wallpapers, and a selection of photos entry 244 on interface 32. Users can view the thumbnails 242 of multiple selected wallpapers and select their favorite selected wallpaper from them.

[0089] Suppose an electronic device receives an operation on a thumbnail 242 of a selected wallpaper; in response to this operation, the electronic device can display the above-mentioned... Figure 1 Interface 23 is shown in (f). The selected wallpaper is displayed on the lock screen wallpaper page 234 of interface 23. Thus, the user can view the display effect of the selected wallpaper to decide whether to set it as the lock screen wallpaper. Afterwards, if the electronic device receives an operation on the completion control 232, in response to that operation, the electronic device can set the selected wallpaper as the lock screen wallpaper.

[0090] Optionally, the selected wallpapers provided in this application embodiment may be one or more sets. Each set of selected wallpapers includes one or more selected wallpapers. When multiple sets of selected wallpapers exist, the electronic device may display a thumbnail of one set of selected wallpapers in the pop-up window 24 or interface 32 for the user to view. In this case, the electronic device can... Figure 1 The pop-up window 24 shown in (e) displays a switch control 243. Similarly, electronic devices can also... Figure 2 Interface 32, shown in (c), displays a "Switch" control 243. The user can use the "Switch" control 243 to switch between different groups of featured wallpapers. For example, suppose there are two groups of featured wallpapers, group A and group B. The electronic device displays thumbnails of each featured wallpaper in group A in the pop-up window 24 or interface 32. Then, the electronic device receives an operation on the "Switch" control 243. In response to this operation, the electronic device can stop displaying thumbnails of group A and instead display thumbnails of each featured wallpaper in group B.

[0091] Alternatively, the electronic device can also be in Figure 1 The pop-up window shown in (e) is 24 or as shown in the image. Figure 2In interface 32 shown in (c), a featured photos entry 244 is displayed. Featured photos entry 244 is used to access an interface for displaying featured photos. Users can view featured photos in this interface. If a user wants to set a featured photo as wallpaper, they can do so by interacting with the displayed featured photo. For example, when an electronic device receives an operation applied to a featured photo, in response to this operation, the electronic device can generate a wallpaper based on the featured photo and a default wallpaper template, and can display interface 23 and show the wallpaper on the lock screen wallpaper page 234 within interface 23. Thus, the user can view the display effect of the wallpaper to decide whether to set it as the lock screen wallpaper. Afterwards, if the electronic device receives an operation applied to completion control 232, in response to this operation, the electronic device can set the wallpaper as the lock screen wallpaper. Featured photos are high-quality images selected by the electronic device from images managed by the gallery application. Featured wallpapers are generated based on some or all of these featured photos and one or more wallpaper templates.

[0092] One point to note is that the above text Figures 1 to 2 The implementation example only illustrates accessing the wallpaper editing interface via the desktop or lock screen. In practical applications, other methods can also be used to access the wallpaper editing interface. For example, a user can issue a user command to a smart voice assistant to open the wallpaper editing interface, triggering the electronic device to display the wallpaper editing interface; or, a user can trigger the electronic device to display the wallpaper editing interface through specific gestures or motion sensing operations.

[0093] Another point to note is that the above text Figures 1 to 2 The implementation method is only illustrated by showing selected wallpapers in the wallpaper editing interface or lock screen style interface. In actual applications, selected wallpapers can also be displayed in other interfaces for users to view, and this application embodiment does not limit this.

[0094] The embodiments in this application are only as described above. Figures 1 to 2 The process of displaying selected wallpapers is illustrated by example using the implementation method described above. Figures 1 to 2 The process described in the implementation instructions does not constitute a specific limitation on the implementation of the embodiments of this application. In practical applications, the display of selected wallpapers can also be achieved through other methods different from the two methods described above.

[0095] The selected wallpapers provided in this application embodiment may be one or more sets.

[0096] The following explains the display rules for each featured wallpaper in a set of selected wallpapers.

[0097] A collection of featured wallpapers may include one or more featured wallpapers. These featured wallpapers exist in an ordered manner. The order of these featured wallpapers determines their display position.

[0098] For example, such as Figure 3 As shown, suppose a selection of wallpapers includes, in order: Wallpaper 1, Wallpaper 2, Wallpaper 3, Wallpaper 4, and Wallpaper 5.

[0099] In some cases, such as Figure 3 As shown in (a), when displaying a selection of wallpapers, the electronic device displays them in a single row. Assume this row has six display positions (also called slots). In this case, the electronic device can display wallpaper 1, wallpaper 2, wallpaper 3, wallpaper 4, and wallpaper 5 sequentially in the first five display positions, following the order of these six positions (e.g., from left to right).

[0100] In other cases, such as Figure 3 As shown in (b), when displaying a selection of wallpapers, electronic devices can display multiple lines ( Figure 3 (b) is shown as an example of two rows. Assume that each row in the multi-row has 4 display positions, and the multi-row has a total of 8 display positions. In this case, the electronic device can display wallpaper 1, wallpaper 2, wallpaper 3, wallpaper 4, and wallpaper 5 in the first 5 display positions in the order of these 8 display positions (such as the order of each row from left to right, or the order of the multi-row from top to bottom).

[0101] The following explains the display rules for each of the featured wallpapers in the multiple featured wallpaper sets.

[0102] When one or more sets of featured wallpapers exist, they are stored in an ordered manner. The order in which these sets of featured wallpapers are arranged determines their display order.

[0103] For example, such as Figure 4 As shown, assume there are two sets of featured wallpapers, namely: Set A and Set B. Set A includes wallpapers 6, 7, 8, 9, and 10. Set B includes wallpapers 11, 12, 13, and 14.

[0104] In some cases, such as Figure 4As shown, the electronic device first displays a selection of wallpapers from group A. Subsequently, the electronic device receives an operation to switch the selected wallpapers. For example, if the electronic device receives an operation on the aforementioned "switch" control 243, in response to this operation, the electronic device may stop displaying selected wallpapers from group A and instead display selected wallpapers from group B. Later, if the electronic device receives another operation to switch the selected wallpapers, in response to this operation, the electronic device may stop displaying selected wallpapers from group B and instead display selected wallpapers from group A.

[0105] Generally, an electronic device displays only one set of selected wallpapers from multiple sets at a time, and can switch between these sets based on user input. However, in practice, an electronic device can display at least two sets of selected wallpapers at a time, or display all of them; this embodiment does not limit this. For example, if there are four sets of selected wallpapers, and the electronic device displays two sets at a time, it can switch between the first two sets and the last two sets based on user input.

[0106] As an example, in this embodiment of the application, each display position in the electronic device used to display selected wallpapers is referred to as a slot. The process of generating selected wallpapers that can be displayed in a certain slot is called filling the slot, i.e., slot filling or slot filling.

[0107] A selection of wallpapers for each slot within one or more curated wallpaper sets can be generated from a single image and a wallpaper template. Each slot has corresponding slot rules (also known as slot matching rules or slot filling rules). Electronic devices can generate one or more curated wallpaper sets based on these slot rules.

[0108] The selected wallpapers in this embodiment may include multiple layers. The layers described in this embodiment may be views obtained by drawing layer content (including but not limited to images, time, etc.) in a blank view.

[0109] These multiple layers have a hierarchical relationship, which refers to their position on the top or bottom layer when displayed. That is, when one layer is at a higher level than another, it is positioned above the first layer. Generally, a higher-level layer will partially or completely obscure the lower-level layer when displayed.

[0110] Figure 5 This is a schematic diagram of multiple layers provided in an embodiment of this application. These multiple layers can be divided into various types.

[0111] For example, such as Figure 5As shown, these multiple layers can include five types of layers: original layer, color background layer, decoration layer, clock layer, and cutout layer.

[0112] Generally, the original layer is at the bottom. The color background layer is below the decoration layer, clock layer, and cutout layer. The decoration layer's layer level can be below the clock layer and cutout layer in some cases, and above them in others. The clock layer's layer level can be below the cutout layer in some cases, and above it in others.

[0113] The image in the original layer can be called the main image. For example, the main image could be one of the selected photos mentioned above. For example, the original layer could be... Figure 6 The layer shown in (a) is shown in the image.

[0114] The image with a color background layer is an image that has a certain color overall. For example, the color of this image can be a solid color or a gradient. For example, this color background layer can be... Figure 6 The layer shown in (b) has a solid color background.

[0115] The decorative layer image is an image that can decorate the main image. For example, the image can be an image with a frame effect, an image containing text, an image with a certain texture, or an image with a mask effect, etc., and this application embodiment does not limit this. For example, the decorative layer can be... Figure 6 The layer shown in (c) or (d) is shown in the image. Figure 6 The decorative layer shown in (c) is... Figure 6 When the decorative layer shown in (d) is overlaid, it can create a picture frame effect.

[0116] The clock layer is a layer used to display the time, which can be the system time of an electronic device. For example, this clock layer could be... Figure 6 The layer shown in (e) is a clock layer that displays the time.

[0117] The image to be cut out from a layer can be obtained from the image of the original layer. For example, the image to be cut out from a layer can be an image of the foreground object (also called the subject) in the original layer's image. Optionally, the foreground object can be extracted from the original layer's image based on object information and edge information. For example, in the original layer... Figure 6 In the case of layer (a) shown in the figure, the cutout layer can be Figure 6 The layer shown in (f) contains the foreground object from the original layer.

[0118] It should be noted that, Figure 5The layer hierarchy shown is not unique and can be changed according to the actual situation, or the layers can be deployed according to the wallpaper editing function of the electronic device. Furthermore, in practical applications, the layer types are not limited to... Figure 5 The five types shown can be customized to other types as needed.

[0119] The featured wallpaper in this application embodiment may include one or more types of layers. Furthermore, in some cases, the featured wallpaper may include one or more layers of the same type. For example, the featured wallpaper may include one or more original layers, and / or may include one or more color background layers, and / or may include one or more decorative layers, and / or may include one or more clock layers, and / or may include one or more cutout layers.

[0120] For example, the featured wallpapers, from bottom to top, can include: the original layer, the clock layer, etc. For instance, the featured wallpapers could be... Figure 7 The wallpaper shown in (a) includes... Figure 6 The original layer shown in (a) and Figure 6 The clock layer is shown in (e).

[0121] Alternatively, the featured wallpapers, from bottom to top, can include: the original layer, the color background layer, the clock layer, and the cutout layer. For example, the featured wallpapers could be... Figure 7 The wallpaper shown in (b) includes... Figure 6 The original layer shown in (a) is... Figure 6 The color background layer shown in (b) is... Figure 6 The clock layer shown in (e) is... Figure 6 The cutout layer is shown in (f) in the image.

[0122] Alternatively, the featured wallpapers, from bottom to top, can include: the original layer, decoration layer 1, clock layer, and decoration layer 2. For example, the featured wallpapers could be... Figure 7 The wallpaper shown in (c) includes... Figure 6 The original layer shown in (a) is... Figure 6 The decorative layer shown in (c) is Figure 6 The clock layer shown in (e) is... Figure 6 The decorative layer shown in (d) is shown in the image.

[0123] Alternatively, the featured wallpapers, from bottom to top, can include: original layer, decoration layer 1, clock layer, cutout layer, and decoration layer 2. For example, the featured wallpapers could be... Figure 7 The wallpaper shown in (d) includes... Figure 6 The original layer shown in (a) is... Figure 6 The decorative layer shown in (c) is Figure 6 The clock layer shown in (e) is... Figure 6 The cutout layer shown in (f) is... Figure 6 The decorative layer shown in (d) is shown in the image.

[0124] Compared to Figure 7 The wallpaper shown in (c) is... Figure 7 The wallpaper shown in (d) can create a sense of depth through the interaction of the original layer, the decorative layer, the clock layer, and the cutout layer. In this embodiment, this effect is referred to as the depth-of-field effect.

[0125] Of course, in addition to the examples above, various types of layers can be flexibly combined in other ways to obtain selected wallpapers with better visual effects. This application embodiment does not limit this.

[0126] It should be noted that the above text Figure 6 and Figure 7 This is merely an illustrative description of layers and wallpapers and does not constitute a limitation on the embodiments of this application.

[0127] As can be seen from the above, the selected wallpapers in this embodiment can be obtained by overlaying multiple layers according to their hierarchical relationship. For example, based on the wallpaper template... Figure 8 Processing a selected photo shown in (a) can yield the following results: Figure 8 The featured wallpapers shown in (b) are included. These featured wallpapers may include... Figure 9 The seven layers shown are: Original Layer, Decoration Layer 1, Decoration Layer 2, Clock Layer, Cutout Layer, Decoration Layer 3, and Decoration Layer 4, with their layer levels from lowest to highest as: 1, 2, 3, 4, 5, 6, and 7. This curated wallpaper features rich visual elements and can meet users' personalized needs.

[0128] The following is a detailed explanation of the process for generating featured wallpapers:

[0129] The wallpaper generation method provided in this application can be applied to electronic devices. For example, the electronic device may be a mobile phone, tablet computer, wearable device, digital camera, television, in-vehicle device, augmented reality (AR) device, virtual reality (VR) device, laptop computer, ultra-mobile personal computer (UMPC), netbook, personal digital assistant (PDA), laptop computer, terminal in industrial control, terminal in self-driving, terminal in remote medical surgery, terminal in smart grid, terminal in transportation safety, terminal in smart city, terminal in smart home, etc., and this application does not limit the scope of the application.

[0130] Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. See also... Figure 10 The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

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

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

[0133] The controller in processor 110 can be the nerve center and command center of electronic device 100. The controller can generate operation control signals according to the instruction opcode and timing signals to complete the control of instruction fetching and execution.

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

[0135] 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, such as saving music, video, and other files on the external memory card.

[0136] Internal memory 121 can be used to store computer-executable program code, which includes instructions. Processor 110 executes various functional applications and data processing of electronic device 100 by running the instructions stored in internal memory 121. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created by electronic device 100 during use (such as audio data, phonebook, etc.). 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.

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

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

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

[0140] Electronic device 100 can implement audio functions, such as music playback and recording, through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D and application processor.

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

[0142] Electronic device 100 can implement display functions through GPU, display screen 194, and application processor. Display screen 194 is used to display images, videos, etc.

[0143] 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 display." Touch sensor 180K detects touch operations applied to or near it. Touch sensor 180K 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.

[0144] The software system of electronic device 100 will be described next. The software system of electronic device 100 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application embodiment uses the layered architecture Android system as an example to exemplify the software system of electronic device 100. It should be noted that although this application embodiment uses the Android system as an example, its basic principles are equally applicable to electronic devices 100 based on operating systems such as iOS or Windows.

[0145] Figure 11 This is a block diagram of a software system for an electronic device 100 provided in an embodiment of this application. See also... Figure 11 A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some implementations, the Android system is divided into an application layer, an application framework layer, the Android runtime, a system layer, and a kernel layer.

[0146] The application layer can include a series of applications. For example... Figure 11 As shown, the application layer can include applications such as calendar, map, video, music, SMS, call, Bluetooth, camera, gallery, and wallpaper.

[0147] Gallery applications can manage one or more images stored on an electronic device. For example, a gallery application can manage a preset image set. A preset image set may include one or more images. The images in the preset image set are images obtained through user operations, such as taking a picture, taking a screenshot, or saving an image.

[0148] Wallpaper applications are used to implement wallpaper-related functions, such as wallpaper generation and editing.

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

[0150] like Figure 11 As shown, the application framework layer may include a task scheduler and a smart service platform.

[0151] Task scheduler is a tool for automating task execution. It can automatically trigger the execution of certain tasks based on a predetermined time, date, or specific conditions.

[0152] The intelligent service platform is used for image analysis and processing, enabling in-depth image analysis and extraction of useful information. For example, it can perform functions such as image recommendation analysis, background removal analysis, and wallpaper composition analysis. Image recommendation analysis determines whether image content is suitable for recommendation to users. Background removal analysis determines whether an image supports background removal. Wallpaper composition analysis analyzes the appropriateness of the subject's display position (i.e., its location on the screen) and adjusts the composition accordingly. For instance, if the subject is positioned too far to the left, image movement or scaling can be used to adjust its position closer to the center of the screen for a better visual effect.

[0153] like Figure 11 As shown, the application framework layer may also include a window manager, content provider, view system, phone manager, resource manager, notification manager, etc.

[0154] The window manager manages windowed applications. It can determine the screen size, the presence of a status bar, screen lock, and screen capture. The content provider stores and retrieves data, making it accessible to applications. This data can include videos, images, audio, incoming and outgoing calls, browsing history and bookmarks, and phone books. The view system includes visual controls, such as controls for displaying text and images. The view system is used to build the application's display interface, which can consist of one or more views, such as a view displaying SMS notification icons, a view displaying text, and a view displaying images. The phone manager provides communication functionality for the electronic device 100, such as managing call status (including connection and disconnection). The resource manager provides various resources to the application, such as localized strings, icons, images, layout files, and video files. The notification manager allows applications to display notifications in the status bar. These notifications can be used to convey informational messages and can disappear automatically after a short pause without user interaction. For example, the notification manager can be used to notify of download completion or message alerts. The notification manager can also display notifications as icons or scrolling text in the system's top status bar, such as notifications from background applications. The notification manager can also display notifications as dialog boxes on the screen, such as text messages in the status bar, sound alerts, vibrations of electronic devices, and flashing indicator lights.

[0155] The Android Runtime comprises the core libraries and the virtual machine. The Android Runtime is responsible for the scheduling and management of the Android system. The core libraries consist of two parts: one part contains the functionalities that Java calls, and the other part is the core Android library itself. The application layer and application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.

[0156] The system layer can include multiple functional modules, such as a surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), and 2D graphics engines (e.g., SGL). The surface manager manages the display subsystem and provides fusion of two-dimensional (2D) and three-dimensional (3D) layers for multiple applications. The media libraries support playback and recording of various common audio and video formats, as well as still image files. The media libraries can support various audio and video coding formats, such as Moving Picture Experts Group (MPEG) 4, H.264 (also known as Advanced Video Coding, AVC), Moving Picture Experts Group Audio Layer III (MP3), Advanced Audio Coding (AAC), Adaptive Multi-rate (AMR), Joint Photographic Experts Group (JPG), and Portable Network Graphics (PNG). 3D graphics processing libraries are used to implement 3D graphics drawing, image rendering, compositing, and layer processing. 2D graphics engines are drawing engines for 2D graphics.

[0157] The kernel layer is the layer between hardware and software. The kernel layer can include display drivers, camera drivers, audio drivers, sensor drivers, etc.

[0158] The following is combined Figure 12 The software architecture shown provides a brief explanation of the wallpaper generation method provided in this application embodiment:

[0159] like Figure 12As shown, when the electronic device's state meets preset conditions, the task scheduler can instruct the gallery application to perform a featured wallpaper generation task. The gallery application can then perform computer vision (CV) analysis on images from a preset image set. Furthermore, the gallery application can call the software development kit (SDK) interface of the smart service platform to perform image analysis through the platform. Through image analysis, the gallery application can filter out a first set of featured photos from the preset image set, and then instruct the wallpaper application to generate featured wallpapers based on this set. The wallpaper application can select appropriate images from the first set of featured photos to generate featured wallpapers according to preset slot-filling logic. During the wallpaper generation process, the wallpaper application can also call the smart service platform's SDK interface to perform operations such as image cutout and wallpaper composition. After generating the featured wallpapers, the wallpaper application can save them.

[0160] It is understood that the embodiments in this application are only for illustrative purposes. Figure 11 and Figure 12 The software system shown is used as an example for illustration. Figure 11 and Figure 12 The software system shown does not constitute a specific limitation on the electronic device 100. In practical applications, the internal structure of the electronic device 100 can be divided into different layers and / or different functional modules as needed to complete some or all of the functions described above. Furthermore, the names of each layer and each functional module are only for easy distinction and are not intended to limit the scope of protection of the embodiments of this application.

[0161] This application does not specifically limit the structure of the execution subject of the wallpaper generation method. As long as the code containing the wallpaper generation method provided in this application is run, the processing can be performed according to the wallpaper generation method provided in this application. For example, the execution subject of the wallpaper generation method provided in this application can be a functional module in an electronic device that can call and execute a program, or it can be a processing device applied in an electronic device, such as a chip.

[0162] The wallpaper generation method provided in the embodiments of this application will be explained in detail below.

[0163] Figure 13 This is a flowchart of a wallpaper generation method provided in an embodiment of this application. See also... Figure 13 The method may include the following steps:

[0164] Step 1301: The task scheduler determines whether the status of the electronic device meets the preset conditions.

[0165] The preset conditions are those suitable for performing the featured wallpaper generation task. When the electronic device's state meets these preset conditions, performing the featured wallpaper generation task has minimal impact on the user experience.

[0166] The preset conditions can be set in advance. For example, the preset conditions may include at least one of the following conditions: the electronic device is in a screen-off state; the electronic device's battery level is greater than or equal to a battery threshold; the electronic device is charging; the electronic device is in an idle period. Of course, this is not limited to these, and the preset conditions may also include other conditions, which are not limited in this embodiment.

[0167] If an electronic device is in a screen-off state, it means the user is unlikely to use it. Furthermore, electronic devices are typically in a low-power mode when the screen is off. Therefore, background tasks performed in this state consume minimal power and will not disturb the user.

[0168] The battery level of an electronic device refers to its current remaining power, usually expressed as a percentage. Battery thresholds can be preset, such as 50% or 60%. When the battery level is greater than or equal to the threshold, the device has sufficient power. Therefore, performing background tasks in this situation generally will not deplete the battery.

[0169] If an electronic device is charging, the power required for task execution can usually be provided by the charger and will not consume battery power. Therefore, performing background tasks in this situation generally will not cause the battery to drop rapidly.

[0170] Idle periods are the time periods allowed to execute background tasks, either by system default or manually set by the user. Idle periods are times when users are unlikely to use electronic devices. For example, an idle period could be from 2 AM to 4 AM. Executing background tasks during idle periods has minimal disruption to the user.

[0171] In one possible implementation, step 1301 can be as follows: When the electronic device changes from a screen-on state to a screen-off state, the task scheduler acquires the electronic device's battery level, charging status, and idle time period. If the electronic device's battery level is greater than or equal to a battery threshold, and / or if the electronic device is charging, and / or if the current time is within the electronic device's idle time period, the task scheduler determines that the electronic device's status meets preset conditions; otherwise, the task scheduler determines that the electronic device's status does not meet preset conditions.

[0172] The charging status of an electronic device is used to indicate whether the device is charging. For example, the charging status of an electronic device can be "not charging" or "charging".

[0173] For example, the task scheduler can obtain the battery level and charging status of the electronic device from the power management module. Of course, the task scheduler can also obtain the battery level and charging status of the electronic device through other means, and this embodiment of the application does not limit this.

[0174] For example, the task scheduler can obtain the idle time periods of an electronic device from the system settings application. Of course, the task scheduler can also obtain the idle time periods of an electronic device in other ways, and this embodiment of the application does not limit this.

[0175] Step 1302: When the electronic device's status meets the preset conditions, the task scheduler launches the gallery application.

[0176] Step 1303: If the Gallery application is already running, the Task Scheduler sends a task execution message to the Gallery application.

[0177] This task execution message instructs the gallery application to perform a featured wallpaper generation task. Optionally, the task execution message may include a task identifier. This task identifier identifies the featured wallpaper generation task.

[0178] If the electronic device meets preset conditions, the Task Scheduler determines that the featured wallpaper generation task can be executed. In this case, the Task Scheduler can first launch the Gallery application and then instruct the Gallery application to execute the featured wallpaper generation task.

[0179] Optionally, if the electronic device's state meets preset conditions, the task scheduler can also determine whether the time difference between the current time and the time when the task execution message was last sent to the gallery application (i.e., the time when the featured wallpaper generation task was last executed) is greater than or equal to a first time threshold. If the time difference between the current time and the time when the task execution message was last sent to the gallery application is greater than or equal to the first time threshold, then steps 1302 to 1303 above are executed to trigger the featured wallpaper generation task; otherwise, the operation ends.

[0180] The initial time limit can be preset. For example, it can be 3 days, 5 days, 7 days, etc. By controlling the time interval reasonably, not only can the poor user experience or unnecessary interruptions caused by frequent updates be avoided to a certain extent, but device performance and resource utilization can also be optimized. At the same time, this ensures that the selected wallpapers do not change too frequently, but maintain a certain update rhythm.

[0181] Step 1304: After receiving the task execution message, the gallery application determines the first selected set of photos in the preset image set.

[0182] After receiving the task execution message, the gallery application can perform the featured wallpaper generation task. When performing this task, the gallery application can first identify featured photos, and then instruct the wallpaper application to generate a featured wallpaper based on those photos.

[0183] A preset image set may include one or more images. The images in the preset image set are images obtained through user operations, such as taking a picture, taking a screenshot, or saving an image.

[0184] The first set of featured photos can include one or more images. Images in the first set of featured photos can be called featured photos. Featured photos are high-quality images from a preset image set. Featured photos can be used to generate featured wallpapers.

[0185] In one possible implementation, step 1304 can be: the gallery application filters a first set of selected photos from a preset image set according to a first image filtering rule.

[0186] For any image in a preset image set, the gallery application can determine whether the image is a featured photo based on a first image filtering rule. Specifically, the image can be determined to be a featured photo if it meets the first image filtering rule, and not a featured photo if it does not meet the first image filtering rule.

[0187] The first image filtering rule can be preset. For example, the first image filtering rule may include at least one of the following filtering rules: the number of subjects in the image is less than or equal to a subject number threshold; the image resolution is greater than or equal to a resolution threshold; the image date is within a preset date range; the tag of the target in the image does not belong to a preset tag blacklist, or the tag of the target in the image belongs to a preset tag whitelist; the image's aesthetic score is greater than or equal to a first aesthetic score threshold; the image is the one with the highest aesthetic score among multiple similar images. Of course, this is not limited to these rules; the first image filtering rule may also include other filtering rules, and this embodiment of the application does not limit this.

[0188] The subject in an image refers to the most important or prominent part of the image, usually its core content. For example, in a picture of people, the subject is the person; in an animal picture, the subject might be a cat or dog; in a landscape picture, the subject might be mountains, buildings, etc. For instance, subject detection algorithms or models can be used to identify the various subjects in an image and determine the number of subjects.

[0189] The subject count threshold can be preset. For example, the subject count threshold can be 1, 2, 3, etc. If the number of subjects in an image is less than or equal to the subject count threshold, it means that there are relatively few subjects in the image. Too many subjects can make the image cluttered and lack focus, while a moderate number of subjects helps to highlight the subject. Therefore, using images with fewer subjects can generate wallpapers with better visual effects.

[0190] The resolution threshold can be preset. An image with a resolution greater than or equal to the resolution threshold indicates a high resolution, and high-resolution images ensure clarity and rich detail. Therefore, using high-resolution images can generate wallpapers with better visual effects.

[0191] The date of an image refers to the date the image was stored in the electronic device. For example, for an image obtained by taking a picture, the date of the image is the date the image was taken; for an image obtained by taking a screenshot, the date of the image is the date the screenshot was taken; and for an image obtained by saving the image, the date of the image is the date the image was saved.

[0192] The preset date range is a pre-defined date interval. For example, the preset date range can be the last 7 days, the last 30 days, etc. Images stored within the preset date range are those that the user has recently been interested in, so wallpapers generated based on these images can, to some extent, meet the user's aesthetic needs.

[0193] A target in an image refers to any object appearing in the image, such as people, animals, plants, or items. A target's label is a classification or description of the target. Optionally, the label may include an identifier (id), a name, etc. For example, various targets in an image can be identified using an object detection algorithm or model, and the labels for each target in the image can be obtained.

[0194] A preset tag blacklist can be set in advance. The preset tag blacklist can include one or more tags. The tags in the preset tag blacklist correspond to targets that are not suitable for use in the wallpaper.

[0195] A preset tag whitelist can be set in advance. The preset tag whitelist can include one or more tags. The tags in the preset tag whitelist correspond to targets that are suitable for appearing in the wallpaper.

[0196] If the target in the image is not in the preset tag blacklist, or the target in the image is in the preset tag whitelist, it means that the target in the image can appear in the wallpaper, and therefore the image can be used to generate wallpaper.

[0197] An image's aesthetic score is a rating of how attractive an image is. This score can be generated based on various factors such as color matching, compositional rationality, sharpness, and contrast. For example, an aesthetic score can be obtained by scoring an image using an aesthetic scoring algorithm or model.

[0198] The first aesthetic score threshold can be preset. An image with an aesthetic score greater than or equal to the first aesthetic score threshold is considered to have a high aesthetic score, meaning the image is highly attractive. Therefore, using images with high aesthetic scores can generate wallpapers with higher quality and visual appeal.

[0199] In the presence of multiple similar images, to avoid generating wallpapers that are too similar, this embodiment selects the image with the highest aesthetic score from among the multiple similar images to generate the wallpaper. This results in a higher quality wallpaper and, to a certain extent, avoids the problem of wallpaper duplication or excessive similarity.

[0200] As an example, for any two images in a preset image set, the image features of each of the two images can be obtained to obtain two image features; if the similarity between the two image features is greater than or equal to a first similarity threshold, the two images are determined to be similar images.

[0201] Image features can be feature vectors representing image content, such as 64-bit feature vectors. For example, image features can be obtained using perceptual hashing algorithms, image feature extraction algorithms, or image feature extraction models.

[0202] The first similarity threshold can be preset. For example, the first similarity threshold can be 0.9, 0.95, etc. If the similarity between two image features is greater than or equal to the first similarity threshold, it means that the two image features are relatively similar, that is, the image content of the two images is relatively similar. Therefore, the two images can be determined to be similar images.

[0203] In some implementations, if the similarity between the two image features is less than a first similarity threshold, the two images can be determined to be dissimilar.

[0204] In other implementations, if the similarity between the two image features is less than a first similarity threshold, the following methods can also be used to determine whether the two images are similar:

[0205] The first method is to determine that the two images are similar if the similarity between their features is greater than or equal to the second similarity threshold, and the time interval between the capture times of the two images is less than or equal to the second duration threshold.

[0206] The second similarity threshold can be preset. The second similarity threshold is lower than the first similarity threshold. For example, the second similarity threshold can be 0.5, 0.6, etc.

[0207] The second duration threshold can be preset. For example, the second duration threshold can be 10 seconds, 20 seconds, 30 seconds, etc.

[0208] For example, images captured by electronic devices can have various attributes, such as the time and location of the capture. For instance, the image file of an image captured by an electronic device may include exchangeable image file format (EXIF) information. EXIF ​​information may include the time and location of the capture.

[0209] If the similarity between these two images is greater than or equal to the second similarity threshold, and the time interval between their capture times is less than or equal to the second duration threshold, it indicates that these two images were captured within a short period of time and possess a certain degree of similarity. For example, they are likely images taken multiple times by the user of the same object within a short period of time. Therefore, these two images can be determined to be similar images.

[0210] The second method is to determine that the two images are similar if the similarity between their features is greater than or equal to the second similarity threshold and the two images were taken at the same location.

[0211] If the similarity between these two images is greater than or equal to the second similarity threshold, and the two images were taken at the same location, it indicates that the two images were taken at the same location and have a certain degree of similarity. For example, it is very likely that the user took the images multiple times at the same location. Therefore, these two images can be determined to be similar images.

[0212] The third method: If the time interval between the shooting times of the two images is less than or equal to the second time threshold, and the shooting locations of the two images are the same, then the two images are determined to be similar images.

[0213] The two images were taken at locations that are less than or equal to the second time threshold, indicating that they were taken at the same location within a short period of time and therefore share a certain degree of similarity. For example, they could very well have been taken multiple times by the user at the same location within a short period. Therefore, these two images can be identified as similar.

[0214] In some cases, considering the need for evolutionary iteration and flexible configuration and operation, the first image filtering rule can be described through an image filtering file. The image filtering file can include various information from the first image filtering rule described above.

[0215] The format of the image filtering file can be preset. For example, the image filtering file can be a txt file, a doc file, a docx file, a JavaScript Object Notation (JSON) file, etc., and this embodiment does not limit this.

[0216] JSON files can store data in the form of "key-value pairs," where each "key" has its own unique "value," and each "value" can also have its own child "key-value pairs." This structure can effectively record various information from the first image filtering rule mentioned above.

[0217] As an example, a JSON file can include, for example, Figure 14 The information shown includes: "resolution" (resolution threshold); "width" (horizontal pixel count, 960 pixels in the example); "height" (vertical pixel count, 1280 pixels in the example); "blacklist" (preset blacklist, including tags with IDs 251 and 335); "date" (preset date range); "before" (number of days before the current date, 30 days in the example); "subject" (subject quantity threshold, 2 in the example); "score" (first aesthetic score threshold, 400 in the example); "similar" (similarity); "threshold" (first similarity threshold, 0.95 in the example); "time" (second duration threshold, 10 seconds in the example); and "location" (1 in the example, indicating the same location).

[0218] It should be noted that JSON files have a simple and efficient format, with straightforward syntax rules and more efficient data parsing. Therefore, when the image filtering file is a JSON file, the gallery application can quickly parse the image filtering file to obtain the various information needed when filtering images.

[0219] In one possible implementation, the operation of the gallery application to filter the first selected photo set from the preset image set according to the first image filtering rules can be as follows: the gallery application creates one or more filters according to the first image filtering rules, and filters the preset image set through the one or more filters to obtain the first selected photo set.

[0220] For example, suppose the image filtering file is as follows: Figure 14 Given the JSON file shown, the gallery application can create [database] based on that JSON file. Figure 15 The six filters shown are: Subject Quantity Filter, Resolution Filter, Date Filter, Tag Filter, Rating Filter, and Similar Image Filter.

[0221] Images from a preset image set are passed to a subject quantity filter. The subject quantity filter selects images where the number of subjects is less than or equal to a subject quantity threshold, and passes them to the next filter, the resolution filter. The resolution filter selects images where the image resolution is greater than or equal to a resolution threshold, and passes them to the next filter, the date filter. The date filter selects images where the image date falls within a preset date range, and passes them to the next filter, the tag filter. The tag filter selects images where the target tag is not in a preset tag blacklist, or where the target tag is in a preset tag whitelist, and passes them to the next filter, the rating filter. The rating filter selects images where the image aesthetic score is greater than or equal to a first aesthetic score threshold, and passes them to the next filter, the similar image filter. The similar image filter adds an image to the first selected image set if no similar images exist for that image. If similar images exist for that image, the filter determines which of the two similar images has the higher aesthetic score and assigns it to the first selected image set, while the image with the lower aesthetic score is not.

[0222] In this way, by using the chain of responsibility pattern to filter images in the preset image set through each filter in turn, it is possible to achieve multi-dimensional and multi-level filtering of images, and quickly and accurately select the first set of selected photos in the preset image set.

[0223] It should be noted that the embodiments in this application only use... Figure 15 The filter shown is used as an example for explanation. Figure 15The filters shown are not intended to limit the embodiments of this application. In practical applications, there may be more or fewer filters than shown, and the filtering order of each filter may also differ from that shown. The specific types and order of filters can be adjusted according to requirements.

[0224] Optionally, after receiving the task execution message, the gallery application can create one or more filters based on the first image filtering rules. After filtering the preset image set using these filters, the filters can be destroyed. This avoids wasting memory and computing resources.

[0225] Optionally, after determining the first set of selected photos in the preset image set, the gallery application can further filter the images in the first set of selected photos through the intelligent service platform to meet more complex user needs or business logic.

[0226] The intelligent service platform can implement some preset image filtering logic. For example, the intelligent service platform can filter out images containing sensitive content (such as brand logos, advertising banners, etc.), and / or, it can filter out images that do not meet the quality standards (such as blurry, overexposed, underexposed, excessive noise, etc.), and / or, it can filter out images containing specific behaviors (such as uncivilized behavior), etc.

[0227] In some implementations, the intelligent service platform can also acquire facial coordinate information from the image. This facial coordinate information is used to indicate the region where the face is located in the image, that is, to indicate the facial region in the image.

[0228] In some implementations, the intelligent service platform can also determine whether an image supports image matting, and if so, determine the coordinate information of the subject in the image. Image matting refers to removing unwanted background from an image and retaining the subject. The subject coordinate information is used to indicate the area where the subject to be matted out of the image is located, that is, to indicate the subject area in the image.

[0229] Step 1305: The gallery application sends a first wallpaper generation message to the wallpaper application. The first wallpaper generation message includes the storage path (also known as the local path) of each image in the first curated photo set.

[0230] Optionally, for any image in the first selected photo set, the first wallpaper generation message may further include the face coordinates of the image, as well as indications of whether the image supports image cutout. Furthermore, if the image supports image cutout, the first wallpaper generation message may also include the subject coordinates of the image.

[0231] Step 1306: After receiving the first wallpaper generation message, the wallpaper application retrieves each image according to the storage path of each image in the first selected photo set, and generates one or more selected wallpapers according to the first selected photo set and the wallpaper generation rules.

[0232] Wallpaper generation rules can be preset. For example, wallpaper generation rules can include multiple slot rules for each of n groups of wallpapers, where n is a positive integer. That is, wallpaper generation rules can include n groups of slot rules.

[0233] A slot rule is a rule used to generate wallpapers that can be displayed in a particular slot.

[0234] In some implementations, slot rules may include: label identifiers and rule identifiers.

[0235] The tag identifier in the slot rule is used to indicate the tags that the image needs to have. The rule identifier in the slot rule is used to indicate the wallpaper template to be used. Optionally, a correspondence between rule identifiers and wallpaper template identifiers can be preset, in which one or more rule identifiers correspond one-to-one with one or more wallpaper template identifiers. In this implementation, a flexible association between rule identifiers and wallpaper templates can be achieved. When it is necessary to adjust the wallpaper templates indicated by multiple slot rules in batches, only the wallpaper template identifier corresponding to the rule identifier needs to be adjusted, without having to adjust each slot rule individually. This can greatly improve the flexibility and efficiency of configuration.

[0236] In other implementations, slot rules may include: label identifiers, depth requirements, and rule identifiers.

[0237] The depth-of-field requirement in the slot rules indicates that the image needs to achieve a depth-of-field effect. For example, if an image supports image cutout and the area containing the cutout subject at least partially overlaps with the clock area, the image is determined to meet the depth-of-field requirement; otherwise, the image is determined not to meet the depth-of-field requirement. The clock area is the area in the wallpaper used to display the clock (i.e., the system time). In this implementation, tags are used to filter images, rule tags are used to specify wallpaper templates, and depth-of-field requirements are used to further filter images, thus ensuring that the generated wallpaper meets both thematic requirements and visual appeal.

[0238] Optionally, a slot rule may include one or more tag identifiers, or one or more rule identifiers.

[0239] Within a set of wallpapers, any two slot rules do not need to be exactly the same. For example, the label and rule identifiers in two slot rules may be different; or, the label identifiers in two slot rules may be the same but the rule identifiers may be different; or, the label identifiers in two slot rules may be different but the rule identifiers may be the same. This can, to some extent, prevent duplicate wallpapers from appearing in a set of wallpapers.

[0240] For example, wallpaper generation rules may also include one or more of the following: main tag, sub-tag, wallpaper template information, wallpaper selection rules, fallback scheme information, number of first wallpapers, number of second wallpapers, number of preset wallpaper groups, slot filling rules, group filling rules, rules for inserting new images, and second aesthetic score threshold.

[0241] The main tag is the tag that images used when generating wallpapers must have. Sub-tags are detailed tags under the main tag. Wallpaper template information indicates the correspondence between rule identifiers and wallpaper template identifiers. Wallpaper selection rules indicate the rules for selecting at least one set of wallpapers to display from multiple sets. Fallback information indicates one or more fallback options that can be used if an image is not selected in a certain slot. The first wallpaper quantity is the minimum number of wallpapers a set of wallpapers must include; the second wallpaper quantity is the maximum number of wallpapers a set of wallpapers can include; the preset wallpaper set number is the maximum number of wallpaper sets that can be displayed. Slot filling rules indicate the rules for filling remaining slots when the number of wallpapers in a set of wallpapers is less than the second wallpaper quantity. Group filling rules indicate the rules for filling remaining groups when the number of wallpaper sets is less than the preset wallpaper set number. New image insertion rules indicate the rules for inserting new images; new images here refer to images added to the preset image set compared to the last time a featured wallpaper generation task was performed. The second aesthetic score threshold is the aesthetic score threshold that a newly added image needs to meet.

[0242] In some cases, considering the need for evolutionary iterations and flexible configuration and operation, wallpaper generation rules can be described through wallpaper generation files. Wallpaper generation files can include various information from the aforementioned wallpaper generation rules.

[0243] The format of the generated wallpaper file can be preset. For example, the generated wallpaper file can be a txt file, a doc file, a docx file, a json file, etc., and this embodiment of the application does not limit this.

[0244] JSON files can store data in the form of "key-value pairs," where each "key" has its own unique "value," and each "value" can also have its own child "key-value pairs." This structure can effectively record various information from the wallpaper generation rules mentioned above.

[0245] As an example, a JSON file can include, for example, Figure 16 The following is an explanation of the JSON file, displaying various information.

[0246] In this context, "tags" refers to main tags, with two main tags shown in the image; "id" refers to tag identifiers, with one tag identifier being 264 and the other being 64; and "name" refers to tag names, with one tag name being "people" and the other being "scenery".

[0247] In this context, "templates" refers to wallpaper template information, with two wallpaper templates shown in the image as an example; "id" refers to rule identifiers, with one rule identifier being 1 and the other rule identifier being 2; "templateId" refers to wallpaper template identifiers, with one wallpaper template identifier being 01_Minimal_magazine and the other being 02_Cute_pet; and "name" refers to the wallpaper template name, with one wallpaper template named "Minimal Magazine" and the other named "Cute Pet" shown in the image.

[0248] Among them, "rules" is used to indicate the multiple slot rules for each wallpaper group in multiple wallpaper groups; "13elements" means 13 slot rules for one wallpaper group, "12elements" means 12 slot rules for another wallpaper group, and so on.

[0249] Here, "groupRules" refers to wallpaper selection rules, indicating the rules for selecting at least one set of wallpapers to display; "1element" refers to a set of wallpaper selection rules. This method selects at least one set of wallpapers from the multiple sets defined in the "rules" to recommend to the user. For example, the "rules" define wallpaper sets A, B, C, and D. The first "1element" in "groupRules" indicates whether wallpaper set A or C can be selected, and the second "1element" indicates whether wallpaper set B or D can be selected.

[0250] Here, "usesSubLabel" refers to a sub-tag, with the example in the image using sub-tag identifiers 349 and 345. "usesSubLabel" is a more detailed sub-tag under the aforementioned "tags". For example, sub-tags under the main tag "scenery" might include "mountains and rivers" or "city". Optionally, the tag identifier in the slot rule can be a sub-tag identifier. In this case, when generating wallpapers according to the slot rule, the sub-tag identifier can be used first for image filtering. If no images are found using the sub-tag identifier, then the corresponding main tag identifier can be used for image filtering.

[0251] The "notfindRule" option provides fallback information, indicating one or more fallback options that can be used if no image is found in a particular slot rule. The "type" option specifies the fallback plan. For example, a "type" value of 1 indicates that the fallback plan is to skip the current slot rule and fill the slot according to the next slot rule. Alternatively, a "type" value of 2 indicates that the fallback plan is to first filter images according to the default slot rule, and then fill the slot according to the next slot rule if no image is found.

[0252] The term "minGroupCapacity" refers to the minimum number of wallpapers a group of wallpapers must include; the example shown in the image is 4.

[0253] The term "maxGroupCapacity" refers to the second group of wallpapers, indicating the maximum number of wallpapers that can be included in a group. In the example shown, 15 is used.

[0254] The term "maxGroupNum" refers to the preset number of wallpaper groups, indicating the maximum number of wallpaper groups that can be displayed. The figure shows an example with 5.

[0255] The "slotFillType" refers to the slot filling rule, which indicates the filling rule for the remaining slots when the number of wallpapers in a group is less than the number of wallpapers defined by "maxGroupCapacity". For example, a value of 0 for "slotFillType" means that the remaining slots are filled using a cyclic filling rule by default, that is, the remaining slots are filled sequentially according to the first slot rule of a group of wallpapers and the subsequent slot rules.

[0256] The meaning of "groupFillType" is the group fill rule, which indicates the fill rule for the remaining groups when the number of wallpaper groups is less than the number of wallpaper groups defined by "maxGroupNum". For example, a value of 0 for "groupFillType" means that the remaining groups are filled by default using a cyclic fill rule, that is, the remaining groups are filled sequentially according to the slot rules of the first wallpaper group and the slot rules of each subsequent wallpaper group.

[0257] The "insertRule" refers to the rule for inserting new images. For example, a value of 0 for "insertRule" means that the wallpaper generated using the new image will be inserted by default using the target principle, which indicates that the wallpaper generated using the new image will be displayed at the top of each group of wallpapers.

[0258] Here, “newAddThresHold” means the second aesthetic score threshold, which is used to indicate the aesthetic score threshold that a newly added image needs to meet. In the figure, 400 is used as an example.

[0259] It should be noted that JSON files have a simple and efficient format, with straightforward syntax rules and more efficient data parsing. Therefore, when the wallpaper generation file is a JSON file, the wallpaper application can quickly parse the wallpaper generation file to obtain the various information needed when generating the wallpaper.

[0260] In some implementations, after receiving the first wallpaper generation message, if the number of images in the first selected photo set is less than the number of first wallpapers, the wallpaper application does not need to perform the operation of retrieving each image according to the storage path of each image in the first selected photo set and generating one or more selected wallpapers according to the first selected photo set and wallpaper generation rules. Instead, it directly determines that the selected wallpaper generation has failed and then sends a generation failure message to the gallery application. This generation failure message may include the reason for the failure, such as the number of selected photos being too small. If the number of images in the first selected photo set is greater than or equal to the number of first wallpapers, each image can be retrieved according to the storage path of each image in the first selected photo set, and one or more selected wallpapers can be generated according to the first selected photo set and wallpaper generation rules.

[0261] In other implementations, after receiving the first wallpaper generation message, the wallpaper application may not determine whether the number of images in the first selected photo set is less than the number of first wallpapers, but directly execute the operation of obtaining each image according to the storage path of each image in the first selected photo set, and generating one or more selected wallpapers according to the first selected photo set and the wallpaper generation rules.

[0262] In one possible implementation, the operation of the wallpaper application generating one or more featured wallpapers based on the first set of selected photos and the wallpaper generation rules can be as follows: traverse the n sets of slot rules in the wallpaper generation rules. For the currently traversed set of slot rules, generate a set of featured wallpapers based on that set of slot rules and the first set of selected photos; if this set of slot rules is not the last set of slot rules in the n sets of slot rules, continue traversing the next set of slot rules; if this set of slot rules is the last set of slot rules in the n sets of slot rules, end the operation.

[0263] It should be noted that in the above implementation, there may be cases where a set of slot rules and the first set of selected photos fail to generate selected wallpapers. Therefore, after traversing all n sets of slot rules, m sets of selected wallpapers can be obtained, where m is a positive integer less than or equal to n. These m sets of selected wallpapers correspond one-to-one with the m sets of slot rules. A set of selected wallpapers is generated based on the corresponding set of slot rules.

[0264] In some cases, it may be possible that a featured wallpaper cannot be generated based on each of the n slot rules and the first featured photo set. In this situation, the wallpaper application can determine that the featured wallpaper generation failed and then send a generation failure message to the gallery application.

[0265] Optionally, if the wallpaper generation rules include a preset number of wallpaper groups and a group filling rule, after the wallpaper application obtains the m selected wallpaper groups, if m is less than the preset number of wallpaper groups, it can generate a more selected wallpaper groups based on the group filling rule and the first selected photo set. Here, a is the difference between b and m, and b is the preset number of wallpaper groups.

[0266] For example, when the group fill rule is a cyclic fill rule, the wallpaper application can generate a set of selected wallpapers according to the order of the m sets of slot rules that correspond one-to-one with the m sets of selected wallpapers, based on a set of slot rules in the m sets of slot rules and the first image set. The first image set is the collection of all images in the first set of selected photos, excluding the images already used to generate the m sets of selected wallpapers.

[0267] Optionally, if the wallpaper generation rules include wallpaper selection rules, after the wallpaper application obtains at least b sets of selected wallpapers, it can select one or more sets of selected wallpapers from these b sets according to the wallpaper selection rules. When displaying selected wallpapers subsequently, these one or more sets of selected wallpapers can be displayed first, where b is the preset number of wallpaper sets. In some cases, the selection can also refer to the first wallpaper quantity; that is, according to the wallpaper selection rules, one or more sets of selected wallpapers with a quantity greater than or equal to the first wallpaper quantity can be preferentially selected from the at least b sets of selected wallpapers.

[0268] For example, assuming the first set of wallpapers contains 4 wallpapers, the at least b selected wallpaper groups include: Group A, Group B, Group C, and Group D. The wallpaper selection rules indicate whether to select one group from Group A and Group C, or one group from Group B and Group D. If Group A contains 3 wallpapers and Group C contains 10 wallpapers, then Group C can be selected. If Group B contains 11 wallpapers and Group D contains 15 wallpapers, then one group can be randomly selected from Group B and Group D, or Group B can be selected sequentially.

[0269] Optionally, the wallpaper application can store the thumbnails and wallpaper files of each of the at least b groups of selected wallpapers to the file system. This allows the application to subsequently display the thumbnails of the selected wallpapers in a relevant interface (such as the wallpaper editing interface described in the previous embodiment) for the user to view the display effect and decide whether to select the selected wallpaper. Furthermore, upon receiving a selection operation applied to the thumbnail of a selected wallpaper, the application can display the selected wallpaper in a relevant interface (such as the lock screen wallpaper page described in the previous embodiment) based on the wallpaper file of that selected wallpaper.

[0270] In this embodiment of the application, the selected wallpaper may include multiple layers, and the type and hierarchy of the multiple layers included in the selected wallpaper can be determined by the wallpaper template that generates the selected wallpaper. For example, such as Figure 7 As shown, a featured wallpaper, from bottom to top, can include the original layer and a clock layer; or it can include the original layer, a color background layer, a clock layer, and a cutout layer; or it can include the original layer, decoration layer 1, a clock layer, and decoration layer 2; or it can include the original layer, decoration layer 1, a clock layer, a cutout layer, and decoration layer 2. Of course, these are not the only examples; the number of layers in a featured wallpaper can be flexibly set according to actual needs.

[0271] For example, a featured wallpaper file may include layer information for the featured wallpaper. Furthermore, the wallpaper file may also include one or more of the following: offset information, scale ratio information, blur factor information, and depth-of-field support status information.

[0272] Layer set information includes basic layer information for each of the multiple layers, and this basic layer information can be organized in hierarchical order within the layer set information.

[0273] For example, the basic information of the original layer may include view identifier, layer type, image storage path, etc. The image storage path in the basic information of the original layer is the storage path of the selected photo used to generate this featured wallpaper; this selected photo is the main image. The basic information of the color background layer may include view identifier, layer type, color setting type, color value, etc. The basic information of the decoration layer may include view identifier, layer type, image storage path, color setting type, color value, etc. The basic information of the clock layer may include view identifier, layer type, layout, font, color value, color setting type, etc. The basic information of the cutout layer may include view identifier, layer type, image storage path, etc.

[0274] Offset information can be determined based on moving and scaling operations on the main image, indicating how much the center of the main image has shifted relative to the screen center after the movement. Offset information applies to both the original layer and the cutout layer. In some cases, if the main image has not been moved or scaled, the offset in the offset information can default to [0,0].

[0275] The scaling ratio information can be determined based on the scaling operation of the main image, indicating how much the scaled main image has been reduced compared to the original. The scaling ratio information applies to both the original layer and the cutout layer. In some cases, if the main image has not been scaled, the scaling ratio in the scaling ratio information can default to 1.

[0276] Blur information can be determined based on the adjusted background blur and is used to indicate the blur level of the main image. Blur information applies to the original layer. In some cases, if the background blur has not been adjusted, the blur level in the blur information can be set to 0 by default.

[0277] The depth-of-field effect switch status information indicates whether the depth-of-field effect switch is on or off. This status information applies to the clock layer and the keying layer. In some cases, if the depth-of-field effect switch has not been operated, the status in the status information can be set to on by default.

[0278] The format of the wallpaper file can be preset. For example, the wallpaper file can be a txt file, doc file, docx file, json file, etc., and this embodiment of the application does not limit this.

[0279] JSON files can store data in the form of "key-value pairs," where each "key" has its own unique "value," and each "value" can also have its own child "key-value pairs." This structure is effective for recording various information in the wallpaper file mentioned above.

[0280] As an example, a JSON file can include, for example, Figure 17 The information shown includes various parameters. "type" indicates the layer type. For example, the values ​​of "type" are: [0] Original layer, [1] Color background layer, [2] Decoration layer, [3] Clock layer, [4] Cutout layer. "colorPolicy" indicates the color setting type. For example, the values ​​of "colorPolicy" are: [0] Color cannot be set, [1] Main color, can be set independently, [2] Cannot be set independently, use main color and secondary color, [3] Main color gradient, [4] Select clock color. "isDepthofFieldSupported" indicates the depth-of-field effect on / off status. For example, the values ​​of "isDepthofFieldSupported" are: [true] On, [false] Off.

[0281] It's worth noting that JSON files have a simple and efficient format, with straightforward syntax and more efficient data parsing. Therefore, when the wallpaper file is a JSON file, the wallpaper application can retrieve it from the file system more quickly and parse it faster to display featured wallpapers.

[0282] As an example, for the currently traversed set of slot rules, the operation of the wallpaper application to generate a set of selected wallpapers based on the set of slot rules and the first set of selected photos may include the following steps (1) to (5):

[0283] Step (1): Iterate through each slot rule in the group of slot rules.

[0284] Step (2): For a slot rule that is currently being traversed, let i = 1; select all images corresponding to the i-th tag in the slot rule from the first selected photo set to obtain the second image set; determine the specified image from the second image set.

[0285] In some cases, if no image corresponding to the i-th tag in the slot rule is found from the first selected photo set, it is determined whether the i-th tag is the last tag in the slot rule. If the i-th tag is not the last tag in the slot rule, let i = i + 1, and re-execute the step of selecting all images corresponding to the i-th tag in the slot rule from the first selected photo set and the subsequent steps; if the i-th tag is the last tag in the slot rule, it is determined that a selected wallpaper could not be generated according to the slot rule and the first selected photo set, and then the following step (5) is executed.

[0286] The designated image is the one with the highest aesthetic score in the second image set.

[0287] In some cases, where the slot rule does not include depth of field requirements, the image with the highest aesthetic score in the second image set can be used as the designated image, and then the following steps (3) can be performed.

[0288] In other cases, where the slot rule includes depth of field requirements, the image with the highest aesthetic score can be determined from the second image set in descending order of aesthetic score, and it can be determined whether the image meets the depth of field requirements. If the image meets the depth of field requirements, it is designated as the specified image, and then the following step (3) is performed. If the image does not meet the depth of field requirements, the next image is determined from the second image set in descending order of aesthetic score, and then it is determined whether the next image meets the depth of field requirements. This process is repeated until an image that meets the depth of field requirements is found as the specified image, and then the following step (3) is performed.

[0289] If none of the images in the second image set meet the depth of field requirement, then determine whether the i-th tag is the last tag in the slot rule. If the i-th tag is not the last tag in the slot rule, let i = i + 1, and re-execute the step of filtering all images corresponding to the i-th tag in the slot rule from the first selected photo set and the subsequent steps; if the i-th tag is the last tag in the slot rule, determine that a selected wallpaper could not be generated according to the slot rule and the first selected photo set, and then execute the following step (5).

[0290] Step (3): Let j = 1; determine whether the specified image matches the wallpaper template identified by the wallpaper template identifier corresponding to the j-th rule identifier in the slot rule (i.e., the wallpaper template indicated by the j-th rule identifier).

[0291] In some cases, if the specified image does not match the wallpaper template, determine whether the j-th rule identifier is the last rule identifier in the slot rule. If the j-th rule identifier is not the last rule identifier in the slot rule, let j = j + 1, and re-execute the step of determining whether the specified image matches the wallpaper template identified by the wallpaper template identifier corresponding to the j-th rule identifier in the slot rule, and the subsequent steps. If the j-th rule identifier is the last rule identifier in the slot rule, determine whether the i-th tag identifier is the last tag identifier in the slot rule; if the i-th tag identifier is not the last tag identifier in the slot rule, let i = i + 1, and re-execute the step of filtering all images corresponding to the i-th tag identifier in the slot rule from the first selected photo set, and the subsequent steps; if the i-th tag identifier is the last tag identifier in the slot rule, determine that a selected wallpaper could not be generated according to the slot rule and the first selected photo set, and then execute the following step (5).

[0292] Step (4): If the specified image matches the wallpaper template identified by the wallpaper template identifier corresponding to the j-th rule identifier, generate a selected wallpaper based on the specified image and the wallpaper template.

[0293] Optionally, if the wallpaper generation rules include a second wallpaper quantity, and c selected wallpapers have already been generated according to the set of slot rules, then step (5) can be skipped and the operation can be terminated; if c selected wallpapers have not yet been generated according to the set of slot rules, then step (5) can be continued until c selected wallpapers are generated according to the set of slot rules. c is the second wallpaper quantity.

[0294] In some implementations, if it is determined that a featured wallpaper cannot be generated based on the slot rule and the first selected photo set, a fallback plan can be executed based on the fallback plan information in the wallpaper generation rule before performing step (5) below. For example, a featured wallpaper can be generated based on the default slot rule and the first selected photo set. The specific operation is similar to steps (2) to (4) above, and will not be repeated here. Afterwards, if a featured wallpaper is successfully generated based on the default slot rule and the first selected photo set, the featured wallpaper is used as the featured wallpaper corresponding to the slot rule, and step (5) below is executed; if a featured wallpaper cannot be generated based on the default slot rule and the first selected photo set, step (5) below is executed.

[0295] Step (5): If the current slot rule is not the last slot rule in the group of slot rules, continue to traverse the next slot rule. If the current slot rule is the last slot rule in the group of slot rules, end the operation.

[0296] Optionally, if the wallpaper generation rules include a second wallpaper quantity and a slot filling rule, and the number of selected wallpapers generated after traversing all slot rules in the set of slot rules is less than the second wallpaper quantity, then d more selected wallpapers can be generated according to the slot filling rule and the selected wallpaper set and added to the set of selected wallpapers corresponding to the set of slot rules. d is the difference between the second wallpaper quantity and the number of selected wallpapers already generated according to the set of slot rules.

[0297] For example, if the slot fill rule is a cyclic fill rule, the wallpaper application can generate d featured wallpapers based on the d slot rules in the set of slot rules and the third image set, following the order of all slot rules in that set. The third image set is the collection of all images in the first set of featured photos, excluding the images already used to generate the featured wallpapers corresponding to that set of slot rules.

[0298] It should be noted that in step (3) above, the wallpaper application determines whether the specified image matches the wallpaper template identified by the wallpaper template identifier corresponding to the j-th rule identifier in the slot rule. This is to determine whether a visually appealing selected wallpaper can be generated based on the specified image and the wallpaper template.

[0299] When generating wallpapers based on images and wallpaper templates, problems may arise such as faces being obscured, subject proportions being distorted, and inconsistencies between the subject cutout and the wallpaper template background (e.g., uneven subject edges). To reduce the probability of these problems, embodiments of this application can determine whether a specified image matches the wallpaper template using the following two methods.

[0300] The first method: When the slot rule does not include depth of field requirements, the wallpaper application generates a two-dimensional matrix based on the transparent areas of each layer in the multiple layers of the wallpaper template, excluding the original layer, the cutout layer, and the clock layer; based on the face area in the specified image, the two-dimensional matrix, and the clock area in the wallpaper template, it determines whether there is face occlusion; if face occlusion exists, it is determined that the specified image does not match the wallpaper template; if face occlusion does not exist, it is determined that the specified image matches the wallpaper template.

[0301] The size of this two-dimensional matrix is ​​the same as the size of the wallpaper template. This two-dimensional matrix is ​​used to indicate the transparent and opaque areas in the wallpaper template. Each pixel in the two-dimensional matrix indicates whether the corresponding position is transparent, such as 1 indicating opaque and 0 indicating transparent.

[0302] For example, a wallpaper application can set the corresponding pixel in a two-dimensional matrix to 0 based on the same transparent area that exists in all layers of the wallpaper template except for the original layer, the cutout layer, and the clock layer, and then set all other pixels in the two-dimensional matrix to 1.

[0303] For example, the wallpaper template includes Figure 18 Decorative layer 1 shown in (a) and Figure 18 Decorative layer 2 is shown in (b) above. Based on this, a process can be created... Figure 18 The two-dimensional matrix shown in (c) is as follows. In this two-dimensional matrix, all pixels that are 0 indicate the same transparent area where both decoration layer 1 and decoration layer 2 exist, which is the transparent area (also known as the small window transparent area) in the wallpaper template; all pixels that are 1 indicate the non-transparent area in the wallpaper template.

[0304] The clock area in this wallpaper template is used to display the system time, and the displayed system time is opaque.

[0305] The small window area in this wallpaper template is a transparent area used to display the main image.

[0306] For example, the operation by which a wallpaper application determines whether a face occlusion exists based on the face region in a specified image, the two-dimensional matrix, the clock region in the wallpaper template, and the small window region can be as follows: determining whether the face region is completely below the clock region, and determining whether the face region overlaps with the non-transparent region indicated by the two-dimensional matrix; if the face region is completely below the clock region and does not overlap with the non-transparent region, it is determined that there is no face occlusion; otherwise, it is determined that there is face occlusion.

[0307] If the face area is completely below the clock area and does not overlap with the non-transparent area, it means that the face is not obscured by the clock or any other non-transparent area, and therefore it can be determined that there is no face obscuration.

[0308] The second method: If the slot rule includes depth of field requirements and the wallpaper template includes a color background layer, the wallpaper application determines whether there is subject misalignment based on the subject area in the specified image, the clock area, the edge area, and the bottom area in the wallpaper template; if subject misalignment exists, it is determined that the specified image does not match the wallpaper template; if subject misalignment does not exist, it is determined that the specified image matches the wallpaper template.

[0309] The edge area of ​​this wallpaper template may include one or more of the left edge, right edge, and bottom edge areas. This edge area may be a region of a certain size. For example, the edge area may be a region of a certain width extending inward from the edges of the wallpaper template (such as the left, right, or bottom edge). The bottom area of ​​the wallpaper template refers to its bottom edge area.

[0310] For example, the operation of a wallpaper application to determine whether there is a subject misalignment based on the subject area in a specified image, the clock area, the edge area, and the bottom area in the wallpaper template can be as follows: determining whether the subject area is completely below the clock area, determining whether the subject area overlaps with the edge area, and determining whether the subject area completely covers the bottom area; if the subject area is not completely below the clock area, overlaps with the edge area, and completely covers the bottom area, it is determined that there is no subject misalignment; otherwise, it is determined that there is a subject misalignment.

[0311] If the main subject area is not completely below the clock area, overlaps with the edge area, and completely covers the bottom area, it indicates that at least a portion of the main subject is above the bottom of the clock area. Furthermore, the main subject extends to the edge of the wallpaper and fills the bottom of the wallpaper. Therefore, it can be determined that the proportions of the main subject are relatively harmonious and blend well with the edge of the wallpaper. Thus, it can be confirmed that there is no subject imbalance.

[0312] In some implementations, the operation of the wallpaper application generating a selected wallpaper based on the specified image and the wallpaper template in step (4) above may include the following methods:

[0313] The first method: If the wallpaper template includes a cutout layer, obtain the cutout image corresponding to the specified image, which contains the main subject of the specified image; store the cutout image to the file system to obtain the storage path of the cutout image; update the image storage path in the layer basic information of the original layer in the wallpaper template file of the wallpaper template to the storage path of the specified image, and update the image storage path in the layer basic information of the cutout layer in the wallpaper template file to the storage path of the cutout image, thereby obtaining the wallpaper file of the selected wallpaper.

[0314] The wallpaper template file has the same structure as the wallpaper file of the selected wallpapers described in the above embodiment, and will not be repeated here.

[0315] Optionally, the wallpaper application can obtain the cutout image corresponding to the specified image through the smart service platform.

[0316] In this approach, optionally, the wallpaper application can perform compositional analysis on a specified image through a smart service platform to adjust the display position of the subject within the specified image. In addition to updating the image storage path in the layer base information of the original layer in the wallpaper template file to the storage path of the specified image, and updating the image storage path in the layer base information of the cut-out layer in the wallpaper template file to the storage path of the cut-out image, the wallpaper application can also update the offset information and / or scaling ratio information in the wallpaper template file based on adjustments to the display position of the subject in the specified image (such as image movement or image scaling) to obtain the wallpaper file for the selected wallpaper.

[0317] The second method: If the wallpaper template does not include cutout layers, update the image storage path in the layer basic information of the original layers in the wallpaper template file to the storage path of the specified image to obtain the wallpaper file of the selected wallpaper.

[0318] Optionally, in this approach, the wallpaper application can also perform compositional analysis on the specified image through a smart service platform to adjust the display position of the main subject in the specified image. After updating the image storage path in the layer base information of the original layers in the wallpaper template file to the storage path of the specified image, the wallpaper application can also update the offset information and / or scaling information in the wallpaper template file based on adjustments to the display position of the main subject in the specified image (such as image movement or image scaling) to obtain the wallpaper file for the selected wallpaper.

[0319] In this embodiment, when the electronic device's state meets preset conditions, the task scheduler can launch the gallery application and instruct it to perform a selected wallpaper generation task. The gallery application can determine a first set of selected photos from a preset image set and instruct the wallpaper application to generate selected wallpapers based on this set. The wallpaper application can generate one or more selected wallpapers according to the selected wallpaper set and wallpaper generation rules. In this way, selected wallpapers that relatively match user preferences and have good visual effects can be automatically generated based on the preset image set and wallpaper generation rules, improving the flexibility and efficiency of wallpaper generation. These personalized, diverse, and high-quality selected wallpapers can then be recommended to the user, enhancing the user experience.

[0320] In some implementations, after receiving the task execution message from the task scheduler in step 1304, the gallery application can directly execute step 1304 and subsequent step 1305. In this case, all images in the preset image set are referenced each time to generate selected wallpapers, thereby achieving a full update of the selected wallpapers and ensuring the integrity and accuracy of the generated selected wallpapers.

[0321] In other embodiments, after receiving the task execution message sent by the task scheduler in step 1304, the gallery application can execute step 1304 and subsequent step 1305 when performing the featured wallpaper generation task for the first time; or, if the first image filtering rule or wallpaper generation rule has been updated compared to the previous performance of the featured wallpaper generation task, step 1304 and subsequent step 1305 can be executed. When performing the featured wallpaper generation task for the second time, and if the first image filtering rule and wallpaper generation rule have not been updated compared to the previous performance of the featured wallpaper generation task, steps 1904 and 1905 can be executed to generate featured wallpapers by referring to images added to the preset image set compared to the previous performance of the featured wallpaper generation task, thereby achieving incremental updates of the featured wallpapers. This can save processing resources and processing time, and improve the efficiency of featured wallpaper generation. The following is a detailed explanation:

[0322] Figure 19 This is a flowchart of a wallpaper generation method provided in an embodiment of this application. See also... Figure 19 The method may include the following steps:

[0323] Step 1901: The task scheduler determines whether the status of the electronic device meets the preset conditions.

[0324] Step 1902: When the electronic device's status meets the preset conditions, the task scheduler launches the gallery application.

[0325] Step 1903: If the Gallery application is already running, the Task Scheduler sends a task execution message to the Gallery application.

[0326] The operations of steps 1901 to 1903 can be referred to steps 1301 to 1303 above, and will not be repeated in this embodiment.

[0327] Step 1904: After receiving the task execution message, the gallery application determines the new image set in the preset image set and determines the second selected photo set in the new image set.

[0328] Optionally, after receiving the task execution message, if the gallery application is not executing the featured wallpaper generation task for the first time, and if the first image filtering rules and wallpaper generation rules have not been updated compared to the last time the featured wallpaper generation task was executed, it may execute step 1904 and subsequent step 1905.

[0329] The new image set can include one or more images. The images in this new image set are those added compared to the last time the featured wallpaper generation task was performed.

[0330] The first set of selected photos mentioned above is a selection of photos chosen from all images in a preset image set. The second set of selected photos here is a selection of photos chosen from all images in a newly added image set.

[0331] In one possible implementation, step 1904 can be: the gallery application filters a second set of featured photos from the newly added image set according to the second image filtering rules.

[0332] For any image in the newly added image set, the gallery application can determine whether the image is a featured photo based on the second image filtering rules. Specifically, the image can be determined to be a featured photo if it meets the second image filtering rules, and not a featured photo if it does not meet the second image filtering rules.

[0333] The second image filtering rule can be preset. Generally, the second image filtering rule is more lenient than the first image filtering rule. The second image filtering rule can include some of the filtering rules in the first image filtering rule.

[0334] For example, the first image filtering rules include the following filtering rules: the number of subjects in the image is less than or equal to the subject number threshold; the image resolution is greater than or equal to the resolution threshold; the image date is within a preset date range; the target label in the image does not belong to the preset label blacklist, or the target label in the image belongs to the preset label whitelist; the image aesthetic score is greater than or equal to the first aesthetic score threshold; the image is the one with the highest aesthetic score among multiple similar images.

[0335] The second image filtering rules can include: the number of subjects in the image is less than or equal to the subject number threshold; the image resolution is greater than or equal to the resolution threshold; the target's label in the image does not belong to the preset label blacklist, or the target's label in the image belongs to the preset label whitelist; and the image is the one with the highest aesthetic score among multiple similar images.

[0336] The operation of the gallery application to filter the second set of selected photos from the newly added image set according to the second image filtering rules is similar to the operation of the gallery application to filter the first set of selected photos from the preset image set according to the first image filtering rules in step 1304 above. Therefore, this embodiment will not be described in detail here.

[0337] Optionally, after identifying the second curated set of photos in the newly added image set, the gallery application can further filter the images in the second curated set through the intelligent service platform to meet more complex user needs or business logic.

[0338] In some implementations, the smart service platform can also acquire facial coordinate information from images.

[0339] In some implementations, the intelligent service platform can also determine whether an image supports image matting, and if so, determine the coordinate information of the main subject of the image.

[0340] Step 1905: The gallery application sends a second wallpaper generation message to the wallpaper application, the second wallpaper generation message including the storage path of each image in the second curated photo set.

[0341] Optionally, for any image in the second selected photo set, the second wallpaper generation message may also include the face coordinates of the image, as well as indications of whether the image supports image cutout. Furthermore, if the image supports image cutout, the second wallpaper generation message may also include the subject coordinates of the image.

[0342] The first wallpaper generation message mentioned above indicates a full update of the selected wallpapers. The second wallpaper generation message here indicates an incremental update of the selected wallpapers.

[0343] Step 1906: After receiving the second wallpaper generation message, the wallpaper application retrieves each image according to the storage path of each image in the second selected photo set, and generates one or more selected wallpapers according to the second selected photo set and the wallpaper generation rules.

[0344] The rules for generating wallpapers have been explained in step 1306 above, and will not be repeated here.

[0345] Wallpaper generation rules can include rules for adding new images and a second aesthetic rating threshold. The wallpaper application can generate one or more curated wallpapers based on a second set of featured photos, the rules for adding new images, and the second aesthetic rating threshold.

[0346] In some implementations, the wallpaper application determines a fourth image set within the second curated photo set based on a second aesthetic rating threshold. The fourth image set is the collection of all images in the second curated photo set whose aesthetic rating is greater than or equal to the second aesthetic rating threshold.

[0347] Optionally, the second aesthetic rating threshold can be lower than the first aesthetic rating threshold. This is done to generate featured wallpapers using as many recently added images as possible. Since users typically show greater interest in recently added images, which are images that users have been interested in recently, featured wallpapers generated based on these images can better reflect users' recent preferences.

[0348] Adding a new image insertion rule can instruct that featured wallpapers generated using the new image will be displayed at the top of each wallpaper group. This distributes these featured wallpapers across multiple wallpaper groups and prioritizes their display at the beginning, making it easier for users to quickly browse their favorite featured wallpapers.

[0349] In some implementations, the operation of a wallpaper application generating one or more featured wallpapers based on a fourth image set and wallpaper generation rules can be as follows: Images in the fourth image set are traversed in descending order of aesthetic rating. For a currently traversed image, a wallpaper template is determined based on the target's tag identifier in the image; it is determined whether the image matches the wallpaper template; if the image matches the wallpaper template, a featured wallpaper is generated based on the image and the wallpaper template; if the number of generated featured wallpapers has not yet reached the third number of wallpapers, the traversal continues to the next image; the operation ends when the number of generated featured wallpapers reaches the third number of wallpapers. According to the rules for inserting new images, the featured wallpaper generated this time replaces the featured wallpaper in the corresponding slot in the stored multiple sets of featured wallpapers.

[0350] For the second set of selected photos, wallpaper templates can be directly determined based on the tags of the targets in the images to generate selected wallpapers. This allows for the generation of wallpapers based on recently added images with high aesthetic ratings, i.e., those with good visual effects, aiming to improve user wallpaper satisfaction.

[0351] Wallpaper applications can pre-set the mapping between tags and wallpaper templates. In this mapping, one tag can correspond to one or more wallpaper templates, and the wallpaper template identified by a tag is suitable for combining with the object identified by that tag to generate a wallpaper.

[0352] The number of third wallpapers can be preset. For example, the number of third wallpapers can be 6, 8, etc.

[0353] The operation of the wallpaper application to determine whether the image matches the wallpaper template is similar to the operation of the wallpaper application to determine whether the specified image matches the wallpaper template identified by the wallpaper template identifier corresponding to the j-th rule identifier in the slot rule in step 1305 above. This application embodiment will not repeat the details.

[0354] The operation of the wallpaper application generating a featured wallpaper based on the image and the wallpaper template is similar to the operation of the wallpaper application generating a featured wallpaper based on the specified image and the wallpaper template in step 1305 above, and will not be described again in this embodiment.

[0355] In this embodiment, selected wallpapers can be generated by referring to images added to the preset image set compared to the previous selected wallpaper generation task, thereby achieving incremental updates of selected wallpapers. This not only yields selected wallpapers that better meet user needs but also saves processing resources and time, improving the efficiency of selected wallpaper generation.

[0356] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0357] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0358] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, can implement the steps in the various method embodiments described above.

[0359] This application also provides a computer program product that, when run on an electronic device, enables the electronic device to perform the steps described in the various method embodiments above.

[0360] This application also provides a chip system including a processor coupled to a memory. The processor executes a computer program stored in the memory to implement the steps of any method embodiment of this application. The chip system can be a single chip or a chip module composed of multiple chips.

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

[0362] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.

[0363] The above-described embodiments are optional embodiments provided by this application and are not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the technical scope disclosed in this application should be included within the protection scope of this application.

Claims

1. A wallpaper generation method, characterized in that, Applied to electronic devices, the method includes: A first target image set is determined from a preset image set according to a first image filtering rule, wherein the first target image set includes one or more target images; Based on the first target image set and one or more wallpaper templates, generate one or more target wallpapers; The first image filtering rule includes at least one of the following filtering rules: The number of subjects in the image is less than or equal to the subject number threshold; The image resolution is greater than or equal to the resolution threshold; The image's date falls within a preset date range; The target in the image is either not in the preset blacklist or the target in the image is in the preset whitelist. The image's aesthetic score is greater than or equal to the first aesthetic score threshold; The image is the one with the highest aesthetic score among multiple similar images.

2. The method as described in claim 1, characterized in that, The step of determining the first target image set in the preset image set according to the first image filtering rule includes: When the state of the electronic device meets the preset conditions, the first target image set in the preset image set is determined according to the first image filtering rules.

3. The method as described in claim 2, characterized in that, The preset conditions include at least one of the following: the electronic device is in a screen-off state; the battery level of the electronic device is greater than or equal to a battery threshold; the electronic device is charging; or the electronic device is in an idle period.

4. The method according to any one of claims 1 to 3, characterized in that, The step of determining the first target image set in the preset image set according to the first image filtering rule includes: If the time interval between the current time and the time of the last execution of the target wallpaper generation task is greater than or equal to a first time interval threshold, the first target image set in the preset image set is determined according to the first image filtering rule.

5. The method according to any one of claims 1 to 4, characterized in that, The method further includes: For any two images in the preset image set, obtain the image features of each of the two images to obtain two image features; If the similarity between the features of the two images is greater than or equal to a first similarity threshold, the two images are determined to be similar images. If the similarity between the two image features is less than a first similarity threshold, and the similarity between the two image features is greater than or equal to a second similarity threshold and the time interval between the shooting times of the two images is less than or equal to a second time interval threshold, or if the similarity between the two image features is greater than or equal to a second similarity threshold and the shooting locations of the two images are the same, or if the time interval between the shooting times of the two images is less than or equal to a second time interval threshold and the shooting locations of the two images are the same, then the two images are determined to be similar images.

6. The method according to any one of claims 1 to 5, characterized in that, The first image filtering rule is described by an image filtering file, which is a JSON file.

7. The method as described in any one of claims 1 to 6, characterized in that, The step of determining the first target image set in the preset image set according to the first image filtering rule includes: Create one or more filters based on the first image filtering rules; The first target image set is obtained by filtering the preset image set through one or more filters.

8. The method according to any one of claims 1 to 7, characterized in that, The step of generating one or more target wallpapers based on the first target image set and one or more wallpaper templates includes: Based on the first target image set and the wallpaper generation rules, generate one or more target wallpapers; The wallpaper generation rules include n sets of slot rules, where n is a positive integer; any one of the n sets of slot rules includes one or more tag identifiers and one or more rule identifiers, or any one of the n sets of slot rules includes one or more tag identifiers, one or more rule identifiers, and a depth requirement; the tag identifiers are used to indicate the tags that the image should have, the rule identifiers are used for the wallpaper templates that should be used, and the depth requirement is used to indicate that the image should achieve a depth effect.

9. The method as described in claim 8, characterized in that, The wallpaper generation rules also include one or more of the following: main tag, sub-tag, wallpaper template information, wallpaper selection rules, number of first wallpapers, number of second wallpapers, number of preset wallpaper groups, slot filling rules, group filling rules, rules for inserting new images, and second aesthetic score threshold. Wallpaper template information is used to indicate the correspondence between rule identifiers and wallpaper template identifiers; Wallpaper selection rules are used to indicate the rules for selecting at least one set of wallpapers to be displayed from multiple sets of wallpapers; the first wallpaper quantity is the minimum limit for the number of wallpapers in a set of wallpapers; the second wallpaper quantity is the maximum limit for the number of wallpapers in a set of wallpapers; The preset number of wallpaper groups is the maximum limit for the number of wallpaper groups; the slot filling rule is used to indicate the filling rule for the remaining slots when the number of wallpapers in a group is less than the number of wallpapers in the second group; the group filling rule is used to indicate the filling rule for the remaining groups when the number of wallpaper groups is less than the preset number of wallpaper groups; the new image insertion rule is used to indicate the insertion rule for new images; the second aesthetic score threshold is the aesthetic score threshold that new images must meet.

10. The method as described in claim 8 or 9, characterized in that, The step of generating one or more target wallpapers based on the first target image set and wallpaper generation rules includes: Iterate through the n sets of slot rules in the wallpaper generation rules; For the current set of slot rules, a set of target images is generated based on the set of slot rules and the first target image set.

11. The method as described in claim 10, characterized in that, The step of generating a set of target images based on the set of slot rules and the first target image set includes: Iterate through each slot rule in the set of slot rules; For a slot rule currently traversed, let i = 1; filter out all images corresponding to the i-th tag identifier in the slot rule from the first target image set to obtain the second image set; determine the specified image from the second image set; Let j = 1; if the specified image matches the wallpaper template indicated by the j-th rule identifier in the slot rule, generate a target image based on the specified image and the wallpaper template.

12. The method as described in claim 11, characterized in that, The method further includes: In the absence of depth of field requirements in the slot rules, a two-dimensional matrix is ​​generated based on the transparent areas of each layer in the wallpaper template, excluding the original layer, the cutout layer, and the clock layer. Based on the face region in the specified image, the two-dimensional matrix, and the clock region in the wallpaper template, determine whether there is face occlusion; If the face is obscured, then the specified image is determined to be mismatched with the wallpaper template. If there is no face obstruction, then the specified image is determined to match the wallpaper template.

13. The method as described in claim 11 or 12, characterized in that, The method further includes: When the slot rule includes a depth of field requirement and the wallpaper template includes a color background layer, it is determined whether there is a subject imbalance based on the subject area in the specified image, the clock area, the edge area, and the bottom area in the wallpaper template. If the subject misalignment exists, it is determined that the specified image does not match the wallpaper template; If the subject misalignment does not exist, then the specified image is determined to match the wallpaper template.

14. The method as described in any one of claims 8 to 13, characterized in that, The wallpaper generation rules are described by a wallpaper generation file, which is a JSON file.

15. The method according to any one of claims 1 to 14, characterized in that, The method further includes: Determine the new image set in the preset image set; A second target image set is determined in the newly added image set according to a second image filtering rule, wherein the second image filtering rule includes some of the filtering rules in the first image filtering rule; One or more target wallpapers are generated based on the second target image set and one or more wallpaper templates.

16. The method as described in claim 15, characterized in that, The step of generating one or more target wallpapers based on the second target image set and one or more wallpaper templates includes: Based on the second aesthetic scoring threshold, a fourth image set is determined in the second target image set; The images in the fourth image set are traversed in descending order of aesthetic scores. For the currently traversed image, determine the target wallpaper template based on the target's tag identifier in the image; If the image matches the target wallpaper template, a target image is generated based on the image and the target wallpaper template.

17. An electronic device, characterized in that, The electronic device includes: one or more processors, and memory; The memory is coupled to the one or more processors, the memory being used to store computer program code, the computer program code including computer instructions, the one or more processors invoking the computer instructions to cause the electronic device to perform the method as described in any one of claims 1 to 16.

18. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes instructions that, when executed on an electronic device, cause the electronic device to perform the method as described in any one of claims 1 to 16.

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