A method and device for changing page theme
By receiving a page theme request and using the target resource management unit, the target theme resource data identification is determined based on the basic topic resource data identification, and dynamically replace the page theme, the problems of poor client scalability and low performance in the existing technology are solved, and efficient theme replacement.
Patent Information
- Application Number
- CN202010327675.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-04-23
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2040-04-23
AI Technical Summary
When changing page themes in the prior art, the code between the client and the server is fixed, the scalability is poor, and the client adopts a system-level reflection mechanism, which has poor performance and poses a security risk.
By receiving a page theme change request, the target topic resource data identification is determined based on the basic topic resource data identification, the page theme is replaced using the target resource management unit, and the page theme is dynamically replaced without modifying the client code or performing application-level replacement.
It improves the performance and scalability of page theme replacement, overcomes the problem of poor flexibility, and achieves the dynamic replacement effect of no code modification.
Smart Images

Figure CN111767103B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method and device for changing a page theme. Background Art
[0002] With the popularization of Internet applications, more and more users want to customize the personalized style of application pages. Therefore, many applications have implemented page theme replacement functions to meet the personalized needs of users. Currently, there are two main ways to replace themes: the first method is that the client and the server agree on theme rules. The client parses the data according to the theme resource data sent by the server and obtains the resource data through the corresponding components of the page to update the interface; the second method is to generate a theme resource package according to the rules, upload the theme resource package, and then send it to the client. The client obtains and replaces the entire resource manager through the reflection mechanism according to the system process, and then reloads the resources of the entire application to achieve page theme replacement.
[0003] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:
[0004] In method one, the client and server codes are fixed due to the need for fixed conventions, and the scalability is poor. If the resource data needs to be changed, the rules need to be re-agreed, resulting in the need to upgrade the client and server versions. In method two, the client uses a system-level reflection mechanism, which requires application-level replacement, has poor performance, and because the reflection mechanism method of obtaining resource data has security risks, it may be disabled. Summary of the invention
[0005] In view of this, an embodiment of the present invention provides a method and device for changing a page theme, which can receive a request to change a page theme, determine 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 form target theme resource data for displaying a target theme page, and change the page theme based on the target theme resource data using a target resource management unit; thereby achieving the technical effect of dynamically changing the page theme without modifying the client code or application-level replacement, 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 performance and scalability of changing the page theme.
[0006] To achieve the above-mentioned purpose, according to one aspect of an embodiment of the present invention, a method for changing a page theme is provided, characterized in that it includes: receiving a request for changing a page theme, the request for changing a page theme at least including a target theme; when the target theme involves a replaceable theme of the page, the request for changing a page theme also includes target theme resource data; determining the target theme resource data identifier based on a basic theme resource data identifier of the page; the target theme resource data identifier indicates corresponding target theme resource data; and changing the page theme based on the target theme resource data using a target resource management unit.
[0007] Optionally, the method for changing the page theme is characterized by:
[0008] The target theme resource data at least includes any one or more data among texts, components, and files related to the target theme of the page.
[0009] Optionally, the method for changing the page theme is characterized by:
[0010] Determining the target theme resource data identifier according to the basic theme resource data identifier of the page includes:
[0011] According to the basic theme resource data identifier of the page and the target theme, a target theme resource data identifier corresponding to the target theme resource data is determined, and the target theme resource data identifier includes the basic theme resource data identifier.
[0012] Optionally, the method for changing the page theme is characterized by:
[0013] 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.
[0014] Optionally, the method for changing the page theme is characterized by:
[0015] Based on the target theme resource data, use the target resource management unit to change the page theme, including:
[0016] Obtain the target theme to be replaced, and according to the target theme, obtain the corresponding target theme resource data package;
[0017] 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.
[0018] Optionally, the method for changing the page theme is characterized by:
[0019] 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.
[0020] To achieve the above object, according to a second aspect of an embodiment of the present invention, there is provided an apparatus for changing a page theme, characterized in that it comprises: a page theme change request processing module, a theme resource data generation module and a target theme page display module; wherein,
[0021] 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;
[0022] The subject resource data generation module is used to determine the target subject resource data identifier according to the basic subject resource data identifier of the page; the target subject resource data identifier indicates the corresponding target subject resource data;
[0023] 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.
[0024] Optionally, the device for changing the page theme is characterized in that:
[0025] The target theme resource data at least includes any one or more data among texts, components, and files related to the target theme of the page.
[0026] Optionally, the device for changing the page theme is characterized in that:
[0027] Determining the target theme resource data identifier according to the basic theme resource data identifier of the page includes:
[0028] The target theme resource data identifier is determined according to the basic theme resource data identifier of the page and the target theme, and the target theme resource data identifier includes the basic theme resource data identifier.
[0029] Optionally, the device for changing the page theme is characterized in that:
[0030] 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.
[0031] Optionally, the device for changing the page theme is characterized in that:
[0032] Based on the target theme resource data, use the target resource management unit to change the page theme, including:
[0033] Obtain the target theme to be replaced, and according to the target theme, obtain the corresponding target theme resource data package;
[0034] 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.
[0035] Optionally, the device for changing the page theme is characterized in that:
[0036] 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.
[0037] To achieve the above-mentioned purpose, according to the third aspect of an embodiment of the present invention, there is provided an electronic device for changing a page theme, characterized in that it comprises: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement any of the methods described in the above-mentioned methods for changing the page theme.
[0038] To achieve the above-mentioned purpose, according to a fourth aspect of an embodiment of the present invention, a computer-readable medium is provided, on which a computer program is stored, characterized in that when the program is executed by a processor, any method described in the above-mentioned method for changing the page theme is implemented.
[0039] An embodiment of the above invention has the following advantages or beneficial effects: it is capable of receiving a request to change the page theme, determining the target theme resource data identifier corresponding to the target theme resource data according to the basic theme resource data identifier of the page, and forming the target theme resource data for displaying the target theme page, and based on the target theme resource data, using the target resource management unit, changing the page theme; thereby achieving the technical effect of dynamically changing the page theme without modifying the client code, 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 performance and scalability of changing the page theme.
[0040] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with specific implementation examples. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0042] Figure 1 It is a flowchart of a method for changing a page theme provided by the first embodiment of the present invention;
[0043] Figure 2 This is a schematic diagram of a process of changing a page theme provided by a second embodiment of the present invention;
[0044] Figure 3 It is a schematic diagram of a flow chart of changing a page theme for a changeable theme provided by an embodiment of the present invention;
[0045] Figure 4 It is a structural schematic diagram of a device for changing a page theme provided by an embodiment of the present invention;
[0046] Figure 5 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;
[0047] Figure 6 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0048] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0049] like Figure 1As shown, an embodiment of the present invention provides a method for changing a page theme, which may include the following steps:
[0050] Step S101: receiving a request for changing a page theme, wherein the request for changing a page theme at least includes a target theme; when the target theme involves a replaceable theme of the page, the request for changing a page theme also includes target theme resource data;
[0051] Specifically, the page theme is used to reflect the page display style. The page theme is mainly reflected through the page text, color, static image, animation, audio, video, control style, etc. Usually, a page theme has a unified style;
[0052] When it is necessary to change the page theme, the application receives a request to change the page theme, which may be sent by the user, for example, the user selects a personalized page theme through a menu, or allows the user to add his own personalized page theme; the request to change the page theme may also be initiated by the application, for example, when the application is started, the page theme is changed to a corresponding page theme according to a time feature, for example, according to time dimension information, the page theme is changed to a summer theme or a winter theme;
[0053] The request to change the page theme includes a target theme that needs to be changed, such as a night theme, a happy theme, a sunny theme, etc.; when the target theme involves a replaceable theme of the page, the request to change the page theme also includes target theme resource data; specifically, the replaceable theme is a personalized customized theme rather than a theme built into the application, so the request to change the page theme also includes target theme resource data; it can be understood that when the target theme involves a replaceable theme of the page and the page is changed, a part of the displayed content of the page can be replaced, or all of the displayed content of the page can be replaced; that is, a part of the theme resource data or all of the theme resource data of the page can be replaced, and further, the displayed content that needs to be changed is determined according to the target theme resource data contained in the page theme request; when the target theme involves a built-in theme of the page, the corresponding built-in theme resource data is obtained according to the request to change the page theme including the target theme that needs to be changed;
[0054] That is, receiving a request for changing the page theme, the request for changing the page theme at least including 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;
[0055] Furthermore, the target theme resource data includes at least any one or more of the text, components, and files related to the target theme of the page; specifically, the text is the text information displayed on the page, the text label of the control, etc., and the component is the control information displayed on the page, the container information, etc., for example, menus, buttons, etc.; the files include pictures, animations, videos and other files related to the page theme display and files containing resource data, for example, using colors.xml to save the color data related to the page theme.
[0056] Step S102: determining the target theme resource data identifier according to the basic theme resource data identifier of the page; the target theme resource data identifier indicates the corresponding target theme resource data;
[0057] Specifically, the basic theme of the page is a default theme that is solidified in the application and reflects the style of the page. If there is no request to change the theme page, the page of the application maintains the style of the basic theme and uses the basic theme resource data related to the basic theme; wherein each basic theme resource data has a corresponding basic theme resource data identifier, and it can be understood that the replacement of the page theme is based on the replacement of the basic theme resource data; when the theme page is replaced, in order to dynamically replace and display the modified target theme resource data, it is necessary to establish a corresponding change relationship between the page basic theme resource data identifier and the identifier of the target theme resource data, and such a corresponding relationship is used to ensure the accuracy of dynamic replacement and the consistency of style, and the extensibility of personalized customization of page themes;
[0058] That is, determining the target theme resource data identifier based on the basic theme resource data identifier of the page includes: determining the target theme resource data identifier corresponding to the target theme resource data based on the basic theme resource data identifier of the page and the target theme, the target theme resource data identifier containing the basic theme resource data identifier.
[0059] For example: the name of the picture related to the basic theme background of the page is background.png, that is, the basic theme resource data identifier is background. The target theme contained in the request to change the page theme indicates that the scene of the page to be changed is "night theme". According to the predefined naming rules, the background picture related to the target theme page will be named: background_night.png; wherein, as mentioned above, "background" is the basic theme resource data identifier; further, "night" is the target theme, representing that the theme is "night theme"; further, background_night is the target theme resource data identifier, and the file background_night.png is the target theme resource data, that is, the target theme resource data identifier contains the basic theme resource data identifier. It is understandable that the background image can be downloaded to the mobile phone by the user. When the user specifies a certain image as the background, the image will be named according to the predefined theme naming rules and placed in the corresponding file directory according to the predefined storage rules. Other resource data related information is also processed similarly. The predefined theme naming rules can be "target theme_basic theme resource data identifier", "basic theme resource data identifier_target theme", etc. The present invention does not limit the specific content of the identifier of the theme resource data and the specific name rules of the target theme resource data identifier.
[0060] Furthermore, 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.
[0061] Specifically, different target theme resource data such as text, pictures, components, etc. can form different files, and the file name contains the target theme resource data identifier; one or more target theme resource data related to the theme information are collected to form a target theme resource data package; it can be understood that there is a corresponding change relationship between the basic theme resource data of the page and the target theme resource data, and the target theme resource data is determined based on the basic theme resource data of the page, and the target theme resource data package is formed based on the target theme resource data.
[0062] For example, progress_bar_night.xml contains the description of the progress bar control, in which the display image related to the progress bar is set to "@folder / progress_bar_night", and the image file "progress_bar_night.png" is located through "progress_bar_night.xml"; wherein, progress_bar_night.xml is a data file formed by the target theme resource data, and "progress_bar" in the file name is the basic theme resource data identifier; "night" is the target theme information, indicating "night theme";
[0063] Furthermore, a target theme resource data packet is formed according to the one or more target theme resource data.
[0064] That is, there is a corresponding change relationship between the basic theme resource data of the page and the target theme resource data. The target theme resource data is determined according to the basic theme resource data of the page, and the target theme resource data packet is formed according to the target theme resource data.
[0065] Step S103: Based on the target theme resource data, the target resource management unit is used to change the page theme.
[0066] Specifically, Figure 3 Steps S301-S304 shown describe this step;
[0067] Based on the target theme resource data, the page theme is changed using the target resource management unit, including: obtaining the target theme to be changed, and obtaining the corresponding target theme resource data package according to the target theme; using the target resource management unit, matching the corresponding target theme resource data identifiers in the target theme resource data package according to the basic theme resource data identifiers of the page; and changing the page theme according to the target theme resource data corresponding to the target theme resource data identifiers.
[0068] like Figure 2 As shown, an embodiment of the present invention provides a method for changing a page theme, which may include the following steps:
[0069] Step S201: receiving a request to change the page theme.
[0070] Specifically, receiving a request for changing a page theme, the request for changing a page theme at least including a target theme; when the target theme relates to a replaceable theme of the page, the request for changing a page theme also includes target theme resource data;
[0071] The target theme resource data at least includes any one or more data among texts, components, and files related to the target theme of the page.
[0072] The description of the request to change the page theme is the same as that of step S101 and will not be repeated here;
[0073] Further, when the target theme included in the request to change the page theme is "built-in theme", step S202 is executed; when the target theme included in the request to change the page theme is "changeable theme", step S203 is executed;
[0074] Among them, the built-in theme is a theme built into the application for expressing the page style. Usually, the application has one or more built-in themes for users to choose from; the replaceable theme is a personalized theme that can be customized by the user. The resource data corresponding to the replaceable theme is the target theme resource data, and the identifier of the resource data corresponding to the replaceable theme is the target theme resource data identifier.
[0075] Step S202: Acquire a built-in theme resource data package.
[0076] Specifically, in order to enrich the user experience, one or more default themes, i.e. built-in themes, are usually included in the application. The resource files of the built-in themes are pre-set and built into the application. It is understandable that the page display content of the built-in themes is fixed, and the number of built-in themes is also fixed;
[0077] When the target theme information included in the request to change the page theme is "built-in theme", a built-in theme resource data packet is obtained. It can be understood that the built-in theme resource data packet is resource data that reflects the built-in theme built into the application; wherein the built-in theme resource data identifier includes the built-in theme resource data identifier;
[0078] For example, the application defines four built-in theme styles according to the four seasons, and has built-in theme resource data packages for the themes of each season; the present invention does not further explore the built-in theme resource data packages. In this example, the request to change the page theme not only includes the target theme information with the value of "built-in theme", but also indicates to switch the "spring theme" to "summer theme" - for example, the themes of different seasons will be indicated by different built-in theme identifiers, so that the application can change the page according to the built-in theme identifier included in the request to change the page theme, and select appropriate resource data from the resource data of its built-in theme.
[0079] Step S203: Determine the target theme resource data identifier corresponding to the target theme resource data; when the target theme information contained in the request to change the page theme is "changeable theme", obtain the target theme resource data, and determine the target theme resource data identifier corresponding to the target theme resource data based on the basic theme resource data identifier of the page and the target theme, wherein the target theme resource data identifier includes the basic theme resource data identifier.
[0080] Furthermore, 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;
[0081] The description of determining the target theme resource data identifier corresponding to the target theme resource data is consistent with step S102 and will not be repeated here;
[0082] Step S204: forming a target subject resource data package.
[0083] Specifically, the basic theme resource data of the page and the target theme resource data have a corresponding change relationship, 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 theme resource data packet is consistent with step S102, and will not be repeated here;
[0084] Step S205: Change the page theme and display the changed theme page.
[0085] Specifically, based on the target theme resource data, the target resource management unit is used to change the page theme;
[0086] Obtain the target theme to be replaced, and obtain the corresponding target theme resource data package according to the target theme; use the target resource management unit to match the corresponding target theme resource data identifiers in the target theme resource data package according to the basic theme resource data identifiers of the page; replace the page theme according to the target theme resource data corresponding to the target theme resource data identifiers.
[0087] Further, obtaining a target theme to be replaced, and when the target theme relates to a built-in theme of the page, obtaining a built-in theme resource data package, and using a built-in resource manager to replace the page theme according to resource data contained in the built-in theme resource data package;
[0088] The target resource management unit is used to configure and manage personalized target theme resource data; for example, theme resource data downloaded to the local; obtain the target theme to be replaced, and when the target theme involves the built-in theme of the page, obtain the built-in theme resource data package, and use the built-in resource manager to replace the page theme according to the resource data contained in the built-in theme resource data package;
[0089] The function of the target resource management unit is similar to that of the built-in resource manager, but the resource data configured and managed are different. This technical means can flexibly process personalized customized subject resource data and has scalability.
[0090] like Figure 3 As shown, an embodiment of the present invention provides a method for changing a page theme for a replaceable theme, and the method may include the following steps:
[0091] Step S301: Send a request to change the subject page;
[0092] The request to change the theme page may come from the application interface, or the application may send the request to change the theme page in other ways; in steps S301 to S304, the target theme involves a replaceable theme of the page, that is, a request to change the page theme is received, and the request to change the page theme at least includes the target theme; when the target theme involves a replaceable theme of the page, the request to change the page theme also includes target theme resource data;
[0093] The description of the subject page request is the same as that of step S101 and will not be repeated here;
[0094] Step S302: using the theme resource unit included in the client, obtaining the target theme to be replaced, and determining the target theme resource data identifier according to the basic theme resource data identifier of the page; the target theme resource data identifier indicates the corresponding target theme resource data;
[0095] Specifically, determining the target theme resource data identifier according to the basic theme resource data identifier of the page includes: determining the 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 includes the basic theme resource data identifier;
[0096] Wherein, determining the target theme resource data identifier corresponding to the target theme resource data according to the basic theme resource data identifier of the page includes: determining the 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 includes the basic theme resource data identifier;
[0097] For example, the user specifies the image "snow.png" as the background image resource data of the replaceable theme "New Year Theme" (newyear), and obtains the file name of the background image in the basic theme resource data identifier of the page as background.png; the corresponding basic theme resource data identifier is "background", then the user-specified image "snow.png" will be named "background_newyear.png" according to the predefined theme naming rules and placed in the corresponding file directory according to the predefined storage rules; among which, "background" is the basic theme resource data identifier; "newyear" is the target theme, and "background_newyear" is the target theme. " is the target theme resource data identifier, thereby forming a corresponding change relationship of the resource data identifier; it can be seen that the target theme resource data identifier includes the basic theme resource data identifier and the target theme; it can be understood that this type of naming rule is used to determine the target theme resource data that replaces the basic theme resource data through the corresponding change relationship between the basic theme resource data identifier and the target theme resource data identifier; further, background_newyear.png is the target theme resource data related to the background; that is, according to the basic theme resource data identifier of the page and the target theme, the target theme resource data identifier corresponding to the target theme resource data is determined, and the target theme resource data identifier includes the basic theme resource data identifier.
[0098] Further, determining the target theme resource data according to the target theme resource data corresponding to the target theme resource data identifier includes:
[0099] 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.
[0100] Step S303: using the target resource management unit, according to the basic theme resource data identifier, searching for the corresponding target theme resource data identifier in the target theme resource package, and obtaining the target theme resource data according to the target theme resource data identifier;
[0101] Step S304: changing the page theme and displaying the changed theme page;
[0102] Steps S303-S304 describe the process of obtaining target resource data and displaying the target theme page according to the target theme resource data package;
[0103] Specifically, a target theme to be replaced is obtained, and according to the target theme, a corresponding resource data package of the target theme is obtained;
[0104] Using the target resource management unit, according to the basic theme resource data identifier of the page, respectively match the corresponding target theme resource data identifier in the target theme resource data packet; according to the target theme resource data corresponding to the target theme resource data identifier, change the page theme;
[0105] For example, the existing page theme is the basic theme, and the target theme information to be replaced is "night theme". The theme resource data related to the night theme includes pictures, components, texts, etc. The following takes pictures as an example;
[0106] According to the basic theme resource data identifier of the page, the corresponding target theme resource data identifier in the target theme resource data packet is matched. For example, taking the resource file of Android as an example,
[0107] The basic theme resource data file picture_bar.xml of a picture included in the page contains a fragment of picture information as follows:
[0108] "@folder1 / picture_bar_008"
[0109] Among them, the picture file named picture_bar_008 is saved in the folder1 directory, and picture_bar_008 is the basic theme resource data identifier;
[0110] The target theme resource data file picture_bar_night.xml corresponding to the target theme "night theme" contains the picture information as follows:
[0111] "@folder2 / picture_bar_008_night"
[0112] Among them, the picture file named picture_bar_008_night is saved in the folder2 directory, and picture_bar_008_night is the target theme resource data identifier;
[0113] It is understandable that folder1 and folder2 are set and named according to predefined rules, and can be the same directory name but different parent directory names; or different directory names named according to the rules;
[0114] Further, in order to replace the resource data, the target resource management unit is used to search for the corresponding target theme resource data identifier in the target theme resource data package according to the resource data identifier "picture_bar" of the basic theme picture, and the matching result is "picture_bar_night". It can be understood that the naming rule of the target theme resource data identifier is preset, and the specific description is consistent with the description of step S102, which will not be repeated here; further, the relevant pictures or other information are obtained according to the specific information contained in picture_bar_night.xml; similarly, each target theme resource data that needs to be replaced is obtained;
[0115] The present invention does not limit the style and specific content of resource data.
[0116] Among them, an implementation scheme of step S304 is as follows. Taking Android application as an example, when the application starts and executes page loading (onActivityCreated is a method related to page loading), the loaded target theme resource data is cached, and when the page is displayed (onActivityResu med is a method related to page display), the target theme resources that need to be replaced are processed and the page theme is replaced. When the page is destroyed (onActivityDestroyed is a method related to page destruction), the relevant cached target theme resource data will be removed to promote memory recovery.
[0117] like Figure 4 As shown, the embodiment of the present invention provides a device 400 for changing a page theme, comprising: a page theme change request processing module 401, a theme resource data generation module 402 and a target theme page display module 403; wherein,
[0118] The page theme change request processing module 401 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 is related to a replaceable theme of the page, the page theme change request also includes target theme resource data;
[0119] The subject resource data generation module 402 is used to determine the target subject resource data identifier according to the basic subject resource data identifier of the page; the target subject resource data identifier indicates the corresponding target subject resource data;
[0120] The target theme page display module 403 is used to change the page theme based on the target theme resource data and using the target resource management unit.
[0121] Optionally, the page theme change request processing module 401 includes the target theme resource data including at least any one or more data among texts, components, and files related to the target theme of the page.
[0122] Optionally, the subject resource data generating module 402 is used to determine the target subject resource data identifier according to the basic subject resource data identifier of the page, including:
[0123] According to the basic theme resource data identifier of the page and the target theme, a target theme resource data identifier corresponding to the target theme resource data is determined, and the target theme resource data identifier includes the basic theme resource data identifier.
[0124] Optionally, the theme resource data generation module 402 includes a corresponding change relationship between the basic theme resource data of the page and the target theme resource data, determines the target theme resource data according to the basic theme resource data of the page, and forms a target theme resource data package according to the target theme resource data.
[0125] Optionally, the target theme page display module 403 is used to change the page theme based on the target theme resource data using the target resource management unit, including:
[0126] Obtain the target theme to be replaced, and according to the target theme, obtain the corresponding target theme resource data package;
[0127] 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.
[0128] Optionally, the target theme page display module 403 is used to obtain the target theme to be replaced. When the target theme involves a built-in theme of the page, the built-in theme resource data package is obtained, and the page theme is replaced according to the resource data contained in the built-in theme resource data package using the built-in resource manager.
[0129] An embodiment of the present invention also provides an electronic device for changing page themes, comprising: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the method provided in any of the above embodiments.
[0130] An embodiment of the present invention further provides a computer-readable medium on which a computer program is stored. When the program is executed by a processor, the method provided in any of the above embodiments is implemented.
[0131] Figure 5 An exemplary system architecture 500 is shown to which the method for changing a page theme or the apparatus for changing a page theme according to an embodiment of the present invention can be applied.
[0132] like Figure 5 As shown, system architecture 500 may include terminal devices 501, 502, 503, a network 504 and a server 505. Network 504 is used to provide a medium for communication links between terminal devices 501, 502, 503 and server 505. Network 504 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0133] Users can use terminal devices 501, 502, 503 to interact with server 505 through network 504 to receive or send messages, etc. Various client applications can be installed on terminal devices 501, 502, 503, such as e-commerce client applications, web browser applications, search applications, instant messaging tools, and email clients.
[0134] The terminal devices 501 , 502 , and 503 may be various electronic devices having a display screen and supporting various client applications, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.
[0135] Server 505 may be a server providing various services, such as a background management server providing support for client applications used by users using terminal devices 501, 502, 503. The background management server may process the received request to change the page theme and feed back the changed theme page to the terminal device.
[0136] It should be noted that the method for changing the page theme provided in the embodiment of the present invention is generally executed by the terminal devices 501 , 502 , 503 , and accordingly, the device for changing the page theme is generally set in the terminal devices 501 , 502 , 503 or in the server 505 .
[0137] It should be understood that Figure 5 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0138] Reference below Figure 6 , which shows a schematic diagram of the structure of a computer system 600 of a terminal device suitable for implementing an embodiment of the present invention. Figure 6 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0139] like Figure 6 As shown, 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 part 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, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0140] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage section 608 as needed.
[0141] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the central processing unit (CPU) 601, the above-mentioned functions defined in the system of the present invention are executed.
[0142] It should be noted that 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 above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0143] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0144] The modules and / or units involved in the embodiments of the present invention described herein may be implemented in software or hardware. The modules and / or units described herein may also be arranged in a processor, for example, they may be described as: a processor including a page theme change request processing module, a theme resource data generation module, and a target theme page display module. The names of these modules do not constitute limitations on the modules themselves in certain circumstances, for example, the target theme page display module may also be described as "a module for displaying a target theme page according to the target theme resource data".
[0145] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes: receiving a request to change the page theme, the request to change the page theme at least includes a target theme; when the target theme involves a replaceable theme of the page, the request to change the page theme also includes target theme resource data; according to the basic theme resource data identifier of the page, the target theme resource data identifier is determined; 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 a target resource management unit.
[0146] According to the technical solution of the embodiment of the present invention, the technical effect of dynamically changing the page theme can be achieved without modifying the code and without making application-level changes. It partially overcomes the problems of poor flexibility and performance of the client in changing the page theme in the prior art and improves the scalability of changing the page theme.
[0147] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for changing a page theme, characterized in that: include: 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. 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. 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. 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. 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. A device for changing the theme of a page, characterized in that: include: Change page theme request processing module, theme resource data generation module and 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. 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. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, 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. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
