Thematic skin switching method, apparatus, device, medium, and product

By employing a triple caching mechanism and a cross-process event notification mechanism, the poor user experience of switching personalized theme skins has been resolved, achieving efficient and seamless theme skin switching and improving user experience and system performance.

CN122086503APending Publication Date: 2026-05-26安徽爱学教育科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
安徽爱学教育科技有限公司
Filing Date
2025-12-02
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

Existing technology cannot meet users' needs for personalized theme skins, resulting in a poor user experience.

Method used

A triple caching mechanism (memory cache, disk cache, and network cache) is used to prioritize the acquisition of target skin packages, and the theme skins can be flexibly switched through parsing and resource proxy layers, including a cross-process event notification mechanism to ensure synchronous updates.

Benefits of technology

It enables flexible acquisition of personalized theme skins for users, improves user experience, reduces the complexity of multi-platform development, eliminates visual flickering and lag, and improves the efficiency of theme skin switching.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122086503A_ABST
    Figure CN122086503A_ABST
Patent Text Reader

Abstract

This application discloses a theme skin switching method, apparatus, device, medium, and product. The method includes: receiving a theme skin switching instruction; obtaining a target skin package matching the theme skin switching instruction using the priority of cached data in a preset caching mechanism; and switching the theme skin of the target interface to the target theme skin based on the target skin package. This application obtains the target skin package matching the theme skin switching instruction by using the priority of cached data in a preset caching mechanism, which can flexibly obtain personalized theme skins for users and improve user experience. Furthermore, this application reduces the complexity of multi-terminal development, eliminates the need to restart or refresh the page, completely eliminates visual flickering and lag, and improves the efficiency of theme skin switching.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and more specifically, to a method, apparatus, device, medium, and product for switching theme skins. Background Technology

[0002] With the increasing popularity of mobile applications, users' demand for personalized themes is growing, especially in scenarios such as holiday themes and promotional activities. It is necessary to support dynamic switching of themes and cover both the native APP and embedded H5 pages.

[0003] Currently, for theme skin switching, multiple resource directories can be pre-set within the app, and the corresponding skin package can be loaded through the resource manager to achieve theme skin switching.

[0004] However, the pre-configured resources in the above methods cannot meet users' personalized needs, resulting in a poor user experience. Summary of the Invention

[0005] The main purpose of this application is to provide a method, device, equipment, medium and product for switching theme skins, which can flexibly obtain personalized theme skins for users and improve user experience.

[0006] To achieve the above objectives, firstly, this application provides a theme skin switching method, including: Receive theme skin switching instructions; Utilize the cache priority in the preset caching mechanism to obtain the target skin package that matches the theme skin switching command; Based on the target skin pack, switch the theme skin in the target interface to the target theme skin.

[0007] In one embodiment, the preset caching mechanism is configured with a triple caching mechanism of memory caching, disk caching and network caching, with memory caching having the first priority, disk caching having the second priority and network caching having the third priority, and the priority of the first priority, the second priority and the third priority decreasing in sequence.

[0008] In one embodiment, the target skin package matching the theme skin switching command is obtained by utilizing the cache priority in a preset caching mechanism, including: Determine if a target skin package matching the theme skin switching command exists in the memory cache; If a target skin package matching the theme skin switching command exists in the memory cache, retrieve the target skin package matching the theme skin switching command.

[0009] In one embodiment, the method further includes: If the target skin package that matches the theme skin switching instruction is not found in the memory cache, check if the target skin package that matches the theme skin switching instruction is found in the disk cache. If a target skin package matching the theme skin switching command exists in the disk cache, retrieve the target skin package matching the theme skin switching command.

[0010] In one embodiment, the method further includes: If the target skin package that matches the theme skin switching command is not found in the disk cache, check if the target skin package that matches the theme skin switching command is found in the network cache. If a target skin package matching the theme skin switching command exists in the network cache, retrieve the target skin package matching the theme skin switching command.

