Page display method and device, electronic equipment and readable storage medium
By finding and injecting target color value files from the local cache in the Hybrid development mode, the problems of cumbersome page color adjustment and low reusability are solved, achieving efficient and low-cost page display color adjustment and improving user experience.
Patent Information
- Application Number
- CN202211242193.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-11
- Publication Date
- 2026-11-06
- Estimated Expiration
- 2042-10-11
AI Technical Summary
The existing Hybrid development model has a cumbersome process for adjusting page colors, which relies on developers to compile and deploy, resulting in high costs. In addition, the reusability of color value files is low, which increases loading costs and bandwidth consumption.
By retrieving the target color value file from the local cache and injecting it into the target page, the page display color can be adjusted, reducing compilation and deployment steps, supporting multiple pages to share the same color value file, and reducing loading costs.
Streamline the page display color adjustment process to improve efficiency, reduce loading costs, decrease data consumption, and enhance user experience.
Smart Images

Figure CN115438286B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and more specifically, to a page display method, apparatus, electronic device, and storage medium. Background Technology
[0002] With the development of computer technology, applications with different functions are emerging one after another. In order to improve the user experience, some applications provide different page display colors for users to choose from.
[0003] In related technologies, page colors are typically managed through color value files in a hybrid development mode. However, this development mode usually has the following drawbacks when updating color value files: First, it usually relies on developers to recompile and deploy, making the process of updating color value files cumbersome and costly. Second, each page needs to repeatedly load the corresponding color value file during the process of adjusting display colors, resulting in high loading costs. Summary of the Invention
[0004] This disclosure provides at least one page display method, apparatus, electronic device, and storage medium. In the process of adjusting the display colors of each page, the page color adjustment process can be simplified, the efficiency of color adjustment can be improved, and the reuse of color value files among multiple pages can be realized, thereby reducing loading costs.
[0005] In a first aspect, embodiments of this disclosure provide a page display method, including:
[0006] In response to a color adjustment instruction for a target page, a target color value file corresponding to the target file identifier carried in the color adjustment instruction is retrieved from the local cache. The target application to which the target page belongs corresponds to at least one color value file, each color value file corresponds to multiple pages, and the color value information corresponding to each page is a subset of the color value information contained in the color value file.
[0007] Based on the target color value file, the current display color of the target page is adjusted to the target display color, which is determined by the subset of the target color value file corresponding to the target page.
[0008] In this embodiment, the target color value file is retrieved from the local cache and injected into the target page to adjust the page's display color. This eliminates the need for developers to compile and deploy color value files for each page. As a result, page development costs are saved, the process of adjusting page display colors is simplified, and the efficiency of adjusting page display colors is improved.
[0009] Furthermore, in this embodiment, since each color value file corresponds to multiple pages, and the color value information corresponding to each page is a subset of the color value information contained in the color value file, and the subsets corresponding to different pages are also different, multiple pages can share the same color value file, thereby realizing the reuse of color value files. Compared with the technical solution in related technologies where a separate request for the color value file corresponding to each page is required for each display color adjustment, the same color value file only needs to be loaded once during the page display color adjustment process. That is, it is not necessary to load it repeatedly for each skin change. In this way, the loading cost of color value files can be reduced, the reusability of color value files can be realized, and the convenience of page display color adjustment can be improved, thereby reducing user data consumption and improving user experience.
[0010] According to the first aspect, in one possible implementation, before adjusting the current display color of the target page to the target display color based on the target color value file, the method further includes:
[0011] If the target color value file does not exist in the local cache, the address file in the local cache is searched for a target network address that matches the target file identifier. The address file contains at least one network address, and each network address corresponds to a file identifier.
[0012] The target color value file is obtained from the storage space corresponding to the target network address.
[0013] In this embodiment of the disclosure, if the target color value file does not exist in the local cache, the target color value file can be obtained from the storage space corresponding to the target network address in the local cache. This helps to improve the diversity of ways to obtain the target color value file.
[0014] According to the first aspect, in one possible implementation, obtaining the target color value file from the storage space corresponding to the target network address includes:
[0015] The target color value file is obtained from the storage space corresponding to the target network address, and the target color value file is cached locally.
[0016] In this embodiment of the disclosure, by caching the target color value file locally, it is not necessary to repeatedly obtain the color value file during the process of adjusting the display color of each page corresponding to the target color value file, which helps to improve the reusability of the target color value file.
[0017] According to the first aspect, in one possible implementation, the method further includes:
[0018] If the target network address is not found in the address file, the management platform searches for the target network address that matches the target file identifier. The management platform is used to store each published color value file to a preset storage space and generate a network address corresponding to each color value file.
[0019] In response to finding the target network address from the management platform, the target color value file is retrieved from the storage space corresponding to the target network address.
[0020] In this embodiment of the disclosure, if the target network address is not found in the address file in the local cache, it is possible to further communicate with the management platform to find the target network address from the management platform, and then obtain the target color value file from the storage space corresponding to the target network address. In this way, the diversity of ways to obtain the target color value file is further improved.
[0021] According to the first aspect, in one possible implementation, the step of searching for a target network address matching the target file identifier from the management platform includes:
[0022] Obtain the target network address from the management platform and cache the target network address locally;
[0023] The step of retrieving the target network address from the management platform and obtaining the target color value file from the storage space corresponding to the target network address includes:
[0024] In response to finding the target network address from the management platform, the target color value file is retrieved from the storage space corresponding to the target network address, and the target color value file is cached locally.
[0025] In this embodiment, by caching the target network address obtained from the management platform, repeated searches on the management platform are eliminated during color adjustment, saving system resources and improving the reusability of the target network address. Furthermore, in addition to caching the target network address, the target color value file obtained from the storage space corresponding to the target network address can also be cached. This allows for priority searching in the local cache during page color adjustment, improving search efficiency, saving system resources, and enhancing the reusability of the target color value file.
[0026] According to the first aspect, in one possible implementation, the method further includes:
[0027] In response to the failure to find the target network address in the management platform, a default color value file is obtained, and based on the default color value file, the current display color of the target page is adjusted to the default display color, wherein the default display color is determined by a subset of the default color value file corresponding to the target page.
[0028] In this embodiment of the disclosure, if the management platform does not have the target network address, it obtains the default color value file and adjusts the current display color of the target page to the default display color. This ensures the normal setting of the target page color and improves the user experience.
[0029] According to the first aspect, in one possible implementation, the method further includes:
[0030] For each color value file and / or each network address in the local cache, determine the usage attributes of the color value file and / or the network address; the usage attributes include at least one of the number of times used and the duration of use;
[0031] In response to the fact that the usage attributes of the color value file and / or the network address do not meet the preset conditions, the color value file and / or the network address are cleared from the local cache.
[0032] In this embodiment of the disclosure, the storage space of the local cache is maintained based on usage attributes, thereby saving the storage space of the local cache.
[0033] Secondly, embodiments of this disclosure provide a page display device, including:
[0034] The color value file lookup module is used to respond to a color adjustment instruction for a target page, and to look up the target color value file corresponding to the target file identifier carried in the color adjustment instruction from the local cache; the target application to which the target page belongs corresponds to at least one color value file, each color value file corresponds to multiple pages, and the color value information corresponding to each page is a subset of the color value information contained in the color value file;
[0035] The display color adjustment module is used to adjust the current display color of the target page to the target display color based on the target color value file. The target display color is determined by the subset of the target color value file corresponding to the target page.
[0036] According to the second aspect, in one possible implementation, the page display device further includes a network address lookup module, the network address lookup module being used for:
[0037] If the target color value file does not exist in the local cache, the address file in the local cache is searched for a target network address that matches the target file identifier. The address file contains at least one network address, and each network address corresponds to a file identifier.
[0038] The color value file search module is specifically used for:
[0039] The target color value file is obtained from the storage space corresponding to the target network address.
[0040] According to the second aspect, in one possible implementation, the color value file lookup module is specifically used for:
[0041] The target color value file is obtained from the storage space corresponding to the target network address, and the target color value file is cached locally.
[0042] According to the second aspect, in one possible implementation, the network address lookup module is further configured to:
[0043] If the target network address is not found in the address file, the management platform searches for the target network address that matches the target file identifier. The management platform is used to store each published color value file to a preset storage space and generate a network address corresponding to each color value file.
[0044] The color value file search module is specifically used for:
[0045] The target color value file is obtained from the storage space corresponding to the target network address.
[0046] According to the second aspect, in one possible implementation, the network address lookup module is specifically used for:
[0047] Obtain the target network address from the management platform and cache the target network address locally;
[0048] The color value file search module is specifically used for:
[0049] The target color value file is obtained from the storage space corresponding to the target network address, and the target color value file is cached locally.
[0050] According to the second aspect, in one possible implementation, the color value file acquisition module is further configured to:
[0051] In response to the failure to find the target network address in the management platform, a default color value file is obtained, and based on the default color value file, the current display color of the target page is adjusted to the default display color, wherein the default display color is determined by a subset of the default color value file corresponding to the target page.
[0052] According to the second aspect, in one possible implementation, the page display device further includes a local cache clearing module, the local cache clearing module being used for:
[0053] For each color value file and / or each network address in the local cache, determine the usage attributes of the color value file and / or the network address; the usage attributes include at least one of the number of times used and the duration of use;
[0054] In response to the fact that the usage attributes of the color value file and / or the network address do not meet the preset conditions, the color value file and / or the network address are cleared from the local cache.
[0055] Thirdly, embodiments of this disclosure provide an electronic device, including: a processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the memory via the bus, and when the machine-readable instructions are executed by the processor, the steps of the page display method as described in any embodiment of the first aspect are performed.
[0056] Fourthly, embodiments of this disclosure provide a computer-readable storage medium storing a computer program that, when executed by a processor, performs the steps of the page display method as described in any embodiment of the first aspect.
[0057] To make the above-mentioned objects, features and advantages of this disclosure more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0058] To more clearly illustrate the technical solutions of the embodiments of this disclosure, the accompanying drawings used in the embodiments will be briefly described below. These drawings are incorporated in and constitute a part of this specification. They illustrate embodiments conforming to this disclosure and, together with the specification, serve to explain the technical solutions of this disclosure. It should be understood that the following drawings only show some embodiments of this disclosure and should not be considered as limiting the scope. Those skilled in the art can obtain other related drawings based on these drawings without creative effort.
[0059] Figure 1 A schematic diagram of the execution subject of a page display method provided in an embodiment of this disclosure is shown;
[0060] Figure 2 A flowchart of a page display method provided by an embodiment of this disclosure is shown;
[0061] Figure 3 A flowchart is shown illustrating another page display method provided by an embodiment of this disclosure;
[0062] Figure 4 A schematic diagram of the structure of a page display device provided in an embodiment of this disclosure is shown;
[0063] Figure 5 A schematic diagram of another page display device provided in an embodiment of this disclosure is shown;
[0064] Figure 6 A schematic diagram of an electronic device provided in an embodiment of the present disclosure is shown. Detailed Implementation
[0065] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this disclosure, and not all of them. The components of the embodiments of this disclosure described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this disclosure provided in the accompanying drawings is not intended to limit the scope of the claimed disclosure, but merely represents selected embodiments of this disclosure. All other embodiments obtained by those skilled in the art based on the embodiments of this disclosure without inventive effort are within the scope of protection of this disclosure.
[0066] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0067] In this document, the term "and / or" merely describes a relationship, indicating that three relationships can exist. For example, A and / or B can represent three cases: A alone, A and B simultaneously, and B alone. Furthermore, the term "at least one" in this document means any combination of at least two of any one or more elements. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C.
[0068] Currently, hybrid development is a common approach for application development, where Android and iOS clients provide WebView containers to load web pages. Since these pages belong to the same app, to maintain a consistent color display across all pages, the color values used by each web page are relatively fixed. To facilitate modification of these color values, web pages often package their color information into a color value file. This file records the correspondence between color aliases and color values, i.e., color key-value pairs.
[0069] Research has revealed the following drawbacks in the aforementioned Hybrid development model's approach of managing page colors using color value files:
[0070] (1) The color adjustment process is complicated. Research has found that in scenarios where page colors need to be adjusted, such as when users switch between different page display colors according to their personal preferences, or when gray is needed on certain special dates, or when dark colors are needed in night mode, etc., the process of adjusting page display colors is quite cumbersome and results in high development costs for each page. Since the hybrid development mode usually relies on developers to replace color value files and recompile and deploy, the process of adjusting page display colors is quite cumbersome and results in high development costs for each page.
[0071] (2) Low reusability of color value files. In the same application, since the colors used by various pages mostly follow the same design specifications, for example, the colors used by each page can be a subset of a color specification. For example, the application's total color specification has 50 colors, page A needs to use 40 of them, and page B needs to use 30 of them. However, every time the display color of a page is adjusted, the corresponding color value file needs to be reloaded, resulting in low reusability of color value files, increasing the overhead of page color adjustment, and thus affecting the efficiency of page display color adjustment.
[0072] Based on the above research, this disclosure provides a page display method that, in response to a color adjustment instruction for a target page, searches for a target color value file corresponding to the target file identifier carried in the color adjustment instruction from a local cache; the target application to which the target page belongs corresponds to at least one color value file, each color value file corresponds to multiple pages, and the color value information corresponding to each page is a subset of the color value information contained in the color value file; based on the target color value file, the current display color of the target page is adjusted to the target display color, the target display color being determined by the subset in the target color value file corresponding to the target page.
[0073] In this embodiment, the target color value file is retrieved from the local cache and injected into the target page to adjust the page's display color. This eliminates the need for developers to compile and deploy color value files for each page. As a result, page development costs are saved, the process of adjusting page display colors is simplified, and the efficiency of adjusting page display colors is improved.
[0074] Furthermore, in this embodiment, since each color value file corresponds to multiple pages, and the color value information corresponding to each page is a subset of the color value information contained in the color value file, and the subsets corresponding to different pages are also different, multiple pages can share the same color value file, thereby realizing the reuse of color value files. Compared with the technical solution in related technologies where a separate request for the color value file corresponding to each page is required for each display color adjustment, the same color value file only needs to be loaded once during the page display color adjustment process. That is, it is not necessary to load it repeatedly for each skin change. In this way, the loading cost of color value files can be reduced, the reusability of color value files can be realized, and the convenience of page display color adjustment can be improved, thereby reducing user data consumption and improving user experience.
[0075] The shortcomings of the above solutions are the result of the inventor's practical experience and careful research. Therefore, the discovery process of the above problems and the solutions proposed in this disclosure below should be considered as the inventor's contribution to this disclosure.
[0076] To facilitate understanding of this embodiment, the page display method disclosed in this disclosure will first be described in detail. The executing entity of this page display method is an electronic device with a certain computing power. For example... Figure 1 As shown, the electronic device 100 may include a terminal. For example, the terminal may be... Figure 1The smartphone 10, desktop computer 20, laptop computer 30, etc. shown can also be Figure 1 Wearable devices (such as smartwatches) and in-vehicle devices not shown are not limited here.
[0077] Furthermore, this page display method can also be software running on the terminal, such as applications with page display functionality. In some possible implementations, this page display method can be implemented by the processor calling computer-readable instructions stored in memory.
[0078] See Figure 2 The diagram shows a flowchart of a page display method provided in an embodiment of this disclosure. The page display method includes the following steps S101 to S102:
[0079] S101, in response to a color adjustment instruction for a target page, a target color value file corresponding to the target file identifier carried in the color adjustment instruction is searched from the local cache. The target application to which the target page belongs corresponds to at least one color value file, each color value file corresponds to multiple pages, and the color value information corresponding to each page is a subset of the color value information contained in the color value file.
[0080] The target page can be any page in the target application (APP), and the target application can be of different types of APP, such as news APP, office APP, instant messaging APP, etc., without limitation.
[0081] The color adjustment command can be a user-initiated command via a terminal to adjust the display colors of a target page, or it can be a command issued by developers through a management platform to adjust the display colors of a target page, for example, using specific page colors for certain holidays. The management platform stores the various color value files issued by developers in a preset storage space and generates a network address corresponding to each color value file.
[0082] The local cache refers to the local cache of the terminal, such as the local cache of a smartphone or the local cache of a computer.
[0083] Specifically, the color value information refers to color key-value pairs. Each color value file contains multiple color key-value pairs, and each color key-value pair contains a color name and the color value corresponding to the color name. For example, a color key-value pair can be bg-grey-1 (color name):#121212 (color value); it can also be bg-grey-2 (color name):#161616 (color value), etc.
[0084] It is understandable that in some implementations, within the same app, since multiple pages use colors that follow the same design specifications, each page of the same app can correspond to a single color value file. In other implementations, for the same app, some pages can follow the same design specifications and correspond to one color value file, while other pages can follow the same design specifications and correspond to a different color value file. Therefore, depending on actual design requirements, the same app can correspond to at least one color value file; for example, the same app can correspond to color value file 1, color value file 2, and color value file 3.
[0085] Furthermore, since the color value information corresponding to each page is a subset of the color value information contained in the color value file, and the subsets corresponding to each page are different, for example, color value file 1 corresponds to pages A, B, and C; color value file 2 corresponds to pages D and E. The target color value file 1 has 50 color key-value pairs. When skinning page A, page A only needs to use 20 of the color key-value pairs; when skinning page B, page B only needs to use 40 of the color key-value pairs; and page C only needs to use 30 of the color key-value pairs. In this way, multiple pages (A, B, C) can share the same color value file 1, thus realizing the reuse of color value files.
[0086] S102, based on the target color value file, adjust the current display color of the target page to the target display color, wherein the target display color is determined by the subset in the target color value file corresponding to the target page.
[0087] It can be understood that adjusting the current display color of the target page to the target display color means adjusting the current skin style of the target page to the target skin style, that is, changing the skin of the target page.
[0088] For example, a user can adjust the skin on a target page of a target application on a terminal. For instance, by triggering (clicking) a skin adjustment icon on the target page, multiple skins to be selected are displayed on the target page. After the user selects a target skin (e.g., a dark skin, a spring-themed skin, a winter-themed skin, etc.) from the multiple skins to be selected, a color adjustment instruction for the target page is generated. The color adjustment instruction carries a target file identifier corresponding to the target skin. Since the target application to which the target page belongs corresponds to at least one color value file, and each color value file has a file identifier, the target file identifier can be compared with the file identifier of at least one color value file in the local cache. In this way, the target color value file can be determined and injected into the target page. Thus, based on the subset of the target color value file that corresponds to the target page, the current display color of the target page can be adjusted to the target display color.
[0089] It should be noted that, since the page skin may also include static elements such as background images or controls, in this embodiment, these static elements can be deployed in other ways, such as storing them separately and loading them separately during page rendering, which will not be described in detail here. In some embodiments, the color value file may also include static elements such as background images and controls, and the page skin can be adjusted as a whole based on this color value file during page display.
[0090] It's understandable that after obtaining the target color value file, it can be injected into the page, thereby adjusting the current display color of the target page to the target display color. Based on the above, it's clear that for the same color value file, since the color value information (a subset of the color value file) differs between different pages, the displayed colors of each page will also differ after adjusting the colors based on the same color value file.
[0091] In this embodiment, the target color value file is retrieved from the local cache and injected into the target page to adjust the page's display color. This eliminates the need for developers to compile and deploy color value files for each page. As a result, page development costs are saved, the process of adjusting page display colors is simplified, and the efficiency of adjusting page display colors is improved.
[0092] Furthermore, in this embodiment, since each color value file corresponds to multiple pages, and the color value information corresponding to each page is a subset of the color value information contained in the color value file, and the subsets corresponding to different pages are also different, multiple pages can share the same color value file, thereby realizing the reuse of color value files. Compared with the technical solution in related technologies where a separate request for the color value file corresponding to each page is required for each display color adjustment, the same color value file only needs to be loaded once during the page display color adjustment process. That is, it is not necessary to load it repeatedly for each skin change. In this way, the loading cost of color value files can be reduced, the reusability of color value files can be realized, and the convenience of page display color adjustment can be improved, thereby reducing user data consumption and improving user experience.
[0093] Optionally, when initially loading the target color value file, a progressive loading method can be used. That is, based on the user-selected target display color (target skin), color key-value pairs related to the target skin can be loaded first, and other color key-value pairs can be loaded during idle time. Finally, the target color value file is obtained and injected through the WebView container. It should be noted that "initially loading the target color value file" here refers to loading the target color value file into the local cache for the first time if it is not already present in the local cache.
[0094] Alternatively, since each page uses at least a portion of the color key-value pairs from the same target color value file, in the process of adjusting the display color of the target page, in addition to injecting the entire target color value file as described in the above embodiments, the target color key-value pairs required by the target page can also be determined from the target color value file for adjustment. Specifically, when adjusting the current display color of the target page to the target display color based on the target color value file, multiple target color key-value pairs matching the page file identifier can be determined from multiple color key-value pairs in the target color value file based on the page identifier, and these multiple target color key-value pairs can be injected into the target page to adjust the current display color of the target page to the target display color. The page identifier is used to indicate the color key-value pairs required to adjust the target display color.
[0095] Based on the above example, if a user selects a spring-themed skin, the spring-themed skin corresponds to target color value file 1, and target color value file 1 corresponds to pages A, B, and C. Target color value file 1 contains 100 color key-value pairs. When adjusting the display color of page A, if the page identifier indicates that the currently adjusted target skin style (spring-themed skin) only requires 20 color key-value pairs from target color value file 1, then only these 20 color key-value pairs need to be extracted from the 100 color key-value pairs in target color value file 1, and injected into the page through the Webview container. Similarly, when adjusting the display color of page B, if the target display color represented by the target file identifier only contains 50 color key-value pairs from target color value file 1, then these 50 color key-value pairs need to be extracted from the 100 color key-value pairs in target color value file 1, and injected into the page through the Webview container. This achieves the skin adjustment of the page.
[0096] In the above implementation, if the target color value file exists in the local cache, subsequent display color adjustment steps can be performed based on the target color value file. If the target color value file does not exist in the local cache, it needs to be obtained through other means. For details, please refer to [link to relevant documentation]. Figure 3 The diagram shows another page display method provided in this disclosure, which includes the following steps S201 to S206:
[0097] S201, in response to the color adjustment instruction for the target page, search the local cache for a target color value file corresponding to the target file identifier based on the target file identifier carried in the color adjustment instruction; if yes, proceed to step S202, otherwise proceed to step S204.
[0098] The target application to which the target page belongs corresponds to at least one color value file, each color value file corresponds to multiple pages, and the color value information corresponding to each page is a subset of the color value information contained in the color value file.
[0099] The description of step S201 is similar to that of step S101 in the above embodiment, and will not be repeated here.
[0100] S202, Based on the target color value file, adjust the current display color of the target page to the target display color.
[0101] The target display color is determined by a subset of the target color value file corresponding to the target page.
[0102] The description of step S202 is similar to that of step S102 in the above embodiments, and will not be repeated here.
[0103] S203, search the local cached address file for a target network address that matches the target file identifier. The address file contains at least one network address, and each network address corresponds to a file identifier. If yes, proceed to step S204; otherwise, proceed to step S205.
[0104] The network address mentioned here is a Content Delivery Network (CDN) address, and each CDN address stores a corresponding color value file in its storage space. Furthermore, the process of the management platform publishing the color value file to the CDN address and the communication process between the management platform and the terminal will be explained later.
[0105] It is understandable that the local cache stores both color value files and network addresses, and each network address also has a corresponding file identifier. Therefore, if the target color value file is not found in the local cache, the target file identifier can be compared with the file identifier of at least one network address in the address file of the local cache to find the target network address from at least one network address.
[0106] S204, retrieve the target color value file from the storage space corresponding to the target network address obtained from the local cache.
[0107] It is understandable that after determining the target network address from the local cache, the target color value file can be obtained from the storage space corresponding to the target network address, and then the subsequent page display color adjustment process can be executed.
[0108] In some implementations, after obtaining the target color value file, the target color value file can be cached. Since one color value file corresponds to multiple pages, caching the target color value file locally can be used to adjust the display colors of other pages. In this way, the reusability of the target color value file can be achieved among various pages. Furthermore, during the process of adjusting the display colors of other pages, the target color value file can be searched from the local cache first, thereby improving the efficiency of file search.
[0109] S205, check from the management platform whether there is a target network address that matches the target file identifier. The management platform is used to store each published color value file to a preset storage space and generate a network address corresponding to each color value file. If yes, proceed to step S206; otherwise, proceed to step S207.
[0110] S206, retrieve the target color value file from the storage space corresponding to the target network address obtained from the management platform, and return to step S202.
[0111] It is understandable that, since the management platform generates a network address corresponding to each color value file, if a target network address matching the target file identifier is not found in the locally cached address file, the terminal can communicate with the management platform and search for a target network address matching the target file identifier in the management platform. In response to finding a target network address matching the target file identifier in the management platform, the terminal can obtain the target network address from the management platform and obtain the target color value file from the storage space corresponding to the target network address. Then, based on the target color value file, the current display color of the target page is adjusted to the target display color.
[0112] Optionally, after obtaining the target network address and target color value file, the target network address obtained from the management platform can be cached. This way, it is not necessary to repeatedly search the management platform when displaying other pages, which helps to save system resources and improves the reusability of the target network address.
[0113] Furthermore, in addition to caching the target network address, the target color value file obtained from the storage space corresponding to the target network address can also be cached. In this way, when adjusting the display color of other pages corresponding to the target color value file, the target color value file can be searched in the local cache first, which helps to improve search efficiency and save system resources, and also improves the reusability of the target color value file.
[0114] S207, obtain the default color value file, and based on the default color value file, adjust the current display color of the target page to the default display color. The default display color is determined by the subset of the default color value file corresponding to the target page, and return to step S202.
[0115] It is understandable that if it is determined that there is no target network address in the management platform that matches the target file identifier, then a default color value file can be obtained, and based on the default color value file, the current display color of the target page can be adjusted to the default display color. In this way, the normal setting of the target page skin can be ensured, thereby improving the user experience.
[0116] The default color value file can be stored in a local cache or in a network address, and there is no limitation on this.
[0117] The following section details the communication process between the management platform and the terminal. In some implementations, after developers publish color value files through the management platform, the management platform generates a network address corresponding to each color value file. The management platform then sends each network address to the terminal, which caches the network addresses locally.
[0118] Alternatively, the management platform can store the generated network addresses without sending each network address to the terminal. After determining the target file identifier, it can search for the target network address matching the target file identifier in the management platform based on the communication connection between the terminal and the management platform, and cache it. This saves local cache storage space. In this embodiment, when multiple color value files need to be updated simultaneously, developers only need to publish each color value file to the preset storage space through the management platform. This simplifies the color value file update process and improves the efficiency of color value file updates.
[0119] In some implementations, if the number of color value files and / or network addresses in the local cache is large, the usage attributes of the color value files and / or network addresses can be determined. These usage attributes include at least one of the number of uses and the duration of use. In response to the usage attributes of the color value files and / or network addresses not meeting a preset condition, the color value files and / or network addresses are cleared from the local cache. For example, if it is determined that the number of uses of color value file A1 in the local cache is zero, color value file A1 can be cleared from the local cache to save storage space.
[0120] In other implementations, if the local cache contains both the target color value file and the target network address corresponding to the target color value file, the target network address can be cleared to save storage space in the local cache.
[0121] Those skilled in the art will understand that, in the above-described method of the specific implementation, the order in which each step is written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.
[0122] Based on the same technical concept, this disclosure also provides a page display device corresponding to the page display method. Since the principle of the device in this disclosure for solving the problem is similar to the page display method described above in this disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.
[0123] Reference Figure 4The diagram shown is a schematic representation of a page display device 400 provided in an embodiment of this disclosure. The device includes:
[0124] The color value file lookup module 410 is used to respond to a color adjustment instruction for a target page and look up a target color value file corresponding to the target file identifier carried in the color adjustment instruction from the local cache; the target application to which the target page belongs corresponds to at least one color value file, each color value file corresponds to multiple pages, and the color value information corresponding to each page is a subset of the color value information contained in the color value file;
[0125] The display color adjustment module 420 is used to adjust the current display color of the target page to the target display color based on the target color value file. The target display color is determined by the subset of the target color value file corresponding to the target page.
[0126] Please see Figure 5 This is a schematic diagram of another page display device 400 provided in an embodiment of this disclosure. The page display device further includes a network address lookup module 430, which is used for:
[0127] If the target color value file does not exist in the local cache, the address file in the local cache is searched for a target network address that matches the target file identifier. The address file contains at least one network address, and each network address corresponds to a file identifier.
[0128] The color value file lookup module 410 is specifically used for:
[0129] The target color value file is obtained from the storage space corresponding to the target network address.
[0130] In one possible implementation, the color value file lookup module 410 is specifically used for:
[0131] The target color value file is obtained from the storage space corresponding to the target network address, and the target color value file is cached locally.
[0132] In one possible implementation, the network address lookup module 430 is further configured to:
[0133] If the target network address is not found in the address file, the management platform searches for the target network address that matches the target file identifier. The management platform is used to store each published color value file to a preset storage space and generate a network address corresponding to each color value file.
[0134] The color value file lookup module 410 is specifically used for:
[0135] In response to finding the target network address from the management platform, the target color value file is retrieved from the storage space corresponding to the target network address.
[0136] In one possible implementation, the network address lookup module 430 is specifically used for:
[0137] Obtain the target network address from the management platform and cache the target network address locally;
[0138] The color value file lookup module 410 is specifically used for:
[0139] In response to finding the target network address from the management platform, the target color value file is retrieved from the storage space corresponding to the target network address, and the target color value file is cached locally.
[0140] In one possible implementation, the color value file acquisition module 410 is further configured to:
[0141] In response to the failure to find the target network address in the management platform, a default color value file is obtained, and based on the default color value file, the current display color of the target page is adjusted to the default display color, wherein the default display color is determined by a subset of the default color value file corresponding to the target page.
[0142] In one possible implementation, the page display device further includes a local cache clearing module 440, the local cache clearing module 440 being used for:
[0143] For each color value file and / or each network address in the local cache, determine the usage attributes of the color value file and / or the network address; the usage attributes include at least one of the number of times used and the duration of use;
[0144] In response to the fact that the usage attributes of the color value file and / or the network address do not meet the preset conditions, the color value file and / or the network address are cleared from the local cache.
[0145] The processing flow of each module in the device and the interaction flow between each module can be referred to the relevant descriptions in the above method embodiments, and will not be detailed here.
[0146] Based on the same technical concept, this disclosure also provides an electronic device. (See also...) Figure 6The diagram shows the structure of an electronic device 600 provided in this embodiment of the present disclosure, including a processor 601, a memory 602, and a bus 603. The memory 602 stores execution instructions and includes a main memory 6021 and an external memory 6022. The main memory 6021, also called internal memory, is used to temporarily store computational data in the processor 601, as well as data exchanged with external memory 6022 such as a hard disk. The processor 601 exchanges data with the external memory 6022 through the main memory 6021.
[0147] In this embodiment, the memory 602 is specifically used to store application code that executes the solution of this application, and its execution is controlled by the processor 601. That is, when the electronic device 600 is running, the processor 601 communicates with the memory 602 through the bus 603, so that the processor 601 executes the application code stored in the memory 602, and then executes the method described in any of the foregoing embodiments.
[0148] The memory 602 may be, but is not limited to, random access memory (RAM), read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), etc.
[0149] Processor 601 may be an integrated circuit chip with signal processing capabilities. The aforementioned processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor can be a microprocessor or any conventional processor.
[0150] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 600. In other embodiments of this application, the electronic device 600 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0151] This disclosure also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the page display method described in the above method embodiments. The storage medium may be a volatile or non-volatile computer-readable storage medium.
[0152] This disclosure also provides a computer program product carrying program code. The program code includes instructions that can be used to execute the steps of the page display method in the above method embodiments. For details, please refer to the above method embodiments, which will not be repeated here.
[0153] The aforementioned computer program product can be implemented through hardware, software, or a combination thereof. In one optional embodiment, the computer program product is specifically embodied in a computer storage medium; in another optional embodiment, the computer program product is specifically embodied in a software product, such as a software development kit (SDK), etc.
[0154] Those skilled in the art will readily understand that, for the sake of convenience and brevity, the specific working processes of the systems and devices described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. In the several embodiments provided in this disclosure, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division; in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the displayed or discussed mutual couplings or direct couplings or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.
[0155] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0156] In addition, the functional units in the various embodiments of this disclosure can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0157] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory, random access memory, magnetic disks, or optical disks.
[0158] Finally, it should be noted that the above-described embodiments are merely specific implementations of this disclosure, used to illustrate the technical solutions of this disclosure, and not to limit it. The protection scope of this disclosure is not limited thereto. Although this disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this disclosure. Such modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this disclosure, and should all be covered within the protection scope of this disclosure. Therefore, the protection scope of this disclosure should be determined by the protection scope of the claims.
Claims
1. A page display method characterized by comprising: include: In response to a color adjustment instruction for a target page, the target color value file corresponding to the target file identifier carried in the color adjustment instruction is searched from the local cache. The target application to which the target page belongs corresponds to at least one color value file, each color value file corresponds to multiple pages, and the color value information corresponding to each page is a subset of the color value information contained in the color value file; Based on the target color value file, the current display color of the target page is adjusted to the target display color, which is determined by the subset of the target color value file corresponding to the target page. The step of searching for the target color value file corresponding to the target file identifier carried in the color adjustment instruction from the local cache includes: comparing the target file identifier with the file identifiers of at least one color value file in the local cache to determine the target color value file. The step of adjusting the current display color of the target page to the target display color based on the target color value file includes: determining multiple target color key-value pairs that match the page identifier from multiple color key-value pairs in the target color value file based on the page identifier, injecting the multiple target color key-value pairs into the target page, and adjusting the current display color of the target page to the target display color, wherein the page identifier is used to indicate the color key-value pairs required to adjust the target display color.
2. The method of claim 1, wherein, Before adjusting the current display color of the target page to the target display color based on the target color value file, the method further includes: If the target color value file does not exist in the local cache, the address file in the local cache is searched for a target network address that matches the target file identifier. The address file contains at least one network address, and each network address corresponds to a file identifier. The target color value file is obtained from the storage space corresponding to the target network address.
3. The method of claim 2, wherein, The step of obtaining the target color value file from the storage space corresponding to the target network address includes: The target color value file is obtained from the storage space corresponding to the target network address, and the target color value file is cached locally.
4. The method of claim 2, wherein, The method further includes: If the target network address is not found in the address file, the management platform searches for the target network address that matches the target file identifier. The management platform is used to store each published color value file to a preset storage space and generate a network address corresponding to each color value file. In response to finding the target network address from the management platform, the target color value file is retrieved from the storage space corresponding to the target network address.
5. The method of claim 4, wherein, The step of searching for the target network address that matches the target file identifier from the management platform includes: Obtain the target network address from the management platform and cache the target network address locally; The step of retrieving the target network address from the management platform and obtaining the target color value file from the storage space corresponding to the target network address includes: In response to finding the target network address from the management platform, the target color value file is retrieved from the storage space corresponding to the target network address, and the target color value file is cached locally.
6. The method of claim 4, wherein, The method further includes: In response to the failure to find the target network address in the management platform, a default color value file is obtained, and based on the default color value file, the current display color of the target page is adjusted to the default display color, wherein the default display color is determined by a subset of the default color value file corresponding to the target page.
7. The method according to any of claims 2-6, characterized by, The method further includes: For each color value file and / or each network address in the local cache, determine the usage attributes of the color value file and / or the network address; the usage attributes include at least one of the number of times used and the duration of use; In response to the fact that the usage attributes of the color value file and / or the network address do not meet the preset conditions, the color value file and / or the network address are cleared from the local cache.
8. A page display device characterized by comprising: include: The color value file lookup module is used to respond to a color adjustment instruction for a target page and search for the target color value file corresponding to the target file identifier carried in the color adjustment instruction from the local cache. The target application to which the target page belongs corresponds to at least one color value file, each color value file corresponds to multiple pages, and the color value information corresponding to each page is a subset of the color value information contained in the color value file; The display color adjustment module is used to adjust the current display color of the target page to a target display color based on the target color value file. The target display color is determined by a subset of the target color value file corresponding to the target page. The step of searching for the target color value file corresponding to the target file identifier carried in the color adjustment instruction from the local cache includes: comparing the target file identifier with the file identifiers of at least one color value file in the local cache to determine the target color value file. The step of adjusting the current display color of the target page to the target display color based on the target color value file includes: determining multiple target color key-value pairs that match the page identifier from multiple color key-value pairs in the target color value file based on the page identifier, injecting the multiple target color key-value pairs into the target page, and adjusting the current display color of the target page to the target display color, wherein the page identifier is used to indicate the color key-value pairs required to adjust the target display color.
9. An electronic device, comprising: include: The device includes a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, they perform the steps of the page display method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the page display method as described in any one of claims 1-7.
Citation Information
Patent Citations
Page color adjustment method and device, storage medium and electronic equipment
CN114611030A
