Dynamic wallpaper generation method and device, terminal equipment and program product
By utilizing lock screen resources to generate dynamic wallpapers, the method addresses the inefficiencies of existing Android wallpaper technologies, reducing complexity and resource usage while enhancing the quality and variety of generated wallpapers.
Patent Information
- Application Number
- CN202510279335.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-10
- Publication Date
- 2025-07-15
AI Technical Summary
In the process of generating dynamic wallpapers, the existing technology has problems such as high development difficulty, large memory usage, high power consumption, and inconsistent syntax and animation gameplay, resulting in poor dynamic wallpaper generation effect.
By obtaining resource packages, calling lock screen resources for analysis and data processing, generating views under lock screen resources, and obtaining wallpaper parameters and templates, and using the rich syntax and animation gameplay of lock screen resources to generate dynamic wallpapers.
It improves the generation effect of dynamic wallpaper, reduces memory usage and power consumption, simplifies development difficulty, improves development efficiency and compatibility, and achieves rich UI effects.
Smart Images

Figure CN120315792A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing, and in particular, to a method, apparatus, terminal device, and program product for generating a dynamic wallpaper. Background Art
[0002] Currently, the dynamic wallpapers of the Android system are mainly drawn through the dynamic wallpaper service and the buffer (Surface). This drawing method of Surface has the characteristic of high performance. However, in the actual development process of dynamic wallpapers, there are still many defects in related technologies, which reduce the generation effect of dynamic wallpapers. Summary of the Invention
[0003] Embodiments of this application are expected to provide a method, apparatus, terminal device, and program product for generating a dynamic wallpaper, which can improve the generation effect of the dynamic wallpaper.
[0004] The technical solution of this application is implemented as follows:
[0005] In a first aspect, an embodiment of this application provides a method for generating a dynamic wallpaper, including:
[0006] Obtain a resource package, call the lock screen resources to perform parsing processing and data processing on the resource package, and generate a first view under the lock screen resources;
[0007] When the type of the resource package is the wallpaper type, obtain the wallpaper parameters corresponding to the first view;
[0008] Obtain a wallpaper template, and load the wallpaper parameters through the wallpaper template to generate a dynamic wallpaper of the first view.
[0009] In a second aspect, an embodiment of this application provides a device for generating a dynamic wallpaper. The device for generating a dynamic wallpaper includes: an obtaining unit and a generating unit; wherein,
[0010] The obtaining unit is configured to obtain a resource package;
[0011] The generating unit is configured to call the lock screen resources to perform parsing processing and data processing on the resource package, and generate a first view under the lock screen resources;
[0012] The obtaining unit is further configured to, when the type of the resource package is the wallpaper type, obtain the wallpaper parameters corresponding to the first view; obtain a wallpaper template;
[0013] The generating unit is further configured to load the wallpaper parameters through the wallpaper template to generate a dynamic wallpaper of the first view.
[0014] In a third aspect, an embodiment of the present application provides a terminal device, which includes: a processor and a memory; wherein,
[0015] the memory is used to store a computer program;
[0016] the processor is used to call and run the computer program from the memory to execute the method described in the first aspect.
[0017] In a fourth aspect, an embodiment of the present application provides a computer program product, including a computer program or instruction for causing a processor to execute the method described in the first aspect.
[0018] An embodiment of the present application provides a method, device, equipment and computer program product for generating a dynamic wallpaper. The method includes: obtaining a resource package, calling a lock screen resource to perform parsing processing and data processing on the resource package to generate a first view under the lock screen resource; when the type of the resource package is a wallpaper type, obtaining wallpaper parameters corresponding to the first view; obtaining a wallpaper template and loading the wallpaper parameters through the wallpaper template to generate a dynamic wallpaper of the first view. Since the lock screen resource has richer syntax and animation play methods than the wallpaper resource, the first view generated by calling the lock screen resource makes the content and form of the dynamic wallpaper generated based on the first view richer, thereby improving the generation effect of the dynamic wallpaper. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The drawings herein are incorporated into the specification and form a part of this specification. These drawings illustrate embodiments consistent with the present application and, together with the specification, are used to explain the technical solutions of the present application. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0020] The flowchart shown in the drawings is only an exemplary illustration and does not necessarily include all contents and operations / steps, nor does it necessarily execute in the described order. For example, some operations / steps can be decomposed, while some operations / steps can be combined or partially combined. Therefore, the actual execution order may change according to the actual situation.
[0021] Figure 1 It is a framework schematic diagram of a method for generating a dynamic wallpaper provided by an embodiment of the present application Figure 1 ;
[0022] Figure 2 It is an optional flowchart diagram of a method for generating a dynamic wallpaper provided by an embodiment of the present application;
[0023] Figure 3Schematic diagram of generating a first view provided by an embodiment of the present application;
[0024] Figure 4 Schematic diagram of the application platformization of a method for generating a dynamic wallpaper provided by an embodiment of the present application;
[0025] Figure 5 Schematic diagram of the application interface of a method for generating a dynamic wallpaper provided by an embodiment of the present application;
[0026] Figure 6 Schematic diagram of creating a target tool class provided by an embodiment of the present application;
[0027] Figure 7 Schematic structural diagram of a chip provided by an embodiment of the present application;
[0028] Figure 8 Schematic diagram of the working principle of a buffer adaptation layer provided by an embodiment of the present application;
[0029] Figure 9 Schematic diagram of the generation of a dynamic wallpaper provided by an embodiment of the present application;
[0030] Figure 10 Schematic diagram of the multi-scenario application of a resource package provided by an embodiment of the present application;
[0031] Figure 11 Schematic diagram of the application of multiple dynamic effect types in multiple scenarios provided by an embodiment of the present application;
[0032] Figure 12 Another optional flowchart of a method for generating a dynamic wallpaper provided by an embodiment of the present application;
[0033] Figure 13 Framework schematic of a method for generating a dynamic wallpaper provided by an embodiment of the present application Figure 2
[0034] Figure 14 Schematic structural diagram of a device for generating a dynamic wallpaper provided by an embodiment of the present application;
[0035] Figure 15 Schematic structural diagram of a terminal device provided by an embodiment of the present application. Detailed implementation manners
[0036] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the following will further describe the specific technical solutions of the present application in detail with reference to the accompanying drawings in the embodiments of the present application. The following embodiments are used to illustrate the present application but are not used to limit the scope of the present application.
[0037] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the technical field to which this application belongs. The terms used herein are for the purpose of describing embodiments of this application only and are not intended to limit this application.
[0038] In the following description, reference is made to "some embodiments", "this embodiment", "embodiments of this application", and examples, etc., which describe subsets of all possible embodiments. However, it can be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments and can be combined with each other without conflict.
[0039] If a similar description such as "first / second" appears in the application documents, the following explanation is added. In the following description, the terms "first / second / third" are only used to distinguish similar objects and do not represent a specific order for the objects. It can be understood that "first / second / third" can be interchanged in a specific order or sequence when permitted, so that the embodiments of this application described here can be implemented in an order other than that illustrated or described here.
[0040] The theme store dynamic wallpaper resource pack is essentially a Domain-Specific Language (DSL) script resource pack. Through the colorful engine, the resource pack is parsed and rendered. Finally, the DSL script is parsed into User Interface (UI) components rendered by the state machine (OpenGL for Embedded Systems, OpenGL ES) and finally drawn onto the Surface of the wallpaper service. In the Android system, the Surface provides a buffer where graphics can be drawn.
[0041] Exemplarily, as Figure 1 shown, the theme store application software 1 includes a wallpaper resource pack 2 and a lock screen resource pack 3. Through the colorful DSL script syntax 6, state machine (OpenGL) encapsulation 7, and colorful dynamic effect gameplay 8 of the colorful engine 4, it is parsed into UI components rendered by the state machine (OpenGL ES rendering) and finally drawn onto the buffer (Surface) of the wallpaper service 12 to achieve the generation of dynamic wallpapers.
[0042] The theme store lock screen resource pack is also essentially a DSL script resource pack. Through the versatile engine, the resource pack is parsed and rendered. Finally, the DSL script is parsed into corresponding View view components and drawn onto the lock screen container. In Android, the View is the basic building block of the user interface.
[0043] Exemplarily, as Figure 1As shown, the theme store application software 1 includes a wallpaper resource package 2 and a lock screen resource package 3. The resource package is parsed through the DSL script syntax 9 and the effect play 11 of the DSL engine 5 to obtain a view component 10 (View view component). Figure 15 (addView), draw the view component 10 onto the lock screen view container of the core application 13 (SystemUI).
[0044] Dynamic wallpaper resources and lock screen resources use different DSL script syntaxes. The dynamic wallpaper resource script supports a single syntax and function, which cannot support rich dynamic wallpaper gameplay. However, lock screen resource support can achieve cooler animation and special effects gameplay. From the perspective of resource richness, functional gameplay diversity, and the number of external theme resource package designers (CP), lock screen resource scripts have an absolute advantage.
[0045] Dynamic wallpaper development often uses Surface and OpenGL ES, which often has the following problems:
[0046] (1) No out-of-the-box UI components are provided.
[0047] (2) Common interactive functions and event handling are not provided.
[0048] (3) There is no dedicated layout editor and preview function.
[0049] The above problems are easy to cause: 1. Development is difficult: Using Surface for development usually requires more underlying knowledge and OpenGL ES rendering technology. For general Android client development, the threshold is high and it is impossible to master it in a short period of time. 2. High memory and high power consumption: Graphics drawing through OpenGL ES generally requires more GPU memory, and high-performance drawing will increase device power consumption. 3. Inconsistent grammar and dynamic gameplay: You need to learn multiple sets of grammars such as Colorful and Variety, which increases the CP learning cost. The script grammar and dynamic gameplay supported by the colorful dynamic wallpaper resources are not rich enough, and the animation and special effects gameplay cannot be aligned with the Variety lock screen resources. The dynamic gameplay supported on the Variety lock screen is generally developed through the View view. If it needs to be compatible with the colorful dynamic wallpaper, it generally needs to be redeveloped through OpenGL ES, and the adaptation cost is relatively high.
[0050] In Android, a View is the basic module of the Android UI. Based on this, a rich variety of predefined components (such as Button buttons, TextView text, ImageView images, etc.) and third-party custom components (Webp animated images, Lottie animations, etc.) are derived. These components have encapsulated common UI functions or cool animations. However, the existing dynamic wallpaper technology does not support the reuse of these rich View view components, resulting in low development efficiency and great development difficulty.
[0051] To solve the disadvantages of related technologies, an embodiment of this application provides a method for generating a dynamic wallpaper, including: obtaining a resource package, calling the lock screen resources to perform parsing processing and data processing on the resource package, and generating a first view under the lock screen resources; in the case where the type of the resource package is a wallpaper type, obtaining wallpaper parameters corresponding to the first view; obtaining a wallpaper template, and loading the wallpaper parameters through the wallpaper template to generate a dynamic wallpaper of the first view. In this process, on the one hand, generating a dynamic wallpaper through wallpaper resources occupies a large amount of memory, and at the same time, there is also a high power consumption. Compared with generating a dynamic wallpaper through wallpaper resources, generating a third-party lock screen through lock screen resources occupies less memory and has lower power consumption. Since this application generates the first view by calling the lock screen resources, and then generates a dynamic wallpaper through the first view, that is, generates a dynamic wallpaper through the lock screen resources, the memory occupied during the generation of the dynamic wallpaper is less and the power consumption is also low; on the other hand, since the lock screen resources have richer syntax and animation effects than the wallpaper resources, based on the resource package, the first view generated by calling the lock screen resources makes the first view have the same characteristics as the lock screen resources, that is, it supports richer syntax and animation effects, and thus makes the content and form of the dynamic wallpaper generated based on the first view more abundant, thereby improving the generation effect of the dynamic wallpaper.
[0052] An embodiment of this application provides a method for generating a dynamic wallpaper, Figure 2 which is an optional flow schematic diagram of a method for generating a dynamic wallpaper provided by an embodiment of this application, and will be described in combination with Figure 2 the steps shown.
[0053] S101. Obtain a resource package, call the lock screen resources to perform parsing processing and data processing on the resource package, and generate a first view under the lock screen resources.
[0054] In an embodiment of this application, the resource package carries materials, models, music, sounds, language files, and fonts. The data format of the resource package is a subfolder or a.zip file. The types of the resource package include a resource package for a dynamic wallpaper, a resource package for a third-party lock screen, and a resource package for other scenarios; among them, the resource packages corresponding to the dynamic wallpaper, the third-party lock screen, and other scenarios use a unified script syntax and package structure.
[0055] In some embodiments of the present application, resource packages are generally produced by engineers using a unified script syntax and uploaded to the theme server. The resource packages are put on the shelves after review and distributed to theme clients through resources for theme clients to display and download resources.
[0056] In some embodiments of the present application, the method for generating a dynamic wallpaper is applicable to a scenario in which a terminal device generates a dynamic wallpaper.
[0057] In some embodiments of the present application, the execution subject of the method for generating dynamic wallpaper is a terminal device, and the terminal device can be a mobile phone or a tablet computer. The embodiments of the present application do not make specific limitations on this.
[0058] In some embodiments of the present application, the terminal device downloads the resource package from the application software of the theme client.
[0059] In some embodiments of the present application, the first view Figure 1 It is generally used to generate lock screen wallpapers, and can also be used to generate dynamic wallpapers. Since the first view calls the lock screen resource to parse and process the resource package, the first view is the view under the lock screen resource.
[0060] For example, first view Figure 1 Generally it is View view.
[0061] The lock screen resource is used to generate a three-party lock screen, and the lock screen resource has rich syntax and dynamic effect gameplay. For the lock screen resource, the embodiment of the present application does not make specific restrictions.
[0062] For example, the lock screen resources can be resources under the Variety Engine. Variety Engine is a dynamic engine system such as themes and dynamic wallpapers that come with the terminal device. It allows the mobile phone to display various dynamic effects with better quality. Variety Engine is an engine system necessary for installing themes in the theme store. It is a system tool for mobile phone dynamic engine rendering, which can quickly and easily realize various dynamic effects, including dynamic lock screen, dynamic themes, dynamic wallpapers and other UI products.
[0063] In some embodiments of the present application, the terminal device calls the lock screen resource, parses and processes the resource package, and obtains the first view under the lock screen resource corresponding to the resource package.
[0064] In some embodiments of the present application, the terminal device uses the lock screen resource to perform script parsing on the resource package to obtain the syntax tree corresponding to the resource package, and then generates the first view under the lock screen resource after performing resource loading, data binding and animation updating operations on the syntax tree.
[0065] In some embodiments of the present application, the terminal device calls the lock screen resources to parse and process the resource package, and obtains data of multiple nodes; performs mapping processing based on the data of the multiple nodes to generate multiple second views corresponding to the multiple nodes; and performs data processing based on the multiple second views to generate a first view.
[0066] S102. When the type of the resource package is the wallpaper type, obtain the wallpaper parameters corresponding to the first view.
[0067] In some embodiments of the present application, the wallpaper parameters are the dynamic special effects and display content for generating a dynamic wallpaper.
[0068] Exemplarily, the dynamic special effects generally refer to the dynamic display modes of the text data and image data displayed on the desktop wallpaper. The display content generally refers to the text data and image data displayed on the desktop wallpaper.
[0069] In some embodiments of the present application, the types of the resource package include the wallpaper type, the lock screen type, and the preset type; wherein, the preset type is other scenarios except the wallpaper type and the lock screen type. The resource package of the wallpaper type is used for providing dynamic wallpaper services to generate a dynamic wallpaper; the resource package of the lock screen type is used for providing third-party lock screen services to produce a lock screen wallpaper; the resource package of the preset type is used to complete functions in other scenarios.
[0070] Exemplarily, the preset type may be a desktop component card.
[0071] In some embodiments of the present application, when the type of the resource package is the wallpaper type, the terminal device performs setting processing on the first view through a view buffer adaptation layer (i.e., a View-Surface adaptation layer) to obtain the wallpaper parameters corresponding to the first view.
[0072] In some embodiments of the present application, when the type of the resource package of the terminal device is the wallpaper type, a target tool class is determined, and setting processing is performed through the target tool class and the first view to obtain the wallpaper parameters corresponding to the first view.
[0073] In some embodiments of the present application, the terminal device obtains a logical display object through a system hidden interface corresponding to the wallpaper resource, accesses an input channel through the system hidden interface corresponding to the wallpaper resource, and obtains a substring object of the input channel. A target tool class is established through the substring object corresponding to the wallpaper service engine and the logical display object. Setting processing is performed through the target tool class and the first view to obtain the wallpaper parameters corresponding to the first view.
[0074] It should be noted that the function of the View-Surface adaptation layer is to convert the View created by the Variety Engine into a SurfaceControl (i.e. wallpaper parameters), and then add the View to the wallpaper service in the form of a SurfaceControl. The core of the View-Surface adaptation layer is to create a SurfaceControlViewHost (i.e. the target tool class) and set the View.
[0075] S103: Obtain a wallpaper template, and load wallpaper parameters through the wallpaper template to generate a dynamic wallpaper of the first view.
[0076] In some embodiments of the present application, the wallpaper template is located in the wallpaper service engine. The wallpaper service engine is mainly used to generate dynamic wallpapers based on resource packages. The embodiments of the present application do not specifically limit the wallpaper service engine.
[0077] Exemplarily, the wallpaper service engine may be called a colorful engine. The colorful engine is a wallpaper software mainly promoted by the terminal device, and is a system software developed based on OpenGL technology. The main functions of the colorful engine include real-time rendering of dynamic wallpapers, enhancing the authenticity and vividness of animation effects, and adjusting the color temperature to adapt to the environment or relieve eye fatigue, enhancing the display effect and reducing blue light damage. The colorful engine also has the function of improving the visual impact of pictures and videos and improving the picture quality of games.
[0078] In some embodiments of the present application, the terminal device may obtain a wallpaper template, and after obtaining the wallpaper template, load wallpaper parameters through the wallpaper template to generate a dynamic wallpaper of the first view.
[0079] In some embodiments of the present application, the terminal device can use wallpaper parameters as the content of the dynamic wallpaper, use the wallpaper template as a container for generating the dynamic wallpaper, add the wallpaper parameters to the wallpaper template, and generate the dynamic wallpaper of the first view.
[0080] In some embodiments of the present application, the terminal device performs data fusion based on the wallpaper parameters and the wallpaper template to obtain the wallpaper content; renders the wallpaper content of the first view to generate a dynamic wallpaper of the first view.
[0081] It can be understood that, on the one hand, generating a live wallpaper through wallpaper resources occupies a large amount of memory, and at the same time, there is also high power consumption. Compared with generating a live wallpaper through wallpaper resources, generating a third-party lock screen through lock screen resources occupies less memory and has lower power consumption. Since this application generates a first view by calling lock screen resources and then generates a live wallpaper through the first view, that is, generates a live wallpaper through lock screen resources, the memory occupied during the process of generating the live wallpaper is less and the power consumption is also low; on the other hand, since lock screen resources have richer syntax and animation effects than wallpaper resources, based on the resource package, the first view generated by calling lock screen resources makes the first view have the same characteristics as the lock screen resources, that is, supports richer syntax and animation effects, and further makes the content and form of the live wallpaper generated based on the first view more abundant, thereby improving the generation effect of the live wallpaper.
[0082] In some embodiments of this application, when calling lock screen resources to parse and process the resource package and perform data processing to generate a first view under the lock screen resources, it can be implemented through S1011, S1012, and S1023 as follows:
[0083] S1011: Call lock screen resources to parse and process the resource package to obtain data of multiple nodes.
[0084] In some embodiments of this application, the data of multiple nodes can be understood as the data of multiple tree nodes corresponding to a syntax tree, and the data of multiple nodes includes the data of a root node and the data of child nodes.
[0085] In some embodiments of this application, the terminal device calls lock screen resources to parse and process the resource package to obtain the data of the root node and the data of child nodes; based on the data of the root node and the data of child nodes, determine the data of multiple nodes.
[0086] S1022: Perform mapping processing on the data of multiple nodes to generate multiple second views corresponding to the data of multiple nodes.
[0087] In some embodiments of this application, the terminal device performs mapping processing on the data of multiple nodes respectively to obtain second views corresponding to each of the multiple nodes.
[0088] S1013: Perform data processing based on multiple second views to generate a first view.
[0089] In some embodiments of this application, the terminal device can generate a first view based on the second view through resource management for resource loading processing, through variable management for data binding processing, and through animation management for animation update processing.
[0090] Exemplarily, such as Figure 3As shown, engineers can write simple DSL scripts and create resource files (such as pictures and videos), package them into a resource package 21, and upload it to the application server (i.e., the theme server 22 in Figure 3 ). The theme server 22 will review and list the resources and distribute them. The resource package 21 can be downloaded through the application client (i.e., the theme client 23 in Figure 3 ). The resources are displayed and downloaded in the theme client 23. The downloaded resource package 21 can be submitted to the versatile engine 5 and parsed through the script parser 51 to generate a syntax tree. The syntax tree includes a root node and sub-nodes (e.g., node 1, node 2, node 3, and node 4). Each node on the syntax tree is mapped to a corresponding view (i.e., the node mapping View in Figure 3 ) to generate a view tree. After the data of the view tree is loaded with resources, data is bound, and animations are updated through resource management 52, variable management 53, and animation management 54, a first view 24 is finally generated.
[0091] It can be understood that since the lock screen resources have richer syntax and dynamic effect gameplay compared to the wallpaper resources, by calling the lock screen resources to parse and process the resource package, and performing resource loading processing, data binding processing, and animation update processing, a first view is generated, enabling the first view to also support richer syntax and dynamic effect gameplay for subsequent generation of better dynamic wallpapers.
[0092] In some embodiments of the present application, the method for generating a dynamic wallpaper further includes:
[0093] S201. When the current operating system parameters are preset system parameters, integrate the view buffer adaptation layer into the framework of the current operating system to directly access the system hidden interface.
[0094] In some embodiments of the present application, the preset system parameters refer to the preset operating system version format of the terminal device. The present application embodiments do not make specific limitations on the preset system parameters.
[0095] Exemplarily, the preset system parameters can be the ColorOS system or other customized systems.
[0096] In some embodiments of the present application, when the current operating system parameters are the ColorOS system or other customized systems, integrate the view buffer adaptation layer into the framework of the current operating system to directly access the system hidden interface of the wallpaper resources.
[0097] S202. When the current operating system parameters are not the preset system parameters, package the view buffer adaptation layer into a software package to access the system hidden interface through the system call-level reflection method.
[0098] In some embodiments of the present application, when the current operating system parameter is not the ColorOS system or other customized systems, the view buffer adaptation layer is encapsulated into a software package to access system hidden interfaces through system call-level reflection.
[0099] Exemplarily, the view buffer adaptation layer needs to access member variables of the InputEventReceiver and Display types in the WallpaperService's Engine subclass (the Wallpaper Service Engine). Both of these variables are system hidden interfaces, and ordinary applications generally do not have the ability to access system hidden interfaces. The present application provides two solutions: platformization and Software Development Kit (SDK) - based development.
[0100] Platformization: As Figure 4 shown, for the systems of Android device manufacturers, such as customized systems, the view buffer adaptation layer 14 is directly integrated into the system framework layer 32 and opened to system applications 312 or third-party applications (i.e., Figure 4 the ordinary applications 313 in
[0101] SDK - based development: As Figure 5 shown, for systems that are not of Android device manufacturers (i.e., other Android systems), for ordinary applications 313 or system applications 312 in the application layer 32, the view buffer adaptation layer 12 is encapsulated into a toolkit (SDK) for ordinary applications 313 or system applications 312 to access. The hidden interface is accessed through Native reflection to obtain the wallpaper service 12 in the system framework layer 32. Native reflection to access the hidden interface is to use the method of system call-level reflection to access system hidden interfaces at the same time. System call-level reflection is to access system hidden interfaces through Native (C or C++). Before the reflection access, the reflection call stack is cleared by starting a new thread environment. When the reflection call stack is empty, the system determines that this reflection is an operation of system call, and thus the system hidden interface can be normally accessed.
[0102] It can be understood that through platformization or SDK - based development of the current operating system, the View - Surface adaptation layer can access the system hidden interface of the wallpaper service, facilitating the acquisition of wallpaper templates. Since the method of system call-level reflection in the present application adopts the principle of least privilege and only accesses the required interfaces, the security risk can be reduced.
[0103] In some embodiments of the present application, obtaining the wallpaper parameters corresponding to the first view in S102 can be implemented through S301, as follows:
[0104] S301. Obtain the wallpaper parameters corresponding to the first view through the substring object and the logical display object corresponding to the wallpaper resource.
[0105] In some embodiments of the present application, the wallpaper resource is a resource used to generate a dynamic wallpaper. The wallpaper resource may include, but is not limited to, a wallpaper service engine.
[0106] In some embodiments of the present application, the terminal device can establish a target tool class through the substring object and the logical display object corresponding to the wallpaper resource; obtain the initial wallpaper parameters through the first view and the target tool class; and perform a copy process based on the initial wallpaper parameters to obtain the wallpaper parameters corresponding to the first view.
[0107] It can be understood that since the first view supports richer syntax and dynamic effect play methods, the wallpaper parameters also support richer syntax and dynamic effect play methods, making the subsequent dynamic wallpaper generated based on the wallpaper parameters have a better effect.
[0108] In some embodiments of the present application, S301 can be implemented through S3011 and S3012, as follows:
[0109] S3011. Obtain the initial wallpaper parameters of the first view through the substring object and the logical display object corresponding to the wallpaper resource.
[0110] In some embodiments of the present application, the terminal device can establish a target tool class through the substring object and the logical display object corresponding to the wallpaper resource; and perform an update process on the original wallpaper parameters of the target tool class based on the first view to obtain the initial wallpaper parameters.
[0111] In some embodiments of the present application, the terminal device can establish a target tool class through the substring object and the logical display object corresponding to the wallpaper resource; perform an update process on the root view of the target tool class based on the first view to obtain the updated root view; and perform an update process on the original wallpaper parameters of the target tool class based on the updated root view to obtain the initial wallpaper parameters.
[0112] In some embodiments of the present application, before executing 301, the terminal device obtains the logical display object through the system hidden interface corresponding to the wallpaper resource; and accesses the input channel through the system hidden interface corresponding to the wallpaper resource to obtain the substring object.
[0113] It should be noted that the system hidden interface corresponding to the wallpaper resource is the system hidden interface corresponding to the wallpaper service engine. The system hidden interfaces include: the hidden interface InputEventReceiver and the hidden interface Display.
[0114] In some embodiments of the present application, the terminal device obtains a logical display object through the hidden interface Display corresponding to the wallpaper resource, and accesses the input channel through the hidden interface InputEventReceiver corresponding to the wallpaper resource to obtain a substring object of the input channel.
[0115] In some embodiments of the present application, the terminal device can establish a target tool class through the substring object and the logical display object corresponding to the wallpaper service engine.
[0116] Exemplarily, through Figure 4 or Figure 5 the method of accessing the system hidden interface in, access the hidden interface to obtain the hidden interface 41 (i.e., the input event receiver InputEventReceiver) of the wallpaper service engine 40, then obtain the input channel 43 (InputChannel) through InputEventReceiver, and obtain the input channel substring object (token) through the input channel 43; the terminal device can also obtain the logical display object Display (i.e., Figure 6 the hidden interface Display42) of the wallpaper service engine 40 by accessing the hidden interface. Use the token object and the Display object as parameters to create the target tool class (SurfaceControlViewHost) 44.
[0117] It should be noted that the token object is the substring object; the Display object is the logical display object.
[0118] It can be understood that the terminal device obtains the logical display object through the system hidden interface corresponding to the wallpaper resource; accesses the input channel through the system hidden interface corresponding to the wallpaper resource to obtain the substring object, which is convenient for establishing the target tool class according to the substring object and the logical display object later.
[0119] In some embodiments of the present application, the terminal device updates the root view of the target tool class based on the first view to obtain the updated root view; based on the updated root view, updates the original wallpaper parameters of the target tool class to obtain the initial wallpaper parameters.
[0120] In some embodiments of the present application, the terminal device adds the first view to the root view of the target tool class, and then adds the buffer of the root view to the original wallpaper parameters of the target tool class through the target tool class to obtain the initial wallpaper parameters.
[0121] It can be understood that the terminal device adds the first view to the root view of the target tool class, and then adds the buffer of the root view to the original wallpaper parameters of the target tool class through the target tool class to obtain the initial wallpaper parameters, which is convenient for generating the wallpaper parameters of the first view subsequently. Since the first view supports richer syntax and dynamic effect play methods, the initial wallpaper parameters also support richer syntax and dynamic effect play methods.
[0122] S3012. Perform a copying process based on the initial wallpaper parameters to obtain the wallpaper parameters corresponding to the first view.
[0123] In some embodiments of the present application, the terminal device performs a copying process based on the initial wallpaper parameters to obtain the wallpaper parameters corresponding to the first view.
[0124] Exemplarily, as Figure 7 shown, the terminal device can set the view 61 by the method of setting the view 60 of the View-Surface adaptation layer 12, add the View view to the root view 441 (ViewRootImpl) of the target tool class 44 (SurfaceControlViewHost), add the buffer 442 (Surface) of the root view 441 to its own original wallpaper 443 (SurfaceControl) through the target tool class 44 to obtain the updated initial wallpaper parameters 444. Finally, the target tool class 44 performs a copy (copyFrom) 63, copies the initial wallpaper parameters 444 to the buffer 64, so as to obtain the wallpaper parameters 445 of the first view.
[0125] It should be noted that the role of ViewRootImpl is to draw the View view onto a Surface through the Canvas canvas.
[0126] It can be understood that the terminal device obtains the initial wallpaper parameters of the first view through the substring object and the logical display object corresponding to the wallpaper resource, and performs a copying process based on the initial wallpaper parameters to obtain the wallpaper parameters corresponding to the first view, which can make the wallpaper parameters be applied under the wallpaper service engine, facilitating the generation of a dynamic wallpaper based on the first view. Since the first view supports richer syntax and dynamic effect play methods, the wallpaper parameters also support richer syntax and dynamic effect play methods, making the subsequent dynamic wallpaper generated based on the wallpaper parameters have a better effect.
[0127] In some embodiments of the present application, obtaining the wallpaper template includes:
[0128] S401. When the system version of the current operating system is the preset version, access the system hidden interface to obtain the wallpaper template.
[0129] In some embodiments of the present application, the preset version is the system version when the operating system of the terminal device meets certain conditions. The present application embodiments do not make specific limitations on the preset version.
[0130] Exemplarily, the preset version is that the Android version is greater than 11.
[0131] In some embodiments of the present application, when the system version of the current operating system is the preset version, the terminal device accesses the system hidden interface of the wallpaper service engine to obtain the wallpaper template.
[0132] S402. When the system version of the current operating system is not the preset version, obtain the target parameter through the dynamic proxy technology; and perform a copy process on the target parameter to obtain the wallpaper template.
[0133] In some embodiments of the present application, when the system version of the current operating system is not the preset version, that is, the system version of the current operating system is that the Android version is equal to 11.
[0134] In some embodiments of the present application, when the system version of the current operating system is not the preset version, the terminal device obtains the target parameter through the Java dynamic proxy technology; and performs a copy process on the target parameter to obtain the wallpaper template.
[0135] It should be noted that the target parameter is the 15th variable of the relayout method.
[0136] Exemplarily, after converting the View view into the SurfaceControl of the View view through the View-Surface adaptation layer, it is necessary to obtain the SurfaceControl of the wallpaper service window (i.e., the wallpaper template), and display the View view on the wallpaper service. First, it is necessary to obtain the SurfaceControl of the wallpaper service window. According to the different Android versions, the obtaining methods are also different. For example Figure 8 as shown
[0137] When Android version 7.0 is greater than Android 11, through Figure 4 or Figure 5 the method of accessing the system hidden interface in, execute S1. Access the wallpaper service hidden interface variable (mBbqSurfaceControl) to obtain the wallpaper template (SurfaceControl) 71 of the wallpaper service content.
[0138] When the Android version is equal to Android 11, execute S2, access the wallpaper service hidden interface variable of type IwindowSession, and S3, execute the relayout method of the dynamic proxy (IwindowSession), and S4, obtain the 15th variable of the relayout method, and S5, obtain the wallpaper template (SurfaceControl) 71 of the wallpaper service content by copying the variable of the wallpaper template type. Copying the variable of type SurfaceControl can prevent the obtained SurfaceControl from being released and becoming unusable.
[0139] It can be understood that for operating systems with different system versions, the wallpaper templates of the wallpaper service are obtained through different methods, which is convenient for subsequently displaying dynamic wallpapers according to the wallpaper templates.
[0140] In some embodiments of the present application, when loading wallpaper parameters through the wallpaper template to generate the dynamic wallpaper of the first view, it can be implemented through S501 and S502, as follows:
[0141] S501: Perform data fusion processing based on the wallpaper parameters and the wallpaper template to obtain the wallpaper content.
[0142] In some embodiments of the present application, after the terminal device obtains the wallpaper parameters and the wallpaper template, it performs data fusion processing on the wallpaper parameters and the wallpaper template to obtain the wallpaper content.
[0143] It should be noted that the wallpaper content is the dynamic wallpaper content to be displayed.
[0144] S502: Render the wallpaper content of the first view to generate the dynamic wallpaper of the first view.
[0145] In some embodiments of the present application, the terminal device renders the wallpaper content of the first view to generate the dynamic wallpaper of the first view.
[0146] Exemplarily, add the SurfaceControl of the View view (hereinafter referred to as SurfaceControl A, that is, the wallpaper parameter) to the SurfaceControl of the wallpaper service window (hereinafter referred to as SurfaceControl B, that is, the wallpaper template). As Figure 9As shown, after the application software 80 of the terminal device obtains the first view 24, it adds the first view 24 to the target tool class 44 through the setView 60 method, and converts the first view 24 into wallpaper parameters (i.e., SurfaceControl 445) through the target tool class 44. Add the (ransition) T tool provided by the subclass of the wallpaper parameter, first add the wallpaper parameter to the wallpaper template (i.e., SurfaceControl 71) of the wallpaper service 12, apply the dynamic wallpaper service, and render the content of the first view onto the dynamic wallpaper 82 of the system desktop 81.
[0147] It can be understood that the terminal device performs data fusion processing based on the wallpaper parameter and the wallpaper template to obtain the wallpaper content, and performs rendering processing on the wallpaper content of the first view to generate the dynamic wallpaper of the first view. In this process, since the first view supports richer syntax and dynamic effect play methods, and the wallpaper parameter is obtained by converting the first view, the wallpaper parameter also supports richer syntax and dynamic effect play methods, and thus the content and form of the dynamic wallpaper generated based on the wallpaper parameter are more abundant, thereby improving the generation effect of the dynamic wallpaper.
[0148] In some embodiments of the present application, after S101, the method for generating a dynamic wallpaper further includes:
[0149] S104. When the type of the resource package is the lock screen type, generate a lock screen wallpaper based on the first view.
[0150] In some embodiments of the present application, when the type of the resource package is the lock screen type, the terminal device can directly generate a lock screen wallpaper based on the first view, that is, a third-party lock screen wallpaper.
[0151] S105. When the type of the resource package is a preset type, generate the content corresponding to the preset type based on the first view; wherein, the preset type is other types except the wallpaper type and the lock screen type.
[0152] In some embodiments of the present application, the preset type is other types except the wallpaper type and the lock screen type, such as a desktop component card.
[0153] In some embodiments of the present application, when the type of the resource package is other types except the wallpaper type and the lock screen type, the terminal device can generate the content corresponding to the preset type based on the first view.
[0154] Exemplarily, such as Figure 10As shown in the figure, resource packages such as dynamic wallpaper data 90, third-party lock screen data 91, and other scenario data 92 are all resource packages using a unified script syntax and package structure, resulting in a unified resource package 93. The unified resource package 93 includes DSL scripts, a resource package structure, and a resource package type. Using the versatile engine 5, script parsing 51, resource management 52, variable management 53, animation management 54, and UI components 55 are performed on the unified resource package 93 to obtain a third view 56. Then, according to different resource package types (for example, wallpaper type 94, lock screen type 95, and other types 96), the third view 56 is displayed in the corresponding scenario using the corresponding method. When the third view 56 is of the wallpaper type 94, the dynamic wallpaper service 97 is completed through the view buffer adaptation layer 12; when the third view 56 is of the lock screen type 95, the third-party lock screen service 98 is performed; when the third view 56 is of other types 96, it is applied to other scenarios (such as component cards) 99.
[0155] It can be understood that in the case where the type of the resource package is the lock screen type, a lock screen wallpaper is generated based on the first view. In the case where the type of the resource package is a preset type, the content corresponding to the preset type is generated based on the first view. Due to the different types of resource packages, different services are applied, enriching the application scenarios of the resource package.
[0156] In some embodiments of the present application, after obtaining the resource package, the method for generating a dynamic wallpaper further includes:
[0157] S601: Invoke the lock screen resources to parse and process the resource package to obtain data of multiple nodes; wherein, the resource package has a unified script syntax and a unified package structure.
[0158] In some embodiments of the present application, the resource package can be applied to the dynamic wallpaper service, can also be applied to the third-party lock screen service, and can also be applied to other scenarios. The resource package can be a resource package of one type among multiple types; the script syntax corresponding to each of the multiple types of resource packages is the same, and the structure of the resource package corresponding to each is the same.
[0159] In some embodiments of the present application, the terminal device invokes the lock screen resources to parse and process the resource package to obtain the data of the root node and the data of the child nodes; through the data of the root node and the data of the child nodes, the data of multiple nodes is determined.
[0160] S602: Perform various different types of data processing on the data of multiple nodes to generate multiple third views corresponding to various different types.
[0161] In some embodiments of the present application, the terminal device performs various different types of data processing on the data of multiple nodes through the versatile engine to generate multiple third views corresponding to various different types.
[0162] It should be noted that multiple different types can be multiple animation types.
[0163] S603: Based on the type of the resource package, determine a target view corresponding to the type of the resource package from a plurality of third views.
[0164] In some embodiments of the present application, based on the type of the resource package, a target view corresponding to the type of the resource package is determined from multiple third views.
[0165] In some embodiments of the present application, if the type of the resource package is a wallpaper type, the view corresponding to the dynamic wallpaper is determined as the target view from multiple third views. If the type of the resource package is a lock screen type, the view corresponding to the lock screen wallpaper is determined as the target view from multiple third views. If the type of the resource package is a preset type, the view corresponding to the preset type is determined as the target view from multiple third views.
[0166] S604: Apply the target view to the scenario corresponding to the type of the resource package.
[0167] For example, a unified rendering engine is used to standardize and unify script syntax. After the script syntax is unified, the same script syntax and animation gameplay can be used in different business scenarios, and the scripts and materials of existing theme resources can be reused. Figure 11 As shown, the engineer creates a resource package and obtains a unified resource package 93. After uploading the unified resource package 93, the unified resource package 93 is analyzed, and the engineer develops new gameplay on the Variety Engine 5 to obtain new dynamic gameplay 1, new dynamic gameplay 2 and new dynamic gameplay 3. A variety of new dynamic gameplay can be applied to the desktop to obtain dynamic wallpaper 82; a variety of new dynamic gameplay is applied to the lock screen to obtain a three-party lock screen 83; a variety of new dynamic gameplay is applied to other scenarios, that is, other business scenarios (such as desktop component cards) 84.
[0168] It should be noted that new dynamic effects can be developed once and used in multiple scenarios. Engineers only need to develop the new dynamic effects once on the Variety Engine and apply them to different scenarios, without having to repeat the development in scenarios such as desktop wallpaper and lock screen. This will form a new system platform capability, open to third-party applications, improve the development efficiency of dynamic wallpapers for third-party applications, and enhance the dynamic wallpaper experience for third-party applications. This will reduce the development difficulty of existing dynamic wallpapers, improve development efficiency, and reduce the memory and power consumption of dynamic wallpapers.
[0169] It is understandable that the lock screen, component card and other scenarios have unified syntax and animation gameplay, reused existing lock screen scripts and resources, reduced the maintenance cost and development compatibility cost of different engines, resource script specifications and animation gameplay, and achieved one-time development and multi-scenario use.
[0170] Based on the above embodiments, the present application proposes a method for generating a dynamic wallpaper, as Figure 12 shown, the method for generating a dynamic wallpaper includes the following steps:
[0171] S11. Obtain a resource package, call the lock screen resources to parse the resource package, and obtain a syntax tree including multiple node data.
[0172] In some embodiments of the present application, the syntax tree includes data of multiple nodes, and the data of multiple nodes includes data of a root node and data of child nodes.
[0173] In some embodiments of the present application, the terminal device calls the lock screen resources to parse the resource package to obtain the data of the root node and the data of the child nodes; based on the data of the root node and the data of the child nodes, determine the syntax tree.
[0174] S12. Perform mapping processing based on the data of multiple nodes to generate a view tree.
[0175] In some embodiments of the present application, the terminal device performs mapping processing respectively based on the data of multiple nodes to obtain second views corresponding to each of the multiple nodes; based on the second views corresponding to each of the multiple nodes, determine the view tree.
[0176] S13. Perform resource loading processing, data binding processing, and animation update processing based on the view tree to generate a first view.
[0177] In some embodiments of the present application, the terminal device can perform resource loading processing through resource management, data binding processing through variable management, and animation update processing through animation management based on the view tree to generate a first view.
[0178] Exemplarily, as Figure 3 shown, engineers can write simple DSL scripts and produce resource files (such as pictures and videos), package them into a resource package 21, and upload them to the application server (i.e., Figure 3 the theme server 22 in Figure 3 ), and the theme server 22 will review, put them on the shelves, and distribute the resources. The resource package 21 can be downloaded through the application client (i.e., Figure 3The node mapping in the View generates a view tree. After the data of the view tree is subjected to resource loading, data binding, and animation update through resource management 52, variable management 53, and animation management 54, a first view 24 is finally generated.
[0179] In some embodiments of the present application, after S13 is executed, S14 or S15 or S16 is executed. The specific execution order depends on the actual situation, and the embodiments of the present application do not make specific limitations.
[0180] S14: When the type of the resource package is the wallpaper type, obtain the wallpaper parameters corresponding to the first view.
[0181] In some embodiments of the present application, a target tool class is established through the substring object and the logical display object corresponding to the wallpaper resource; setting processing is performed through the target tool class and the first view to obtain the initial wallpaper parameters; based on the initial wallpaper parameters, copy processing is performed to obtain the wallpaper parameters corresponding to the first view.
[0182] Exemplarily, as Figure 7 shown, the terminal device can set the view 61 by setting the view 60 of the View-Surface adaptation layer 12, add the View view to the root view 441 (ViewRootImpl) of the target tool class 44 (SurfaceControlViewHost), and add the buffer 442 (Surface) of the root view 441 to its own original wallpaper 443 (SurfaceControl) through the target tool class 44 to obtain the updated initial wallpaper parameters 444. Finally, the target tool class 44 performs a copy (copyFrom) 63 and copies the initial wallpaper parameters 444 to the buffer 64, thereby obtaining the wallpaper parameters 445 of the first view.
[0183] In some embodiments of the present application, after S14 is executed, S17 and S18 are executed.
[0184] S15: When the type of the resource package is the lock screen type, generate a lock screen wallpaper based on the first view.
[0185] In some embodiments of the present application, when the type of the resource package is the lock screen type, the terminal device can directly generate a lock screen wallpaper based on the first view, that is, a third-party lock screen wallpaper.
[0186] S16: When the type of the resource package is the preset type, generate the content corresponding to the preset type based on the first view.
[0187] In some embodiments of the present application, the preset type is other types except the wallpaper type and the lock screen type, such as a desktop component card.
[0188] In some embodiments of the present application, when the type of the resource package is other types than the wallpaper type and the lock screen type, the terminal device may generate content corresponding to the preset type based on the first view.
[0189] Exemplarily, as Figure 10 shown, resource packages such as dynamic wallpaper data 90, third-party lock screen data 91, and other scenario data 92 are all resource packages using a unified script syntax and package structure to obtain a unified resource package 93. The unified resource package 93 includes DSL scripts, resource package structures, and resource package types. Using the versatile engine 5, perform script parsing 51, resource management 52, variable management 53, animation management 54, and UI component 55 on the unified resource package 93 to obtain a third view 56, and then according to different resource package types (for example, wallpaper type 94, lock screen type 95, and other type 96), use the corresponding method to display the third view 56 in the corresponding scenario. When the third view 56 is the wallpaper type 94, complete the dynamic wallpaper service 97 through the view buffer adaptation layer 12; when the third view 56 is the lock screen type 95, perform the third-party lock screen service 98; when the third view 56 is the other type 96, apply it to other scenarios (such as component cards) 99.
[0190] S17. Obtain a wallpaper template, and perform data fusion processing based on the wallpaper parameters and the wallpaper template to obtain wallpaper content.
[0191] In some embodiments of the present application, after the terminal device obtains the wallpaper parameters and the wallpaper template, it performs data fusion processing on the wallpaper parameters and the wallpaper template to obtain wallpaper content.
[0192] It should be noted that the wallpaper content is the dynamic wallpaper content to be displayed.
[0193] S18. Render the wallpaper content of the first view to generate a dynamic wallpaper for the first view.
[0194] In some embodiments of the present application, the terminal device renders the wallpaper content of the first view to generate a dynamic wallpaper for the first view.
[0195] Exemplarily, add the SurfaceControl of the View view (hereinafter referred to as SurfaceControl A, that is, the wallpaper parameters) to the SurfaceControl of the wallpaper service window (hereinafter referred to as SurfaceControl B, that is, the wallpaper template). As Figure 9As shown, after the application software 80 of the terminal device obtains the first view 24, it adds the first view 24 to the target tool class 44 through the setView 60 method of the view, and converts the first view 24 into wallpaper parameters (i.e., SurfaceControl 445) through the target tool class 44. By adding the subclass provided by the wallpaper parameters (ransition) T tool, the wallpaper parameters are first added to the wallpaper template (i.e., SurfaceControl 71) of the wallpaper service 12, and the dynamic wallpaper service is applied to render the content of the first view onto the dynamic wallpaper 82 on the system desktop 81.
[0196] In some embodiments of the present application, the present application proposes a method for generating a dynamic wallpaper, such as Figure 13 As shown, the present application provides a View-Surface adaptation layer 14 on the basis of the system wallpaper service to realize the display of the View view on the dynamic wallpaper service window. The core of the View-Surface adaptation layer is to use the SurfaceControlViewHost tool provided in the Android 11 and above system versions. The theme store application software 1 contains a wallpaper resource package 2 and a lock screen resource package 3. The resource packages are parsed through the versatile DSL script syntax 9, view components 10, and versatile dynamic effect play methods 11 of the versatile engine 5 to obtain the View view. Through the set view 60 and the view buffer adaptation layer 14, and by drawing the view 16 (Transition), the View view is drawn onto the buffer of the wallpaper service 12 to generate a dynamic wallpaper. It is also possible to increase the view Figure 15 and draw the View view component onto the lock screen view container of the core application 13.
[0197] In some embodiments of the present application, the method for generating a dynamic wallpaper has the following beneficial effects:
[0198] (1) Improve the development efficiency of dynamic wallpapers
[0199] The present application can reuse existing View view R & D assets, OpenGL ES R & D assets, and lock screen theme resources. While achieving richer UI effects, it reduces the workload of repeated development and improves the development efficiency of dynamic wallpapers.
[0200] (2) Reduce the development difficulty of dynamic wallpapers
[0201] Development engineers only need to master basic View view development, and CP only needs to master simple DSL script development to develop dynamic wallpapers with rich effects, greatly reducing the threshold and difficulty of developing dynamic wallpapers.
[0202] (3) Reduce the memory power consumption of dynamic wallpapers
[0203] In the solution where the View is used to implement the dynamic wallpaper, compared with the traditional OpenGL ES solution for implementing dynamic wallpapers, in scenarios such as picture wallpapers, video wallpapers, and Lottie animation wallpapers, the memory occupancy is reduced, and the power consumption is also decreased. Table 1 shows the memory experiment data. When using the same materials, the View solution occupies less memory.
[0204] Table 1
[0205]
[0206] (4) Unification of the theme resource package syntax and unification of the dynamic effect gameplay
[0207] For the maintainers of the colorful engine and the versatile engine, it is possible to implement a set of code that is compatible with both the lock screen and the dynamic wallpaper. To add new dynamic effect gameplay, only one development is required to be compatible with both the lock screen and the wallpaper, reducing the development and maintenance costs.
[0208] Using a set of script syntax can be displayed on both the lock screen and the desktop wallpaper, which can improve the compatibility between the lock screen and the desktop.
[0209] Based on the method for generating a dynamic wallpaper according to the above embodiments, the embodiments of the present application further provide a device for generating a dynamic wallpaper, as Figure 14 shown Figure 14 is a schematic structural diagram of a device for generating a dynamic wallpaper provided by an embodiment of the present application. The device 14 for generating a dynamic wallpaper includes: an acquisition unit 1401 and a generation unit 1402, where
[0210] The acquisition unit 1401 is configured to acquire a resource package;
[0211] The generation unit 1402 is configured to call the lock screen resources to perform parsing processing and data processing on the resource package, and generate a first view under the lock screen resources;
[0212] The acquisition unit 1401 is further configured to, when the type of the resource package is a wallpaper type, acquire wallpaper parameters corresponding to the first view; acquire a wallpaper template;
[0213] The generation unit 1402 is further configured to load the wallpaper parameters through the wallpaper template to generate a dynamic wallpaper of the first view.
[0214] In some embodiments of the present application, the device 14 for generating a dynamic wallpaper includes: a parsing unit 1403; where
[0215] The parsing unit 1403 is configured to call the lock screen resources to perform parsing processing on the resource package to obtain data of multiple nodes;
[0216] The generating unit 1402 is further configured to perform mapping processing on the data of the multiple nodes to generate multiple second views corresponding to the multiple nodes; and perform data processing based on the multiple second views to generate the first view.
[0217] In some embodiments of the present application, the obtaining unit 1401 is further configured to obtain wallpaper parameters corresponding to the first view through a substring object and a logical display object corresponding to the wallpaper resource.
[0218] In some embodiments of the present application, the dynamic wallpaper generating device 14 includes: a copying unit 1404;
[0219] In some embodiments of the present application, the obtaining unit 1401 is further configured to obtain initial wallpaper parameters of the first view through the substring object and the logical display object corresponding to the wallpaper resource;
[0220] The copying unit 1404 is configured to perform copying processing based on the initial wallpaper parameters to obtain the wallpaper parameters corresponding to the first view.
[0221] In some embodiments of the present application, the dynamic wallpaper generating device 14 includes: a establishing unit 1405 and an updating unit 1406; wherein,
[0222] The establishing unit 1404 is configured to establish a target tool class through the substring object and the logical display object corresponding to the wallpaper resource;
[0223] The updating unit 1406 is configured to perform updating processing on the original wallpaper parameters of the target tool class based on the first view to obtain the initial wallpaper parameters.
[0224] In some embodiments of the present application, the obtaining unit 1401 is further configured to obtain the logical display object through a system hidden interface corresponding to the wallpaper resource; and access an input channel through the system hidden interface corresponding to the wallpaper resource to obtain the substring object.
[0225] In some embodiments of the present application, the obtaining unit 1401 is further configured to integrate a view buffer adaptation layer into a framework of the current operating system to directly access the system hidden interface when current operating system parameters are preset system parameters; and encapsulate the view buffer adaptation layer into a software package to access the system hidden interface in a manner of system call-level reflection when the current operating system parameters are not preset system parameters.
[0226] In some embodiments of the present application, the obtaining unit 1401 is further configured to access the system hidden interface to obtain the wallpaper template when the system version of the current operating system is a preset version; when the system version of the current operating system is not the preset version, obtain target parameters through dynamic proxy technology; and perform a copying process on the target parameters to obtain the wallpaper template.
[0227] In some embodiments of the present application, the obtaining unit 1401 is further configured to perform data fusion processing based on the wallpaper parameters and the wallpaper template to obtain wallpaper content;
[0228] The generating unit 1402 is further configured to perform a rendering process on the wallpaper content of the first view to generate a dynamic wallpaper of the first view.
[0229] In some embodiments of the present application, the generating unit 1402 is further configured to obtain a resource package, call the lock screen resources to perform parsing processing and data processing on the resource package, and after generating the first view under the lock screen resources, when the type of the resource package is the lock screen type, generate a lock screen wallpaper based on the first view; when the type of the resource package is a preset type, generate the content corresponding to the preset type based on the first view; wherein the preset type is other types except the wallpaper type and the lock screen type.
[0230] In some embodiments of the present application, the dynamic wallpaper generating device 14 includes: a determining unit 1407;
[0231] The obtaining unit 1401 is further configured to, after obtaining the resource package, call the lock screen resources to perform parsing processing on the resource package to obtain data of multiple nodes; wherein the resource package has a unified script syntax and a unified package structure;
[0232] The generating unit 1402 is further configured to perform various different types of data processing on the data of the multiple nodes to generate multiple third views corresponding to the various different types;
[0233] The determining unit 1407 is configured to determine a target view corresponding to the type of the resource package among the multiple third views based on the type of the resource package; and apply the target view in the scenario corresponding to the type of the resource package.
[0234] Based on the dynamic wallpaper generating method of the above embodiments, an embodiment of the present application further provides a terminal device, as Figure 15 shown Figure 15A schematic structural diagram of a terminal device provided by an embodiment of the present application. The terminal device 15 includes: a processor 1501 and a memory 1502. The memory 1502 is used to store a computer program; the processor 1501 is used to call and run the computer program from the memory to execute the method for generating a dynamic wallpaper as described in the above embodiment.
[0235] In the embodiment of the present application, the above-mentioned processor 1501 may be at least one of an application specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field programmable gate array (FPGA), a central processing unit (CPU), a controller, a microcontroller, and a microprocessor. It can be understood that for different devices, the electronic devices for implementing the above processor functions may also be others, and the embodiments of the present application do not make specific limitations.
[0236] The embodiment of the present application provides a computer program product, including a computer program or instruction, which is used to implement the method for generating a dynamic wallpaper as described in any one of the above embodiments when being executed by a processor.
[0237] Exemplarily, the program instructions corresponding to a method for generating a dynamic wallpaper in this embodiment may be stored on a storage medium such as an optical disc, a hard disk, or a USB flash drive. When the program instructions corresponding to a method for generating a dynamic wallpaper in the storage medium are read or executed by an electronic device, the method for generating a dynamic wallpaper as described in any one of the above embodiments can be implemented.
[0238] In addition, in the embodiment of the present application, each functional module may be integrated in a processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit. The above integrated unit may be implemented in the form of hardware or in the form of a software functional module.
[0239] When an integrated unit is implemented in the form of a software functional module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the method of this embodiment. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM), random access memories (RAM), magnetic disks, or optical discs.
[0240] It should be understood that the "one embodiment" or "an embodiment" or "some embodiments" mentioned throughout the specification means that the specific features, structures, or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, the appearances of "in one embodiment" or "in an embodiment" or "in some embodiments" throughout the specification do not necessarily refer to the same embodiment. In addition, these specific features, structures, or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present application, the magnitudes of the serial numbers of the above processes do not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application. The serial numbers of the embodiments of the present application above are only for description and do not represent the advantages or disadvantages of the embodiments. The above descriptions of each embodiment tend to emphasize the differences between each embodiment, and their similarities or similarities can be referred to each other. For the sake of brevity, they will not be repeated herein.
[0241] The modules described as separate components above may or may not be physically separated, and the components shown as modules may or may not be physical modules; they can be located in one place or distributed to multiple network units; some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0242] In addition, in each embodiment of the present application, each functional module can be fully integrated in a processing unit, or each module can be separately used as a unit, or two or more modules can be integrated in a unit; the above integrated modules can be implemented in the form of hardware or in the form of a combination of hardware and software functional units.
[0243] Those of ordinary skill in the art can understand that all or part of the steps for implementing the above method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps including those of the above method embodiments; and the aforementioned storage medium includes various media that can store program codes, such as removable storage devices, read-only memory (ROM), magnetic disks, or optical discs.
[0244] The methods disclosed in several method embodiments provided by the embodiments of the present application can be arbitrarily combined without conflict to obtain new method embodiments.
[0245] The features disclosed in several product embodiments provided by the embodiments of the present application can be arbitrarily combined without conflict to obtain new product embodiments.
[0246] The features disclosed in several method or device embodiments provided by the embodiments of the present application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.
[0247] As mentioned above, it is only the implementation manner of the embodiments of the present application, but the protection scope of the embodiments of the present application is not limited thereto. Any person skilled in the art within the technical scope disclosed in the present application can easily think of changes or substitutions, which should all be covered within the protection scope of the embodiments of the present application. Therefore, the protection scope of the embodiments of the present application shall be subject to the protection scope of the claims.
Claims
1. A method for generating a dynamic wallpaper, characterized in that, The method includes: Obtain a resource package, call the lock screen resources to perform parsing processing and data processing on the resource package, and generate a first view under the lock screen resources; When the type of the resource package is the wallpaper type, obtain the wallpaper parameters corresponding to the first view; Obtain a wallpaper template, and load the wallpaper parameters through the wallpaper template to generate a dynamic wallpaper of the first view.
2. The method according to claim 1, wherein The step of calling the lock screen resources to perform parsing processing and data processing on the resource package to generate a first view under the lock screen resources includes: Call the lock screen resources to perform parsing processing on the resource package to obtain data of multiple nodes; Perform mapping processing on the data of the multiple nodes to generate multiple second views corresponding to the data of the multiple nodes; Perform data processing based on the multiple second views to generate the first view.
3. The method according to claim 1, characterized in that, The step of obtaining the wallpaper parameters corresponding to the first view includes: Obtain the wallpaper parameters corresponding to the first view through a substring object and a logical display object corresponding to the wallpaper resources.
4. The method according to claim 3, wherein The step of obtaining the wallpaper parameters corresponding to the first view through a substring object and a logical display object corresponding to the wallpaper resources includes: Obtain the initial wallpaper parameters of the first view through the substring object and the logical display object corresponding to the wallpaper resources; Perform copying processing based on the initial wallpaper parameters to obtain the wallpaper parameters corresponding to the first view.
5. The method according to claim 4, characterized in that, The step of obtaining the initial wallpaper parameters of the first view through the substring object and the logical display object corresponding to the wallpaper resources includes: Establish a target tool class through the substring object and the logical display object corresponding to the wallpaper resources; Based on the first view, perform update processing on the original wallpaper parameters of the target tool class to obtain the initial wallpaper parameters.
6. The method according to claim 3, wherein The method further includes: Obtain the logical display object through a system hidden interface corresponding to the wallpaper resources; Access an input channel through a system hidden interface corresponding to the wallpaper resources to obtain the substring object.
7. The method according to claim 6, characterized in that, The method further includes: When the current operating system parameters are preset system parameters, integrate the view buffer adaptation layer into the framework of the current operating system to directly access the system hidden interface; When the current operating system parameters are not preset system parameters, encapsulate the view buffer adaptation layer into a software package to access the system hidden interface through the system call-level reflection method.
8. The method according to claim 6 or 7, characterized in that The step of obtaining the wallpaper template includes: When the system version of the current operating system is a preset version, access the system hidden interface to obtain the wallpaper template; When the system version of the current operating system is not a preset version, obtain target parameters through dynamic proxy technology; and perform copying processing on the target parameters to obtain the wallpaper template.
9. The method according to any one of claims 1 to 6, characterized in that, The step of loading the wallpaper parameters through the wallpaper template to generate a dynamic wallpaper of the first view includes: Perform data fusion processing based on the wallpaper parameters and the wallpaper template to obtain wallpaper content; Perform rendering processing on the wallpaper content of the first view to generate a dynamic wallpaper of the first view.
10. The method according to claim 1, characterized in that, After obtaining the resource package, invoking the lock screen resources to perform parsing processing and data processing on the resource package, and generating a first view under the lock screen resources, the method further includes: When the type of the resource package is the lock screen type, generating a lock screen wallpaper based on the first view; When the type of the resource package is a preset type, generating the content corresponding to the preset type based on the first view; wherein, the preset type is other types except the wallpaper type and the lock screen type.
11. The method according to claim 1, wherein After obtaining the resource package, the method further includes: Invoking the lock screen resources to perform parsing processing on the resource package to obtain data of multiple nodes; wherein, the resource package has a unified script syntax and a unified package structure; Performing various different types of data processing on the data of the multiple nodes to generate multiple third views corresponding to the various different types; Based on the type of the resource package, determining a target view corresponding to the type of the resource package among the multiple third views; Applying the target view in the scenario corresponding to the type of the resource package.
12. A generating device for dynamic wallpapers, characterized in that, The dynamic wallpaper generating device includes: an obtaining unit and a generating unit; wherein, The obtaining unit is configured to obtain a resource package; The generating unit is configured to invoke the lock screen resources to perform parsing processing and data processing on the resource package to generate a first view under the lock screen resources; The obtaining unit is further configured to, when the type of the resource package is the wallpaper type, obtain wallpaper parameters corresponding to the first view; and obtain a wallpaper template; The generating unit is further configured to load the wallpaper parameters through the wallpaper template to generate a dynamic wallpaper of the first view.
13. A terminal device, characterized in that, It includes a processor and a memory, the memory is used to store a computer program, and the processor is used to invoke and run the computer program stored in the memory to execute the method according to any one of claims 1 to 11.
14. A computer program product, characterized in that, It includes a computer program or instruction, and when the computer program or instruction is executed by a processor, the method according to any one of claims 1 to 11 is implemented.