[0011] In one embodiment, the method further includes: If the target skin package that matches the theme skin switching command is not found in the network cache, retrieve the target skin package that matches the theme skin switching command from the cloud.

[0012] In one implementation, retrieving a target skin package matching the theme skin switching command from the cloud includes: Send an HTTP request to the cloud; Receive the target skin package that matches the theme skin switching command from the cloud based on an HTTP request.

[0013] In one embodiment, switching the theme skin of the target interface to the target theme skin based on the target skin package includes: The target skin package is parsed to obtain the configuration file, which stores skin resource values ​​and resource identifiers that match the target theme in the form of key-value pairs; Retrieve skin resource values ​​from the configuration file; Obtain the corresponding resource identifier based on the skin resource value; The target theme skin is obtained based on the resource identifier, and the theme skin in the target interface is switched to the target theme skin.

[0014] In one embodiment, the method further includes: Listen for the target event, where the target event indicates that the theme skin in the target interface will be switched to the target theme skin; Update the style of controls in the target interface that match the target theme skin based on the target event.

[0015] Secondly, embodiments of this application provide a theme skin switching device, including: The receiving module is used to receive theme skin switching instructions; The acquisition module is used to obtain the target skin package that matches the theme skin switching command by utilizing the priority of the cache in the preset caching mechanism; The switching module is used to switch the theme skin in the target interface to the target theme skin based on the target skin package.

[0016] Thirdly, embodiments of this application provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of any of the methods described above.

[0017] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of any of the methods described above.

[0018] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the methods described above.

[0019] This application provides a theme skin switching method, apparatus, device, medium, and product, including: first receiving a theme skin switching instruction; then, using the priority of caching in a preset caching mechanism to obtain a target skin package matching the theme skin switching instruction; and finally, based on the target skin package, switching the theme skin of the target interface to the target theme skin. This application obtains the target skin package matching the theme skin switching instruction by using the priority of caching in a preset caching mechanism, which can flexibly obtain personalized theme skins for users and improve user experience. Furthermore, this application reduces the complexity of multi-terminal development, eliminates the need to restart or refresh the page, completely eliminates visual flickering and lag, and improves the efficiency of theme skin switching. Attached Figure Description

[0020] The accompanying drawings, which form part of this application, are used to provide a further understanding of the application and to make other features, objects, and advantages of the application more apparent. The illustrative embodiments and descriptions of this application are used to explain the application and do not constitute an undue limitation of the application. In the drawings: Figure 1 This is a schematic diagram of a theme skin switching method provided in an embodiment of this application; Figure 2 This is a flowchart illustrating another theme skin switching method provided in an embodiment of this application; Figure 3 This is a schematic diagram of the structure of a cache management engine provided in an embodiment of this application; Figure 4 This is a flowchart illustrating a caching strategy provided in an embodiment of this application; Figure 5This is a schematic diagram of the structure of a theme rendering engine provided in an embodiment of this application; Figure 6 This is a schematic diagram of the structure of a resource management engine provided in an embodiment of this application; Figure 7 This is a schematic diagram of a lightweight skin pack provided in an embodiment of this application; Figure 8 This is a schematic diagram of the structure of a theme skin switching device provided in an embodiment of this application; Figure 9 This is a schematic diagram of the computer device provided in the embodiments of this application. Detailed Implementation

[0021] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0022] The terms "first," "second," "third," "fourth," etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein.

[0023] In the embodiments of this application, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0024] It should be understood that in the various embodiments of this application, the sequence number of each process does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0025] It should be understood that in this application, "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to such process, method, product or device.

[0026] It should be understood that in this application, "multiple" refers to two or more. "And / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, "and / or B" can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "Contains A, B, and C", "Contains A, B, and C" means that all three A, B, and C are contained; "Contains A, B, or C" means that one of A, B, and C is contained; "Contains A, B, and / or C" means that any one, two, or three of A, B, and C are contained.

[0027] It should be understood that in this application, "B corresponding to A", "B corresponding to A", "A corresponds to B", or "B corresponds to A" means that B is associated with A, and B can be determined based on A. Determining B based on A does not mean determining B solely based on A; B can also be determined based on A and / or other information. Matching A and B is defined as a similarity between A and B that is greater than or equal to a preset threshold.

[0028] Depending on the context, "if" as used here can be interpreted as "when," "when," "in response to determination," or "in response to detection."

[0029] The data involved in this application may be data authorized by the tester or fully authorized by all parties. The collection, dissemination, and use of the data shall comply with the relevant laws, regulations and standards of the relevant countries and regions. The implementation methods / executives of this application may be combined with each other.

[0030] The technical solutions of this application will be described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.

[0031] The present application will now be described in conjunction with the accompanying drawings and specific embodiments.

[0032] Please see Figure 1 , Figure 1 This is a flowchart illustrating a theme skin switching method provided in an embodiment of this application. Figure 1 As shown, it includes the following steps: Step S101: Receive theme skin switching command.

[0033] like Figure 2 As shown, when using a certain app within a certain application, a user wants to change the current theme to the "Chinese New Year theme". The user manually triggers the switching command and enters the "Theme Settings" page of the app, which displays several available theme options (such as the default theme, the Chinese New Year theme, and the Mid-Autumn Festival theme).

[0034] When a user browses and clicks the preview image or the switch button for the "Spring Festival Theme," the app interface immediately detects the click and generates a theme skin switching instruction. This instruction contains the identifier of the target skin (such as skinId="spring_festival") and is passed to the local theme engine (DThemeEngine). After receiving the instruction, the theme engine initiates the subsequent skin loading and switching process.

[0035] Step S102: Utilize the priority of the cache in the preset caching mechanism to obtain the target skin package that matches the theme skin switching command.

[0036] like Figure 3 As shown, the default caching mechanism in this application is executed by the cache management engine. This default caching mechanism includes a triple caching system: memory cache, disk cache, and network cache. Memory cache has the highest priority, followed by disk cache, and then network cache. The priorities of the first, second, and third priorities decrease sequentially. Table 1 lists the storage content, priority, and eviction policy of the memory cache, disk cache, and network cache.

[0037] Table 1 Preset caching mechanisms

[0038] It should be noted that memory cache and disk cache are local caches.

[0039] Using the cache priority in the preset caching mechanism, the target skin package that matches the theme skin switching command is obtained, including: first, it is necessary to determine whether there is a target skin package that matches the theme skin switching command in the memory cache; if there is a target skin package that matches the theme skin switching command in the memory cache, the target skin package that matches the theme skin switching command is obtained; if there is no target skin package that matches the theme skin switching command in the memory cache, it is necessary to determine whether there is a target skin package that matches the theme skin switching command in the disk cache.

[0040] If a target skin package matching the theme skin switching command exists in the disk cache, retrieve the target skin package matching the theme skin switching command; if no target skin package matching the theme skin switching command exists in the disk cache, determine whether a target skin package matching the theme skin switching command exists in the network cache.

[0041] If a target skin package matching the theme skin switching command exists in the network cache, retrieve the target skin package matching the theme skin switching command; if no target skin package matching the theme skin switching command exists in the network cache, retrieve the target skin package matching the theme skin switching command from the cloud.

[0042] The process of obtaining the target skin package that matches the theme skin switching command from the cloud includes: sending an HTTP request to the cloud; and receiving the target skin package that matches the theme skin switching command from the cloud based on the HTTP request.

[0043] Specifically, such as Figure 4 As shown, the execution process for obtaining the target skin package through the preset caching mechanism, which includes a triple caching mechanism of memory caching, disk caching, and network caching, is as follows: 1. Query memory cache (first priority): The theme engine first quickly searches the memory cache to see if skin package data (including parsed JSON mapping tables and decoded WebP resources) with the identifier "spring_festival" exists.

[0044] Scenario 1: Memory cache hit. For example, a user may have just used this Chinese New Year theme a few minutes ago, and its resources are still in memory. In this case, the theme engine will immediately retrieve all the data of the target skin package from the memory cache and load it directly into the "background resource pool" for switching. This process takes a very short time, usually less than 10 milliseconds.

[0045] Scenario 2: Memory cache miss. As shown in this example, assume this is the first time a user has switched to this skin, or the skin data has been evicted from the memory cache due to long-term inactivity. In this case, the engine switches to the next priority disk cache for lookup.

[0046] 2. Query disk cache (second priority): The theme engine then searches the device's disk cache. The disk cache stores complete skin pack ZIP files and parsed JSON files that the user may have previously downloaded.

[0047] Scenario 1: Disk cache hit. For example, the "Spring Festival Theme" skin pack may have been silently downloaded to the local device during a previous promotional push, but the user has not yet activated it. The engine finds the corresponding ZIP file in the disk cache, decompresses it, parses the JSON configuration and WebP images, and loads this data into the "background resource pool." Compared to network download, this process only involves local disk read and write, and the speed is still very fast.

[0048] Scenario 2: Disk cache miss. Assume this is the first time the user's device needs this Spring Festival theme, and it has never been downloaded locally. In this case, the engine will continue to query the network cache according to priority.

[0049] 3. Query network cache (third priority): The theme engine then checks the network cache. This network cache does not refer to local device storage, but rather to intermediate caches (such as CDN edge node caches) that may exist during communication between the client and the cloud (cloud server) via HTTPS. The theme engine will then send a query request to the cloud, which may quickly return cached skin package data due to the CDN mechanism.

[0050] Situation: Network cache miss / no valid cache. For a new or recently updated skin package, the CDN may not have a cache, or the request may not be able to retrieve it from an intermediate cache. In this case, it is determined that the target skin package cannot be obtained through any level of cache, and the process of retrieving it directly from the cloud is initiated. Specifically, the download module constructs an HTTPS request (e.g., a GET request containing the target skinId="spring_festival" and client device information) and sends it to the predefined skin package download interface in the cloud.

[0051] After receiving this request, the cloud verifies its validity and then returns the corresponding lightweight "Spring Festival Theme" skin pack (ZIP format, less than 100KB in size) as a response data stream to the app.

[0052] The app's download module receives this data packet from the cloud and downloads it completely to its local machine. Subsequently, the skin package is stored in the disk cache for later use, while its contents are parsed and loaded. Figure 5 The "background resource pool" in the system is used to perform UI redrawing, animation transitions, performance optimization, and other processes during the theme skin change process.

[0053] This application embodiment utilizes a preset caching mechanism to obtain target skin packages that match the theme skin switching instructions based on caching priority. Its execution process is based on a triple caching mechanism of memory caching, disk caching, and network caching, with priority decreasing in that order. It is uniformly scheduled by the cache management engine. This multi-level caching strategy significantly reduces the latency and network overhead of skin package acquisition through priority ordering and on-demand loading mechanism, ensuring the efficiency and dynamism of theme switching. At the same time, local caching optimization reduces duplicate downloads, improving user experience and system performance.

[0054] Step S103: Based on the target skin package, switch the theme skin in the target interface to the target theme skin.

[0055] Based on the target skin package, the theme skin in the target interface is switched to the target theme skin, including: parsing the target skin package to obtain the configuration file, wherein the configuration file stores skin resource values ​​and resource identifiers that match the target theme in the form of key-value pairs; obtaining the skin resource values ​​from the configuration file; obtaining the corresponding resource identifiers based on the skin resource values; obtaining the target theme skin based on the resource identifiers, and switching the theme skin in the target interface to the target theme skin.

[0056] Specifically, such as Figure 6 The resource management engine first decompresses and parses the target skin package, extracting the configuration file stored in a lightweight data format. The core of this configuration file is that it is organized using a key-value pair structure.

[0057] like Figure 7 As shown, a lightweight skin pack, taking a single skin pack as an example, includes APP metadata, H5 metadata, and WebP format resources, which include background images, icons, etc.

