CN111209065B - Dynamic wallpaper setting method and device, storage medium and electronic equipment - Google Patents

Dynamic wallpaper setting method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN111209065B
CN111209065B CN201911415154.6A CN201911415154A CN111209065B CN 111209065 B CN111209065 B CN 111209065B CN 201911415154 A CN201911415154 A CN 201911415154A CN 111209065 B CN111209065 B CN 111209065B
Authority
CN
China
Prior art keywords
dynamic
resource
wallpaper
dynamic wallpaper
file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911415154.6A
Other languages
Chinese (zh)
Other versions
CN111209065A (en
Inventor
邓楚坤
付光鑫
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201911415154.6A priority Critical patent/CN111209065B/en
Publication of CN111209065A publication Critical patent/CN111209065A/en
Application granted granted Critical
Publication of CN111209065B publication Critical patent/CN111209065B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Abstract

The embodiment of the application discloses a dynamic wallpaper setting method, a device, a storage medium and electronic equipment, wherein when a dynamic wallpaper setting instruction sent by a target process is received, resource identification information corresponding to the dynamic wallpaper setting instruction is acquired; acquiring a dynamic resource file based on the resource identification information, and analyzing the dynamic resource file to acquire dynamic resource data, a configuration file and an animation script file; drawing dynamic wallpaper according to the dynamic resource data, the configuration file and the wallpaper service, so as to respond to a dynamic wallpaper setting instruction; when the interface switching operation is detected, controlling the dynamic display of the dynamic wallpaper according to the animation script file, and realizing the cross-process dynamic wallpaper setting.

Description

Dynamic wallpaper setting method and device, storage medium and electronic equipment
Technical Field
The application relates to the technical field of terminals, in particular to a dynamic wallpaper setting method and device, a storage medium and electronic equipment.
Background
Wallpaper of electronic equipment can be divided into dynamic wallpaper and static wallpaper according to the expression form, wherein the static wallpaper is a static picture as a background picture of the wallpaper, and the dynamic wallpaper is the wallpaper with a dynamic display effect. The conventional dynamic wallpaper setting mode has complicated steps, and needs to enter a system wallpaper setting interface every time, and preview and setting operations are performed through a dynamic wallpaper selector, so that cross-process dynamic wallpaper setting cannot be realized.
Disclosure of Invention
The embodiment of the application provides a dynamic wallpaper setting method, a device, a storage medium and electronic equipment, which can realize cross-process dynamic wallpaper setting.
In a first aspect, an embodiment of the present application provides a method for setting dynamic wallpaper, including:
when a dynamic wallpaper setting instruction sent by a target process is received, acquiring resource identification information corresponding to the dynamic wallpaper setting instruction;
acquiring a dynamic resource file based on the resource identification information, and analyzing the dynamic resource file to acquire dynamic resource data, a configuration file and an animation script file;
drawing dynamic wallpaper according to the dynamic resource data, the configuration file and the wallpaper service, so as to respond to the dynamic wallpaper setting instruction;
and when the interface switching operation is detected, controlling the dynamic display of the dynamic wallpaper according to the animation script file.
In a second aspect, an embodiment of the present application further provides a dynamic wallpaper setting device, including:
the information acquisition unit is used for acquiring resource identification information corresponding to a dynamic wallpaper setting instruction when the dynamic wallpaper setting instruction sent by a target process is received;
the resource acquisition unit is used for acquiring a dynamic resource file based on the resource identification information and analyzing the dynamic resource file to acquire dynamic resource data, a configuration file and an animation script file;
the wallpaper drawing unit is used for drawing dynamic wallpaper according to the dynamic resource data, the configuration file and the wallpaper service so as to respond to the dynamic wallpaper setting instruction;
and the dynamic display unit is used for controlling the dynamic display of the dynamic wallpaper according to the animation script file when the interface switching operation is detected.
In a third aspect, embodiments of the present application further provide a storage medium having stored thereon a computer program which, when run on a computer, causes the computer to perform a dynamic wallpaper setting method as provided by any of the embodiments of the present application.
In a fourth aspect, an embodiment of the present application further provides an electronic device, including a processor and a memory, where the memory has a computer program, and the processor is configured to execute the dynamic wallpaper setting method according to any embodiment of the present application by calling the computer program.
According to the technical scheme provided by the embodiment of the application, when the dynamic wallpaper setting instruction sent by the target process is received, the resource identification information corresponding to the dynamic wallpaper setting instruction is acquired, the dynamic resource file is acquired based on the resource identification information, the dynamic resource file is analyzed to obtain the dynamic resource data, the configuration file and the animation script file, the drawing of the dynamic wallpaper is realized according to the dynamic resource data, the configuration file and the wallpaper service, when the interface switching operation is detected, the dynamic display of the dynamic wallpaper is controlled according to the animation script file, in this way, when the dynamic wallpaper is required to be set through the external process, the resource identification information can be transmitted to the dynamic wallpaper setting process based on the dynamic wallpaper setting instruction, the dynamic wallpaper setting process can acquire the dynamic resource file through the acquired resource identification and analyze the dynamic resource file, the drawing of the dynamic wallpaper is realized, and when the interface switching operation occurs in the electronic equipment, the dynamic display of the dynamic wallpaper is controlled according to the animation script file, and the cross-process setting of the dynamic wallpaper is realized.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a first flowchart of a dynamic wallpaper setting method according to an embodiment of the present application.
Fig. 2 is an application scenario schematic diagram of a dynamic wallpaper setting method according to an embodiment of the present application.
Fig. 3 is a schematic diagram of a system frame of a dynamic wallpaper setting method according to an embodiment of the present application.
Fig. 4 is a second flowchart of a dynamic wallpaper setting method according to an embodiment of the present application.
Fig. 5 is a schematic structural diagram of a dynamic wallpaper setting device according to an embodiment of the present application.
Fig. 6 is a schematic diagram of a first structure of an electronic device according to an embodiment of the present application.
Fig. 7 is a schematic diagram of a second structure of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. It will be apparent that the described embodiments are only some, but not all, embodiments of the application. All other embodiments, which can be made by a person skilled in the art without any inventive effort, are intended to be within the scope of the present application based on the embodiments of the present application.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments.
The embodiment of the application provides a dynamic wallpaper setting method, and an execution main body of the dynamic wallpaper setting method can be the dynamic wallpaper setting device provided by the embodiment of the application or electronic equipment integrated with the dynamic wallpaper setting device, wherein the dynamic wallpaper setting device can be realized in a hardware or software mode. The electronic device may be a smart phone, a tablet computer, a palm computer, a notebook computer, or a desktop computer.
Referring to fig. 1, fig. 1 is a schematic flow chart of a dynamic wallpaper setting method according to an embodiment of the application. The specific flow of the dynamic wallpaper setting method provided by the embodiment of the application can be as follows:
101. when a dynamic wallpaper setting instruction sent by a target process is received, resource identification information corresponding to the dynamic wallpaper setting instruction is acquired.
In the conventional dynamic wallpaper setting scheme, each dynamic wallpaper needs to register one WallpaperService in the APK to represent one dynamic wallpaper service. And the wallpaper is set up to be displayed on the desktop after the wallpaper is jumped to the dynamic wallpaper selector to preview. Therefore, the setting steps of the dynamic wallpaper are complicated, and each time of setting or updating the dynamic wallpaper can be realized through a plurality of steps such as a dynamic wallpaper selector, preview, setting and the like. Meanwhile, by the setting mode, a user can only enter a dynamic wallpaper setting interface set by the system to set, and dynamic wallpaper resources acquired by other application programs cannot be set directly.
The electronic device is provided with a process for implementing dynamic wallpaper settings, hereinafter referred to as dynamic wallpaper engine, with which other processes running in the electronic device can communicate across processes via a preset communication protocol, e.g. communication between the dynamic wallpaper engine and other processes via AIDL (Android Interface Definition Language, android interface language). The other process may be any process of an application program capable of acquiring the dynamic wallpaper resource, for example, a process of an application program such as a video management program, a theme store, a resource manager, and the like.
Referring to fig. 2, fig. 2 is a schematic application scenario diagram of a dynamic wallpaper setting method according to an embodiment of the present application. In the embodiment of the application, the user can realize the setting of the dynamic wallpaper in other processes except the dynamic wallpaper engine. For example, the user obtains a dynamic wallpaper resource through the target process, triggers a dynamic wallpaper setting instruction through a "set wallpaper for" control in the options of the dynamic wallpaper, and sends the dynamic wallpaper setting instruction to the dynamic wallpaper engine through inter-process communication. The dynamic wallpaper setting instruction carries resource identification information corresponding to the dynamic wallpaper resource file, and other processes can acquire the dynamic wallpaper resource file according to the resource identification information. In some embodiments, the resource identification information may be a URI (uniform resource identifier). For example, after receiving the dynamic wallpaper setting instruction, the dynamic wallpaper engine may acquire a dynamic wallpaper resource file based on the uniform resource identifier, and directly set the dynamic wallpaper corresponding to the dynamic wallpaper resource file as the current dynamic wallpaper in the background.
102. And acquiring a dynamic resource file based on the resource identification information, and analyzing the dynamic resource file to acquire dynamic resource data, a configuration file and an animation script file.
The dynamic resource file of the target process may be a file in a compressed format, for example, ZIP format, etc. The compressed file is packed with dynamic resource data, configuration file and animation script file, wherein the dynamic resource data contains various resource data for realizing dynamic wallpaper display, which can be pictures, videos, frame sequences and the like. The configuration file is attribute information for defining the dynamic wallpaper, and the file may be a text document, for example, a config format document, for defining an ID, version number, name, rendering type, engine version, name and format of the animation script file, etc. of the dynamic wallpaper. The animation script file is mainly used for configuring dynamic wallpaper to display different interfaces or animations at different time.
The external process needs to uniformly package dynamic resource data, configuration files, animation script files and the like into a compressed package, and the security, timeliness and the like of the resource are controlled by the external application. The external process embeds the compressed package in its own APP or in the SD card and generates a URI accessible by a dynamic wallpaper engine. The external process communicates with the dynamic wallpaper engine through an AIDL communication protocol agreed with the dynamic wallpaper engine, sends the URI of the available dynamic resource file to the dynamic wallpaper engine and sends a dynamic wallpaper setting instruction.
Referring to fig. 3, fig. 3 is a schematic diagram of a system frame of a dynamic wallpaper setting method according to an embodiment of the application. In the scheme of the embodiment of the application, the dynamic wallpaper engine comprises a resource management module, a communication module, an XML analysis sub-module, a resource analysis module and a wallpaper service module. Wherein the external application communicates with the dynamic wallpaper engine through the communication module. The resource management module acquires dynamic wallpaper resources through ADIL. The XML analysis submodule is used for analyzing the animation script file, and the resource analysis module controls the dynamic resource data to be displayed according to the definition of the script file through the WallpaperService.
Taking the resource identification information as a URI as an example, after the dynamic wallpaper engine acquires the URI, the received URI is read to acquire a dynamic resource file. Parsing the dynamic resource file to obtain dynamic resource data, configuration files, and animation script files in some embodiments includes: decompressing the dynamic resource file to obtain decompressed data, and acquiring a configuration file from the decompressed data; parsing the configuration file to determine script file format and rendering type; and acquiring an animation script file corresponding to the script file format from the decompressed data, and acquiring dynamic resource data matched with the rendering type from the decompressed data.
The resource manager analyzes the configuration file in the decompressed data to determine the format and the name of the animation script file, and further determines the animation script file from the decompressed data according to the format and the name. In addition, the resource manager can determine the rendering type according to the configuration file, and further acquire dynamic resource data matched with the rendering type from the decompressed data.
103. And drawing dynamic wallpaper according to the dynamic resource data, the configuration file and the wallpaper service, so as to respond to the dynamic wallpaper setting instruction.
And then, the dynamic wallpaper engine realizes drawing of the dynamic wallpaper according to the acquired dynamic resource data, the configuration file and the wallpaper service. For example, the dynamic wallpaper engine determines a drawing mode of the dynamic wallpaper through the configuration file, and then realizes drawing of the dynamic wallpaper according to the drawing mode through the wallpaper service.
104. And when the interface switching operation is detected, controlling the dynamic display of the dynamic wallpaper according to the animation script file.
After the dynamic wallpaper is set, different interfaces or animations are displayed on different display occasions by the dynamic wallpaper, the effect is realized by an animation script file, and when the electronic equipment performs interface switching operation, the dynamic display of the dynamic wallpaper can be controlled according to the animation script file.
The animation script file may be in XML (Extensible Markup Language ) format, json (JavaScript Object Notation, json object profile) format, or the like. The animation script file is mainly used for configuring dynamic wallpaper to display different interfaces or animations at different time. A plurality of response methods are defined in the animation script file, each response method corresponds to an interface switching operation, and the response method defines a dynamic display method, so that when the electronic equipment performs the interface switching operation, the response method corresponding to the interface switching operation can be determined according to the animation script file, and further dynamic resource data is controlled to be displayed according to the response method and the corresponding dynamic display mode. For example, wallpaper will trigger a response method to perform a certain dynamic resource data loop play when it is first applied or returned to the desktop from other applications.
For example, when making dynamic wallpaper, the xml outermost node is defined as:
the root node LiveWallpaper is used for representing the current document and analyzing the dynamic wallpaper.
The child nodes under the Elements/> node all represent Elements to be rendered, such as Elements of video, pictures, models, H264 format video and the like, and different Elements have different attributes, but each element needs to be configured with a unique ID, namely a resource identifier.
Different Animations will be configured under the animation/> node, each animation also requiring a unique ID to be configured, each animation requiring binding of one to multiple elements. The animation may be play, displacement, rotation, scaling, reflection animation, etc., and embodiments of the present application are not particularly limited thereto.
< Methods/> various response Methods are configured under the nodes, each method can specify that one animation is performed once or that the animation is played in a loop or interval. Whether or not to loop will be determined by the attribute value. For example: "loop": and (5) circularly playing. "once": pause after play only once. "specific value" (eg: "5000"): and played every few milliseconds. The response method can be set according to the requirement of the dynamic effect, for example, the trigger response method onStart is initialized when a set of wallpaper is set or replaced. The wallpaper will trigger the response method onResume when it is first applied or returned to the desktop from other applications, and the dynamic wallpaper engine performs some animation or other action. After screen locking, the desktop trigger-response method onresumeromromlock is returned, the dynamic wallpaper engine performs some animation or other action, and so on.
In particular, the application is not limited by the order of execution of the steps described, as some of the steps may be performed in other orders or concurrently without conflict.
As can be seen from the foregoing, in the dynamic wallpaper setting method provided by the embodiment of the application, when a dynamic wallpaper setting instruction sent by a target process is received, resource identification information corresponding to the dynamic wallpaper setting instruction is obtained, a dynamic resource file is obtained based on the resource identification information, the dynamic resource file is parsed to obtain dynamic resource data, a configuration file and an animation script file, drawing of the dynamic wallpaper is realized according to the dynamic resource data, the configuration file and a wallpaper service, when an interface switching operation is detected, dynamic display of the dynamic wallpaper is controlled according to the animation script file, in this way, when the dynamic wallpaper is required to be set through an external process, the resource identification information can be transmitted to the dynamic wallpaper setting process based on the dynamic wallpaper setting instruction, the dynamic wallpaper setting process can obtain the dynamic resource file through the obtained resource identification and parse the dynamic resource file, and when the electronic device performs the interface switching operation, the dynamic display of the dynamic wallpaper is controlled according to the animation script file, so that the cross-process setting of the dynamic wallpaper is realized.
The method described in the previous examples is described in further detail below by way of example.
Referring to fig. 4, fig. 4 is a second flow chart of the dynamic wallpaper setting method according to the embodiment of the application. The method comprises the following steps:
201. when a dynamic wallpaper setting instruction sent by a target process is received, resource identification information corresponding to the dynamic wallpaper setting instruction is acquired.
The user obtains a dynamic wallpaper resource through the target process, triggers a dynamic wallpaper setting instruction through a wallpaper setting control in options of the dynamic wallpaper, and sends the dynamic wallpaper setting instruction to a dynamic wallpaper engine through inter-process communication. And after receiving the dynamic wallpaper setting instruction, the dynamic wallpaper engine acquires the URI.
202. And acquiring a dynamic resource file based on the resource identification information, and analyzing the dynamic resource file to acquire dynamic resource data, a configuration file and an animation script file.
After the dynamic wallpaper engine acquires the URI, the received URI is read to acquire the dynamic resource file. And decompressing the dynamic resource file, analyzing the configuration file in the decompressed data to determine the format and the name of the animation script file, and further determining the animation script file from the decompressed data according to the format and the name. In addition, the resource manager can determine the rendering type according to the configuration file, and further acquire dynamic resource data matched with the rendering type from the decompressed data.
203. And creating a first resource instance according to the configuration file and the dynamic resource data.
Referring to fig. 3, in the script parsing module of the dynamic wallpaper engine, corresponding parsing sub-modules, such as XML, json, etc., are set for script files of different formats. The resource analysis module is provided with corresponding rendering sub-modules, such as Normalvideo, normalImage, for different types of dynamic resource data. The resource resolution module determines a corresponding rendering sub-module by the rendering type determined in 202, and creates a first resource instance based on the rendering sub-module and the dynamic resource data.
204. And determining a target analysis submodule corresponding to the script file format, and analyzing the animation script file according to the target analysis submodule to generate an analysis instance.
The script analysis module determines a script file format corresponding to the animation script file, determines a target analysis submodule from a plurality of analysis submodules, starts the target analysis submodule to analyze the animation script file, generates an analysis instance, and the analysis instance is used for assisting the first resource instance to respond to different interface switching operations and execute corresponding actions.
205. And drawing dynamic wallpaper according to the first resource instance and the wallpaper service, so as to respond to the dynamic wallpaper setting instruction.
The dynamic wallpaper engine is used for drawing dynamic wallpaper based on the wallpaper service module and the first resource instance. If the dynamic wallpaper engine is to set the dynamic wallpaper for the first time, the dynamic wallpaper engine is used as a system level process, and a system method is called in the background based on the Wallpaper service implementation class built in the dynamic wallpaper engine to realize a first resource instance so as to set the dynamic wallpaper as the system wallpaper. If the dynamic wallpaper engine is not the first dynamic wallpaper, the current resource instance in the dynamic wallpaper engine is directly switched to the first resource instance.
206. And setting the first resource instance as a drawing execution class of the wallpaper service.
207. When the interface switching operation is detected, determining a response method corresponding to the interface switching operation based on the first resource instance, determining a target drawing operation corresponding to the response method from the analysis instance, and executing the target drawing operation.
208. And the drawing operation is realized through the wallpaper service so as to update the wallpaper display interface.
In some embodiments, when an interface switching operation is detected, determining a response method corresponding to the interface switching operation based on the first resource instance, determining a target drawing operation corresponding to the response method from the parsing instance, and executing the target drawing operation, where the determining includes: when interface switching operation is detected, determining a response method corresponding to the interface switching operation based on the first resource instance; detecting whether the analysis example contains the response method or not; if yes, determining a resource identifier and a drawing parameter corresponding to the response method from the analysis example; and based on the first resource instance, controlling the animation element corresponding to the resource identifier to execute the target drawing operation according to the drawing parameter.
The method comprises the steps that a dynamic wallpaper engine sets a first resource instance as a drawing execution class of the wallpaper service, a user executes a certain operation on electronic equipment, for example, the user returns to a desktop from a certain application, the electronic equipment executes interface switching operation, a response method corresponding to the interface switching operation is determined, then the dynamic wallpaper engine searches drawing operation to be executed in a corresponding method in an analysis instance, for example, a certain section of video is played, a certain picture is drawn, movement or rotation of certain resource data on an interface is controlled, namely, a resource identifier and drawing parameters are determined, and animation elements corresponding to the resource identifier are controlled to execute the drawing operation according to the drawing parameters.
And the dynamic wallpaper engine realizes drawing operation through the wallpaper service module to update the wallpaper display interface, and the wallpaper displays the drawing operation. It will be appreciated that nothing is done if no corresponding response method is found.
As can be seen from the above, the dynamic wallpaper setting method provided by the embodiment of the application omits a complicated operation flow for a user, directly realizes setting and switching of dynamic wallpaper in the background, when the dynamic wallpaper is required to be set through an external process, can transmit resource identification information to the dynamic wallpaper setting process based on the dynamic wallpaper setting instruction, and the dynamic wallpaper setting process can acquire a dynamic resource file through the acquired resource identification and analyze the dynamic resource file to realize drawing of the dynamic wallpaper, and controls dynamic display of the dynamic wallpaper according to the animation script file when interface switching operation occurs in the electronic equipment, thereby realizing cross-process setting of the dynamic wallpaper.
In one embodiment, a dynamic wallpaper setting device is also provided. Referring to fig. 5, fig. 5 is a schematic structural diagram of a dynamic wallpaper setting device 300 according to an embodiment of the application. The dynamic wallpaper setting device 300 is applied to an electronic device, and the dynamic wallpaper setting device 300 includes an information acquisition unit 301, a resource acquisition unit 302, a wallpaper drawing unit 303, and a dynamic display unit 304, as follows:
an information obtaining unit 301, configured to obtain, when a dynamic wallpaper setting instruction sent by a target process is received, resource identification information corresponding to the dynamic wallpaper setting instruction;
a resource obtaining unit 302, configured to obtain a dynamic resource file based on the resource identification information, and parse the dynamic resource file to obtain dynamic resource data, a configuration file and an animation script file;
a wallpaper drawing unit 303, configured to implement drawing of dynamic wallpaper according to the dynamic resource data, the configuration file, and the wallpaper service, so as to respond to the dynamic wallpaper setting instruction;
and the dynamic display unit 304 is used for controlling the dynamic display of the dynamic wallpaper according to the animation script file when the interface switching operation is detected.
In some embodiments, the resource acquisition unit 302 is further configured to:
decompressing the dynamic resource file to obtain decompressed data, and acquiring a configuration file from the decompressed data;
parsing the configuration file to determine script file format and rendering type;
and acquiring an animation script file corresponding to the script file format from the decompressed data, and acquiring dynamic resource data matched with the rendering type from the decompressed data.
In some embodiments, wallpaper drawing unit 303 is further to:
creating a first resource instance according to the configuration file and the dynamic resource data;
and drawing dynamic wallpaper according to the first resource instance and the wallpaper service, so as to respond to the dynamic wallpaper setting instruction.
In some embodiments, wallpaper drawing unit 303 is further to: and generating an analysis instance based on the animation script file.
In some embodiments, dynamic presentation unit 304 is further to:
setting the first resource instance as a drawing execution class of the wallpaper service;
when interface switching operation is detected, determining a response method corresponding to the interface switching operation based on the first resource instance, determining a target drawing operation corresponding to the response method from the analysis instance, and executing the target drawing operation;
and the drawing operation is realized through the wallpaper service so as to update the wallpaper display interface.
In some embodiments, dynamic presentation unit 304 is further to:
when interface switching operation is detected, determining a response method corresponding to the interface switching operation based on the first resource instance;
detecting whether the analysis example contains the response method or not;
if yes, determining a resource identifier and a drawing parameter corresponding to the response method from the analysis example;
and based on the first resource instance, controlling the animation element corresponding to the resource identifier to execute the target drawing operation according to the drawing parameter.
In the implementation, each module may be implemented as an independent entity, or may be combined arbitrarily, and implemented as the same entity or several entities, and the implementation of each module may be referred to the foregoing method embodiment, which is not described herein again.
It should be noted that, the dynamic wallpaper setting device provided by the embodiment of the present application belongs to the same concept as the dynamic wallpaper setting method in the above embodiment, and any method provided in the dynamic wallpaper setting method embodiment may be run on the dynamic wallpaper setting device, and detailed implementation processes of the method are shown in the dynamic wallpaper setting method embodiment, which is not repeated herein.
As can be seen from the foregoing, in the dynamic wallpaper setting device provided by the embodiment of the application, when a dynamic wallpaper setting instruction sent by a target process is received, resource identification information corresponding to the dynamic wallpaper setting instruction is obtained, a dynamic resource file is obtained based on the resource identification information, the dynamic resource file is parsed to obtain dynamic resource data, a configuration file and an animation script file, drawing of the dynamic wallpaper is realized according to the dynamic resource data, the configuration file and a wallpaper service, when an interface switching operation is detected, dynamic display of the dynamic wallpaper is controlled according to the animation script file, in this way, when the dynamic wallpaper is required to be set through an external process, the resource identification information can be transmitted to the dynamic wallpaper setting process based on the dynamic wallpaper setting instruction, the dynamic wallpaper setting process can obtain the dynamic resource file through the obtained resource identification and perform parsing processing, drawing of the dynamic wallpaper is realized, and when the electronic device performs the interface switching operation, dynamic display of the dynamic wallpaper is controlled according to the animation script file, and cross-process setting of the dynamic wallpaper is realized.
The embodiment of the application also provides electronic equipment. The electronic equipment can be a smart phone, a tablet personal computer and other equipment. Referring to fig. 6, fig. 6 is a schematic diagram of a first structure of an electronic device according to an embodiment of the application. The electronic device 400 comprises a processor 401 and a memory 402. The processor 401 is electrically connected to the memory 402.
The processor 401 is a control center of the electronic device 400, connects various parts of the entire electronic device using various interfaces and lines, and performs various functions of the electronic device and processes data by running or calling computer programs stored in the memory 402, and calling data stored in the memory 402, thereby performing overall monitoring of the electronic device.
Memory 402 may be used to store computer programs and data. The memory 402 stores a computer program having instructions executable in a processor. The computer program may constitute various functional modules. The processor 401 executes various functional applications and data processing by calling a computer program stored in the memory 402.
In this embodiment, the processor 401 in the electronic device 400 loads the instructions corresponding to the processes of one or more computer programs into the memory 402 according to the following steps, and the processor 401 executes the computer programs stored in the memory 402, so as to implement various functions:
when a dynamic wallpaper setting instruction sent by a target process is received, acquiring resource identification information corresponding to the dynamic wallpaper setting instruction;
acquiring a dynamic resource file based on the resource identification information, and analyzing the dynamic resource file to acquire dynamic resource data, a configuration file and an animation script file;
drawing dynamic wallpaper according to the dynamic resource data, the configuration file and the wallpaper service, so as to respond to the dynamic wallpaper setting instruction;
and when the interface switching operation is detected, controlling the dynamic display of the dynamic wallpaper according to the animation script file.
In some embodiments, referring to fig. 7, fig. 7 is a schematic diagram of a second structure of an electronic device according to an embodiment of the application. The electronic device 400 further comprises: radio frequency circuit 403, display 404, control circuit 405, input unit 406, audio circuit 407, sensor 408, and power supply 409. The processor 401 is electrically connected to the radio frequency circuit 403, the display 404, the control circuit 405, the input unit 406, the audio circuit 407, the sensor 408, and the power supply 409, respectively.
The radio frequency circuit 403 is used to transmit and receive radio frequency signals to communicate with a network device or other electronic device through wireless communication.
The display 404 may be used to display information entered by a user or provided to a user as well as various graphical user interfaces of the electronic device, which may be composed of images, text, icons, video, and any combination thereof.
The control circuit 405 is electrically connected to the display screen 404, and is used for controlling the display screen 404 to display information.
The input unit 406 may be used to receive entered numbers, character information, or user characteristic information (e.g., fingerprints), and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control. The input unit 406 may include a fingerprint recognition module.
The audio circuit 407 may provide an audio interface between the user and the electronic device through a speaker, microphone. Wherein the audio circuit 407 comprises a microphone. The microphone is electrically connected to the processor 401. The microphone is used for receiving voice information input by a user.
The sensor 408 is used to collect external environmental information. The sensor 408 may include one or more of an ambient brightness sensor, an acceleration sensor, a gyroscope, and the like.
The power supply 409 is used to power the various components of the electronic device 400. In some embodiments, power supply 409 may be logically connected to processor 401 through a power management system, thereby performing functions such as managing charging, discharging, and power consumption through the power management system.
Although not shown in the drawings, the electronic device 400 may further include a camera, a bluetooth module, etc., which will not be described herein.
In this embodiment, the processor 401 in the electronic device 400 loads the instructions corresponding to the processes of one or more computer programs into the memory 402 according to the following steps, and the processor 401 executes the computer programs stored in the memory 402, so as to implement various functions:
when a dynamic wallpaper setting instruction sent by a target process is received, acquiring resource identification information corresponding to the dynamic wallpaper setting instruction;
acquiring a dynamic resource file based on the resource identification information, and analyzing the dynamic resource file to acquire dynamic resource data, a configuration file and an animation script file;
drawing dynamic wallpaper according to the dynamic resource data, the configuration file and the wallpaper service, so as to respond to the dynamic wallpaper setting instruction;
and when the interface switching operation is detected, controlling the dynamic display of the dynamic wallpaper according to the animation script file.
In some embodiments, when parsing the dynamic resource file to obtain dynamic resource data, configuration files, and animation script files, the processor 401 performs:
decompressing the dynamic resource file to obtain decompressed data, and acquiring a configuration file from the decompressed data;
parsing the configuration file to determine script file format and rendering type;
and acquiring an animation script file corresponding to the script file format from the decompressed data, and acquiring dynamic resource data matched with the rendering type from the decompressed data.
In some embodiments, when the drawing of the dynamic wallpaper is implemented according to the resource data, the configuration file and the wallpaper service, the processor 401 performs:
creating a first resource instance according to the configuration file and the dynamic resource data;
and drawing dynamic wallpaper according to the first resource instance and the wallpaper service, so as to respond to the dynamic wallpaper setting instruction.
In some embodiments, the processor 401 further performs: and generating an analysis instance based on the animation script file.
In some embodiments, when an interface switching operation is detected, the processor 401 performs:
setting the first resource instance as a drawing execution class of the wallpaper service;
when interface switching operation is detected, determining a response method corresponding to the interface switching operation based on the first resource instance, determining a target drawing operation corresponding to the response method from the analysis instance, and executing the target drawing operation;
and the drawing operation is realized through the wallpaper service so as to update the wallpaper display interface.
In some embodiments, when the interface switching operation is detected, a response method corresponding to the interface switching operation is determined based on the first resource instance, a target drawing operation corresponding to the response method is determined from the parsing instance, and the target drawing operation is executed, the processor 401 executes:
when interface switching operation is detected, determining a response method corresponding to the interface switching operation based on the first resource instance;
detecting whether the analysis example contains the response method or not;
if yes, determining a resource identifier and a drawing parameter corresponding to the response method from the analysis example;
and based on the first resource instance, controlling the animation element corresponding to the resource identifier to execute the target drawing operation according to the drawing parameter.
As can be seen from the foregoing, the embodiment of the present application provides an electronic device, when receiving a dynamic wallpaper setting instruction sent by a target process, the electronic device obtains resource identification information corresponding to the dynamic wallpaper setting instruction, obtains a dynamic resource file based on the resource identification information, analyzes the dynamic resource file to obtain dynamic resource data, a configuration file and an animation script file, and realizes drawing of the dynamic wallpaper according to the dynamic resource data, the configuration file and a wallpaper service, when detecting an interface switching operation, controls dynamic display of the dynamic wallpaper according to the animation script file, in this way, when needing to set the dynamic wallpaper through an external process, the dynamic wallpaper setting process can transmit the resource identification information to the dynamic wallpaper setting process based on the dynamic wallpaper setting instruction, and the dynamic wallpaper setting process can obtain the dynamic resource file through the obtained resource identification and perform analysis processing, thereby realizing drawing of the dynamic wallpaper, and when the electronic device performs the interface switching operation, controls dynamic display of the dynamic wallpaper according to the animation script file, thereby realizing cross-process setting of the dynamic wallpaper.
The embodiment of the application also provides a storage medium, in which a computer program is stored, and when the computer program runs on a computer, the computer executes the dynamic wallpaper setting method according to any of the above embodiments.
It should be noted that, those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be implemented by a computer program to instruct related hardware, and the computer program may be stored in a computer readable storage medium, where the storage medium may include, but is not limited to: read Only Memory (ROM), random access Memory (RAM, random Access Memory), magnetic or optical disk, and the like.
Furthermore, the terms "first," "second," and "third," and the like, herein, are used for distinguishing between different objects and not for describing a particular sequential order. Furthermore, the terms "comprise" and "have," as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or modules is not limited to the particular steps or modules listed and certain embodiments may include additional steps or modules not listed or inherent to such process, method, article, or apparatus.
The method, the device, the storage medium and the electronic equipment for setting the dynamic wallpaper provided by the embodiment of the application are described in detail. The principles and embodiments of the present application have been described herein with reference to specific examples, the description of which is intended only to assist in understanding the methods of the present application and the core ideas thereof; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in light of the ideas of the present application, the present description should not be construed as limiting the present application.

Claims (8)

1. A dynamic wallpaper setting method, comprising:
when a dynamic wallpaper engine receives a dynamic wallpaper setting instruction sent by a target process, acquiring resource identification information corresponding to the dynamic wallpaper setting instruction; the target process acquires a dynamic wallpaper resource, and generates a dynamic wallpaper setting instruction based on control triggering in the dynamic wallpaper resource; the target process sends the dynamic wallpaper setting instruction to a dynamic wallpaper engine through a preset communication protocol so as to realize cross-process communication;
acquiring a dynamic resource file based on the resource identification information, and analyzing the dynamic resource file to acquire dynamic resource data, a configuration file and an animation script file;
drawing dynamic wallpaper according to the dynamic resource data, the configuration file and the wallpaper service, so as to respond to the dynamic wallpaper setting instruction;
when the interface switching operation is detected, controlling the dynamic display of the dynamic wallpaper according to the animation script file, wherein the method comprises the following steps: setting a first resource instance as a drawing execution class of the wallpaper service; when interface switching operation is detected, determining a response method corresponding to the interface switching operation based on the first resource instance; detecting whether the analysis example contains the response method or not; if yes, determining a resource identifier and a drawing parameter corresponding to the response method from the analysis example; based on the first resource instance, controlling the animation element corresponding to the resource identifier to execute target drawing operation according to the drawing parameter; the drawing operation is realized through the wallpaper service so as to update a wallpaper display interface;
wherein the first resource instance is created from the configuration file and the dynamic resource data; the parsing instance is generated based on the animation script file.
2. The dynamic wallpaper setting method as claimed in claim 1, wherein said parsing the dynamic resource file to obtain dynamic resource data, configuration files and animation script files comprises:
decompressing the dynamic resource file to obtain decompressed data, and acquiring a configuration file from the decompressed data;
parsing the configuration file to determine script file format and rendering type;
and acquiring an animation script file corresponding to the script file format from the decompressed data, and acquiring dynamic resource data matched with the rendering type from the decompressed data.
3. The method for setting dynamic wallpaper according to claim 1, wherein said rendering of dynamic wallpaper according to said resource data, said configuration file and a wallpaper service comprises:
creating a first resource instance according to the configuration file and the dynamic resource data;
and drawing dynamic wallpaper according to the first resource instance and the wallpaper service.
4. The method for setting dynamic wallpaper according to claim 3, wherein when an interface switching operation is detected, before controlling dynamic presentation of the dynamic wallpaper according to the animation script file, the method further comprises:
and generating an analysis instance based on the animation script file.
5. A dynamic wallpaper setting device, comprising:
the information acquisition unit is used for acquiring resource identification information corresponding to a dynamic wallpaper setting instruction when the dynamic wallpaper engine receives the dynamic wallpaper setting instruction sent by the target process; the target process acquires a dynamic wallpaper resource, and generates a dynamic wallpaper setting instruction based on control triggering in the dynamic wallpaper resource; the target process sends the dynamic wallpaper setting instruction to a dynamic wallpaper engine through a preset communication protocol so as to realize cross-process communication;
the resource acquisition unit is used for acquiring a dynamic resource file based on the resource identification information and analyzing the dynamic resource file to acquire dynamic resource data, a configuration file and an animation script file;
the wallpaper drawing unit is used for drawing dynamic wallpaper according to the dynamic resource data, the configuration file and the wallpaper service so as to respond to the dynamic wallpaper setting instruction;
the dynamic display unit is used for controlling the dynamic display of the dynamic wallpaper according to the animation script file when the interface switching operation is detected, and comprises the following steps: setting a first resource instance as a drawing execution class of the wallpaper service; when interface switching operation is detected, determining a response method corresponding to the interface switching operation based on the first resource instance; detecting whether the analysis example contains the response method or not; if yes, determining a resource identifier and a drawing parameter corresponding to the response method from the analysis example; based on the first resource instance, controlling the animation element corresponding to the resource identifier to execute target drawing operation according to the drawing parameter; the drawing operation is realized through the wallpaper service so as to update a wallpaper display interface;
wherein the first resource instance is created from the configuration file and the dynamic resource data; the parsing instance is generated based on the animation script file.
6. The dynamic wallpaper setting device of claim 5, wherein the resource acquisition unit is further to:
creating a first resource instance according to the configuration file and the dynamic resource data;
and drawing dynamic wallpaper according to the first resource instance and the wallpaper service, so as to respond to the dynamic wallpaper setting instruction.
7. A storage medium having stored thereon a computer program, which when run on a computer causes the computer to perform the dynamic wallpaper setting method according to any of claims 1 to 4.
8. An electronic device comprising a processor and a memory, the memory storing a computer program, characterized in that the processor is adapted to perform the dynamic wallpaper setting method according to any of claims 1-4 by invoking the computer program.
CN201911415154.6A 2019-12-31 2019-12-31 Dynamic wallpaper setting method and device, storage medium and electronic equipment Active CN111209065B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911415154.6A CN111209065B (en) 2019-12-31 2019-12-31 Dynamic wallpaper setting method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911415154.6A CN111209065B (en) 2019-12-31 2019-12-31 Dynamic wallpaper setting method and device, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN111209065A CN111209065A (en) 2020-05-29
CN111209065B true CN111209065B (en) 2023-12-08

Family

ID=70786480

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911415154.6A Active CN111209065B (en) 2019-12-31 2019-12-31 Dynamic wallpaper setting method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN111209065B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114296854B (en) * 2021-12-28 2024-04-26 珠海豹趣科技有限公司 Desktop wallpaper display method and device, electronic equipment and readable storage medium
CN116743908B (en) * 2022-09-13 2024-03-26 荣耀终端有限公司 Wallpaper display method and related device
CN115941836B (en) * 2022-10-28 2023-10-20 荣耀终端有限公司 Interface display method, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011111926A2 (en) * 2010-03-12 2011-09-15 블루가 (주) Apparatus and method for implementing web-based user interface on mobile terminal
CN106598410A (en) * 2016-12-07 2017-04-26 掌阅科技股份有限公司 Display method, device and terminal equipment of electronic book
CN109168074A (en) * 2018-10-25 2019-01-08 苏宁智能终端有限公司 A kind of video broadcasting method and device
CN109727301A (en) * 2018-12-29 2019-05-07 北京字节跳动网络技术有限公司 Generate method, apparatus, electronic equipment and the storage medium of dynamic wallpaper
CN110069182A (en) * 2019-04-28 2019-07-30 努比亚技术有限公司 Wallpaper control method, mobile terminal and computer readable storage medium
CN110209460A (en) * 2019-06-10 2019-09-06 Oppo广东移动通信有限公司 A kind of implementation method of dynamic wallpaper, device, storage medium and terminal

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060206803A1 (en) * 2005-03-14 2006-09-14 Smith Jeffrey C Interactive desktop wallpaper system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011111926A2 (en) * 2010-03-12 2011-09-15 블루가 (주) Apparatus and method for implementing web-based user interface on mobile terminal
CN106598410A (en) * 2016-12-07 2017-04-26 掌阅科技股份有限公司 Display method, device and terminal equipment of electronic book
CN109168074A (en) * 2018-10-25 2019-01-08 苏宁智能终端有限公司 A kind of video broadcasting method and device
CN109727301A (en) * 2018-12-29 2019-05-07 北京字节跳动网络技术有限公司 Generate method, apparatus, electronic equipment and the storage medium of dynamic wallpaper
CN110069182A (en) * 2019-04-28 2019-07-30 努比亚技术有限公司 Wallpaper control method, mobile terminal and computer readable storage medium
CN110209460A (en) * 2019-06-10 2019-09-06 Oppo广东移动通信有限公司 A kind of implementation method of dynamic wallpaper, device, storage medium and terminal

Also Published As

Publication number Publication date
CN111209065A (en) 2020-05-29

Similar Documents

Publication Publication Date Title
CN111240777B (en) Dynamic wallpaper generation method and device, storage medium and electronic equipment
CN111240774B (en) Dynamic wallpaper generation method and device, storage medium and electronic equipment
CN108319489B (en) Application page starting method and device, storage medium and electronic equipment
CN111209065B (en) Dynamic wallpaper setting method and device, storage medium and electronic equipment
CN109857506B (en) Method and device for realizing guide information, electronic equipment and storage medium
CN112035768A (en) Page rendering method and device for fast application, storage medium and electronic equipment
AU2013213683B2 (en) A method and system of application development for multiple device client platforms
CN110471701B (en) Image rendering method and device, storage medium and electronic equipment
CN113613064B (en) Video processing method, device, storage medium and terminal
CN112217671B (en) Method and equipment for performing interface display on front-end micro-service based on split deployment
CN111240776B (en) Dynamic wallpaper setting method and device, storage medium and electronic equipment
CN113313804A (en) Image rendering method and device, electronic equipment and storage medium
CN114205447B (en) Shortcut setting method and device of electronic equipment, storage medium and electronic equipment
CN113220366A (en) Sub-application starting method and device, terminal and server
CN108156534B (en) Method and device for generating demonstration application and computer readable storage medium
CN115589432A (en) Message push management method, device, medium and equipment
CN113467663B (en) Interface configuration method, device, computer equipment and medium
CN106383705B (en) Method and device for setting mouse display state in application thin client
CN114417201A (en) Message processing method and device, computer equipment and storage medium
KR100603580B1 (en) Method for realizing user interface of mobile terminal
CN111124386B (en) Animation event processing method, device, equipment and storage medium based on Unity
CN111399955B (en) Mobile terminal and interface display method of application program thereof
CN112929717B (en) Focus management method and display device
CN114327709A (en) Control page generation method and device, intelligent device and storage medium
CN114092590A (en) Electronic device and evaluation method and medium for image rendering performance of electronic device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant