[go: up one dir, main page]

CN111767103B - A method and device for changing page theme - Google Patents

A method and device for changing page theme Download PDF

Info

Publication number
CN111767103B
CN111767103B CN202010327675.2A CN202010327675A CN111767103B CN 111767103 B CN111767103 B CN 111767103B CN 202010327675 A CN202010327675 A CN 202010327675A CN 111767103 B CN111767103 B CN 111767103B
Authority
CN
China
Prior art keywords
theme
resource data
target
page
basic
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
CN202010327675.2A
Other languages
Chinese (zh)
Other versions
CN111767103A (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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology 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 Beijing Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202010327675.2A priority Critical patent/CN111767103B/en
Publication of CN111767103A publication Critical patent/CN111767103A/en
Application granted granted Critical
Publication of CN111767103B publication Critical patent/CN111767103B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

本发明公开了一种更换页面主题的方法和装置,涉及计算机技术领域。该方法的一具体实施方式包括:接收更换页面主题请求,根据所述页面的基础主题资源数据标识,确定所述目标主题资源数据相对应的目标主题资源数据标识,并形成用于显示目标主题页面的目标主题资源数据,基于目标主题资源数据,利用目标资源管理单元,更换页面主题;该实施方式能够达到无需修改代码并且无需进行应用级变更而动态更换页面主题的技术效果,部分克服了现有技术中客户端在更换页面主题中灵活性差和性能差的问题,提高了更换页面主题的扩展性。

The present invention discloses a method and device for changing a page theme, and relates to the field of computer technology. A specific implementation of the method includes: receiving a request for changing a page theme, determining a target theme resource data identifier corresponding to the target theme resource data according to a basic theme resource data identifier of the page, and forming target theme resource data for displaying a target theme page, and changing the page theme based on the target theme resource data and using a target resource management unit; the implementation can achieve the technical effect of dynamically changing the page theme without modifying the code and without making application-level changes, partially overcoming the problems of poor flexibility and poor performance of the client in changing the page theme in the prior art, and improving the extensibility of changing the page theme.

Description

Page theme changing method and device
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for replacing a page theme.
Background
With popularization of internet applications, more and more users wish to customize the personalized style of application pages, so that many applications do page theme changing functions and meet personalized requirements of the users. The current ways of changing the theme are mainly divided into two ways: the method comprises the steps that a client side and a server side agree on theme rules, and the client side analyzes data according to theme resource data issued by the server side and acquires the resource data through a corresponding component of a page to update an interface; and secondly, generating a theme resource package according to a rule, uploading the theme resource package, then issuing a client, acquiring and replacing the whole resource manager by the client through a reflection mechanism according to a system flow, and reloading the resources of the whole application to realize the replacement of the page theme.
In the process of implementing the present invention, the inventor finds that at least the following problems exist in the prior art:
in the first method, because the fixed rule is required to ensure that the codes of the client and the server are fixed, the expansibility is poor, and if the resource data is required to be replaced, the rule is required to be contracted again, so that the versions of the client and the server are required to be upgraded; the second client adopts a system-level reflection mechanism, application-level replacement is needed, performance is poor, and potential safety hazards are forbidden because of the method for acquiring resource data by the reflection mechanism.
Disclosure of Invention
In view of this, an embodiment of the present invention provides a method and an apparatus for replacing a page theme, capable of receiving a request for replacing a page theme, determining a target theme resource data identifier corresponding to the target theme resource data according to a basic theme resource data identifier of the page, and forming target theme resource data for displaying a target theme page, and replacing a page theme with a target resource management unit based on the target theme resource data; therefore, the technical effect of dynamically replacing the page theme without modifying the code of the client or replacing the application level is achieved, the problems of poor flexibility and poor performance of the client in replacing the page theme in the prior art are partially overcome, and the performance and expansibility of replacing the page theme are improved.
To achieve the above object, according to an aspect of the embodiment of the present invention, there is provided a method for replacing a page theme, including: receiving a page theme changing request, wherein the page theme changing request at least comprises a target theme; when the target theme relates to the replaceable theme of the page, the page replacement theme request further comprises target theme resource data; determining the target theme resource data identification according to the basic theme resource data identification of the page; the target subject resource data identification indicates corresponding target subject resource data; and replacing the page theme by using a target resource management unit based on the target theme resource data.
Optionally, the method for replacing the page theme is characterized in that,
The target theme resource data at least comprises any one or more data of texts, components and files related to the target theme of the page.
Optionally, the method for replacing the page theme is characterized in that,
Determining the target theme resource data identification according to the basic theme resource data identification of the page, including:
And determining a target theme resource data identifier corresponding to the target theme resource data according to the basic theme resource data identifier of the page and the target theme, wherein the target theme resource data identifier comprises the basic theme resource data identifier.
Optionally, the method for replacing the page theme is characterized in that,
The basic theme resource data of the page and the target theme resource data have corresponding change relation, the target theme resource data is determined according to the basic theme resource data of the page, and a target theme resource data packet is formed according to the target theme resource data.
Optionally, the method for replacing the page theme is characterized in that,
Based on the target topic resource data, replacing the page topic by using a target resource management unit, comprising:
Acquiring a target theme to be replaced, and acquiring a corresponding target theme resource data packet according to the target theme;
Respectively matching the corresponding target topic resource data identifications in the target topic resource data packet according to the basic topic resource data identifications of the page by using a target resource management unit; and replacing a page theme according to the target theme resource data corresponding to the target theme resource data identification.
Optionally, the method for replacing the page theme is characterized in that,
Acquiring a target theme to be replaced, acquiring a built-in theme resource data packet when the target theme relates to the built-in theme of the page, and replacing the page theme according to resource data contained in the built-in theme resource data packet by utilizing a built-in resource manager.
To achieve the above object, according to a second aspect of the embodiments of the present invention, there is provided an apparatus for replacing a page theme, including: a page replacement theme request processing module, a theme resource data generating module and a target theme page display module; wherein,
The page replacement theme request processing module is used for receiving a page replacement theme request, and the page replacement theme request at least comprises a target theme; when the target theme relates to the replaceable theme of the page, the page replacement theme request further comprises target theme resource data;
the topic resource data generation module is used for determining the target topic resource data identification according to the basic topic resource data identification of the page; the target subject resource data identification indicates corresponding target subject resource data;
The target theme page display module is used for replacing a page theme by utilizing a target resource management unit based on the target theme resource data.
Optionally, the device for replacing page theme is characterized in that,
The target theme resource data at least comprises any one or more data of texts, components and files related to the target theme of the page.
Optionally, the device for replacing page theme is characterized in that,
Determining the target theme resource data identification according to the basic theme resource data identification of the page, including:
And determining the target theme resource data identification according to the basic theme resource data identification of the page and the target theme, wherein the target theme resource data identification comprises the basic theme resource data identification.
Optionally, the device for replacing page theme is characterized in that,
The basic theme resource data of the page and the target theme resource data have corresponding change relation, the target theme resource data is determined according to the basic theme resource data of the page, and a target theme resource data packet is formed according to the target theme resource data.
Optionally, the device for replacing page theme is characterized in that,
Based on the target topic resource data, replacing the page topic by using a target resource management unit, comprising:
Acquiring a target theme to be replaced, and acquiring a corresponding target theme resource data packet according to the target theme;
Respectively matching the corresponding target topic resource data identifications in the target topic resource data packet according to the basic topic resource data identifications of the page by using a target resource management unit; and replacing a page theme according to the target theme resource data corresponding to the target theme resource data identification.
Optionally, the device for replacing page theme is characterized in that,
Acquiring a target theme to be replaced, acquiring a built-in theme resource data packet when the target theme relates to the built-in theme of the page, and replacing the page theme according to resource data contained in the built-in theme resource data packet by utilizing a built-in resource manager.
To achieve the above object, according to a third aspect of the embodiments of the present invention, there is provided an electronic device for replacing a page theme, including: one or more processors; and a storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the method as described in any of the methods of changing page topics above.
To achieve the above object, according to a fourth aspect of the embodiments of the present invention, there is provided a computer-readable medium having stored thereon a computer program, characterized in that the program, when executed by a processor, implements a method as described in any one of the above methods of changing page topics.
One embodiment of the above invention has the following advantages or benefits: the method comprises the steps that a page theme changing request can be received, a target theme resource data identifier corresponding to target theme resource data is determined according to a basic theme resource data identifier of the page, target theme resource data for displaying the target theme page is formed, and a page theme is changed by using a target resource management unit based on the target theme resource data; therefore, the technical effect of dynamically changing the page theme without modifying the code of the client is achieved, the problems of poor flexibility and poor performance of the client in changing the page theme in the prior art are partially overcome, and the performance and expansibility of changing the page theme are improved.
Further effects of the above-described non-conventional alternatives are described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a flow chart of a method for replacing a page theme according to a first embodiment of the present invention;
FIG. 2 is a schematic flow chart of a method for replacing a theme of a page according to a second embodiment of the present invention;
FIG. 3 is a flow diagram of a change page theme for a changeable theme provided by one embodiment of the present invention;
FIG. 4 is a schematic structural diagram of an apparatus for changing page theme according to an embodiment of the present invention;
FIG. 5 is an exemplary system architecture diagram in which embodiments of the present invention may be applied;
Fig. 6 is a schematic diagram of a computer system suitable for use in implementing an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention will now be described with reference to the accompanying drawings, in which various details of the embodiments of the present invention are included to facilitate understanding, and are to be considered merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
As shown in fig. 1, an embodiment of the present invention provides a method for replacing a page theme, which may include the following steps:
Step S101: receiving a page theme changing request, wherein the page theme changing request at least comprises a target theme; when the target theme relates to the replaceable theme of the page, the page replacement theme request further comprises target theme resource data;
The page theme is mainly embodied by characters, colors, static pictures, animations, audios, videos, control styles and the like of the page, and usually one page theme has a uniform style;
When the page theme needs to be replaced, the application receives a page theme replacing request, wherein the page theme replacing request can be sent by a user, for example, the user selects a personalized page theme through a menu or allows the user to add the personalized page theme; the request for replacing the page theme can also be initiated by an application, for example, when the application is started, the page theme is replaced by a corresponding page theme according to the time characteristics, for example, the page theme is replaced by a summer theme or a winter theme according to the time dimension information;
The change page theme request includes a target theme to be changed, for example, a night theme, a happy theme, a sunny theme, etc.; when the target theme relates to the replaceable theme of the page, the page replacement theme request further comprises target theme resource data; specifically, the replaceable theme is a personalized customized theme, not a theme built in an application, so the request for replacing the page theme further comprises target theme resource data; it can be appreciated that when the target theme relates to the replaceable theme of the page and the page is replaced, a part of the display content of the page can be replaced, and the whole display content of the page can also be replaced; that is, a part of theme resource data or all theme resource data of the page may be replaced, and further, display contents to be changed are determined according to target theme resource data included in the page theme request; when the target theme relates to the built-in theme of the page, acquiring corresponding built-in theme resource data according to a request for changing the page theme, wherein the request comprises the target theme to be changed;
Namely, receiving a page replacement theme request, wherein the page replacement theme request at least comprises a target theme; when the target theme relates to the replaceable theme of the page, the page replacement theme request further comprises target theme resource data;
further, the target theme resource data at least comprises any one or more data of texts, components and files related to the target theme of the page; specifically, the text is text information displayed on the page, text labels of the controls and the like, and the component is control information, container information and the like displayed on the page, such as menus, buttons and the like; the files include files of pictures, animations, videos, etc. related to the display of the page theme and files containing resource data, for example, data of colors related to the page theme are saved using color.
Step S102: determining the target theme resource data identification according to the basic theme resource data identification of the page; the target subject resource data identification indicates corresponding target subject resource data;
specifically, the basic topic of the page is a default topic solidified in the application and showing the page style, if no request for replacing the topic page exists, the page of the application maintains the style of the basic topic and uses basic topic resource data related to the basic topic; wherein each basic theme resource data has a corresponding basic theme resource data identifier, and it can be understood that the replacement page theme is replaced based on the basic theme resource data; when a theme page is replaced, in order to dynamically replace and display modified target theme resource data, a corresponding change relation between a page basic theme resource data identifier and a target theme resource data identifier needs to be established, and the corresponding relation is used for ensuring the accuracy of dynamic replacement, the consistency of styles and the expansibility of personalized customized page theme;
That is, according to the basic theme resource data identifier of the page, determining the target theme resource data identifier includes: and determining a target theme resource data identifier corresponding to the target theme resource data according to the basic theme resource data identifier of the page and the target theme, wherein the target theme resource data identifier comprises the basic theme resource data identifier.
For example: the picture name related to the basic theme background of the page is backgroup. The target theme contained in the change page theme request indicates that the scene of the page to be changed is the "night theme". According to a predefined naming rule, the background picture related to the target subject page will be named: backspace_right. Wherein, "background" is the underlying topic resource data identification, as described above; further, "right" is a target theme, representing a theme of "night theme"; still further, the background_right is a target theme resource data identifier, and the file background_right.png is target theme resource data, that is, the target theme resource data identifier includes the basic theme resource data identifier. It can be understood that the background picture can be downloaded to the mobile phone by the user, when the user designates a certain picture as the background, the picture is named according to a predefined theme naming rule, and is placed in a corresponding file directory according to a predefined storage rule, and other information related to the resource data is similarly processed, wherein the predefined theme naming rule can be 'target theme_basic theme resource data identification', 'basic theme resource data identification_target theme', and the like; the invention does not limit the specific content of the mark of the theme resource data and the specific name rule of the mark of the target theme resource data;
Further, the basic theme resource data of the page and the target theme resource data have a corresponding change relation, the target theme resource data is determined according to the basic theme resource data of the page, and a target theme resource data packet is formed according to the target theme resource data.
Specifically, different target theme resource data such as text, pictures, components and the like can form different files, and the file names contain target theme resource data identifiers; collecting one or more target topic resource data related to topic information to form a target topic resource data packet; it can be understood that the basic theme resource data of the page and the target theme resource data have a corresponding change relationship, the target theme resource data is determined according to the basic theme resource data of the page, and a target theme resource data packet is formed according to the target theme resource data.
For example, progress_bar_right.xml contains a description of a progress bar control, wherein the display picture related to the progress bar is set to "@ folder/progress_bar_right", and the picture file "progress_bar_right.png" is located through "pro gress _bar_right.xml"; the method comprises the steps that a progress_bar_right.xml is used as a data file formed by target theme resource data, and a 'progress_bar' in a file name is used as a basic theme resource data identifier; "right" is target theme information, representing "night theme";
Further, a target subject resource data package is formed according to the one or more target subject resource data.
Namely, the basic theme resource data of the page and the target theme resource data have a corresponding change relation, the target theme resource data is determined according to the basic theme resource data of the page, and a target theme resource data packet is formed according to the target theme resource data.
Step S103: and replacing the page theme by using the target resource management unit based on the target theme resource data.
Specifically, steps S301 to S304 as shown in fig. 3 describe the present step;
Based on the target topic resource data, replacing the page topic by using a target resource management unit, comprising: acquiring a target theme to be replaced, and acquiring a corresponding target theme resource data packet according to the target theme; respectively matching the corresponding target topic resource data identifications in the target topic resource data packet according to the basic topic resource data identifications of the page by using a target resource management unit; and replacing the page theme according to the target theme resource data corresponding to the target theme resource data identification.
As shown in fig. 2, an embodiment of the present invention provides a method for replacing a page theme, which may include the following steps:
Step S201: a request to change page theme is received.
Specifically, receiving a page replacement theme request, wherein the page replacement theme request at least comprises a target theme; when the target theme relates to the replaceable theme of the page, the page replacement theme request further comprises target theme resource data;
the target theme resource data at least comprises any one or more data of texts, components and files related to the target theme of the page.
The description of the request for replacing the page theme is consistent with the step S101, and will not be repeated here;
Further, when the target topic included in the request for replacing page topic is "built-in topic", step S202 is performed; when the target topic included in the page replacement topic request is "replaceable topic", step S203 is performed;
The built-in theme is a theme which is built in an application and used for representing the style of the page, and one or more built-in themes are built in the application for users to select; the replaceable theme is a personalized theme customizable by a user, the resource data corresponding to the replaceable theme is target theme resource data, and the identification of the resource data corresponding to the replaceable theme is target theme resource data identification.
Step S202: and acquiring the built-in theme resource data packet.
Specifically, in order to enrich user experience, one or more default topics are usually included in the application, namely, built-in topics, and resource files of the built-in topics are preset and built-in the application, and it can be understood that page display content of the built-in topics is fixed, and the number of the built-in topics is also fixed;
When the target theme information contained in the page theme change request is a built-in theme, a built-in theme resource data packet is acquired, and it can be understood that the built-in theme resource data packet is resource data which is built in an application and reflects the built-in theme; wherein the built-in subject resource data identifier comprises a built-in subject resource data identifier;
for example, the application defines four built-in theme styles according to four seasons, and embeds theme resource data packages for themes in each season; the invention does not further discuss the built-in theme resource data package. In this example, the change page theme request not only contains target theme information with a value of "built-in theme", but also can indicate that the "spring theme" is changed to "summer theme", for example, the theme of different seasons will be indicated by different built-in theme identifiers, so that the application can select appropriate resource data from the resource data of its built-in theme to change the page according to the built-in theme identifier contained in the change page theme request.
Step S203: determining a target subject resource data identifier corresponding to the target subject resource data; when the target topic information contained in the page topic replacement request is a replaceable topic, target topic resource data are acquired, and target topic resource data identifiers corresponding to the target topic resource data are determined according to the basic topic resource data identifiers of the page and the target topic, wherein the target topic resource data identifiers contain the basic topic resource data identifiers.
Further, the basic theme resource data of the page and the target theme resource data have a corresponding change relation, the target theme resource data is determined according to the basic theme resource data of the page, and a target theme resource data packet is formed according to the target theme resource data;
The description of the target subject resource data identifier corresponding to the determined target subject resource data is consistent with step S102, and will not be repeated here;
Step S204: and forming a target theme resource data packet.
Specifically, the basic theme resource data of the page and the target theme resource data have a corresponding change relation, and the target theme resource data included in the target theme resource data packet is determined according to the basic theme resource data of the page. The description of forming the target subject resource data packet is consistent with step S102, and will not be repeated here;
Step S205: and replacing the page theme, and displaying the theme page after replacement.
Specifically, based on the target topic resource data, replacing the page topic by using a target resource management unit;
Acquiring a target theme to be replaced, and acquiring a corresponding target theme resource data packet according to the target theme; respectively matching the corresponding target topic resource data identifications in the target topic resource data packet according to the basic topic resource data identifications of the page by using a target resource management unit; and replacing a page theme according to the target theme resource data corresponding to the target theme resource data identification.
Further, acquiring a target theme to be replaced, acquiring a built-in theme resource data packet when the target theme relates to the built-in theme of the page, and replacing the page theme according to resource data contained in the built-in theme resource data packet by utilizing a built-in resource manager;
The target resource management unit is used for configuring and managing personalized target theme resource data; theme resource data downloaded locally; acquiring a target theme to be replaced, acquiring a built-in theme resource data packet when the target theme relates to a built-in theme of the page, and replacing the page theme according to resource data contained in the built-in theme resource data packet by utilizing a built-in resource manager;
The function of the target resource management unit is similar to that of the built-in resource manager, the configured and managed resource data are different, and the personalized customized theme resource data can be flexibly processed by the technical means, so that the target resource management unit has expandability.
As shown in fig. 3, an embodiment of the present invention provides a method for changing page theme of a replaceable theme, which may include the steps of;
Step S301: sending a theme page replacement request;
The request for replacing the theme page can come from an application interface, and the application can send the request for replacing the theme page in other modes; in step S301-step S304, the target theme relates to a replaceable theme of the page, i.e. a request for replacing a page theme is received, the request for replacing a page theme at least comprising the target theme; when the target theme relates to the replaceable theme of the page, the page replacement theme request further comprises target theme resource data;
the description of the topic page request is consistent with step S101, and will not be repeated here;
Step S302: acquiring a target theme to be replaced by using a theme resource unit contained in a client, and determining a target theme resource data identifier according to a basic theme resource data identifier of the page; the target subject resource data identification indicates corresponding target subject resource data;
Specifically, determining the target topic resource data identifier according to the basic topic resource data identifier of the page comprises: determining a target theme resource data identifier corresponding to the target theme resource data according to the basic theme resource data identifier of the page and the target theme, wherein the target theme resource data identifier comprises the basic theme resource data identifier;
Wherein, according to the basic theme resource data identification of the page, determining the target theme resource data identification corresponding to the target theme resource data includes: determining a target theme resource data identifier corresponding to the target theme resource data according to the basic theme resource data identifier of the page and the target theme, wherein the target theme resource data identifier comprises the basic theme resource data identifier;
For example, the user designates the picture "snorow. Png" as the background picture resource data of the replaceable theme "new year theme" (newyear), and obtains the file name of the background picture in the basic theme resource data identifier of the page as background; the corresponding basic theme resource data is identified as "background", and then the picture "now.png" specified by the user will be named as "background_newyear.png" according to the predefined theme naming rule and placed in the corresponding file directory according to the predefined storage rule; wherein, "background" is a basic theme resource data identifier; "newyear" is a target theme, and "background_ newyear" is a target theme resource data identifier, so as to form a corresponding change relation of the resource data identifier; thus, the target theme resource data identifier comprises the basic theme resource data identifier and also comprises the target theme; it can be appreciated that such naming rules are used to determine the target theme resource data that replaces the base theme resource data by the corresponding change relationship of the base theme resource data identifier and the target theme resource data identifier; further, background_newyear.png is the target topic resource data related to the background; that is, according to the basic topic resource data identifier of the page and the target topic, determining a target topic resource data identifier corresponding to the target topic resource data, wherein the target topic resource data identifier contains the basic topic resource data identifier.
Further, determining target subject resource data according to the target subject resource data identification corresponding to the target subject resource data, including:
the basic theme resource data of the page and the target theme resource data have corresponding change relation, the target theme resource data is determined according to the basic theme resource data of the page, and a target theme resource data packet is formed according to the target theme resource data.
Step S303: searching a corresponding target theme resource data identifier in a target theme resource package according to the basic theme resource data identifier by utilizing a target resource management unit, and acquiring target theme resource data according to the target theme resource data identifier;
step S304: replacing a page theme, and displaying a theme page after replacement;
Steps S303 to S304 describe a process of acquiring target resource data and displaying a target topic page according to the target topic resource data packet;
specifically, a target theme to be replaced is obtained, and a corresponding target theme resource data packet is obtained according to the target theme;
Respectively matching the corresponding target topic resource data identifications in the target topic resource data packet according to the basic topic resource data identifications of the page by using a target resource management unit; changing page topics according to the target topic resource data corresponding to the target topic resource data identification;
For example, the existing page theme is a basic theme, the target theme information to be replaced is a "night theme", and theme resource data related to the night theme includes pictures, components, text and the like, and the pictures are taken as examples for illustration;
Matching the corresponding target subject resource data identifier in the target subject resource data packet according to the basic subject resource data identifier of the page, for example, taking an android resource file as an example,
The picture information fragment is contained in the picture_bar.xml file of the basic theme resource data file of one picture contained in the page as follows:
"@folder1/picture_bar_008"
The picture file named picture_bar_008 is stored under a folder1 directory, and p icture _bar_008 is taken as a basic theme resource data identifier;
The information of the pictures contained in the picture_bar_right.xml file corresponding to the target theme "night theme" is as follows:
"@folder2/picture_bar_008_night"
The picture file named as picture_bar_008_light is stored under a folder2 directory, and picture_bar_008_light is a target theme resource data identifier;
it will be appreciated that folder1 and folder2 are set and named according to predefined rules, and may be the same directory name, while the superior directory names are different; or different directory names named according to rules;
Further, in order to execute replacement of the resource data, the target resource management unit is utilized to search for a corresponding target topic resource data identifier in the target topic resource data packet according to the resource data identifier "picture_bar" of the basic topic picture, and the matching result is "picture_bar_nig ht", which can be understood that the naming rule of the target topic resource data identifier is preset, and the specific description is consistent as that of the step S102, and is not repeated herein; further, acquiring related pictures or other information according to the specific information contained in pic wire_bar_right.xml; similarly, acquiring target theme resource data of each object to be replaced;
The invention does not limit the style and the concrete content of the resource data.
Taking an android application as an example, when the application starts and executes page loading (onActivityCreated is a page loading related method), the loaded target theme resource data is cached, when the page is displayed (onActivityResu med is a page display related method), the target theme resource to be replaced is processed and the page theme is replaced, and when the page is destroyed (onActivityDestroyed is a page destroy related method), the removal operation is performed on the relevant cached target theme resource data to promote the memory recovery.
As shown in fig. 4, an embodiment of the present invention provides an apparatus 400 for replacing a page theme, including: a replacement page theme request processing module 401, a theme resource data generating module 402, and a target theme page display module 403; wherein,
The page replacement topic request processing module 401 is configured to receive a page replacement topic request, where the page replacement topic request at least includes a target topic; when the target theme relates to the replaceable theme of the page, the page replacement theme request further comprises target theme resource data;
The topic resource data generation module 402 is configured to determine the target topic resource data identifier according to a basic topic resource data identifier of the page; the target subject resource data identification indicates corresponding target subject resource data;
the target topic page display module 403 is configured to replace a page topic with a target resource management unit based on the target topic resource data.
Optionally, the replacing page theme request processing module 401 includes the target theme resource data at least including any one or more of text, components, and files related to the target theme of the page.
Optionally, the topic resource data generating module 402 is configured to determine the target topic resource data identifier according to the basic topic resource data identifier of the page, and includes:
And determining a target theme resource data identifier corresponding to the target theme resource data according to the basic theme resource data identifier of the page and the target theme, wherein the target theme resource data identifier comprises the basic theme resource data identifier.
Optionally, the topic resource data generation module 402 includes that a corresponding change relationship exists between basic topic resource data of the page and target topic resource data, the target topic resource data is determined according to the basic topic resource data of the page, and a target topic resource data packet is formed according to the target topic resource data.
Optionally, the target topic page display module 403 is configured to replace a page topic with a target resource management unit based on target topic resource data, and includes:
Acquiring a target theme to be replaced, and acquiring a corresponding target theme resource data packet according to the target theme;
Respectively matching the corresponding target topic resource data identifications in the target topic resource data packet according to the basic topic resource data identifications of the page by using a target resource management unit; and replacing a page theme according to the target theme resource data corresponding to the target theme resource data identification.
Optionally, the target theme page display module 403 is configured to obtain a target theme to be replaced, obtain a built-in theme resource data packet when the target theme relates to a built-in theme of the page, and replace the page theme according to resource data included in the built-in theme resource data packet by using a built-in resource manager.
The embodiment of the invention also provides electronic equipment for replacing the page theme, which comprises: one or more processors; and a storage device for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the method provided by any of the embodiments described above.
The embodiment of the invention also provides a computer readable medium, on which a computer program is stored, which when executed by a processor implements the method provided by any of the above embodiments.
Fig. 5 illustrates an exemplary system architecture 500 to which the page theme change method or apparatus of changing page theme of the embodiment of the present invention may be applied.
As shown in fig. 5, the system architecture 500 may include terminal devices 501, 502, 503, a network 504, and a server 505. The network 504 is used as a medium to provide communication links between the terminal devices 501, 502, 503 and the server 505. The network 504 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
A user may interact with the server 505 via the network 504 using the terminal devices 501, 502, 503 to receive or send messages or the like. Various client applications such as an electronic mall client application, a web browser application, a search class application, an instant messaging tool, a mailbox client, and the like may be installed on the terminal devices 501, 502, 503.
The terminal devices 501, 502, 503 may be a variety of electronic devices having a display screen and supporting a variety of client applications, including but not limited to smartphones, tablet computers, laptop and desktop computers, and the like.
The server 505 may be a server providing various services, such as a background management server providing support for client applications used by the user with the terminal devices 501, 502, 503. The background management server can process the received request for replacing the theme of the theme page and feed the theme page after replacement back to the terminal equipment.
It should be noted that, the method for replacing the page theme provided by the embodiment of the present invention is generally executed by the terminal devices 501, 502, 503, and accordingly, the device for replacing the page theme is generally disposed in the terminal devices 501, 502, 503 or the server 505.
It should be understood that the number of terminal devices, networks and servers in fig. 5 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 6, there is illustrated a schematic diagram of a computer system 600 suitable for use in implementing an embodiment of the present invention. The terminal device shown in fig. 6 is only an example, and should not impose any limitation on the functions and the scope of use of the embodiment of the present invention.
As shown in fig. 6, the computer system 600 includes a Central Processing Unit (CPU) 601, which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the system 600 are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other through a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, mouse, etc.; an output portion 607 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The drive 610 is also connected to the I/O interface 605 as needed. Removable media 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is installed as needed on drive 610 so that a computer program read therefrom is installed as needed into storage section 608.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication portion 609, and/or installed from the removable medium 611. The above-described functions defined in the system of the present invention are performed when the computer program is executed by a Central Processing Unit (CPU) 601.
The computer readable medium shown in the present invention may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules and/or units involved in the embodiments of the present invention may be implemented in software, or may be implemented in hardware. The described modules and/or units may also be provided in a processor, e.g., may be described as: a processor includes a replacement page theme request processing module, a theme resource data generation module, and a target theme page display module. The names of these modules do not limit the module itself in some cases, and for example, the target topic page display module may also be described as "a module for displaying a target topic page based on target topic resource data".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be present alone without being fitted into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to include: receiving a page theme changing request, wherein the page theme changing request at least comprises a target theme; when the target theme relates to the replaceable theme of the page, the page replacement theme request further comprises target theme resource data; determining the target theme resource data identification according to the basic theme resource data identification of the page; the target subject resource data identification indicates corresponding target subject resource data; and replacing the page theme by using a target resource management unit based on the target theme resource data.
According to the technical scheme of the embodiment of the invention, the technical effect of dynamically changing the page theme without modifying codes and carrying out application level change can be achieved, the problems of poor flexibility and poor performance of the client in changing the page theme in the prior art are partially overcome, and the expansibility of changing the page theme is improved.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives can occur depending upon design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (9)

1.一种更换页面主题的方法,其特征在于,包括:1. A method for changing a page theme, comprising: 接收更换页面主题请求,所述更换页面主题请求至少包含目标主题;在所述目标主题涉及所述页面的可更换主题时,所述更换页面主题请求还包括目标主题资源数据;receiving a request for changing the page theme, wherein the request for changing the page theme at least includes a target theme; when the target theme relates to a replaceable theme of the page, the request for changing the page theme also includes target theme resource data; 根据所述页面的基础主题资源数据标识,以及所述目标主题,确定所述目标主题资源数据相对应的目标主题资源数据标识,所述目标主题资源数据标识包含所述基础主题资源数据标识;所述目标主题资源数据标识指示相对应的目标主题资源数据;According to the basic theme resource data identifier of the page and the target theme, determine the target theme resource data identifier corresponding to the target theme resource data, the target theme resource data identifier includes the basic theme resource data identifier; the target theme resource data identifier indicates the corresponding target theme resource data; 基于所述目标主题资源数据,利用目标资源管理单元,更换页面主题。Based on the target theme resource data, the page theme is changed using the target resource management unit. 2.根据权利要求1所述的方法,其特征在于,2. The method according to claim 1, characterized in that 所述目标主题资源数据包括页面的所述目标主题相关的文本、组件、图片、动画、视频、资源数据中的任意一种或者多种数据;其中,所述资源数据包括与页面主题相关的颜色数据。The target theme resource data includes any one or more of text, components, pictures, animations, videos, and resource data related to the target theme of the page; wherein the resource data includes color data related to the page theme. 3.根据权利要求1所述的方法,其特征在于,3. The method according to claim 1, characterized in that 所述页面的基础主题资源数据与目标主题资源数据存在对应变更关系,根据页面的所述基础主题资源数据,确定所述目标主题资源数据,根据所述目标主题资源数据形成目标主题资源数据包。There is a corresponding change relationship between the basic theme resource data and the target theme resource data of the page. The target theme resource data is determined according to the basic theme resource data of the page, and a target theme resource data packet is formed according to the target theme resource data. 4.根据权利要求3所述的方法,其特征在于,4. The method according to claim 3, characterized in that 基于目标主题资源数据,利用目标资源管理单元,更换页面主题,包括:Based on the target theme resource data, use the target resource management unit to change the page theme, including: 获取待更换的目标主题,根据所述目标主题,获取相应的所述目标主题资源数据包;Obtain the target theme to be replaced, and according to the target theme, obtain the corresponding target theme resource data package; 利用目标资源管理单元,根据所述页面的基础主题资源数据标识,分别匹配所述目标主题资源数据包中对应的所述目标主题资源数据标识;根据所述目标主题资源数据标识对应的所述目标主题资源数据,更换页面主题。Using the target resource management unit, the target theme resource data identifiers corresponding to the target theme resource data packets are matched respectively according to the basic theme resource data identifiers of the page; and the page theme is changed according to the target theme resource data corresponding to the target theme resource data identifiers. 5.根据权利要求4所述的方法,其特征在于,5. The method according to claim 4, characterized in that 获取待更换的目标主题,在所述目标主题涉及所述页面的内置主题时,获取内置主题资源数据包,利用内置资源管理器,根据所述内置主题资源数据包所包含的资源数据,更换页面主题。The target theme to be replaced is obtained. When the target theme relates to the built-in theme of the page, a built-in theme resource data packet is obtained. The page theme is replaced according to the resource data contained in the built-in theme resource data packet by using a built-in resource manager. 6.一种更换页面主题的装置,其特征在于,包括:更换页面主题请求处理模块、主题资源数据生成模块和目标主题页面显示模块;其中,6. A device for changing the page theme, characterized by comprising: a page theme change request processing module, a theme resource data generation module and a target theme page display module; wherein, 所述更换页面主题请求处理模块,用于接收更换页面主题请求,所述更换页面主题请求至少包含目标主题;在所述目标主题涉及所述页面的可更换主题时,所述更换页面主题请求还包括目标主题资源数据;The page theme change request processing module is used to receive a page theme change request, wherein the page theme change request at least includes a target theme; when the target theme involves a replaceable theme of the page, the page theme change request also includes target theme resource data; 所述主题资源数据生成模块,用于根据所述页面的基础主题资源数据标识,以及所述目标主题,确定所述目标主题资源数据相对应的目标主题资源数据标识,所述目标主题资源数据标识包含所述基础主题资源数据标识;所述目标主题资源数据标识指示相对应的目标主题资源数据;The subject resource data generation module is used to determine the target subject resource data identifier corresponding to the target subject resource data according to the basic subject resource data identifier of the page and the target subject, wherein the target subject resource data identifier includes the basic subject resource data identifier; the target subject resource data identifier indicates the corresponding target subject resource data; 所述目标主题页面显示模块,用于基于所述目标主题资源数据,利用目标资源管理单元,更换页面主题。The target theme page display module is used to change the page theme based on the target theme resource data and using the target resource management unit. 7.根据权利要求6所述的装置,其特征在于,7. The device according to claim 6, characterized in that 基于目标主题资源数据,利用目标资源管理单元,更换页面主题,包括:Based on the target theme resource data, use the target resource management unit to change the page theme, including: 获取待更换的目标主题,根据所述目标主题,获取相应的所述目标主题资源数据形成的主题资源数据包;Acquire a target theme to be replaced, and acquire a theme resource data packet formed by corresponding target theme resource data according to the target theme; 利用目标资源管理单元,根据所述页面的基础主题资源数据标识,分别匹配所述目标主题资源数据包中对应的所述目标主题资源数据标识;根据所述目标主题资源数据标识对应的所述目标主题资源数据,更换页面主题。Using the target resource management unit, the target theme resource data identifiers corresponding to the target theme resource data packets are matched respectively according to the basic theme resource data identifiers of the page; and the page theme is changed according to the target theme resource data corresponding to the target theme resource data identifiers. 8.一种电子设备,其特征在于,包括:8. An electronic device, comprising: 一个或多个处理器;one or more processors; 存储装置,用于存储一个或多个程序,a storage device for storing one or more programs, 当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如权利要求1-5中任一所述的方法。When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 5. 9.一种计算机可读介质,其上存储有计算机程序,其特征在于,所述程序被处理器执行时实现如权利要求1-5中任一所述的方法。9. A computer-readable medium having a computer program stored thereon, wherein when the program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
CN202010327675.2A 2020-04-23 2020-04-23 A method and device for changing page theme Active CN111767103B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010327675.2A CN111767103B (en) 2020-04-23 2020-04-23 A method and device for changing page theme

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010327675.2A CN111767103B (en) 2020-04-23 2020-04-23 A method and device for changing page theme

Publications (2)

Publication Number Publication Date
CN111767103A CN111767103A (en) 2020-10-13
CN111767103B true CN111767103B (en) 2024-11-15

Family

ID=72719170

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010327675.2A Active CN111767103B (en) 2020-04-23 2020-04-23 A method and device for changing page theme

Country Status (1)

Country Link
CN (1) CN111767103B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106354394A (en) * 2016-08-26 2017-01-25 乐视控股(北京)有限公司 Browser subject switching handling method and device

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7107539B2 (en) * 1998-12-18 2006-09-12 Tangis Corporation Thematic response to a computer user's context, such as by a wearable personal computer
CN101561747A (en) * 2009-05-25 2009-10-21 腾讯科技(深圳)有限公司 Method and device for outputting user interface of client
CN104915257A (en) * 2015-06-08 2015-09-16 青岛海信移动通信技术股份有限公司 Method and device for replacing theme based on Android system application
CN105117469A (en) * 2015-08-28 2015-12-02 无锡天脉聚源传媒科技有限公司 Method and apparatus for personalized replacement of webpage theme
CN106657611A (en) * 2016-11-15 2017-05-10 努比亚技术有限公司 Device and method for changing application theme
CN108509236A (en) * 2017-02-24 2018-09-07 北京旷视科技有限公司 Subject replacement method and device, face identification system subject replacement method and device
CN111131352B (en) * 2018-10-31 2023-01-13 北京国双科技有限公司 Theme switching method and device
CN110908655B (en) * 2019-10-16 2023-12-05 浙江大搜车软件技术有限公司 Skin changing method, device, computer equipment and readable storage medium

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106354394A (en) * 2016-08-26 2017-01-25 乐视控股(北京)有限公司 Browser subject switching handling method and device

Also Published As

Publication number Publication date
CN111767103A (en) 2020-10-13

Similar Documents

Publication Publication Date Title
JP6621543B2 (en) Automatic update of hybrid applications
US9002962B2 (en) Saving message attachments to an online content management system
US10505872B2 (en) Messaging application interacting with one or more extension applications
CN113747376B (en) Messaging Extension App Store
US9519654B2 (en) Method, device, processing center and system for desktop synchronization
JP6022540B2 (en) Push notification to update multiple dynamic icon panels
US20160170712A1 (en) Method for integrally implementing development and release of APP
CN109478180B (en) Cloud content state determination logic
US20240402977A1 (en) Desktop sharing method and mobile terminal
AU2017201927A1 (en) A method for roundtrip sharing of editable data with associated action between mobile apps
US10375149B2 (en) Application registration and interaction
CN110647327B (en) Method and device for dynamic control of user interface based on card
CN110674624A (en) A method and system for graphic editing
CN106899755A (en) Information sharing method, information sharing device and terminal
CN112433728A (en) Website construction method and device, electronic equipment and storage medium
CN111767103B (en) A method and device for changing page theme
CN113760349B (en) Image upgrade method and device
CN115250259B (en) Information interaction method and device and electronic equipment
CN112130855B (en) A method and device for generating a page
WO2016107119A1 (en) Method and device for realizing unstructured supplementary service data menu
CN107911469B (en) Card configuration method and device and server
CN110109727A (en) The configuration method and device of application
CN113760314B (en) Page module control method, device, electronic device and storage medium
CN112947846B (en) Batch processing task execution method and device of object storage system and electronic equipment
CN113704187A (en) Method and device for generating file

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