[0058] The file is then parsed to read the various resource identifiers defined within and their corresponding skin resource values. Specifically, resource identifiers refer to specific visual elements in the interface (such as "main color" or "background image"), while skin resource values ​​define the specific presentation of that visual element under the "Spring Festival theme," such as a color code representing festive red, or the file path and name of a background image for a specific holiday.

[0059] All these skin resource values ​​are retrieved from the configuration file. For numerical resources such as color and font size, they are directly stored in a dynamic mapping table in memory. For image resources, the corresponding efficiently compressed image file is located from the skin package according to the path specified in the configuration, and then decoded. The renderable image data is also preloaded into the "background resource pool".

[0060] During this process, when any UI component in an application (APP) or webpage (H5) needs to obtain a visual resource (e.g., a button needs to obtain its background color, or a page needs to load its background image), the resource proxy layer intercepts this request.

[0061] The resource proxy layer analyzes the resource identifier corresponding to the request and then searches for it in the pre-built "Spring Festival Theme" mapping table based on this resource identifier. Once a match is found, the corresponding target theme skin resource is immediately obtained, such as the red color value or background image unique to the Spring Festival, and this value is dynamically returned to the UI component that made the request. The component then uses this new resource value for drawing and rendering.

[0062] Once it's confirmed that all new theme resources in the "background resource pool" have been parsed and preloaded, and that the resource proxy layer can accurately provide new resources, the theme engine activates its core double-buffering switching mechanism. This mechanism achieves instant theme switching by quickly swapping references between the "foreground resource pool" (current theme) and the "background resource pool" (Spring Festival theme). After the reference swap, the engine immediately triggers a global user interface redraw. From this moment on, all resource requests from all UI components to the resource proxy layer will receive and apply the visual elements of the "Spring Festival theme." Simultaneously, the theme change event is broadcast to the entire application and operating system. This ensures that all UI modules within the application, embedded H5 pages, and even system-level controls (such as the status bar and navigation bar) receive the new style instructions synchronously and update immediately, achieving complete visual style unification from within the application to the system level.

[0063] This application embodiment efficiently extracts configuration files organized by key-value pairs by decompressing and parsing the lightweight skin package, establishing a precise mapping between resource identifiers and skin resource values, thus achieving standardized and structured description of skin resources. Subsequently, the resource management engine directly stores the parsed numerical resources such as colors and fonts into a memory mapping table, and decodes and preloads WebP image resources into the "backend resource pool," ensuring that all necessary resources are immediately available and greatly improving the efficiency of resource preparation. Furthermore, the "resource proxy layer" intercepts resource requests between the APP and H5 pages and dynamically returns the skin resource values ​​of the target theme based on the mapping table. This enables non-intrusive control over the rendering behavior of interface components, allowing components to automatically adapt to new themes without modifying their logic. This significantly improves the maintainability and scalability of the system. In addition, the "double buffer switching mechanism" quickly swaps references between the front-end and back-end resource pools and triggers global redraw and cross-process event broadcasting. This achieves instant theme switching (with a much shorter time consumption than traditional solutions) and synchronous updates of system-level controls (such as status bars and navigation bars). As a result, while ensuring a high degree of consistency in the visual style of the APP's native parts, embedded H5 pages, and system UI, it provides users with a seamless, smooth, and flicker-free theme switching experience, comprehensively improving the product's dynamic operation capabilities and the personalized expressiveness of the user interface.

[0064] In one embodiment, the method further includes: listening to a target event, wherein the target event is used to indicate switching the theme skin in the target interface to the target theme skin; and updating the control styles in the target interface that match the target theme skin based on the target event.

[0065] Specifically, once the theme engine confirms that a new theme, such as the "Spring Festival theme," has been successfully enabled and the main interface rendering is complete, it will immediately trigger a global "Theme Changed" target event. This event is a signal indicating that the entire application (including all sub-modules and embedded content) needs to switch its theme skin to the new target theme.

