CN111240776B - 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
CN111240776B
CN111240776B CN201911421562.2A CN201911421562A CN111240776B CN 111240776 B CN111240776 B CN 111240776B CN 201911421562 A CN201911421562 A CN 201911421562A CN 111240776 B CN111240776 B CN 111240776B
Authority
CN
China
Prior art keywords
dynamic
resource
wallpaper
file
dynamic wallpaper
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
CN201911421562.2A
Other languages
Chinese (zh)
Other versions
CN111240776A (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 CN201911421562.2A priority Critical patent/CN111240776B/en
Publication of CN111240776A publication Critical patent/CN111240776A/en
Application granted granted Critical
Publication of CN111240776B publication Critical patent/CN111240776B/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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

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; creating a first resource instance according to the configuration file and the dynamic resource data; and according to the first resource instance, the animation script file and the wallpaper service, drawing of dynamic wallpaper is realized, so that the dynamic wallpaper setting of the cross-process is realized in response to the dynamic wallpaper setting instruction.

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;
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, the animation script file and the wallpaper service, so as to respond to the dynamic wallpaper setting instruction.
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 file 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 resource analysis unit is used for creating a first resource instance according to the configuration file and the dynamic resource data;
and the wallpaper drawing unit is used for drawing dynamic wallpaper according to the first resource instance, the animation script file and the wallpaper service, so as to respond to the dynamic wallpaper setting instruction.
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 a dynamic wallpaper setting instruction sent by a target process is received, resource identification information corresponding to the dynamic wallpaper setting instruction is acquired, a dynamic resource file is acquired based on the resource identification information, the dynamic resource file is analyzed to obtain dynamic resource data, a configuration file and an animation script file, then a first resource instance is created according to the dynamic resource data of the configuration file, drawing of the dynamic wallpaper is realized according to the first resource instance, the animation script file and a wallpaper service, in order to respond to the dynamic wallpaper setting instruction, 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 acquire the dynamic resource file through the acquired resource identification and analyze the dynamic resource file to obtain a first resource instance for realizing dynamic wallpaper drawing, and the wallpaper service is used for drawing the dynamic wallpaper based on the first resource instance, so that cross-process dynamic wallpaper setting 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 conventional dynamic wallpaper setting schemes, each dynamic wallpaper requires a WallpaperService to be registered in the desktop wallpaper application 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 packaged with dynamic resource data, configuration file and animation script file, wherein the dynamic resource data contains various resource data for realizing dynamic wallpaper display, and the dynamic resource data can be pictures (such as Gif pictures), videos, frame sequences and the like. The dynamic wallpaper engine controls the dynamic presentation of the resource data to realize dynamic wallpaper. For example, control the playing of video, or control the playing of Gif pictures. A frame sequence is understood as a group of images, and different images can be displayed on different pages, or switching of different images can be controlled on the same page to realize dynamic effects.
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, a script analysis 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 script analysis module 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 and acquiring a configuration file from 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 creating a first resource instance according to the configuration file and the dynamic resource data.
In a script parsing module in the dynamic wallpaper engine, corresponding parsing sub-modules, such as XML, json and the like, are set for script files in different formats. The resource analysis module is provided with corresponding rendering sub-modules for different types of dynamic resource data, such as a video analysis module, an image analysis module or other modules. In some embodiments, creating a first resource instance from the configuration file and the dynamic resource data includes: determining a rendering type according to the configuration file, and starting a rendering sub-module corresponding to the rendering type; and processing the dynamic resource data based on the rendering sub-module to generate a first resource instance. The resource analysis module determines a corresponding rendering module from a plurality of preset rendering modules according to the rendering type determined in 102, and creates a first resource instance based on the rendering module and the dynamic resource data.
104. And drawing dynamic wallpaper according to the first resource instance, the animation script file 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. In some embodiments, the drawing of dynamic wallpaper according to the first resource instance, the animation script file, and the wallpaper service includes: judging whether the currently used wallpaper is dynamic wallpaper or not; if not, the first resource instance is realized through the wallpaper service and the animation script file so as to draw dynamic wallpaper; if yes, determining a current second resource instance, replacing the second resource instance with the first resource instance, and drawing dynamic wallpaper based on the animation script file. In this embodiment, if the current system wallpaper is dynamic wallpaper, the system method is not required to be called to implement the first resource instance in the background based on the WallpaperService implementation class built in the dynamic wallpaper engine, but the current resource instance in the dynamic wallpaper engine can be directly switched to the first resource instance. And after the current resource instance in the dynamic wallpaper engine is switched to the first resource instance, the current system wallpaper can be switched to the dynamic wallpaper to be set, and after the wallpaper is switched, the first resource instance can be assisted by the animation script file to respond to the action of the actual execution of different interface switching operations, so that the dynamic display effect of the dynamic wallpaper is realized.
Otherwise, if the current system wallpaper is not the dynamic wallpaper, the dynamic wallpaper engine is used as a system level process, a system method is called to realize a first resource instance in the background based on the WallpaperService implementation class built in the dynamic wallpaper engine so as to set the dynamic wallpaper as the system wallpaper, and after the wallpaper is switched, the animation script file can be used for assisting the first resource instance to respond to the actually executed actions of different interface switching operations so as to realize the dynamic display effect of the dynamic wallpaper.
Or, in some other embodiments, whether the current system wallpaper is dynamic wallpaper or not, the system method may be invoked to implement the first resource instance in the background based on the WallpaperService implementation class built in the dynamic wallpaper engine.
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 present 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, then a first resource instance is created according to the configuration file dynamic resource data, and drawing of dynamic wallpaper is implemented according to the first resource instance, the animation script file and a wallpaper service, so as to respond to the dynamic wallpaper setting instruction.
In some embodiments, parsing the dynamic resource file to obtain dynamic resource data, configuration files, and animation script files includes: decompressing the dynamic resource file to obtain decompressed data, and obtaining 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 this embodiment, after the dynamic wallpaper engine obtains the URI, the received URI is read to obtain 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.
In some embodiments, after the acquiring the 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 method further includes: adding the dynamic resource data, the configuration file and the animation script file to a preset cache area; acquiring a target dynamic wallpaper identifier according to the configuration file, and judging whether a preset path stores a folder matched with the target dynamic wallpaper identifier; if not, creating a target folder in the preset path based on the target dynamic wallpaper identifier, writing the dynamic resource data, the configuration file and the animation script file into the target folder from the cache area, and executing to create a first resource instance according to the configuration file and the dynamic resource data.
In this embodiment, after the dynamic resource data, the configuration file and the animation script file are acquired, the dynamic resource data, the configuration file and the animation script file are cached in a preset cache area, and the configuration file acquires the target dynamic wallpaper identifier, for example, the ID of the dynamic wallpaper, whether a folder named as the ID is stored in a preset path is judged according to the ID, if the folder named as the ID is not stored in the preset path, the folder is created by taking the ID of the dynamic wallpaper in the current configuration file as the name, and the dynamic resource data, the configuration file and the animation script file cached in the preset cache area are written in the folder. And then performs 103 to 105 based on the data in the folder.
The preset path is a path for storing dynamic resource data, configuration files and animation script files, and the files corresponding to each set dynamic wallpaper can be stored in the preset path. And, a folder is set for each dynamic wallpaper, and the folder is named by the ID or name of the dynamic wallpaper.
In some embodiments, after determining whether the preset path stores a folder matching the target dynamic wallpaper identifier, the method further includes: if yes, acquiring a history configuration file from the folder, and judging whether the version of the history configuration file is the same as that of the configuration file; if yes, the preset cache area is emptied, and a first resource instance is created according to the configuration file and the dynamic resource data.
If the preset path has a folder named as the ID, the electronic equipment is judged to have set the dynamic wallpaper, and the file in the cache is not required to be written into the preset path, so that the configuration file, the dynamic wallpaper data and the like can be directly obtained from the preset path, and the dynamic wallpaper is drawn. And simultaneously, the data in the preset cache area is emptied.
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 invention. The method comprises the following steps:
201. when a dynamic wallpaper setting instruction sent by a target process is received, judging whether the target process is positioned in a process white list.
In this embodiment, a process white list is set in the electronic device in advance, where a process in the process white list is a process that allows system wallpaper to be set as dynamic wallpaper across processes, and the process in the process white list may be added by a user as needed. 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. After receiving the dynamic wallpaper setting instruction, the dynamic wallpaper engine judges whether the target process is located in a process white list.
202. And when the target process is positioned in the process white list, acquiring the resource identification information corresponding to the dynamic wallpaper setting instruction.
And if the target process is not positioned in the process white list, not responding to the dynamic wallpaper setting instruction. Otherwise, if the target process is located in the process white list, the resource identification information corresponding to the dynamic wallpaper setting instruction is obtained.
203. Decompressing the dynamic resource file to obtain decompressed data, and obtaining a configuration file from the decompressed data.
204. The configuration file is parsed to determine script file formats and rendering types.
205. 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 script file 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.
206. And starting a rendering sub-module corresponding to the rendering type, and processing the dynamic resource data based on the rendering sub-module to generate a first resource instance.
Referring to fig. 3, a corresponding rendering sub-module, such as a video parsing module, an image parsing module, etc., is provided in the resource parsing module of the dynamic wallpaper engine for different types of dynamic resource data. After the rendering type is determined, determining a rendering sub-module corresponding to the rendering type from a plurality of rendering sub-modules, and starting the rendering sub-module to process the dynamic resource data to generate a first resource instance.
207. And drawing dynamic wallpaper according to the first resource instance, the animation script file and the wallpaper service, so as to respond to the dynamic wallpaper setting instruction.
The animation script file may be in XML (Extensible Markup Language ) format, json (JavaScript Object Notation, json object profile) format, or the like. Referring to fig. 3, in the script parsing module in the dynamic wallpaper engine, corresponding parsing sub-modules, such as XML, json, etc., are set for script files in different formats. 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.
The dynamic wallpaper engine is used for drawing the dynamic wallpaper based on the wallpaper service, the first resource instance and the analysis instance. If the dynamic wallpaper engine is the first dynamic wallpaper (i.e. the current system wallpaper is not the dynamic wallpaper), the dynamic wallpaper engine is used as a system level process, a system method is called in the background based on the Wallpaper service implementation class built in the dynamic wallpaper engine, a first resource instance is realized to set the dynamic wallpaper as the system wallpaper, and after the wallpaper is switched, the action of the first resource instance in response to the actual execution of different interface switching operations can be assisted by analyzing the instance, so that the dynamic display effect of the dynamic wallpaper is realized. If the dynamic wallpaper engine is not the first dynamic wallpaper (the current system wallpaper is the dynamic wallpaper), the current resource instance in the dynamic wallpaper engine is directly switched to the first resource instance. And after the current resource instance in the dynamic wallpaper engine is switched to the first resource instance, the current system wallpaper can be switched to the dynamic wallpaper to be set, and after the wallpaper is switched, the first resource instance can be assisted by analyzing the instance to respond to the action of the actual execution of different interface switching operations, so that the dynamic display effect of the dynamic wallpaper is realized.
As can be seen from the above, in the method for setting dynamic wallpaper according to the embodiment of the present application, when the dynamic wallpaper needs to be set by an external process, the resource identification information may be transmitted to the dynamic wallpaper setting process based on the dynamic wallpaper setting instruction, the dynamic wallpaper setting process may obtain the dynamic resource file through the obtained resource identification and perform parsing processing, so as to obtain a first resource instance for implementing dynamic wallpaper drawing, and the wallpaper service performs dynamic wallpaper drawing based on the first resource instance, thereby implementing cross-process dynamic wallpaper setting.
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 file acquisition unit 302, a resource analysis unit 303, and a wallpaper drawing 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 file 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 resource parsing unit 303, configured to create a first resource instance according to the configuration file and the dynamic resource data;
and the wallpaper drawing unit 304 is configured to implement drawing of dynamic wallpaper according to the first resource instance, the animation script file and the wallpaper service, so as to respond to the dynamic wallpaper setting instruction.
In some embodiments, the file acquisition unit 302 is further configured to: decompressing the dynamic resource file to obtain decompressed data, and obtaining 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, the resource parsing unit 303 is further configured to: determining a rendering type according to the configuration file, and starting a rendering sub-module corresponding to the rendering type; and processing the dynamic resource data based on the rendering sub-module to generate a first resource instance.
In some embodiments, wallpaper drawing unit 304 is further to: judging whether the currently used wallpaper is dynamic wallpaper or not; if not, the first resource instance is realized through the wallpaper service and the animation script file so as to draw dynamic wallpaper; if yes, determining a current second resource instance, replacing the second resource instance with the first resource instance, and drawing dynamic wallpaper based on the animation script file.
In some embodiments, the file acquisition unit 302 is further configured to: adding the dynamic resource data, the configuration file and the animation script file to a preset cache area;
acquiring a target dynamic wallpaper identifier according to the configuration file, and judging whether a preset path stores a folder matched with the target dynamic wallpaper identifier;
if not, creating a target folder in the preset path based on the target dynamic wallpaper identification, and writing the dynamic resource data, the configuration file and the animation script file into the target folder from the cache area.
In some embodiments, the file acquisition unit 302 is further configured to: if yes, acquiring a history configuration file from the folder, and judging whether the version of the history configuration file is the same as that of the configuration file; if yes, the preset cache area is emptied, and a first resource instance is created according to the configuration file and the dynamic resource data.
In some embodiments, the information acquisition unit 301 is further configured to: when a dynamic wallpaper setting instruction sent by a target process is received, judging whether the target process is positioned in a process white list; and when the target process is positioned in the process white list, executing and acquiring the resource identification information corresponding to the dynamic wallpaper setting instruction.
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 above, the dynamic wallpaper setting device 300 according to the embodiment of the application includes: 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 file 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 resource parsing unit 303, configured to create a first resource instance according to the configuration file and the dynamic resource data; and the wallpaper drawing unit 304 is configured to implement drawing of dynamic wallpaper according to the first resource instance, the animation script file and the wallpaper service, so as to respond to the dynamic wallpaper setting instruction. 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 acquire a dynamic resource file through the acquired resource identification and analyze the dynamic resource file to acquire a first resource instance for realizing dynamic wallpaper drawing, and the wallpaper service performs dynamic wallpaper drawing based on the first resource instance, so that cross-process dynamic wallpaper setting 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;
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, the animation script file and the wallpaper service, so as to respond to the dynamic wallpaper setting instruction.
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;
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, the animation script file and the wallpaper service, so as to respond to the dynamic wallpaper setting instruction.
In some embodiments, in 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 obtaining 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 creating the first resource instance from the configuration file and the dynamic resource data, the processor 401 performs:
determining a rendering type according to the configuration file, and starting a rendering sub-module corresponding to the rendering type;
and processing the dynamic resource data based on the rendering sub-module to generate a first resource instance.
In some embodiments, when the drawing of the dynamic wallpaper is implemented according to the first resource instance, the animation script file and the wallpaper service, the processor 401 performs:
judging whether the currently used wallpaper is dynamic wallpaper or not;
if not, the first resource instance is realized through the wallpaper service and the animation script file so as to draw dynamic wallpaper;
if yes, determining a current second resource instance, replacing the second resource instance with the first resource instance, and drawing dynamic wallpaper based on the animation script file.
In some embodiments, after acquiring a dynamic resource file based on the resource identification information, parsing the dynamic resource file to acquire dynamic resource data, a configuration file, and an animation script file, the processor 401 performs:
adding the dynamic resource data, the configuration file and the animation script file to a preset cache area;
acquiring a target dynamic wallpaper identifier according to the configuration file, and judging whether a preset path stores a folder matched with the target dynamic wallpaper identifier;
if not, creating a target folder in the preset path based on the target dynamic wallpaper identifier, writing the dynamic resource data, the configuration file and the animation script file into the target folder from the cache area, and executing to create a first resource instance according to the configuration file and the dynamic resource data.
In some embodiments, after determining whether the preset path stores a folder matching the target dynamic wallpaper identifier, the processor 401 performs:
if yes, acquiring a history configuration file from the folder, and judging whether the version of the history configuration file is the same as that of the configuration file;
If yes, the preset cache area is emptied, and a first resource instance is created according to the configuration file and the dynamic resource data.
In some embodiments, before acquiring the resource identification information corresponding to the dynamic wallpaper setting instruction, the processor 401 executes:
when a dynamic wallpaper setting instruction sent by a target process is received, judging whether the target process is positioned in a process white list;
and when the target process is positioned in the process white list, executing and acquiring the resource identification information corresponding to the dynamic wallpaper setting instruction.
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, then creates a first resource instance according to the configuration file dynamic resource data, and according to the first resource instance, the animation script file and a wallpaper service, realizes drawing of dynamic wallpaper, in response to the dynamic wallpaper setting instruction, in this way, when the dynamic wallpaper needs to be set by an external process, the dynamic wallpaper setting process can transmit resource identification information to the dynamic wallpaper setting process based on the dynamic wallpaper setting instruction, and can obtain the dynamic resource file through the obtained resource identification and analyze the dynamic wallpaper setting process to obtain a first resource instance for realizing drawing of dynamic wallpaper, and the wallpaper service performs drawing of dynamic wallpaper based on the first resource instance, thereby realizing cross-process dynamic wallpaper setting.
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 (9)

1. A method for setting dynamic wallpaper, applied to a dynamic wallpaper engine, the method comprising:
when a dynamic wallpaper setting instruction sent by an external process is received, acquiring resource identification information carried by the dynamic wallpaper setting instruction, wherein the external process and the dynamic wallpaper engine belong to different processes;
acquiring a dynamic resource file based on the resource identification information, analyzing the dynamic resource file to acquire dynamic resource data, a configuration file and an animation script file, wherein the configuration file is used for describing attribute information of dynamic wallpaper, and the animation script file is used for configuring animations displayed by the dynamic wallpaper at different occasions;
Creating a first resource instance according to the configuration file and the dynamic resource data;
judging whether the currently used wallpaper is dynamic wallpaper or not;
if not, the first resource instance is realized through the wallpaper service and the animation script file, and the dynamic wallpaper is drawn so as to respond to the dynamic wallpaper setting instruction;
if yes, determining a current second resource instance, replacing the second resource instance with the first resource instance, and drawing dynamic wallpaper based on the animation script file to respond to the dynamic wallpaper setting instruction.
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 obtaining 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 dynamic wallpaper setting method as claimed in claim 1, wherein said creating a first resource instance from said configuration file and said dynamic resource data comprises:
determining a rendering type according to the configuration file, and starting a rendering sub-module corresponding to the rendering type;
and processing the dynamic resource data based on the rendering sub-module to generate a first resource instance.
4. The method for setting dynamic wallpaper according to claim 1, wherein after obtaining a dynamic resource file based on the resource identification information and parsing the dynamic resource file to obtain dynamic resource data, a configuration file and an animation script file, further comprising:
adding the dynamic resource data, the configuration file and the animation script file to a preset cache area;
acquiring a target dynamic wallpaper identifier according to the configuration file, and judging whether a preset path stores a folder matched with the target dynamic wallpaper identifier;
if not, creating a target folder in the preset path based on the target dynamic wallpaper identifier, writing the dynamic resource data, the configuration file and the animation script file into the target folder from the cache area, and executing to create a first resource instance according to the configuration file and the dynamic resource data.
5. The method for setting dynamic wallpaper according to claim 4, wherein after determining whether a preset path stores a folder matching the target dynamic wallpaper identification, further comprising:
if yes, acquiring a history configuration file from the folder, and judging whether the version of the history configuration file is the same as that of the configuration file;
if yes, the preset cache area is emptied, and a first resource instance is created according to the configuration file and the dynamic resource data.
6. The method for setting dynamic wallpaper according to any of claims 1 to 5, further comprising, prior to said obtaining the resource identification information carried by the dynamic wallpaper setting instruction:
when a dynamic wallpaper setting instruction sent by an external process is received, judging whether the external process is positioned in a process white list or not;
and when the external process is positioned in the process white list, executing and acquiring the resource identification information carried by the dynamic wallpaper setting instruction.
7. A dynamic wallpaper setting device, characterized by being applied to a dynamic wallpaper engine, the device comprising:
the information acquisition unit is used for acquiring resource identification information carried by a dynamic wallpaper setting instruction when the dynamic wallpaper setting instruction sent by an external process is received, wherein the external process and the dynamic wallpaper engine belong to different processes;
The file acquisition unit is used for acquiring a dynamic resource file based on the resource identification information, analyzing the dynamic resource file to acquire dynamic resource data, a configuration file and an animation script file, wherein the configuration file is used for describing attribute information of the dynamic wallpaper, and the animation script file is used for configuring animations displayed by the dynamic wallpaper at different occasions;
the resource analysis unit is used for creating a first resource instance according to the configuration file and the dynamic resource data;
and the wallpaper drawing unit is used for judging whether the currently used wallpaper is dynamic wallpaper, if not, implementing the first resource instance through a wallpaper service and the animation script file, drawing the dynamic wallpaper, responding to the dynamic wallpaper setting instruction, if so, determining a current second resource instance, replacing the second resource instance with the first resource instance, and drawing the dynamic wallpaper based on the animation script file, so as to respond to the dynamic wallpaper setting instruction.
8. 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 6.
9. 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-6 by invoking the computer program.
CN201911421562.2A 2019-12-31 2019-12-31 Dynamic wallpaper setting method and device, storage medium and electronic equipment Active CN111240776B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911421562.2A CN111240776B (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
CN201911421562.2A CN111240776B (en) 2019-12-31 2019-12-31 Dynamic wallpaper setting method and device, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN111240776A CN111240776A (en) 2020-06-05
CN111240776B true CN111240776B (en) 2023-11-10

Family

ID=70872087

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911421562.2A Active CN111240776B (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) CN111240776B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116743908B (en) * 2022-09-13 2024-03-26 荣耀终端有限公司 Wallpaper display method and related device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8549273B1 (en) * 2009-03-24 2013-10-01 Cms Products, Inc. Method and apparatus to present a unique background image on a personal computer display when the computer system is booted from an external drive
CN106598410A (en) * 2016-12-07 2017-04-26 掌阅科技股份有限公司 Display method, device and terminal equipment of electronic book
CN108848271A (en) * 2018-07-27 2018-11-20 深圳众思科技有限公司 Method and mobile terminal based on real-time weather situation control wallpaper weather masking-out
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 (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7032011B2 (en) * 2000-03-29 2006-04-18 Symantec Corporation Server based extraction, transfer, storage and processing of remote settings, files and data
US6795089B2 (en) * 2000-12-20 2004-09-21 Microsoft Corporation Dynamic, live surface and model elements for visualization and modeling

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8549273B1 (en) * 2009-03-24 2013-10-01 Cms Products, Inc. Method and apparatus to present a unique background image on a personal computer display when the computer system is booted from an external drive
CN106598410A (en) * 2016-12-07 2017-04-26 掌阅科技股份有限公司 Display method, device and terminal equipment of electronic book
CN108848271A (en) * 2018-07-27 2018-11-20 深圳众思科技有限公司 Method and mobile terminal based on real-time weather situation control wallpaper weather masking-out
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
CN111240776A (en) 2020-06-05

Similar Documents

Publication Publication Date Title
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
CN111240777B (en) Dynamic wallpaper generation method and device, storage medium and electronic equipment
US11706331B2 (en) Information processing method and apparatus, storage medium, and electronic device
CN108363528B (en) Application page starting method and device, storage medium and electronic equipment
CN110874217B (en) Interface display method and device for quick application and storage medium
CN111240774B (en) Dynamic wallpaper generation method and device, storage medium and electronic equipment
CN109857506B (en) Method and device for realizing guide information, electronic equipment and storage medium
CN111596998A (en) Page processing method of ink screen and terminal
CN110471701B (en) Image rendering method and device, storage medium and electronic equipment
EP4177782A1 (en) Font adjustment method and apparatus, storage medium, and electronic device
CN112035768A (en) Page rendering method and device for fast application, storage medium and electronic equipment
CN112882709A (en) Rendering method, device and equipment based on container engine system and storage medium
CN113313804A (en) Image rendering method and device, electronic equipment and storage medium
CN111240776B (en) Dynamic wallpaper setting method and device, storage medium and electronic equipment
CN113176954B (en) Application calling method and device, storage medium and electronic equipment
CN114327087A (en) Input event processing method and device, electronic equipment and storage medium
CN107402756B (en) Method, device and terminal for drawing page
CN113220366A (en) Sub-application starting method and device, terminal and server
CN116467221B (en) Pile inserting method and system based on interpreter and related electronic equipment
CN110069186B (en) Method and equipment for displaying operation interface of application
CN115309470B (en) Method, device, equipment and storage medium for loading widget
CN114077368B (en) Vehicle-mounted applet running method and device, computer equipment and storage medium
EP4195095A1 (en) Method for translating interface of application, and related device
CN109948095B (en) Method, device, terminal and storage medium for displaying webpage content

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