CN116627566A - Theme application method, theme application device, electronic equipment and readable storage medium - Google Patents

Theme application method, theme application device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN116627566A
CN116627566A CN202310593092.8A CN202310593092A CN116627566A CN 116627566 A CN116627566 A CN 116627566A CN 202310593092 A CN202310593092 A CN 202310593092A CN 116627566 A CN116627566 A CN 116627566A
Authority
CN
China
Prior art keywords
resource
theme
application
mapping table
updated
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.)
Pending
Application number
CN202310593092.8A
Other languages
Chinese (zh)
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.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication Co 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 Vivo Mobile Communication Co Ltd filed Critical Vivo Mobile Communication Co Ltd
Priority to CN202310593092.8A priority Critical patent/CN116627566A/en
Publication of CN116627566A publication Critical patent/CN116627566A/en
Pending legal-status Critical Current

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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/14Details of searching files based on file metadata
    • G06F16/148File search processing

Abstract

The application discloses a theme application method, a theme application device, electronic equipment and a readable storage medium, and belongs to the technical field of electronics. The specific scheme comprises the following steps: acquiring a first mapping table corresponding to a target theme, wherein the first mapping table comprises a mapping relation between updated resources in the target theme and resources to be updated of an application; updating a theme resource mapping table based on the first mapping table; searching updated resources according to the theme resource mapping table, and replacing the resources to be updated with updated resources.

Description

Theme application method, theme application device, electronic equipment and readable storage medium
Technical Field
The application belongs to the technical field of electronics, and particularly relates to a theme application method, a theme application device, electronic equipment and a readable storage medium.
Background
In general, a user may download a theme resource package from a network, and update the display effect of the application interface by applying the theme resource package.
In the related art, when a user triggers an electronic device to apply a new interface theme, a resource needs to be created first, and when the resource is created, the resource of the theme resource package needs to be loaded and cached, and a file handle of the theme resource package needs to be opened.
However, since the resources of the theme resource package need to be loaded and cached, and the file handle of the theme resource package is always opened, the operation efficiency of the electronic device is greatly reduced.
Disclosure of Invention
The embodiment of the application aims to provide a theme application method, a theme application device, electronic equipment and a readable storage medium, which can solve the problem that the operation efficiency of the electronic equipment is low after a user triggers the electronic equipment to apply a new interface theme.
In a first aspect, an embodiment of the present application provides a theme application method, including: acquiring a first mapping table corresponding to a target theme, wherein the first mapping table comprises a mapping relation between updated resources in the target theme and resources to be updated of an application; updating a theme resource mapping table based on the first mapping table; searching updated resources according to the theme resource mapping table, and replacing the resources to be updated with updated resources.
In a second aspect, an embodiment of the present application provides a theme application apparatus, including: the device comprises an acquisition module and a processing module; the acquisition module is used for acquiring a first mapping table corresponding to the target theme, wherein the first mapping table comprises the mapping relation between the updated resources in the target theme and the resources to be updated of the application; the processing module is used for updating the theme resource mapping table based on the first mapping table; searching updated resources according to the theme resource mapping table, and replacing the resources to be updated with updated resources.
In a third aspect, an embodiment of the present application provides an electronic device comprising a processor and a memory storing a program or instructions executable on the processor, which when executed by the processor, implement the steps of the method as described in the first aspect.
In a fourth aspect, embodiments of the present application provide a readable storage medium having stored thereon a program or instructions which when executed by a processor perform the steps of the method according to the first aspect.
In a fifth aspect, an embodiment of the present application provides a chip, where the chip includes a processor and a communication interface, where the communication interface is coupled to the processor, and where the processor is configured to execute a program or instructions to implement a method according to the first aspect.
In a sixth aspect, embodiments of the present application provide a computer program product stored in a storage medium, the program product being executable by at least one processor to implement the method according to the first aspect.
In the embodiment of the application, a first mapping table corresponding to a target theme is acquired, wherein the first mapping table comprises the mapping relation between updated resources in the target theme and resources to be updated of an application; updating a theme resource mapping table based on the first mapping table; searching updated resources according to the theme resource mapping table, and replacing the resources to be updated with updated resources. According to the scheme, the theme resource mapping table can be updated based on the first mapping table, and the first mapping table comprises the mapping relation between the updated resources in the target theme and the resources to be updated of the application, so that the updated resources can be searched according to the theme resource mapping table, and the resources to be updated can be replaced by the updated resources. Because the updated resources can be directly searched according to the theme resource mapping table without loading and buffering the resources of the theme resource package and opening the file handle of the theme resource package, the occupation of the process memory can be reduced, the influence on the resource creation efficiency is avoided, the running efficiency and the resource searching efficiency of the electronic equipment can be improved, and the running smoothness of the electronic equipment is improved.
Drawings
FIG. 1 is a schematic flow chart of a theme application method according to an embodiment of the present application;
FIG. 2 is a schematic diagram of an interface of a theme application method according to an embodiment of the present application;
FIG. 3 is a second schematic diagram of an interface of the theme application method according to the embodiment of the present application;
FIG. 4 is a second flowchart of a theme application method according to the embodiment of the present application;
FIG. 5 is a schematic structural diagram of a theme application apparatus according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
fig. 7 is a schematic hardware diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions of the embodiments of the present application will be clearly described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which are obtained by a person skilled in the art based on the embodiments of the present application, fall within the scope of protection of the present application.
The terms first, second and the like in the description and in the claims, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the terms so used are interchangeable under appropriate circumstances such that the embodiments of the application are capable of operation in sequences other than those illustrated or otherwise described herein, and that the objects identified by "first," "second," etc. are generally of a type not limited to the number of objects, for example, the first object may be one or more. Furthermore, in the description and claims, "and/or" means at least one of the connected objects, and the character "/", generally means that the associated object is an "or" relationship.
In order to meet the personalized display requirement of users on interface elements in the display interface of the electronic equipment, a plurality of global interface topics are developed in the market, users can download topic resource packages from a network, and the display effect of the application interface is updated in a mode of applying the topic resource packages.
In the related art, after a user triggers an electronic device to apply a new interface theme, the electronic device may intercept when a Java layer of the android system is used for obtaining resources. The electronic equipment can download a theme resource package, wherein the theme resource package comprises a pre-configured corresponding relation between a resource name and a resource value, then the electronic equipment can firstly determine the corresponding relation between the resource name and a resource number of the interface theme, buffer the corresponding relation between the resource name and the resource number, and finally, when acquiring the resource, the electronic equipment can determine the resource value corresponding to the resource name through the resource number, thereby solving the problem of resource searching in the theme application process.
However, the scheme in the related art has the following drawbacks:
firstly, the operation of determining the corresponding relation between the resource name and the resource number consumes longer time, which greatly reduces the resource searching efficiency;
Secondly, for the resources of the picture types, the memory occupation is large, so that the pre-caching cannot be performed, and the electronic equipment can ensure the acquisition efficiency when acquiring the resources of the picture types only by opening the compressed files in the theme resource package as file handles all the time. Because the file handle held by the process needs to occupy the running memory of the electronic equipment, the running efficiency of the electronic equipment is also affected;
thirdly, for non-picture type resources, memory reading is required frequently when the resources are acquired, so that cumulative influence is generated;
fourth, in other processes that need to acquire the theme resources, for example, in the scenario that the application icons, the labels, and the like are acquired in batches through the system interface, the process memory is increased and the system process is dragged due to the need of buffering the theme resources in advance.
Aiming at the defects, the embodiment of the application provides a theme application method, which can acquire a first mapping table corresponding to a target theme, wherein the first mapping table comprises the mapping relation between updated resources in the target theme and resources to be updated of the application; updating a theme resource mapping table based on the first mapping table; searching updated resources according to the theme resource mapping table, and replacing the resources to be updated with updated resources. According to the scheme, the theme resource mapping table can be updated based on the first mapping table, and the first mapping table comprises the mapping relation between the updated resources in the target theme and the resources to be updated of the application, so that the updated resources can be searched according to the theme resource mapping table, and the resources to be updated can be replaced by the updated resources. Because the updated resources can be directly searched according to the theme resource mapping table without loading and buffering the resources of the theme resource package and opening the file handle of the theme resource package, the occupation of the process memory can be reduced, the influence on the resource creation efficiency is avoided, the running efficiency and the resource searching efficiency of the electronic equipment can be improved, and the running smoothness of the electronic equipment is improved.
The following describes proper nouns related to the embodiments of the present application.
Runtime Overlay resource (Runtime Resource Overlay, dynamic Overlay mechanism): the resource file may be compiled into an independent apk file, and placed in advance under a fixed path (e.g., product/overlay path) of the device, and then the resource file of the original apk may be replaced at runtime. And the android resource can be dynamically covered when the android system runs, so that the obtained android resource value can be dynamically changed.
A runtime make and overlay resource mechanism (fabricated overlay mechanism): for an enhanced version of the dynamic overlay mechanism, the frro file may be dynamically generated directly as a runtime replacement resource.
frro document: in order to cover temporary files manufactured by the resource during running, the resource name and the resource value of the resource to be replaced can be persisted, and the resource coverage failure after restarting the equipment is prevented.
The following describes in detail the subject application method provided by the embodiment of the present application through specific embodiments and application scenarios thereof with reference to the accompanying drawings.
The execution subject of the theme application method provided by the embodiment of the application may be an electronic device or a functional module or a functional entity in the electronic device capable of implementing the theme application method, and the electronic device in the embodiment of the application includes, but is not limited to, a mobile phone, a tablet computer, a camera, a wearable device, etc., and the theme application method provided by the embodiment of the application is described below by taking the electronic device as an execution subject.
As shown in fig. 1, an embodiment of the present application provides a theme application method, which may include steps 101 to 103:
step 101, a first mapping table corresponding to a target theme is obtained.
The first mapping table comprises a mapping relation between the updated resource and the resource to be updated of the application in the target theme.
When the user wants to change the interface theme of the electronic device, the user can select and download one interface theme from the network according to the display effect of the interface which the user wants to want. As shown in fig. 2, a user may determine a target theme from multiple online themes according to a display effect of each interface theme, and through performing a first trigger input on a "download" control, enable the electronic device to download a theme resource package of the target theme to the electronic device.
As shown in fig. 3, after downloading is completed, the user may find the downloaded target theme in the local theme interface of the electronic device, and perform a second trigger input on the "apply theme" control, so that the electronic device applies the target theme to the interface element of the electronic device.
Optionally, the updated resource and the resource to be updated are corresponding resources in different topics. For example, if the resource to be updated is the resource of the application icon in the original application theme, the updated resource is the resource of the application icon in the target theme; if the resource to be updated is the resource of the application home page image in the original application theme, the updated resource is the resource of the application home page image in the target theme.
Optionally, the electronic device may first obtain a theme resource of the target theme; analyzing the theme resource to generate target type data, and generating a resource file according to the target type data; and establishing a first mapping table according to the resource file.
Specifically, the electronic device may parse the downloaded theme resource to determine a resource name and a resource value, classify the theme resource according to an application type and a resource type of an application of the theme to be updated, load the parsed theme resource into the memory according to a rule, and then uniformly package the parsed resource into a frro file by using a fabricated overlay mechanism in units of an application to obtain a resource file. Finally, the electronic device may establish a first mapping table idmap from the resource file.
Optionally, the electronic device loading the parsed theme resource into the memory means: after resolving the resource names and resource values of the resources such as pictures, colors, size types and the like in the theme resources, the resources are stored in the memory of the electronic equipment in a key-value corresponding relation.
Optionally, the electronic device may obtain the file stream by parsing the picture in the theme resource, that is, the target type data corresponding to the picture is the file stream. The electronic device may obtain the int data by analyzing the color and the size in the theme resource, that is, the target type data corresponding to the color and the size is the int data.
Optionally, the resource file is a frro file named with characters containing the name of the originating application.
Optionally, the storage paths of the resource file and the first mapping table idmap are both first paths, and the first paths may be data/resource-cache.
Based on the above scheme, since the resource file can be generated according to the theme resource of the target theme, and the first mapping table can be established according to the resource file, the mapping relationship between the updated resource and the resource to be updated of the application in the target theme can be determined, thereby providing a basis for the replacement of the interface resource.
Optionally, the electronic device establishes the first mapping table according to the resource file, which may specifically include: the method comprises the steps that electronic equipment submits a file storage path of a resource file to a runtime coverage resource overlay mechanism, wherein the file storage path is a first path; based on the first path, a first mapping table is established through an overlay mechanism.
Specifically, the electronic device may submit the file storage path of the frro file to an overlay mechanism, and the overlay mechanism may first establish a first mapping table idmap between the resource in the frro file and the resource to be updated, where the first mapping table idmap may be stored in the first path, and the creation process of the first mapping table does not need to be performed again when the device is restarted each time.
Based on the scheme, the first mapping table can be established through the overlay mechanism, so that the creation efficiency of resources can be improved, the implementation of the theme application process is simpler and more convenient, the system complexity is lower, and the robustness is better.
Step 102, updating the theme resource mapping table based on the first mapping table.
Specifically, after the first mapping table is obtained, the electronic device may update the theme resource mapping table of the native layer of the android system through a local interface (Java Native Interface, JNI).
It should be noted that, the theme resource mapping table is a dynamic resource mapping table maintained in the native layer of the android system, and when the theme resource is obtained, the electronic device may search and return from the theme resource mapping table according to the information of the current device. The topic resource mapping table comprises a dynamic resource mapping table (dynamic reftable) and an information List (Config List), wherein the dynamic resource mapping table is a mapping relation after topic resource application, can search resources according to global topic conditions, and the information List is a part for searching resources according to information (such as horizontal and vertical screens, language states and the like) of current equipment.
Optionally, when an application process of an application is in a running state, the electronic device may update an acquisition path of an application theme resource of the application; the acquisition path of the application theme resource of an application can also be updated when the user triggers the application to run. Specifically, the method can be determined according to actual use requirements, and the embodiment of the application is not limited to the method.
The following describes in detail, through a specific embodiment, an acquisition path of updating application theme resources of an electronic device.
In one embodiment, the electronic device may update an acquisition path of an application theme resource of a first application to the first path, where the first application is an application in a running state.
Specifically, since the file storage path of the first mapping table is the first path, after the first mapping table is obtained, in order to enable the application in the running state to display the interface effect of the target theme, the acquisition path of the application theme resource of the application in the running state may be updated to the first path.
Optionally, the first application refers to all applications in a running state, and the first application may be one application or multiple applications.
Taking an example that the first application includes an application 1 and an application 2 as an example, where the application 1 is in a foreground running state and the application 2 is in a background running state, the electronic device may update an acquisition path of an application theme resource of the application 1 to a first path, so that the electronic device may acquire a first mapping table according to the first path, determine the application theme resource of the application 1 based on the first mapping table, and display an application interface of the application 1 according to the application theme resource. Similarly, the electronic device may update the acquisition path of the application theme resource of the application 2 to a first path, so that the electronic device may acquire the first mapping table according to the first path, determine the application theme resource of the application 2 based on the first mapping table, and display an application interface of the application 2 according to the application theme resource.
Based on the above scheme, the acquiring path of the application theme resource of the application in the running state can be updated to be the first path, and because the file storage path of the first mapping table is the first path, after updating the application theme, the electronic device can acquire the first mapping table through the first path, and determine the application theme resource based on the first mapping table, thereby enabling the mapping relation of the interface theme to take effect, and further realizing the updating of the application theme of the first application.
In another embodiment, an electronic device may receive a first input from a user; and responding to the first input, running the second application, and acquiring application theme resources of the second application according to the first path.
Optionally, the first input is an input triggering the electronic device to run the second application, and the first input may be a touch input, a voice input, or a gesture input.
Specifically, since the file storage path of the first mapping table is the first path, after the user triggers the electronic device to run the second application through the first input, in order to update the application theme of the second application, the electronic device may directly obtain the application theme resource of the second application according to the first path.
For example, taking the first application as a "setting" application as an example, after the user performs the first input on the "setting" icon, the electronic device may acquire a first mapping table according to the first path, determine an application theme resource of the "setting" application based on the first mapping table, and display an interface home page of the "setting" application according to the application theme resource.
According to the scheme, after the user triggers the second application to run, the application theme resources of the second application can be directly obtained according to the first path, and because the file storage path of the first mapping table is the first path, after the application theme is updated and the second application is triggered to start, the electronic equipment can obtain the first mapping table through the first path, and the application theme resources are determined based on the first mapping table, so that the mapping relation of the interface theme is effective, and further updating of the application theme of the second application is achieved.
And step 103, searching for updated resources according to the theme resource mapping table, and replacing the resources to be updated with updated resources.
Optionally, the electronic device may send a prompt message to the target application through the system interface, where the prompt message is used to instruct the theme resource mapping table to update; and then, the electronic equipment can search the updated resources according to the theme resource mapping table, acquire the updated resources based on the first path, and replace the resources to be updated of the application interface of the target application with the updated resources.
Specifically, the overlay mechanism may send, through the system interface, a change in information of the terminal device in a resource path change (config_asset_path) dimension, so that a foreground application and a background application in the electronic device respond to the change in the resource mapping relationship.
Optionally, the target application is an application supporting a target theme, for example, in a case where the target theme is a global theme, the target application is an application supporting a global theme.
Alternatively, the target application may include the first application and the second application.
Optionally, the electronic device may respond to the terminal device information change of the dimension of the resource path change, re-acquire the resource, and refresh the interface display of the target application, so that the electronic device displays the interface element in the interface of the target application according to the display effect of the target theme.
Based on the scheme, the updated resources can be searched based on the theme resource mapping table, so that the creation efficiency of Java layer resource objects is not affected, the problem of large memory occupation caused by holding file handles all the time in a process can be avoided, the operation fluency of the electronic equipment can be improved, and the performance consumption caused by theme functions is reduced.
In the embodiment of the application, the theme resource mapping table can be updated based on the first mapping table, and because the first mapping table comprises the mapping relation between the updated resource in the target theme and the resource to be updated of the application, the updated resource can be searched according to the theme resource mapping table, and the resource to be updated is replaced by the updated resource. Because the updated resources can be directly searched according to the theme resource mapping table without loading and buffering the resources of the theme resource package and opening the file handle of the theme resource package, the occupation of the process memory can be reduced, the influence on the resource creation efficiency is avoided, the running efficiency and the resource searching efficiency of the electronic equipment can be improved, and the running smoothness of the electronic equipment is improved.
As shown in fig. 4, a complete execution flow of a theme application method according to an embodiment of the present application includes steps 401 to 409:
step 401, the electronic device receives a first trigger input.
When the user wants to replace the interface theme of the electronic device, a target theme can be determined from a plurality of online themes according to the display effect of each interface theme on the network, and a first trigger input is carried out on the target theme.
Step 402, the electronic device downloads the theme resource of the target theme.
The electronic device may download a theme resource of the target theme in response to the first trigger input.
Step 403, the electronic device receives a second trigger input.
After the downloading is completed, the user can find the downloaded target theme in the local theme interface of the electronic equipment, and the target theme is applied to the interface element of the electronic equipment by the electronic equipment through the second trigger input.
Step 404, the electronic device parses the theme resource.
The electronic device may analyze the downloaded theme resources to determine a resource name and a resource value, classify the theme resources according to an application type and a resource type of an application of the theme to be updated, and load the analyzed theme resources into the memory according to a rule.
Step 405, the electronic device generates a resource file through a fabricated overlay mechanism.
The electronic device can uniformly package the analyzed resources into a frro file by taking the application as a unit through a fabricated overlay mechanism to obtain a resource file.
Step 406, the electronic device creates a first mapping table and updates the theme resource mapping table.
The electronic device may establish a first mapping table idmap according to the resource file, and update the subject resource mapping table based on the first mapping table.
Step 407, the electronic device determines whether the target application supports the target theme.
After updating the theme resource mapping table, the electronic device may first determine whether the target application supports the application of the target theme.
In step 408a, in the case that the target application supports the target theme, the electronic device sends a prompt message to the target application through the system interface.
The electronic device may send a hint information to the target application through the system interface, where the hint information is used to indicate that the theme resource map is updated.
Step 408b, in the case that the target application does not support the target theme, the flow ends.
And 409, the electronic equipment re-acquires the resources, refreshes the interface display of the target application, and ends the process.
After receiving the prompt message, the electronic device may search for updated resources according to the theme resource mapping table, obtain updated resources based on the first path, and replace the resources to be updated of the application interface of the target application with updated resources.
According to the theme application method provided by the embodiment of the application, the execution subject can be the theme application device. In the embodiment of the application, a theme application device executes a theme application method as an example, and the theme application device provided by the embodiment of the application is described.
As shown in fig. 5, an embodiment of the present application further provides a theme application apparatus 500, including: an acquisition module 501 and a processing module 502; the obtaining module 501 is configured to obtain a first mapping table corresponding to a target topic, where the first mapping table includes a mapping relationship between an updated resource in the target topic and an application resource to be updated; a processing module 502, configured to update the topic resource mapping table based on the first mapping table; searching updated resources according to the theme resource mapping table, and replacing the resources to be updated with updated resources.
Optionally, the obtaining module 501 is further configured to obtain a theme resource of the target theme; the processing module 502 is further configured to parse the theme resource to generate target type data, and generate a resource file according to the target type data; and establishing a first mapping table according to the resource file.
Optionally, the processing module 502 is specifically configured to submit a file storage path of the resource file to the runtime overlay resource overlay mechanism, where the file storage path is a first path; based on the first path, a first mapping table is established through an overlay mechanism.
Optionally, the storage path of the first mapping table is a first path; the processing module 502 is further configured to update an acquisition path of an application theme resource of a first application to the first path, where the first application is an application in a running state.
Optionally, the storage path of the first mapping table is a first path; the apparatus 500 further comprises a receiving module 503; a receiving module 503, configured to receive a first input of a user; the processing module 502 is further configured to run a second application in response to the first input, and obtain an application theme resource of the second application according to the first path.
Optionally, the apparatus 500 further includes a communication module 504; the communication module 504 is configured to send a prompt message to the target application through the system interface, where the prompt message is used to instruct the theme resource mapping table to be updated; the processing module 502 is specifically configured to search for an updated resource according to the topic resource mapping table, obtain the updated resource based on the first path, and replace the resource to be updated of the target application with the updated resource.
In the embodiment of the application, the theme resource mapping table can be updated based on the first mapping table, and because the first mapping table comprises the mapping relation between the updated resource in the target theme and the resource to be updated of the application, the updated resource can be searched according to the theme resource mapping table, and the resource to be updated is replaced by the updated resource. Because the updated resources can be directly searched according to the theme resource mapping table without loading and buffering the resources of the theme resource package and opening the file handle of the theme resource package, the occupation of the process memory can be reduced, the influence on the resource creation efficiency is avoided, the running efficiency and the resource searching efficiency of the electronic equipment can be improved, and the running smoothness of the electronic equipment is improved.
The subject application in the embodiments of the present application may be an electronic device, or may be a component in an electronic device, such as an integrated circuit or a chip. The electronic device may be a terminal, or may be other devices than a terminal. By way of example, the electronic device may be a mobile phone, tablet computer, notebook computer, palm computer, vehicle-mounted electronic device, mobile internet appliance (Mobile Internet Device, MID), augmented reality (augmented reality, AR)/Virtual Reality (VR) device, robot, wearable device, ultra-mobile personal computer, UMPC, netbook or personal digital assistant (personal digital assistant, PDA), etc., but may also be a server, network attached storage (Network Attached Storage, NAS), personal computer (personal computer, PC), television (TV), teller machine or self-service machine, etc., and the embodiments of the present application are not limited in particular.
The subject application in embodiments of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, and the embodiment of the present application is not limited specifically.
The theme application apparatus provided in the embodiment of the present application can implement each process implemented by the embodiments of the methods of fig. 1 to fig. 4, and in order to avoid repetition, a description is omitted here.
Optionally, as shown in fig. 6, the embodiment of the present application further provides an electronic device 600, including a processor 601 and a memory 602, where the memory 602 stores a program or an instruction that can be executed on the processor 601, and the program or the instruction implements each step of the above-mentioned subject application method embodiment when executed by the processor 601, and the steps achieve the same technical effects, so that repetition is avoided, and no further description is given here.
The electronic device in the embodiment of the application includes the mobile electronic device and the non-mobile electronic device.
Fig. 7 is a schematic diagram of a hardware structure of an electronic device implementing an embodiment of the present application.
The electronic device 700 includes, but is not limited to: radio frequency unit 701, network module 702, audio output unit 703, input unit 704, sensor 705, display unit 706, user input unit 707, interface unit 708, memory 709, and processor 710.
Those skilled in the art will appreciate that the electronic device 700 may also include a power source (e.g., a battery) for powering the various components, which may be logically connected to the processor 710 via a power management system so as to perform functions such as managing charge, discharge, and power consumption via the power management system. The electronic device structure shown in fig. 7 does not constitute a limitation of the electronic device, and the electronic device may include more or less components than shown, or may combine certain components, or may be arranged in different components, which are not described in detail herein.
The processor 710 is configured to obtain a first mapping table corresponding to the target topic, where the first mapping table includes a mapping relationship between an updated resource in the target topic and an application resource to be updated; updating a theme resource mapping table based on the first mapping table; searching updated resources according to the theme resource mapping table, and replacing the resources to be updated with updated resources.
In the embodiment of the application, the theme resource mapping table can be updated based on the first mapping table, and because the first mapping table comprises the mapping relation between the updated resource in the target theme and the resource to be updated of the application, the updated resource can be searched according to the theme resource mapping table, and the resource to be updated is replaced by the updated resource. Because the updated resources can be directly searched according to the theme resource mapping table without loading and buffering the resources of the theme resource package and opening the file handle of the theme resource package, the occupation of the process memory can be reduced, the influence on the resource creation efficiency is avoided, the running efficiency and the resource searching efficiency of the electronic equipment can be improved, and the running smoothness of the electronic equipment is improved.
Optionally, the processor 710 is further configured to obtain a theme resource of the target theme; analyzing the theme resource to generate target type data, and generating a resource file according to the target type data; and establishing a first mapping table according to the resource file.
In the embodiment of the application, the resource file can be generated according to the theme resource of the target theme, and the first mapping table is established according to the resource file, so that the mapping relation between the updated resource and the resource to be updated of the application in the target theme can be determined, thereby providing a basis for the replacement of the interface resource.
Optionally, the processor 710 is specifically configured to submit a file storage path of the resource file to the runtime overlay resource overlay mechanism, where the file storage path is a first path; based on the first path, a first mapping table is established through an overlay mechanism.
In the embodiment of the application, the first mapping table can be established through an overlay mechanism, so that the creation efficiency of resources can be improved, the realization of the theme application process is simpler and more convenient, the system complexity is lower, and the robustness is better.
Optionally, the storage path of the first mapping table is a first path; the processor 710 is further configured to update an acquisition path of an application theme resource of a first application to the first path, where the first application is an application in a running state.
In the embodiment of the application, the acquisition path of the application theme resource of the application in the running state can be updated to be the first path, and because the file storage path of the first mapping table is the first path, after updating the application theme, the electronic device can acquire the first mapping table through the first path and determine the application theme resource based on the first mapping table, thereby enabling the mapping relation of the interface theme to take effect and further realizing the updating of the application theme of the first application.
Optionally, the storage path of the first mapping table is a first path; a user input unit 707 for receiving a first input of a user; the processor 710 is further configured to run a second application in response to the first input, and obtain an application theme resource of the second application according to the first path.
In the embodiment of the application, after the user triggers the second application to run, the application theme resource of the second application can be directly obtained according to the first path, and because the file storage path of the first mapping table is the first path, after the application theme is updated and the second application is triggered to start, the electronic equipment can obtain the first mapping table through the first path and determine the application theme resource based on the first mapping table, thereby enabling the mapping relation of the interface theme to take effect and further realizing the updating of the application theme of the second application.
Optionally, the interface unit 708 is configured to send, through the system interface, a hint information to the target application, where the hint information is used to instruct the topic resource mapping table to be updated; the processor 710 is specifically configured to search for an updated resource according to the topic resource mapping table, obtain the updated resource based on the first path, and replace the resource to be updated of the target application with the updated resource.
In the embodiment of the application, because the updated resources can be searched based on the theme resource mapping table, the creation efficiency of Java layer resource objects is not affected, and the problem of large memory occupation caused by holding file handles all the time in the process can be avoided, thereby improving the operation smoothness of the electronic equipment and reducing the performance consumption caused by theme functions.
It should be appreciated that in embodiments of the present application, the input unit 704 may include a graphics processor (Graphics Processing Unit, GPU) 7041 and a microphone 7042, with the graphics processor 7041 processing image data of still pictures or video obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The display unit 706 may include a display panel 7061, and the display panel 7061 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. The user input unit 707 includes at least one of a touch panel 7071 and other input devices 7072. The touch panel 7071 is also referred to as a touch screen. The touch panel 7071 may include two parts, a touch detection device and a touch controller. Other input devices 7072 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and so forth, which are not described in detail herein.
The memory 709 may be used to store software programs as well as various data. The memory 709 may mainly include a first storage area storing programs or instructions and a second storage area storing data, wherein the first storage area may store an operating system, application programs or instructions (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like. Further, the memory 709 may include volatile memory or nonvolatile memory, or the memory 709 may include both volatile and nonvolatile memory. The nonvolatile Memory may be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable EPROM (EEPROM), or a flash Memory. The volatile memory may be random access memory (Random Access Memory, RAM), static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (ddr SDRAM), enhanced SDRAM (Enhanced SDRAM), synchronous DRAM (SLDRAM), and Direct RAM (DRRAM). Memory 709 in embodiments of the application includes, but is not limited to, these and any other suitable types of memory.
Processor 710 may include one or more processing units; optionally, processor 710 integrates an application processor that primarily processes operations involving an operating system, user interface, application programs, and the like, and a modem processor that primarily processes wireless communication signals, such as a baseband processor. It will be appreciated that the modem processor described above may not be integrated into the processor 710.
The embodiment of the present application further provides a readable storage medium, where a program or an instruction is stored, where the program or the instruction realizes each process of the above embodiment of the subject application method when executed by a processor, and the process can achieve the same technical effect, so that repetition is avoided, and no further description is given here.
Wherein the processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes computer readable storage medium such as computer readable memory ROM, random access memory RAM, magnetic or optical disk, etc.
The embodiment of the application further provides a chip, which comprises a processor and a communication interface, wherein the communication interface is coupled with the processor, and the processor is used for running programs or instructions to realize the processes of the embodiment of the subject application method, and the same technical effects can be achieved, so that repetition is avoided, and the description is omitted here.
It should be understood that the chips referred to in the embodiments of the present application may also be referred to as system-on-chip chips, chip systems, or system-on-chip chips, etc.
Embodiments of the present application provide a computer program product stored in a storage medium, where the program product is executed by at least one processor to implement the respective processes of the above-described embodiments of the subject application method, and achieve the same technical effects, and are not repeated herein.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. Furthermore, it should be noted that the scope of the methods and apparatus in the embodiments of the present application is not limited to performing the functions in the order shown or discussed, but may also include performing the functions in a substantially simultaneous manner or in an opposite order depending on the functions involved, e.g., the described methods may be performed in an order different from that described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the related art in the form of a computer software product stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk), including several instructions for causing a terminal (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method according to the embodiments of the present application.
The embodiments of the present application have been described above with reference to the accompanying drawings, but the present application is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those having ordinary skill in the art without departing from the spirit of the present application and the scope of the claims, which are to be protected by the present application.

Claims (14)

1. A method of theme application comprising:
acquiring a first mapping table corresponding to a target theme, wherein the first mapping table comprises a mapping relation between updated resources and resources to be updated of an application in the target theme;
updating a theme resource mapping table based on the first mapping table;
and searching the updated resource according to the theme resource mapping table, and replacing the resource to be updated with the updated resource.
2. The method for applying a theme according to claim 1, wherein before the first mapping table corresponding to the target theme is obtained, the method further includes:
obtaining theme resources of the target theme;
analyzing the subject resource to generate target type data, and generating a resource file according to the target type data;
and establishing the first mapping table according to the resource file.
3. The theme application method according to claim 2, wherein the creating the first mapping table according to the resource file includes:
submitting a file storage path of the resource file to a runtime overlay resource mechanism, wherein the file storage path is a first path;
and establishing the first mapping table through the overlay mechanism based on the first path.
4. A theme application method according to claim 2 or 3, wherein the storage path of the first mapping table is a first path; after the first mapping table is established according to the resource file, the method further comprises:
updating an acquisition path of an application theme resource of a first application into the first path, wherein the first application is an application in a running state.
5. A theme application method according to claim 2 or 3, wherein the storage path of the first mapping table is a first path; after the first mapping table is established according to the resource file, the method further comprises:
receiving a first input of a user;
and responding to the first input, running a second application, and acquiring application theme resources of the second application according to the first path.
6. The theme application method of claim 1, wherein after updating the theme resource map based on the first map, the method further comprises:
sending prompt information to a target application through a system interface, wherein the prompt information is used for indicating that the theme resource mapping table is updated;
the searching the updated resource according to the topic resource mapping table, and replacing the resource to be updated with the updated resource includes:
Searching the updated resource according to the theme resource mapping table, acquiring the updated resource based on the first path, and replacing the resource to be updated of the target application with the updated resource.
7. A theme application apparatus comprising: the device comprises an acquisition module and a processing module;
the acquisition module is used for acquiring a first mapping table corresponding to a target theme, wherein the first mapping table comprises a mapping relation between updated resources and resources to be updated of an application in the target theme;
the processing module is used for updating a theme resource mapping table based on the first mapping table; and searching the updated resource according to the theme resource mapping table, and replacing the resource to be updated with the updated resource.
8. The theme application apparatus of claim 7, wherein,
the acquisition module is further used for acquiring theme resources of the target theme;
the processing module is also used for analyzing the theme resource to generate target type data and generating a resource file according to the target type data; and establishing the first mapping table according to the resource file.
9. The theme application of claim 8, wherein the processing module is specifically configured to submit a file storage path of the resource file to a runtime overlay resource overlay mechanism, the file storage path being a first path; and establishing the first mapping table through the overlay mechanism based on the first path.
10. The theme application apparatus according to claim 8 or 9, wherein the storage path of the first mapping table is a first path;
the processing module is further configured to update an acquisition path of an application theme resource of a first application to the first path, where the first application is an application in a running state.
11. The theme application apparatus according to claim 8 or 9, wherein the storage path of the first mapping table is a first path; the apparatus further comprises a receiving module;
the receiving module is used for receiving a first input of a user;
the processing module is further configured to respond to the first input, run a second application, and obtain an application theme resource of the second application according to the first path.
12. The theme application apparatus of claim 7, further comprising a communication module;
the communication module is used for sending prompt information to a target application through a system interface, wherein the prompt information is used for indicating the update of the theme resource mapping table;
the processing module is specifically configured to search the update resource according to the theme resource mapping table, obtain the update resource based on the first path, and replace the resource to be updated of the target application with the update resource.
13. An electronic device comprising a processor and a memory storing a program or instructions executable on the processor, which when executed by the processor, implement the subject application method of any of claims 1-6.
14. A readable storage medium, wherein a program or instructions is stored on the readable storage medium, which when executed by a processor, implements the subject application method of any of claims 1-6.
CN202310593092.8A 2023-05-24 2023-05-24 Theme application method, theme application device, electronic equipment and readable storage medium Pending CN116627566A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310593092.8A CN116627566A (en) 2023-05-24 2023-05-24 Theme application method, theme application device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310593092.8A CN116627566A (en) 2023-05-24 2023-05-24 Theme application method, theme application device, electronic equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN116627566A true CN116627566A (en) 2023-08-22

Family

ID=87636116

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310593092.8A Pending CN116627566A (en) 2023-05-24 2023-05-24 Theme application method, theme application device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN116627566A (en)

Similar Documents

Publication Publication Date Title
US11868785B2 (en) Application program page processing method and device
CN109408136B (en) Information processing method, information processing apparatus, storage medium, and electronic device
CN109358936B (en) Information processing method, device, storage medium, electronic device and system
US20210133388A1 (en) Webpage rendering method, device, electronic apparatus and storage medium
CN109165050B (en) Program running method and device, computing equipment and storage medium
US9798555B2 (en) Application implementation method and apparatus
CN108549568B (en) Application entry processing method and device, storage medium and electronic equipment
WO2021164367A1 (en) Container mirror image providing method, container mirror image loading method, and related device and system
CN111796823A (en) Method and device for updating page and displaying page and page maintenance system
WO2020206691A1 (en) Application processing method and apparatus, storage medium, and electronic device
CN113312037A (en) Data processing method, device and equipment applied to microservice and storage medium
CN112306587A (en) Page display processing method and device and terminal equipment
CN108345478B (en) Application processing method and device, storage medium and electronic equipment
CN108334330B (en) Application unloading method and device, storage medium and electronic equipment
US20160371172A1 (en) Techniques for evaluating applications through use of an auxiliary application
CN111367518A (en) Page layout method and device, computing equipment and computer storage medium
CN108563476B (en) Application program running method and device, storage medium and electronic equipment
CN107423291B (en) Data translation method and client device
CN108268274B (en) Application management method and device, storage medium and electronic equipment
CN111177634A (en) Multi-language supporting file content loading method, device, equipment and medium
CN113742716B (en) Code running method, device, electronic equipment, storage medium and program product
CN116627566A (en) Theme application method, theme application device, electronic equipment and readable storage medium
CN111221613B (en) Program calling method and device and storage medium
CN106775608A (en) The implementation method and device of autonomous system process
CN114020309B (en) Method, device and storage medium for constructing multi-page application through webpack

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