[0066] Across the entire application, there exists a cross-process / cross-context notifier responsible for broadcasting this event to every part that needs to respond: On Android, this notification publishes the event through a system-provided content observer mechanism. Any component that is interested in theme changes (such as various UI elements or even proxy services for system controls) will register to listen for this event.

[0067] On iOS, the Notifier uses its centralized notification system to distribute events to all observers who have subscribed to the notification.

[0068] For embedded H5 pages, the notifier will inject a custom JavaScript event into the WebView container by executing a piece of JavaScript bridging code, ensuring that the H5 page can receive the same theme change instruction.

[0069] Once the "Theme changed" event is captured by the various listeners, the corresponding style update process is immediately initiated. For example, on Android, a dedicated service captures the event and then calls the system API to update the background color of the status bar at the top of the phone to a specific red defined in the "Spring Festival Theme" mapping table. At the same time, the color of the virtual navigation bar at the bottom of the application is also updated synchronously to ensure consistency between the system level and the application's internal style.

[0070] In-app component and H5 control updates: Within the app, each active interface (Activity / ViewController) triggers a lightweight redraw upon receiving an event. Because the resource proxy layer is already in effect, components in these interfaces (such as buttons, cards, and tabs) automatically retrieve colors and images from the new theme resource pool during the redraw, thus providing a refreshed look without requiring a restart.

[0071] In the H5 page, the script listening for this JavaScript event will execute. First, it retrieves the new values ​​(such as primary and secondary colors) of the CSS variables from the new theme configuration, and then dynamically applies these new values ​​to the document object model (DOM) styles of the entire page. This allows all visual elements in the H5 page, such as navigation bars, buttons, and backgrounds, to switch to the Chinese New Year theme style almost simultaneously with the native parts of the app.

[0072] This application's embodiments leverage a unified notification mechanism across processes and contexts to precisely deliver theme switching events to Android (via content observers), iOS (via a centralized notification system), and embedded H5 pages (via JavaScript bridge events). This ensures that every visual component, from the native application interface and system-level controls (such as the status bar and navigation bar) to embedded web content, can respond instantly and consistently to theme changes. Lightweight redraws are triggered by events rather than interface restarts or refreshes, allowing all active components to dynamically obtain style resources from the new theme resource pool based on the already activated resource proxy layer. This achieves seamless and smooth switching without interrupting user operations, completely eliminating visual flickering or lag. Simultaneously, this event-driven architecture decouples the theme engine from specific UI components, improving system maintainability and scalability, and providing an immediate and complete activation channel for the operational side to dynamically push new themes. Ultimately, while ensuring a high degree of visual consistency across platforms, it comprehensively improves the continuity of user experience, system responsiveness, and the flexibility of dynamic operations.

[0073] This application provides a theme skin switching method, including: first receiving a theme skin switching instruction; then, using the priority of caching in a preset caching mechanism to obtain a target skin package matching the theme skin switching instruction; and finally, based on the target skin package, switching the theme skin of the target interface to the target theme skin. This application obtains the target skin package matching the theme skin switching instruction by using the priority of caching in a preset caching mechanism, which can flexibly obtain personalized theme skins for users and improve user experience. Furthermore, this application reduces the complexity of multi-terminal development, eliminates the need to restart or refresh the page, completely eliminates visual flickering and lag, and improves theme skin switching efficiency.

[0074] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0075] The following are device embodiments of this application. For details not described in detail, please refer to the corresponding method embodiments described above.

[0076] Figure 8 This diagram illustrates a theme skin switching device according to an embodiment of this application. For ease of explanation, only the parts relevant to this embodiment are shown. The theme skin switching device includes: Receiver module 801 is used to receive theme skin switching instructions; The acquisition module 802 is used to acquire the target skin package that matches the theme skin switching instruction by utilizing the priority of the cache in the preset caching mechanism; The switching module 803 is used to switch the theme skin in the target interface to the target theme skin based on the target skin package.

[0077] In one embodiment, the preset caching mechanism is configured with a triple caching mechanism of memory caching, disk caching and network caching, with memory caching having the first priority, disk caching having the second priority and network caching having the third priority, and the priority of the first priority, the second priority and the third priority decreasing in sequence.

[0078] In one embodiment, the acquisition module 802 is further configured to determine whether a target skin package matching the theme skin switching instruction exists in the memory cache; If a target skin package matching the theme skin switching command exists in the memory cache, retrieve the target skin package matching the theme skin switching command.

[0079] In one embodiment, the device further includes: a first determination module, which is used to determine whether a target skin package matching the theme skin switching instruction exists in the disk cache if no target skin package matching the theme skin switching instruction exists in the memory cache; If a target skin package matching the theme skin switching command exists in the disk cache, retrieve the target skin package matching the theme skin switching command.

[0080] In one embodiment, the apparatus further includes: a second determination module, which is used to determine whether a target skin package matching the theme skin switching instruction exists in the network cache if no target skin package matching the theme skin switching instruction exists in the disk cache; If a target skin package matching the theme skin switching command exists in the network cache, retrieve the target skin package matching the theme skin switching command.

[0081] In one embodiment, the device further includes a third determination module, which is used to obtain a target skin package that matches the theme skin switching instruction from the cloud if no target skin package matching the theme skin switching instruction exists in the network cache.

[0082] In one embodiment, the third determination module is further configured to send an HTTP request to the cloud; Receive the target skin package that matches the theme skin switching command from the cloud based on an HTTP request.

[0083] In one embodiment, the switching module 803 is further configured to parse the target skin package and obtain a configuration file, wherein the configuration file stores skin resource values ​​and resource identifiers that match the target theme in the form of key-value pairs; Retrieve skin resource values ​​from the configuration file; Obtain the corresponding resource identifier based on the skin resource value; The target theme skin is obtained based on the resource identifier, and the theme skin in the target interface is switched to the target theme skin.

[0084] In one embodiment, the apparatus further includes: a control update module, which is used to listen for a target event, wherein the target event is used to indicate that the theme skin in the target interface is switched to the target theme skin; Update the style of controls in the target interface that match the target theme skin based on the target event.

[0085] This application provides a theme skin switching device, specifically used for: first receiving a theme skin switching instruction; then, using the priority of caching in a preset caching mechanism, obtaining a target skin package matching the theme skin switching instruction; and then, based on the target skin package, switching the theme skin of the target interface to the target theme skin. This application obtains the target skin package matching the theme skin switching instruction through the priority of caching in a preset caching mechanism, which can flexibly obtain personalized theme skins for users and improve user experience. Furthermore, this application reduces the complexity of multi-terminal development, eliminates the need to restart or refresh the page, completely eliminates visual flickering and lag, and improves theme skin switching efficiency.

[0086] This application Figure 9 A schematic diagram of a computer device is provided. (Example) Figure 9 As shown, the computer device 9 in this embodiment includes a processor 901, a memory 902, and a computer program 903 stored in the memory 902 and executable on the processor 901. When the processor 901 executes the computer program 903, it implements the steps in the various theme skin switching method embodiments described above, for example... Figure 1 Steps 101 to 103 are shown. Alternatively, when processor 901 executes computer program 903, it implements the functions of each module / unit in the above-described embodiments of the theme skin switching device, for example... Figure 8 The functions of modules / units 801 to 803 shown.

[0087] This application also provides a readable storage medium storing a computer program, which, when executed by a processor, is used to implement the theme skin switching method provided in the various embodiments described above.

[0088] The readable storage medium can be a computer storage medium or a communication medium. A communication medium includes any medium that facilitates the transfer of computer programs from one location to another. A computer storage medium can be any available medium accessible to a general-purpose or special-purpose computer. For example, a readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application-Specific Integrated Circuit (ASIC). Alternatively, the ASIC can be located in a user equipment. Of course, the processor and the readable storage medium can also exist as discrete components in a communication device. The readable storage medium can be a read-only memory (ROM), random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.

[0089] This application also provides a program product including executable instructions stored in a readable storage medium. At least one processor of the device can read the executable instructions from the readable storage medium, and executing the executable instructions causes the device to implement the theme skin switching methods provided in the various embodiments described above.

[0090] In the embodiments of the above-described device, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this application can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules within the processor.

[0091] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications 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 application.

Claims

1. A method for switching theme skins, characterized in that, include: Receive theme skin switching instructions; By utilizing the cache priority in the preset caching mechanism, the target skin package that matches the theme skin switching instruction is obtained; Based on the target skin package, the theme skin in the target interface is switched to the target theme skin.

2. The theme skin switching method as described in claim 1, characterized in that, The preset caching mechanism is configured with a triple caching mechanism of memory caching, disk caching and network caching. The memory cache has the first priority, the disk cache has the second priority, and the network cache has the third priority. The priority of the first priority, the second priority and the third priority decrease in sequence.

3. The theme skin switching method as described in claim 2, characterized in that, The step of obtaining the target skin package matching the theme skin switching instruction by utilizing the cache priority in the preset caching mechanism includes: Determine whether a target skin package matching the theme skin switching instruction exists in the memory cache; If a target skin package matching the theme skin switching instruction exists in the memory cache, the target skin package matching the theme skin switching instruction is obtained.

4. The theme skin switching method as described in claim 3, characterized in that, The method further includes: If the memory cache does not contain a target skin package that matches the theme skin switching instruction, determine whether the disk cache contains a target skin package that matches the theme skin switching instruction; If a target skin package matching the theme skin switching instruction exists in the disk cache, the target skin package matching the theme skin switching instruction is obtained.

5. The theme skin switching method as described in claim 4, characterized in that, The method further includes: If the disk cache does not contain a target skin package that matches the theme skin switching instruction, determine whether the network cache contains a target skin package that matches the theme skin switching instruction; If a target skin package matching the theme skin switching instruction exists in the network cache, obtain the target skin package matching the theme skin switching instruction.

6. The theme skin switching method as described in claim 5, characterized in that, The method further includes: If no target skin package matching the theme skin switching instruction is found in the network cache, the target skin package matching the theme skin switching instruction is obtained from the cloud.

7. The theme skin switching method as described in claim 6, characterized in that, The step of retrieving the target skin package that matches the theme skin switching command from the cloud includes: Send an HTTP request to the cloud; Receive the target skin package that matches the theme skin switching instruction from the cloud based on the HTTP request.

8. The theme skin switching method as described in claim 1, characterized in that, The step of switching the theme skin of the target interface to the target theme skin based on the target skin package includes: The target skin package is parsed to obtain a configuration file, wherein the configuration file stores skin resource values ​​and resource identifiers that match the target theme in the form of key-value pairs; Obtain the skin resource value from the configuration file; Obtain the corresponding resource identifier based on the skin resource value; The target theme skin is obtained based on the resource identifier, and the theme skin in the target interface is switched to the target theme skin.

9. The theme skin switching method as described in claim 1, characterized in that, The method further includes: Listen for target events, wherein the target events are used to indicate that the theme skin in the target interface is switched to the target theme skin; Update the control styles in the target interface that match the target theme skin based on the target event.

10. A theme skin switching device, characterized in that, include: The receiving module is used to receive theme skin switching instructions; The acquisition module is used to acquire the target skin package that matches the theme skin switching instruction by utilizing the priority of the cache in the preset caching mechanism; The switching module is used to switch the theme skin in the target interface to the target theme skin based on the target skin package.

11. A computer device, characterized in that, Includes a memory, and one or more processors communicatively connected to the memory; The memory stores instructions that can be executed by the one or more processors to cause the one or more processors to implement the theme skin switching method as described in any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that, Includes a program or instructions that, when run on a computer, implement the theme skin switching method of any one of claims 1 to 9.

13. A computer program product, characterized in that, The system includes a computer program that, when executed by a processor, implements the theme skin switching method according to any one of claims 1 to 9.